From 1a8ecd746e49598545ad0c5c27959e65fa528e91 Mon Sep 17 00:00:00 2001
From: zhanghao <774378400@qq.com>
Date: Thu, 16 Oct 2025 10:18:21 +0800
Subject: [PATCH 01/10] =?UTF-8?q?feat:=20=E8=AE=BE=E5=A4=87=E6=B3=A8?=
=?UTF-8?q?=E5=86=8C=E9=BA=A6=E5=85=8B=E9=A3=8E?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/device/microphone.js | 46 ++++
src/router/index.js | 10 +-
.../register/components/Microphone/index.vue | 225 ++++++++++++++++++
src/views/device/register/index.vue | 4 +
4 files changed, 284 insertions(+), 1 deletion(-)
create mode 100644 src/api/device/microphone.js
create mode 100644 src/views/device/register/components/Microphone/index.vue
diff --git a/src/api/device/microphone.js b/src/api/device/microphone.js
new file mode 100644
index 0000000..e5fa841
--- /dev/null
+++ b/src/api/device/microphone.js
@@ -0,0 +1,46 @@
+import request from '@/utils/request'
+
+// 开始录音
+export function startMicrophoneApi(data) {
+ return request({
+ url: '/api/Microphone/start',
+ method: 'post',
+ params: data
+ })
+}
+
+// 暂停录音
+export function pauseMicrophoneApi(data) {
+ return request({
+ url: '/api/Microphone/pause',
+ method: 'post',
+ params: data
+ })
+}
+
+// 恢复录音
+export function resumeMicrophoneApi(data) {
+ return request({
+ url: '/api/Microphone/resume',
+ method: 'post',
+ params: data
+ })
+}
+
+// 停止录音
+export function stopMicrophoneApi(data) {
+ return request({
+ url: '/api/Microphone/stop',
+ method: 'post',
+ params: data
+ })
+}
+
+// 播放音频
+export function playSpeaker(data) {
+ return request({
+ url: '/api/Speaker/play',
+ method: 'post',
+ params: data
+ })
+}
\ No newline at end of file
diff --git a/src/router/index.js b/src/router/index.js
index dbabe71..5c17dd3 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -1,6 +1,7 @@
import { createWebHistory, createRouter } from "vue-router";
/* Layout */
import Layout from "@/layout";
+import path from "path";
/**
* Note: 路由配置项
@@ -92,7 +93,14 @@ export const constantRoutes = [
name: "灵巧手示教",
meta: { title: "灵巧手详情" },
hidden: true,
- },
+ },{
+ path: "microphone/:id",
+ component: () =>
+ import("@/views/device/register/components/Microphone/index.vue"),
+ name: "麦克风示教",
+ meta: { title: "麦克风详情" },
+ hidden: true,
+ }
],
},
{
diff --git a/src/views/device/register/components/Microphone/index.vue b/src/views/device/register/components/Microphone/index.vue
new file mode 100644
index 0000000..fa76496
--- /dev/null
+++ b/src/views/device/register/components/Microphone/index.vue
@@ -0,0 +1,225 @@
+
+
+
远程麦克风
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/device/register/index.vue b/src/views/device/register/index.vue
index 986fb2d..7520614 100644
--- a/src/views/device/register/index.vue
+++ b/src/views/device/register/index.vue
@@ -378,6 +378,10 @@ function handleControl(row) {
const fullPath = `${row.deviceModel}/${row.id}`; // 构造路由路径
router.push({
path: fullPath,
+ query: {
+ terminalId: row.idDeDeviceTerminalConfig,
+ deviceId: row.deviceCode
+ }
}); // 使用路由跳转
// intoControlPage(`/${row.deviceModel}`, `${row.id}`)
}
From 907d75ffc1dfe2c0684c5d3075b563a0d656c04d Mon Sep 17 00:00:00 2001
From: zhanghao <774378400@qq.com>
Date: Fri, 24 Oct 2025 09:28:21 +0800
Subject: [PATCH 02/10] =?UTF-8?q?feat:=20=E9=85=8D=E7=BD=AE=E6=9D=83?=
=?UTF-8?q?=E9=99=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/device/profile/index.vue | 1018 ++++++++++++++--------------
src/views/vi/testProject/index.vue | 3 +
2 files changed, 511 insertions(+), 510 deletions(-)
diff --git a/src/views/device/profile/index.vue b/src/views/device/profile/index.vue
index c76ce62..ee10b2b 100644
--- a/src/views/device/profile/index.vue
+++ b/src/views/device/profile/index.vue
@@ -1,510 +1,508 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 新增
-
-
-
- 修改
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 修改
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ controlModuleList.find(item => item.value === scope.row.deviceModel)?.label }}
-
-
-
-
-
-
- 修改
-
- 删除
-
-
-
-
-
-
-
-
-
edit=false"
- @open="getDeviceList">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 新增
+
+
+
+ 修改
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 修改
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ controlModuleList.find(item => item.value === scope.row.deviceModel)?.label }}
+
+
+
+
+
+
+ 修改
+
+ 删除
+
+
+
+
+
+
+
+
+
edit=false"
+ @open="getDeviceList">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/vi/testProject/index.vue b/src/views/vi/testProject/index.vue
index 9ed1831..7f457ae 100644
--- a/src/views/vi/testProject/index.vue
+++ b/src/views/vi/testProject/index.vue
@@ -182,6 +182,7 @@
size="mini"
type="text"
@click="handleSetting(row)"
+ v-hasPermi="['system:project:add','system:project:edit']"
>配置
执行
可视化
From 1cf8cba6c43b3a53fbd20a831379f21858bc17ce Mon Sep 17 00:00:00 2001
From: zhanghao <774378400@qq.com>
Date: Fri, 24 Oct 2025 09:48:24 +0800
Subject: [PATCH 03/10] =?UTF-8?q?feat:=20=E9=80=82=E9=85=8D=E5=88=86?=
=?UTF-8?q?=E8=BE=A8=E7=8E=87?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/system/menu/index.vue | 913 ++++++++++-----------
src/views/system/role/index.vue | 1177 ++++++++++++++--------------
src/views/system/user/index.vue | 1085 ++++++++++++-------------
src/views/vi/testProject/index.vue | 166 ++--
4 files changed, 1684 insertions(+), 1657 deletions(-)
diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue
index 6cd0a93..d6ed77f 100644
--- a/src/views/system/menu/index.vue
+++ b/src/views/system/menu/index.vue
@@ -1,452 +1,461 @@
-
-
-
-
-
-
-
-
-
-
-
-
- 搜索
- 重置
-
-
-
-
-
- 新增
-
-
- 展开/折叠
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ parseTime(scope.row.createTime) }}
-
-
-
-
- 修改
- 新增
- 删除
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 目录
- 菜单
- 按钮
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 路由名称
-
-
-
-
-
-
-
-
-
-
-
- 是否外链
-
-
-
- 是
- 否
-
-
-
-
-
-
-
-
-
-
- 路由地址
-
-
-
-
-
-
-
-
-
-
-
-
- 组件路径
-
-
-
-
-
-
-
-
-
-
-
-
-
- 权限字符
-
-
-
-
-
-
-
-
-
-
-
-
- 路由参数
-
-
-
-
-
-
-
-
-
-
-
- 是否缓存
-
-
-
- 缓存
- 不缓存
-
-
-
-
-
-
-
-
-
-
- 显示状态
-
-
-
- {{ dict.label }}
-
-
-
-
-
-
-
-
-
-
- 菜单状态
-
-
-
- {{ dict.label }}
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+ 新增
+
+
+ 展开/折叠
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ parseTime(scope.row.createTime) }}
+
+
+
+
+ 修改
+ 新增
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 目录
+ 菜单
+ 按钮
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 路由名称
+
+
+
+
+
+
+
+
+
+
+
+ 是否外链
+
+
+
+ 是
+ 否
+
+
+
+
+
+
+
+
+
+
+ 路由地址
+
+
+
+
+
+
+
+
+
+
+
+
+ 组件路径
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 权限字符
+
+
+
+
+
+
+
+
+
+
+
+
+ 路由参数
+
+
+
+
+
+
+
+
+
+
+
+ 是否缓存
+
+
+
+ 缓存
+ 不缓存
+
+
+
+
+
+
+
+
+
+
+ 显示状态
+
+
+
+ {{ dict.label }}
+
+
+
+
+
+
+
+
+
+
+ 菜单状态
+
+
+
+ {{ dict.label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue
index 81b98dc..02e8048 100644
--- a/src/views/system/role/index.vue
+++ b/src/views/system/role/index.vue
@@ -1,584 +1,593 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 搜索
- 重置
-
-
-
-
- 新增
-
-
- 修改
-
-
- 删除
-
-
- 导出
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ parseTime(scope.row.createTime) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 权限字符
-
-
-
-
-
-
-
-
-
- {{ dict.label }}
-
-
-
- 展开/折叠
- 全选/全不选
- 父子联动
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 展开/折叠
- 全选/全不选
- 父子联动
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+ 新增
+
+
+ 修改
+
+
+ 删除
+
+
+ 导出
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ parseTime(scope.row.createTime) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 权限字符
+
+
+
+
+
+
+
+
+
+ {{ dict.label }}
+
+
+
+ 展开/折叠
+ 全选/全不选
+ 父子联动
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 展开/折叠
+ 全选/全不选
+ 父子联动
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue
index 04d482c..9cd3e8d 100644
--- a/src/views/system/user/index.vue
+++ b/src/views/system/user/index.vue
@@ -1,538 +1,547 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 搜索
- 重置
-
-
-
-
-
- 新增
-
-
- 修改
-
-
- 删除
-
-
- 导入
-
-
- 导出
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ parseTime(scope.row.createTime) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ dict.label }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 将文件拖到此处,或点击上传
-
-
-
- 是否更新已经存在的用户数据
-
-
仅允许导入xls、xlsx格式文件。
-
下载模板
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+ 新增
+
+
+ 修改
+
+
+ 删除
+
+
+ 导入
+
+
+ 导出
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ parseTime(scope.row.createTime) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ dict.label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 将文件拖到此处,或点击上传
+
+
+
+ 是否更新已经存在的用户数据
+
+
仅允许导入xls、xlsx格式文件。
+
下载模板
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/vi/testProject/index.vue b/src/views/vi/testProject/index.vue
index 7f457ae..cbaddb9 100644
--- a/src/views/vi/testProject/index.vue
+++ b/src/views/vi/testProject/index.vue
@@ -142,91 +142,91 @@
-
-
-
-
-
-
- {{ parseTime(row.planStart) }}
-
-
-
-
- {{ parseTime(row.planEnd) }}
-
-
-
-
-
-
-
-
-
- {{ row.status == 0 ? '已执行': '未执行' }}
-
-
-
-
- 配置
-
- 执行
-
- 可视化
-
- 修改
- 删除
-
-
-
+
+
+
+
+
+
+ {{ parseTime(row.planStart) }}
+
+
+
+
+ {{ parseTime(row.planEnd) }}
+
+
+
+
+
+
+
+
+
+ {{ row.status == 0 ? '已执行': '未执行' }}
+
+
+
+
+ 配置
+
+ 执行
+
+ 可视化
+
+ 修改
+ 删除
+
+
+
-
+
From 031a38f4635605257b228d3642358977bf267155 Mon Sep 17 00:00:00 2001
From: zhanghao <774378400@qq.com>
Date: Wed, 5 Nov 2025 15:48:20 +0800
Subject: [PATCH 04/10] =?UTF-8?q?feat:=20=E4=BF=AE=E5=A4=8Dbug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/test/configs/Run.vue | 2 +-
vite.config.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/views/test/configs/Run.vue b/src/views/test/configs/Run.vue
index 95d1b4b..a5a0c07 100644
--- a/src/views/test/configs/Run.vue
+++ b/src/views/test/configs/Run.vue
@@ -48,7 +48,7 @@
-
+
diff --git a/vite.config.js b/vite.config.js
index 9bddf63..20460d5 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -35,7 +35,7 @@ export default defineConfig(({mode, command}) => {
//杨 http://192.168.0.10:13080
//赵 http://10.148.108.58:13080
// dev http://10.148.20.34:13080
- // target: command === 'build' ? VITE_API_URL : 'http://10.148.20.34:13080',
+ // target: VITE_API_URL,
target: command === 'build' ? VITE_API_URL : 'http://192.168.0.10:13080',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, '')
From 74c75e111e9219678d599ccb4e08a4f8221c0d9c Mon Sep 17 00:00:00 2001
From: zhanghao <774378400@qq.com>
Date: Mon, 10 Nov 2025 17:22:23 +0800
Subject: [PATCH 05/10] =?UTF-8?q?feat:=20=E8=A7=A6=E6=8E=A7=E4=BA=A4?=
=?UTF-8?q?=E4=BA=92?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/flow/config.js | 18 ++++++++++++++++++
src/views/flow/icon/dialogue.svg | 2 +-
src/views/flow/icon/touch.svg | 1 +
3 files changed, 20 insertions(+), 1 deletion(-)
create mode 100644 src/views/flow/icon/touch.svg
diff --git a/src/views/flow/config.js b/src/views/flow/config.js
index f7fce53..2b528ad 100644
--- a/src/views/flow/config.js
+++ b/src/views/flow/config.js
@@ -16,6 +16,7 @@ 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 { v4 as randomUUID } from 'uuid'
@@ -350,4 +351,21 @@ export const collapseList = [
}
],
},
+ {
+ collapseTitle: "触控交互",
+ nodeList: [
+ {
+ icon: touchSvg,
+ name: "触控",
+ type: "serviceNode",
+ desc: "去触控坐标的点位",
+ action: 'TOUCH',
+ nodeParams: [
+ { name: "deviceId", type: "input", input: "", disabled: true },
+ { name: "touchParams", type: "input", input: "", disabled: true }
+ ],
+ outputType: 'json',
+ }
+ ],
+ },
]
diff --git a/src/views/flow/icon/dialogue.svg b/src/views/flow/icon/dialogue.svg
index e3481ff..b208067 100644
--- a/src/views/flow/icon/dialogue.svg
+++ b/src/views/flow/icon/dialogue.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/views/flow/icon/touch.svg b/src/views/flow/icon/touch.svg
new file mode 100644
index 0000000..44a14a5
--- /dev/null
+++ b/src/views/flow/icon/touch.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
From 592ebddc251aaa95f7aa24df1671c42b306aed82 Mon Sep 17 00:00:00 2001
From: zhanghao <774378400@qq.com>
Date: Thu, 13 Nov 2025 21:55:20 +0800
Subject: [PATCH 06/10] =?UTF-8?q?feat:=20=E6=9C=BA=E5=99=A8=E4=BA=BA?=
=?UTF-8?q?=E8=AF=B4=E8=AF=9D=E5=92=8C=E8=A1=A8=E6=83=85=E8=8A=82=E7=82=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/flow/config.js | 69 ++++++++++++++++++++-
src/views/flow/icon/expression.svg | 1 +
src/views/flow/nodes/common/serviceNode.vue | 14 ++++-
3 files changed, 79 insertions(+), 5 deletions(-)
create mode 100644 src/views/flow/icon/expression.svg
diff --git a/src/views/flow/config.js b/src/views/flow/config.js
index 2b528ad..46b30e1 100644
--- a/src/views/flow/config.js
+++ b/src/views/flow/config.js
@@ -17,6 +17,7 @@ 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'
import { v4 as randomUUID } from 'uuid'
@@ -74,11 +75,39 @@ export const registerCustomizeNode = (lf) => {
};
const deviceOptions = () => {
- return ['cam1', 'cam2', 'cam3', 'cam4']
+ return [{
+ value: 'cam1',
+ label: 'cam1'
+ }, {
+ value: 'cam2',
+ label: 'cam2'
+ }, {
+ value: 'cam3',
+ label: 'cam3'
+ }, {
+ value: 'cam4',
+ label: 'cam4'
+ }]
}
const audioOptions = () => {
- return ['spk1']
+ return [{
+ value: 'spk1',
+ label: 'spk1'
+ }]
+}
+
+const expressOptions = () => {
+ return [{
+ value: 1,
+ label: '高兴'
+ }, {
+ value: 2,
+ label: '惊讶'
+ }, {
+ value: 3,
+ label: '疲惫'
+ }]
}
export const collapseList = [
@@ -365,7 +394,41 @@ export const collapseList = [
{ name: "touchParams", type: "input", input: "", disabled: true }
],
outputType: 'json',
- }
+ },
+ {
+ icon: expressionSvg,
+ name: "开始说话",
+ type: "serviceNode",
+ desc: "控制机器人说话",
+ action: 'BIO_HEAD_SPEAK_START',
+ nodeParams: [
+ { name: "deviceId", type: "input", input: "", disabled: true }
+ ],
+ outputType: 'json',
+ },
+ {
+ icon: expressionSvg,
+ name: "停止说话",
+ type: "serviceNode",
+ desc: "停止机器人说话",
+ action: 'BIO_HEAD_SPEAK_STOP',
+ nodeParams: [
+ { name: "deviceId", type: "input", input: "", disabled: true }
+ ],
+ outputType: 'json',
+ },
+ {
+ icon: expressionSvg,
+ name: "表情",
+ type: "serviceNode",
+ desc: "控制机器人的面部表情",
+ action: 'BIO_HEAD_SPECIAL_EXPRESSION',
+ nodeParams: [
+ { name: "deviceId", type: "input", input: "", disabled: true },
+ { name: "expressKey", type: "input",componentType: 'select', selectOptions: expressOptions(), disabled: true },
+ ],
+ outputType: 'json',
+ },
],
},
]
diff --git a/src/views/flow/icon/expression.svg b/src/views/flow/icon/expression.svg
new file mode 100644
index 0000000..ae84256
--- /dev/null
+++ b/src/views/flow/icon/expression.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/views/flow/nodes/common/serviceNode.vue b/src/views/flow/nodes/common/serviceNode.vue
index dab8b6c..6e0956d 100644
--- a/src/views/flow/nodes/common/serviceNode.vue
+++ b/src/views/flow/nodes/common/serviceNode.vue
@@ -62,6 +62,7 @@
@@ -81,9 +82,9 @@
>
-
+
-
+
{
+ // 阻止事件冒泡到 Logic Flow 节点,避免被其事件拦截
+ e.stopPropagation();
+ // 可选:明确放行 Ctrl+V(增强兼容性)
+ if ((e.ctrlKey || e.metaKey) && e.key === 'v') {
+ e.returnValue = true; // 允许默认粘贴行为
+ }
+}
+
onMounted(() => {
emitter.on("changeNodeState", (data) => {
if (data.nodeId === props.model.id) {
From 9a7afa8f6e6f889fbacd14b68aee00626ba369f5 Mon Sep 17 00:00:00 2001
From: zhanghao <774378400@qq.com>
Date: Mon, 17 Nov 2025 14:54:32 +0800
Subject: [PATCH 07/10] =?UTF-8?q?feat:=20=E8=8A=82=E7=82=B9=E7=BC=A9?=
=?UTF-8?q?=E5=B0=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/utils/flow.js | 28 +
src/views/flow/components/NodeTitle.vue | 388 ++++----
src/views/flow/config.js | 5 +
src/views/flow/index.vue | 12 +-
src/views/flow/nodes/common/serviceNode.vue | 247 +++--
src/views/flow/nodes/common/startNode.vue | 63 +-
src/views/flow/nodes/function/loop.vue | 170 ++--
src/views/flow/nodes/function/sleep.vue | 868 ++++++++---------
src/views/flow/nodes/function/switch.vue | 998 +++++++++++---------
vite.config.js | 4 +-
10 files changed, 1564 insertions(+), 1219 deletions(-)
diff --git a/src/utils/flow.js b/src/utils/flow.js
index 94f7557..10187e6 100644
--- a/src/utils/flow.js
+++ b/src/utils/flow.js
@@ -127,6 +127,34 @@ export const formatTableData = (arr, data = {}) => {
}
export const addNewEdge = (nodeId) => {
+ const { edges } = lf.getGraphData();
+ const ttt = edges.slice(); // 浅拷贝(比 JSON 深拷贝高效 10x+)
+
+ const edgesToDelete = ttt.filter(_edge =>
+ _edge.sourceNodeId === nodeId || _edge.targetNodeId === nodeId
+ );
+
+ edgesToDelete.forEach(edge => lf.deleteEdge(edge.id));
+
+ if (window.addNewEdgeTimer) {
+ clearTimeout(window.addNewEdgeTimer); // 清理上一次未执行的定时器
+ }
+
+ window.addNewEdgeTimer = setTimeout(() => {
+ edgesToDelete.forEach(item => {
+ lf.addEdge({
+ type: "bezier",
+ sourceNodeId: item.sourceNodeId,
+ targetNodeId: item.targetNodeId,
+ sourceAnchorId: item.sourceAnchorId,
+ targetAnchorId: item.targetAnchorId
+ });
+ })
+ delete window.addNewEdgeTimer;
+ }, 50)
+}
+
+export const newEdge = (nodeId) => {
const { edges } = lf.getGraphData();
const arr = JSON.parse(JSON.stringify(edges))
arr.forEach(_edge => {
diff --git a/src/views/flow/components/NodeTitle.vue b/src/views/flow/components/NodeTitle.vue
index b7f61b4..1a66002 100644
--- a/src/views/flow/components/NodeTitle.vue
+++ b/src/views/flow/components/NodeTitle.vue
@@ -1,171 +1,217 @@
-
-
-
-
-
![]()
-
-
- {{ nodeName }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{{ props.nodeDesc }}
-
-
-
-
\ No newline at end of file
+
+
+
+
+
![]()
+
+
+ {{ nodeName }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ props.nodeDesc }}
+
+
+
+
diff --git a/src/views/flow/config.js b/src/views/flow/config.js
index 46b30e1..9584e80 100644
--- a/src/views/flow/config.js
+++ b/src/views/flow/config.js
@@ -42,6 +42,11 @@ export const lfConfig = {
// foldSize: 30, // 折叠后显示的图标尺寸
// },
edgeType: "bezier",
+ zoomConfig: {
+ min: 0.05, // 最小缩放比例(支持更小值,如 0.01,但不建议过小)
+ max: 3, // 最大缩放比例(可自定义)
+ step: 0.1 // 每次滚轮缩放的步长(默认 0.1)
+ },
style: {
anchor: {
show: true, // 强制全局锚点显示
diff --git a/src/views/flow/index.vue b/src/views/flow/index.vue
index c0541a3..df850c9 100644
--- a/src/views/flow/index.vue
+++ b/src/views/flow/index.vue
@@ -54,7 +54,7 @@
-
+
@@ -79,7 +79,7 @@ import Aside from "./components/Aside.vue";
import { ElMessage } from 'element-plus'
import { useFlowStore } from '@/store/modules/flow'
import { emitter } from '@/utils/eventBus';
-import { recursiveFilter, addNewEdge, convertToTree } from '@/utils/flow'
+import { recursiveFilter, newEdge, convertToTree } from '@/utils/flow'
import { flowDeploy, flowView, flowPause, flowResume, flowStop } from '@/api/device/flow'
import { getDetect } from '@/api/test/detect'
import { Location } from "@element-plus/icons-vue";
@@ -502,7 +502,6 @@ const initFlow = () => {
const node = lf.getNodeModelById(item.id)
node.updateSize()
})
-
operationEdge(arr)
});
@@ -588,7 +587,7 @@ onMounted(() => {
const operationEdge = (arr) => {
arr.forEach(item => {
- addNewEdge(item.id)
+ newEdge(item.id)
})
}
@@ -601,6 +600,7 @@ onUnmounted(() => {
.page {
width: 100%;
height: 100%;
+ overflow: hidden;
.page__container {
width: 100%;
@@ -622,6 +622,10 @@ onUnmounted(() => {
}
}
+ .container {
+ height: calc(100% - 60px);
+ }
+
.el-main {
padding: 0;
}
diff --git a/src/views/flow/nodes/common/serviceNode.vue b/src/views/flow/nodes/common/serviceNode.vue
index 6e0956d..b92ac7c 100644
--- a/src/views/flow/nodes/common/serviceNode.vue
+++ b/src/views/flow/nodes/common/serviceNode.vue
@@ -1,22 +1,33 @@
-