feat: 添加dotenv依赖,增强配置管理;更新Aside组件以传递flowId;新增语料获取节点及相关逻辑
This commit is contained in:
parent
df522fb87c
commit
f8d1adc788
@ -47,6 +47,7 @@
|
|||||||
"axios": "1.13.2",
|
"axios": "1.13.2",
|
||||||
"clipboard": "2.0.11",
|
"clipboard": "2.0.11",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
|
"dotenv": "^17.4.2",
|
||||||
"echarts": "5.6.0",
|
"echarts": "5.6.0",
|
||||||
"file-saver": "2.0.5",
|
"file-saver": "2.0.5",
|
||||||
"fuse.js": "7.1.0",
|
"fuse.js": "7.1.0",
|
||||||
|
|||||||
9
pnpm-lock.yaml
generated
9
pnpm-lock.yaml
generated
@ -38,6 +38,9 @@ importers:
|
|||||||
dayjs:
|
dayjs:
|
||||||
specifier: ^1.11.13
|
specifier: ^1.11.13
|
||||||
version: 1.11.23
|
version: 1.11.23
|
||||||
|
dotenv:
|
||||||
|
specifier: ^17.4.2
|
||||||
|
version: 17.4.2
|
||||||
echarts:
|
echarts:
|
||||||
specifier: 5.6.0
|
specifier: 5.6.0
|
||||||
version: 5.6.0
|
version: 5.6.0
|
||||||
@ -1016,6 +1019,10 @@ packages:
|
|||||||
dompurify@3.2.7:
|
dompurify@3.2.7:
|
||||||
resolution: {integrity: sha512-WhL/YuveyGXJaerVlMYGWhvQswa7myDG17P7Vu65EWC05o8vfeNbvNf4d/BOvH99+ZW+LlQsc1GDKMa1vNK6dw==}
|
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:
|
dunder-proto@1.0.1:
|
||||||
resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==}
|
resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==}
|
||||||
engines: {node: '>= 0.4'}
|
engines: {node: '>= 0.4'}
|
||||||
@ -2730,6 +2737,8 @@ snapshots:
|
|||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@types/trusted-types': 2.0.7
|
'@types/trusted-types': 2.0.7
|
||||||
|
|
||||||
|
dotenv@17.4.2: {}
|
||||||
|
|
||||||
dunder-proto@1.0.1:
|
dunder-proto@1.0.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
call-bind-apply-helpers: 1.0.2
|
call-bind-apply-helpers: 1.0.2
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
<div class="node-list">
|
<div class="node-list">
|
||||||
<div
|
<div
|
||||||
v-for="node in item.nodeList"
|
v-for="node in filterNodeList(item.nodeList)"
|
||||||
:key="`${node.type}-${node.action || node.name}`"
|
:key="`${node.type}-${node.action || node.name}`"
|
||||||
class="node-item"
|
class="node-item"
|
||||||
draggable="true"
|
draggable="true"
|
||||||
@ -57,6 +57,8 @@ import { computed, ref, watch } from "vue";
|
|||||||
import { Rank, Search } from "@element-plus/icons-vue";
|
import { Rank, Search } from "@element-plus/icons-vue";
|
||||||
import { collapseList } from "../config";
|
import { collapseList } from "../config";
|
||||||
|
|
||||||
|
const props = defineProps({ flowId: String })
|
||||||
|
|
||||||
const keyword = ref("");
|
const keyword = ref("");
|
||||||
const activeNames = ref(collapseList[0] ? [collapseList[0].collapseTitle] : []);
|
const activeNames = ref(collapseList[0] ? [collapseList[0].collapseTitle] : []);
|
||||||
const totalCount = computed(() => collapseList.reduce((total, group) => total + group.nodeList.length, 0));
|
const totalCount = computed(() => 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);
|
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 对应的数据或交互;作用范围仅限当前组件或模块。
|
* 处理 handleDragCustom 对应的数据或交互;作用范围仅限当前组件或模块。
|
||||||
* @param {*} event 触发操作的浏览器事件
|
* @param {*} event 触发操作的浏览器事件
|
||||||
@ -86,6 +95,14 @@ watch(keyword, (value) => {
|
|||||||
*/
|
*/
|
||||||
const handleDragCustom = (event, node) => {
|
const handleDragCustom = (event, node) => {
|
||||||
event.dataTransfer.effectAllowed = "copy";
|
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));
|
event.dataTransfer.setData("flowNode", JSON.stringify(node));
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -96,6 +96,16 @@ const inspectionEventTypes = () => {
|
|||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const corpus_type = () => {
|
||||||
|
return [{
|
||||||
|
value: 'zh-CN',
|
||||||
|
label: '中文'
|
||||||
|
}, {
|
||||||
|
value: 'en-US',
|
||||||
|
label: '英文'
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
|
||||||
export const collapseList = [
|
export const collapseList = [
|
||||||
{
|
{
|
||||||
collapseTitle: "相机",
|
collapseTitle: "相机",
|
||||||
@ -133,11 +143,6 @@ export const collapseList = [
|
|||||||
outputParams: [],
|
outputParams: [],
|
||||||
outputType: 'json'
|
outputType: 'json'
|
||||||
},
|
},
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
collapseTitle: "录像",
|
|
||||||
nodeList: [
|
|
||||||
{
|
{
|
||||||
icon: videoSvg,
|
icon: videoSvg,
|
||||||
name: "开启录像",
|
name: "开启录像",
|
||||||
@ -194,20 +199,6 @@ export const collapseList = [
|
|||||||
action: 'STOP_LOOP',
|
action: 'STOP_LOOP',
|
||||||
desc: "用于立即终止当前所在的循环,跳出循环体",
|
desc: "用于立即终止当前所在的循环,跳出循环体",
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// icon: startSvg,
|
|
||||||
// name: "单次循环开始",
|
|
||||||
// type: "subStart",
|
|
||||||
// action: 'SUB_START',
|
|
||||||
// desc: "循环体内部工作流的开始节点,开始循环体内部的单次流程",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// icon: endSvg,
|
|
||||||
// name: "单次循环结束",
|
|
||||||
// type: "subEnd",
|
|
||||||
// action: 'SUB_END',
|
|
||||||
// desc: "循环体内部工作流的终止节点,结束循环体内部的单次流程",
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
icon: switchSvg,
|
icon: switchSvg,
|
||||||
name: "分支",
|
name: "分支",
|
||||||
@ -303,6 +294,20 @@ function handler(params) {
|
|||||||
], desc: '当前循环对象', }
|
], 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: "通用指令",
|
name: "通用指令",
|
||||||
type: "deviceUniversal",
|
type: "deviceUniversal",
|
||||||
desc: "执行设备通用指令",
|
desc: "执行设备通用指令",
|
||||||
|
show: __PROJECT_NAME__ === 'aima',
|
||||||
action: 'DEVICE_EXECUTE_JSON_COMMAND',
|
action: 'DEVICE_EXECUTE_JSON_COMMAND',
|
||||||
nodeType: 'EDGE',
|
nodeType: 'EDGE',
|
||||||
nodeParams: [
|
nodeParams: [
|
||||||
@ -356,6 +362,7 @@ function handler(params) {
|
|||||||
name: "动作队列",
|
name: "动作队列",
|
||||||
type: "actionQueue",
|
type: "actionQueue",
|
||||||
desc: "在边缘端按顺序连续执行多个动作",
|
desc: "在边缘端按顺序连续执行多个动作",
|
||||||
|
show: __PROJECT_NAME__ === 'aima',
|
||||||
action: 'SYSTEM_EXECUTE_ACTION_QUEUE',
|
action: 'SYSTEM_EXECUTE_ACTION_QUEUE',
|
||||||
nodeType: 'EDGE',
|
nodeType: 'EDGE',
|
||||||
nodeParams: [
|
nodeParams: [
|
||||||
@ -564,6 +571,7 @@ function handler(params) {
|
|||||||
name: "视频智能分析",
|
name: "视频智能分析",
|
||||||
type: "mediaAnalysis",
|
type: "mediaAnalysis",
|
||||||
desc: "按分析场景理解测试录像并输出结构化结论",
|
desc: "按分析场景理解测试录像并输出结构化结论",
|
||||||
|
show: __PROJECT_NAME__ === 'aima',
|
||||||
action: "VIDEO_ANALYZE",
|
action: "VIDEO_ANALYZE",
|
||||||
nodeType: "LLM",
|
nodeType: "LLM",
|
||||||
nodeParams: [
|
nodeParams: [
|
||||||
@ -597,6 +605,7 @@ function handler(params) {
|
|||||||
name: "通用图片分析",
|
name: "通用图片分析",
|
||||||
type: "imageAnalysis",
|
type: "imageAnalysis",
|
||||||
desc: "按照提示词分析一张或多张图片并返回指定内容",
|
desc: "按照提示词分析一张或多张图片并返回指定内容",
|
||||||
|
show: __PROJECT_NAME__ === 'aima',
|
||||||
action: 'IMAGE_ANALYZE',
|
action: 'IMAGE_ANALYZE',
|
||||||
nodeType: "LLM",
|
nodeType: "LLM",
|
||||||
nodeParams: [
|
nodeParams: [
|
||||||
@ -666,6 +675,7 @@ function handler(params) {
|
|||||||
type: "sdAgent",
|
type: "sdAgent",
|
||||||
desc: "通过apiKey调用商道大模型",
|
desc: "通过apiKey调用商道大模型",
|
||||||
action: 'AI_AGENT_PLATFORM',
|
action: 'AI_AGENT_PLATFORM',
|
||||||
|
show: __PROJECT_NAME__ === 'cmvr',
|
||||||
nodeType: "LLM",
|
nodeType: "LLM",
|
||||||
outputType: 'json',
|
outputType: 'json',
|
||||||
nodeParams: [
|
nodeParams: [
|
||||||
|
|||||||
@ -118,7 +118,7 @@
|
|||||||
</el-header>
|
</el-header>
|
||||||
<el-container class="container">
|
<el-container class="container">
|
||||||
<el-aside v-if="!flowStore.disableForm">
|
<el-aside v-if="!flowStore.disableForm">
|
||||||
<Aside />
|
<Aside :flowId="flowInfoData.itemId" />
|
||||||
</el-aside>
|
</el-aside>
|
||||||
<el-main>
|
<el-main>
|
||||||
<div class="canvas-toolbar">
|
<div class="canvas-toolbar">
|
||||||
|
|||||||
@ -22,6 +22,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #output>
|
<template #output>
|
||||||
<div v-if="nodeOperatingStatus != 'FAILED'">
|
<div v-if="nodeOperatingStatus != 'FAILED'">
|
||||||
|
{{ props.properties.outputType }}
|
||||||
<JsonViewer
|
<JsonViewer
|
||||||
v-if="!['img', 'video', 'audio'].includes(props.properties.outputType)"
|
v-if="!['img', 'video', 'audio'].includes(props.properties.outputType)"
|
||||||
:value="outputJsonData"
|
:value="outputJsonData"
|
||||||
@ -184,6 +185,7 @@ onMounted(() => {
|
|||||||
output = data.paramsOut || {};
|
output = data.paramsOut || {};
|
||||||
}
|
}
|
||||||
inputJsonData.value = inputData;
|
inputJsonData.value = inputData;
|
||||||
|
console.log('output', output)
|
||||||
outputJsonData.value = output;
|
outputJsonData.value = output;
|
||||||
emits("contentChange");
|
emits("contentChange");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user