feat(app): 应用设置页(107)+ 流程定义/编辑器应用下拉改读白名单显示应用名

- AppSetting.vue:tab1 应用管理(学校池同步说明+开关 i-switch);tab2 科室管理占位(Part E)
- Defs.vue 筛选下拉与表格应用列显示 appName;编辑器归属应用下拉去 allow-create、限启用集合
- flow.ts 增 appList/appEnable(defAppKeys 保留 deprecated)
This commit is contained in:
chenxing
2026-10-10 19:17:39 +08:00
parent acbf601e7a
commit e8f9af534b
5 changed files with 135 additions and 14 deletions
+14 -7
View File
@@ -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<string[]>([]);
// 按应用筛选(flw_def.app_key,2026-10-10):下拉数据源来自应用设置白名单(flw_app enabled=1)
const apps = ref<{ appKey: string; appName: string }[]>([]);
const appMap = ref<Record<string, string>>({});
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<string, string> = {};
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(() => {
<Button class="fl" type="primary" size="large" @click="onNew">新建流程</Button>
<Select v-model="filterApp" clearable filterable placeholder="按应用筛选" class="fl"
style="width: 200px; margin-left: 8px" @on-change="load">
<Option v-for="k in appKeys" :key="k" :value="k">{{ k }}</Option>
<Option v-for="a in apps" :key="a.appKey" :value="a.appKey">{{ a.appName }}</Option>
</Select>
</div>