From 24b390daa081eb6d5892b7840012e7b2b0694a6f Mon Sep 17 00:00:00 2001 From: donghao Date: Mon, 28 Jul 2025 10:06:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A4=9A=E5=9B=BE=E9=87=87=E9=9B=86?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/auto-imports.d.ts | 2 + src/renderer/src/App.vue | 6 +- .../src/components/Button/src/button.tsx | 2 +- .../ProForm/index.ts} | 0 src/renderer/src/styles/ds-dialog.scss | 55 +++ src/renderer/src/styles/element-plus.scss | 36 -- src/renderer/src/styles/global.scss | 5 +- src/renderer/src/styles/main.scss | 1 + .../FlowImagesCapture/imageNodeModel.scss | 0 .../FlowImagesCapture/imageNodeModel.vue | 130 +++++++ .../views/Design/FlowImagesCapture/index.ts | 14 + .../multiImageNodeModel.scss | 40 +++ .../FlowImagesCapture/multiImageNodeModel.vue | 328 ++++++++++++++++++ .../views/Design/Workflow/logicFlowView.vue | 50 ++- 14 files changed, 609 insertions(+), 60 deletions(-) rename src/renderer/src/{views/Design/FlowImagesCapture/imageModel.vue => components/ProForm/index.ts} (100%) create mode 100644 src/renderer/src/styles/ds-dialog.scss create mode 100644 src/renderer/src/views/Design/FlowImagesCapture/imageNodeModel.scss create mode 100644 src/renderer/src/views/Design/FlowImagesCapture/imageNodeModel.vue create mode 100644 src/renderer/src/views/Design/FlowImagesCapture/index.ts create mode 100644 src/renderer/src/views/Design/FlowImagesCapture/multiImageNodeModel.scss create mode 100644 src/renderer/src/views/Design/FlowImagesCapture/multiImageNodeModel.vue diff --git a/src/renderer/auto-imports.d.ts b/src/renderer/auto-imports.d.ts index 61767cd..e0f45c0 100644 --- a/src/renderer/auto-imports.d.ts +++ b/src/renderer/auto-imports.d.ts @@ -9,6 +9,8 @@ declare global { const EffectScope: typeof import('vue')['EffectScope'] const ElButton: typeof import('element-plus/es')['ElButton'] const ElDialog: typeof import('element-plus/es')['ElDialog'] + const ElIcon: typeof import('element-plus/es')['ElIcon'] + const ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] const ElMessage: typeof import('element-plus/es')['ElMessage'] const computed: typeof import('vue')['computed'] const createApp: typeof import('vue')['createApp'] diff --git a/src/renderer/src/App.vue b/src/renderer/src/App.vue index 5dcaccf..5a033ca 100644 --- a/src/renderer/src/App.vue +++ b/src/renderer/src/App.vue @@ -2,11 +2,13 @@ * @Author: donghao donghao@supervision.ltd * @Date: 2025-07-02 13:17:44 * @LastEditors: donghao donghao@supervision.ltd - * @LastEditTime: 2025-07-02 16:29:18 + * @LastEditTime: 2025-07-25 16:44:43 * @FilePath: \electron-project\Robot-Al\Robot-Al-Platform-Web\src\renderer\src\App.vue * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE --> - + @@ -46,20 +49,33 @@ import { OperationNode, ImageNode } from '@/components/LogicFlowNodes' import { useLogicFlow } from '@/hooks/useLogicFlow' import { logicFlowConf, logicFlowThemeConf } from '@/config/designCanvas' import { getNodeOutputCount, getNodeInputCount } from '@/utils/forData/arr' +import { FlowImageNodeModel, FlowMultiImageNodeModel } from '../FlowImagesCapture' const showLf = ref(false) // 是否显示画布 const showTop = ref(false) // 是否显示顶部工具栏 const showAttribute = ref(false) // 属性面板 -const nodeData = ref(null) +const currNodeData = ref({}) // 节点数据 const { graphData } = useLogicFlow() // 1. 初始化画布 const lf = ref(null) const flowDetail = reactive({}) +const isOpenFlowImage = ref(false) // 是否打开图片源流程图节点 +const isOpenFlowMultiImage = ref(false) // 是否打开多图采集流程图节点 // 隐藏属性面板 -const hideAttrPanel = () => { - showAttribute.value = false +const changeAttrPanelStatus = (isOpen) => { + switch (currNodeData.value?.type) { + case 'image-node': + isOpenFlowImage.value = true + break + case 'multi-image-node': + isOpenFlowMultiImage.value = true + break + } + nextTick(() => { + showAttribute.value = isOpen || !showAttribute.value + }) } // 控制器基础操作 @@ -110,27 +126,25 @@ const setEdgeType = (data) => { // 注册自定义事件 const initEvents = () => { lf.value.on('node:click', ({ data }) => { - nodeData.value = data - console.log('node:click-nodeData', nodeData.value) - if (['imageNode'].includes(data.type)) { - showAttribute.value = true - } + // currNodeData.value = data + console.log('node:click-currNodeData', currNodeData.value) + // changeAttrPanelStatus(true) }) lf.value.on('node:dbclick', ({ data }) => { - nodeData.value = data - console.log('node:dbclick-nodeData', nodeData.value) - }) - lf.value.on('edge:dbclick', ({ data }) => { - nodeData.value = data - showAttribute.value = true + currNodeData.value = data + console.log('node:dbclick-currNodeData', currNodeData.value) + changeAttrPanelStatus(true) }) + // lf.value.on('edge:dbclick', ({ data }) => { + // currNodeData.value = data + // }) //来自边的事件中心发出的事件 lf.value.on('edge:app-config', (res) => { - nodeData.value = res + currNodeData.value = res showAttribute.value = true }) lf.value.on('element:click', () => { - hideAttrPanel() // 隐藏属性面板 + // hideAttrPanel() // 隐藏属性面板 // console.log(lf.value.getGraphData(), 'getGraphData_click', JSON.stringify(lf.value.getGraphData())) }) lf.value.on('blank:contextmenu', (e, position) => {