From c54f1da1266dec5ee8bb57f7a8a08a2efc23c437 Mon Sep 17 00:00:00 2001
From: lixiaolong <702156524@qq.com>
Date: Wed, 12 Aug 2026 09:31:45 +0800
Subject: [PATCH] =?UTF-8?q?feat(flow):=20=E6=96=B0=E5=A2=9E=E5=B7=A5?=
=?UTF-8?q?=E4=BD=9C=E6=B5=81=E6=89=A7=E8=A1=8C=E8=B5=84=E6=BA=90=E9=85=8D?=
=?UTF-8?q?=E7=BD=AE=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 添加了 flowExecution 工具模块用于处理工作流运行时资源配置
- 实现了工作流角色定义的加载、合并和验证功能
- 集成了机器人和设备分配逻辑到任务执行界面
- 更新了 RuntimeAssignmentsEditor 组件以支持动态设备分配
- 移除了静态机器人选择,改为基于流程角色的动态分配
- 优化了工作流资源定义合并逻辑,支持插槽复用配置
- 增强了设备冲突检测和错误处理机制
- 统一了多个视图中的工作流执行资源配置流程
---
src/utils/flowExecution.js | 82 ++++++++++++++
src/utils/flowResources.js | 7 +-
.../components/RuntimeAssignmentsEditor.vue | 101 ++++++++++++++----
src/views/inspection/runTask/index.vue | 88 +++++----------
.../intelligenceTest/runningTask/index.vue | 30 +++---
src/views/is/project/evaluate/Run.vue | 23 ++--
src/views/test/configs/Run.vue | 22 ++--
src/views/test/configs/index.vue | 62 -----------
src/views/vi/testProject/evaluate/Run.vue | 23 ++--
9 files changed, 251 insertions(+), 187 deletions(-)
create mode 100644 src/utils/flowExecution.js
diff --git a/src/utils/flowExecution.js b/src/utils/flowExecution.js
new file mode 100644
index 0000000..44be2b6
--- /dev/null
+++ b/src/utils/flowExecution.js
@@ -0,0 +1,82 @@
+import { getFlowParamsApi } from '@/api/device/terminal'
+import { getDetect } from '@/api/test/detect'
+import {
+ getResourceRoles,
+ mergeResourceRoleDefinitions,
+ normalizeFlowResourceSchema,
+ validateFlowResources,
+} from '@/utils/flowResources'
+
+const clone = (value) => JSON.parse(JSON.stringify(value || []))
+
+const parseFlowData = (itemId, flowData) => {
+ if (!flowData) throw new Error(`流程项[${itemId}]还没有配置工作流`)
+ try {
+ const graph = typeof flowData === 'string' ? JSON.parse(flowData) : flowData
+ const normalizedGraph = normalizeFlowResourceSchema(graph)
+ const validation = validateFlowResources(normalizedGraph)
+ if (validation.errors.length) {
+ throw new Error(validation.errors[0].message)
+ }
+ return validation.graph
+ } catch (error) {
+ throw new Error(`流程项[${itemId}]不可执行:${error.message || '工作流数据无法解析'}`)
+ }
+}
+
+const assertCompatibleDefinitions = (roleGroups) => {
+ const rolesByKey = new Map()
+ roleGroups.flat().forEach((role) => {
+ const existing = rolesByKey.get(role.roleKey)
+ if (!existing) {
+ rolesByKey.set(role.roleKey, clone([role])[0])
+ return
+ }
+ const slotsByKey = new Map((existing.deviceSlots || []).map((slot) => [slot.slotKey, slot]))
+ ;(role.deviceSlots || []).forEach((slot) => {
+ const existingSlot = slotsByKey.get(slot.slotKey)
+ if (existingSlot && String(existingSlot.deviceKind ?? '') !== String(slot.deviceKind ?? '')) {
+ throw new Error(`机器人角色“${existing.displayName}”的设备用途“${slot.displayName}”在不同流程中类型不一致`)
+ }
+ if (!existingSlot) existing.deviceSlots.push(clone([slot])[0])
+ })
+ })
+}
+
+export const loadFlowItemRuntimeRoles = async (items = []) => {
+ if (items.some((item) => !item?.itemId)) throw new Error('任务编排中存在缺少流程项ID的数据')
+ const uniqueItems = Array.from(new Map(
+ items.filter((item) => item?.itemId).map((item) => [item.itemId, item]),
+ ).values())
+ if (!uniqueItems.length) throw new Error('当前任务没有编排任何流程项')
+
+ const roleGroups = await Promise.all(uniqueItems.map(async (item) => {
+ const response = await getDetect(item.itemId)
+ const graph = parseFlowData(item.itemName || item.itemId, response.data?.flowData)
+ return getResourceRoles(graph)
+ }))
+ assertCompatibleDefinitions(roleGroups)
+ return mergeResourceRoleDefinitions(roleGroups)
+}
+
+export const loadTaskRuntimeRoles = async (taskId) => {
+ if (!taskId) throw new Error('任务没有关联流程编排')
+ const response = await getFlowParamsApi(taskId)
+ return loadFlowItemRuntimeRoles(response.rows || [])
+}
+
+export const createRuntimeAssignments = (roles = [], primaryRobotId = '') => roles.map((role, index) => ({
+ roleKey: role.roleKey,
+ members: [{
+ memberKey: `${role.roleKey}_1`,
+ robotId: index === 0 ? primaryRobotId || role.legacyRobotId || '' : role.legacyRobotId || '',
+ devices: Object.fromEntries((role.deviceSlots || []).map((slot) => [
+ slot.slotKey,
+ slot.legacyDeviceId || '',
+ ])),
+ }],
+}))
+
+export const firstAssignedRobotId = (assignments = []) => (
+ clone(assignments).flatMap((item) => item.members || []).find((member) => member.robotId)?.robotId || ''
+)
diff --git a/src/utils/flowResources.js b/src/utils/flowResources.js
index dedd8c3..dceddc1 100644
--- a/src/utils/flowResources.js
+++ b/src/utils/flowResources.js
@@ -313,10 +313,15 @@ export const mergeResourceRoleDefinitions = (roleGroups = []) => {
merged.push(clone(sourceRole))
return
}
+ role.required = role.required !== false || sourceRole.required !== false
;(sourceRole.deviceSlots || []).forEach((sourceSlot) => {
- if (!role.deviceSlots.some((slot) => slot.slotKey === sourceSlot.slotKey)) {
+ const slot = role.deviceSlots.find((item) => item.slotKey === sourceSlot.slotKey)
+ if (!slot) {
role.deviceSlots.push(clone(sourceSlot))
+ return
}
+ slot.required = slot.required !== false || sourceSlot.required !== false
+ slot.allowReuse = slot.allowReuse === true && sourceSlot.allowReuse === true
})
})
return merged
diff --git a/src/views/flow/components/RuntimeAssignmentsEditor.vue b/src/views/flow/components/RuntimeAssignmentsEditor.vue
index 42c418e..3abd07e 100644
--- a/src/views/flow/components/RuntimeAssignmentsEditor.vue
+++ b/src/views/flow/components/RuntimeAssignmentsEditor.vue
@@ -9,13 +9,14 @@
changeRobot(role, robotId)"
>
-
+
@@ -36,18 +37,21 @@
+
diff --git a/src/views/inspection/runTask/index.vue b/src/views/inspection/runTask/index.vue
index 55f7ece..61651ea 100644
--- a/src/views/inspection/runTask/index.vue
+++ b/src/views/inspection/runTask/index.vue
@@ -20,7 +20,7 @@
@click="removeTask(task)" />
-
机器人:{{ task.robotName }}
+ 主要机器人:{{ task.robotName || '执行时安排' }}
@@ -44,7 +44,7 @@
ID: {{ runTask.taskId }}
-
机器人:{{ runTask.robotName }}
+
主要机器人:{{ runTask.robotName || '按流程角色安排' }}
开始时间: {{ formatDate(runTask.startTime) }}
@@ -84,7 +84,9 @@
-
+
+ {{ scope.row.robotName || '按流程角色安排' }}
+
{{ formatDate(scope.row.startTime) }}
@@ -117,17 +119,10 @@
-
+
-
-
-
-
-
@@ -145,7 +140,12 @@
-
+
取消
开始执行
@@ -159,16 +159,17 @@ import taskSteps from "./task-steps.vue";
import taskLog from "./task-log.vue";
import { useContainerHeight } from "@/hooks/tableHeight";
import { getTaskList, getWaypointByTaskId } from "@/api/inspection/task";
-import { getRobotList } from "@/api/inspection/robot";
import { onMounted, onUnmounted } from "vue";
import { addRunTask, getRunTaskList, startRunTask, pauseRunTask, stopRunTask, resumeRunTask, deleteRunTask, getTaskLogListApi } from "@/api/inspection/runTask";
import { ElMessage, ElMessageBox } from "element-plus";
import { formatDate } from "@/utils/index";
import { debounce } from 'lodash'; // 引入 lodash 的防抖函数
-import { getFlowParamsApi } from '@/api/device/terminal'
-import { getDetect } from '@/api/test/detect'
import RuntimeAssignmentsEditor from '@/views/flow/components/RuntimeAssignmentsEditor.vue'
-import { getResourceRoles, mergeResourceRoleDefinitions, normalizeFlowResourceSchema } from '@/utils/flowResources'
+import {
+ createRuntimeAssignments,
+ firstAssignedRobotId,
+ loadTaskRuntimeRoles,
+} from '@/utils/flowExecution'
const topContainerRef = ref();
const containerHeight = useContainerHeight(topContainerRef);
@@ -179,6 +180,7 @@ const pendingStartTask = ref(null)
const runtimeRoles = ref([])
const runtimeAssignments = ref([])
const runtimeEditorRef = ref()
+const runtimeMapId = ref('')
const taskStatusMap = {
'0': '已完成',
@@ -191,17 +193,13 @@ const taskStatusMap = {
const form = reactive({
taskId: null,
- robotId: null,
});
const rules = reactive({
taskId: [{ required: true, message: '请选择任务', trigger: 'change' }],
- robotId: [{ required: true, message: '请选择机器人', trigger: 'change' }],
});
const taskList = ref([]);
-const robotList = ref([]);
-
const runTaskList = ref([]);
const getTaskData = () => {
@@ -213,30 +211,12 @@ const getTaskData = () => {
})
}
-const getRobotData = (mapId = null) => {
- getRobotList({
- pageNum: 1,
- pageSize: 10000,
- currentMapId: mapId
- }).then((res) => {
- robotList.value = res.rows;
- })
-}
-
const open = ref(false);
const addTask = () => {
open.value = true;
}
-const taskChange = (value) => {
- const task = taskList.value.find(item => item.id === value)
- const mapId = task.mapId
- form.robotId = null;
- robotList.value = []
- getRobotData(mapId)
-}
-
const runTaskRef = ref();
/**
* 确定添加执行任务
@@ -347,25 +327,16 @@ const startTask = async (task) => {
ElMessage.warning('当前任务没有关联流程编排')
return
}
- const response = await getFlowParamsApi(taskDefinition.taskConfigId)
- const definitions = await Promise.all((response.rows || []).map(async (item) => {
- const flowResponse = await getDetect(item.itemId)
- return flowResponse.data?.flowData
- ? getResourceRoles(normalizeFlowResourceSchema(JSON.parse(flowResponse.data.flowData)))
- : []
- }))
- const roles = mergeResourceRoleDefinitions(definitions)
- runtimeAssignments.value = roles.map((role, index) => ({
- roleKey: role.roleKey,
- members: [{
- memberKey: `${role.roleKey}_1`,
- robotId: index === 0 ? task.robotId || '' : '',
- devices: {}
- }]
- }))
- runtimeRoles.value = roles
- pendingStartTask.value = task
- startDialogVisible.value = true
+ try {
+ const roles = await loadTaskRuntimeRoles(taskDefinition.taskConfigId)
+ runtimeAssignments.value = createRuntimeAssignments(roles, task.robotIdentity)
+ runtimeMapId.value = taskDefinition.mapId || ''
+ runtimeRoles.value = roles
+ pendingStartTask.value = task
+ startDialogVisible.value = true
+ } catch (error) {
+ ElMessage.error(error.message || '工作流执行资源加载失败')
+ }
}
}
@@ -377,7 +348,7 @@ const confirmStartTask = async () => {
}
startSubmitting.value = true
try {
- const robotId = runtimeAssignments.value.flatMap(item => item.members).find(member => member.robotId)?.robotId || ''
+ const robotId = firstAssignedRobotId(runtimeAssignments.value)
const res = await startRunTask(pendingStartTask.value.id, {
robotId,
runtimeAssignments: runtimeAssignments.value
@@ -534,7 +505,6 @@ const handleOpenLog = async (row) => {
}
onMounted(() => {
getTaskData();
- getRobotData();
getList();
getHistoryList();
subscribeDebounced(true)
diff --git a/src/views/intelligenceTest/runningTask/index.vue b/src/views/intelligenceTest/runningTask/index.vue
index 1db5614..c96ef3e 100644
--- a/src/views/intelligenceTest/runningTask/index.vue
+++ b/src/views/intelligenceTest/runningTask/index.vue
@@ -183,10 +183,12 @@ import {
import { ElMessage, ElMessageBox } from "element-plus";
import { formatDate } from "@/utils/index";
import { debounce } from 'lodash'; // 引入 lodash 的防抖函数
-import { getFlowParamsApi } from '@/api/device/terminal'
-import { getDetect } from '@/api/test/detect'
import RuntimeAssignmentsEditor from '@/views/flow/components/RuntimeAssignmentsEditor.vue'
-import { getResourceRoles, mergeResourceRoleDefinitions, normalizeFlowResourceSchema } from '@/utils/flowResources'
+import {
+ createRuntimeAssignments,
+ firstAssignedRobotId,
+ loadTaskRuntimeRoles,
+} from '@/utils/flowExecution'
const topContainerRef = ref();
const containerHeight = useContainerHeight(topContainerRef);
@@ -367,17 +369,15 @@ const startTask = async (task) => {
ElMessage.warning('当前任务没有关联流程编排')
return
}
- const response = await getFlowParamsApi(taskDefinition.taskConfigId)
- const definitions = await Promise.all((response.rows || []).map(async (item) => {
- const flowResponse = await getDetect(item.itemId)
- return flowResponse.data?.flowData
- ? getResourceRoles(normalizeFlowResourceSchema(JSON.parse(flowResponse.data.flowData)))
- : []
- }))
- runtimeRoles.value = mergeResourceRoleDefinitions(definitions)
- runtimeAssignments.value = []
- pendingStartTask.value = task
- startDialogVisible.value = true
+ try {
+ const roles = await loadTaskRuntimeRoles(taskDefinition.taskConfigId)
+ runtimeAssignments.value = createRuntimeAssignments(roles)
+ runtimeRoles.value = roles
+ pendingStartTask.value = task
+ startDialogVisible.value = true
+ } catch (error) {
+ ElMessage.error(error.message || '工作流执行资源加载失败')
+ }
}
}
@@ -389,7 +389,7 @@ const confirmStartTask = async () => {
}
startSubmitting.value = true
try {
- const robotId = runtimeAssignments.value.flatMap(item => item.members).find(member => member.robotId)?.robotId || ''
+ const robotId = firstAssignedRobotId(runtimeAssignments.value)
const res = await startTaskinstance(pendingStartTask.value.id, {
robotId,
runtimeAssignments: runtimeAssignments.value
diff --git a/src/views/is/project/evaluate/Run.vue b/src/views/is/project/evaluate/Run.vue
index 696b14f..313b5b0 100644
--- a/src/views/is/project/evaluate/Run.vue
+++ b/src/views/is/project/evaluate/Run.vue
@@ -68,9 +68,11 @@ import { ref, watch } from "vue";
import { ElMessage } from "element-plus";
import { addValueProperty, formatTableData } from "@/utils/flow";
import { getExecuteRunParams, projectExecute } from "@/api/is/project/index.js";
-import { getDetect } from '@/api/test/detect'
import RuntimeAssignmentsEditor from '@/views/flow/components/RuntimeAssignmentsEditor.vue'
-import { getResourceRoles, mergeResourceRoleDefinitions, normalizeFlowResourceSchema } from '@/utils/flowResources'
+import {
+ firstAssignedRobotId,
+ loadFlowItemRuntimeRoles,
+} from '@/utils/flowExecution'
const props = defineProps({
@@ -96,13 +98,8 @@ const getProjectParams = async () => {
if (res.code === 200) {
const data = parseConfig(res.data)
formData.value.tableData = data
- const definitions = await Promise.all(data.map(async (item) => {
- const response = await getDetect(item.itemId)
- return response.data?.flowData
- ? getResourceRoles(normalizeFlowResourceSchema(JSON.parse(response.data.flowData)))
- : []
- }))
- roles.value = mergeResourceRoleDefinitions(definitions)
+ runtimeAssignments.value = []
+ roles.value = await loadFlowItemRuntimeRoles(data)
}
};
@@ -131,7 +128,7 @@ const confirm = () => {
ElMessage.warning(assignmentError)
return
}
- const robotId = runtimeAssignments.value.flatMap(item => item.members).find(member => member.robotId)?.robotId || ''
+ const robotId = firstAssignedRobotId(runtimeAssignments.value)
const res = await projectExecute({
runParams,
projectId: props.projectId,
@@ -160,7 +157,11 @@ watch(
() => props.drawer,
(newVal) => {
if (newVal) {
- getProjectParams()
+ getProjectParams().catch((error) => {
+ roles.value = []
+ runtimeAssignments.value = []
+ ElMessage.error(error.message || '工作流执行资源加载失败')
+ })
}
}
);
diff --git a/src/views/test/configs/Run.vue b/src/views/test/configs/Run.vue
index 798ff2d..209af69 100644
--- a/src/views/test/configs/Run.vue
+++ b/src/views/test/configs/Run.vue
@@ -68,9 +68,11 @@ import { emitter } from "@/utils/eventBus";
import { ElMessage } from "element-plus";
import { getFlowParamsApi } from "@/api/device/terminal.js";
import { taskExecute } from "@/api/test/config"
-import { getDetect } from '@/api/test/detect'
import RuntimeAssignmentsEditor from '@/views/flow/components/RuntimeAssignmentsEditor.vue'
-import { getResourceRoles, mergeResourceRoleDefinitions, normalizeFlowResourceSchema } from '@/utils/flowResources'
+import {
+ firstAssignedRobotId,
+ loadFlowItemRuntimeRoles,
+} from '@/utils/flowExecution'
const props = defineProps({
drawer: Boolean,
@@ -101,12 +103,8 @@ const getFlowParams = async () => {
if (res.code === 200) {
const data = parseConfig(res.rows)
formData.value.tableData = data
- const definitions = await Promise.all(data.map(async (item) => {
- const response = await getDetect(item.itemId)
- if (!response.data?.flowData) return []
- return getResourceRoles(normalizeFlowResourceSchema(JSON.parse(response.data.flowData)))
- }))
- roles.value = mergeResourceRoleDefinitions(definitions)
+ runtimeAssignments.value = []
+ roles.value = await loadFlowItemRuntimeRoles(data)
}
};
@@ -135,7 +133,7 @@ const confirm = () => {
ElMessage.warning(assignmentError)
return
}
- const robotId = runtimeAssignments.value.flatMap(item => item.members).find(member => member.robotId)?.robotId || ''
+ const robotId = firstAssignedRobotId(runtimeAssignments.value)
const res = await taskExecute({
runParams,
taskId: props.currentRow.id,
@@ -159,7 +157,11 @@ watch(
() => props.drawer,
(newVal) => {
if (newVal) {
- getFlowParams()
+ getFlowParams().catch((error) => {
+ roles.value = []
+ runtimeAssignments.value = []
+ ElMessage.error(error.message || '工作流执行资源加载失败')
+ })
}
}
);
diff --git a/src/views/test/configs/index.vue b/src/views/test/configs/index.vue
index 589e5f1..f4d4aa8 100644
--- a/src/views/test/configs/index.vue
+++ b/src/views/test/configs/index.vue
@@ -341,17 +341,14 @@ import {
getTaskParamsById,
listConfig,
taskConfig,
- taskExecute,
updateConfig,
} from "@/api/test/config";
-import { flowExecute } from "@/api/flow/flow";
import TableSearch from "@/components/TableSearch/index.vue";
import draggable from "vuedraggable";
import { listDetect } from "@/api/test/detect.js";
import { Tools, Delete } from "@element-plus/icons-vue";
import { listGroup } from "@/api/system/group.js";
-import { listTerminal } from "@/api/device/terminal.js";
import Run from "./Run.vue";
import { ref, reactive, toRefs, onMounted } from "vue";
@@ -415,7 +412,6 @@ function cancel() {
taskExecuteOpen.value = false;
taskConfigOpen.value = false;
executeOpen.value = false;
- selectedTerminal.value = "";
reset();
}
@@ -590,46 +586,6 @@ const submitTaskForm = () => {
});
};
-const formatCode = (arr) => {
- return arr.map((item) => ({
- itemId: item.detectId,
- params: item.params.reduce((acc, param) => {
- acc[param.paramEnName] = param.sourceValue;
- return acc;
- }, {}),
- }));
-};
-
-const handleTaskExecute = (formEl) => {
- if (!selectedTerminal.value) {
- proxy.$modal.msgError("请选择执行终端");
- return;
- }
- const data = Object.assign(
- {},
- { runParams: { robotId: selectedTerminal.value } },
- { taskId: currentRow.value.id }
- );
- // taskExecute(data).then((res) => {
- // proxy.$modal.msgSuccess("下发成功")
- // resetTaskList()
- // executeOpen.value = false
- // taskExecuteOpen.value = false
- // currentRow.value = undefined
- // selectedTerminal.value = ""
- // })
-
- flowExecute(data).then((res) => {
- console.log("res", res);
- proxy.$modal.msgSuccess("下发成功");
- resetTaskList();
- executeOpen.value = false;
- taskExecuteOpen.value = false;
- currentRow.value = undefined;
- selectedTerminal.value = "";
- });
-};
-
const handleTaskExecuteOpen = (row) => {
currentRow.value = row;
executeOpen.value = true;
@@ -661,24 +617,6 @@ function handleGetSystemGroup(row) {
});
}
-const terminalGroup = ref([]);
-const selectedTerminal = ref("");
-
-/** 获取设备终端列表 */
-function handleGetTerminalGroup(row) {
- listTerminal({
- pageNum: 1,
- pageSize: 1000,
- }).then((response) => {
- terminalGroup.value = response.rows?.map((item) => {
- return {
- label: `${item.name}(${item.host}:${item.port})`,
- value: item.id,
- };
- });
- });
-}
-
const removeFromB = (id) => {
const index = taskRightList.value.findIndex(item => item.id === id)
if (index !== -1) taskRightList.value.splice(index, 1)
diff --git a/src/views/vi/testProject/evaluate/Run.vue b/src/views/vi/testProject/evaluate/Run.vue
index 1874718..2e1a90a 100644
--- a/src/views/vi/testProject/evaluate/Run.vue
+++ b/src/views/vi/testProject/evaluate/Run.vue
@@ -68,9 +68,11 @@ import { ref, watch } from "vue";
import { ElMessage } from "element-plus";
import { addValueProperty, formatTableData } from "@/utils/flow";
import { getExecuteRunParams, projectExecute } from "@/api/vi/project.js"
-import { getDetect } from '@/api/test/detect'
import RuntimeAssignmentsEditor from '@/views/flow/components/RuntimeAssignmentsEditor.vue'
-import { getResourceRoles, mergeResourceRoleDefinitions, normalizeFlowResourceSchema } from '@/utils/flowResources'
+import {
+ firstAssignedRobotId,
+ loadFlowItemRuntimeRoles,
+} from '@/utils/flowExecution'
const props = defineProps({
drawer: Boolean,
@@ -94,13 +96,8 @@ const getProjectParams = async () => {
if (res.code === 200) {
const data = parseConfig(res.data)
formData.value.tableData = data
- const definitions = await Promise.all(data.map(async (item) => {
- const response = await getDetect(item.itemId)
- return response.data?.flowData
- ? getResourceRoles(normalizeFlowResourceSchema(JSON.parse(response.data.flowData)))
- : []
- }))
- roles.value = mergeResourceRoleDefinitions(definitions)
+ runtimeAssignments.value = []
+ roles.value = await loadFlowItemRuntimeRoles(data)
}
};
@@ -129,7 +126,7 @@ const confirm = () => {
ElMessage.warning(assignmentError)
return
}
- const robotId = runtimeAssignments.value.flatMap(item => item.members).find(member => member.robotId)?.robotId || ''
+ const robotId = firstAssignedRobotId(runtimeAssignments.value)
const res = await projectExecute({
runParams,
projectId: props.projectId,
@@ -158,7 +155,11 @@ watch(
() => props.drawer,
(newVal) => {
if (newVal) {
- getProjectParams()
+ getProjectParams().catch((error) => {
+ roles.value = []
+ runtimeAssignments.value = []
+ ElMessage.error(error.message || '工作流执行资源加载失败')
+ })
}
}
);