-
其它条件不满足进入此分支(该分支不可编辑和删除)
+
+
+
其它条件不满足进入此分支(该分支不可编辑和删除)
-
-
-
+
+
+
-
- {{ dict.label }}
-
-
-
-
+ {{ dict.label }}
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -150,25 +163,31 @@
From b69a784e8631f8b230823b8022ec53d732c50d96 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=89=E6=B5=A9=E6=B5=A9?= <1036606149@qq.com>
Date: Sat, 21 Sep 2024 09:15:27 +0800
Subject: [PATCH 58/93] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91=20IO?=
=?UTF-8?q?T=20=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/iot/device/index.ts | 63 ++++++
src/api/iot/product/index.ts | 5 +
src/router/modules/remaining.ts | 2 +-
src/utils/dict.ts | 3 +-
src/views/iot/device/DeviceForm.vue | 121 +++++++++++
src/views/iot/device/index.vue | 276 +++++++++++++++++++++++++
src/views/iot/product/ProductForm.vue | 2 +-
src/views/iot/product/detail/index.vue | 2 +-
src/views/iot/product/index.vue | 10 +-
9 files changed, 477 insertions(+), 7 deletions(-)
create mode 100644 src/api/iot/device/index.ts
create mode 100644 src/views/iot/device/DeviceForm.vue
create mode 100644 src/views/iot/device/index.vue
diff --git a/src/api/iot/device/index.ts b/src/api/iot/device/index.ts
new file mode 100644
index 00000000..4ee6d8d9
--- /dev/null
+++ b/src/api/iot/device/index.ts
@@ -0,0 +1,63 @@
+import request from '@/config/axios'
+
+// 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 - 已禁用
+ statusLastUpdateTime: Date // 设备状态最后更新时间
+ lastOnlineTime: Date // 最后上线时间
+ lastOfflineTime: Date // 最后离线时间
+ activeTime: Date // 设备激活时间
+ ip: string // 设备的 IP 地址
+ firmwareVersion: string // 设备的固件版本
+ deviceSecret: string // 设备密钥,用于设备认证,需安全存储
+ 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 // 地区编码,符合国家地区编码标准,关联地区表
+ address: string // 设备详细地址
+ serialNumber: string // 设备序列号
+}
+
+// IoT 设备 API
+export const DeviceApi = {
+ // 查询IoT 设备分页
+ getDevicePage: async (params: any) => {
+ return await request.get({ url: `/iot/device/page`, params })
+ },
+
+ // 查询IoT 设备详情
+ getDevice: async (id: number) => {
+ return await request.get({ url: `/iot/device/get?id=` + id })
+ },
+
+ // 新增IoT 设备
+ createDevice: async (data: DeviceVO) => {
+ return await request.post({ url: `/iot/device/create`, data })
+ },
+
+ // 修改IoT 设备
+ updateDevice: async (data: DeviceVO) => {
+ return await request.put({ url: `/iot/device/update`, data })
+ },
+
+ // 删除IoT 设备
+ deleteDevice: async (id: number) => {
+ return await request.delete({ url: `/iot/device/delete?id=` + id })
+ },
+
+ // 导出IoT 设备 Excel
+ exportDevice: async (params) => {
+ return await request.download({ url: `/iot/device/export-excel`, params })
+ }
+}
\ No newline at end of file
diff --git a/src/api/iot/product/index.ts b/src/api/iot/product/index.ts
index 1bc45b9e..d4de1e5b 100644
--- a/src/api/iot/product/index.ts
+++ b/src/api/iot/product/index.ts
@@ -51,5 +51,10 @@ export const ProductApi = {
// 更新产品状态
updateProductStatus: async (id: number, status: number) => {
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/router/modules/remaining.ts b/src/router/modules/remaining.ts
index 0a156539..4595d563 100644
--- a/src/router/modules/remaining.ts
+++ b/src/router/modules/remaining.ts
@@ -614,7 +614,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
children: [
{
path: 'product/detail/:id',
- name: 'IotProductDetail',
+ name: 'IoTProductDetail',
meta: {
title: '产品详情',
noCache: true,
diff --git a/src/utils/dict.ts b/src/utils/dict.ts
index 4a8c017c..82f9218f 100644
--- a/src/utils/dict.ts
+++ b/src/utils/dict.ts
@@ -234,5 +234,6 @@ export enum DICT_TYPE {
IOT_PRODUCT_STATUS = 'iot_product_status', // IOT 产品状态
IOT_PRODUCT_DEVICE_TYPE = 'iot_product_device_type', // IOT 产品设备类型
IOT_DATA_FORMAT = 'iot_data_format', // IOT 数据格式
- IOT_PROTOCOL_TYPE = 'iot_protocol_type' // IOT 接入网关协议
+ IOT_PROTOCOL_TYPE = 'iot_protocol_type', // IOT 接入网关协议
+ IOT_DEVICE_STATUS = 'iot_device_status' // IOT 设备状态
}
diff --git a/src/views/iot/device/DeviceForm.vue b/src/views/iot/device/DeviceForm.vue
new file mode 100644
index 00000000..a77045c9
--- /dev/null
+++ b/src/views/iot/device/DeviceForm.vue
@@ -0,0 +1,121 @@
+
+
+
+
diff --git a/src/views/iot/device/index.vue b/src/views/iot/device/index.vue
new file mode 100644
index 00000000..e50819bd
--- /dev/null
+++ b/src/views/iot/device/index.vue
@@ -0,0 +1,276 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+ 新增
+
+
+ 导出
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 编辑
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/iot/product/ProductForm.vue b/src/views/iot/product/ProductForm.vue
index 21cee6c3..7d254a03 100644
--- a/src/views/iot/product/ProductForm.vue
+++ b/src/views/iot/product/ProductForm.vue
@@ -103,7 +103,7 @@
import { ProductApi, ProductVO } from '@/api/iot/product'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
-defineOptions({ name: 'ProductForm' })
+defineOptions({ name: 'IoTProductForm' })
const { t } = useI18n()
const message = useMessage()
diff --git a/src/views/iot/product/detail/index.vue b/src/views/iot/product/detail/index.vue
index 8652e240..c77fe176 100644
--- a/src/views/iot/product/detail/index.vue
+++ b/src/views/iot/product/detail/index.vue
@@ -20,7 +20,7 @@ import { ProductApi, ProductVO } from '@/api/iot/product'
import ProductDetailsHeader from '@/views/iot/product/detail/ProductDetailsHeader.vue'
import ProductDetailsInfo from '@/views/iot/product/detail/ProductDetailsInfo.vue'
-defineOptions({ name: 'IotProductDetail' })
+defineOptions({ name: 'IoTProductDetail' })
const route = useRoute()
const message = useMessage()
diff --git a/src/views/iot/product/index.vue b/src/views/iot/product/index.vue
index a1f5ae4a..d3196ac4 100644
--- a/src/views/iot/product/index.vue
+++ b/src/views/iot/product/index.vue
@@ -44,7 +44,11 @@
-
+
+
+ {{ scope.row.name }}
+
+
@@ -106,7 +110,7 @@ import ProductForm from './ProductForm.vue'
import { DICT_TYPE } from '@/utils/dict'
/** iot 产品 列表 */
-defineOptions({ name: 'Product' })
+defineOptions({ name: 'IoTProduct' })
const message = useMessage() // 消息弹窗
const { t } = useI18n() // 国际化
@@ -166,7 +170,7 @@ const openForm = (type: string, id?: number) => {
/** 打开详情 */
const { currentRoute, push } = useRouter()
const openDetail = (id: number) => {
- push({ name: 'IotProductDetail', params: { id } })
+ push({ name: 'IoTProductDetail', params: { id } })
}
/** 删除按钮操作 */
From 4680a7dcfd135643fd13f5c3099250b27cbb1a60 Mon Sep 17 00:00:00 2001
From: jason <2667446@qq.com>
Date: Sat, 21 Sep 2024 11:01:56 +0800
Subject: [PATCH 59/93] =?UTF-8?q?=E4=BB=BF=E9=92=89=E9=92=89=E6=B5=81?=
=?UTF-8?q?=E7=A8=8B=E8=AE=BE=E8=AE=A1=E5=99=A8,=20=E6=9D=A1=E4=BB=B6?=
=?UTF-8?q?=E8=8A=82=E7=82=B9=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/NodeHandler.vue | 13 ++---
.../SimpleProcessDesignerV2/src/consts.ts | 16 ++++--
.../src/nodes-config/ConditionNodeConfig.vue | 51 +++++++++----------
.../src/nodes/ExclusiveNode.vue | 8 ++-
.../SimpleProcessDesignerV2/src/utils.ts | 2 +-
5 files changed, 44 insertions(+), 46 deletions(-)
diff --git a/src/components/SimpleProcessDesignerV2/src/NodeHandler.vue b/src/components/SimpleProcessDesignerV2/src/NodeHandler.vue
index 81b78852..629031b8 100644
--- a/src/components/SimpleProcessDesignerV2/src/NodeHandler.vue
+++ b/src/components/SimpleProcessDesignerV2/src/NodeHandler.vue
@@ -120,10 +120,9 @@ const addNode = (type: number) => {
showText: '',
type: NodeType.CONDITION_NODE,
childNode: undefined,
- attributes: {
- conditionType: 1,
- defaultFlow: false
- }
+ conditionType: 1,
+ defaultFlow: false
+
},
{
id: 'Flow_' + generateUUID(),
@@ -131,10 +130,8 @@ const addNode = (type: number) => {
showText: '其它情况进入此流程',
type: NodeType.CONDITION_NODE,
childNode: undefined,
- attributes: {
- conditionType: undefined,
- defaultFlow: true
- }
+ conditionType: undefined,
+ defaultFlow: true
}
]
}
diff --git a/src/components/SimpleProcessDesignerV2/src/consts.ts b/src/components/SimpleProcessDesignerV2/src/consts.ts
index d0e59558..0364c5e6 100644
--- a/src/components/SimpleProcessDesignerV2/src/consts.ts
+++ b/src/components/SimpleProcessDesignerV2/src/consts.ts
@@ -62,7 +62,6 @@ export interface SimpleFlowNode {
type: NodeType
name: string
showText?: string
- attributes?: any
// 孩子节点
childNode?: SimpleFlowNode
// 条件节点
@@ -89,6 +88,15 @@ export interface SimpleFlowNode {
assignEmptyHandler?: AssignEmptyHandler
// 审批节点的审批人与发起人相同时,对应的处理类型
assignStartUserHandlerType?: number
+ // 条件类型
+ conditionType?: ConditionType
+ // 条件表达式
+ conditionExpression?: string
+ // 条件组
+ conditionGroups?: ConditionGroup
+ // 是否默认的条件
+ defaultFlow?: boolean
+
}
// 候选人策略枚举 ( 用于审批节点。抄送节点 )
export enum CandidateStrategy {
@@ -292,7 +300,7 @@ export enum TimeUnitType {
}
// 条件配置类型 ( 用于条件节点配置 )
-export enum ConditionConfigType {
+export enum ConditionType {
/**
* 条件表达式
*/
@@ -428,8 +436,8 @@ export const APPROVE_METHODS: DictDataVO[] = [
]
export const CONDITION_CONFIG_TYPES: DictDataVO[] = [
- { label: '条件表达式', value: 1 },
- { label: '条件规则', value: 2 }
+ { label: '条件表达式', value: ConditionType.EXPRESSION },
+ { label: '条件规则', value: ConditionType.RULE }
]
// 时间单位类型
diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue
index 4ffcd4c5..3a193d0f 100644
--- a/src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue
+++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue
@@ -26,19 +26,17 @@