Commit 777f4375 authored by 王晓倩's avatar 王晓倩

地图弹窗设备实时数据接口

parent f3f82940
...@@ -91,6 +91,22 @@ public class TDeviceReportDataController extends BaseController ...@@ -91,6 +91,22 @@ public class TDeviceReportDataController extends BaseController
return AjaxResult.success(deviceReportDataVo); return AjaxResult.success(deviceReportDataVo);
} }
/**
* 地图弹窗获取设备监控数据详细信息
*/
@GetMapping(value = "getWindowData/{deviceId}")
public AjaxResult getWindowData(@PathVariable("deviceId") int deviceId) throws Exception
{
TDeviceReportData deviceReportData = null;
try {
deviceReportData = tDeviceReportDataService.selectWindowDataByDeviceId(deviceId);
} catch (Exception e) {
e.printStackTrace();
throw new Exception("地图弹窗获取设备监控数据详细信息失败");
}
return AjaxResult.success(deviceReportData);
}
/** /**
* 新增设备监控 * 新增设备监控
*/ */
......
...@@ -23,6 +23,14 @@ public interface ITDeviceReportDataService ...@@ -23,6 +23,14 @@ public interface ITDeviceReportDataService
*/ */
public DeviceReportDataVo selectTDeviceReportDataByDeviceId(int deviceId) throws Exception; public DeviceReportDataVo selectTDeviceReportDataByDeviceId(int deviceId) throws Exception;
/**
* 地图弹窗获取实时数据
*
* @param deviceId 设备ID
* @return 设备监控
*/
public TDeviceReportData selectWindowDataByDeviceId(int deviceId) throws Exception;
/** /**
* 查询设备监控列表 * 查询设备监控列表
* *
......
...@@ -61,6 +61,21 @@ public class TDeviceReportDataServiceImpl implements ITDeviceReportDataService ...@@ -61,6 +61,21 @@ public class TDeviceReportDataServiceImpl implements ITDeviceReportDataService
return deviceReportDataVo; return deviceReportDataVo;
} }
/**
* 查询设备监控
*
* @param deviceId 设备ID
* @return 设备监控
*/
@Override
public TDeviceReportData selectWindowDataByDeviceId(int deviceId) throws Exception
{
TDeviceInfo tDeviceInfo = tDeviceInfoMapper.selectTDeviceInfoById(deviceId);
TDeviceReportData tDeviceReportData = tDeviceReportDataMapper.selectTDeviceReportDataByDeviceNum(tDeviceInfo.getIotNo());
return tDeviceReportData;
}
/** /**
* 查询设备监控列表 * 查询设备监控列表
* *
......
...@@ -19,9 +19,17 @@ export function realtimeData(query) { ...@@ -19,9 +19,17 @@ export function realtimeData(query) {
} }
// 查询设备监控详细 // 查询设备监控详细
export function getData(deviceReportDataId) { export function getData(deviceId) {
return request({ return request({
url: '/dataMonitoring/reportData/' + deviceReportDataId, url: '/dataMonitoring/reportData/' + deviceId,
method: 'get'
})
}
// 查询设备监控详细
export function getWindowData(deviceId) {
return request({
url: '/dataMonitoring/reportData/getWindowData/' + deviceId,
method: 'get' method: 'get'
}) })
} }
......
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
上报时间:<span class="reportTime"></span> 上报时间:<span class="reportTime"></span>
</div> </div>
</el-col> </el-col>
</div> </div>
<div v-if="data.deviceType==4" class="windowwarn-content" style=" <div v-if="data.deviceType==4" class="windowwarn-content" style="
border-bottom: 1px solid #e2e2e2; border-bottom: 1px solid #e2e2e2;
padding: 10px 0 2px 22px; padding: 10px 0 2px 22px;
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
</template> </template>
<script> <script>
import { realtimeData, getData } from "@/api/dataMonitoring/reportData"; import { getWindowData } from "@/api/dataMonitoring/reportData";
import moment from "moment"; import moment from "moment";
//line移入时的的infowindow //line移入时的的infowindow
export default { export default {
...@@ -153,7 +153,6 @@ export default { ...@@ -153,7 +153,6 @@ export default {
data(){ data(){
return{ return{
deviceId:"", deviceId:"",
alarm:{},
} }
}, },
mounted() { mounted() {
...@@ -179,7 +178,7 @@ export default { ...@@ -179,7 +178,7 @@ export default {
}); });
}, },
getDataid() { getDataid() {
getData(this.data.deviceId).then(response => { getWindowData(this.data.deviceId).then(response => {
this.changeValue(response.data) this.changeValue(response.data)
}) })
......
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
上报时间:<span class="reportTime"></span> 上报时间:<span class="reportTime"></span>
</div> </div>
</el-col> </el-col>
</div> </div>
<div v-if="data.deviceType==4" class="windowwarn-content" style=" <div v-if="data.deviceType==4" class="windowwarn-content" style="
border-bottom: 1px solid #e2e2e2; border-bottom: 1px solid #e2e2e2;
padding: 10px 0 2px 22px; padding: 10px 0 2px 22px;
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
</template> </template>
<script> <script>
import { realtimeData, getData } from "@/api/dataMonitoring/reportData"; import { getWindowData } from "@/api/dataMonitoring/reportData";
import moment from "moment"; import moment from "moment";
//line移入时的的infowindow //line移入时的的infowindow
export default { export default {
...@@ -165,7 +165,6 @@ ...@@ -165,7 +165,6 @@
obj: { typs: Object }, obj: { typs: Object },
title: "", title: "",
data: {}, data: {},
// realtime:{},
map: null, map: null,
}, },
data() { data() {
...@@ -198,7 +197,7 @@ ...@@ -198,7 +197,7 @@
methods: { methods: {
moment, moment,
getDataid() { getDataid() {
getData(this.data.deviceId).then(response => { getWindowData(this.data.deviceId).then(response => {
this.changeValue(response.data) this.changeValue(response.data)
}) })
...@@ -450,4 +449,4 @@ ...@@ -450,4 +449,4 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
</style> </style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment