diff --git a/src/views/error/401.vue b/src/views/error/401.vue deleted file mode 100644 index b361368..0000000 --- a/src/views/error/401.vue +++ /dev/null @@ -1,82 +0,0 @@ - - - - - diff --git a/src/views/error/404.vue b/src/views/error/404.vue deleted file mode 100644 index f205303..0000000 --- a/src/views/error/404.vue +++ /dev/null @@ -1,227 +0,0 @@ - - - - - diff --git a/src/views/flow/components/ActionQueueSingleRun.vue b/src/views/flow/components/ActionQueueSingleRun.vue deleted file mode 100644 index baf3a56..0000000 --- a/src/views/flow/components/ActionQueueSingleRun.vue +++ /dev/null @@ -1,281 +0,0 @@ - - - - - diff --git a/src/views/flow/components/Aside.vue b/src/views/flow/components/Aside.vue deleted file mode 100644 index a818eef..0000000 --- a/src/views/flow/components/Aside.vue +++ /dev/null @@ -1,251 +0,0 @@ - - - - - - diff --git a/src/views/flow/components/FormItemRecursive.vue b/src/views/flow/components/FormItemRecursive.vue deleted file mode 100644 index 7c0e324..0000000 --- a/src/views/flow/components/FormItemRecursive.vue +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - - diff --git a/src/views/flow/components/LoopIterationResults.vue b/src/views/flow/components/LoopIterationResults.vue deleted file mode 100644 index cb311a6..0000000 --- a/src/views/flow/components/LoopIterationResults.vue +++ /dev/null @@ -1,217 +0,0 @@ - - - - - diff --git a/src/views/flow/components/NodeState.vue b/src/views/flow/components/NodeState.vue deleted file mode 100644 index d53e966..0000000 --- a/src/views/flow/components/NodeState.vue +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - - - diff --git a/src/views/flow/components/NodeTitle.vue b/src/views/flow/components/NodeTitle.vue deleted file mode 100644 index f8e4e76..0000000 --- a/src/views/flow/components/NodeTitle.vue +++ /dev/null @@ -1,338 +0,0 @@ - - - - - - diff --git a/src/views/flow/components/OuterNode.vue b/src/views/flow/components/OuterNode.vue deleted file mode 100644 index 0cdc977..0000000 --- a/src/views/flow/components/OuterNode.vue +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - diff --git a/src/views/flow/components/ParamsDrawer.vue b/src/views/flow/components/ParamsDrawer.vue deleted file mode 100644 index d26cd31..0000000 --- a/src/views/flow/components/ParamsDrawer.vue +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - diff --git a/src/views/flow/components/RuntimeAssignmentsEditor.vue b/src/views/flow/components/RuntimeAssignmentsEditor.vue deleted file mode 100644 index 96a41e3..0000000 --- a/src/views/flow/components/RuntimeAssignmentsEditor.vue +++ /dev/null @@ -1,411 +0,0 @@ - - - - - - diff --git a/src/views/flow/components/RuntimeParamsEditor.vue b/src/views/flow/components/RuntimeParamsEditor.vue deleted file mode 100644 index 2b8784a..0000000 --- a/src/views/flow/components/RuntimeParamsEditor.vue +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - diff --git a/src/views/flow/components/SubFlowExecutionResults.vue b/src/views/flow/components/SubFlowExecutionResults.vue deleted file mode 100644 index 54f6c45..0000000 --- a/src/views/flow/components/SubFlowExecutionResults.vue +++ /dev/null @@ -1,173 +0,0 @@ - - - - - diff --git a/src/views/flow/components/TaskExecutionLog.vue b/src/views/flow/components/TaskExecutionLog.vue deleted file mode 100644 index c698d7d..0000000 --- a/src/views/flow/components/TaskExecutionLog.vue +++ /dev/null @@ -1,889 +0,0 @@ - - - - - diff --git a/src/views/flow/components/TestRun.vue b/src/views/flow/components/TestRun.vue deleted file mode 100644 index c823b81..0000000 --- a/src/views/flow/components/TestRun.vue +++ /dev/null @@ -1,319 +0,0 @@ - - - - - - diff --git a/src/views/flow/components/params/ActionQueueParams.vue b/src/views/flow/components/params/ActionQueueParams.vue deleted file mode 100644 index 104bc86..0000000 --- a/src/views/flow/components/params/ActionQueueParams.vue +++ /dev/null @@ -1,585 +0,0 @@ - - - - - diff --git a/src/views/flow/components/params/BasicNodeParams.vue b/src/views/flow/components/params/BasicNodeParams.vue deleted file mode 100644 index dfb1413..0000000 --- a/src/views/flow/components/params/BasicNodeParams.vue +++ /dev/null @@ -1,598 +0,0 @@ - - - - - - diff --git a/src/views/flow/components/params/CodeNodeParams.vue b/src/views/flow/components/params/CodeNodeParams.vue deleted file mode 100644 index bdac619..0000000 --- a/src/views/flow/components/params/CodeNodeParams.vue +++ /dev/null @@ -1,501 +0,0 @@ - - - - - - diff --git a/src/views/flow/components/params/DeviceUniversal.vue b/src/views/flow/components/params/DeviceUniversal.vue deleted file mode 100644 index b3f1b95..0000000 --- a/src/views/flow/components/params/DeviceUniversal.vue +++ /dev/null @@ -1,521 +0,0 @@ - - - - - - diff --git a/src/views/flow/components/params/EndParams.vue b/src/views/flow/components/params/EndParams.vue deleted file mode 100644 index a80fdf7..0000000 --- a/src/views/flow/components/params/EndParams.vue +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - diff --git a/src/views/flow/components/params/HttpNodeParams.vue b/src/views/flow/components/params/HttpNodeParams.vue deleted file mode 100644 index b3417fb..0000000 --- a/src/views/flow/components/params/HttpNodeParams.vue +++ /dev/null @@ -1,704 +0,0 @@ - - - - - - diff --git a/src/views/flow/components/params/ImageAnalysisParams.vue b/src/views/flow/components/params/ImageAnalysisParams.vue deleted file mode 100644 index 779cfad..0000000 --- a/src/views/flow/components/params/ImageAnalysisParams.vue +++ /dev/null @@ -1,431 +0,0 @@ - - - - - - diff --git a/src/views/flow/components/params/MediaAnalysisParams.vue b/src/views/flow/components/params/MediaAnalysisParams.vue deleted file mode 100644 index b53d4af..0000000 --- a/src/views/flow/components/params/MediaAnalysisParams.vue +++ /dev/null @@ -1,567 +0,0 @@ - - - - - - diff --git a/src/views/flow/components/params/RecognizeNodeParams.vue b/src/views/flow/components/params/RecognizeNodeParams.vue deleted file mode 100644 index b339d05..0000000 --- a/src/views/flow/components/params/RecognizeNodeParams.vue +++ /dev/null @@ -1,387 +0,0 @@ - - - - - - diff --git a/src/views/flow/components/params/RobotExecutionTarget.vue b/src/views/flow/components/params/RobotExecutionTarget.vue deleted file mode 100644 index b87c223..0000000 --- a/src/views/flow/components/params/RobotExecutionTarget.vue +++ /dev/null @@ -1,120 +0,0 @@ - - - - - diff --git a/src/views/flow/components/params/SdAgentNodeParams.vue b/src/views/flow/components/params/SdAgentNodeParams.vue deleted file mode 100644 index 64a580d..0000000 --- a/src/views/flow/components/params/SdAgentNodeParams.vue +++ /dev/null @@ -1,390 +0,0 @@ - - - - - - diff --git a/src/views/flow/components/params/StartParams.vue b/src/views/flow/components/params/StartParams.vue deleted file mode 100644 index cf68381..0000000 --- a/src/views/flow/components/params/StartParams.vue +++ /dev/null @@ -1,233 +0,0 @@ - - - - - - diff --git a/src/views/flow/components/params/SubFlowParams.vue b/src/views/flow/components/params/SubFlowParams.vue deleted file mode 100644 index 65c60d8..0000000 --- a/src/views/flow/components/params/SubFlowParams.vue +++ /dev/null @@ -1,291 +0,0 @@ - - - - - - diff --git a/src/views/flow/components/params/SwitchNodeParams.vue b/src/views/flow/components/params/SwitchNodeParams.vue deleted file mode 100644 index 2073e29..0000000 --- a/src/views/flow/components/params/SwitchNodeParams.vue +++ /dev/null @@ -1,413 +0,0 @@ - - - - - - diff --git a/src/views/flow/components/params/useQuote.js b/src/views/flow/components/params/useQuote.js deleted file mode 100644 index 35c9861..0000000 --- a/src/views/flow/components/params/useQuote.js +++ /dev/null @@ -1,43 +0,0 @@ -import { ref } from 'vue' -import { getUpstreamInput } from '@/utils/flow' - -export function useQuote(nodeId) { - const quoteOptions = ref([]) - const cascaderRefs = ref([]) - - const refreshQuoteOptions = () => { - quoteOptions.value = getUpstreamInput(nodeId) || [] - } - - // The option tree must exist before Cascader can render a persisted path. - refreshQuoteOptions() - - const handleTypeChange = (property) => { - if (!property) return - if (property.type === 'input') { - property.quote = [] - } else { - property.input = '' - refreshQuoteOptions() - } - } - - const cascaderChange = (value, property) => { - if (!property) return - property.quote = Array.isArray(value) ? [...value] : [] - property.quoteType = value?.[1] === 'input' ? 'input' : 'output' - } - - const visibleChange = (visible) => { - if (visible) refreshQuoteOptions() - } - - return { - quoteOptions, - cascaderRefs, - handleTypeChange, - cascaderChange, - visibleChange, - refreshQuoteOptions, - } -} diff --git a/src/views/flow/composables/useFlowEvents.js b/src/views/flow/composables/useFlowEvents.js deleted file mode 100644 index 39353ae..0000000 --- a/src/views/flow/composables/useFlowEvents.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * 文件说明:流程事件订阅组合逻辑,并在卸载时释放监听器。 - * 作用范围:仅服务于流程设计器模块。 - */ -import { onUnmounted } from "vue"; -import { emitter } from "@/utils/eventBus"; - -export const useFlowEvents = () => { - const listeners = []; - - /** - * 订阅 onFlowEvent 对应的数据或交互;作用范围仅限当前组件或模块。 - * @param {*} type 目标类型 - * @param {*} handler 事件处理函数 - */ - const onFlowEvent = (type, handler) => { - emitter.on(type, handler); - listeners.push([type, handler]); - }; - - onUnmounted(() => { - listeners.forEach(([type, handler]) => emitter.off(type, handler)); - listeners.length = 0; - }); - - return { onFlowEvent }; -}; diff --git a/src/views/flow/config.js b/src/views/flow/config.js deleted file mode 100644 index cb7451c..0000000 --- a/src/views/flow/config.js +++ /dev/null @@ -1,897 +0,0 @@ -/** - * 文件说明:定义流程设计器可用的节点、表单字段及下拉选项等静态配置。 - * 作用范围:仅服务于流程设计器模块。 - */ -import cameraSvg from './icon/camera.svg' -import videoSvg from './icon/video.svg' -import loopSvg from './icon/loop.svg' -import stopLoopSvg from './icon/stopLoop.svg' -import switchSvg from './icon/switch.svg' -import microphoneSvg from './icon/microphone.svg' -import sleepSvg from './icon/sleep.svg' -import planSvg from './icon/plan.svg' -import awakenSvg from './icon/awaken.svg' -import dialogueSvg from './icon/dialogue.svg' -import audioSvg from './icon/audio.svg' -import touchSvg from './icon/touch.svg' -import expressionSvg from './icon/expression.svg' - -/** - * 处理与 http method options 相关的状态或数据,该影响范围仅限当前模块。 - */ -const httpMethodOptions = () => { - return [{ - value: 'POST', - label: 'POST' - }, { - value: 'GET', - label: 'GET' - }, { - value: 'PUT', - label: 'PUT' - }, { - value: 'DELETE', - label: 'DELETE' - }] -} - -/** - * 处理与 express options 相关的状态或数据,该影响范围仅限当前模块。 - */ -const expressOptions = () => { - return [{ - value: 1, - label: '高兴' - }, { - value: 2, - label: '惊讶' - }, { - value: 3, - label: '愤怒' - }, { - value: 4, - label: '悲伤' - }, { - value: 5, - label: '睡觉' - }, { - value: 6, - label: '打哈欠' - }] -} - -/** - * 处理与 task type options 相关的状态或数据,该影响范围仅限当前模块。 - */ -const taskTypeOptions = () => { - return [{ - value: 'voice', - label: '语音交互' - }, { - value: 'touch', - label: '触控交互' - }] -} - -/** - * 处理与 voice options 相关的状态或数据,该影响范围仅限当前模块。 - */ -const voiceOptions = () => { - return [{ - value: 'x4_xiaoyan', - label: 'x4_xiaoyan' - }] -} - -/** - * 处理与 inspection event types 相关的状态或数据,该影响范围仅限当前模块。 - */ -const inspectionEventTypes = () => { - return [{ - value: 'No-Glove', - label: '没戴手套' - }, { - value: 'No-Helmet-Glove', - label: '没戴头盔' - }] -} - -export const collapseList = [ - { - collapseTitle: "相机", - nodeList: [ - { - icon: cameraSvg, - name: "开启相机", - type: "serviceNode", - desc: "在获取相机照片时,需要先启动相机", - action: 'CAMERA_START', - nodeType: 'EDGE', - nodeParams: [], - outputParams: [], - outputType: 'json' - }, - { - icon: cameraSvg, - name: "获取图片", - type: "serviceNode", - desc: "获取相机拍摄的照片", - action: 'CAMERA_GETRGBIMAGE', - nodeType: 'EDGE', - nodeParams: [], - outputType: 'img', - outputParams: [{ name: 'imageUrl', type: 'array', desc: '图片地址数组', children: [], disabled: true }] - }, - { - icon: cameraSvg, - name: "关闭相机", - type: "serviceNode", - desc: "获取相机照片后,关闭该相机", - action: 'CAMERA_STOP', - nodeType: 'EDGE', - nodeParams: [], - outputParams: [], - outputType: 'json' - }, - ], - }, - { - collapseTitle: "录像", - nodeList: [ - { - icon: videoSvg, - name: "开启录像", - type: "serviceNode", - desc: "开启摄像头,并开始录像", - action: 'CAMERA_RECORDING_START', - nodeType: 'EDGE', - nodeParams: [], - outputParams: [], - outputType: 'json' - }, - { - icon: videoSvg, - name: "结束录像", - type: "serviceNode", - desc: "停止录像,并关闭摄像头", - action: 'CAMERA_RECORDING_STOP', - nodeType: 'EDGE', - nodeParams: [], - outputType: 'video', - outputParams: [{ name: 'videoUrl', type: 'array', children: [], desc: '视频播放地址数组', disabled: true}] - } - ], - }, - { - collapseTitle: "功能", - nodeList: [ - { - icon: loopSvg, - name: "循环", - type: "loop", - action: 'START_LOOP', - desc: "实现对列表对象循环执行一系列任务", - nodeParams: [{ name: "loopNum", type: "input", input: null, quote: "" }], - outputParams: [], - outputType: 'json' - }, - { - icon: planSvg, - name: "子流程", - type: "subFlow", - action: 'SUB_FLOW', - nodeType: 'NONE', - desc: "执行同一项目中已发布的工作流", - subFlow: {}, - nodeParams: [], - outputParams: [], - outputType: 'json' - }, - { - icon: stopLoopSvg, - name: "结束循环", - type: "stopLoop", - 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: "分支", - type: "branch", - action: 'BRANCH', - desc: "连接多个下游分支,根据设定的条件按照顺序查找的方式来匹配运行的分支,如果匹配到某条件则只运行该条件对应的分支,否则继续匹配下一条件直至结束", - }, - { - icon: sleepSvg, - name: "睡眠", - type: "sleep", - desc: "用于睡眠整个流程,表示延迟多少毫秒", - action: 'sleep', - nodeParams: [ - { name: "delayMs", type: "input", componentType: 'number', input: 0, disabled: true } - ], - outputParams: [], - outputType: 'json' - }, - { - icon: expressionSvg, - name: "HTTP请求", - type: "http", - desc: "HTTP请求", - action: 'HTTP', - nodeType: 'HTTP', - nodeParams: [ - { name: "config", type: "input", input: "", children: [ - { name: "url", type: "input", input: "", disabled: true, required: true }, - { name: "method", type: "input", input: "POST", componentType: 'select', selectOptions: httpMethodOptions(), disabled: true }, - { name: "timeout", type: "input", input: "10000", componentType: 'number', required: false, disabled: true } - ], disabled: true, required: true }, - { name: "headers", type: "input", input: "", children: [ - { name: "", type: "input", input: ""} - ], disabled: true, required: true }, - { name: "params", type: "input", input: "", children: [ - { name: "", type: "input", input: ""} - ], disabled: true, required: true }, - { name: "body", type: "input", input: "", children: [ - { name: 'bodyType', type: "input", input: "json", disabled: true }, - { name: 'json', type: "input", input: '{"a": 123}' }, - { name: 'formData', type: "input", input: "", children: []} - ], required: true }, - ], - outputType: 'json', - outputParams: [{ name: 'result', type: 'Object', children: [], desc: 'HTTP请求结果'}] - }, - { - icon: expressionSvg, - name: "代码", - type: "code", - desc: "js代码", - action: 'CODE', - canAddFormItem: true, - nodeParams: [ - { name: "input", type: "input", input: "", required: true }, - { name: "code", type: "input", input: ` -// 方法定义不能修改 -/** - * 处理与 r 相关的状态或数据,该影响范围仅限当前模块。 - * @param {*} params 待处理的参数集合 - */ -function handler(params) { - // 返回值是一个可序列化成 json 的 dict 或 object - const result ={ - type: 2, - message: params.input - } - return result -} - `, required: true } - ], - outputType: 'json', - outputParams: [{ name: 'result', type: 'object', children: [ - {name: 'type', type: 'number', desc: '占位属性'}, - {name: 'message', type: 'string', desc: '占位属性'} - ], desc: 'js节点返回'}] - }, - { - icon: microphoneSvg, - name: "获取当前循环对象", - type: "currentLoop", - desc: "获取当前循环对象", - action: 'GET_CURRENT_OBJECT', - nodeParams: [ - { name: "array", type: "input", input: "" } - ], - outputType: 'json', - outputParams: [ - { name: 'index', type: 'number', desc: '索引'}, - { name: 'object', type: 'object', children: [ - { name: 'test', type: 'string', desc: '占位属性' } - ], desc: '当前循环对象', } - ] - }, - ], - }, - { - collapseTitle: "机器人", - nodeList: [ - { - icon: videoSvg, - name: "AGV控制", - type: "serviceNode", - desc: "控制机器人的底盘", - action: 'AGV_MOVE_TO_POINT', - nodeType: 'EDGE', - nodeParams: [ - { name: "x", type: "input", input: "", disabled: true }, - { name: "y", type: "input", input: "", disabled: true }, - { name: "theta", type: "input", input: "", disabled: true }, - { name: "blockedTimeoutMs", type: "input", componentType: "number", input: 60000, min: 1, required: true, disabled: true }, - ], - outputType: 'json' - }, - { - icon: videoSvg, - name: "AGV站点导航", - type: "serviceNode", - desc: "从AGV站点列表选择目标站点并导航", - action: 'AGV_MOVE_TO_STATION', - nodeType: 'EDGE', - nodeParams: [ - { name: "stationId", type: "input", input: "", componentType: 'select', selectOptions: [], forceSelect: true, disabled: true }, - { name: "blockedTimeoutMs", type: "input", componentType: "number", input: 60000, min: 1, required: true, disabled: true } - ], - outputType: 'json' - }, - { - icon: cameraSvg, - name: "通用指令", - type: "deviceUniversal", - desc: "执行设备通用指令", - action: 'DEVICE_EXECUTE_JSON_COMMAND', - nodeType: 'EDGE', - nodeParams: [ - { name: "requestJson", type: "input", input: `{ - "a":123 -}`, required: false, disabled: true }, - ], - outputParams: [], - outputType: 'json' - }, - { - icon: planSvg, - name: "动作队列", - type: "actionQueue", - desc: "在边缘端按顺序连续执行多个动作", - action: 'SYSTEM_EXECUTE_ACTION_QUEUE', - nodeType: 'EDGE', - nodeParams: [ - { name: "actionId", type: "input", input: "", required: false }, - { name: "totalTimeoutMs", type: "input", componentType: 'number', input: 60000, required: true }, - { name: "steps", type: "input", input: [], required: true }, - ], - outputParams: [ - { name: 'actionId', type: 'string', desc: '动作队列标识' }, - { name: 'completedSteps', type: 'number', desc: '已完成步骤数' }, - { name: 'result', type: 'string', desc: '执行结果' }, - ], - outputType: 'json' - }, - { - icon: videoSvg, - name: "机械臂", - type: "serviceNode", - desc: "控制机器人的手臂", - action: 'ARM_MOVE_TO_POINT', - nodeType: 'EDGE', - nodeParams: [ - { name: "x", type: "input", input: "", disabled: true }, - { name: "y", type: "input", input: "", disabled: true }, - { name: "z", type: "input", input: "", disabled: true }, - { name: "rx", type: "input", input: "", disabled: true }, - { name: "ry", type: "input", input: "", disabled: true }, - { name: "rz", type: "input", input: "", disabled: true }, - { name: "velocity", type: "input", componentType: 'number', max: 5, step: 0.01, input: 0.1, disabled: true }, - { name: "acceleration", type: "input", componentType: 'number', max: 5, step: 0.01, input: 0.2, disabled: true }, - ], - outputType: 'json' - }, - { - icon: videoSvg, - name: "机械臂关节运动", - type: "serviceNode", - desc: "通过关节空间插值运动到目标关节位置", - action: 'ARM_MOVE_TO_J', - nodeType: 'EDGE', - nodeParams: [ - { name: "target", type: "input", input: "[0, 0, 0, 0, 0, 0]", disabled: true }, - { name: "velocity", type: "input", componentType: 'number', max: 5, step: 0.01, input: 0.1, disabled: true }, - { name: "acceleration", type: "input", componentType: 'number', max: 5, step: 0.01, input: 0.2, disabled: true }, - ], - outputType: 'json' - }, - // 使能状态由两个独立节点显式控制。节点本身不接收参数,也不依赖前一运动节点的隐式使能, - // 因而可在流程开始、异常恢复或任务收尾位置按业务需要自由编排。 - { - icon: videoSvg, - name: "开启机械臂使能", - type: "serviceNode", - desc: "开启机械臂使能,后续运动节点不会自动使能", - action: 'ARM_ENABLE', - nodeType: 'EDGE', - nodeParams: [], - outputParams: [], - outputType: 'json' - }, - // 关闭节点与开启节点使用不同 action,边缘执行器据此下发去使能指令; - // 空 outputParams 表示该节点只负责设备状态切换,不向后续节点暴露业务输出。 - { - icon: videoSvg, - name: "关闭机械臂使能", - type: "serviceNode", - desc: "关闭机械臂使能", - action: 'ARM_DISABLE', - nodeType: 'EDGE', - nodeParams: [], - outputParams: [], - outputType: 'json' - }, - { - icon: cameraSvg, - name: "开始监听报警事件", - type: "serviceNode", - desc: "开始监听报警事件", - action: 'INSPECTION_ALERT_LISTEN_START', - nodeType: 'EDGE', - nodeParams: [ - { name: "robotId", type: "input", input: "", disabled: true }, - { name: "eventTypes", type: "input", input: "", componentType: 'select', selectOptions: inspectionEventTypes(), disabled: true } - ], - outputParams: [], - outputType: 'json' - }, - { - icon: cameraSvg, - name: "结束监听报警事件", - type: "serviceNode", - desc: "结束监听报警事件", - action: 'INSPECTION_ALERT_LISTEN_STOP', - nodeType: 'EDGE', - nodeParams: [ - { name: "robotId", type: "input", input: "", disabled: true }, - { name: "eventTypes", type: "input", input: "", componentType: 'select', selectOptions: inspectionEventTypes(), disabled: true } - ], - outputParams: [], - outputType: 'json' - }, - { - icon: dialogueSvg, - name: "巡检仪表读数识别", - type: "recognize", - desc: "巡检仪表读数识别", - action: 'INSPECTION_METER_RECOGNIZE', - nodeType: "LLM", - outputType: 'json', - nodeParams: [ - { name: 'imageUrl', type: "input", input: "", disabled: true }, - { name: 'resultName', type: "input", input: "", disabled: true }, - { name: "alarmRules", type: "input", input: [], disabled: true } - ], - outputParams: [] - }, - { - icon: cameraSvg, - name: "人工巡检判断", - type: "serviceNode", - desc: "创建人工巡检判断任务", - action: 'INSPECTION_MANUAL_REVIEW_CREATE', - nodeType: 'EDGE', - nodeParams: [ - { name: "resultName", type: "input", input: "", disabled: true }, - { name: "videoUrl", type: "input", input: "", required: false, disabled: true }, - { name: "imageUrl", type: "input", input: "", required: false, disabled: true }, - { name: "reviewCriteria", type: "input", input: "", disabled: true }, - { name: "defaultAlarmLevel", type: "input", componentType: 'number', max: 3, step: 1, input: 1, disabled: true }, - ], - outputParams: [], - outputType: 'json' - }, - ], - }, - { - collapseTitle: "音频", - nodeList: [ - { - icon: microphoneSvg, - name: "启动麦克风", - type: "serviceNode", - desc: "用于启动麦克风的节点", - action: 'MICROPHONE_START', - nodeType: 'EDGE', - nodeParams: [], - outputType: 'json' - }, - { - icon: microphoneSvg, - name: "停止麦克风", - type: "serviceNode", - desc: "用于停止麦克风的节点", - action: 'MICROPHONE_STOP', - nodeType: 'EDGE', - nodeParams: [], - outputType: 'audio', - outputParams: [{ name: 'audioUrl', type: 'array', children: [], desc: '录音播放地址数组', disabled: true }] - }, - { - icon: audioSvg, - name: "播放音频", - type: "serviceNode", - desc: "用于播放音频的节点", - action: 'SPEAKER_PLAYAUDIO', - nodeType: 'EDGE', - nodeParams: [ - { name: "audioPath", type: "input", input: "", disabled: true } - ], - outputType: 'json' - }, - ], - }, - { - collapseTitle: "大模型", - nodeList: [ - { - icon: microphoneSvg, - name: "声音类型检测", - type: "mediaAnalysis", - desc: "判断录音是否属于指定的声音类型", - action: "AUDIO_EVENT_CLASSIFY", - nodeType: "LLM", - nodeParams: [ - { name: "profileCode", type: "input", input: "aima.power_state.v1", required: true, disabled: true }, - { name: "expectedLabel", type: "input", input: "", required: true, disabled: true }, - { name: "expectedLabelName", type: "input", input: "", required: false, disabled: true }, - { name: "audioUrl", type: "quote", input: "", quote: "", required: true, disabled: true }, - { name: "asynchronous", type: "input", input: false, required: false, disabled: true, componentType: "switch" }, - ], - outputType: "json", - outputParams: [ - { name: "passed", type: "boolean", desc: "是否检测到目标声音", disabled: true }, - { name: "expectedLabel", type: "string", desc: "目标声音类型编码", disabled: true }, - { name: "expectedLabelName", type: "string", desc: "目标声音类型名称", disabled: true }, - { name: "label", type: "string", desc: "实际声音类型编码,未匹配时为UNKNOWN", disabled: true }, - { name: "labelName", type: "string", desc: "实际声音类型名称", disabled: true }, - { name: "matched", type: "boolean", desc: "是否识别到已知声音", disabled: true }, - { name: "confidence", type: "number", desc: "最高匹配度", disabled: true }, - { name: "decisionReason", type: "string", desc: "检测结论", disabled: true }, - { name: "scores", type: "object", desc: "各分类匹配度", children: [], disabled: true }, - ], - }, - { - icon: videoSvg, - name: "视频智能分析", - type: "mediaAnalysis", - desc: "按分析场景理解测试录像并输出结构化结论", - action: "VIDEO_ANALYZE", - nodeType: "LLM", - nodeParams: [ - { name: "profileCode", type: "input", input: "aima.power_video.v1", required: true, disabled: true }, - { name: "videoUrl", type: "quote", input: "", quote: "", required: true, disabled: true }, - { name: "instruction", type: "input", input: "", required: true, disabled: true }, - { name: "analysisMode", type: "input", input: "AUTO", required: false, disabled: true }, - // 默认返回精简结论;用户开启详细输出时,执行端才补充事件证据。 - { name: "detailedOutput", type: "input", input: false, required: false, disabled: true, componentType: "switch" }, - { name: "analysisTuning", type: "input", input: { sampleFps: 2, maxWidth: 960, confidenceThreshold: 0.75, fallbackToAccurate: true }, required: false, disabled: true }, - { name: "asynchronous", type: "input", input: false, required: false, disabled: true, componentType: "switch" }, - ], - outputType: "json", - outputParams: [ - { name: "result", type: "string", desc: "分析结果", disabled: true }, - { name: "passed", type: "boolean", desc: "是否通过", disabled: true }, - { name: "confidence", type: "number", desc: "判定置信度", disabled: true }, - { name: "evidenceSufficient", type: "boolean", desc: "证据是否充分", disabled: true }, - { name: "decisionReason", type: "string", desc: "判定原因", disabled: true }, - { name: "conclusion", type: "string", desc: "分析结论", disabled: true }, - { name: "summary", type: "string", desc: "分析摘要", disabled: true }, - { name: "events", type: "array", desc: "关键事件", children: [], disabled: true }, - { name: "analysisMode", type: "string", desc: "实际分析模式", disabled: true }, - { name: "fallback", type: "boolean", desc: "是否切换精确分析", disabled: true }, - { name: "detailedOutput", type: "boolean", desc: "是否返回详细事件证据", disabled: true }, - ], - }, - { - // 通用图片分析不内置通过/不通过判定,返回结构完全由用户提示词约定。 - icon: cameraSvg, - name: "通用图片分析", - type: "imageAnalysis", - desc: "按照提示词分析一张或多张图片并返回指定内容", - action: 'IMAGE_ANALYZE', - nodeType: "LLM", - nodeParams: [ - { name: "profileCode", type: "input", input: "common.image_analysis.v1", required: true, disabled: true }, - { name: "imageUrl", type: "quote", input: "", quote: "", required: true, disabled: true }, - { name: "analysisMethod", type: "input", input: "VISION_MODEL", required: false, disabled: true }, - { name: "prompt", type: "input", input: "", required: true, disabled: true, componentType: "textarea" }, - { name: "analysisMode", type: "input", input: "FAST", required: false, disabled: true }, - { name: "analysisTuning", type: "input", input: { maxWidth: 896, maxImages: 12, maxOutputTokens: 384, matchThreshold: 0.48, matchSelector: "BEST", matchIndex: 1, matchSort: "ROW_MAJOR", locateConfidenceThreshold: 0.45 }, required: false, disabled: true }, - { name: "asynchronous", type: "input", input: false, required: false, disabled: true, componentType: "switch" }, - ], - outputType: "json", - outputParams: [ - { name: "result", type: "object", desc: "按提示词返回的结果", children: [], disabled: true }, - { name: "resultText", type: "string", desc: "模型返回的原始文本", disabled: true }, - { name: "matched", type: "boolean", desc: "找图是否匹配", disabled: true }, - { name: "matchScore", type: "number", desc: "匹配分数或定位置信度", disabled: true }, - { name: "coordinates", type: "array", desc: "原图坐标 [x1,y1,x2,y2]", children: [], disabled: true }, - { name: "center", type: "array", desc: "目标中心点 [x,y]", children: [], disabled: true }, - { name: "matchedDescription", type: "string", desc: "模型实际定位的目标描述", disabled: true }, - { name: "refinementMethod", type: "string", desc: "坐标精修方式", disabled: true }, - { name: "matchCount", type: "number", desc: "匹配项数量", disabled: true }, - { name: "matches", type: "array", desc: "全部匹配项", children: [], disabled: true }, - { name: "selectedMatchIndex", type: "number", desc: "当前选择的匹配序号", disabled: true }, - ], - }, - { - icon: microphoneSvg, - name: "获取触控坐标", - type: "serviceNode", - desc: "用于获取触控坐标的节点", - action: 'TOUCH_COORDINATES', - nodeType: "LLM", - nodeParams: [ - { name: "targetFeature", type: "input", input: "运动模式", disabled: true }, - { name: "manufacturer", type: "input", input: "xiaomi", disabled: true }, - { name: "vehType", type: "input", input: "su7", disabled: true }, - ], - outputType: 'json', - outputParams: [{ name: 'coordinates', type: 'object', children: [ - { name: 'x', type: 'number', desc: 'x坐标' }, - { name: 'y', type: 'number', desc: 'y坐标' } - ], desc: '坐标对象', }] - }, { - icon: dialogueSvg, - name: "tts语音合成", - type: "serviceNode", - desc: "将指令文本(text)处理合成语音,输出语音路径(audioPath)", - action: 'GENERATE_ADVANCED_AUDIO', - nodeType: "LLM", - outputType: 'json', - nodeParams: [{ name: 'text', type: "input", input: "", disabled: true }], - outputParams: [{ name: 'audioPath', type: 'string', desc: '语音路径', disabled: true}] - }, { - icon: dialogueSvg, - name: "意图识别", - type: "serviceNode", - desc: "意图识别,输出类型(type) 1: 语音交互 2: 触控交互 3: 闲聊 4: 知识问答", - action: 'INTENT_RECOGNITION', - nodeType: "LLM", - outputType: 'json', - nodeParams: [{ name: 'text', type: "input", input: "", disabled: true }], - outputParams: [{ name: 'type', type: 'string', desc: '1:语音交互 2:触控交互 3: 闲聊 4:知识问答', disabled: true}] - }, { - icon: dialogueSvg, - name: "商道智能体", - type: "sdAgent", - desc: "通过apiKey调用商道大模型", - action: 'AI_AGENT_PLATFORM', - nodeType: "LLM", - outputType: 'json', - nodeParams: [ - { name: "config", type: "input", input: "", children: [ - { name: 'apiKey', type: "input", input: "", disabled: true }, - { name: 'text', type: "input", input: "", disabled: true }, - ]}, - { name: 'invokeTts', type: "input", input: false }, - { name: 'tts', type: "input", input: "", children: [ - { name: 'url', type: "input", input: "", disabled: true }, - { name: 'text', type: "input", input: "", disabled: true }, - { name: 'speed', type: "input", input: "", max: 100, disabled: true }, - { name: 'voice', type: "input", input: "", componentType: 'select', selectOptions: voiceOptions(), disabled: true }, - { name: 'volume', type: "input", input: "", componentType: 'number', max: 100, disabled: true } - ], disabled: true } - ], - outputParams: [{ name: 'result', type: 'string', desc: '商道大模型的返回文案', disabled: true}] - }, { - icon: dialogueSvg, - name: "tts语音播放", - type: "serviceNode", - desc: "调用tts将文案转换为语音播放", - action: 'AI_TTS', - nodeType: "LLM", - outputType: 'json', - nodeParams: [ - { name: 'url', type: "input", input: "", disabled: true }, - { name: 'text', type: "input", input: "", disabled: true }, - { name: 'speed', type: "input", input: "", max: 100, disabled: true }, - { name: 'voice', type: "input", input: "", componentType: 'select', selectOptions: voiceOptions(), disabled: true }, - { name: 'volume', type: "input", input: "", componentType: 'number', max: 100, disabled: true } - ] - }, { - icon: dialogueSvg, - name: "获取当前页面名称", - type: "serviceNode", - desc: "获取当前页面名称", - action: 'GET_CURRENT_PAGE', - nodeType: "LLM", - outputType: 'json', - nodeParams: [ - { name: 'url', type: "input", input: "", disabled: true }, - ], - outputParams: [{ name: 'pageName', type: 'string', desc: '当前页面名称', disabled: true}] - } - ], - }, - { - collapseTitle: "语音交互", - nodeList: [ - { - icon: planSvg, - name: "方案处理", - type: "serviceNode", - desc: "语音交互-方案处理,输入方案id(schemeId),输出唤醒语料(wakeCorpus)和测试语料数组(testCorpus)", - action: 'VI_SCHEME', - nodeParams: [{ name: 'schemeId', type: "input", input: "", disabled: true }], - outputType: 'json', - outputParams: [ - { name: 'wakeCorpus', type: 'object', desc: '唤醒语料', children: []}, - { name: 'testCorpus', type: 'array', desc: '测试语料数组', children: []}, - { name: 'sceneType', type: 'number', desc: '1:唤醒测试,2:单次对话测试,3:连续对话测试', disabled: true } - ] - }, - { - icon: awakenSvg, - name: "唤醒语料", - type: "serviceNode", - desc: "唤醒语料处理,输入唤醒语料(wakeCorpus),输出语音路径(audioPath)", - action: 'VI_CORPUS_WAKE', - nodeType: "EDGE", - outputType: 'json', - nodeParams: [{ name: 'wakeCorpus', type: "input", input: "", disabled: true }], - outputParams: [{ name: 'audioPath', type: 'string', desc: '语音路径', disabled: true}] - }, - { - icon: dialogueSvg, - name: "单次对话语料", - type: "serviceNode", - desc: "测试语料-单次对话语料处理,输入单次对话语料(testCorpus),输出语音路径(audioPath)", - action: 'VI_CORPUS_SINGLE', - nodeType: "EDGE", - outputType: 'json', - nodeParams: [{ name: 'testCorpus', type: "input", input: "", disabled: true }], - outputParams: [{ name: 'audioPath', type: 'string', desc: '语音路径', disabled: true}] - }, - { - icon: dialogueSvg, - name: "连续对话语料", - type: "serviceNode", - desc: "测试语料-连续对话语料处理,输入连续对话语料(testCorpus),输出语音路径(audioPath)", - action: 'VI_CORPUS_CONTINUOUS', - nodeType: "EDGE", - outputType: 'json', - nodeParams: [{ name: 'testCorpus', type: "input", input: "", disabled: true }], - outputParams: [{ name: 'audioPath', type: 'string', desc: '语音路径', disabled: true}] - }, - { - icon: audioSvg, - name: "播放语料", - type: "serviceNode", - desc: "用于播放语料的节点,需要输入语音路径,执行设备由流程角色配置", - action: 'VI_PLAY_CORPUS', - nodeType: "EDGE", - outputType: 'json', - nodeParams: [ - { name: 'audioPath', type: "input", input: "", disabled: true }, - { name: 'bioId', type: "input", input: "", disabled: true, required: false } - ], - } - ], - }, - { - collapseTitle: "触控交互", - nodeList: [ - { - icon: touchSvg, - name: "触控", - type: "serviceNode", - desc: "去触控坐标的点位", - action: 'TOUCH', - nodeType: "EDGE", - nodeParams: [ - { name: "touchParams", type: "input", input: "", disabled: true } - ], - outputType: 'json', - }, - { - icon: expressionSvg, - name: "开始说话", - type: "serviceNode", - desc: "控制机器人说话", - action: 'BIO_HEAD_SPEAK_START', - nodeType: "EDGE", - nodeParams: [], - outputType: 'json', - }, - { - icon: expressionSvg, - name: "停止说话", - type: "serviceNode", - desc: "停止机器人说话", - action: 'BIO_HEAD_SPEAK_STOP', - nodeType: "EDGE", - nodeParams: [], - outputType: 'json', - }, - { - icon: expressionSvg, - name: "表情", - type: "serviceNode", - desc: "控制机器人的面部表情", - action: 'BIO_HEAD_SPECIAL_EXPRESSION', - nodeType: "EDGE", - nodeParams: [ - { name: "expressKey", type: "input",componentType: 'select', selectOptions: expressOptions(), disabled: true }, - ], - outputType: 'json', - }, - { - icon: touchSvg, - name: "路径搜索", - type: "serviceNode", - desc: "路径搜索", - action: 'TI_PATH_SEARCH', - nodeType: "EDGE", - nodeParams: [ - { name: "currentLocation", type: "input", input: "", disabled: true }, - { name: "funcId", type: "input", input: "", disabled: true }, - { name: "vehicleConfigId", type: "input", input: "", disabled: true }, - ], - outputType: 'json', - outputParams: [ - { name: 'nextLocation', type: 'string', desc: '下一路径位置', disabled: true}, - { name: 'isEnd', type: 'string', desc: '是否结束', disabled: true}, - { name: 'iconUrl', type: 'string', desc: '图标路径', disabled: true} - ] - }, - { - icon: touchSvg, - name: "获取触控二维坐标", - type: "serviceNode", - desc: "获取触控二维坐标", - action: 'TI_TOUCH_COORDINATES', - nodeType: "EDGE", - nodeParams: [ - { name: "imageUrl", type: "input", input: "", disabled: true }, - { name: "iconUrl", type: "input", input: "", disabled: true } - ], - outputType: 'json', - outputParams: [ - { name: 'touchCoordinates', type: 'string', desc: '触控二维坐标', disabled: true}, - ] - } - ], - }, - { - collapseTitle: "AI评估", - nodeList: [ - { - icon: expressionSvg, - name: "AI评估预处理", - type: "serviceNode", - desc: "AI评估预处理", - action: 'AI_EVALUATION_PRE', - nodeType: "AE", - nodeParams: [ - { name: "taskType", type: "input", input: "", componentType: 'select', selectOptions: taskTypeOptions(), disabled: true }, - { name: "wakeCorpus", type: "input", input: "", disabled: true, required: false }, - { name: "testCorpus", type: "input", input: "", disabled: true, required: false }, - { name: "sceneType", type: "input", input: "", disabled: true, required: false }, - ], - outputType: 'json', - }, - { - icon: touchSvg, - name: "AI评估执行", - type: "serviceNode", - desc: "AI评估执行", - action: 'AI_EVALUATION_END', - nodeType: "AE", - nodeParams: [ - { name: "videoUrl", type: "input", input: "", disabled: true } - ], - outputType: 'json', - } - ], - }, -] diff --git a/src/views/flow/icon/audio.svg b/src/views/flow/icon/audio.svg deleted file mode 100644 index e71eb39..0000000 --- a/src/views/flow/icon/audio.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/views/flow/icon/awaken.svg b/src/views/flow/icon/awaken.svg deleted file mode 100644 index 26b7a98..0000000 --- a/src/views/flow/icon/awaken.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/views/flow/icon/camera.svg b/src/views/flow/icon/camera.svg deleted file mode 100644 index 5d21dd9..0000000 --- a/src/views/flow/icon/camera.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/views/flow/icon/dialogue.svg b/src/views/flow/icon/dialogue.svg deleted file mode 100644 index b208067..0000000 --- a/src/views/flow/icon/dialogue.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/views/flow/icon/end.svg b/src/views/flow/icon/end.svg deleted file mode 100644 index 81dc559..0000000 --- a/src/views/flow/icon/end.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/views/flow/icon/expression.svg b/src/views/flow/icon/expression.svg deleted file mode 100644 index ae84256..0000000 --- a/src/views/flow/icon/expression.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/views/flow/icon/group.svg b/src/views/flow/icon/group.svg deleted file mode 100644 index d2f250d..0000000 --- a/src/views/flow/icon/group.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/views/flow/icon/loop.svg b/src/views/flow/icon/loop.svg deleted file mode 100644 index 00e5311..0000000 --- a/src/views/flow/icon/loop.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/views/flow/icon/microphone.svg b/src/views/flow/icon/microphone.svg deleted file mode 100644 index d576328..0000000 --- a/src/views/flow/icon/microphone.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/views/flow/icon/plan.svg b/src/views/flow/icon/plan.svg deleted file mode 100644 index d166240..0000000 --- a/src/views/flow/icon/plan.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/views/flow/icon/sleep.svg b/src/views/flow/icon/sleep.svg deleted file mode 100644 index 75639ab..0000000 --- a/src/views/flow/icon/sleep.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/views/flow/icon/start.svg b/src/views/flow/icon/start.svg deleted file mode 100644 index 6e6db22..0000000 --- a/src/views/flow/icon/start.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/views/flow/icon/stopLoop.svg b/src/views/flow/icon/stopLoop.svg deleted file mode 100644 index 2cf73c6..0000000 --- a/src/views/flow/icon/stopLoop.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/views/flow/icon/switch.svg b/src/views/flow/icon/switch.svg deleted file mode 100644 index 58c1870..0000000 --- a/src/views/flow/icon/switch.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/views/flow/icon/touch.svg b/src/views/flow/icon/touch.svg deleted file mode 100644 index 44a14a5..0000000 --- a/src/views/flow/icon/touch.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/views/flow/icon/video.svg b/src/views/flow/icon/video.svg deleted file mode 100644 index 400695e..0000000 --- a/src/views/flow/icon/video.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/views/flow/index.vue b/src/views/flow/index.vue deleted file mode 100644 index e175c93..0000000 --- a/src/views/flow/index.vue +++ /dev/null @@ -1,2994 +0,0 @@ - - - - - diff --git a/src/views/flow/nodes/common/endNode.vue b/src/views/flow/nodes/common/endNode.vue deleted file mode 100644 index 17d291c..0000000 --- a/src/views/flow/nodes/common/endNode.vue +++ /dev/null @@ -1,24 +0,0 @@ - - - - diff --git a/src/views/flow/nodes/common/selectAreaNode.vue b/src/views/flow/nodes/common/selectAreaNode.vue deleted file mode 100644 index 27be9eb..0000000 --- a/src/views/flow/nodes/common/selectAreaNode.vue +++ /dev/null @@ -1,128 +0,0 @@ - - - - diff --git a/src/views/flow/nodes/common/serviceNode.vue b/src/views/flow/nodes/common/serviceNode.vue deleted file mode 100644 index b8cc687..0000000 --- a/src/views/flow/nodes/common/serviceNode.vue +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - diff --git a/src/views/flow/nodes/common/startNode.vue b/src/views/flow/nodes/common/startNode.vue deleted file mode 100644 index a88f2e4..0000000 --- a/src/views/flow/nodes/common/startNode.vue +++ /dev/null @@ -1,101 +0,0 @@ - - - - diff --git a/src/views/flow/nodes/function/actionQueue.vue b/src/views/flow/nodes/function/actionQueue.vue deleted file mode 100644 index c711e3b..0000000 --- a/src/views/flow/nodes/function/actionQueue.vue +++ /dev/null @@ -1,25 +0,0 @@ - - - - - diff --git a/src/views/flow/nodes/function/codeNode.vue b/src/views/flow/nodes/function/codeNode.vue deleted file mode 100644 index 63e3112..0000000 --- a/src/views/flow/nodes/function/codeNode.vue +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - diff --git a/src/views/flow/nodes/function/currentLoop.vue b/src/views/flow/nodes/function/currentLoop.vue deleted file mode 100644 index 4299bcc..0000000 --- a/src/views/flow/nodes/function/currentLoop.vue +++ /dev/null @@ -1,262 +0,0 @@ - - - - - - diff --git a/src/views/flow/nodes/function/deviceUniversal.vue b/src/views/flow/nodes/function/deviceUniversal.vue deleted file mode 100644 index d10473c..0000000 --- a/src/views/flow/nodes/function/deviceUniversal.vue +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - diff --git a/src/views/flow/nodes/function/httpNode.vue b/src/views/flow/nodes/function/httpNode.vue deleted file mode 100644 index f58bd26..0000000 --- a/src/views/flow/nodes/function/httpNode.vue +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - diff --git a/src/views/flow/nodes/function/loop.vue b/src/views/flow/nodes/function/loop.vue deleted file mode 100644 index 702416b..0000000 --- a/src/views/flow/nodes/function/loop.vue +++ /dev/null @@ -1,265 +0,0 @@ - - - - diff --git a/src/views/flow/nodes/function/recognize.vue b/src/views/flow/nodes/function/recognize.vue deleted file mode 100644 index e9f4279..0000000 --- a/src/views/flow/nodes/function/recognize.vue +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - diff --git a/src/views/flow/nodes/function/sdAgent.vue b/src/views/flow/nodes/function/sdAgent.vue deleted file mode 100644 index 458ee6c..0000000 --- a/src/views/flow/nodes/function/sdAgent.vue +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - diff --git a/src/views/flow/nodes/function/sleep.vue b/src/views/flow/nodes/function/sleep.vue deleted file mode 100644 index 37c5f44..0000000 --- a/src/views/flow/nodes/function/sleep.vue +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - diff --git a/src/views/flow/nodes/function/stopLoop.vue b/src/views/flow/nodes/function/stopLoop.vue deleted file mode 100644 index e2f57c9..0000000 --- a/src/views/flow/nodes/function/stopLoop.vue +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - - diff --git a/src/views/flow/nodes/function/subEnd.vue b/src/views/flow/nodes/function/subEnd.vue deleted file mode 100644 index 29b57df..0000000 --- a/src/views/flow/nodes/function/subEnd.vue +++ /dev/null @@ -1,19 +0,0 @@ - - - - diff --git a/src/views/flow/nodes/function/subFlow.vue b/src/views/flow/nodes/function/subFlow.vue deleted file mode 100644 index 546c8f8..0000000 --- a/src/views/flow/nodes/function/subFlow.vue +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - diff --git a/src/views/flow/nodes/function/subStart.vue b/src/views/flow/nodes/function/subStart.vue deleted file mode 100644 index 0675d52..0000000 --- a/src/views/flow/nodes/function/subStart.vue +++ /dev/null @@ -1,19 +0,0 @@ - - - - diff --git a/src/views/flow/nodes/function/switch.vue b/src/views/flow/nodes/function/switch.vue deleted file mode 100644 index 8d63bb2..0000000 --- a/src/views/flow/nodes/function/switch.vue +++ /dev/null @@ -1,319 +0,0 @@ - - - - - - diff --git a/src/views/flow/vue-flow/FlowEdge.vue b/src/views/flow/vue-flow/FlowEdge.vue deleted file mode 100644 index ca50187..0000000 --- a/src/views/flow/vue-flow/FlowEdge.vue +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - diff --git a/src/views/flow/vue-flow/FlowNode.vue b/src/views/flow/vue-flow/FlowNode.vue deleted file mode 100644 index a44b597..0000000 --- a/src/views/flow/vue-flow/FlowNode.vue +++ /dev/null @@ -1,419 +0,0 @@ - - - - - - diff --git a/src/views/flow/vue-flow/adapter.js b/src/views/flow/vue-flow/adapter.js deleted file mode 100644 index c3c66e1..0000000 --- a/src/views/flow/vue-flow/adapter.js +++ /dev/null @@ -1,990 +0,0 @@ -/** - * 文件说明:旧流程数据与 Vue Flow 状态、操作 API 之间的兼容适配层。 - * 作用范围:仅服务于流程设计器模块。 - */ -import { nextTick } from "vue"; -import { v4 as uuid } from "uuid"; -import { MarkerType } from "@vue-flow/core"; - -/** - * 克隆 clone 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} value 待处理的新值 - */ -const clone = (value) => JSON.parse(JSON.stringify(value ?? {})); - -const GROUP_TYPES = new Set(["loop", "selectArea"]); -const TARGET_ONLY_TYPES = new Set(["end", "stopLoop", "subEnd"]); -const SOURCE_ONLY_TYPES = new Set(["start", "subStart"]); -const LOOP_BODY_INSET = { left: 24, top: 112, right: 24, bottom: 24 }; -const GROUP_BODY_INSET = { left: 24, top: 120, right: 24, bottom: 24 }; -const LOOP_MIN_SIZE = { width: 520, height: 360 }; - -/** - * 处理 loopChildExtent 对应的数据或交互;作用范围仅限画布适配层。 - */ -const loopChildExtent = () => ({ - range: "parent", - padding: [ - LOOP_BODY_INSET.top, - LOOP_BODY_INSET.right, - LOOP_BODY_INSET.bottom, - LOOP_BODY_INSET.left, - ], -}); - -/** - * 编组 groupChildExtent 对应的数据或交互;作用范围仅限画布适配层。 - */ -const groupChildExtent = () => ({ - range: "parent", - padding: [ - GROUP_BODY_INSET.top, - GROUP_BODY_INSET.right, - GROUP_BODY_INSET.bottom, - GROUP_BODY_INSET.left, - ], -}); - -/** - * 处理 nodeSize 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} node 当前流程节点 - */ -const nodeSize = (node) => { - // 分支节点采用统一的标准卡片尺寸,忽略旧流程数据中遗留的大尺寸记录。 - if (node.type === "branch") return { width: 372, height: 180 }; - const width = Number(node.properties?.width || node.width); - const height = Number(node.properties?.height || node.height); - if (Number.isFinite(width) && Number.isFinite(height)) { - return { width, height }; - } - if (GROUP_TYPES.has(node.type)) return { width: 720, height: 460 }; - if (TARGET_ONLY_TYPES.has(node.type) || SOURCE_ONLY_TYPES.has(node.type)) { - return { width: 328, height: 120 }; - } - return { width: 372, height: 180 }; -}; - -/** - * 处理 edgeId 对应的数据或交互;作用范围仅限画布适配层。 - */ -const edgeId = () => `edge_${uuid().replace(/-/g, "")}`; -/** - * 处理 nodeId 对应的数据或交互;作用范围仅限画布适配层。 - */ -const nodeId = () => uuid().replace(/-/g, ""); - -/** - * 处理 toVueNode 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} node 当前流程节点 - * @param {*} sizeOverride 调用方传入的 sizeOverride 参数 - * @param {*} positionOverride 调用方传入的 positionOverride 参数 - */ -const toVueNode = (node, sizeOverride, positionOverride) => { - const normalized = clone(node); - normalized.id ||= nodeId(); - normalized.properties ||= {}; - const overrideWidth = Number(sizeOverride?.width); - const overrideHeight = Number(sizeOverride?.height); - const size = Number.isFinite(overrideWidth) && overrideWidth > 0 - && Number.isFinite(overrideHeight) && overrideHeight > 0 - ? { width: overrideWidth, height: overrideHeight } - : nodeSize(normalized); - const center = { - x: Number(normalized.x) || 0, - y: Number(normalized.y) || 0, - }; - const overrideX = Number(positionOverride?.x); - const overrideY = Number(positionOverride?.y); - const position = Number.isFinite(overrideX) && Number.isFinite(overrideY) - ? { x: overrideX, y: overrideY } - : { - x: center.x - size.width / 2, - y: center.y - size.height / 2, - }; - - const dimensions = GROUP_TYPES.has(normalized.type) - ? { width: size.width, height: size.height } - : { width: size.width }; - - return { - id: normalized.id, - type: "flow-node", - position, - ...dimensions, - draggable: normalized.draggable !== false, - selectable: true, - deletable: !SOURCE_ONLY_TYPES.has(normalized.type) && normalized.type !== "end", - connectable: true, - zIndex: GROUP_TYPES.has(normalized.type) ? 0 : 2, - data: { - flowType: normalized.type, - properties: normalized.properties, - children: Array.isArray(normalized.children) ? normalized.children : [], - text: normalized.text, - backend: normalized, - originalCenter: center, - originalPosition: position, - size, - }, - }; -}; - -/** - * 处理 toVueEdge 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} edge 调用方传入的 edge 参数 - */ -const toVueEdge = (edge) => { - const normalized = clone(edge); - normalized.id ||= edgeId(); - return { - id: normalized.id, - source: normalized.sourceNodeId, - target: normalized.targetNodeId, - sourceHandle: normalized.sourceAnchorId || null, - targetHandle: normalized.targetAnchorId || null, - type: "flow-edge", - animated: true, - selectable: true, - focusable: true, - deletable: true, - interactionWidth: 32, - markerEnd: { - type: MarkerType.ArrowClosed, - color: "#ff6b35", - width: 20, - height: 20, - }, - style: { stroke: "#ff6b35", strokeWidth: 2 }, - data: { backend: normalized }, - }; -}; - -/** - * 关联 attachChildrenToGroups 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} nodes 调用方传入的 nodes 参数 - */ -const attachChildrenToGroups = (nodes) => { - // 先建立节点索引和显式父子关系,再用旧数据中的 children 补齐缺失关系。 - // 最后统一换算相对坐标,避免父节点尚未就绪时提前计算造成位置漂移。 - const nodeLookup = new Map(nodes.map((node) => [node.id, node])); - const declaredParents = new Map(); - - nodes.filter((node) => GROUP_TYPES.has(node.data.flowType)).forEach((group) => { - (group.data.children || []).forEach((childId) => { - if (!declaredParents.has(childId)) declaredParents.set(childId, group.id); - }); - }); - - nodes.forEach((child) => { - const parentId = child.data.properties?.parentId || declaredParents.get(child.id); - const parent = nodeLookup.get(parentId); - if (!parent || !GROUP_TYPES.has(parent.data.flowType) || GROUP_TYPES.has(child.data.flowType)) return; - - const isLoop = parent.data.flowType === "loop"; - const relativePosition = { - x: isLoop - ? Math.max(child.position.x - parent.position.x, LOOP_BODY_INSET.left) - : child.position.x - parent.position.x, - y: isLoop - ? Math.max(child.position.y - parent.position.y, LOOP_BODY_INSET.top) - : child.position.y - parent.position.y, - }; - child.parentNode = parentId; - child.extent = isLoop ? loopChildExtent() : groupChildExtent(); - child.expandParent = false; - child.position = relativePosition; - child.zIndex = 5; - child.data.properties = { ...child.data.properties, parentId }; - parent.data.children = Array.from(new Set([...(parent.data.children || []), child.id])); - }); - - nodes.filter((node) => node.data.flowType === "loop").forEach((group) => { - const children = nodes.filter((node) => node.parentNode === group.id); - if (!children.length) return; - const requiredWidth = Math.max(...children.map((child) => ( - child.position.x + Number(child.data.size?.width || 0) + LOOP_BODY_INSET.right - ))); - const requiredHeight = Math.max(...children.map((child) => ( - child.position.y + Number(child.data.size?.height || 0) + LOOP_BODY_INSET.bottom - ))); - const width = Math.max(Number(group.data.size?.width || 0), LOOP_MIN_SIZE.width, requiredWidth); - const height = Math.max(Number(group.data.size?.height || 0), LOOP_MIN_SIZE.height, requiredHeight); - group.width = width; - group.height = height; - group.data.size = { width, height }; - group.data.properties = { ...group.data.properties, width, height }; - }); - - return nodes.sort((left, right) => Number(Boolean(left.parentNode)) - Number(Boolean(right.parentNode))); -}; - -export const toVueFlowData = (graph = {}, options = {}) => { - const nodes = attachChildrenToGroups((graph.nodes || []).map((node) => ( - toVueNode(node, options.nodeSizes?.get(node.id), options.nodePositions?.get(node.id)) - ))); - const nodeLookup = new Map(nodes.map((node) => [node.id, node])); - const edges = (graph.edges || []).map((edge) => { - const vueEdge = toVueEdge(edge); - const source = nodeLookup.get(vueEdge.source); - const target = nodeLookup.get(vueEdge.target); - if (source?.parentNode || target?.parentNode) vueEdge.zIndex = 4; - return vueEdge; - }); - return { nodes, edges }; -}; - -export const createFlowFacade = (store) => { - const handlers = new Map(); - const componentInstances = new Map(); - const loopLayoutStates = new Map(); - let historySuspended = false; - let history = []; - let historyIndex = -1; - - /** - * 获取 getNodes 对应的数据或交互;作用范围仅限画布适配层。 - */ - const getNodes = () => store.getNodes.value || []; - /** - * 获取 getEdges 对应的数据或交互;作用范围仅限画布适配层。 - */ - const getEdges = () => store.getEdges.value || []; - - /** - * 处理 backendNode 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} node 当前流程节点 - */ - const backendNode = (node) => { - const result = clone(node.data.backend); - const size = { - width: Number(node.width || node.dimensions?.width || node.data.size?.width || 0), - height: Number(node.height || node.dimensions?.height || node.data.size?.height || 0), - }; - const parent = node.parentNode ? store.findNode(node.parentNode) : null; - const parentPosition = parent?.position || parent?.computedPosition || { x: 0, y: 0 }; - const absolutePosition = parent - ? { x: parentPosition.x + node.position.x, y: parentPosition.y + node.position.y } - : (node.position || node.computedPosition); - result.id = node.id; - result.type = node.data.flowType; - if (GROUP_TYPES.has(result.type)) { - result.x = absolutePosition.x + size.width / 2; - result.y = absolutePosition.y + size.height / 2; - } else { - const originalCenter = node.data.originalCenter || { - x: absolutePosition.x + size.width / 2, - y: absolutePosition.y + size.height / 2, - }; - const originalPosition = node.data.originalPosition || absolutePosition; - result.x = originalCenter.x + absolutePosition.x - originalPosition.x; - result.y = originalCenter.y + absolutePosition.y - originalPosition.y; - } - result.properties = clone(node.data.properties || {}); - if (parent?.data?.flowType === "selectArea") delete result.properties.parentId; - if (GROUP_TYPES.has(result.type)) { - result.properties.width = size.width; - result.properties.height = size.height; - } - if (node.data.children?.length || GROUP_TYPES.has(result.type)) { - result.children = [...(node.data.children || [])]; - } else { - delete result.children; - } - return result; - }; - - /** - * 处理 backendEdge 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} edge 调用方传入的 edge 参数 - */ - const backendEdge = (edge) => ({ - ...clone(edge.data?.backend), - id: edge.id, - type: edge.data?.backend?.type || "bezier", - sourceNodeId: edge.source, - targetNodeId: edge.target, - sourceAnchorId: edge.sourceHandle || `${edge.source}_1`, - targetAnchorId: edge.targetHandle || `${edge.target}_3`, - }); - - /** - * 处理 emit 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} name 名称或事件名称 - * @param {*} payload 事件数据 - */ - const emit = (name, payload) => { - (handlers.get(name) || []).forEach((handler) => handler(payload)); - }; - - /** - * 处理 recordHistory 对应的数据或交互;作用范围仅限画布适配层。 - */ - const recordHistory = () => { - if (historySuspended) return; - const graph = facade.getGraphData(); - const serialized = JSON.stringify(graph); - if (history[historyIndex]?.serialized === serialized) return; - history = history.slice(0, historyIndex + 1); - history.push({ serialized, graph: clone(graph) }); - if (history.length > 100) history.shift(); - historyIndex = history.length - 1; - }; - - /** - * 更新 changed 对应的数据或交互;作用范围仅限画布适配层。 - */ - const changed = () => { - if (historySuspended) return; - recordHistory(); - emit("history:change", { data: facade.getGraphData() }); - }; - - /** - * 获取 getNodeRect 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} node 当前流程节点 - */ - const getNodeRect = (node) => { - const parent = node.parentNode ? store.findNode(node.parentNode) : null; - const parentPosition = parent?.position || parent?.computedPosition || { x: 0, y: 0 }; - const position = parent - ? { x: parentPosition.x + node.position.x, y: parentPosition.y + node.position.y } - : (node.position || node.computedPosition); - return { - x: Number(position?.x || 0), - y: Number(position?.y || 0), - width: Number(node.width || node.dimensions?.width || node.data.size?.width || 0), - height: Number(node.height || node.dimensions?.height || node.data.size?.height || 0), - }; - }; - - /** - * 获取 getLoopLayoutState 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} group 调用方传入的 group 参数 - */ - const getLoopLayoutState = (group) => { - const current = getNodeRect(group); - const existing = loopLayoutStates.get(group.id); - /** - * 处理 if 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} !existing 调用方传入的 !existing 参数 - */ - if (!existing) { - const state = { base: { ...current }, last: { ...current } }; - loopLayoutStates.set(group.id, state); - return state; - } - - const sizeChanged = Math.abs(current.width - existing.last.width) > 1 - || Math.abs(current.height - existing.last.height) > 1; - /** - * 处理 if 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} sizeChanged 调用方传入的 sizeChanged 参数 - */ - if (sizeChanged) { - existing.base = { ...current }; - } else { - const dx = current.x - existing.last.x; - const dy = current.y - existing.last.y; - existing.base.x += dx; - existing.base.y += dy; - } - existing.last = { ...current }; - return existing; - }; - - /** - * 布局 layoutLoop 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} group 调用方传入的 group 参数 - * @param {*} activeChildId 调用方传入的 activeChildId 参数 - * @param {*} activePosition 调用方传入的 activePosition 参数 - */ - const layoutLoop = (group, activeChildId, activePosition) => { - const state = getLoopLayoutState(group); - const children = getNodes().filter((node) => node.parentNode === group.id); - if (!children.length) return false; - - const snapshots = children.map((child) => { - const rect = getNodeRect(child); - const position = child.id === activeChildId && activePosition - ? { x: activePosition.x, y: activePosition.y } - : { x: rect.x, y: rect.y }; - return { child, position, width: rect.width, height: rect.height }; - }); - const contentLeft = Math.min(...snapshots.map(({ position }) => position.x)); - const contentTop = Math.min(...snapshots.map(({ position }) => position.y)); - const contentRight = Math.max(...snapshots.map(({ position, width }) => position.x + width)); - const contentBottom = Math.max(...snapshots.map(({ position, height }) => position.y + height)); - const left = Math.min(state.base.x, contentLeft - LOOP_BODY_INSET.left); - const top = Math.min(state.base.y, contentTop - LOOP_BODY_INSET.top); - const right = Math.max( - state.base.x + Math.max(state.base.width, LOOP_MIN_SIZE.width), - contentRight + LOOP_BODY_INSET.right, - ); - const bottom = Math.max( - state.base.y + Math.max(state.base.height, LOOP_MIN_SIZE.height), - contentBottom + LOOP_BODY_INSET.bottom, - ); - const width = right - left; - const height = bottom - top; - const properties = { ...group.data.properties, width, height }; - - store.updateNode(group.id, { - position: { x: left, y: top }, - computedPosition: { ...group.computedPosition, x: left, y: top }, - dimensions: { width, height }, - width, - height, - }); - store.updateNodeData(group.id, { - ...group.data, - properties, - size: { width, height }, - }, { replace: true }); - snapshots.forEach(({ child, position }) => { - store.updateNode(child.id, { - position: { x: position.x - left, y: position.y - top }, - computedPosition: { ...child.computedPosition, x: position.x, y: position.y }, - extent: loopChildExtent(), - expandParent: false, - }); - }); - state.last = { x: left, y: top, width, height }; - nextTick(() => store.updateNodeInternals([group.id, ...children.map((child) => child.id)])); - return true; - }; - - /** - * 获取 getAnchors 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} node 当前流程节点 - */ - const getAnchors = (node) => { - const type = node.data.flowType; - /** - * 处理 if 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} type 目标类型 - */ - if (type === "branch") { - return [ - { id: `${node.id}_entry`, name: "left" }, - ...(node.data.properties?.anchor || []).map((item) => ({ ...item, name: "right" })), - ]; - } - if (TARGET_ONLY_TYPES.has(type)) return [{ id: `${node.id}_3`, name: "left" }]; - if (SOURCE_ONLY_TYPES.has(type)) return [{ id: `${node.id}_1`, name: "right" }]; - if (type === "selectArea") return []; - return [ - { id: `${node.id}_1`, name: "right" }, - { id: `${node.id}_3`, name: "left" }, - ]; - }; - - /** - * 处理 modelFor 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} id 目标元素 ID - */ - const modelFor = (id) => { - const node = store.findNode(id); - if (!node) return null; - const model = { - id, - type: node.data.flowType, - get x() { return backendNode(node).x; }, - get y() { return backendNode(node).y; }, - get width() { return node.dimensions?.width || node.data.size?.width || 0; }, - get height() { return node.dimensions?.height || node.data.size?.height || 0; }, - get left() { return getNodeRect(node).x; }, - get top() { return getNodeRect(node).y; }, - get parentId() { return node.parentNode || null; }, - get anchors() { return getAnchors(node); }, - get children() { return new Set(node.data.children || []); }, - set children(value) { - const children = Array.from(value || []); - store.updateNodeData(id, { ...node.data, children }, { replace: true }); - changed(); - }, - get draggable() { return node.draggable !== false; }, - set draggable(value) { store.updateNode(id, { draggable: Boolean(value) }); }, - getProperties: () => facade.getProperties(id), - setProperties: (properties) => facade.setProperties(id, properties), - setComponentInstance: (instance) => componentInstances.set(id, instance), - closePopover: () => componentInstances.get(id)?.closePopover?.(), - updateSize: () => store.updateNodeInternals([id]), - setCustomProperties: () => store.updateNodeInternals([id]), - }; - return model; - }; - - const facade = { - /** - * 订阅 on 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} name 名称或事件名称 - * @param {*} handler 事件处理函数 - */ - on(name, handler) { - const list = handlers.get(name) || []; - list.push(handler); - handlers.set(name, list); - return () => facade.off(name, handler); - }, - /** - * 订阅 once 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} name 名称或事件名称 - * @param {*} handler 事件处理函数 - */ - once(name, handler) { - /** - * 处理 wrapped 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} payload 事件数据 - */ - const wrapped = (payload) => { - facade.off(name, wrapped); - handler(payload); - }; - facade.on(name, wrapped); - }, - /** - * 取消订阅 off 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} name 名称或事件名称 - * @param {*} handler 事件处理函数 - */ - off(name, handler) { - if (!handler) handlers.delete(name); - else handlers.set(name, (handlers.get(name) || []).filter((item) => item !== handler)); - }, - emit, - markChanged: changed, - /** - * 获取 getGraphData 对应的数据或交互;作用范围仅限画布适配层。 - */ - getGraphData() { - return { - nodes: getNodes().map(backendNode), - edges: getEdges().map(backendEdge), - }; - }, - /** - * 渲染 render 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} graph 调用方传入的 graph 参数 - * @param {*} options 行为配置 - */ - render(graph, options = {}) { - historySuspended = true; - loopLayoutStates.clear(); - const nodeSizes = options.preserveNodeSizes === true - ? new Map(getNodes().map((node) => [node.id, { - width: Number(node.dimensions?.width || node.width || node.data.size?.width || 0), - height: Number(node.dimensions?.height || node.height || node.data.size?.height || 0), - }])) - : options.nodeSizes; - const nodePositions = options.preserveNodePositions === true - ? new Map(getNodes().map((node) => { - const rect = getNodeRect(node); - return [node.id, { x: rect.x, y: rect.y }]; - })) - : options.nodePositions; - const data = toVueFlowData(graph, { nodeSizes, nodePositions }); - /** - * 处理 finishRender 对应的数据或交互;作用范围仅限画布适配层。 - */ - const finishRender = () => { - historySuspended = false; - if (options.resetHistory !== false) { - history = []; - historyIndex = -1; - recordHistory(); - } - nextTick(() => store.updateNodeInternals()); - }; - /** - * 处理 applyData 对应的数据或交互;作用范围仅限画布适配层。 - */ - const applyData = () => { - store.setNodes(data.nodes); - store.setEdges(data.edges); - finishRender(); - }; - - if (options.replaceNodes === true) { - // Changing parentNode is structural in Vue Flow. Unmount in one tick - // and remount in the next so node wrappers and edges cannot retain - // different graph-node instances for the same id. - store.setEdges([]); - store.setNodes([]); - nextTick(applyData); - } else { - applyData(); - } - }, - /** - * 新增 addNode 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} node 当前流程节点 - */ - addNode(node) { - const vueNode = toVueNode(node); - store.addNodes(vueNode); - changed(); - return backendNode(vueNode); - }, - /** - * 删除 deleteNode 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} id 目标元素 ID - */ - deleteNode(id) { - const target = store.findNode(id); - if (target?.data?.flowType === "selectArea") { - facade.ungroup(id); - return; - } - const parentId = target?.parentNode; - const childIds = target?.data?.children || []; - const removeChildren = target?.data?.flowType === "loop" && childIds.length > 0; - const nodeIds = removeChildren ? [id, ...childIds] : id; - const removedIds = new Set(Array.isArray(nodeIds) ? nodeIds : [nodeIds]); - store.removeNodes(nodeIds, true, removeChildren); - getNodes().forEach((node) => { - if (node.data.children?.includes(id) && !removedIds.has(node.id)) { - store.updateNodeData(node.id, { - ...node.data, - children: node.data.children.filter((childId) => childId !== id), - }, { replace: true }); - } - }); - componentInstances.delete(id); - childIds.forEach((childId) => componentInstances.delete(childId)); - changed(); - if (parentId) nextTick(() => facade.resizeGroupToChildren(parentId)); - }, - /** - * 新增 addEdge 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} edge 调用方传入的 edge 参数 - */ - addEdge(edge) { - const vueEdge = toVueEdge(edge); - const source = store.findNode(vueEdge.source); - const target = store.findNode(vueEdge.target); - if (source?.parentNode || target?.parentNode) vueEdge.zIndex = 4; - store.addEdges(vueEdge); - changed(); - return backendEdge(vueEdge); - }, - /** - * 删除 deleteEdge 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} id 目标元素 ID - */ - deleteEdge(id) { - store.removeEdges(id); - changed(); - }, - /** - * 删除 deleteEdgeByNodeId 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} id 目标元素 ID - */ - deleteEdgeByNodeId(id) { - store.removeEdges(getEdges().filter((edge) => edge.source === id || edge.target === id)); - changed(); - }, - /** - * 获取 getProperties 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} id 目标元素 ID - */ - getProperties(id) { - return clone(store.findNode(id)?.data?.properties || {}); - }, - /** - * 设置 setProperties 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} id 目标元素 ID - * @param {*} properties 调用方传入的 properties 参数 - */ - setProperties(id, properties) { - const node = store.findNode(id); - if (!node) return; - store.updateNodeData(id, { ...node.data, properties: clone(properties) }, { replace: true }); - nextTick(() => store.updateNodeInternals([id])); - changed(); - }, - getNodeModelById: modelFor, - /** - * 获取 getSelectElements 对应的数据或交互;作用范围仅限画布适配层。 - */ - getSelectElements() { - return { - nodes: (store.getSelectedNodes.value || []).map(backendNode), - edges: (store.getSelectedEdges.value || []).map(backendEdge), - }; - }, - /** - * 清理 clearSelectElements 对应的数据或交互;作用范围仅限画布适配层。 - */ - clearSelectElements() { - store.removeSelectedElements(); - }, - /** - * 处理 selectElementById 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} id 目标元素 ID - */ - selectElementById(id) { - store.removeSelectedElements(); - if (!id) return; - const node = store.findNode(id); - if (node) store.addSelectedNodes([node]); - const edge = store.findEdge(id); - if (edge) store.addSelectedEdges([edge]); - }, - /** - * 处理 selectElementsByIds 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} ids 调用方传入的 ids 参数 - */ - selectElementsByIds(ids = []) { - store.removeSelectedElements(); - const nodes = ids.map((id) => store.findNode(id)).filter(Boolean); - if (nodes.length) store.addSelectedNodes(nodes); - }, - /** - * 处理 focusOn 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} { id } 调用方传入的 { id } 参数 - */ - focusOn({ id }) { - const node = store.findNode(id); - if (!node) return; - const center = backendNode(node); - store.setCenter(center.x, center.y, { zoom: Math.max(store.viewport.value?.zoom || 1, 0.7), duration: 300 }); - }, - /** - * 处理 fitView 对应的数据或交互;作用范围仅限画布适配层。 - */ - fitView() { - return store.fitView({ padding: 0.18, duration: 300 }); - }, - /** - * 处理 translateCenter 对应的数据或交互;作用范围仅限画布适配层。 - */ - translateCenter() { - return facade.fitView(); - }, - /** - * 缩放 zoom 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} scale 缩放比例 - * @param {*} center 缩放中心 - */ - zoom(scale, center) { - if (Array.isArray(center) && center.length === 2) { - return store.setCenter(center[0], center[1], { zoom: scale, duration: 250 }); - } - return store.zoomTo(scale, { duration: 250 }); - }, - /** - * 获取 getPointByClient 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} x 客户端横坐标 - * @param {*} y 客户端纵坐标 - */ - getPointByClient(x, y) { - const point = store.screenToFlowCoordinate({ x, y }); - return { canvasOverlayPosition: point, domOverlayPosition: point }; - }, - /** - * 新增 addToGroup 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} groupId 分组节点 ID - * @param {*} childId 子节点 ID - * @param {*} dropCenter 拖放中心坐标 - */ - addToGroup(groupId, childId, dropCenter) { - const group = store.findNode(groupId); - const child = store.findNode(childId); - if (!group || !child || GROUP_TYPES.has(child.data.flowType)) return; - const previousParentId = child.parentNode || child.data?.properties?.parentId; - const graph = facade.getGraphData(); - const groupData = graph.nodes.find((node) => node.id === groupId); - const childData = graph.nodes.find((node) => node.id === childId); - if (!groupData || !childData) return; - - // 节点从循环体外进入循环体后,原连线的两端已处于不同执行作用域,必须全部断开。 - // 在重新渲染父子结构前直接过滤图数据,可保证入边、出边和层级变更在同一次更新中完成。 - const enteringLoop = group.data.flowType === "loop" && previousParentId !== groupId; - if (enteringLoop) { - graph.edges = graph.edges.filter((edge) => ( - edge.sourceNodeId !== childId && edge.targetNodeId !== childId - )); - } - - groupData.children = Array.from(new Set([...(groupData.children || []), childId])); - childData.properties = { ...(childData.properties || {}), parentId: groupId }; - if (dropCenter) { - childData.x = dropCenter.x; - childData.y = dropCenter.y; - } - facade.render(graph, { - resetHistory: false, - replaceNodes: true, - preserveNodeSizes: true, - preserveNodePositions: true, - }); - nextTick(() => { - store.updateNodeInternals([groupId, childId]); - changed(); - }); - }, - /** - * 编组 groupNodes 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} groupNode 调用方传入的 groupNode 参数 - * @param {*} childIds 子节点 ID 集合 - */ - groupNodes(groupNode, childIds = []) { - // 先计算选中节点的外接矩形确定容器尺寸,再把子节点坐标转换为容器内相对坐标。 - // 与分组外节点相连的边保持不变,此处仅更新节点层级和几何信息。 - const graph = facade.getGraphData(); - const selectedIds = new Set(childIds); - const children = graph.nodes.filter((node) => ( - selectedIds.has(node.id) - && !GROUP_TYPES.has(node.type) - && !store.findNode(node.id)?.parentNode - )); - if (!children.length) return null; - - const group = clone(groupNode); - group.id ||= nodeId(); - group.type = "selectArea"; - group.properties = { ...(group.properties || {}), action: "NONE" }; - group.children = children.map((node) => node.id); - children.forEach((node) => { - node.properties = { ...(node.properties || {}), parentId: group.id }; - }); - graph.nodes.push(group); - facade.render(graph, { - resetHistory: false, - replaceNodes: true, - preserveNodeSizes: true, - preserveNodePositions: true, - }); - nextTick(() => { - store.updateNodeInternals([group.id, ...group.children]); - changed(); - }); - return clone(group); - }, - /** - * 处理 ungroup 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} groupId 分组节点 ID - */ - ungroup(groupId) { - const graph = facade.getGraphData(); - const group = graph.nodes.find((node) => node.id === groupId && node.type === "selectArea"); - if (!group) return false; - const childIds = new Set([ - ...(group.children || []), - ...graph.nodes.filter((node) => node.properties?.parentId === groupId).map((node) => node.id), - ]); - graph.nodes = graph.nodes.filter((node) => node.id !== groupId); - graph.nodes.forEach((node) => { - if (!childIds.has(node.id)) return; - const properties = { ...(node.properties || {}) }; - delete properties.parentId; - node.properties = properties; - }); - facade.render(graph, { - resetHistory: false, - replaceNodes: true, - preserveNodeSizes: true, - preserveNodePositions: true, - }); - nextTick(() => { - store.updateNodeInternals([...childIds]); - changed(); - }); - return true; - }, - /** - * 准备 prepareLoopChildDrag 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} childId 子节点 ID - */ - prepareLoopChildDrag(childId) { - const child = store.findNode(childId); - const group = child?.parentNode ? store.findNode(child.parentNode) : null; - if (!group || group.data.flowType !== "loop") return; - store.updateNode(childId, { - extent: loopChildExtent(), - expandParent: false, - }); - getLoopLayoutState(group); - const rect = getNodeRect(child); - return { groupId: group.id, position: { x: rect.x, y: rect.y } }; - }, - /** - * 布局 layoutLoopDuringDrag 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} groupId 分组节点 ID - * @param {*} childId 子节点 ID - * @param {*} position 调用方传入的 position 参数 - */ - layoutLoopDuringDrag(groupId, childId, position) { - const group = store.findNode(groupId); - if (!group || group.data.flowType !== "loop" || !position) return; - layoutLoop(group, childId, position); - }, - /** - * 调整 resizeGroupToChildren 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} groupId 分组节点 ID - * @param {*} options 行为配置 - */ - resizeGroupToChildren(groupId, options = {}) { - // 循环容器沿用统一的内边距和最小尺寸约束,并按配置决定是否记录变更。 - // 拖拽过程可关闭变更标记,避免高频移动产生多余历史记录。 - const group = store.findNode(groupId); - if (!group || group.data.flowType !== "loop") return; - if (layoutLoop(group) && options.markChanged !== false) changed(); - }, - /** - * 移动 moveNodeBy 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} id 目标元素 ID - * @param {*} dx 横向位移 - * @param {*} dy 纵向位移 - */ - moveNodeBy(id, dx, dy) { - const node = store.findNode(id); - if (!node) return; - store.updateNode(id, { - position: { - x: node.position.x + dx, - y: node.position.y + dy, - }, - }); - changed(); - }, - /** - * 撤销 undo 对应的数据或交互;作用范围仅限画布适配层。 - */ - undo() { - if (historyIndex <= 0) return false; - historyIndex -= 1; - const snapshot = clone(history[historyIndex].graph); - facade.render(snapshot, { resetHistory: false, replaceNodes: true }); - nextTick(() => emit("history:change", { data: facade.getGraphData() })); - return true; - }, - /** - * 重做 redo 对应的数据或交互;作用范围仅限画布适配层。 - */ - redo() { - if (historyIndex >= history.length - 1) return false; - historyIndex += 1; - const snapshot = clone(history[historyIndex].graph); - facade.render(snapshot, { resetHistory: false, replaceNodes: true }); - nextTick(() => emit("history:change", { data: facade.getGraphData() })); - return true; - }, - /** - * 注册 registerComponentInstance 对应的数据或交互;作用范围仅限画布适配层。 - * @param {*} id 目标元素 ID - * @param {*} instance 组件实例 - */ - registerComponentInstance(id, instance) { - if (instance) componentInstances.set(id, instance); - }, - extension: { - selectionSelect: { - openSelectionSelect: () => emit("selection:open"), - closeSelectionSelect: () => emit("selection:close"), - }, - }, - }; - - return facade; -}; diff --git a/src/views/inspection/alarm/index.vue b/src/views/inspection/alarm/index.vue deleted file mode 100644 index c306a5d..0000000 --- a/src/views/inspection/alarm/index.vue +++ /dev/null @@ -1,452 +0,0 @@ - - - - - diff --git a/src/views/inspection/cockpit/canvasUtils.js b/src/views/inspection/cockpit/canvasUtils.js deleted file mode 100644 index e9751e8..0000000 --- a/src/views/inspection/cockpit/canvasUtils.js +++ /dev/null @@ -1,620 +0,0 @@ -import { useInspectionStore } from "@/store/modules/inspection"; - -const inspectionStore = useInspectionStore(); - - -/** - * 6位十六进制颜色字符串转为 CSS rgba 字符串 - * @param {string} hex - 如 "#ff6e40" - * @param {number} alpha - 透明度 0~1 - * @returns {string} CSS rgba 字符串 - */ -function hexToCssRgba(hexString, alpha) { - const r = parseInt(hexString.slice(1, 3), 16); // 提取 R 分量 - const g = parseInt(hexString.slice(3, 5), 16); // 提取 G 分量 - const b = parseInt(hexString.slice(5, 7), 16); // 提取 B 分量 - return `rgba(${r},${g},${b},${alpha})`; -} - -/** - * 将世界坐标转换为 Canvas 屏幕像素坐标 - * 注意:世界坐标 Y 轴向上,Canvas Y 轴向下,因此需要翻转 - * @param {number} worldX - 世界坐标 X(米) - * @param {number} worldY - 世界坐标 Y(米) - * @returns {{x: number, y: number}} Canvas 上的屏幕像素坐标 - */ -export const worldToScreen = (worldX, worldY, dataStore) => { - const store = dataStore || inspectionStore; - const camera = store.camera - const screenX = (worldX - camera.centerX) * camera.pixelsPerMeter + store.canvasWidthPx / 2; // 水平偏移 + 居中 - const screenY = -(worldY - camera.centerY) * camera.pixelsPerMeter + store.canvasHeightPx / 2; // 垂直翻转 + 居中 - return { x: screenX, y: screenY }; -}; - -/** - * 将 Canvas 屏幕像素坐标反算为世界坐标 - * 与 worldToScreen 互为逆运算 - * @param {number} screenX - Canvas 像素 X - * @param {number} screenY - Canvas 像素 Y - * @returns {{x: number, y: number}} 世界坐标(米) - */ -export const screenToWorld = (screenX, screenY, dataStore) => { - const store = dataStore || inspectionStore; - const camera = store.camera; - const worldX = (screenX - store.canvasWidthPx / 2) / camera.pixelsPerMeter + camera.centerX; // 水平反算 - const worldY = -(screenY - store.canvasHeightPx / 2) / camera.pixelsPerMeter + camera.centerY; // 垂直反算(带翻转) - return { x: worldX, y: worldY }; -}; - - -/** - * 0xAARRGGBB 整数颜色解码为 {r, g, b, a} 对象 - * @param {number} argbInt - 32位 ARGB 整数,如 0xCCFF0040 - * @returns {{r:number, g:number, b:number, a:number}|null} RGBA 分量 (0~255),无效输入返回 null - */ -export const decodeArgbInteger = (argbInt) => { - if (typeof argbInt !== 'number') return null; // 非数字类型直接返回 - return { - a: (argbInt >>> 24) & 0xFF, // 高8位:Alpha 透明度 - r: (argbInt >>> 16) & 0xFF, // 次高8位:Red - g: (argbInt >>> 8) & 0xFF, // 次低8位:Green - b: argbInt & 0xFF, // 低8位:Blue - }; -} - -/** - * 将 decodeArgbInteger 的结果转为 CSS rgba() 字符串 - * @param {{r,g,b,a}} colorObj - RGBA 分量对象 - * @param {number} [alphaOverride] - 可选,覆盖 alpha 值(0~1) - * @returns {string|null} CSS rgba 字符串,如 "rgba(255,0,64,0.3)" - */ -export const toCssRgba = (colorObj, alphaOverride) => { - if (!colorObj) return null; // 空对象返回 null - const alpha = alphaOverride !== undefined // 如果提供了覆盖值 - ? alphaOverride // 使用覆盖值 - : colorObj.a / 255; // 否则将 0~255 映射到 0~1 - return `rgba(${colorObj.r},${colorObj.g},${colorObj.b},${alpha})`; -} - -/** - * 栅格底图绘制函数 - * 将预渲染的离屏 Canvas 图像绘制到主 Canvas 上,并根据当前地图范围进行缩放和平移 - * @param {*} canvasCtx - * @param {*} map - * @param {*} gridOffscreen - */ -export const drawGrid = (canvasCtx, map, dataStore) => { - const store = dataStore || inspectionStore; - const topLeftScreen = worldToScreen(map.originX, map.maxY, store); // 图像左上角(世界坐标→屏幕) - const bottomRightScreen = worldToScreen(map.maxX, map.originY, store); // 图像右下角(世界坐标→屏幕) - canvasCtx.imageSmoothingEnabled = false; // 关闭抗锯齿(保持像素清晰) - canvasCtx.drawImage( - store.gridOffscreen, // 离屏 Canvas 图像源 - topLeftScreen.x, topLeftScreen.y, // 目标左上角 - bottomRightScreen.x - topLeftScreen.x, // 目标宽度 - bottomRightScreen.y - topLeftScreen.y // 目标高度 - ); -} - -/** - * 网格辅助线(每1米一条) - * @param {*} canvasCtx - * @param {*} canvasWidthPx - * @param {*} canvasHeightPx - */ -export const drawGridlines = (canvasCtx, dataStore) => { - // 计算当前可视范围的世界坐标 - const store = dataStore || inspectionStore; - const viewTopLeft = screenToWorld(0, 0, store); // 视口左上角世界坐标 - const viewBottomRight = screenToWorld(store.canvasWidthPx, store.canvasHeightPx, store); // 视口右下角世界坐标 - const viewMinX = Math.floor(Math.min(viewTopLeft.x, viewBottomRight.x)); // 可视X最小整数 - const viewMaxX = Math.ceil(Math.max(viewTopLeft.x, viewBottomRight.x)); // 可视X最大整数 - const viewMinY = Math.floor(Math.min(viewTopLeft.y, viewBottomRight.y)); // 可视Y最小整数 - const viewMaxY = Math.ceil(Math.max(viewTopLeft.y, viewBottomRight.y)); // 可视Y最大整数 - - // 绘制1米间隔的浅色网格线 - canvasCtx.strokeStyle = 'rgba(30,50,80,0.25)'; // 淡蓝灰色 - canvasCtx.lineWidth = 0.5; // 细线 - canvasCtx.beginPath(); - for (let worldX = viewMinX; worldX <= viewMaxX; worldX++) { // 逐列绘制垂直线 - const screenPos = worldToScreen(worldX, 0, store); - canvasCtx.moveTo(screenPos.x, 0); // 从画布顶部 - canvasCtx.lineTo(screenPos.x, store.canvasHeightPx); // 到画布底部 - } - for (let worldY = viewMinY; worldY <= viewMaxY; worldY++) { // 逐行绘制水平线 - const screenPos = worldToScreen(0, worldY, store); - canvasCtx.moveTo(0, screenPos.y); // 从画布左边 - canvasCtx.lineTo(store.canvasWidthPx, screenPos.y); // 到画布右边 - } - canvasCtx.stroke(); -} - -/** - * 绘制高级区域列表 - * @param {*} canvasCtx - * @param {*} map - * @param {*} dataStore - */ -export const drawAdvancedAreaList = (canvasCtx, map, dataStore) => { - const store = dataStore || inspectionStore; - for (let areaIndex = 0; areaIndex < map.advancedAreas.length; areaIndex++) { - const area = map.advancedAreas[areaIndex]; // 当前区域 - const vertices = area.posGroup || []; // 多边形顶点数组 - if (vertices.length < 3) continue; // 少于3个顶点无法构成多边形,跳过 - - // ── 颜色:优先使用 attribute 中的 ARGB 整数,否则用默认品红色 ── - let fillColorCss = 'rgba(224,64,251,0.12)'; // 默认填充(品红半透明) - let strokeColorCss = 'rgba(224,64,251,0.5)'; // 默认描边(品红较不透明) - if (area.attribute) { - const brushColor = decodeArgbInteger(area.attribute.colorBrush); // 解码填充色 - const penColor = decodeArgbInteger(area.attribute.colorPen); // 解码描边色 - if (brushColor) { - // 使用原始 alpha 值的一半作为填充透明度,最小 0.06 - fillColorCss = toCssRgba(brushColor, Math.max(0.06, (brushColor.a / 255) * 0.5)); - } - if (penColor) { - strokeColorCss = toCssRgba(penColor, 0.6); // 描边60%不透明 - } - } - - // ── 绘制多边形 ── - canvasCtx.fillStyle = fillColorCss; // 设置填充色 - canvasCtx.strokeStyle = strokeColorCss; // 设置描边色 - canvasCtx.lineWidth = 1.2; // 描边宽度 - canvasCtx.beginPath(); - const firstVertexScreen = worldToScreen(vertices[0].x, vertices[0].y, store); // 第一个顶点的屏幕位置 - canvasCtx.moveTo(firstVertexScreen.x, firstVertexScreen.y); // 移动到起点 - for (let i = 1; i < vertices.length; i++) { // 依次连接后续顶点 - const vertexScreen = worldToScreen(vertices[i].x, vertices[i].y, store); - canvasCtx.lineTo(vertexScreen.x, vertexScreen.y); - } - canvasCtx.closePath(); // 闭合路径 - canvasCtx.fill(); // 填充 - canvasCtx.stroke(); // 描边 - - // ── 在多边形质心处绘制区域名称标签 ── - let centroidWorldX = 0, centroidWorldY = 0; // 质心世界坐标 - for (const v of vertices) { centroidWorldX += v.x; centroidWorldY += v.y; } // 累加顶点坐标 - centroidWorldX /= vertices.length; // 求平均得到质心 X - centroidWorldY /= vertices.length; // 求平均得到质心 Y - const centroidScreen = worldToScreen(centroidWorldX, centroidWorldY, store); - canvasCtx.font = '500 32px "JetBrains Mono"'; // 标签字体 - canvasCtx.fillStyle = strokeColorCss; // 与描边同色 - canvasCtx.textAlign = 'center'; // 居中对齐 - canvasCtx.fillText(area.instanceName || '', centroidScreen.x, centroidScreen.y + 3); // 绘制文字 - } -}; - -/** - * 绘制高级线列表 - * @param {*} canvasCtx - * @param {*} map - */ -export const drawAdvancedLineList = (canvasCtx, map, dataStore) => { - const store = dataStore || inspectionStore; - for (let advLineIndex = 0; advLineIndex < map.advancedLines.length; advLineIndex++) { - const advLine = map.advancedLines[advLineIndex]; // 当前高级线 - const lineData = advLine.line; // 内部的 line 对象 - if (!lineData || !lineData.startPos || !lineData.endPos) continue; // 缺少端点则跳过 - - const startScreen = worldToScreen(lineData.startPos.x, lineData.startPos.y, store); - const endScreen = worldToScreen(lineData.endPos.x, lineData.endPos.y, store); - - // ── 根据 className 决定颜色和线型 ── - let lineColorHex = '#ff6e40'; // 默认橙色 - let lineDashPattern = []; // 默认实线(无虚线) - const classNameLower = (advLine.className || '').toLowerCase(); - if (classNameLower.includes('forbidden')) { // 禁行线 → 红色虚线 - lineColorHex = '#ff1744'; - lineDashPattern = [8, 4]; // 虚线模式:8px实 4px空 - } else if (classNameLower.includes('virtual')) { // 虚拟线 → 橙色虚线 - lineColorHex = '#ffab40'; - lineDashPattern = [4, 4]; - } - - // 绘制高级线 - canvasCtx.save(); - canvasCtx.shadowColor = lineColorHex; // 辉光色与线条同色 - canvasCtx.shadowBlur = 4; // 辉光半径 - canvasCtx.strokeStyle = lineColorHex; // 线条颜色 - canvasCtx.lineWidth = 2.5; // 线宽(比基础线粗) - canvasCtx.setLineDash(lineDashPattern); // 设置虚线模式 - canvasCtx.globalAlpha = 0.8; // 80%不透明 - canvasCtx.beginPath(); - canvasCtx.moveTo(startScreen.x, startScreen.y); - canvasCtx.lineTo(endScreen.x, endScreen.y); - canvasCtx.stroke(); - canvasCtx.setLineDash([]); // 恢复实线 - canvasCtx.restore(); - - // 在中点绘制名称标签 - // const midpointScreenX = (startScreen.x + endScreen.x) / 2; - // const midpointScreenY = (startScreen.y + endScreen.y) / 2; - // canvasCtx.font = '500 8px "JetBrains Mono"'; - // canvasCtx.fillStyle = hexToCssRgba(lineColorHex, 0.55); // 55%不透明的文字 - // canvasCtx.textAlign = 'center'; - // canvasCtx.fillText(advLine.instanceName || advLine.className || '', midpointScreenX, midpointScreenY - 6); - } -}; - -/** - * 绘制基础直线列表 - * @param {*} canvasCtx - * @param {*} map - * @param {*} dataStore - */ -export const drawNormalLines = (canvasCtx, map, dataStore) => { - const store = dataStore || inspectionStore; - for (let lineIndex = 0; lineIndex < map.normalLines.length; lineIndex++) { - const line = map.normalLines[lineIndex]; // 当前直线 - const startScreen = worldToScreen(line.startPos.x, line.startPos.y, store); // 起点屏幕位置 - const endScreen = worldToScreen(line.endPos.x, line.endPos.y, store); // 终点屏幕位置 - - // 绘制发光直线 - canvasCtx.save(); - canvasCtx.shadowColor = '#00e5ff'; // 阴影颜色(产生辉光) - canvasCtx.shadowBlur = 5; // 辉光扩散半径 - canvasCtx.strokeStyle = '#00e5ff'; // 线条颜色:青色 - canvasCtx.lineWidth = 2; // 线宽 - canvasCtx.globalAlpha = 0.8; // 80%不透明 - canvasCtx.beginPath(); - canvasCtx.moveTo(startScreen.x, startScreen.y); // 从起点 - canvasCtx.lineTo(endScreen.x, endScreen.y); // 到终点 - canvasCtx.stroke(); - canvasCtx.restore(); - - // 在中点绘制方向箭头 - const midpointX = (startScreen.x + endScreen.x) / 2; // 中点X - const midpointY = (startScreen.y + endScreen.y) / 2; // 中点Y - const arrowAngle = Math.atan2(endScreen.y - startScreen.y, endScreen.x - startScreen.x); // 线段方向角 - const arrowLength = 5; // 箭头长度 - canvasCtx.fillStyle = 'rgba(0,229,255,0.6)'; // 箭头填充色 - canvasCtx.beginPath(); - canvasCtx.moveTo(midpointX + Math.cos(arrowAngle) * arrowLength, midpointY + Math.sin(arrowAngle) * arrowLength); // 箭头尖端 - canvasCtx.lineTo(midpointX + Math.cos(arrowAngle + 2.5) * 4, midpointY + Math.sin(arrowAngle + 2.5) * 4); // 左翼 - canvasCtx.lineTo(midpointX + Math.cos(arrowAngle - 2.5) * 4, midpointY + Math.sin(arrowAngle - 2.5) * 4); // 右翼 - canvasCtx.closePath(); - canvasCtx.fill(); - } -}; - -/** - * 绘制高级曲线列表 - * @param {*} canvasCtx - * @param {*} map - * @param {*} dataStore - */ -export const drawAdvancedCurveList = (canvasCtx, map, dataStore) => { - const store = dataStore || inspectionStore; - for (let curveIndex = 0; curveIndex < map.advancedCurves.length; curveIndex++) { - const curve = map.advancedCurves[curveIndex]; // 当前曲线 - - // 提取起点和终点的 pos(注意:startPos/endPos 是 {instanceName, pos:{x,y}} 结构) - const startPoint = curve.startPos?.pos; // 起点世界坐标 - const endPoint = curve.endPos?.pos; // 终点世界坐标 - const controlPoint1 = curve.controlPos1; // 第一控制点(直接 {x,y}) - const controlPoint2 = curve.controlPos2; // 第二控制点(直接 {x,y}) - if (!startPoint || !endPoint) continue; // 缺少端点则跳过 - - // 转换为屏幕坐标 - const startScreen = worldToScreen(startPoint.x, startPoint.y, store); - const endScreen = worldToScreen(endPoint.x, endPoint.y, store); - const cp1Screen = controlPoint1 ? worldToScreen(controlPoint1.x, controlPoint1.y, store) : null; // 可能不存在 - const cp2Screen = controlPoint2 ? worldToScreen(controlPoint2.x, controlPoint2.y, store) : null; - - // ── 绘制贝塞尔曲线(虚线)── - canvasCtx.save(); - canvasCtx.shadowColor = '#76ff03'; // 酸绿色辉光 - canvasCtx.shadowBlur = 5; - canvasCtx.strokeStyle = '#76ff03'; // 酸绿色线条 - canvasCtx.lineWidth = 2; - canvasCtx.setLineDash([8, 5]); // 虚线模式 - canvasCtx.globalAlpha = 0.85; - canvasCtx.beginPath(); - canvasCtx.moveTo(startScreen.x, startScreen.y); // 起点 - if (cp1Screen && cp2Screen) { - // 有2个控制点 → 三次贝塞尔 (cubic bezier) - canvasCtx.bezierCurveTo(cp1Screen.x, cp1Screen.y, cp2Screen.x, cp2Screen.y, endScreen.x, endScreen.y); - } else if (cp1Screen) { - // 仅1个控制点 → 二次贝塞尔 (quadratic bezier) - canvasCtx.quadraticCurveTo(cp1Screen.x, cp1Screen.y, endScreen.x, endScreen.y); - } else { - // 无控制点 → 直线 - canvasCtx.lineTo(endScreen.x, endScreen.y); - } - canvasCtx.stroke(); - canvasCtx.setLineDash([]); // 恢复实线 - canvasCtx.restore(); - - // ── 在 t=0.5 处绘制方向箭头 ── - if (cp1Screen && cp2Screen) { - const t = 0.5; // 参数 t = 0.5(曲线中点) - const oneMinusT = 0.5; // 1-t = 0.5 - // 三次贝塞尔公式计算中点坐标 - const arrowX = oneMinusT ** 3 * startScreen.x + 3 * oneMinusT ** 2 * t * cp1Screen.x + 3 * oneMinusT * t ** 2 * cp2Screen.x + t ** 3 * endScreen.x; - const arrowY = oneMinusT ** 3 * startScreen.y + 3 * oneMinusT ** 2 * t * cp1Screen.y + 3 * oneMinusT * t ** 2 * cp2Screen.y + t ** 3 * endScreen.y; - // 三次贝塞尔的一阶导数(切线方向) - const tangentX = 3 * oneMinusT ** 2 * (cp1Screen.x - startScreen.x) + 6 * oneMinusT * t * (cp2Screen.x - cp1Screen.x) + 3 * t ** 2 * (endScreen.x - cp2Screen.x); - const tangentY = 3 * oneMinusT ** 2 * (cp1Screen.y - startScreen.y) + 6 * oneMinusT * t * (cp2Screen.y - cp1Screen.y) + 3 * t ** 2 * (endScreen.y - cp2Screen.y); - const tangentAngle = Math.atan2(tangentY, tangentX); // 切线角度 - - // 绘制箭头 - canvasCtx.fillStyle = 'rgba(118,255,3,0.7)'; - canvasCtx.beginPath(); - canvasCtx.moveTo(arrowX + Math.cos(tangentAngle) * 5, arrowY + Math.sin(tangentAngle) * 5); - canvasCtx.lineTo(arrowX + Math.cos(tangentAngle + 2.5) * 4, arrowY + Math.sin(tangentAngle + 2.5) * 4); - canvasCtx.lineTo(arrowX + Math.cos(tangentAngle - 2.5) * 4, arrowY + Math.sin(tangentAngle - 2.5) * 4); - canvasCtx.closePath(); - canvasCtx.fill(); - - // 绘制控制点小圆(辅助调试用) - canvasCtx.fillStyle = 'rgba(118,255,3,0.25)'; // 浅绿色半透明 - for (const controlScreen of [cp1Screen, cp2Screen]) { - canvasCtx.beginPath(); - canvasCtx.arc(controlScreen.x, controlScreen.y, 2.5, 0, Math.PI * 2); // 半径2.5px的小圆 - canvasCtx.fill(); - } - } - - // ── 曲线名称标签 ── - // canvasCtx.font = '500 7px "JetBrains Mono"'; - // canvasCtx.fillStyle = 'rgba(118,255,3,0.5)'; - // canvasCtx.textAlign = 'center'; - // const labelScreenY = Math.min(startScreen.y, endScreen.y) - 8; // 标签放在最高点上方 - // canvasCtx.fillText(curve.instanceName || '', (startScreen.x + endScreen.x) / 2, labelScreenY); - } -}; - -/** - * 绘制高级点列表 - * @param {*} canvasCtx - * @param {*} map - * @param {*} dataStore - */ -export const drawAdvancedPointList = (canvasCtx, map, dataStore) => { - const store = dataStore || inspectionStore; - for (let pointIndex = 0; pointIndex < map.advancedPoints.length; pointIndex++) { - const advPoint = map.advancedPoints[pointIndex]; // 当前高级点 - const pointScreen = worldToScreen(advPoint.pos.x, advPoint.pos.y, store); // 屏幕位置 - - // 判断是否被鼠标悬停 - const isHovered = store.hoveredElement && - store.hoveredElement.kind === 'point' && - store.hoveredElement.index === pointIndex; - - // ── 根据 className 决定颜色 ── - let pointColorHex = '#ffd600'; // 默认琥珀色 - const classNameLower = (advPoint.className || '').toLowerCase(); - if (classNameLower.includes('landmark') || classNameLower.includes('land')) { - pointColorHex = '#ffd600'; // LandMark → 琥珀色 - } else if (classNameLower.includes('charge')) { - pointColorHex = '#22c55e'; // 充电点 → 绿色 - } else if (classNameLower.includes('load')) { - pointColorHex = '#3b82f6'; // 装载点 → 蓝色 - } else if (classNameLower.includes('work') || classNameLower.includes('process')) { - pointColorHex = '#a855f7'; // 工位 → 紫色 - } else if (classNameLower.includes('station')) { - pointColorHex = '#00e5ff'; // 站点 → 青色 - } - - // ── 绘制菱形标记 ── - const diamondRadius = isHovered ? 8 : 5; // 悬停时放大 - const pulseAlpha = isHovered ? Math.sin(store.animationTimeSeconds * 5) * 0.2 + 0.8 : 1; // 悬停时脉冲闪烁 - - canvasCtx.save(); - canvasCtx.globalAlpha = pulseAlpha; // 应用透明度 - canvasCtx.shadowColor = pointColorHex; // 辉光颜色 - canvasCtx.shadowBlur = isHovered ? 18 : 8; // 悬停时增强辉光 - - // 绘制旋转45度的正方形(菱形) - canvasCtx.fillStyle = pointColorHex; - canvasCtx.beginPath(); - canvasCtx.moveTo(pointScreen.x, pointScreen.y - diamondRadius); // 上顶点 - canvasCtx.lineTo(pointScreen.x + diamondRadius * 0.7, pointScreen.y); // 右顶点 - canvasCtx.lineTo(pointScreen.x, pointScreen.y + diamondRadius); // 下顶点 - canvasCtx.lineTo(pointScreen.x - diamondRadius * 0.7, pointScreen.y); // 左顶点 - canvasCtx.closePath(); - canvasCtx.fill(); - - // 中心白色小圆点(指示精确位置) - canvasCtx.shadowBlur = 0; - canvasCtx.fillStyle = '#fff'; - canvasCtx.globalAlpha = 0.9; - canvasCtx.beginPath(); - canvasCtx.arc(pointScreen.x, pointScreen.y, 1.8, 0, Math.PI * 2); // 半径1.8px - canvasCtx.fill(); - canvasCtx.restore(); - - // ── 方向箭头(基于 dir 字段,弧度)── - if (advPoint.dir !== undefined && advPoint.dir !== null) { - // dir 可能是字符串(smap 样例中为 "-1.5759999999999958")或数字 - const dirRadians = typeof advPoint.dir === 'string' ? parseFloat(advPoint.dir) : advPoint.dir; - if (!isNaN(dirRadians)) { // 有效方向角 - const arrowLengthPx = 12; // 箭头长度(屏幕像素) - canvasCtx.strokeStyle = hexToCssRgba(pointColorHex, 0.5); // 半透明的线条 - canvasCtx.lineWidth = 1; - canvasCtx.beginPath(); - canvasCtx.moveTo(pointScreen.x, pointScreen.y); // 从点中心出发 - // 注意:世界坐标 Y 向上,但 atan2 使用的 dir 是标准数学角,屏幕 Y 翻转后取负 - canvasCtx.lineTo( - pointScreen.x + Math.cos(dirRadians) * arrowLengthPx, - pointScreen.y - Math.sin(dirRadians) * arrowLengthPx // Y 翻转 - ); - canvasCtx.stroke(); - } - } - - // ── 名称标签 ── - canvasCtx.font = '500 12px "JetBrains Mono"'; - canvasCtx.fillStyle = hexToCssRgba(pointColorHex, 0.7); - canvasCtx.textAlign = 'center'; - canvasCtx.fillText(advPoint.instanceName || '', pointScreen.x, pointScreen.y - diamondRadius - 4); - } -} - -/** - * 绘制地图边界 - * @param {*} canvasCtx - * @param {*} map - * @param {*} dataStore - */ -export const drawMapBoundary = (canvasCtx, map, dataStore) => { - const store = dataStore || inspectionStore; - const boundaryTopLeft = worldToScreen(map.originX, map.maxY, store); // 边界左上角屏幕位置 - const boundaryBottomRight = worldToScreen(map.maxX, map.originY, store); // 边界右下角屏幕位置 - canvasCtx.strokeStyle = 'rgba(0,229,160,0.1)'; // 极淡的青绿色 - canvasCtx.lineWidth = 1; - canvasCtx.setLineDash([5, 4]); // 虚线 - canvasCtx.strokeRect( - boundaryTopLeft.x, boundaryTopLeft.y, - boundaryBottomRight.x - boundaryTopLeft.x, - boundaryBottomRight.y - boundaryTopLeft.y - ); - canvasCtx.setLineDash([]); // 恢复实线 -}; - -/** - * 从 normalPosList 构建占据栅格图像 - * - * 原理:normalPosList 中每个点标记一个自由通行格子。 - * 未出现在列表中的格子 = 障碍物(墙壁) - * 墙壁格子如果紧邻自由格子,则标记为"墙壁边缘",渲染高亮 - * - * @param {Object} parsedMap - parseSmapJson 的输出 - * @param {boolean} showEdgeGlow - 是否计算墙壁边缘高亮效果 - * @returns {HTMLCanvasElement} 离屏 Canvas 元素,包含渲染好的栅格图像 - */ -export const buildOccupancyGridImage = (parsedMap, showEdgeGlow) => { - const gridW = parsedMap.gridWidth; // 栅格宽度(像素) - const gridH = parsedMap.gridHeight; // 栅格高度(像素) - const originX = parsedMap.originX; // 世界坐标原点 X - const originY = parsedMap.originY; // 世界坐标原点 Y - const resolution = parsedMap.resolution; // 分辨率 - - // ── 第一步:遍历 normalPosList,标记自由空间 ── - const occupancyGrid = new Uint8Array(gridW * gridH); // 0=墙壁, 1=自由空间 - for (const freeSpacePoint of parsedMap.normalPositions) { - // 将世界坐标转换为栅格像素坐标 - const gridColX = Math.floor((freeSpacePoint.x - originX) / resolution); // 列号(从左到右) - const pixelRowFromBottom = Math.floor((freeSpacePoint.y - originY) / resolution); // 行号(从下到上,世界坐标系) - const imageRowY = gridH - 1 - pixelRowFromBottom; // 翻转为图像行号(从上到下) - // 安全边界检查后标记为自由空间 - if (gridColX >= 0 && gridColX < gridW && imageRowY >= 0 && imageRowY < gridH) { - occupancyGrid[imageRowY * gridW + gridColX] = 1; // 标记该格为自由 - } - } - - // ── 第二步:遍历每个格子,按类型着色 ── - const offscreenCanvas = document.createElement('canvas'); // 创建离屏 Canvas - offscreenCanvas.width = gridW; // 设置尺寸 - offscreenCanvas.height = gridH; - const offscreenCtx = offscreenCanvas.getContext('2d'); // 获取上下文 - const imageData = offscreenCtx.createImageData(gridW, gridH);// 创建 ImageData - const pixelData = imageData.data; // 像素数据数组 (RGBA 扁平排列) - - // 定义三种颜色 - const FREE_SPACE_R = 10, FREE_SPACE_G = 16, FREE_SPACE_B = 30; // 自由空间:深蓝黑 - const WALL_INTERIOR_R = 22, WALL_INTERIOR_G = 36, WALL_INTERIOR_B = 64; // 墙壁内部:深蓝 - const WALL_EDGE_R = 45, WALL_EDGE_G = 130, WALL_EDGE_B = 255; // 墙壁边缘:亮蓝 - - for (let rowY = 0; rowY < gridH; rowY++) { // 逐行扫描 - for (let colX = 0; colX < gridW; colX++) { // 逐列扫描 - const gridIndex = rowY * gridW + colX; // 一维数组索引 - const pixelOffset = gridIndex << 2; // RGBA 偏移(×4) - - if (occupancyGrid[gridIndex] === 1) { - // ── 自由空间 ── - pixelData[pixelOffset] = FREE_SPACE_R; // R - pixelData[pixelOffset + 1] = FREE_SPACE_G; // G - pixelData[pixelOffset + 2] = FREE_SPACE_B; // B - pixelData[pixelOffset + 3] = 255; // A(不透明) - } else { - // ── 障物(墙壁)── 判断是否为边缘 - let isAdjacentToFreeSpace = false; // 是否紧邻自由空间 - if (showEdgeGlow) { // 仅在启用边缘效果时检测 - if (rowY > 0 && occupancyGrid[(rowY - 1) * gridW + colX] === 1) isAdjacentToFreeSpace = true; // 上方 - else if (rowY < gridH - 1 && occupancyGrid[(rowY + 1) * gridW + colX] === 1) isAdjacentToFreeSpace = true; // 下方 - else if (colX > 0 && occupancyGrid[rowY * gridW + colX - 1] === 1) isAdjacentToFreeSpace = true; // 左方 - else if (colX < gridW - 1 && occupancyGrid[rowY * gridW + colX + 1] === 1) isAdjacentToFreeSpace = true; // 右方 - } - if (isAdjacentToFreeSpace) { - // 墙壁边缘:亮蓝色 - pixelData[pixelOffset] = WALL_EDGE_R; - pixelData[pixelOffset + 1] = WALL_EDGE_G; - pixelData[pixelOffset + 2] = WALL_EDGE_B; - pixelData[pixelOffset + 3] = 255; - } else { - // 墙壁内部:深蓝色 - pixelData[pixelOffset] = WALL_INTERIOR_R; - pixelData[pixelOffset + 1] = WALL_INTERIOR_G; - pixelData[pixelOffset + 2] = WALL_INTERIOR_B; - pixelData[pixelOffset + 3] = 255; - } - } - } - } - - // 将 ImageData 绘制到离屏 Canvas 上 - offscreenCtx.putImageData(imageData, 0, 0); - return offscreenCanvas; -} - -export class MobileRobot { - constructor(id, name, x, y, angleRad = 0, color = '#15ff00', imageUrl = null) { - this.id = id; - this.name = name; - this.x = x; // 世界坐标X (米) - this.y = y; // 世界坐标Y (米) - this.angle = angleRad; // 朝向弧度 - this.imageUrl = imageUrl || '/bot.svg'; - this.color = color; // 颜色 - // 预加载图片 (可选) - this.imgElement = null; - if (this.imageUrl) { - this.init(color, this.imageUrl) - } - } - - async init(color, imageUrl) { - const response = await fetch(imageUrl); - let svgText = await response.text(); - // 替换颜色 - svgText = svgText.replace(/currentColor/g, color); - svgText = svgText.replace(/stroke="[^"]*"/g, `stroke="${color}"`); - // 创建Blob URL - const blob = new Blob([svgText], { type: 'image/svg+xml' }); - const url = URL.createObjectURL(blob); - this.imgElement = new Image(); - this.imgElement.src = url; - } - // 命中检测: 检查世界坐标是否在机器人区域内 (半径0.35米) - hitTest(worldX, worldY, pixelsPerMeter){ - const dx = worldX - this.x; - const dy = worldY - this.y; - const distance = Math.hypot(dx, dy); - const hitRadius = 0.35; // 米 - return distance < hitRadius; - } - - // 绘制到canvas上下文 (屏幕坐标) - draw(ctx, screenX, screenY, color, scale = 1) { - const size = 24; // 绘制大小px - if (this.imgElement && this.imgElement.complete) { - ctx.save(); - ctx.translate(screenX, screenY); - ctx.rotate(-this.angle); // canvas Y向下, 角度翻转适配 - ctx.drawImage(this.imgElement, -size / 2, -size / 2, size, size); - ctx.restore(); - } - // 名字标签 - ctx.font = '12px "JetBrains Mono"'; - ctx.fillStyle = color; - ctx.shadowBlur = 0; - ctx.fillText(this.name, screenX, screenY - 20); - } - - // 更新位置 - setPosition(x, y) { this.x = x; this.y = y; } - setAngle(rad) { this.angle = rad; } -} - diff --git a/src/views/inspection/cockpit/components/Header.vue b/src/views/inspection/cockpit/components/Header.vue deleted file mode 100644 index 7c1da4a..0000000 --- a/src/views/inspection/cockpit/components/Header.vue +++ /dev/null @@ -1,161 +0,0 @@ - - - \ No newline at end of file diff --git a/src/views/inspection/cockpit/components/ManualTakeover/DirectionControl.vue b/src/views/inspection/cockpit/components/ManualTakeover/DirectionControl.vue deleted file mode 100644 index 4e1f1d5..0000000 --- a/src/views/inspection/cockpit/components/ManualTakeover/DirectionControl.vue +++ /dev/null @@ -1,325 +0,0 @@ - - - diff --git a/src/views/inspection/cockpit/components/ManualTakeover/RoboticArm.vue b/src/views/inspection/cockpit/components/ManualTakeover/RoboticArm.vue deleted file mode 100644 index 8ba9ba0..0000000 --- a/src/views/inspection/cockpit/components/ManualTakeover/RoboticArm.vue +++ /dev/null @@ -1,419 +0,0 @@ - - - diff --git a/src/views/inspection/cockpit/components/ManualTakeover/VoiceConversation.vue b/src/views/inspection/cockpit/components/ManualTakeover/VoiceConversation.vue deleted file mode 100644 index 280c094..0000000 --- a/src/views/inspection/cockpit/components/ManualTakeover/VoiceConversation.vue +++ /dev/null @@ -1,1125 +0,0 @@ - - - - - diff --git a/src/views/inspection/cockpit/components/ManualTakeover/index.vue b/src/views/inspection/cockpit/components/ManualTakeover/index.vue deleted file mode 100644 index eaf49da..0000000 --- a/src/views/inspection/cockpit/components/ManualTakeover/index.vue +++ /dev/null @@ -1,622 +0,0 @@ - - - - diff --git a/src/views/inspection/cockpit/components/MapCanvas.vue b/src/views/inspection/cockpit/components/MapCanvas.vue deleted file mode 100644 index 8c8e59c..0000000 --- a/src/views/inspection/cockpit/components/MapCanvas.vue +++ /dev/null @@ -1,527 +0,0 @@ - - - - - diff --git a/src/views/inspection/cockpit/components/MapOverview.vue b/src/views/inspection/cockpit/components/MapOverview.vue deleted file mode 100644 index 34cca2e..0000000 --- a/src/views/inspection/cockpit/components/MapOverview.vue +++ /dev/null @@ -1,433 +0,0 @@ - - - - - diff --git a/src/views/inspection/cockpit/components/Monitor.vue b/src/views/inspection/cockpit/components/Monitor.vue deleted file mode 100644 index 6dd44a5..0000000 --- a/src/views/inspection/cockpit/components/Monitor.vue +++ /dev/null @@ -1,209 +0,0 @@ - - - diff --git a/src/views/inspection/cockpit/components/UrdfView.vue b/src/views/inspection/cockpit/components/UrdfView.vue deleted file mode 100644 index 254c787..0000000 --- a/src/views/inspection/cockpit/components/UrdfView.vue +++ /dev/null @@ -1,292 +0,0 @@ - - - - - diff --git a/src/views/inspection/cockpit/index.vue b/src/views/inspection/cockpit/index.vue deleted file mode 100644 index 916636b..0000000 --- a/src/views/inspection/cockpit/index.vue +++ /dev/null @@ -1,50 +0,0 @@ - - - \ No newline at end of file diff --git a/src/views/inspection/point/index.vue b/src/views/inspection/point/index.vue deleted file mode 100644 index 5f11aa6..0000000 --- a/src/views/inspection/point/index.vue +++ /dev/null @@ -1,419 +0,0 @@ - - - diff --git a/src/views/inspection/runTask/index.vue b/src/views/inspection/runTask/index.vue deleted file mode 100644 index a4ef912..0000000 --- a/src/views/inspection/runTask/index.vue +++ /dev/null @@ -1,824 +0,0 @@ - - - diff --git a/src/views/inspection/runTask/task-log.vue b/src/views/inspection/runTask/task-log.vue deleted file mode 100644 index 31e8947..0000000 --- a/src/views/inspection/runTask/task-log.vue +++ /dev/null @@ -1,469 +0,0 @@ - - - - - diff --git a/src/views/inspection/runTask/task-steps.vue b/src/views/inspection/runTask/task-steps.vue deleted file mode 100644 index 6d7e595..0000000 --- a/src/views/inspection/runTask/task-steps.vue +++ /dev/null @@ -1,117 +0,0 @@ - - - - diff --git a/src/views/inspection/task/index.vue b/src/views/inspection/task/index.vue deleted file mode 100644 index 8a9f73f..0000000 --- a/src/views/inspection/task/index.vue +++ /dev/null @@ -1,404 +0,0 @@ - - - diff --git a/src/views/intelligenceTest/car/index.vue b/src/views/intelligenceTest/car/index.vue deleted file mode 100644 index a4ae1a2..0000000 --- a/src/views/intelligenceTest/car/index.vue +++ /dev/null @@ -1,304 +0,0 @@ - - - diff --git a/src/views/intelligenceTest/mobilePhone/index.vue b/src/views/intelligenceTest/mobilePhone/index.vue deleted file mode 100644 index 89d0a04..0000000 --- a/src/views/intelligenceTest/mobilePhone/index.vue +++ /dev/null @@ -1,321 +0,0 @@ - - - diff --git a/src/views/intelligenceTest/runningTask/index.vue b/src/views/intelligenceTest/runningTask/index.vue deleted file mode 100644 index 28abdd8..0000000 --- a/src/views/intelligenceTest/runningTask/index.vue +++ /dev/null @@ -1,885 +0,0 @@ - - - diff --git a/src/views/intelligenceTest/runningTask/task-log.vue b/src/views/intelligenceTest/runningTask/task-log.vue deleted file mode 100644 index 562bff7..0000000 --- a/src/views/intelligenceTest/runningTask/task-log.vue +++ /dev/null @@ -1,641 +0,0 @@ - - - - - diff --git a/src/views/intelligenceTest/runningTask/task-steps.vue b/src/views/intelligenceTest/runningTask/task-steps.vue deleted file mode 100644 index 667bc41..0000000 --- a/src/views/intelligenceTest/runningTask/task-steps.vue +++ /dev/null @@ -1,117 +0,0 @@ - - - - diff --git a/src/views/intelligenceTest/taskManage/index.vue b/src/views/intelligenceTest/taskManage/index.vue deleted file mode 100644 index 9d0ea7c..0000000 --- a/src/views/intelligenceTest/taskManage/index.vue +++ /dev/null @@ -1,376 +0,0 @@ - - - diff --git a/src/views/intelligenceTest/testCase/index.vue b/src/views/intelligenceTest/testCase/index.vue deleted file mode 100644 index 0c6cc25..0000000 --- a/src/views/intelligenceTest/testCase/index.vue +++ /dev/null @@ -1,344 +0,0 @@ - - - diff --git a/src/views/login.vue b/src/views/login.vue deleted file mode 100644 index 36116e2..0000000 --- a/src/views/login.vue +++ /dev/null @@ -1,239 +0,0 @@ - - - - - diff --git a/src/views/monitor/cache/index.vue b/src/views/monitor/cache/index.vue deleted file mode 100644 index 271cc8e..0000000 --- a/src/views/monitor/cache/index.vue +++ /dev/null @@ -1,132 +0,0 @@ - - - diff --git a/src/views/monitor/cache/list.vue b/src/views/monitor/cache/list.vue deleted file mode 100644 index 6515fcd..0000000 --- a/src/views/monitor/cache/list.vue +++ /dev/null @@ -1,246 +0,0 @@ - - - diff --git a/src/views/monitor/druid/index.vue b/src/views/monitor/druid/index.vue deleted file mode 100644 index 29c1aa7..0000000 --- a/src/views/monitor/druid/index.vue +++ /dev/null @@ -1,13 +0,0 @@ - - - diff --git a/src/views/monitor/job/detail.vue b/src/views/monitor/job/detail.vue deleted file mode 100644 index ab09d50..0000000 --- a/src/views/monitor/job/detail.vue +++ /dev/null @@ -1,217 +0,0 @@ - - - - - diff --git a/src/views/monitor/job/index.vue b/src/views/monitor/job/index.vue deleted file mode 100644 index 25b4532..0000000 --- a/src/views/monitor/job/index.vue +++ /dev/null @@ -1,435 +0,0 @@ - - - diff --git a/src/views/monitor/job/log.vue b/src/views/monitor/job/log.vue deleted file mode 100644 index 8651c74..0000000 --- a/src/views/monitor/job/log.vue +++ /dev/null @@ -1,251 +0,0 @@ - - - diff --git a/src/views/monitor/logininfor/index.vue b/src/views/monitor/logininfor/index.vue deleted file mode 100644 index 86f9f0b..0000000 --- a/src/views/monitor/logininfor/index.vue +++ /dev/null @@ -1,233 +0,0 @@ - - - diff --git a/src/views/monitor/online/index.vue b/src/views/monitor/online/index.vue deleted file mode 100644 index fee70fe..0000000 --- a/src/views/monitor/online/index.vue +++ /dev/null @@ -1,109 +0,0 @@ - - - diff --git a/src/views/monitor/operlog/detail.vue b/src/views/monitor/operlog/detail.vue deleted file mode 100644 index 6ebc593..0000000 --- a/src/views/monitor/operlog/detail.vue +++ /dev/null @@ -1,152 +0,0 @@ - - - diff --git a/src/views/monitor/operlog/index.vue b/src/views/monitor/operlog/index.vue deleted file mode 100644 index 9648905..0000000 --- a/src/views/monitor/operlog/index.vue +++ /dev/null @@ -1,262 +0,0 @@ - - - diff --git a/src/views/monitor/server/index.vue b/src/views/monitor/server/index.vue deleted file mode 100644 index 60ff80c..0000000 --- a/src/views/monitor/server/index.vue +++ /dev/null @@ -1,187 +0,0 @@ - - - diff --git a/src/views/redirect/index.vue b/src/views/redirect/index.vue deleted file mode 100644 index 99dd4f5..0000000 --- a/src/views/redirect/index.vue +++ /dev/null @@ -1,14 +0,0 @@ - - - \ No newline at end of file diff --git a/src/views/register.vue b/src/views/register.vue deleted file mode 100644 index 254cc8e..0000000 --- a/src/views/register.vue +++ /dev/null @@ -1,219 +0,0 @@ - - - - - diff --git a/src/views/resource/device/index.vue b/src/views/resource/device/index.vue deleted file mode 100644 index a28535e..0000000 --- a/src/views/resource/device/index.vue +++ /dev/null @@ -1,104 +0,0 @@ - - - - - diff --git a/src/views/resource/map/index.vue b/src/views/resource/map/index.vue deleted file mode 100644 index 745e05e..0000000 --- a/src/views/resource/map/index.vue +++ /dev/null @@ -1,189 +0,0 @@ - - - diff --git a/src/views/resource/robot/index.vue b/src/views/resource/robot/index.vue deleted file mode 100644 index 04f3b84..0000000 --- a/src/views/resource/robot/index.vue +++ /dev/null @@ -1,339 +0,0 @@ - - - - - diff --git a/src/views/resource/terminal/index.vue b/src/views/resource/terminal/index.vue deleted file mode 100644 index 8bb484f..0000000 --- a/src/views/resource/terminal/index.vue +++ /dev/null @@ -1,75 +0,0 @@ - - - - - diff --git a/src/views/system/config/index.vue b/src/views/system/config/index.vue deleted file mode 100644 index beaaa7f..0000000 --- a/src/views/system/config/index.vue +++ /dev/null @@ -1,316 +0,0 @@ - - - diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue deleted file mode 100644 index 9c8b317..0000000 --- a/src/views/system/dept/index.vue +++ /dev/null @@ -1,334 +0,0 @@ - - - diff --git a/src/views/system/dict/data.vue b/src/views/system/dict/data.vue deleted file mode 100644 index d96fd1f..0000000 --- a/src/views/system/dict/data.vue +++ /dev/null @@ -1,362 +0,0 @@ - - - diff --git a/src/views/system/dict/detail.vue b/src/views/system/dict/detail.vue deleted file mode 100644 index 472267b..0000000 --- a/src/views/system/dict/detail.vue +++ /dev/null @@ -1,202 +0,0 @@ - - - - - diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue deleted file mode 100644 index 1e64264..0000000 --- a/src/views/system/dict/index.vue +++ /dev/null @@ -1,346 +0,0 @@ - - - diff --git a/src/views/system/file/index.vue b/src/views/system/file/index.vue deleted file mode 100644 index 8fa3319..0000000 --- a/src/views/system/file/index.vue +++ /dev/null @@ -1,350 +0,0 @@ - - - diff --git a/src/views/system/group/index.vue b/src/views/system/group/index.vue deleted file mode 100644 index 925ef7d..0000000 --- a/src/views/system/group/index.vue +++ /dev/null @@ -1,289 +0,0 @@ - - - diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue deleted file mode 100644 index 9bc0ee8..0000000 --- a/src/views/system/menu/index.vue +++ /dev/null @@ -1,508 +0,0 @@ - - - diff --git a/src/views/system/notice/ReadUsers.vue b/src/views/system/notice/ReadUsers.vue deleted file mode 100644 index 7590bef..0000000 --- a/src/views/system/notice/ReadUsers.vue +++ /dev/null @@ -1,118 +0,0 @@ - - - - - diff --git a/src/views/system/notice/index.vue b/src/views/system/notice/index.vue deleted file mode 100644 index 7541a48..0000000 --- a/src/views/system/notice/index.vue +++ /dev/null @@ -1,306 +0,0 @@ - - - diff --git a/src/views/system/post/index.vue b/src/views/system/post/index.vue deleted file mode 100644 index 316e0d7..0000000 --- a/src/views/system/post/index.vue +++ /dev/null @@ -1,287 +0,0 @@ - - - diff --git a/src/views/system/role/authUser.vue b/src/views/system/role/authUser.vue deleted file mode 100644 index 6848eb4..0000000 --- a/src/views/system/role/authUser.vue +++ /dev/null @@ -1,179 +0,0 @@ - - - - diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue deleted file mode 100644 index c191194..0000000 --- a/src/views/system/role/index.vue +++ /dev/null @@ -1,584 +0,0 @@ - - - diff --git a/src/views/system/role/selectUser.vue b/src/views/system/role/selectUser.vue deleted file mode 100644 index 58b621a..0000000 --- a/src/views/system/role/selectUser.vue +++ /dev/null @@ -1,144 +0,0 @@ - - - diff --git a/src/views/system/user/authRole.vue b/src/views/system/user/authRole.vue deleted file mode 100644 index 28b40e7..0000000 --- a/src/views/system/user/authRole.vue +++ /dev/null @@ -1,123 +0,0 @@ - - - diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue deleted file mode 100644 index 6528964..0000000 --- a/src/views/system/user/index.vue +++ /dev/null @@ -1,459 +0,0 @@ - - - diff --git a/src/views/system/user/profile/index.vue b/src/views/system/user/profile/index.vue deleted file mode 100644 index dfb4a66..0000000 --- a/src/views/system/user/profile/index.vue +++ /dev/null @@ -1,94 +0,0 @@ - - - diff --git a/src/views/system/user/profile/resetPwd.vue b/src/views/system/user/profile/resetPwd.vue deleted file mode 100644 index e454938..0000000 --- a/src/views/system/user/profile/resetPwd.vue +++ /dev/null @@ -1,60 +0,0 @@ - - - diff --git a/src/views/system/user/profile/userAvatar.vue b/src/views/system/user/profile/userAvatar.vue deleted file mode 100644 index 64d2c94..0000000 --- a/src/views/system/user/profile/userAvatar.vue +++ /dev/null @@ -1,180 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/system/user/profile/userInfo.vue b/src/views/system/user/profile/userInfo.vue deleted file mode 100644 index 9fcc09b..0000000 --- a/src/views/system/user/profile/userInfo.vue +++ /dev/null @@ -1,67 +0,0 @@ - - - diff --git a/src/views/system/user/view.vue b/src/views/system/user/view.vue deleted file mode 100644 index 593a163..0000000 --- a/src/views/system/user/view.vue +++ /dev/null @@ -1,175 +0,0 @@ - - - diff --git a/src/views/system/vehOper/index.vue b/src/views/system/vehOper/index.vue deleted file mode 100644 index 0a9b389..0000000 --- a/src/views/system/vehOper/index.vue +++ /dev/null @@ -1,349 +0,0 @@ - - - diff --git a/src/views/tool/build/CodeTypeDialog.vue b/src/views/tool/build/CodeTypeDialog.vue deleted file mode 100644 index de0beb7..0000000 --- a/src/views/tool/build/CodeTypeDialog.vue +++ /dev/null @@ -1,71 +0,0 @@ - - - \ No newline at end of file diff --git a/src/views/tool/build/DraggableItem.vue b/src/views/tool/build/DraggableItem.vue deleted file mode 100644 index 9ae2354..0000000 --- a/src/views/tool/build/DraggableItem.vue +++ /dev/null @@ -1,68 +0,0 @@ - - \ No newline at end of file diff --git a/src/views/tool/build/IconsDialog.vue b/src/views/tool/build/IconsDialog.vue deleted file mode 100644 index 98d9c13..0000000 --- a/src/views/tool/build/IconsDialog.vue +++ /dev/null @@ -1,115 +0,0 @@ - - - diff --git a/src/views/tool/build/RightPanel.vue b/src/views/tool/build/RightPanel.vue deleted file mode 100644 index 5fe80fb..0000000 --- a/src/views/tool/build/RightPanel.vue +++ /dev/null @@ -1,906 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/tool/build/TreeNodeDialog.vue b/src/views/tool/build/TreeNodeDialog.vue deleted file mode 100644 index 372d3af..0000000 --- a/src/views/tool/build/TreeNodeDialog.vue +++ /dev/null @@ -1,93 +0,0 @@ - - diff --git a/src/views/tool/build/index.vue b/src/views/tool/build/index.vue deleted file mode 100644 index 64a9317..0000000 --- a/src/views/tool/build/index.vue +++ /dev/null @@ -1,660 +0,0 @@ - - - - - diff --git a/src/views/tool/gen/basicInfoForm.vue b/src/views/tool/gen/basicInfoForm.vue deleted file mode 100644 index 92c3ca9..0000000 --- a/src/views/tool/gen/basicInfoForm.vue +++ /dev/null @@ -1,48 +0,0 @@ - - - diff --git a/src/views/tool/gen/createTable.vue b/src/views/tool/gen/createTable.vue deleted file mode 100644 index b5fedde..0000000 --- a/src/views/tool/gen/createTable.vue +++ /dev/null @@ -1,46 +0,0 @@ - - - diff --git a/src/views/tool/gen/editTable.vue b/src/views/tool/gen/editTable.vue deleted file mode 100644 index 9433527..0000000 --- a/src/views/tool/gen/editTable.vue +++ /dev/null @@ -1,212 +0,0 @@ - - - diff --git a/src/views/tool/gen/genInfoForm.vue b/src/views/tool/gen/genInfoForm.vue deleted file mode 100644 index 5247772..0000000 --- a/src/views/tool/gen/genInfoForm.vue +++ /dev/null @@ -1,328 +0,0 @@ - - - diff --git a/src/views/tool/gen/importTable.vue b/src/views/tool/gen/importTable.vue deleted file mode 100644 index a73ad7a..0000000 --- a/src/views/tool/gen/importTable.vue +++ /dev/null @@ -1,126 +0,0 @@ - - - diff --git a/src/views/tool/gen/index.vue b/src/views/tool/gen/index.vue deleted file mode 100644 index 9359592..0000000 --- a/src/views/tool/gen/index.vue +++ /dev/null @@ -1,309 +0,0 @@ - - - diff --git a/src/views/tool/swagger/index.vue b/src/views/tool/swagger/index.vue deleted file mode 100644 index a3b03bb..0000000 --- a/src/views/tool/swagger/index.vue +++ /dev/null @@ -1,9 +0,0 @@ - - -