diff --git a/package.json b/package.json index b5e698249b3446c795f4fc4e91caafd9a2d1c54c..acb8de5f256a3a9adbc4d6ef2362beba72048e92 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 6afc3c3224c370ccb3a798d86d8341d4f972421e..1314394a359fda8189cffc208061792e50ce5eea 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 db85caf5aea98e77617823c79d5eb940c5fd9872..a85fe1216ddcabaa13e137ed2a652cd8cf6df379 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 4e1276eea0f9b1a6e4a57df93df3860dc82d870c..985e39d137525ddfa1740956565cff3ebea43087 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({ -