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 @@
-
+