Skip to content

Commit 8922e26

Browse files
committed
# Conflicts: # .env # pnpm-lock.yaml
2 parents 7c710d2 + ed84afe commit 8922e26

File tree

112 files changed

+12778
-2943
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+12778
-2943
lines changed

.env

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,7 @@ VITE_APP_API_ENCRYPT_ALGORITHM = AES
3131
VITE_APP_API_ENCRYPT_REQUEST_KEY = 52549111389893486934626385991395
3232
VITE_APP_API_ENCRYPT_RESPONSE_KEY = 96103715984234343991809655248883
3333
# VITE_APP_API_ENCRYPT_REQUEST_KEY = MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCls2rIpnGdYnLFgz1XU13GbNQ5DloyPpvW00FPGjqn5Z6JpK+kDtVlnkhwR87iRrE5Vf2WNqRX6vzbLSgveIQY8e8oqGCb829myjf1MuI+ZzN4ghf/7tEYhZJGPI9AbfxFqBUzm+kR3/HByAI22GLT96WM26QiMK8n3tIP/yiLswIDAQAB
34-
# VITE_APP_API_ENCRYPT_RESPONSE_KEY = MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAOH8IfIFxL/MR9XIg1UDv5z1fGXQI93E8wrU4iPFovL/sEt9uSgSkjyidC2O7N+m7EKtoN6b1u7cEwXSkwf3kfK0jdWLSQaNpX5YshqXCBzbDfugDaxuyYrNA4/tIMs7mzZAk0APuRXB35Dmupou7Yw7TFW/7QhQmGfzeEKULQvnAgMBAAECgYAw8LqlQGyQoPv5p3gRxEMOCfgL0JzD3XBJKztiRd35RDh40Nx1ejgjW4dPioFwGiVWd2W8cAGHLzALdcQT2KDJh+T/tsd4SPmI6uSBBK6Ff2DkO+kFFcuYvfclQQKqxma5CaZOSqhgenacmgTMFeg2eKlY3symV6JlFNu/IKU42QJBAOhxAK/Eq3e61aYQV2JSguhMR3b8NXJJRroRs/QHEanksJtl+M+2qhk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Us94h+v702Fnym+jJ2CHEkXvz2US8UDs52nWrZYiM1o1y4tfSHm8H8bv8JCAa9GHyriEawfBraILOmllFdLQJAQSRZy4wmlaG48MhVXodB85X+VZ9krGXZ2TLhz7kz9iuToy53l9jTkESt6L5BfBDCVdIwcXLYgK+8KFdHN5W7HQ==
35+
36+
# 百度地图
37+
VITE_BAIDU_MAP_KEY = 'efHIw2qmH8RzHPxK0z0rbCgzDVLup9LD'

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"fast-xml-parser": "^4.3.2",
5252
"highlight.js": "^11.9.0",
5353
"jsencrypt": "^3.3.2",
54+
"jsoneditor": "^10.1.3",
5455
"lodash-es": "^4.17.21",
5556
"markdown-it": "^14.1.0",
5657
"markmap-common": "^0.16.0",
@@ -67,7 +68,6 @@
6768
"sortablejs": "^1.15.3",
6869
"steady-xml": "^0.1.0",
6970
"url": "^0.11.3",
70-
"v3-jsoneditor": "^0.0.6",
7171
"video.js": "^7.21.5",
7272
"vue": "3.5.12",
7373
"vue-dompurify-html": "^4.1.4",
@@ -85,6 +85,7 @@
8585
"@iconify/json": "^2.2.187",
8686
"@intlify/unplugin-vue-i18n": "^2.0.0",
8787
"@purge-icons/generated": "^0.9.0",
88+
"@types/jsoneditor": "^9.9.5",
8889
"@types/lodash-es": "^4.17.12",
8990
"@types/node": "^20.11.21",
9091
"@types/nprogress": "^0.2.3",

src/api/iot/alert/config/index.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import request from '@/config/axios'
2+
3+
/** IoT 告警配置信息 */
4+
export interface AlertConfig {
5+
id: number // 配置编号
6+
name?: string // 配置名称
7+
description: string // 配置描述
8+
level?: number // 告警级别
9+
status?: number // 配置状态
10+
sceneRuleIds: string // 关联的场景联动规则编号数组
11+
receiveUserIds: string // 接收的用户编号数组
12+
receiveTypes: string // 接收的类型数组
13+
}
14+
15+
// IoT 告警配置 API
16+
export const AlertConfigApi = {
17+
// 查询告警配置分页
18+
getAlertConfigPage: async (params: any) => {
19+
return await request.get({ url: `/iot/alert-config/page`, params })
20+
},
21+
22+
// 查询告警配置详情
23+
getAlertConfig: async (id: number) => {
24+
return await request.get({ url: `/iot/alert-config/get?id=` + id })
25+
},
26+
27+
// 新增告警配置
28+
createAlertConfig: async (data: AlertConfig) => {
29+
return await request.post({ url: `/iot/alert-config/create`, data })
30+
},
31+
32+
// 修改告警配置
33+
updateAlertConfig: async (data: AlertConfig) => {
34+
return await request.put({ url: `/iot/alert-config/update`, data })
35+
},
36+
37+
// 删除告警配置
38+
deleteAlertConfig: async (id: number) => {
39+
return await request.delete({ url: `/iot/alert-config/delete?id=` + id })
40+
},
41+
42+
// 获取告警配置简单列表
43+
getSimpleAlertConfigList: async () => {
44+
return await request.get({ url: `/iot/alert-config/simple-list` })
45+
}
46+
}

src/api/iot/alert/record/index.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import request from '@/config/axios'
2+
3+
/** IoT 告警记录信息 */
4+
export interface AlertRecord {
5+
id: number // 记录编号
6+
configId: number // 告警配置编号
7+
configName: string // 告警名称
8+
configLevel: number // 告警级别
9+
productId: number // 产品编号
10+
deviceId: number // 设备编号
11+
deviceMessage: any // 触发的设备消息
12+
processStatus?: boolean // 是否处理
13+
processRemark: string // 处理结果(备注)
14+
}
15+
16+
// IoT 告警记录 API
17+
export const AlertRecordApi = {
18+
// 查询告警记录分页
19+
getAlertRecordPage: async (params: any) => {
20+
return await request.get({ url: `/iot/alert-record/page`, params })
21+
},
22+
23+
// 查询告警记录详情
24+
getAlertRecord: async (id: number) => {
25+
return await request.get({ url: `/iot/alert-record/get?id=` + id })
26+
},
27+
28+
// 处理告警记录
29+
processAlertRecord: async (id: number, processRemark: string) => {
30+
return await request.put({
31+
url: `/iot/alert-record/process`,
32+
data: { id, processRemark }
33+
})
34+
}
35+
}

src/api/iot/device/device/index.ts

Lines changed: 50 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import request from '@/config/axios'
33
// IoT 设备 VO
44
export interface DeviceVO {
55
id: number // 设备 ID,主键,自增
6-
deviceKey: string // 设备唯一标识符
76
deviceName: string // 设备名称
87
productId: number // 产品编号
98
productKey: string // 产品标识
@@ -22,62 +21,54 @@ export interface DeviceVO {
2221
mqttUsername: string // MQTT 用户名
2322
mqttPassword: string // MQTT 密码
2423
authType: string // 认证类型
25-
latitude: number // 设备位置的纬度
26-
longitude: number // 设备位置的经度
24+
locationType: number // 定位类型
25+
latitude?: number // 设备位置的纬度
26+
longitude?: number // 设备位置的经度
2727
areaId: number // 地区编码
2828
address: string // 设备详细地址
2929
serialNumber: string // 设备序列号
3030
config: string // 设备配置
3131
groupIds?: number[] // 添加分组 ID
3232
}
3333

34-
// IoT 设备数据 VO
35-
export interface DeviceDataVO {
36-
deviceId: number // 设备编号
37-
thinkModelFunctionId: number // 物模型编号
38-
productKey: string // 产品标识
39-
deviceName: string // 设备名称
34+
// IoT 设备属性详细 VO
35+
export interface IotDevicePropertyDetailRespVO {
4036
identifier: string // 属性标识符
37+
value: string // 最新值
38+
updateTime: Date // 更新时间
4139
name: string // 属性名称
4240
dataType: string // 数据类型
43-
updateTime: Date // 更新时间
44-
value: string // 最新值
41+
dataSpecs: any // 数据定义
42+
dataSpecsList: any[] // 数据定义列表
4543
}
4644

47-
// IoT 设备数据 VO
48-
export interface DeviceHistoryDataVO {
49-
time: number // 时间
50-
data: string // 数据
45+
// IoT 设备属性 VO
46+
export interface IotDevicePropertyRespVO {
47+
identifier: string // 属性标识符
48+
value: string // 最新值
49+
updateTime: Date // 更新时间
5150
}
5251

52+
// TODO @芋艿:调整到 constants
5353
// IoT 设备状态枚举
5454
export enum DeviceStateEnum {
5555
INACTIVE = 0, // 未激活
5656
ONLINE = 1, // 在线
5757
OFFLINE = 2 // 离线
5858
}
5959

60-
// IoT 设备上行 Request VO
61-
export interface IotDeviceUpstreamReqVO {
62-
id: number // 设备编号
63-
type: string // 消息类型
64-
identifier: string // 标识符
65-
data: any // 请求参数
66-
}
67-
68-
// IoT 设备下行 Request VO
69-
export interface IotDeviceDownstreamReqVO {
70-
id: number // 设备编号
71-
type: string // 消息类型
72-
identifier: string // 标识符
73-
data: any // 请求参数
60+
// 设备认证参数 VO
61+
export interface IotDeviceAuthInfoVO {
62+
clientId: string // 客户端 ID
63+
username: string // 用户名
64+
password: string // 密码
7465
}
7566

76-
// MQTT 连接参数 VO
77-
export interface MqttConnectionParamsVO {
78-
mqttClientId: string // MQTT 客户端 ID
79-
mqttUsername: string // MQTT 用户名
80-
mqttPassword: string // MQTT 密码
67+
// IoT 设备发送消息 Request VO
68+
export interface IotDeviceMessageSendReqVO {
69+
deviceId: number // 设备编号
70+
method: string // 请求方法
71+
params?: any // 请求参数
8172
}
8273

8374
// 设备 API
@@ -128,42 +119,47 @@ export const DeviceApi = {
128119
},
129120

130121
// 获取设备的精简信息列表
131-
getSimpleDeviceList: async (deviceType?: number) => {
132-
return await request.get({ url: `/iot/device/simple-list?`, params: { deviceType } })
122+
getSimpleDeviceList: async (deviceType?: number, productId?: number) => {
123+
return await request.get({ url: `/iot/device/simple-list?`, params: { deviceType, productId } })
124+
},
125+
126+
// 根据产品编号,获取设备的精简信息列表
127+
getDeviceListByProductId: async (productId: number) => {
128+
return await request.get({ url: `/iot/device/simple-list?`, params: { productId } })
133129
},
134130

135131
// 获取导入模板
136132
importDeviceTemplate: async () => {
137133
return await request.download({ url: `/iot/device/get-import-template` })
138134
},
139135

140-
// 设备上行
141-
upstreamDevice: async (data: IotDeviceUpstreamReqVO) => {
142-
return await request.post({ url: `/iot/device/upstream`, data })
136+
// 获取设备属性最新数据
137+
getLatestDeviceProperties: async (params: any) => {
138+
return await request.get({ url: `/iot/device/property/get-latest`, params })
143139
},
144140

145-
// 设备下行
146-
downstreamDevice: async (data: IotDeviceDownstreamReqVO) => {
147-
return await request.post({ url: `/iot/device/downstream`, data })
141+
// 获取设备属性历史数据
142+
getHistoryDevicePropertyList: async (params: any) => {
143+
return await request.get({ url: `/iot/device/property/history-list`, params })
148144
},
149145

150-
// 获取设备属性最新数据
151-
getLatestDeviceProperties: async (params: any) => {
152-
return await request.get({ url: `/iot/device/property/latest`, params })
146+
// 获取设备认证信息
147+
getDeviceAuthInfo: async (id: number) => {
148+
return await request.get({ url: `/iot/device/get-auth-info`, params: { id } })
153149
},
154150

155-
// 获取设备属性历史数据
156-
getHistoryDevicePropertyPage: async (params: any) => {
157-
return await request.get({ url: `/iot/device/property/history-page`, params })
151+
// 查询设备消息分页
152+
getDeviceMessagePage: async (params: any) => {
153+
return await request.get({ url: `/iot/device/message/page`, params })
158154
},
159155

160-
// 查询设备日志分页
161-
getDeviceLogPage: async (params: any) => {
162-
return await request.get({ url: `/iot/device/log/page`, params })
156+
// 查询设备消息配对分页
157+
getDeviceMessagePairPage: async (params: any) => {
158+
return await request.get({ url: `/iot/device/message/pair-page`, params })
163159
},
164160

165-
// 获取设备MQTT连接参数
166-
getMqttConnectionParams: async (deviceId: number) => {
167-
return await request.get({ url: `/iot/device/mqtt-connection-params`, params: { deviceId } })
161+
// 发送设备消息
162+
sendDeviceMessage: async (params: IotDeviceMessageSendReqVO) => {
163+
return await request.post({ url: `/iot/device/message/send`, data: params })
168164
}
169165
}

src/api/iot/ota/firmware/index.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import request from '@/config/axios'
2+
3+
/** IoT OTA 固件信息 */
4+
export interface IoTOtaFirmware {
5+
id?: number // 固件编号
6+
name?: string // 固件名称
7+
description?: string // 固件描述
8+
version?: string // 版本号
9+
productId?: number // 产品编号
10+
productName?: string // 产品名称
11+
fileUrl?: string // 固件文件 URL
12+
fileSize?: number // 固件文件大小
13+
fileDigestAlgorithm?: string // 固件文件签名算法
14+
fileDigestValue?: string // 固件文件签名结果
15+
createTime?: Date // 创建时间
16+
}
17+
18+
// IoT OTA 固件 API
19+
export const IoTOtaFirmwareApi = {
20+
// 查询 OTA 固件分页
21+
getOtaFirmwarePage: async (params: any) => {
22+
return await request.get({ url: `/iot/ota/firmware/page`, params })
23+
},
24+
25+
// 查询 OTA 固件详情
26+
getOtaFirmware: async (id: number) => {
27+
return await request.get({ url: `/iot/ota/firmware/get?id=` + id })
28+
},
29+
30+
// 新增 OTA 固件
31+
createOtaFirmware: async (data: IoTOtaFirmware) => {
32+
return await request.post({ url: `/iot/ota/firmware/create`, data })
33+
},
34+
35+
// 修改 OTA 固件
36+
updateOtaFirmware: async (data: IoTOtaFirmware) => {
37+
return await request.put({ url: `/iot/ota/firmware/update`, data })
38+
},
39+
40+
// 删除 OTA 固件
41+
deleteOtaFirmware: async (id: number) => {
42+
return await request.delete({ url: `/iot/ota/firmware/delete?id=` + id })
43+
}
44+
}

src/api/iot/ota/task/index.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import request from '@/config/axios'
2+
3+
/** IoT OTA 任务信息 */
4+
export interface OtaTask {
5+
id?: number // 任务编号
6+
name: string // 任务名称
7+
description?: string // 任务描述
8+
firmwareId?: number // 固件编号
9+
status: number // 任务状态
10+
deviceScope?: number // 升级范围
11+
deviceIds?: number[] // 指定设备ID列表(当升级范围为指定设备时使用)
12+
deviceTotalCount?: number // 设备总共数量
13+
deviceSuccessCount?: number // 设备成功数量
14+
createTime?: Date // 创建时间
15+
}
16+
17+
// IoT OTA 任务 API
18+
export const IoTOtaTaskApi = {
19+
// 查询 OTA 升级任务分页
20+
getOtaTaskPage: async (params: any) => {
21+
return await request.get({ url: `/iot/ota/task/page`, params })
22+
},
23+
24+
// 查询 OTA 升级任务详情
25+
getOtaTask: async (id: number) => {
26+
return await request.get({ url: `/iot/ota/task/get?id=` + id })
27+
},
28+
29+
// 创建 OTA 升级任务
30+
createOtaTask: async (data: OtaTask) => {
31+
return await request.post({ url: `/iot/ota/task/create`, data })
32+
},
33+
34+
// 取消 OTA 升级任务
35+
cancelOtaTask: async (id: number) => {
36+
return await request.post({ url: `/iot/ota/task/cancel?id=` + id })
37+
}
38+
}

0 commit comments

Comments
 (0)