From a41b19ffbb6e1b1ebbae62e9c0991135a3b6e4a3 Mon Sep 17 00:00:00 2001 From: betaqi <3188864257@qq.com> Date: Wed, 26 Nov 2025 15:30:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9F=BA=E7=A1=80=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commun_channel_moebustcp.json | 24 ++ .../commun_dev_modbustcp.json | 34 +++ public/commun_config_modbustcp/index.json | 22 ++ .../point_table_modbus_01.json | 61 +++++ .../point_table_modbus_02.json | 61 +++++ .../point_table_modbus_03.json | 61 +++++ .../commun_config_modbustcp/工程说明.md | 53 ++++ src/api/module/channel/index.d.ts | 18 ++ src/api/module/channel/index.ts | 17 ++ src/api/module/device/category.ts | 17 ++ src/api/module/device/index.d.ts | 11 + src/api/module/device/index.ts | 18 ++ src/assets/images/exception/no-permission.svg | 1 + src/assets/images/exception/not-found.svg | 1 + src/components/Edfs-exception.vue | 82 +++++++ src/views/Error/404.vue | 21 ++ .../components/create-engineering-dlg.vue | 115 +++++++++ .../config/components/StepChannel.vue | 223 +++++++++++++++++ .../config/components/StepDevice.vue | 187 ++++++++++++++ .../config/components/StepDeviceCategory.vue | 230 ++++++++++++++++++ src/views/engineering/config/index.vue | 194 +++++++++++++++ 21 files changed, 1451 insertions(+) create mode 100644 public/commun_config_modbustcp/commun_channel_moebustcp.json create mode 100644 public/commun_config_modbustcp/commun_dev_modbustcp.json create mode 100644 public/commun_config_modbustcp/index.json create mode 100644 public/commun_config_modbustcp/point_table_modbus_01.json create mode 100644 public/commun_config_modbustcp/point_table_modbus_02.json create mode 100644 public/commun_config_modbustcp/point_table_modbus_03.json create mode 100644 public/commun_config_modbustcp/工程说明.md create mode 100644 src/api/module/channel/index.d.ts create mode 100644 src/api/module/channel/index.ts create mode 100644 src/api/module/device/category.ts create mode 100644 src/api/module/device/index.d.ts create mode 100644 src/api/module/device/index.ts create mode 100644 src/assets/images/exception/no-permission.svg create mode 100644 src/assets/images/exception/not-found.svg create mode 100644 src/components/Edfs-exception.vue create mode 100644 src/views/Error/404.vue create mode 100644 src/views/engineering/components/create-engineering-dlg.vue create mode 100644 src/views/engineering/config/components/StepChannel.vue create mode 100644 src/views/engineering/config/components/StepDevice.vue create mode 100644 src/views/engineering/config/components/StepDeviceCategory.vue create mode 100644 src/views/engineering/config/index.vue diff --git a/public/commun_config_modbustcp/commun_channel_moebustcp.json b/public/commun_config_modbustcp/commun_channel_moebustcp.json new file mode 100644 index 0000000..43ea954 --- /dev/null +++ b/public/commun_config_modbustcp/commun_channel_moebustcp.json @@ -0,0 +1,24 @@ +{ + "channel": [ + { + "name": "名称,唯一标识不可重复,不能为中文或特殊符号,长度32字节", + "ip": "设备IP地址,字符串", + "port": "端口号,整形数字,0~65535,一般为502" + }, + { + "name": "modbustcp_ch1", + "ip": "192.168.10.123", + "port": 502 + }, + { + "name": "xxxx", + "ip": "192.168.10.133", + "port": 1502 + }, + { + "name": "xxxxxx", + "ip": "192.168.10.143", + "port": 2502 + } + ] +} \ No newline at end of file diff --git a/public/commun_config_modbustcp/commun_dev_modbustcp.json b/public/commun_config_modbustcp/commun_dev_modbustcp.json new file mode 100644 index 0000000..644adb7 --- /dev/null +++ b/public/commun_config_modbustcp/commun_dev_modbustcp.json @@ -0,0 +1,34 @@ +{ + "dev": [ + { + "name": "名称,唯一标识不可重复,不能为中文或特殊符号,长度32字节", + "ch": "所在通道名称,特指ModbusRtu通道的名称,字符串", + "point": "使用点表名称,特指Modbus点表的名称,字符串", + "addr": "站地址,字符串,0 ~ 255" + }, + { + "name": "xxxx1", + "ch": "modbustcp_ch1", + "point": "pcs", + "addr": "1" + }, + { + "name": "xxxx2", + "ch": "modbustcp_ch1", + "point": "pcs", + "addr": "2" + }, + { + "name": "xxxx3", + "ch": "xxxx", + "point": "bms", + "addr": "1" + }, + { + "name": "xxxx4", + "ch": "xxxxxx", + "point": "tms", + "addr": "1" + } + ] +} \ No newline at end of file diff --git a/public/commun_config_modbustcp/index.json b/public/commun_config_modbustcp/index.json new file mode 100644 index 0000000..d16e67d --- /dev/null +++ b/public/commun_config_modbustcp/index.json @@ -0,0 +1,22 @@ +{ + "name": "工程名xxxx", + "commun_channel": { + "通讯通道类型,固定如下": "通讯通道配置文件路径", + "modbustcp": "commun_channel_moebustcp.json" + }, + "commun_dev": { + "通讯设备类型,固定如下": "通讯设备配置文件路径", + "modbustcp": "commun_dev_moebustcp.json" + }, + "point_table": { + "通讯点表类型,固定如下": { + "名称": "路径" + }, + "modbus": { + "modbus点表名称,自定义,非中文、非特殊字符,32字节": "modbus点表文件路径", + "pcs2": "point_table_modbus_01.json", + "bms": "point_table_modbus_02.json", + "tms": "point_table_modbus_03.json" + } + } +} \ No newline at end of file diff --git a/public/commun_config_modbustcp/point_table_modbus_01.json b/public/commun_config_modbustcp/point_table_modbus_01.json new file mode 100644 index 0000000..550aa8c --- /dev/null +++ b/public/commun_config_modbustcp/point_table_modbus_01.json @@ -0,0 +1,61 @@ +{ + "name": "p12312cs", + "point": [ + [ + "点起始地址,进制字符串, 范围 0x0000~0xFFFF 或 0~65535", + "点数量,字符串, 范围 0x0001~0x10000 或 1~65536", + "功能码,字符串,可选项: '0x01' '0x02' '0x03' '0x04' 或 '1' '2' '3' '4'", + "数据类型,字符串,可选 'U16' 'S16' 'U32' 'S32'", + "点读取周期ms,整形数字,-1时标志该点位未启用", + "点位段名称,字符串,可设为空字符串" + ], + [ + "0x0001", + "0x0010", + "0x03", + "U16", + 1000, + "点位段名称1" + ], + [ + "0x0100", + "0x0020", + "0x03", + "U16", + 1000, + "点位段名称2" + ], + [ + "0x0120", + "0x0020", + "0x03", + "U32", + 1000, + "" + ], + [ + "0x0000", + "0x0020", + "0x04", + "U16", + 1000, + "点位段名称" + ], + [ + "0x0020", + "0x0010", + "0x04", + "U32", + 1000, + "-" + ], + [ + "0x0040", + "0x0020", + "0x04", + "U16", + 1000, + "点位段名称" + ] + ] +} \ No newline at end of file diff --git a/public/commun_config_modbustcp/point_table_modbus_02.json b/public/commun_config_modbustcp/point_table_modbus_02.json new file mode 100644 index 0000000..f694b7b --- /dev/null +++ b/public/commun_config_modbustcp/point_table_modbus_02.json @@ -0,0 +1,61 @@ +{ + "name": "xxxx", + "point": [ + [ + "点起始地址,进制字符串, 范围 0x0000~0xFFFF 或 0~65535", + "点数量,字符串, 范围 0x0001~0x10000 或 1~65536", + "功能码,字符串,可选项: '0x01' '0x02' '0x03' '0x04' 或 '1' '2' '3' '4'", + "数据类型,字符串,可选 'U16' 'S16' 'U32' 'S32'", + "点读取周期ms,整形数字,-1时标志该点位未启用", + "点位段名称,字符串,可设为空字符串" + ], + [ + "0x0001", + "0x0010", + "0x03", + "U16", + 1000, + "点位段名称1" + ], + [ + "0x0100", + "0x0020", + "0x03", + "U16", + 1000, + "点位段名称2" + ], + [ + "0x0120", + "0x0020", + "0x03", + "U32", + 1000, + "" + ], + [ + "0x0000", + "0x0020", + "0x04", + "U16", + 1000, + "点位段名称" + ], + [ + "0x0020", + "0x0010", + "0x04", + "U32", + 1000, + "-" + ], + [ + "0x0040", + "0x0020", + "0x04", + "U16", + 1000, + "点位段名称" + ] + ] +} \ No newline at end of file diff --git a/public/commun_config_modbustcp/point_table_modbus_03.json b/public/commun_config_modbustcp/point_table_modbus_03.json new file mode 100644 index 0000000..f694b7b --- /dev/null +++ b/public/commun_config_modbustcp/point_table_modbus_03.json @@ -0,0 +1,61 @@ +{ + "name": "xxxx", + "point": [ + [ + "点起始地址,进制字符串, 范围 0x0000~0xFFFF 或 0~65535", + "点数量,字符串, 范围 0x0001~0x10000 或 1~65536", + "功能码,字符串,可选项: '0x01' '0x02' '0x03' '0x04' 或 '1' '2' '3' '4'", + "数据类型,字符串,可选 'U16' 'S16' 'U32' 'S32'", + "点读取周期ms,整形数字,-1时标志该点位未启用", + "点位段名称,字符串,可设为空字符串" + ], + [ + "0x0001", + "0x0010", + "0x03", + "U16", + 1000, + "点位段名称1" + ], + [ + "0x0100", + "0x0020", + "0x03", + "U16", + 1000, + "点位段名称2" + ], + [ + "0x0120", + "0x0020", + "0x03", + "U32", + 1000, + "" + ], + [ + "0x0000", + "0x0020", + "0x04", + "U16", + 1000, + "点位段名称" + ], + [ + "0x0020", + "0x0010", + "0x04", + "U32", + 1000, + "-" + ], + [ + "0x0040", + "0x0020", + "0x04", + "U16", + 1000, + "点位段名称" + ] + ] +} \ No newline at end of file diff --git a/public/commun_config_modbustcp/工程说明.md b/public/commun_config_modbustcp/工程说明.md new file mode 100644 index 0000000..9e253dd --- /dev/null +++ b/public/commun_config_modbustcp/工程说明.md @@ -0,0 +1,53 @@ + + +## 创建工程 + +填写工程名,用户自定义输入 + + + +## 通讯点表 + +1. 展示目前工程中已有的通讯点表 + +2. 导入新的通讯点表 + + ``` + 自定义名称:设置点表自定义名字,用户自定义输入,需检查唯一性,禁止中文、特殊字符 + 通讯点表类型:通过下拉菜单选择,目前只支持ModbusTcp(预留支持其他类型,不同类型的点表需要分类保存) + ``` + + + +## 通讯通道 + +1. 展示目前工程中已有的通讯通道 + +2. 创建新的通讯通道 + + ``` + 自定义名称:设置通讯通道自定义名字,用户自定义输入,需检查唯一性,禁止中文、特殊字符 + 通讯通道类型:通过下拉菜单选择,目前只支持ModbusTcp(预留支持其他类型,不同类型的通讯通道分类保存) + 设备IP地址:用户自定义输入,须符合IP地址的格式,如192.168.10.123 + 设备端口:用户自定义输入,范围0~65535,一般为502 + ``` + + + +## 通讯设备 + +1. 展示目前工程中已有的通讯设备 + +2. 创建新的通讯设备 + + ``` + 自定义名称:设置通讯设备自定义名字,用户自定义输入,需检查唯一性,禁止中文、特殊字符 + 通讯设备类型:通过下拉菜单选择,目前只支持ModbusTcp(预留支持其他类型,不同类型的通讯设备分类保存) + 通讯通道选择:通过下拉菜单选择,选项为已选择的类型(目前只有ModbusTcp)的所有通讯通道(是否支持在此处新建通道) + 通讯点表选择:通过下拉菜单选择,选项为已选择的类型(目前只有ModbusTcp)的所有通讯点表(是否支持在此处新建点表) + 通讯地址:用户自定义输入通讯站地址,范围0~255,一般为1 + ``` + + + + \ No newline at end of file diff --git a/src/api/module/channel/index.d.ts b/src/api/module/channel/index.d.ts new file mode 100644 index 0000000..8c7340c --- /dev/null +++ b/src/api/module/channel/index.d.ts @@ -0,0 +1,18 @@ +export type Channel = 'modbusTcp' | 'mqtt' + +export type IChannel = + | (IModbusTcpChannelOV & { channel: 'modbusTcp' }) + | (IMqttChannelOV & { channel: 'mqtt' }) + +interface IChannelBaseOV { + name: string +} + +export interface IModbusTcpChannelOV extends IChannelBaseOV { + ip: string + port: number +} + +export interface IMqttChannelOV extends IChannelBaseOV { + broker: string +} diff --git a/src/api/module/channel/index.ts b/src/api/module/channel/index.ts new file mode 100644 index 0000000..1c8ce87 --- /dev/null +++ b/src/api/module/channel/index.ts @@ -0,0 +1,17 @@ +import { globalServer } from '../index' +import type { IChannel } from './index.d' + +export const getChannelList = () => { + return globalServer({ + url: '/channel/list', + method: 'get', + }) +} + +export const saveChannel = (params: IChannel[]) => { + return globalServer({ + url: '/channel/save', + method: 'post', + data: params, + }) +} diff --git a/src/api/module/device/category.ts b/src/api/module/device/category.ts new file mode 100644 index 0000000..1c2b1d8 --- /dev/null +++ b/src/api/module/device/category.ts @@ -0,0 +1,17 @@ +import { globalServer } from '../index' +import type { IDeviceCategory } from './index.d' + +export const getDeviceTypeList = () => { + return globalServer({ + url: '/device/type/list', + method: 'get', + }) +} + +export const createDeviceType = (params: IDeviceCategory) => { + return globalServer({ + url: '/device/type/create', + method: 'post', + data: params, + }) +} \ No newline at end of file diff --git a/src/api/module/device/index.d.ts b/src/api/module/device/index.d.ts new file mode 100644 index 0000000..35e22d1 --- /dev/null +++ b/src/api/module/device/index.d.ts @@ -0,0 +1,11 @@ +export interface IDevice { + name: string + ch: string + point: string + addr: number +} + +export interface IDeviceCategory { + name: string, + fileName?: string, +} \ No newline at end of file diff --git a/src/api/module/device/index.ts b/src/api/module/device/index.ts new file mode 100644 index 0000000..3602835 --- /dev/null +++ b/src/api/module/device/index.ts @@ -0,0 +1,18 @@ +import { globalServer } from '../index' +import type { IDevice } from './index.d' + +export const getDeviceList = () => { + return globalServer({ + url: '/device/list', + method: 'get', + }) +} + +export const saveDevice = (params: IDevice[]) => { + return globalServer({ + url: '/device/update', + method: 'put', + data: params, + }) +} + diff --git a/src/assets/images/exception/no-permission.svg b/src/assets/images/exception/no-permission.svg new file mode 100644 index 0000000..4c408ca --- /dev/null +++ b/src/assets/images/exception/no-permission.svg @@ -0,0 +1 @@ + diff --git a/src/assets/images/exception/not-found.svg b/src/assets/images/exception/not-found.svg new file mode 100644 index 0000000..a513656 --- /dev/null +++ b/src/assets/images/exception/not-found.svg @@ -0,0 +1 @@ + diff --git a/src/components/Edfs-exception.vue b/src/components/Edfs-exception.vue new file mode 100644 index 0000000..e3a8208 --- /dev/null +++ b/src/components/Edfs-exception.vue @@ -0,0 +1,82 @@ + + + + diff --git a/src/views/Error/404.vue b/src/views/Error/404.vue new file mode 100644 index 0000000..0e8e922 --- /dev/null +++ b/src/views/Error/404.vue @@ -0,0 +1,21 @@ + + + + + diff --git a/src/views/engineering/components/create-engineering-dlg.vue b/src/views/engineering/components/create-engineering-dlg.vue new file mode 100644 index 0000000..71e546e --- /dev/null +++ b/src/views/engineering/components/create-engineering-dlg.vue @@ -0,0 +1,115 @@ + + + + + diff --git a/src/views/engineering/config/components/StepChannel.vue b/src/views/engineering/config/components/StepChannel.vue new file mode 100644 index 0000000..e5612c7 --- /dev/null +++ b/src/views/engineering/config/components/StepChannel.vue @@ -0,0 +1,223 @@ + + + + + diff --git a/src/views/engineering/config/components/StepDevice.vue b/src/views/engineering/config/components/StepDevice.vue new file mode 100644 index 0000000..ff429f3 --- /dev/null +++ b/src/views/engineering/config/components/StepDevice.vue @@ -0,0 +1,187 @@ + + + + + diff --git a/src/views/engineering/config/components/StepDeviceCategory.vue b/src/views/engineering/config/components/StepDeviceCategory.vue new file mode 100644 index 0000000..0c62d54 --- /dev/null +++ b/src/views/engineering/config/components/StepDeviceCategory.vue @@ -0,0 +1,230 @@ + + + + + diff --git a/src/views/engineering/config/index.vue b/src/views/engineering/config/index.vue new file mode 100644 index 0000000..cce83a0 --- /dev/null +++ b/src/views/engineering/config/index.vue @@ -0,0 +1,194 @@ + + + + +