From f8d1adc788ce65e4b87287bebf67394bafd9fa3b Mon Sep 17 00:00:00 2001 From: zhanghao <774378400@qq.com> Date: Thu, 10 Sep 2026 15:25:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0dotenv=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=EF=BC=8C=E5=A2=9E=E5=BC=BA=E9=85=8D=E7=BD=AE=E7=AE=A1?= =?UTF-8?q?=E7=90=86=EF=BC=9B=E6=9B=B4=E6=96=B0Aside=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E4=BB=A5=E4=BC=A0=E9=80=92flowId=EF=BC=9B=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=AF=AD=E6=96=99=E8=8E=B7=E5=8F=96=E8=8A=82=E7=82=B9=E5=8F=8A?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + pnpm-lock.yaml | 9 ++++ src/views/flow/components/Aside.vue | 19 +++++++- src/views/flow/config.js | 48 +++++++++++++-------- src/views/flow/index.vue | 2 +- src/views/flow/nodes/common/serviceNode.vue | 2 + 6 files changed, 60 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index c04c35f..55824e0 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,7 @@ "axios": "1.13.2", "clipboard": "2.0.11", "dayjs": "^1.11.13", + "dotenv": "^17.4.2", "echarts": "5.6.0", "file-saver": "2.0.5", "fuse.js": "7.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c7d6aff..114fdce 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -38,6 +38,9 @@ importers: dayjs: specifier: ^1.11.13 version: 1.11.23 + dotenv: + specifier: ^17.4.2 + version: 17.4.2 echarts: specifier: 5.6.0 version: 5.6.0 @@ -1016,6 +1019,10 @@ packages: dompurify@3.2.7: resolution: {integrity: sha512-WhL/YuveyGXJaerVlMYGWhvQswa7myDG17P7Vu65EWC05o8vfeNbvNf4d/BOvH99+ZW+LlQsc1GDKMa1vNK6dw==} + dotenv@17.4.2: + resolution: {integrity: sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==} + engines: {node: '>=12'} + dunder-proto@1.0.1: resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} engines: {node: '>= 0.4'} @@ -2730,6 +2737,8 @@ snapshots: optionalDependencies: '@types/trusted-types': 2.0.7 + dotenv@17.4.2: {} + dunder-proto@1.0.1: dependencies: call-bind-apply-helpers: 1.0.2 diff --git a/src/views/flow/components/Aside.vue b/src/views/flow/components/Aside.vue index a818eef..45edf74 100644 --- a/src/views/flow/components/Aside.vue +++ b/src/views/flow/components/Aside.vue @@ -31,7 +31,7 @@
collapseList.reduce((total, group) => total + group.nodeList.length, 0)); @@ -79,6 +81,13 @@ watch(keyword, (value) => { if (value.trim()) activeNames.value = filteredGroups.value.map((group) => group.collapseTitle); }); +const filterNodeList = (nodeList) => { + return nodeList.filter((node) => { + if (node.show === undefined) return true; + return node.show; + }); +}; + /** * 处理 handleDragCustom 对应的数据或交互;作用范围仅限当前组件或模块。 * @param {*} event 触发操作的浏览器事件 @@ -86,6 +95,14 @@ watch(keyword, (value) => { */ const handleDragCustom = (event, node) => { event.dataTransfer.effectAllowed = "copy"; + if (node.action === "INSPECTION_WAYPOINT_CORPUS") { + node.nodeParams = node.nodeParams.map((param) => { + if (param.name === "detectItemId") { + param.input = props.flowId || ""; + } + return param; + }); + } event.dataTransfer.setData("flowNode", JSON.stringify(node)); }; diff --git a/src/views/flow/config.js b/src/views/flow/config.js index cb7451c..b562485 100644 --- a/src/views/flow/config.js +++ b/src/views/flow/config.js @@ -96,6 +96,16 @@ const inspectionEventTypes = () => { }] } +const corpus_type = () => { + return [{ + value: 'zh-CN', + label: '中文' + }, { + value: 'en-US', + label: '英文' + }] +} + export const collapseList = [ { collapseTitle: "相机", @@ -133,11 +143,6 @@ export const collapseList = [ outputParams: [], outputType: 'json' }, - ], - }, - { - collapseTitle: "录像", - nodeList: [ { icon: videoSvg, name: "开启录像", @@ -194,20 +199,6 @@ export const collapseList = [ action: 'STOP_LOOP', desc: "用于立即终止当前所在的循环,跳出循环体", }, - // { - // icon: startSvg, - // name: "单次循环开始", - // type: "subStart", - // action: 'SUB_START', - // desc: "循环体内部工作流的开始节点,开始循环体内部的单次流程", - // }, - // { - // icon: endSvg, - // name: "单次循环结束", - // type: "subEnd", - // action: 'SUB_END', - // desc: "循环体内部工作流的终止节点,结束循环体内部的单次流程", - // }, { icon: switchSvg, name: "分支", @@ -303,6 +294,20 @@ function handler(params) { ], desc: '当前循环对象', } ] }, + { + icon: cameraSvg, + name: "获取语料", + type: "serviceNode", + desc: "获取点位设置的语料", + show: __PROJECT_NAME__ === 'changan', + action: 'INSPECTION_WAYPOINT_CORPUS', + nodeParams: [ + { name: "detectItemId", type: "input", input: "", disabled: true }, + { name: "type", type: "input", input: "", componentType: 'select', selectOptions: corpus_type(), disabled: true } + ], + outputType: 'json', + outputParams: [{ name: 'corpus', type: 'string', desc: '语料文本' }] + }, ], }, { @@ -341,6 +346,7 @@ function handler(params) { name: "通用指令", type: "deviceUniversal", desc: "执行设备通用指令", + show: __PROJECT_NAME__ === 'aima', action: 'DEVICE_EXECUTE_JSON_COMMAND', nodeType: 'EDGE', nodeParams: [ @@ -356,6 +362,7 @@ function handler(params) { name: "动作队列", type: "actionQueue", desc: "在边缘端按顺序连续执行多个动作", + show: __PROJECT_NAME__ === 'aima', action: 'SYSTEM_EXECUTE_ACTION_QUEUE', nodeType: 'EDGE', nodeParams: [ @@ -564,6 +571,7 @@ function handler(params) { name: "视频智能分析", type: "mediaAnalysis", desc: "按分析场景理解测试录像并输出结构化结论", + show: __PROJECT_NAME__ === 'aima', action: "VIDEO_ANALYZE", nodeType: "LLM", nodeParams: [ @@ -597,6 +605,7 @@ function handler(params) { name: "通用图片分析", type: "imageAnalysis", desc: "按照提示词分析一张或多张图片并返回指定内容", + show: __PROJECT_NAME__ === 'aima', action: 'IMAGE_ANALYZE', nodeType: "LLM", nodeParams: [ @@ -666,6 +675,7 @@ function handler(params) { type: "sdAgent", desc: "通过apiKey调用商道大模型", action: 'AI_AGENT_PLATFORM', + show: __PROJECT_NAME__ === 'cmvr', nodeType: "LLM", outputType: 'json', nodeParams: [ diff --git a/src/views/flow/index.vue b/src/views/flow/index.vue index e175c93..84b7018 100644 --- a/src/views/flow/index.vue +++ b/src/views/flow/index.vue @@ -118,7 +118,7 @@ -