- Defs.vue:工具栏"按应用筛选"下拉(/def/appkeys 数据源,clearable/filterable)+ 应用列(空显示 -) - 编辑器:头部"应用"Select(clearable/filterable/allow-create,可手输新值),载入回显、保存透传 appKey - defList 支持 appKey 可选参数、新增 defAppKeys;新参数全部可选,与后端部署顺序无依赖
This commit is contained in:
@@ -23,11 +23,15 @@ 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[]>([]);
|
||||
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: "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";
|
||||
@@ -58,12 +62,21 @@ const columns = [
|
||||
async function load() {
|
||||
loading.value = true;
|
||||
try {
|
||||
rows.value = (await flowApi.defList().send()) || [];
|
||||
rows.value = (await flowApi.defList({ appKey: filterApp.value || undefined }).send()) || [];
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
/** 应用清单(筛选下拉):flw_def 已标注 ∪ 已注册回调的应用,失败降级为空下拉 */
|
||||
async function loadAppKeys() {
|
||||
try {
|
||||
appKeys.value = (await flowApi.defAppKeys().send()) || [];
|
||||
} catch {
|
||||
appKeys.value = [];
|
||||
}
|
||||
}
|
||||
|
||||
/** 新建:编辑器空模板(默认含一个待配置审批节点) */
|
||||
function onNew() {
|
||||
router.push({ path: "/admin/defs/editor" });
|
||||
@@ -148,7 +161,10 @@ function onDiagram(row: any) {
|
||||
router.push({ path: "/diagram", query: { defId: row.id } });
|
||||
}
|
||||
|
||||
onMounted(load);
|
||||
onMounted(() => {
|
||||
load();
|
||||
loadAppKeys();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -157,6 +173,10 @@ onMounted(load);
|
||||
<!-- 操作按钮区:主操作靠左(bsch应用页规范 §1) -->
|
||||
<div class="fix mb-12">
|
||||
<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>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
<Table :columns="columns" :data="rows" :loading="loading" class="link-table table-bottom-box"
|
||||
|
||||
Reference in New Issue
Block a user