From 8fadc4f5397bee2c7ca213edc3000b173c4f50f4 Mon Sep 17 00:00:00 2001 From: zttProjectSpace Date: Sun, 20 Apr 2025 17:26:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=8C=E8=8A=82=E7=82=B9=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/createapp/components/workFlow.vue | 1 - .../components/workFlowConfig/CustomNode.vue | 56 +++++++++++++++-- src/views/createapp/index.vue | 61 +++++++++---------- src/views/styles/workFlowArrange.scss | 49 +++++++++++++-- 4 files changed, 123 insertions(+), 44 deletions(-) diff --git a/src/views/createapp/components/workFlow.vue b/src/views/createapp/components/workFlow.vue index 4fc0657..8eb9a89 100644 --- a/src/views/createapp/components/workFlow.vue +++ b/src/views/createapp/components/workFlow.vue @@ -664,7 +664,6 @@ const saveFlow = (updateNodeParameter?) => { ) .then((res) => { if (res[1]?.result) { - ElMessage.success('工作流更新成功'); queryFlow('update'); const updatedCurFlow = res[1].result.flow; console.log(res[1].result); diff --git a/src/views/createapp/components/workFlowConfig/CustomNode.vue b/src/views/createapp/components/workFlowConfig/CustomNode.vue index 4441c73..4a7d0c8 100644 --- a/src/views/createapp/components/workFlowConfig/CustomNode.vue +++ b/src/views/createapp/components/workFlowConfig/CustomNode.vue @@ -2,6 +2,9 @@ import { Position, Handle } from '@vue-flow/core'; import { ref, onMounted, watch } from 'vue'; import NodeMirrorText from '../codeMirror/nodeMirrorText.vue'; +import { CopyDocument, WarnTriangleFilled } from '@element-plus/icons-vue'; +import { ElMessage } from 'element-plus'; +import { IconSuccess } from '@computing/opendesign-icons'; import { nodeTypeToIcon, getSrcIcon, getNodeClass } from '../types'; const props = defineProps({ id: { @@ -28,7 +31,7 @@ const props = defineProps({ const emits = defineEmits(['delNode', 'editYamlDrawer', 'updateConnectHandle']); const statusList = ref(['running', 'success', 'error']); - +const nodeDescription = ref([]); // 当前节点状态-工作流调试结果-成功/失败/运行中 const curStatus = ref(''); @@ -48,6 +51,7 @@ const inputAndOutput = ref({ watch( () => props.data, () => { + nodeDescription.value = props.data.description.split('\n\n') || []; const isInclude = statusList.value.includes(props.data?.status); // 设置节点的状态-默认以及成功、失败、运行中 if (!isInclude) { @@ -94,6 +98,22 @@ const setConnectStatus = (type) => { // 更新当前节点handle连接状态 emits('updateConnectHandle', props.id); }; + +const handleCopyTextToclipboard = (text) => { + const input = document.createElement('input'); + input.value = text; + document.body.appendChild(input); + input.select(); + document.execCommand('copy'); + ElMessage({ + showClose: true, + message: '复制成功', + icon: IconSuccess, + customClass: 'o-message--success', + duration: 2000, + }); + document.body.removeChild(input); +};