File tree Expand file tree Collapse file tree 2 files changed +21
-8
lines changed
views/iot/device/device/detail Expand file tree Collapse file tree 2 files changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -56,8 +56,16 @@ export enum DeviceStateEnum {
56
56
OFFLINE = 2 // 离线
57
57
}
58
58
59
- // IoT 模拟设备上报数据 Request VO
60
- export interface IotDeviceSimulationReportReqVO {
59
+ // IoT 模拟设备上行数据 Request VO
60
+ export interface IotDeviceSimulationUpstreamReqVO {
61
+ id : number // 设备编号
62
+ type : string // 消息类型
63
+ identifier : string // 标识符
64
+ data : any // 请求参数
65
+ }
66
+
67
+ // IoT 模拟设备下行数据 Request VO
68
+ export interface IotDeviceSimulationDownstreamReqVO {
61
69
id : number // 设备编号
62
70
type : string // 消息类型
63
71
identifier : string // 标识符
@@ -121,9 +129,14 @@ export const DeviceApi = {
121
129
return await request . download ( { url : `/iot/device/get-import-template` } )
122
130
} ,
123
131
124
- // 模拟设备上报
125
- simulationReportDevice : async ( data : IotDeviceSimulationReportReqVO ) => {
126
- return await request . post ( { url : `/iot/device/simulation-report` , data } )
132
+ // 模拟设备上行
133
+ simulationDeviceUpstream : async ( data : IotDeviceSimulationUpstreamReqVO ) => {
134
+ return await request . post ( { url : `/iot/device/simulation-upstream` , data } )
135
+ } ,
136
+
137
+ // 模拟设备下行
138
+ simulationDeviceDownstream : async ( data : IotDeviceSimulationDownstreamReqVO ) => {
139
+ return await request . post ( { url : `/iot/device/simulation-downstream` , data } )
127
140
} ,
128
141
129
142
// 获取设备属性最新数据
Original file line number Diff line number Diff line change 103
103
<el-button
104
104
type =" primary"
105
105
@click =" handlePropertyReport"
106
- v-hasPermi =" ['iot:device:simulation-report ']"
106
+ v-hasPermi =" ['iot:device:simulation']"
107
107
>
108
108
发送
109
109
</el-button >
@@ -331,7 +331,7 @@ const handlePropertyReport = async () => {
331
331
})
332
332
333
333
try {
334
- await DeviceApi .simulationReportDevice ({
334
+ await DeviceApi .simulationDeviceUpstream ({
335
335
id: props .device .id ,
336
336
type: ' property' ,
337
337
identifier: ' report' ,
@@ -375,7 +375,7 @@ const handlePropertyReport = async () => {
375
375
/** 处理设备状态 */
376
376
const handleDeviceState = async (state : number ) => {
377
377
try {
378
- await DeviceApi .simulationReportDevice ({
378
+ await DeviceApi .simulationDeviceUpstream ({
379
379
id: props .device .id ,
380
380
type: ' state' ,
381
381
identifier: ' report' ,
You can’t perform that action at this time.
0 commit comments