- AppSetting tab2:科室表格(成员维护 Modal 复用 UserSelectInput/改名/停启用/删除)+ 拉取预览确认导入 - 编辑器科室下拉/校验数据源切 deptList(停用科室不进下拉);Maps.vue 与 104 路由删除 - flow.ts:dept 系列 API;map 系列 CRUD 删除(保留 mapLookupUser 选人检索)
This commit is contained in:
@@ -61,7 +61,7 @@ const appKey = ref("");
|
||||
const appOptions = ref<{ appKey: string; appName: string }[]>([]);
|
||||
|
||||
const model = reactive<EditorModel>(createEmptyModel());
|
||||
/** 科室映射聚合(mapList):仅用于下拉选项与"无启用办理人"提示 */
|
||||
/** 科室列表(deptList 聚合行):仅用于下拉选项与"无启用人员"提示 */
|
||||
const depts = reactive<DeptOption[]>([]);
|
||||
/** userId → 姓名快照(mapLookupUser 检索补全,失败降级 #id) */
|
||||
const userNames = reactive<Record<number, string>>({});
|
||||
@@ -120,20 +120,17 @@ const editingCondition = computed<ConditionNode | null>(() => {
|
||||
|
||||
async function loadDepts(): Promise<void> {
|
||||
try {
|
||||
const rows: any[] = (await flowApi.mapList().send()) || [];
|
||||
const grouped: Record<string, DeptOption> = {};
|
||||
rows.forEach((r) => {
|
||||
const key = r.deptKey;
|
||||
if (!key) return;
|
||||
if (!grouped[key]) grouped[key] = { deptKey: key, deptName: r.deptName || "", count: 0 };
|
||||
if (!grouped[key].deptName && r.deptName) grouped[key].deptName = r.deptName;
|
||||
// 状态 0=启用(与办理人映射页口径一致),发布校验要求至少 1 名启用办理人
|
||||
if (r.status === 0) grouped[key].count += 1;
|
||||
});
|
||||
depts.splice(0, depts.length, ...Object.values(grouped));
|
||||
// 科室管理(2026-10-10 切源):deptList 返回聚合行 {deptKey,deptName,status,count}
|
||||
const rows: any[] = (await flowApi.deptList().send()) || [];
|
||||
depts.splice(0, depts.length, ...rows.map((r) => ({
|
||||
deptKey: String(r.deptKey),
|
||||
deptName: r.deptName || "",
|
||||
// 停用科室不进编辑器下拉(与发布校验口径一致:解析不出办理人)
|
||||
count: r.status === 0 ? r.count : 0,
|
||||
})));
|
||||
} catch {
|
||||
// 映射表拉取失败不阻塞编辑:审批人下拉退化为"仅当前值",校验降级为提示
|
||||
Message.warning("办理人映射拉取失败,科室下拉可能不完整");
|
||||
// 科室拉取失败不阻塞编辑:审批人下拉退化为"仅当前值",校验降级为提示
|
||||
Message.warning("科室数据拉取失败,科室下拉可能不完整");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user