From e8f9af534bf02a9bf3926e37c4fd06517ceba9bb Mon Sep 17 00:00:00 2001 From: chenxing Date: Sat, 10 Oct 2026 19:17:39 +0800 Subject: [PATCH] =?UTF-8?q?feat(app):=20=E5=BA=94=E7=94=A8=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=A1=B5=EF=BC=88107=EF=BC=89+=20=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E5=AE=9A=E4=B9=89/=E7=BC=96=E8=BE=91=E5=99=A8=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E4=B8=8B=E6=8B=89=E6=94=B9=E8=AF=BB=E7=99=BD=E5=90=8D?= =?UTF-8?q?=E5=8D=95=E6=98=BE=E7=A4=BA=E5=BA=94=E7=94=A8=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - AppSetting.vue:tab1 应用管理(学校池同步说明+开关 i-switch);tab2 科室管理占位(Part E) - Defs.vue 筛选下拉与表格应用列显示 appName;编辑器归属应用下拉去 allow-create、限启用集合 - flow.ts 增 appList/appEnable(defAppKeys 保留 deprecated) --- src/api/module/flow.ts | 11 +++ src/router/routes.ts | 8 ++ src/views/flow/admin/AppSetting.vue | 93 +++++++++++++++++++++++ src/views/flow/admin/Defs.vue | 21 +++-- src/views/flow/admin/def-editor/index.vue | 16 ++-- 5 files changed, 135 insertions(+), 14 deletions(-) create mode 100644 src/views/flow/admin/AppSetting.vue diff --git a/src/api/module/flow.ts b/src/api/module/flow.ts index e7736b9..aebcc12 100644 --- a/src/api/module/flow.ts +++ b/src/api/module/flow.ts @@ -126,6 +126,17 @@ class FlowApi { defAppKeys() { return get(`${ROOT}/admin/def/appkeys`); } + + // ==================== 管理面:应用设置(2026-10-10) ==================== + + /** 应用管理列表(flw_app 白名单;附带学校池静默同步,UserBase 不可达降级本地行) */ + appList() { + return get(`${ROOT}/admin/app/list`); + } + /** 开关某应用是否对接流程(停用后 defSave 归属应用校验拦截新引用) */ + appEnable(id: number | string, enabled: boolean) { + return post(`${ROOT}/admin/app/enable`, { id, enabled }); + } defGet(id: number | string) { return get(`${ROOT}/admin/def/get`, { id }); } diff --git a/src/router/routes.ts b/src/router/routes.ts index dd2c4fc..8c32cbe 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -84,6 +84,14 @@ const routes: RouteRecordRaw[] = [ component: () => import("@/views/flow/admin/Routers.vue"), meta: { title: "条件路由", modId: 106 }, }, + { + // 应用设置(2026-10-10 四议题):tab1 应用管理(flw_app 白名单,学校池同步); + // tab2 科室管理(Part E 填充)。菜单需在 UserBase 侧配置同 path 的 app_module(custom_id=107) + path: "/admin/app-setting", + name: "flow_admin_app_setting", + component: () => import("@/views/flow/admin/AppSetting.vue"), + meta: { title: "应用设置", modId: 107 }, + }, { // 办件进度嵌入页(iframe 免签嵌入,App.vue 对 /embed/* 前缀旁路 CAS 与 layout): // 不挂菜单、无 parentId(子应用 Drawer 内打开,非管理面导航);query.token 必填 diff --git a/src/views/flow/admin/AppSetting.vue b/src/views/flow/admin/AppSetting.vue new file mode 100644 index 0000000..6a51477 --- /dev/null +++ b/src/views/flow/admin/AppSetting.vue @@ -0,0 +1,93 @@ + + + diff --git a/src/views/flow/admin/Defs.vue b/src/views/flow/admin/Defs.vue index 141c839..1beddb7 100644 --- a/src/views/flow/admin/Defs.vue +++ b/src/views/flow/admin/Defs.vue @@ -23,15 +23,16 @@ const sourceText = ref(""); const sourceTitle = ref(""); // 操作按钮区 + 表格,无搜索、无分页 const tableHeight = ref(Utils.useTableHeight({ isOperat: true })); -// 按应用筛选(flw_def.app_key,2026-10-10):下拉数据源来自 /def/appkeys -const appKeys = ref([]); +// 按应用筛选(flw_def.app_key,2026-10-10):下拉数据源来自应用设置白名单(flw_app enabled=1) +const apps = ref<{ appKey: string; appName: string }[]>([]); +const appMap = ref>({}); const filterApp = ref(""); const columns = [ { title: "序号", type: "index", width: 70, align: "center" }, { title: "流程", key: "name", minWidth: 180 }, { title: "编码", key: "code", width: 160 }, - { title: "应用", key: "appKey", width: 110, align: "center", render: (h: any, p: any) => h("span", p.row.appKey || "-") }, + { title: "应用", key: "appKey", width: 130, align: "center", render: (h: any, p: any) => h("span", p.row.appKey ? (appMap.value[p.row.appKey] || p.row.appKey) : "-") }, { title: "版本", key: "version", width: 70, align: "center" }, { title: "状态", width: 90, align: "center", render: (h: any, p: any) => { const c = p.row.status === 1 ? "green" : p.row.status === 0 ? "orange" : "gray"; @@ -68,12 +69,18 @@ async function load() { } } -/** 应用清单(筛选下拉):flw_def 已标注 ∪ 已注册回调的应用,失败降级为空下拉 */ +/** 应用清单(筛选下拉):应用设置白名单(flw_app enabled=1),失败降级为空下拉 */ async function loadAppKeys() { try { - appKeys.value = (await flowApi.defAppKeys().send()) || []; + const rows: any[] = (await flowApi.appList().send()) || []; + const enabled = rows.filter((r) => r.enabled === 1); + apps.value = enabled.map((r) => ({ appKey: String(r.appKey), appName: r.appName || String(r.appKey) })); + const map: Record = {}; + rows.forEach((r) => { if (r.appKey != null) map[String(r.appKey)] = r.appName || String(r.appKey); }); + appMap.value = map; } catch { - appKeys.value = []; + apps.value = []; + appMap.value = {}; } } @@ -175,7 +182,7 @@ onMounted(() => { diff --git a/src/views/flow/admin/def-editor/index.vue b/src/views/flow/admin/def-editor/index.vue index c66f311..a2add30 100644 --- a/src/views/flow/admin/def-editor/index.vue +++ b/src/views/flow/admin/def-editor/index.vue @@ -57,8 +57,8 @@ const sourceStatus = ref(0); const sourceVersion = ref(0); /** 归属应用(flw_def.app_key;按应用筛选维度,空=未分配) */ const appKey = ref(""); -/** 应用清单下拉(本校已标注 ∪ 已注册回调),拉取失败降级为仅手输 */ -const appKeys = ref([]); +/** 应用清单下拉(应用设置白名单 flw_app enabled=1,显示应用名),拉取失败降级为仅当前值 */ +const appOptions = ref<{ appKey: string; appName: string }[]>([]); const model = reactive(createEmptyModel()); /** 科室映射聚合(mapList):仅用于下拉选项与"无启用办理人"提示 */ @@ -177,9 +177,12 @@ async function load(): Promise { await loadDepts(); await loadRouters(); try { - appKeys.value = ((await flowApi.defAppKeys().send()) as string[]) || []; + const rows: any[] = (await flowApi.appList().send()) || []; + appOptions.value = rows + .filter((r) => r.enabled === 1) + .map((r) => ({ appKey: String(r.appKey), appName: r.appName || String(r.appKey) })); } catch { - appKeys.value = []; + appOptions.value = []; } const queryId = route.query.id ? Number(route.query.id) : null; @@ -484,9 +487,8 @@ onUnmounted(() => window.removeEventListener("beforeunload", onBeforeUnload));