|
|
@@ -13,10 +13,15 @@
|
|
|
|
|
|
<el-form :inline="true" :model="queryParams" class="search-form">
|
|
|
<el-form-item label="流程名称">
|
|
|
- <el-select v-model="queryParams.processName" placeholder="全部流程" clearable style="width: 200px;">
|
|
|
+ <el-select v-model="queryParams.processName" placeholder="全部流程" clearable style="width: 200px;" @change="onProcessChange">
|
|
|
<el-option v-for="def in definitionList" :key="def.id" :label="def.name" :value="def.name" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="当前节点">
|
|
|
+ <el-select v-model="queryParams.currentNodeId" placeholder="全部节点" clearable style="width: 160px;">
|
|
|
+ <el-option v-for="node in currentNodeOptions" :key="node.id" :label="node.name" :value="node.id" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" @click="handleQuery">查询</el-button>
|
|
|
<el-button @click="resetQuery">重置</el-button>
|
|
|
@@ -276,11 +281,30 @@ const tableData = ref<FlowTask[]>([])
|
|
|
const total = ref(0)
|
|
|
const tableRef = ref<TableInstance>()
|
|
|
const definitionList = ref<FlowDefinition[]>([])
|
|
|
+const currentNodeOptions = ref<{ id: string; name: string }[]>([])
|
|
|
+
|
|
|
+function onProcessChange() {
|
|
|
+ queryParams.currentNodeId = undefined
|
|
|
+ const def = definitionList.value.find(d => d.name === queryParams.processName)
|
|
|
+ if (def?.flowJson) {
|
|
|
+ try {
|
|
|
+ currentNodeOptions.value = JSON.parse(def.flowJson)
|
|
|
+ .nodes.filter((n: any) => n.type !== 'start' && n.type !== 'end' && n.type !== 'condition' && n.type !== 'cc')
|
|
|
+ .map((n: any) => ({ id: n.id, name: n.name }))
|
|
|
+ } catch {
|
|
|
+ currentNodeOptions.value = []
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ currentNodeOptions.value = []
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
const queryParams = reactive({
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
processName: undefined as string | undefined,
|
|
|
- formFilters: undefined as string | undefined
|
|
|
+ formFilters: undefined as string | undefined,
|
|
|
+ currentNodeId: undefined as string | undefined
|
|
|
})
|
|
|
|
|
|
// 表单字段筛选
|
|
|
@@ -566,6 +590,8 @@ function handleQuery() {
|
|
|
function resetQuery() {
|
|
|
queryParams.processName = undefined
|
|
|
queryParams.formFilters = undefined
|
|
|
+ queryParams.currentNodeId = undefined
|
|
|
+ currentNodeOptions.value = []
|
|
|
activeUrgency.value = 'all'
|
|
|
queryParams.pageNum = 1
|
|
|
Object.keys(filterForm).forEach(key => delete filterForm[key])
|
|
|
@@ -578,6 +604,7 @@ async function loadDefinitions() {
|
|
|
// 默认选中第一个流程并触发查询
|
|
|
if (definitionList.value.length > 0 && !queryParams.processName) {
|
|
|
queryParams.processName = definitionList.value[0].name
|
|
|
+ onProcessChange()
|
|
|
loadData()
|
|
|
}
|
|
|
} catch {
|