File tree Expand file tree Collapse file tree 3 files changed +18
-19
lines changed
views/iot/device/device/detail Expand file tree Collapse file tree 3 files changed +18
-19
lines changed Original file line number Diff line number Diff line change @@ -128,27 +128,26 @@ export const DeviceApi = {
128
128
return await request . get ( { url : `/iot/device/simple-list?` , params : { deviceType } } )
129
129
} ,
130
130
131
- // 获取设备属性最���数据
132
- getDevicePropertiesLatestData : async ( params : any ) => {
133
- return await request . get ( { url : `/iot/device/data/latest` , params } )
134
- } ,
135
-
136
- // 获取设备属性历史数据
137
- getDevicePropertiesHistoryData : async ( params : any ) => {
138
- return await request . get ( { url : `/iot/device/data/history` , params } )
139
- } ,
140
-
141
131
// 获取导入模板
142
132
importDeviceTemplate : async ( ) => {
143
133
return await request . download ( { url : `/iot/device/get-import-template` } )
144
134
} ,
145
135
146
136
// 模拟设备上报
147
137
simulationReportDevice : async ( data : IotDeviceSimulationReportReqVO ) => {
148
- // TODO @super :/iot/device/simulator
149
138
return await request . post ( { url : `/iot/device/simulation-report` , data } )
150
139
} ,
151
140
141
+ // 获取设备属性最新数据
142
+ getLatestDeviceProperties : async ( params : any ) => {
143
+ return await request . get ( { url : `/iot/device/property/latest` , params } )
144
+ } ,
145
+
146
+ // 获取设备属性历史数据
147
+ getHistoryDevicePropertyPage : async ( params : any ) => {
148
+ return await request . get ( { url : `/iot/device/property/history-page` , params } )
149
+ } ,
150
+
152
151
// 查询设备日志分页
153
152
getDeviceLogPage : async ( params : any ) => {
154
153
return await request . get ( { url : `/iot/device/log/page` , params } )
Original file line number Diff line number Diff line change 37
37
<el-table-column
38
38
label =" 时间"
39
39
align =" center"
40
- prop =" time "
40
+ prop =" updateTime "
41
41
:formatter =" dateFormatter"
42
42
width =" 180px"
43
43
/>
44
- <el-table-column label =" 原始值 " align =" center" prop =" data " />
44
+ <el-table-column label =" 属性值 " align =" center" prop =" value " />
45
45
</el-table >
46
46
<!-- 分页 -->
47
47
<Pagination
@@ -72,7 +72,7 @@ const queryParams = reactive({
72
72
pageNo: 1 ,
73
73
pageSize: 10 ,
74
74
deviceId: - 1 ,
75
- identifier: undefined as string | undefined ,
75
+ identifier: ' ' ,
76
76
times: [
77
77
// 默认显示最近一周的数据
78
78
formatDate (beginOfDay (new Date (new Date ().getTime () - 3600 * 1000 * 24 * 7 ))),
@@ -85,7 +85,7 @@ const queryFormRef = ref() // 搜索的表单
85
85
const getList = async () => {
86
86
detailLoading .value = true
87
87
try {
88
- const data = await DeviceApi .getDevicePropertiesHistoryData (queryParams )
88
+ const data = await DeviceApi .getHistoryDevicePropertyPage (queryParams )
89
89
list .value = data .list
90
90
total .value = data .total
91
91
} finally {
@@ -94,7 +94,7 @@ const getList = async () => {
94
94
}
95
95
96
96
/** 打开弹窗 */
97
- const open = async (deviceId : number , identifier : String ) => {
97
+ const open = (deviceId : number , identifier : string ) => {
98
98
dialogVisible .value = true
99
99
queryParams .deviceId = deviceId
100
100
queryParams .identifier = identifier
Original file line number Diff line number Diff line change 57
57
<el-button
58
58
link
59
59
type =" primary"
60
- @click =" openDetail(scope.row.deviceId , scope.row.identifier)"
60
+ @click =" openDetail(props.device.id , scope.row.identifier)"
61
61
>
62
62
查看数据
63
63
</el-button >
@@ -102,7 +102,7 @@ const getList = async () => {
102
102
loading .value = true
103
103
try {
104
104
queryParams .deviceId = props .device .id
105
- list .value = await DeviceApi .getDevicePropertiesLatestData (queryParams )
105
+ list .value = await DeviceApi .getLatestDeviceProperties (queryParams )
106
106
} finally {
107
107
loading .value = false
108
108
}
@@ -123,7 +123,7 @@ const resetQuery = () => {
123
123
124
124
/** 添加/修改操作 */
125
125
const detailRef = ref ()
126
- const openDetail = (deviceId : number , identifier : String ) => {
126
+ const openDetail = (deviceId : number , identifier : string ) => {
127
127
detailRef .value .open (deviceId , identifier )
128
128
}
129
129
You can’t perform that action at this time.
0 commit comments