From 6718e0fb08b51ad39890fa1e3c7b4079051ee7c2 Mon Sep 17 00:00:00 2001 From: li-shengren-123456 Date: Tue, 11 Feb 2025 10:23:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E5=88=9B=E5=BB=BA=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E6=B5=81=E4=B8=8E=E5=88=A0=E9=99=A4=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/apis/workFlow/workFlowService.ts | 11 +- src/views/createapp/components/appConfig.vue | 38 +-- src/views/createapp/components/workFlow.vue | 232 ++++++++++++++---- .../components/workFlowConfig/BranchNode.vue | 7 +- .../workFlowConfig/CustomSaENode.vue | 6 +- .../components/workFlowConfig/useDnD.js | 12 +- .../workFlowConfig/workFlowDialog.vue | 99 +++++++- src/views/createapp/index.vue | 23 +- src/views/styles/createApp.scss | 5 + src/views/styles/workFlowArrange.scss | 22 +- 11 files changed, 363 insertions(+), 93 deletions(-) diff --git a/package.json b/package.json index b5e6982..acb8de5 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "highlight.js": "11.10.0", "js-yaml": "^4.1.0", "marked": "4.3", + "nanoid": "^5.0.9", "pinia": "2.1.6", "sass": "1.62.0", "typescript": "4.9.5", diff --git a/src/apis/workFlow/workFlowService.ts b/src/apis/workFlow/workFlowService.ts index 6afc3c3..1314394 100644 --- a/src/apis/workFlow/workFlowService.ts +++ b/src/apis/workFlow/workFlowService.ts @@ -55,17 +55,16 @@ export const createOrUpdateFlowTopology = ( * @returns */ export const delFlowTopology = (params: { - appId: number; - flowId: number; + appId: string; + flowId: string; }): Promise<[any, FcResponse | undefined]> => { - return del('/api/flow', params); + return del(`/api/flow?appId=${params.appId}&flowId=${params.flowId}`); }; - export const workFlowApi = { queryAllFlowService, querySingleFlowServiceNode, querySingleFlowTopology, delFlowTopology, - createOrUpdateFlowTopology -}; \ No newline at end of file + createOrUpdateFlowTopology, +}; diff --git a/src/views/createapp/components/appConfig.vue b/src/views/createapp/components/appConfig.vue index db85caf..a85fe12 100644 --- a/src/views/createapp/components/appConfig.vue +++ b/src/views/createapp/components/appConfig.vue @@ -10,6 +10,7 @@ const activeName = ref([1, 2, 3]); const activeNames = ref([1, 2, 3]); const route = useRoute(); const props = withDefaults(defineProps(), {}); +const emits = defineEmits(['getFlowList']); const createAppForm = ref({ icon: '', @@ -17,10 +18,11 @@ const createAppForm = ref({ description: '', links: [], recommendedQuestions: [], - dialogRounds: 1, - permissionType: 'all', + dialogRounds: 3, + permissionType: 'private', selectedPeople: [], }); +const flowDataList = ref([]); const searchName = ref(''); const permissionTypeList = [ { @@ -42,6 +44,8 @@ const curPersonList = ref([...permissionList.value]); const createAppRole = ref({ name: [{ required: true, message: '应用名称不能为空', trigger: 'blur' }], description: [{ required: true, message: '应用简介不能为空', trigger: 'change' }], + dialogRounds: [{ required: true, message: '对话轮次不能为空', trigger: 'change' }], + descripermissionTypeption: [{ required: true, message: '权限不能为空', trigger: 'change' }], }); const createAppFormRef = ref(); const modeOptions = reactive([ @@ -85,17 +89,21 @@ onMounted(() => { id: route.query?.appId as string, }) .then(res => { - let appInfo = res?.[1]?.result; - createAppForm.value = { - icon: appInfo.icon, - name: appInfo.name, - description: appInfo.description, - links: appInfo.links.map(item => item.url), - recommendedQuestions: appInfo.recommendedQuestions, - dialogRounds: appInfo.dialogRounds, - permission: { visibility: appInfo.permission.visibility }, - permissionType: appInfo.permission.visibility, - }; + const appInfo = res?.[1]?.result; + if (appInfo) { + createAppForm.value = { + icon: appInfo.icon, + name: appInfo.name, + description: appInfo.description, + links: appInfo.links.map(item => item.url), + recommendedQuestions: appInfo.recommendedQuestions, + dialogRounds: appInfo.dialogRounds, + permission: { visibility: appInfo.permission.visibility }, + permissionType: appInfo.permission.visibility, + }; + flowDataList.value = appInfo.workflows; + emits('getFlowList', flowDataList.value); + } }); } }); @@ -213,7 +221,7 @@ defineExpose({ - +
(1 ~ 10) @@ -227,7 +235,7 @@ defineExpose({ - +
diff --git a/src/views/createapp/components/workFlow.vue b/src/views/createapp/components/workFlow.vue index 4e1276e..985e39d 100644 --- a/src/views/createapp/components/workFlow.vue +++ b/src/views/createapp/components/workFlow.vue @@ -1,8 +1,8 @@
{{ node.name }}
@@ -447,16 +574,16 @@ defineExpose({ -