From f8619047c5799effb25616a08bc68a6dcbbd2445 Mon Sep 17 00:00:00 2001 From: fhysy <1149505133@qq.com> Date: Fri, 15 Aug 2025 15:46:41 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E4=BA=A7=E5=93=81=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E7=9A=84=E5=B1=9E=E6=80=A7=E3=80=81=E5=8A=9F=E8=83=BD=E5=92=8C?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将属性、功能和事件定义抽离为单独的组件 - 优化了数据类型、表单类型等选项的管理 - 改进了输出参数的编辑功能 - 统一了保存和取消操作的样式 - 调整了部分UI样式,如描述字段的样式 --- apps/web-antd/src/constants/dicts/device.ts | 90 ++++ .../product/detail/components/BasicInfo.vue | 2 +- .../product/detail/components/EventDrawer.vue | 412 ++++++++++++++ .../detail/components/FunctionDrawer.vue | 504 ++++++++++++++++++ .../detail/components/MetadataTable.vue | 472 ++-------------- .../detail/components/ParameterModal.vue | 387 ++++++++++++++ .../detail/components/PropertyDrawer.vue | 468 ++++++++++++++++ 7 files changed, 1906 insertions(+), 429 deletions(-) create mode 100644 apps/web-antd/src/views/device/product/detail/components/EventDrawer.vue create mode 100644 apps/web-antd/src/views/device/product/detail/components/FunctionDrawer.vue create mode 100644 apps/web-antd/src/views/device/product/detail/components/ParameterModal.vue create mode 100644 apps/web-antd/src/views/device/product/detail/components/PropertyDrawer.vue diff --git a/apps/web-antd/src/constants/dicts/device.ts b/apps/web-antd/src/constants/dicts/device.ts index 07cf9dd..6618a91 100644 --- a/apps/web-antd/src/constants/dicts/device.ts +++ b/apps/web-antd/src/constants/dicts/device.ts @@ -21,3 +21,93 @@ export const deviceTypeOptions = [ tooltip: '能挂载子设备与平台进行通信的设备', }, ]; + +// 数据类型选项 +export const dataTypeOptions = [ + { + value: 'int', + label: 'int(整数型)', + }, + { + value: 'long', + label: 'long(长整数型)', + }, + { + value: 'float', + label: 'float(单精度浮点型)', + }, + { + value: 'double', + label: 'double(双精度浮点数)', + }, + { + value: 'string', + label: 'text(字符串)', + }, + { + value: 'boolean', + label: 'boolean(布尔型)', + }, + { + value: 'date', + label: 'date(时间型)', + }, + { + value: 'enum', + label: 'enum(枚举)', + }, + // { + // value: 'array', + // label: 'array(数组)', + // }, + // { + // value: 'object', + // label: 'object(结构体)', + // }, + // { + // value: 'file', + // label: 'file(文件)', + // }, + // { + // value: 'password', + // label: 'password(密码)', + // }, + // { + // value: 'geoPoint', + // label: 'geoPoint(地理位置)', + // } +]; + +// 表单类型选项 +export const formTypeOptions = [ + { label: '文本', value: 'input' }, + { label: '开关', value: 'switch' }, + { label: '数字', value: 'number' }, + { label: '进度条', value: 'progress' }, + { label: '选择器', value: 'select' }, + { label: '时间选择器', value: 'time' }, + // { label: '文本域', value: 'textarea' }, +]; + +export const viewTypeOptions = [ + { label: '文本', value: 'input' }, + { label: '开关', value: 'switch' }, + { label: '选择器', value: 'select' }, + { label: '进度条', value: 'progress' }, + { label: '图片', value: 'img' }, + { label: '折线图', value: 'line' }, + { label: '仪表盘', value: 'dashboard' }, +]; + +// 读写类型选项 +export const readWriteTypeOptions = [ + { label: '读', value: 'R' }, + { label: '写', value: 'W' }, + { label: '读写', value: 'RW' }, +]; + +export const timeOptions = [ + { label: 'yyyy-MM-dd HH:mm:ss', value: 'yyyy-MM-dd HH:mm:ss' }, + { label: 'yyyy-MM-dd', value: 'yyyy-MM-dd' }, + { label: 'HH:mm:ss', value: 'HH:mm:ss' }, +]; diff --git a/apps/web-antd/src/views/device/product/detail/components/BasicInfo.vue b/apps/web-antd/src/views/device/product/detail/components/BasicInfo.vue index c0d34c4..a931625 100644 --- a/apps/web-antd/src/views/device/product/detail/components/BasicInfo.vue +++ b/apps/web-antd/src/views/device/product/detail/components/BasicInfo.vue @@ -129,7 +129,7 @@ const productParams = computed(() => {{ formatTime(productInfo.updateTime) }} - + {{ productInfo.description || '暂无描述' }} diff --git a/apps/web-antd/src/views/device/product/detail/components/EventDrawer.vue b/apps/web-antd/src/views/device/product/detail/components/EventDrawer.vue new file mode 100644 index 0000000..36d65a2 --- /dev/null +++ b/apps/web-antd/src/views/device/product/detail/components/EventDrawer.vue @@ -0,0 +1,412 @@ + + +