-
+
查看
@@ -39,16 +39,12 @@
-
diff --git a/src/components/DiyEditor/components/mobile/PromotionPoint/property.vue b/src/components/DiyEditor/components/mobile/PromotionPoint/property.vue
new file mode 100644
index 00000000..84a429b6
--- /dev/null
+++ b/src/components/DiyEditor/components/mobile/PromotionPoint/property.vue
@@ -0,0 +1,154 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 建议尺寸:36 * 22
+
+
+
+
+
+
+ 文字
+ 图片
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 建议尺寸:56 * 56
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/mall/promotion/point/activity/index.vue b/src/views/mall/promotion/point/activity/index.vue
index fa826940..ceceb7b5 100644
--- a/src/views/mall/promotion/point/activity/index.vue
+++ b/src/views/mall/promotion/point/activity/index.vue
@@ -10,15 +10,6 @@
class="-mb-15px"
label-width="68px"
>
-
-
-
+
+
+
+
+
+
+
diff --git a/src/views/mall/promotion/point/components/PointTableSelect.vue b/src/views/mall/promotion/point/components/PointTableSelect.vue
new file mode 100644
index 00000000..d68b5f15
--- /dev/null
+++ b/src/views/mall/promotion/point/components/PointTableSelect.vue
@@ -0,0 +1,300 @@
+
+
+
+
+
From d9f433671754c3498a7bb99f841cc7ff336a200e Mon Sep 17 00:00:00 2001
From: puhui999
Date: Sat, 28 Sep 2024 14:02:13 +0800
Subject: [PATCH 55/66] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E5=AE=8C?=
=?UTF-8?q?=E5=96=84=E3=80=91=E5=95=86=E5=9F=8E:=20=E5=AE=8C=E5=96=84?=
=?UTF-8?q?=E7=A7=AF=E5=88=86=E5=95=86=E5=9F=8E=E8=A3=85=E4=BF=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../DiyEditor/components/mobile/PromotionPoint/index.vue | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/components/DiyEditor/components/mobile/PromotionPoint/index.vue b/src/components/DiyEditor/components/mobile/PromotionPoint/index.vue
index 614980df..4acd93fc 100644
--- a/src/components/DiyEditor/components/mobile/PromotionPoint/index.vue
+++ b/src/components/DiyEditor/components/mobile/PromotionPoint/index.vue
@@ -67,9 +67,8 @@
:style="{ color: property.fields.price.color }"
class="text-16px"
>
- {{ spu.point }}积分{{
- !spu.pointPrice || spu.pointPrice === 0 ? '' : `+${fenToYuan(spu.pointPrice)}元`
- }}
+ {{ spu.point }}积分
+ {{ !spu.pointPrice || spu.pointPrice === 0 ? '' : `+${fenToYuan(spu.pointPrice)}元` }}
Date: Sun, 29 Sep 2024 17:09:37 +0800
Subject: [PATCH 56/66] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91datas?=
=?UTF-8?q?et=20=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/knowledge/dataset.vue | 152 ++++++++++++++++++++++++++++++++
1 file changed, 152 insertions(+)
create mode 100644 src/views/knowledge/dataset.vue
diff --git a/src/views/knowledge/dataset.vue b/src/views/knowledge/dataset.vue
new file mode 100644
index 00000000..4636a912
--- /dev/null
+++ b/src/views/knowledge/dataset.vue
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
+
+
+
+
+ 1 文档
+ 5 千字符
+ 0 关联应用
+
+
+ useful for when you want to answer queries about the 接口鉴权示例代码.md
+
+
+
+
+
+
+
+
+
+
+
From 3f6e3c4168b7e8d288ab6b782cd829c2b6392d36 Mon Sep 17 00:00:00 2001
From: cherishsince
Date: Sun, 29 Sep 2024 17:09:51 +0800
Subject: [PATCH 57/66] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91datas?=
=?UTF-8?q?et=20=E5=88=9B=E5=BB=BA=E9=80=89=E6=8B=A9=E6=95=B0=E6=8D=AE?=
=?UTF-8?q?=E6=BA=90=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../knowledge/dataset-form/form-step1.vue | 151 ++++++++++++++++++
1 file changed, 151 insertions(+)
create mode 100644 src/views/knowledge/dataset-form/form-step1.vue
diff --git a/src/views/knowledge/dataset-form/form-step1.vue b/src/views/knowledge/dataset-form/form-step1.vue
new file mode 100644
index 00000000..ef3579eb
--- /dev/null
+++ b/src/views/knowledge/dataset-form/form-step1.vue
@@ -0,0 +1,151 @@
+
+
+
+
+
+
+
导入已有文本
+
+
+
+
+
上传文本文件
+
+
+ 拖拽文件至此,或者 选择文件
+
+ 已支持 TXT、MARKDOWN、PDF、HTML、XLSX、XLS、DOCX、CSV、EML、MSG、PPTX、PPT、XML、EPUB,每个文件不超过 15MB。
+
+
+
+
+
+
+ 下一步
+
+
+
+
+
+ 创建一个空知识库
+
+
+
+
+
+
+
From 4a2eddbd3b0b0501ae86be2a9140a69a60cc6423 Mon Sep 17 00:00:00 2001
From: cherishsince
Date: Sun, 29 Sep 2024 18:04:06 +0800
Subject: [PATCH 58/66] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91datas?=
=?UTF-8?q?et=20=E5=88=9B=E5=BB=BA=E6=95=B0=E6=8D=AE=E6=B8=85=E6=B4=97?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=20(30%)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../knowledge/dataset-form/form-step2.vue | 168 ++++++++++++++++++
1 file changed, 168 insertions(+)
create mode 100644 src/views/knowledge/dataset-form/form-step2.vue
diff --git a/src/views/knowledge/dataset-form/form-step2.vue b/src/views/knowledge/dataset-form/form-step2.vue
new file mode 100644
index 00000000..f8ca5718
--- /dev/null
+++ b/src/views/knowledge/dataset-form/form-step2.vue
@@ -0,0 +1,168 @@
+
+
+
+
+
+
+
+
+
+ 自动分段与清洗
+ 自定义
+
+
+
+
+
+
+ 高质量
+ 经济
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 分段预览
+
+
+
+
+
+
{{ segment.number }}
+
+
+
+
+
+
{{ segment.text }}
+
+
+
+
+
+
+
+
+
+
From 81a710c02df7ba92c64b7c0b73d4b933efe9af2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=89=E6=B5=A9=E6=B5=A9?= <1036606149@qq.com>
Date: Sun, 29 Sep 2024 21:58:03 +0800
Subject: [PATCH 59/66] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD=E3=80=91=20IOT=20=E4=BA=A7=E5=93=81=E7=AE=A1=E7=90=86?=
=?UTF-8?q?=EF=BC=8C=E7=89=A9=E6=A8=A1=E5=9E=8B=E6=96=B0=E5=A2=9E?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/iot/thinkmodelfunction/index.ts | 55 +++++
src/utils/dict.ts | 6 +-
.../iot/product/detail/ThinkModelFunction.vue | 149 ++++++++++++++
.../product/detail/ThinkModelFunctionForm.vue | 194 ++++++++++++++++++
src/views/iot/product/detail/index.vue | 20 +-
5 files changed, 414 insertions(+), 10 deletions(-)
create mode 100644 src/api/iot/thinkmodelfunction/index.ts
create mode 100644 src/views/iot/product/detail/ThinkModelFunction.vue
create mode 100644 src/views/iot/product/detail/ThinkModelFunctionForm.vue
diff --git a/src/api/iot/thinkmodelfunction/index.ts b/src/api/iot/thinkmodelfunction/index.ts
new file mode 100644
index 00000000..29f06a78
--- /dev/null
+++ b/src/api/iot/thinkmodelfunction/index.ts
@@ -0,0 +1,55 @@
+import request from '@/config/axios'
+
+// IoT 产品物模型 VO
+export interface ThinkModelFunctionVO {
+ id: number // 物模型功能编号
+ identifier: string // 功能标识
+ name: string // 功能名称
+ description: string // 功能描述
+ productId: number // 产品ID(关联 IotProductDO 的 id)
+ productKey: string // 产品Key(关联 IotProductDO 的 productKey)
+ type: number // 功能类型(1 - 属性,2 - 服务,3 - 事件)
+ property: string // 属性(存储 ThingModelProperty 的 JSON 数据)
+ event: string // 事件(存储 ThingModelEvent 的 JSON 数据)
+ service: string // 服务(存储服务的 JSON 数据)
+}
+
+// IoT 产品物模型 API
+export const ThinkModelFunctionApi = {
+ // 查询IoT 产品物模型分页
+ getThinkModelFunctionPage: async (params: any) => {
+ return await request.get({ url: `/iot/think-model-function/page`, params })
+ },
+ // 获得IoT 产品物模型
+ getThinkModelFunctionListByProductId: async (params: any) => {
+ return await request.get({
+ url: `/iot/think-model-function/list-by-product-id`,
+ params
+ })
+ },
+
+ // 查询IoT 产品物模型详情
+ getThinkModelFunction: async (id: number) => {
+ return await request.get({ url: `/iot/think-model-function/get?id=` + id })
+ },
+
+ // 新增IoT 产品物模型
+ createThinkModelFunction: async (data: ThinkModelFunctionVO) => {
+ return await request.post({ url: `/iot/think-model-function/create`, data })
+ },
+
+ // 修改IoT 产品物模型
+ updateThinkModelFunction: async (data: ThinkModelFunctionVO) => {
+ return await request.put({ url: `/iot/think-model-function/update`, data })
+ },
+
+ // 删除IoT 产品物模型
+ deleteThinkModelFunction: async (id: number) => {
+ return await request.delete({ url: `/iot/think-model-function/delete?id=` + id })
+ },
+
+ // 导出IoT 产品物模型 Excel
+ exportThinkModelFunction: async (params) => {
+ return await request.download({ url: `/iot/think-model-function/export-excel`, params })
+ }
+}
diff --git a/src/utils/dict.ts b/src/utils/dict.ts
index 82f9218f..e8deb60a 100644
--- a/src/utils/dict.ts
+++ b/src/utils/dict.ts
@@ -235,5 +235,9 @@ export enum DICT_TYPE {
IOT_PRODUCT_DEVICE_TYPE = 'iot_product_device_type', // IOT 产品设备类型
IOT_DATA_FORMAT = 'iot_data_format', // IOT 数据格式
IOT_PROTOCOL_TYPE = 'iot_protocol_type', // IOT 接入网关协议
- IOT_DEVICE_STATUS = 'iot_device_status' // IOT 设备状态
+ IOT_DEVICE_STATUS = 'iot_device_status', // IOT 设备状态
+ IOT_PRODUCT_FUNCTION_TYPE = 'iot_product_function_type', // IOT 产品功能类型
+ IOT_DATA_TYPE = 'iot_data_type', // IOT 数据类型
+ IOT_UNIT_TYPE = 'iot_unit_type', // IOT 单位类型
+ IOT_RW_TYPE = 'iot_rw_type' // IOT 读写类型
}
diff --git a/src/views/iot/product/detail/ThinkModelFunction.vue b/src/views/iot/product/detail/ThinkModelFunction.vue
new file mode 100644
index 00000000..95089c62
--- /dev/null
+++ b/src/views/iot/product/detail/ThinkModelFunction.vue
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+ 添加功能
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 编辑
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/iot/product/detail/ThinkModelFunctionForm.vue b/src/views/iot/product/detail/ThinkModelFunctionForm.vue
new file mode 100644
index 00000000..976ca717
--- /dev/null
+++ b/src/views/iot/product/detail/ThinkModelFunctionForm.vue
@@ -0,0 +1,194 @@
+
+
+
+
+
diff --git a/src/views/iot/product/detail/index.vue b/src/views/iot/product/detail/index.vue
index 6ff97bb8..f57fc4d6 100644
--- a/src/views/iot/product/detail/index.vue
+++ b/src/views/iot/product/detail/index.vue
@@ -1,18 +1,18 @@
getProductData(id)" />
-
-
-
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
@@ -22,6 +22,7 @@ import { DeviceApi } from '@/api/iot/device'
import ProductDetailsHeader from '@/views/iot/product/detail/ProductDetailsHeader.vue'
import ProductDetailsInfo from '@/views/iot/product/detail/ProductDetailsInfo.vue'
import ProductTopic from '@/views/iot/product/detail/ProductTopic.vue'
+import ThinkModelFunction from '@/views/iot/product/detail/ThinkModelFunction.vue'
defineOptions({ name: 'IoTProductDetail' })
@@ -30,6 +31,7 @@ const message = useMessage()
const id = Number(route.params.id) // 编号
const loading = ref(true) // 加载中
const product = ref({} as ProductVO) // 详情
+const activeTab = ref('info') // 默认激活的标签页
/** 获取详情 */
const getProductData = async (id: number) => {
From 4b2800f723a3c39dbc8efe496ab78920120d5a98 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=89=E6=B5=A9=E6=B5=A9?= <1036606149@qq.com>
Date: Mon, 30 Sep 2024 12:19:55 +0800
Subject: [PATCH 60/66] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD=E3=80=91=20IOT=20=E7=89=A9=E6=A8=A1=E5=9E=8B=E6=96=B0?=
=?UTF-8?q?=E5=A2=9E=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../iot/product/detail/ThinkModelFunction.vue | 6 +-
.../product/detail/ThinkModelFunctionForm.vue | 106 ++++++++++++------
2 files changed, 75 insertions(+), 37 deletions(-)
diff --git a/src/views/iot/product/detail/ThinkModelFunction.vue b/src/views/iot/product/detail/ThinkModelFunction.vue
index 95089c62..cc2119c5 100644
--- a/src/views/iot/product/detail/ThinkModelFunction.vue
+++ b/src/views/iot/product/detail/ThinkModelFunction.vue
@@ -40,7 +40,11 @@
-
+
+
+
+
+
diff --git a/src/views/iot/product/detail/ThinkModelFunctionForm.vue b/src/views/iot/product/detail/ThinkModelFunctionForm.vue
index 976ca717..0ea2a756 100644
--- a/src/views/iot/product/detail/ThinkModelFunctionForm.vue
+++ b/src/views/iot/product/detail/ThinkModelFunctionForm.vue
@@ -8,35 +8,40 @@
v-loading="formLoading"
>
-
-
-
+
+ 属性
+ 服务
+ 事件
+
-
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
~
@@ -46,14 +51,7 @@
-
-
-
+
@@ -61,8 +59,12 @@
只读
-
-
+
+
@@ -96,11 +98,11 @@ const formData = ref({
identifier: undefined,
name: undefined,
description: undefined,
- type: undefined,
+ type: '1',
property: {
identifier: undefined,
name: undefined,
- accessMode: undefined,
+ accessMode: 'rw',
required: true,
dataType: {
type: undefined,
@@ -110,13 +112,44 @@ const formData = ref({
step: undefined,
unit: undefined
}
- }
+ },
+ description: undefined // 添加这一行
}
})
const formRules = reactive({
- name: [{ required: true, message: '功能名称不能为空', trigger: 'blur' }],
+ name: [
+ { required: true, message: '功能名称不能为空', trigger: 'blur' },
+ {
+ pattern: /^[\u4e00-\u9fa5a-zA-Z0-9][\u4e00-\u9fa5a-zA-Z0-9\-_/\.]{0,29}$/,
+ message:
+ '支持中文、大小写字母、日文、数字、短划线、下划线、斜杠和小数点,必须以中文、英文或数字开头,不超过 30 个字符',
+ trigger: 'blur'
+ }
+ ],
type: [{ required: true, message: '功能类型不能为空', trigger: 'blur' }],
- identifier: [{ required: true, message: '标识符不能为空', trigger: 'blur' }],
+ identifier: [
+ { required: true, message: '标识符不能为空', trigger: 'blur' },
+ {
+ pattern: /^[a-zA-Z0-9_]{1,50}$/,
+ message: '支持大小写字母、数字和下划线,不超过 50 个字符',
+ trigger: 'blur'
+ },
+ {
+ validator: (rule, value, callback) => {
+ const reservedKeywords = ['set', 'get', 'post', 'property', 'event', 'time', 'value']
+ if (reservedKeywords.includes(value)) {
+ callback(
+ new Error(
+ 'set, get, post, property, event, time, value 是系统保留字段,不能用于标识符定义'
+ )
+ )
+ } else {
+ callback()
+ }
+ },
+ trigger: 'blur'
+ }
+ ],
property: {
dataType: {
type: [{ required: true, message: '数据类型不能为空', trigger: 'blur' }]
@@ -172,11 +205,11 @@ const resetForm = () => {
identifier: undefined,
name: undefined,
description: undefined,
- type: undefined,
+ type: '1',
property: {
identifier: undefined,
name: undefined,
- accessMode: undefined,
+ accessMode: 'rw',
required: true,
dataType: {
type: undefined,
@@ -186,7 +219,8 @@ const resetForm = () => {
step: undefined,
unit: undefined
}
- }
+ },
+ description: undefined // 确保重置 description 字段
}
}
formRef.value?.resetFields()
From 79c3ba090f94977e2e5b0ba7f89650744af92e56 Mon Sep 17 00:00:00 2001
From: YunaiV
Date: Mon, 30 Sep 2024 19:45:41 +0800
Subject: [PATCH 61/66] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9=E3=80=91=E5=B7=A5=E4=BD=9C=E6=B5=81=EF=BC=9A=E6=B5=81?=
=?UTF-8?q?=E7=A8=8B=E5=AE=9E=E4=BE=8B=E5=88=97=E8=A1=A8=EF=BC=8C=E4=BD=BF?=
=?UTF-8?q?=E7=94=A8=20processDefinitionKey=20=E6=A3=80=E7=B4=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/bpm/processInstance/index.vue | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/views/bpm/processInstance/index.vue b/src/views/bpm/processInstance/index.vue
index f1d6ca73..4b72e395 100644
--- a/src/views/bpm/processInstance/index.vue
+++ b/src/views/bpm/processInstance/index.vue
@@ -19,10 +19,10 @@
class="!w-240px"
/>
-
+
Date: Tue, 1 Oct 2024 10:45:56 +0800
Subject: [PATCH 62/66] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9=E3=80=91=E5=95=86=E5=9F=8E=EF=BC=9A=E9=99=90=E6=97=B6?=
=?UTF-8?q?=E6=8A=98=E6=89=A3=EF=BC=8C=E5=A4=9A=E4=B9=98=E4=BB=A5=E4=BA=86?=
=?UTF-8?q?=20100=20=E4=BC=98=E6=83=A0=E9=87=91=E9=A2=9D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../discountActivity/DiscountActivityForm.vue | 2 +-
.../discountActivity/discountActivity.data.ts | 11 -----------
2 files changed, 1 insertion(+), 12 deletions(-)
diff --git a/src/views/mall/promotion/discountActivity/DiscountActivityForm.vue b/src/views/mall/promotion/discountActivity/DiscountActivityForm.vue
index 3004488d..6c2469f6 100644
--- a/src/views/mall/promotion/discountActivity/DiscountActivityForm.vue
+++ b/src/views/mall/promotion/discountActivity/DiscountActivityForm.vue
@@ -190,7 +190,7 @@ const submitForm = async () => {
const products = cloneDeep(spuAndSkuListRef.value.getSkuConfigs('productConfig'))
products.forEach((item: DiscountActivityApi.DiscountProductVO) => {
item.discountPercent = convertToInteger(item.discountPercent)
- item.discountPrice = convertToInteger(yuanToFen(item.discountPrice))
+ item.discountPrice = convertToInteger(item.discountPrice)
})
const data = cloneDeep(formRef.value.formModel) as DiscountActivityApi.DiscountActivityVO
data.products = products
diff --git a/src/views/mall/promotion/discountActivity/discountActivity.data.ts b/src/views/mall/promotion/discountActivity/discountActivity.data.ts
index 217b7ab3..81540b0f 100644
--- a/src/views/mall/promotion/discountActivity/discountActivity.data.ts
+++ b/src/views/mall/promotion/discountActivity/discountActivity.data.ts
@@ -70,17 +70,6 @@ const crudSchemas = reactive([
width: 120
}
},
- {
- label: '优惠类型',
- field: 'discountType',
- dictType: DICT_TYPE.PROMOTION_DISCOUNT_TYPE,
- dictClass: 'number',
- isSearch: true,
- form: {
- component: 'Radio',
- value: 1
- }
- },
{
label: '活动商品',
field: 'spuId',
From 6d641177b824c7c44fed9f6d005105e2d186ce4e Mon Sep 17 00:00:00 2001
From: YunaiV
Date: Tue, 1 Oct 2024 19:29:24 +0800
Subject: [PATCH 63/66] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E8=AF=84?=
=?UTF-8?q?=E5=AE=A1=E3=80=91IoT=EF=BC=9A=E4=BA=A7=E5=93=81=E3=80=81?=
=?UTF-8?q?=E8=AE=BE=E5=A4=87=E3=80=81=E7=89=A9=E6=A8=A1=E5=9E=8B=E7=9A=84?=
=?UTF-8?q?=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/iot/device/index.ts | 28 ++++----
src/api/iot/product/index.ts | 35 ++++-----
src/api/iot/thinkmodelfunction/index.ts | 26 +++----
src/views/iot/device/DeviceForm.vue | 7 +-
.../iot/device/detail/DeviceDetailsHeader.vue | 1 +
.../iot/device/detail/DeviceDetailsInfo.vue | 71 ++++++++-----------
src/views/iot/device/index.vue | 7 +-
src/views/iot/product/ProductForm.vue | 28 ++------
.../product/detail/ProductDetailsHeader.vue | 17 +++--
.../iot/product/detail/ProductDetailsInfo.vue | 6 +-
src/views/iot/product/detail/ProductTopic.vue | 1 +
.../iot/product/detail/ThinkModelFunction.vue | 3 +-
.../product/detail/ThinkModelFunctionForm.vue | 7 +-
src/views/iot/product/detail/index.vue | 7 +-
src/views/iot/product/index.vue | 19 +----
15 files changed, 114 insertions(+), 149 deletions(-)
diff --git a/src/api/iot/device/index.ts b/src/api/iot/device/index.ts
index 24d48789..903874b7 100644
--- a/src/api/iot/device/index.ts
+++ b/src/api/iot/device/index.ts
@@ -1,16 +1,16 @@
import request from '@/config/axios'
-// 设备 VO
+// IoT 设备 VO
export interface DeviceVO {
id: number // 设备 ID,主键,自增
- deviceKey: string // 设备唯一标识符,全局唯一,用于识别设备
- deviceName: string // 设备名称,在产品内唯一,用于标识设备
- productId: number // 产品 ID,关联 iot_product 表的 id
- productKey: string // 产品 Key,关联 iot_product 表的 product_key
- deviceType: number // 设备类型:0 - 直连设备,1 - 网关子设备,2 - 网关设备
- nickname: string // 设备备注名称,供用户自定义备注
- gatewayId: number // 网关设备 ID,子设备需要关联的网关设备 ID
- status: number // 设备状态:0 - 未激活,1 - 在线,2 - 离线,3 - 已禁用
+ deviceKey: string // 设备唯一标识符
+ deviceName: string // 设备名称
+ productId: number // 产品编号
+ productKey: string // 产品标识
+ deviceType: number // 设备类型
+ nickname: string // 设备备注名称
+ gatewayId: number // 网关设备 ID
+ status: number // 设备状态
statusLastUpdateTime: Date // 设备状态最后更新时间
lastOnlineTime: Date // 最后上线时间
lastOfflineTime: Date // 最后离线时间
@@ -22,17 +22,17 @@ export interface DeviceVO {
mqttClientId: string // MQTT 客户端 ID
mqttUsername: string // MQTT 用户名
mqttPassword: string // MQTT 密码
- authType: string // 认证类型(如一机一密、动态注册)
- latitude: number // 设备位置的纬度,范围 -90.000000 ~ 90.000000
- longitude: number // 设备位置的经度,范围 -180.000000 ~ 180.000000
- areaId: number // 地区编码,符合国家地区编码标准,关联地区表
+ authType: string // 认证类型
+ latitude: number // 设备位置的纬度
+ longitude: number // 设备位置的经度
+ areaId: number // 地区编码
address: string // 设备详细地址
serialNumber: string // 设备序列号
}
export interface DeviceUpdateStatusVO {
id: number // 设备 ID,主键,自增
- status: number // 设备状态:0 - 未激活,1 - 在线,2 - 离线,3 - 已禁用
+ status: number // 设备状态
}
// 设备 API
diff --git a/src/api/iot/product/index.ts b/src/api/iot/product/index.ts
index 2a8d430f..1ffa490d 100644
--- a/src/api/iot/product/index.ts
+++ b/src/api/iot/product/index.ts
@@ -1,50 +1,51 @@
import request from '@/config/axios'
-// iot 产品 VO
+// IoT 产品 VO
export interface ProductVO {
+ id: number // 产品编号
name: string // 产品名称
- id: number // 产品ID
productKey: string // 产品标识
- protocolId: number // 协议编号(脚本解析 id)
+ protocolId: number // 协议编号
categoryId: number // 产品所属品类标识符
description: string // 产品描述
- validateType: number // 数据校验级别, 0: 强校验, 1: 弱校验, 2: 免校验
- status: number // 产品状态, 0: DEVELOPMENT_STATUS, 1: RELEASE_STATUS
- deviceType: number // 设备类型, 0: 直连设备, 1: 网关子设备, 2: 网关设备
- netType: number // 联网方式, 0: Wi-Fi, 1: Cellular, 2: Ethernet, 3: 其他
- protocolType: number // 接入网关协议, 0: modbus, 1: opc-ua, 2: customize, 3: ble, 4: zigbee
- dataFormat: number // 数据格式, 0: 透传模式, 1: Alink JSON
+ validateType: number // 数据校验级别
+ status: number // 产品状态
+ deviceType: number // 设备类型
+ netType: number // 联网方式
+ protocolType: number // 接入网关协议
+ dataFormat: number // 数据格式
deviceCount: number // 设备数量
+ createTime: Date // 创建时间
}
-// iot 产品 API
+// IoT 产品 API
export const ProductApi = {
- // 查询iot 产品分页
+ // 查询产品分页
getProductPage: async (params: any) => {
return await request.get({ url: `/iot/product/page`, params })
},
- // 查询iot 产品详情
+ // 查询产品详情
getProduct: async (id: number) => {
return await request.get({ url: `/iot/product/get?id=` + id })
},
- // 新增iot 产品
+ // 新增产品
createProduct: async (data: ProductVO) => {
return await request.post({ url: `/iot/product/create`, data })
},
- // 修改iot 产品
+ // 修改产品
updateProduct: async (data: ProductVO) => {
return await request.put({ url: `/iot/product/update`, data })
},
- // 删除iot 产品
+ // 删除产品
deleteProduct: async (id: number) => {
return await request.delete({ url: `/iot/product/delete?id=` + id })
},
- // 导出iot 产品 Excel
+ // 导出产品 Excel
exportProduct: async (params) => {
return await request.download({ url: `/iot/product/export-excel`, params })
},
@@ -54,7 +55,7 @@ export const ProductApi = {
return await request.put({ url: `/iot/product/update-status?id=` + id + `&status=` + status })
},
- // 查询产品(精简)列表
+ // 查询产品(精简)列表
getSimpleProductList() {
return request.get({ url: '/iot/product/list-all-simple' })
}
diff --git a/src/api/iot/thinkmodelfunction/index.ts b/src/api/iot/thinkmodelfunction/index.ts
index 29f06a78..bd2e2d0f 100644
--- a/src/api/iot/thinkmodelfunction/index.ts
+++ b/src/api/iot/thinkmodelfunction/index.ts
@@ -6,21 +6,21 @@ export interface ThinkModelFunctionVO {
identifier: string // 功能标识
name: string // 功能名称
description: string // 功能描述
- productId: number // 产品ID(关联 IotProductDO 的 id)
- productKey: string // 产品Key(关联 IotProductDO 的 productKey)
- type: number // 功能类型(1 - 属性,2 - 服务,3 - 事件)
- property: string // 属性(存储 ThingModelProperty 的 JSON 数据)
- event: string // 事件(存储 ThingModelEvent 的 JSON 数据)
- service: string // 服务(存储服务的 JSON 数据)
+ productId: number // 产品编号
+ productKey: string // 产品标识
+ type: number // 功能类型
+ property: string // 属性
+ event: string // 事件
+ service: string // 服务
}
// IoT 产品物模型 API
export const ThinkModelFunctionApi = {
- // 查询IoT 产品物模型分页
+ // 查询产品物模型分页
getThinkModelFunctionPage: async (params: any) => {
return await request.get({ url: `/iot/think-model-function/page`, params })
},
- // 获得IoT 产品物模型
+ // 获得产品物模型
getThinkModelFunctionListByProductId: async (params: any) => {
return await request.get({
url: `/iot/think-model-function/list-by-product-id`,
@@ -28,27 +28,27 @@ export const ThinkModelFunctionApi = {
})
},
- // 查询IoT 产品物模型详情
+ // 查询产品物模型详情
getThinkModelFunction: async (id: number) => {
return await request.get({ url: `/iot/think-model-function/get?id=` + id })
},
- // 新增IoT 产品物模型
+ // 新增产品物模型
createThinkModelFunction: async (data: ThinkModelFunctionVO) => {
return await request.post({ url: `/iot/think-model-function/create`, data })
},
- // 修改IoT 产品物模型
+ // 修改产品物模型
updateThinkModelFunction: async (data: ThinkModelFunctionVO) => {
return await request.put({ url: `/iot/think-model-function/update`, data })
},
- // 删除IoT 产品物模型
+ // 删除产品物模型
deleteThinkModelFunction: async (id: number) => {
return await request.delete({ url: `/iot/think-model-function/delete?id=` + id })
},
- // 导出IoT 产品物模型 Excel
+ // 导出产品物模型 Excel
exportThinkModelFunction: async (params) => {
return await request.download({ url: `/iot/think-model-function/export-excel`, params })
}
diff --git a/src/views/iot/device/DeviceForm.vue b/src/views/iot/device/DeviceForm.vue
index f926b6d4..cb026012 100644
--- a/src/views/iot/device/DeviceForm.vue
+++ b/src/views/iot/device/DeviceForm.vue
@@ -57,8 +57,7 @@ const formData = ref({
id: undefined,
productId: undefined,
deviceName: undefined,
- nickname: undefined,
- serialNumber: undefined
+ nickname: undefined
})
const formRules = reactive({
productId: [{ required: true, message: '产品不能为空', trigger: 'blur' }],
@@ -66,7 +65,7 @@ const formRules = reactive({
{
pattern: /^[a-zA-Z0-9_.\-:@]{4,32}$/,
message:
- '支持英文字母、数字、下划线(_)、中划线(-)、点号(.)、半角冒号(:)和特殊字符@,长度限制为4~32个字符',
+ '支持英文字母、数字、下划线(_)、中划线(-)、点号(.)、半角冒号(:)和特殊字符@,长度限制为 4~32 个字符',
trigger: 'blur'
}
],
@@ -79,7 +78,7 @@ const formRules = reactive({
}
const length = value.replace(/[\u4e00-\u9fa5\u3040-\u30ff]/g, 'aa').length
if (length < 4 || length > 64) {
- callback(new Error('备注名称长度限制为4~64个字符,中文及日文算2个字符'))
+ callback(new Error('备注名称长度限制为 4~64 个字符,中文及日文算 2 个字符'))
} else if (!/^[\u4e00-\u9fa5\u3040-\u30ff_a-zA-Z0-9]+$/.test(value)) {
callback(new Error('备注名称只能包含中文、英文字母、日文、数字和下划线(_)'))
} else {
diff --git a/src/views/iot/device/detail/DeviceDetailsHeader.vue b/src/views/iot/device/detail/DeviceDetailsHeader.vue
index 4360cab1..62960529 100644
--- a/src/views/iot/device/detail/DeviceDetailsHeader.vue
+++ b/src/views/iot/device/detail/DeviceDetailsHeader.vue
@@ -59,6 +59,7 @@ const emit = defineEmits(['refresh'])
* @param text 需要复制的文本
*/
const copyToClipboard = (text: string) => {
+ // TODO @haohao:可以考虑用 await 异步转同步哈
navigator.clipboard.writeText(text).then(() => {
message.success('复制成功')
})
diff --git a/src/views/iot/device/detail/DeviceDetailsInfo.vue b/src/views/iot/device/detail/DeviceDetailsInfo.vue
index 77084625..59b9d254 100644
--- a/src/views/iot/device/detail/DeviceDetailsInfo.vue
+++ b/src/views/iot/device/detail/DeviceDetailsInfo.vue
@@ -3,33 +3,33 @@
{{ product.name }}
- {{ product.productKey }}
+
+ {{ product.productKey }}
复制
- {{ device.deviceName }}
+
+ {{ device.deviceName }}
复制
{{ device.nickname }}
- {{
- formatDate(device.createTime)
- }}
- {{
- formatDate(device.activeTime)
- }}
- {{
- formatDate(device.lastOnlineTime)
- }}
+
+ {{ formatDate(device.createTime) }}
+
+
+ {{ formatDate(device.activeTime) }}
+
+
+ {{ formatDate(device.lastOnlineTime) }}
+
- {{
- formatDate(device.lastOfflineTime)
- }}
+
+ {{ formatDate(device.lastOfflineTime) }}
+
查看
@@ -53,7 +53,6 @@
-
@@ -63,7 +62,6 @@
-
@@ -87,39 +85,28 @@ import { ProductVO } from '@/api/iot/product'
import { formatDate } from '@/utils/formatTime'
import { DeviceVO } from '@/api/iot/device'
-// 消息提示
-const message = useMessage()
+const message = useMessage() // 消息提示
-// 路由实例
-const router = useRouter()
+const { product, device } = defineProps<{ product: ProductVO; device: DeviceVO }>() // 定义 Props
-// 定义 Props
-const { product, device } = defineProps<{ product: ProductVO; device: DeviceVO }>()
+const emit = defineEmits(['refresh']) // 定义 Emits
-// 定义 Emits
-const emit = defineEmits(['refresh'])
+const activeNames = ref(['basicInfo']) // 展示的折叠面板
+const mqttDialogVisible = ref(false) // 定义 MQTT 弹框的可见性
+const mqttParams = ref({
+ mqttClientId: '',
+ mqttUsername: '',
+ mqttPassword: ''
+}) // 定义 MQTT 参数对象
-// 展示的折叠面板
-const activeNames = ref(['basicInfo'])
-
-// 复制到剪贴板方法
+/** 复制到剪贴板方法 */
const copyToClipboard = (text: string) => {
navigator.clipboard.writeText(text).then(() => {
message.success('复制成功')
})
}
-// 定义 MQTT 弹框的可见性
-const mqttDialogVisible = ref(false)
-
-// 定义 MQTT 参数对象
-const mqttParams = ref({
- mqttClientId: '',
- mqttUsername: '',
- mqttPassword: ''
-})
-
-// 打开 MQTT 参数弹框的方法
+/** 打开 MQTT 参数弹框的方法 */
const openMqttParams = () => {
mqttParams.value = {
mqttClientId: device.mqttClientId || 'N/A',
@@ -129,7 +116,7 @@ const openMqttParams = () => {
mqttDialogVisible.value = true
}
-// 关闭 MQTT 弹框的方法
+/** 关闭 MQTT 弹框的方法 */
const handleCloseMqttDialog = () => {
mqttDialogVisible.value = false
}
diff --git a/src/views/iot/device/index.vue b/src/views/iot/device/index.vue
index 566c78a6..784b1482 100644
--- a/src/views/iot/device/index.vue
+++ b/src/views/iot/device/index.vue
@@ -192,9 +192,8 @@ const queryParams = reactive({
status: undefined
})
const queryFormRef = ref() // 搜索的表单
-const exportLoading = ref(false) // 导出的加载中
-/** 产品ID到名称的映射 */
+/** 产品标号和名称的映射 */
const productMap = reactive({})
/** 查询列表 */
@@ -207,6 +206,7 @@ const getList = async () => {
// 获取产品ID列表
const productIds = [...new Set(data.list.map((device) => device.productId))]
// 获取产品名称
+ // TODO @haohao:最好后端拼接哈
const products = await Promise.all(productIds.map((id) => ProductApi.getProduct(id)))
products.forEach((product) => {
productMap[product.id] = product.name
@@ -235,7 +235,7 @@ const openForm = (type: string, id?: number) => {
}
/** 打开详情 */
-const { currentRoute, push } = useRouter()
+const { push } = useRouter()
const openDetail = (id: number) => {
push({ name: 'IoTDeviceDetail', params: { id } })
}
@@ -252,6 +252,7 @@ const handleDelete = async (id: number) => {
await getList()
} catch {}
}
+
/** 查询字典下拉列表 */
const products = ref()
const getProducts = async () => {
diff --git a/src/views/iot/product/ProductForm.vue b/src/views/iot/product/ProductForm.vue
index 7d254a03..75d6efcc 100644
--- a/src/views/iot/product/ProductForm.vue
+++ b/src/views/iot/product/ProductForm.vue
@@ -128,15 +128,10 @@ const formData = ref({
})
const formRules = reactive({
name: [{ required: true, message: '产品名称不能为空', trigger: 'blur' }],
- deviceType: [
- {
- required: true,
- message: '设备类型不能为空',
- trigger: 'change'
- }
- ],
+ deviceType: [{ required: true, message: '设备类型不能为空', trigger: 'change' }],
netType: [
{
+ // TODO @haohao:0、1、/2 最好前端也枚举下;另外,这里的 required 可以直接设置为 true。然后表单那些 v-if。只要不存在,它自动就不校验了哈
required: formData.deviceType === 0 || formData.deviceType === 2,
message: '联网方式不能为空',
trigger: 'change'
@@ -145,23 +140,12 @@ const formRules = reactive({
protocolType: [
{ required: formData.deviceType === 1, message: '接入网关协议不能为空', trigger: 'change' }
],
- dataFormat: [
- {
- required: true,
- message: '数据格式不能为空',
- trigger: 'change'
- }
- ],
- validateType: [
- {
- required: true,
- message: '数据校验级别不能为空',
- trigger: 'change'
- }
- ]
+ dataFormat: [{ required: true, message: '数据格式不能为空', trigger: 'change' }],
+ validateType: [{ required: true, message: '数据校验级别不能为空', trigger: 'change' }]
})
const formRef = ref()
+/** 打开弹窗 */
const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
@@ -178,6 +162,7 @@ const open = async (type: string, id?: number) => {
}
defineExpose({ open, close: () => (dialogVisible.value = false) })
+/** 提交表单 */
const emit = defineEmits(['success'])
const submitForm = async () => {
await formRef.value.validate()
@@ -198,6 +183,7 @@ const submitForm = async () => {
}
}
+/** 重置表单 */
const resetForm = () => {
formData.value = {
name: undefined,
diff --git a/src/views/iot/product/detail/ProductDetailsHeader.vue b/src/views/iot/product/detail/ProductDetailsHeader.vue
index db0849ed..ba009516 100644
--- a/src/views/iot/product/detail/ProductDetailsHeader.vue
+++ b/src/views/iot/product/detail/ProductDetailsHeader.vue
@@ -58,19 +58,24 @@ import ProductForm from '@/views/iot/product/ProductForm.vue'
import { ProductApi, ProductVO } from '@/api/iot/product'
const message = useMessage()
+
+const { product } = defineProps<{ product: ProductVO }>() // 定义 Props
+
+/** 处理复制 */
const copyToClipboard = (text: string) => {
navigator.clipboard.writeText(text).then(() => {
message.success('复制成功')
})
}
-// 路由跳转到设备管理
-const { currentRoute, push } = useRouter()
+/** 路由跳转到设备管理 */
+const { push } = useRouter()
const goToManagement = (productId: string) => {
push({ name: 'IoTDevice', query: { productId } })
}
-// 操作修改
+/** 操作修改 */
+const emit = defineEmits(['refresh']) // 定义 Emits
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
@@ -95,10 +100,4 @@ const confirmUnpublish = async (id: number) => {
message.error('撤销发布失败')
}
}
-
-// 定义 Props
-const { product } = defineProps<{ product: ProductVO }>()
-
-// 定义 Emits
-const emit = defineEmits(['refresh'])
diff --git a/src/views/iot/product/detail/ProductDetailsInfo.vue b/src/views/iot/product/detail/ProductDetailsInfo.vue
index e3b5483a..5153045e 100644
--- a/src/views/iot/product/detail/ProductDetailsInfo.vue
+++ b/src/views/iot/product/detail/ProductDetailsInfo.vue
@@ -6,9 +6,9 @@
- {{
- formatDate(product.createTime)
- }}
+
+ {{ formatDate(product.createTime) }}
+
diff --git a/src/views/iot/product/detail/ProductTopic.vue b/src/views/iot/product/detail/ProductTopic.vue
index 79ca2808..c327bb65 100644
--- a/src/views/iot/product/detail/ProductTopic.vue
+++ b/src/views/iot/product/detail/ProductTopic.vue
@@ -44,6 +44,7 @@ const columns2 = reactive([
{ label: '描述', field: 'description' }
])
+// TODO @haohao:这个,有没可能写到一个枚举里,方便后续维护? /Users/yunai/Java/yudao-ui-admin-vue3/src/views/ai/utils/constants.ts
const data1 = computed(() => {
if (!props.product || !props.product.productKey) return []
return [
diff --git a/src/views/iot/product/detail/ThinkModelFunction.vue b/src/views/iot/product/detail/ThinkModelFunction.vue
index cc2119c5..5a75d109 100644
--- a/src/views/iot/product/detail/ThinkModelFunction.vue
+++ b/src/views/iot/product/detail/ThinkModelFunction.vue
@@ -88,6 +88,7 @@ import ThinkModelFunctionForm from '@/views/iot/product/detail/ThinkModelFunctio
const props = defineProps<{ product: ProductVO }>()
+const { t } = useI18n() // 国际化
const message = useMessage() // 消息弹窗
const loading = ref(true) // 列表的加载中
@@ -97,7 +98,7 @@ const queryParams = reactive({
pageNo: 1,
pageSize: 10,
type: undefined,
- productId: undefined
+ productId: -1
})
const queryFormRef = ref() // 搜索的表单
diff --git a/src/views/iot/product/detail/ThinkModelFunctionForm.vue b/src/views/iot/product/detail/ThinkModelFunctionForm.vue
index 0ea2a756..895692e0 100644
--- a/src/views/iot/product/detail/ThinkModelFunctionForm.vue
+++ b/src/views/iot/product/detail/ThinkModelFunctionForm.vue
@@ -46,7 +46,6 @@
~
-
@@ -77,7 +76,6 @@