From a76b54bcde3c978232149d0ec5bd1c7a8cb62c87 Mon Sep 17 00:00:00 2001 From: li-shengren-123456 Date: Thu, 13 Feb 2025 16:10:13 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E4=B8=8E=E6=9C=AA=E5=8F=91=E5=B8=83=E6=A0=B7=E5=BC=8F=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BF=9D=E5=AD=98=E8=B0=83=E8=AF=95=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/styles/theme.scss | 8 +- src/views/app/index.vue | 58 ++++++-- src/views/app/style.scss | 2 +- src/views/createapp/components/workFlow.vue | 19 ++- .../components/workFlowConfig/BranchNode.vue | 61 +++++--- .../workFlowConfig/workFlowDialog.vue | 140 +++++++++--------- src/views/createapp/index.vue | 86 ++++++----- src/views/styles/workFlowArrange.scss | 19 ++- 8 files changed, 244 insertions(+), 149 deletions(-) diff --git a/src/assets/styles/theme.scss b/src/assets/styles/theme.scss index 69d0ce2..b76af6b 100644 --- a/src/assets/styles/theme.scss +++ b/src/assets/styles/theme.scss @@ -16,6 +16,7 @@ body[theme='dark'] { --flow-instance-hover-color: #1F2329; --flow-instance-shadow: 0 4px 16px 0 rgba(253, 254, 255, 0.1); --flow-node-default-over-color: #25303E; + --flow-node-boder-default-over: #314265; --flow-node-success-over-color: #1F312A; --flow-node-error-over-color: #332127; } @@ -37,7 +38,8 @@ body[theme='light'] { --o-flow-code-border: rgb(223,229,239); --flow-instance-hover-color: #FDFEFF; --flow-instance-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.1); - --flow-node-default-over-color: #EEF3FE; - --flow-node-success-over-color: #E6F6E9; - --flow-node-error-over-color: #F8E7E7; + --flow-node-default-over-color: #edf2fd; + --flow-node-boder-default-over: #c7d6f5; + --flow-node-success-over-color: #e6f6e9; + --flow-node-error-over-color: #f8e7e7; } diff --git a/src/views/app/index.vue b/src/views/app/index.vue index 44eb2f6..a6c3960 100644 --- a/src/views/app/index.vue +++ b/src/views/app/index.vue @@ -51,7 +51,11 @@
{{ appItem.name }}
-
+
@@ -68,6 +72,10 @@ 删除
+
+
+
未发布
+
@@ -159,6 +167,10 @@ const handleQueryAppList = (payload?: any) => { }; const handleFavorite = (e, item) => { + // 未发布的不可收藏 + if (!item.published) { + return; + } e.stopPropagation(); api .changeSingleAppCollect({ @@ -225,16 +237,40 @@ onMounted(() => { handleQueryAppList(); }); - diff --git a/src/views/createapp/components/workFlowConfig/workFlowDialog.vue b/src/views/createapp/components/workFlowConfig/workFlowDialog.vue index e5a6c55..8564ce7 100644 --- a/src/views/createapp/components/workFlowConfig/workFlowDialog.vue +++ b/src/views/createapp/components/workFlowConfig/workFlowDialog.vue @@ -17,7 +17,7 @@ clearable > - + @@ -42,7 +42,7 @@ import { ref } from 'vue'; import { api } from 'src/apis'; import { useRoute } from 'vue-router'; import { v4 as uuidv4 } from 'uuid'; -import { ElMessage } from 'element-plus'; +import { ElMessage, FormInstance } from 'element-plus'; const workFlowDiaVisible = ref(true); const route = useRoute(); const props = defineProps({ @@ -66,74 +66,78 @@ const workFlowRules = ref({ const onCancel = () => { emits('handleClose'); }; -const handleSubmit = () => { - // 创建工作流 - const appId = route.query?.appId; - // 创建使用生成的flowId - const flowId = uuidv4(); - // 调用接口新建工作流 - api - .createOrUpdateFlowTopology( - { - appId: appId, - flowId, - topologyCheck: false, - }, - { - flow: { - name: workFlowData.value.name, - description: workFlowData.value.description, - enable: true, - editable: true, - // 创建工作流时,默认包含开始结束固定两节点,这两个节点非后端返回,其apiId与serviceId不为空即可 - nodes: [ - { - apiId: 'startId', - name: '开始', - serviceId: 'startService', - type: 'start', - description: 'startNode', - editable: false, +const handleSubmit = (formEl: FormInstance | undefined) => { + // 校验必填项是否填写 + formEl?.validate(valid => { + if (valid) { + // 创建工作流 + const appId = route.query?.appId; + // 创建使用生成的flowId + const flowId = uuidv4(); + // 调用接口新建工作流 + api + .createOrUpdateFlowTopology( + { + appId: appId, + flowId, + topologyCheck: false, + }, + { + flow: { + name: workFlowData.value.name, + description: workFlowData.value.description, enable: true, - nodeId: 'node1', - position: { - x: 100, - y: 160, - }, + editable: true, + // 创建工作流时,默认包含开始结束固定两节点,这两个节点非后端返回,其apiId与serviceId不为空即可 + nodes: [ + { + apiId: 'startId', + name: '开始', + serviceId: 'startService', + type: 'start', + description: 'startNode', + editable: false, + enable: true, + nodeId: 'node1', + position: { + x: 100, + y: 160, + }, + }, + { + apiId: 'endId', + name: '结束', + serviceId: 'endService', + type: 'end', + description: 'endNode', + editable: false, + enable: true, + nodeId: 'node2', + position: { + x: 600, + y: 160, + }, + }, + ], + // 初始创建的工作流边为空 + edges: [], }, - { - apiId: 'endId', - name: '结束', - serviceId: 'endService', - type: 'end', - description: 'endNode', - editable: false, - enable: true, - nodeId: 'node2', - position: { - x: 600, - y: 160, - }, + focusPoint: { + x: 800, + y: 800, }, - ], - // 初始创建的工作流边为空 - edges: [ - ], - }, - focusPoint: { - x: 800, - y: 800, - }, - }, - ) - .then(res => { - if (res[1]?.result?.flow) { - ElMessage.success('创建成功'); - // 将创建成功后的flow对象传给父组件 - emits('createFlowId', {...res[1].result.flow}); - onCancel(); - } - }); + }, + ) + .then(res => { + if (res[1]?.result?.flow) { + ElMessage.success('创建成功'); + // 将创建成功后的flow对象传给父组件 + emits('createFlowId', { ...res[1].result.flow }); + onCancel(); + } + }); + } + }); };