Skip to content

Commit 80ac4b0

Browse files
committed
Merge branch 'master' of https://gitee.com/yudaocode/yudao-ui-admin-vue3 into feature/bpm
2 parents 7508eb5 + 5216d18 commit 80ac4b0

File tree

89 files changed

+7604
-1343
lines changed

Some content is hidden

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

89 files changed

+7604
-1343
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"source.fixAll.stylelint": "explicit"
8888
},
8989
"[vue]": {
90-
"editor.defaultFormatter": "esbenp.prettier-vscode"
90+
"editor.defaultFormatter": "octref.vetur"
9191
},
9292
"i18n-ally.localesPaths": ["src/locales"],
9393
"i18n-ally.keystyle": "nested",

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
"sortablejs": "^1.15.3",
6868
"steady-xml": "^0.1.0",
6969
"url": "^0.11.3",
70+
"v3-jsoneditor": "^0.0.6",
7071
"video.js": "^7.21.5",
7172
"vue": "3.5.12",
7273
"vue-dompurify-html": "^4.1.4",
@@ -92,6 +93,7 @@
9293
"@typescript-eslint/eslint-plugin": "^7.1.0",
9394
"@typescript-eslint/parser": "^7.1.0",
9495
"@unocss/eslint-config": "^0.57.4",
96+
"@unocss/eslint-plugin": "66.1.0-beta.5",
9597
"@unocss/transformer-variant-group": "^0.58.5",
9698
"@vitejs/plugin-legacy": "^5.3.1",
9799
"@vitejs/plugin-vue": "^5.0.4",

pnpm-lock.yaml

Lines changed: 275 additions & 99 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
import request from '@/config/axios'
2+
3+
// IoT 设备 VO
4+
export interface DeviceVO {
5+
id: number // 设备 ID,主键,自增
6+
deviceKey: string // 设备唯一标识符
7+
deviceName: string // 设备名称
8+
productId: number // 产品编号
9+
productKey: string // 产品标识
10+
deviceType: number // 设备类型
11+
nickname: string // 设备备注名称
12+
gatewayId: number // 网关设备 ID
13+
state: number // 设备状态
14+
onlineTime: Date // 最后上线时间
15+
offlineTime: Date // 最后离线时间
16+
activeTime: Date // 设备激活时间
17+
createTime: Date // 创建时间
18+
ip: string // 设备的 IP 地址
19+
firmwareVersion: string // 设备的固件版本
20+
deviceSecret: string // 设备密钥,用于设备认证,需安全存储
21+
mqttClientId: string // MQTT 客户端 ID
22+
mqttUsername: string // MQTT 用户名
23+
mqttPassword: string // MQTT 密码
24+
authType: string // 认证类型
25+
latitude: number // 设备位置的纬度
26+
longitude: number // 设备位置的经度
27+
areaId: number // 地区编码
28+
address: string // 设备详细地址
29+
serialNumber: string // 设备序列号
30+
config: string // 设备配置
31+
groupIds?: number[] // 添加分组 ID
32+
}
33+
34+
// IoT 设备数据 VO
35+
export interface DeviceDataVO {
36+
deviceId: number // 设备编号
37+
thinkModelFunctionId: number // 物模型编号
38+
productKey: string // 产品标识
39+
deviceName: string // 设备名称
40+
identifier: string // 属性标识符
41+
name: string // 属性名称
42+
dataType: string // 数据类型
43+
updateTime: Date // 更新时间
44+
value: string // 最新值
45+
}
46+
47+
// IoT 设备数据 VO
48+
export interface DeviceHistoryDataVO {
49+
time: number // 时间
50+
data: string // 数据
51+
}
52+
53+
// IoT 设备状态枚举
54+
export enum DeviceStateEnum {
55+
INACTIVE = 0, // 未激活
56+
ONLINE = 1, // 在线
57+
OFFLINE = 2 // 离线
58+
}
59+
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 // 请求参数
74+
}
75+
76+
// MQTT 连接参数 VO
77+
export interface MqttConnectionParamsVO {
78+
mqttClientId: string // MQTT 客户端 ID
79+
mqttUsername: string // MQTT 用户名
80+
mqttPassword: string // MQTT 密码
81+
}
82+
83+
// 设备 API
84+
export const DeviceApi = {
85+
// 查询设备分页
86+
getDevicePage: async (params: any) => {
87+
return await request.get({ url: `/iot/device/page`, params })
88+
},
89+
90+
// 查询设备详情
91+
getDevice: async (id: number) => {
92+
return await request.get({ url: `/iot/device/get?id=` + id })
93+
},
94+
95+
// 新增设备
96+
createDevice: async (data: DeviceVO) => {
97+
return await request.post({ url: `/iot/device/create`, data })
98+
},
99+
100+
// 修改设备
101+
updateDevice: async (data: DeviceVO) => {
102+
return await request.put({ url: `/iot/device/update`, data })
103+
},
104+
105+
// 修改设备分组
106+
updateDeviceGroup: async (data: { ids: number[]; groupIds: number[] }) => {
107+
return await request.put({ url: `/iot/device/update-group`, data })
108+
},
109+
110+
// 删除单个设备
111+
deleteDevice: async (id: number) => {
112+
return await request.delete({ url: `/iot/device/delete?id=` + id })
113+
},
114+
115+
// 删除多个设备
116+
deleteDeviceList: async (ids: number[]) => {
117+
return await request.delete({ url: `/iot/device/delete-list`, params: { ids: ids.join(',') } })
118+
},
119+
120+
// 导出设备
121+
exportDeviceExcel: async (params: any) => {
122+
return await request.download({ url: `/iot/device/export-excel`, params })
123+
},
124+
125+
// 获取设备数量
126+
getDeviceCount: async (productId: number) => {
127+
return await request.get({ url: `/iot/device/count?productId=` + productId })
128+
},
129+
130+
// 获取设备的精简信息列表
131+
getSimpleDeviceList: async (deviceType?: number) => {
132+
return await request.get({ url: `/iot/device/simple-list?`, params: { deviceType } })
133+
},
134+
135+
// 获取导入模板
136+
importDeviceTemplate: async () => {
137+
return await request.download({ url: `/iot/device/get-import-template` })
138+
},
139+
140+
// 设备上行
141+
upstreamDevice: async (data: IotDeviceUpstreamReqVO) => {
142+
return await request.post({ url: `/iot/device/upstream`, data })
143+
},
144+
145+
// 设备下行
146+
downstreamDevice: async (data: IotDeviceDownstreamReqVO) => {
147+
return await request.post({ url: `/iot/device/downstream`, data })
148+
},
149+
150+
// 获取设备属性最新数据
151+
getLatestDeviceProperties: async (params: any) => {
152+
return await request.get({ url: `/iot/device/property/latest`, params })
153+
},
154+
155+
// 获取设备属性历史数据
156+
getHistoryDevicePropertyPage: async (params: any) => {
157+
return await request.get({ url: `/iot/device/property/history-page`, params })
158+
},
159+
160+
// 查询设备日志分页
161+
getDeviceLogPage: async (params: any) => {
162+
return await request.get({ url: `/iot/device/log/page`, params })
163+
},
164+
165+
// 获取设备MQTT连接参数
166+
getMqttConnectionParams: async (deviceId: number) => {
167+
return await request.get({ url: `/iot/device/mqtt-connection-params`, params: { deviceId } })
168+
}
169+
}

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

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import request from '@/config/axios'
2+
3+
// IoT 设备分组 VO
4+
export interface DeviceGroupVO {
5+
id: number // 分组 ID
6+
name: string // 分组名字
7+
status: number // 分组状态
8+
description: string // 分组描述
9+
deviceCount?: number // 设备数量
10+
}
11+
12+
// IoT 设备分组 API
13+
export const DeviceGroupApi = {
14+
// 查询设备分组分页
15+
getDeviceGroupPage: async (params: any) => {
16+
return await request.get({ url: `/iot/device-group/page`, params })
17+
},
18+
19+
// 查询设备分组详情
20+
getDeviceGroup: async (id: number) => {
21+
return await request.get({ url: `/iot/device-group/get?id=` + id })
22+
},
23+
24+
// 新增设备分组
25+
createDeviceGroup: async (data: DeviceGroupVO) => {
26+
return await request.post({ url: `/iot/device-group/create`, data })
27+
},
28+
29+
// 修改设备分组
30+
updateDeviceGroup: async (data: DeviceGroupVO) => {
31+
return await request.put({ url: `/iot/device-group/update`, data })
32+
},
33+
34+
// 删除设备分组
35+
deleteDeviceGroup: async (id: number) => {
36+
return await request.delete({ url: `/iot/device-group/delete?id=` + id })
37+
},
38+
39+
// 获取设备分组的精简信息列表
40+
getSimpleDeviceGroupList: async () => {
41+
return await request.get({ url: `/iot/device-group/simple-list` })
42+
}
43+
}

src/api/iot/device/index.ts

Lines changed: 0 additions & 74 deletions
This file was deleted.

src/api/iot/plugin/index.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import request from '@/config/axios'
2+
3+
// IoT 插件配置 VO
4+
export interface PluginConfigVO {
5+
id: number // 主键ID
6+
pluginKey: string // 插件标识
7+
name: string // 插件名称
8+
description: string // 描述
9+
deployType: number // 部署方式
10+
fileName: string // 插件包文件名
11+
version: string // 插件版本
12+
type: number // 插件类型
13+
protocol: string // 设备插件协议类型
14+
status: number // 状态
15+
configSchema: string // 插件配置项描述信息
16+
config: string // 插件配置信息
17+
script: string // 插件脚本
18+
}
19+
20+
// IoT 插件配置 API
21+
export const PluginConfigApi = {
22+
// 查询插件配置分页
23+
getPluginConfigPage: async (params: any) => {
24+
return await request.get({ url: `/iot/plugin-config/page`, params })
25+
},
26+
27+
// 查询插件配置详情
28+
getPluginConfig: async (id: number) => {
29+
return await request.get({ url: `/iot/plugin-config/get?id=` + id })
30+
},
31+
32+
// 新增插件配置
33+
createPluginConfig: async (data: PluginConfigVO) => {
34+
return await request.post({ url: `/iot/plugin-config/create`, data })
35+
},
36+
37+
// 修改插件配置
38+
updatePluginConfig: async (data: PluginConfigVO) => {
39+
return await request.put({ url: `/iot/plugin-config/update`, data })
40+
},
41+
42+
// 删除插件配置
43+
deletePluginConfig: async (id: number) => {
44+
return await request.delete({ url: `/iot/plugin-config/delete?id=` + id })
45+
},
46+
47+
// 修改插件状态
48+
updatePluginStatus: async (data: any) => {
49+
return await request.put({ url: `/iot/plugin-config/update-status`, data })
50+
}
51+
}

0 commit comments

Comments
 (0)