diff --git a/src/assets/img/nodatapic.jpg b/src/assets/img/nodatapic.jpg new file mode 100644 index 0000000..100f935 Binary files /dev/null and b/src/assets/img/nodatapic.jpg differ diff --git a/src/assets/img/nodatapic2.jpg b/src/assets/img/nodatapic2.jpg new file mode 100644 index 0000000..6a25538 Binary files /dev/null and b/src/assets/img/nodatapic2.jpg differ diff --git a/src/utils/api/index.js b/src/utils/api/index.js index 43caf8e..7256edb 100644 --- a/src/utils/api/index.js +++ b/src/utils/api/index.js @@ -507,14 +507,26 @@ export function setTermGPSJoggle(data) { } //手动拍照 -export function getLatestPhotoJoggle(data) { +export function takePicJoggle(data) { return request({ - url: "/api/getLatestPhoto", - method: "post", - data, + url: "/api/takePic", + method: "get", + + params: data, + // data, + // headers: { + // "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + // }, + }); +} +//手动拍 获取装置状态 +export function getTakePicStatusJoggle(data) { + return request({ + url: "/api/getTakePicStatus", + method: "get", + params: data, }); } - //获取所有通道列表 export function getAllChannelListJoggle(data) { @@ -536,11 +548,11 @@ export function getAllTowerJoggle(data) { } //手动拍照获取最新图片 -export function getReturnedPhotoJoggle(data) { +export function getTakePicPhotoStatusJoggle(data) { return request({ - url: "/api/getReturnedPhoto", - method: "post", - data, + url: "/api/getTakePicPhotoStatus", + method: "get", + params: data, }); } diff --git a/src/views/alarmHandling/components/historyimg.vue b/src/views/alarmHandling/components/historyimg.vue index 9ea3750..df3a804 100644 --- a/src/views/alarmHandling/components/historyimg.vue +++ b/src/views/alarmHandling/components/historyimg.vue @@ -14,7 +14,16 @@ indicator-position="none" > - + + diff --git a/src/views/alarmHandling/index.vue b/src/views/alarmHandling/index.vue index 599a52d..2732d96 100644 --- a/src/views/alarmHandling/index.vue +++ b/src/views/alarmHandling/index.vue @@ -343,8 +343,12 @@ import { getSearchInfo, getAlarmList, getAlarmTypeList, - getLatestPhotoJoggle, - getReturnedPhotoJoggle, + // getLatestPhotoJoggle, + // getReturnedPhotoJoggle, + getTermStatus, + takePicJoggle, + getTakePicPhotoStatusJoggle, + getTakePicStatusJoggle, readAlarm, } from "@/utils/api/index"; import historyimg from "./components/historyimg.vue"; @@ -398,6 +402,8 @@ export default { zoomD: 1, canvansdata: "", current: 0, + requestId: "", //请求拍照返回的requestid + picTime: "", //请求拍照返回的时间 }; }, created() { @@ -794,33 +800,100 @@ export default { this.imgOnload(); }); }, - //手动拍照 + + //主动拍照 handleCommandpic() { - this.btnpicloading = true; - getLatestPhotoJoggle({ - captureType: 0, - channel: this.selectRow.channelId, - termId: this.selectRow.termId, - preset: 255, - }).then((res) => { - this.$message({ - duration: 1500, - showClose: true, - message: "手动拍照请求成功!", - type: "success", - }); - this.timer = window.setInterval(() => { - this.newPicApi(res.data); - this.i++; - }, 5000); + getTermStatus({ termId: this.selectRow.termId }).then((res) => { + console.log(res); + if (res.data.isonline) { + takePicJoggle({ + captureType: 0, + channel: this.selectRow.channelId, + termId: this.selectRow.termId, + preset: 255, + }) + .then((res) => { + console.log(res); + this.requestId = res.data.requestId; //获取requestid 判断装置是否下发 + this.picTime = res.data.taketime; //获取时间 判断获取最新图片 + console.log(this.requestId); + this.btnpicloading = true; + this.statusTimer = window.setInterval(() => { + this.getTakePicStatus(this.requestId); + this.statusNum++; + }, 2000); + }) + .catch((err) => { + console.log(err); //代码错误、请求失败捕获 + }); + } else { + this.$message({ + duration: 1500, + showClose: true, + message: "装置下线,发送指令失败", + type: "error", + }); + } }); }, + //获取装置是否下发状态 + getTakePicStatus(data) { + console.log(data); + getTakePicStatusJoggle({ + requestid: data, + }) + .then((res) => { + console.log(res); + //res.data 0 状态未知 1 成功 2失败 + if (res.data == 0 && this.statusNum >= 5) { + this.statusNum = 0; + clearInterval(this.statusTimer); + this.statusTimer = null; + this.btnpicloading = false; + this.btnvideoloading = false; + this.$message({ + duration: 1500, + showClose: true, + message: "下发指令超时,请重试!", + type: "warning", + }); + } else if (res.data == 1) { + this.statusNum = 0; + clearInterval(this.statusTimer); + this.statusTimer = null; + this.$message({ + duration: 1500, + showClose: true, + message: "下发指令成功!", + type: "success", + }); + this.timer = window.setInterval(() => { + this.newPicApi(); + this.i++; + }, 8000); + } else if (res.data == 2) { + this.statusNum = 0; + clearInterval(this.statusTimer); + this.statusTimer = null; + this.$message({ + duration: 1500, + showClose: true, + message: "下发指令失败!", + type: "error", + }); + } + }) + .catch((err) => { + console.log(err); //代码错误、请求失败捕获 + }); + }, //获取最新图片 - newPicApi(val) { - getReturnedPhotoJoggle({ - photoTime: val, + newPicApi() { + getTakePicPhotoStatusJoggle({ + photoTime: new Date(this.picTime).getTime(), termId: this.selectRow.termId, }).then((res) => { + console.log(res.data); if (res.data == true && this.i < 10) { clearInterval(this.timer); this.timer = null; @@ -846,6 +919,7 @@ export default { } }); }, + //历史图片 handleHistory() { this.$refs.historyimg_ref.display(); diff --git a/src/views/components/carouselChart.vue b/src/views/components/carouselChart.vue index 4407390..584a2a1 100644 --- a/src/views/components/carouselChart.vue +++ b/src/views/components/carouselChart.vue @@ -22,13 +22,6 @@ -
- -
-
+
+ +
@@ -147,6 +147,7 @@ export default { this.isShow = false; }, handleclose() { + this.isShow = false; this.i = 0; clearInterval(this.timer); this.timer = null; diff --git a/src/views/realTimeMonitor/index.vue b/src/views/realTimeMonitor/index.vue index c1b6763..5162906 100644 --- a/src/views/realTimeMonitor/index.vue +++ b/src/views/realTimeMonitor/index.vue @@ -67,7 +67,7 @@
-
+
-
-
+
+
{{ towertitle }} @@ -87,6 +87,7 @@ :terminalPhoto="terminalPhoto" v-if="terminalPhoto.length > 0" > +
@@ -99,7 +100,6 @@ type="date" placeholder="选择日期" format="yyyy 年 MM 月 dd 日" - value-format="timestamp" :picker-options="pickerOptions" @change="changedate" :clearable="false" @@ -132,9 +132,107 @@
+
+

操作项

+
+ + + 主动拍照 + + + {{ + item.alias !== null && item.alias !== "" + ? item.alias + : item.label + }} + + + + + 主动录像 + + + {{ + item.alias !== null && item.alias !== "" + ? item.alias + : item.label + }} + + + + + 装置信息 + 拍照时间表 + + + + 声光报警 + + + 开启 + 关闭 + + + + + + 线缆显示 + + + 开启 + 关闭 + + + + 获取GPS位置 + + + + GPS开关 + + + 开启GPS + 关闭GPS + + + + 历史图片 +
+
+ + +
@@ -143,13 +241,30 @@ import { getdyTreeListJoggle, getChannelByTermidJoggle, getTerminalPhotoListJoggle, + getTermStatus, + alarmMarkJoggle, + takePicJoggle, + getTakePicPhotoStatusJoggle, + getTakePicStatusJoggle, + setTermGPSJoggle, } from "@/utils/api/index"; import previewContain from "./previewContain.vue"; import carouselChart from "../components/carouselChart.vue"; +import setschedule from "./components/setschedule.vue"; +import infoDialog from "./components/infoDialog.vue"; +import gpsPosition from "./components/gpsPosition.vue"; export default { - components: { previewContain, carouselChart }, + components: { + previewContain, + carouselChart, + setschedule, + infoDialog, + gpsPosition, + }, data() { return { + btnpicloading: false, + btnvideoloading: false, onlinestatus: "", //设备状态啊 onlineNum: "", //在线数 totalNum: "", //装置总数 @@ -165,473 +280,15 @@ export default { currentNodekey: "", //默认选中的节点树, previewData: [], //预览图数据 page: 1, // 当前页数 - pagesize: 16, //当前多少条数据 - total: 0, //总条数 treetimer: null, //轮询状态timer - towerFlag: true, //判断是否是图片list + LineFlag: true, + towerFlag: false, //判断是否是图片list towertitle: "", //装置杆塔信息 - terminalPhoto: [ - { - id: 209654, - termId: 10323, - channelId: 1, - channelName: "通道1", - alias: "白天", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 171068, - photoTime: "2023-07-17T08:00:02.000+00:00", - recvTime: "2023-07-17T07:59:59.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_1_FF_20230717160002.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209646, - termId: 10323, - channelId: 2, - channelName: "通道2", - alias: "黑夜", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 229840, - photoTime: "2023-07-17T07:47:36.000+00:00", - recvTime: "2023-07-17T07:47:33.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_2_FF_20230717154736.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209644, - termId: 10323, - channelId: 1, - channelName: "通道1", - alias: "白天", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 173700, - photoTime: "2023-07-17T07:47:08.000+00:00", - recvTime: "2023-07-17T07:47:03.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_1_FF_20230717154708.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209641, - termId: 10323, - channelId: 2, - channelName: "通道2", - alias: "黑夜", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 231280, - photoTime: "2023-07-17T07:44:32.000+00:00", - recvTime: "2023-07-17T07:44:28.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_2_FF_20230717154432.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209638, - termId: 10323, - channelId: 1, - channelName: "通道1", - alias: "白天", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 200977, - photoTime: "2023-07-17T07:43:34.000+00:00", - recvTime: "2023-07-17T07:43:30.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_1_FF_20230717154334.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209633, - termId: 10323, - channelId: 2, - channelName: "通道2", - alias: "黑夜", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 244618, - photoTime: "2023-07-17T07:38:08.000+00:00", - recvTime: "2023-07-17T07:38:03.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_2_FF_20230717153808.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209632, - termId: 10323, - channelId: 1, - channelName: "通道1", - alias: "白天", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 227006, - photoTime: "2023-07-17T07:37:46.000+00:00", - recvTime: "2023-07-17T07:37:42.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_1_FF_20230717153746.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209631, - termId: 10323, - channelId: 2, - channelName: "通道2", - alias: "黑夜", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 232942, - photoTime: "2023-07-17T07:35:44.000+00:00", - recvTime: "2023-07-17T07:35:40.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_2_FF_20230717153544.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209629, - termId: 10323, - channelId: 1, - channelName: "通道1", - alias: "白天", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 169296, - photoTime: "2023-07-17T07:35:10.000+00:00", - recvTime: "2023-07-17T07:35:06.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_1_FF_20230717153510.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209606, - termId: 10323, - channelId: 1, - channelName: "通道1", - alias: "白天", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 225203, - photoTime: "2023-07-17T07:00:02.000+00:00", - recvTime: "2023-07-17T06:59:57.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_1_FF_20230717150002.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209601, - termId: 10323, - channelId: 1, - channelName: "通道1", - alias: "白天", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 276768, - photoTime: "2023-07-17T06:46:41.000+00:00", - recvTime: "2023-07-17T06:46:37.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_1_FF_20230717144641.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209595, - termId: 10323, - channelId: 1, - channelName: "通道1", - alias: "白天", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 214869, - photoTime: "2023-07-17T06:00:02.000+00:00", - recvTime: "2023-07-17T05:59:58.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_1_FF_20230717140002.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209580, - termId: 10323, - channelId: 1, - channelName: "通道1", - alias: "白天", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 213474, - photoTime: "2023-07-17T05:00:02.000+00:00", - recvTime: "2023-07-17T04:59:58.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_1_FF_20230717130002.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209549, - termId: 10323, - channelId: 1, - channelName: "通道1", - alias: "白天", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 214600, - photoTime: "2023-07-17T04:00:02.000+00:00", - recvTime: "2023-07-17T03:59:58.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_1_FF_20230717120002.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209535, - termId: 10323, - channelId: 1, - channelName: "通道1", - alias: "白天", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 213311, - photoTime: "2023-07-17T03:00:02.000+00:00", - recvTime: "2023-07-17T02:59:58.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_1_FF_20230717110002.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209529, - termId: 10323, - channelId: 1, - channelName: "通道1", - alias: "白天", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 213896, - photoTime: "2023-07-17T02:00:05.000+00:00", - recvTime: "2023-07-17T02:00:01.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_1_FF_20230717100005.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209521, - termId: 10323, - channelId: 1, - channelName: "通道1", - alias: "白天", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 217319, - photoTime: "2023-07-17T01:00:02.000+00:00", - recvTime: "2023-07-17T00:59:58.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_1_FF_20230717090002.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209512, - termId: 10323, - channelId: 1, - channelName: "通道1", - alias: "白天", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 136386, - photoTime: "2023-07-17T00:00:02.000+00:00", - recvTime: "2023-07-16T23:59:58.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_1_FF_20230717080002.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209505, - termId: 10323, - channelId: 1, - channelName: "通道1", - alias: "白天", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 160791, - photoTime: "2023-07-16T23:00:02.000+00:00", - recvTime: "2023-07-16T22:59:58.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_1_FF_20230717070002.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209493, - termId: 10323, - channelId: 2, - channelName: "通道2", - alias: "黑夜", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 1315637, - photoTime: "2023-07-16T22:00:15.000+00:00", - recvTime: "2023-07-16T22:00:11.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_2_FF_20230717060015.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209490, - termId: 10323, - channelId: 1, - channelName: "通道1", - alias: "白天", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 131594, - photoTime: "2023-07-16T22:00:02.000+00:00", - recvTime: "2023-07-16T21:59:58.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_1_FF_20230717060002.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209484, - termId: 10323, - channelId: 2, - channelName: "通道2", - alias: "黑夜", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 164643, - photoTime: "2023-07-16T21:00:02.000+00:00", - recvTime: "2023-07-16T21:00:00.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_2_FF_20230717050002.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209477, - termId: 10323, - channelId: 2, - channelName: "通道2", - alias: "黑夜", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 53881, - photoTime: "2023-07-16T20:00:02.000+00:00", - recvTime: "2023-07-16T19:59:59.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_2_FF_20230717040002.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209470, - termId: 10323, - channelId: 2, - channelName: "通道2", - alias: "黑夜", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 50555, - photoTime: "2023-07-16T19:00:02.000+00:00", - recvTime: "2023-07-16T18:59:59.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_2_FF_20230717030002.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209463, - termId: 10323, - channelId: 2, - channelName: "通道2", - alias: "黑夜", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 902957, - photoTime: "2023-07-16T18:00:02.000+00:00", - recvTime: "2023-07-16T17:59:57.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_2_FF_20230717020002.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209455, - termId: 10323, - channelId: 2, - channelName: "通道2", - alias: "黑夜", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 57962, - photoTime: "2023-07-16T17:00:02.000+00:00", - recvTime: "2023-07-16T16:59:59.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_2_FF_20230717010002.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - { - id: 209449, - termId: 10323, - channelId: 2, - channelName: "通道2", - alias: "黑夜", - presetId: 255, - width: 1920, - height: 1080, - fileSize: 82371, - photoTime: "2023-07-16T16:00:02.000+00:00", - recvTime: "2023-07-16T16:00:00.000+00:00", - path: "http://dev.xinyingpower.com:40080/photos/2023/07/17/00/XYIGQ10D221000100_2_FF_20230717000002.jpg", - thumb: null, - manualRequest: null, - mediaType: 0, - }, - ], //获取装置当前图片数据 + terminalPhoto: [], //获取装置当前图片数据 + nopicPath: require("@/assets/img/nopic.jpg"), + swiperLoading: false, zzCmdid: "", + zztermId: "", dateValue: "", //选择日期 pickerOptions: { disabledDate(date) { @@ -639,7 +296,18 @@ export default { }, }, channelListOption: [], //通道内容 - selectChannelValue: "", //选中的通道 + channelOption: [], //主动拍照通道 + selectChannelValue: null, //选中的通道 + channelId: "", //选中的通道id + btnpicloading: false, //主动拍照按钮loading + requestId: "", //请求拍照返回的requestid + picTime: "", //请求拍照返回的时间 + timer: null, //获取最新图片 + i: 0, //获取最新图片 + CurrentData: "", //历史图片当前选中数据 + + statusNum: 0, //查询下发状态 + statusTimer: null, //查询下发状态 }; }, watch: { @@ -665,6 +333,7 @@ export default { methods: { //获取当前时间 getDateTime() { + console.log(new Date()); this.dateValue = new Date().getTime(); }, //选择时间 @@ -675,22 +344,27 @@ export default { handleNodeClick(data) { console.log(data); this.selectData = data; + this.zztermId = data.id; + this.CurrentData = data; //this.previewData = data; if (data.dyValue) { - this.towerFlag = true; + this.LineFlag = true; + this.towerFlag = false; console.log("电压"); this.type = 1; //this.getPicList(data.id, this.type); - this.$refs.previewRef.getPicList(data.id, this.type); + this.$refs.previewRef.getPicList(data.id, this.type, this.page); } else if (data.bsManufacturer) { - this.towerFlag = true; + this.LineFlag = true; + this.towerFlag = false; console.log("线路"); this.type = 2; - this.$refs.previewRef.getPicList(data.id, this.type); + this.$refs.previewRef.getPicList(data.id, this.type, this.page); //this.getPicList(data.id, this.type); } else { console.log("杆塔"); - this.towerFlag = false; + this.LineFlag = false; + this.towerFlag = true; this.towertitle = data.name; this.zzCmdid = data.cmdid; this.getChannelList(data.id); @@ -731,13 +405,18 @@ export default { this.emptyText = "暂无数据"; this.selectData = this.lineTreeData[0]; //第一个选中的数据 this.currentNodekey = this.lineTreeData[0].id; //第一个数据 + console.log(this.currentNodekey); this.type = 1; this.newCurrentId = this.lineTreeData[0].id; this.previewData = this.lineTreeData[0]; //预览图数据 this.$nextTick(() => { this.$refs.tree.setCurrentKey(this.currentNodekey); //一定要加这个选中了否则样式没有出来 - - this.$refs.previewRef.getPicList(this.currentNodekey, this.type); + this.channelId = this.currentNodekey; + this.$refs.previewRef.getPicList( + this.currentNodekey, + this.type, + this.page + ); }); } }) @@ -753,10 +432,20 @@ export default { console.log(res); this.channelList = res.data.list; console.log(this.channelList); + this.channelOption = []; + this.channelList.forEach((item) => { + this.channelOption.push({ + label: item.channelname, + value: item.channelid, + termid: item.termId, + alias: item.alias, + }); + }); // 选择通道一通道二select框 + console.log(this.channelOption); this.channelListOption = []; this.channelListOption.push({ label: "全部", - value: "-1", + value: -1, termid: "", alias: "", }); @@ -769,17 +458,36 @@ export default { }); }); this.selectChannelValue = this.channelListOption[0].value; //默认选中所有通道 + this.getTerminalPhotoList( + this.selectChannelValue, + this.dateValue, + this.channelList[0].termId + ); //获取图片列表是传当前设备的 id 和termid }) .catch((err) => { console.log(err); //代码错误、请求失败捕获 }); }, //切换通道 - changeChannelId(val) {}, + changeChannelId(val) { + console.log(val); + this.getTerminalPhotoList(val, this.dateValue, this.zztermId); + }, + //选择时间 + changedate() { + console.log(this.dateValue); + console.log(this.zztermId); + this.getTerminalPhotoList( + this.selectChannelValue, + this.dateValue, + this.zztermId + ); + }, //获取图片 getTerminalPhotoList(id, date, termId) { this.terminalPhoto = []; console.log(id, date, termId); + this.swiperLoading = true; getTerminalPhotoListJoggle({ channelid: id, time: date, @@ -787,13 +495,386 @@ export default { }) .then((res) => { console.log(res); - this.terminalPhoto = res.data.list; + this.swiperLoading = false; + if (res.data.list.length == 0) { + this.terminalPhoto = [ + { + path: this.nopicPath, + termId: termId, + mediatype: 0, + }, + ]; + } else { + this.terminalPhoto = res.data.list; + } }) .catch((err) => { console.log(err); //代码错误、请求失败捕获 }); }, + //点击图片列表执行函数 + jumpTowerPic(data) { + console.log("我是从子组件过来的数据"); + console.log(data); + this.LineFlag = false; + this.towerFlag = true; + this.zzCmdid = data.cmdid; + this.towertitle = data.towername; + this.zztermId = data.termid; + this.selectChannelValue = data.channnelname; + this.$refs.tree.setCurrentKey(this.zztermId); //一定要加这个选中了否则样式没有出来 + if (data.photoTime == "" || data.photoTime == null) { + this.getDateTime(); + } else { + this.dateValue = data.photoTime; + } + console.log(this.selectChannelValue); + // this.getChannelList(this.zztermId); + getChannelByTermidJoggle({ termid: this.zztermId }) + .then((res) => { + console.log(res); + this.channelList = res.data.list; + console.log(this.channelList); + this.channelOption = []; + this.channelList.forEach((item) => { + this.channelOption.push({ + label: item.channelname, + value: item.channelid, + termid: item.termId, + alias: item.alias, + }); + }); // 选择通道一通道二select框 + console.log(this.channelOption); + this.channelListOption = []; + this.channelListOption.push({ + label: "全部", + value: -1, + termid: "", + alias: "", + }); + this.channelList.forEach((item) => { + this.channelListOption.push({ + label: item.channelname, + value: item.channelid, + termid: item.termId, + alias: item.alias, + }); + }); + this.selectChannelValue = data.channnelname; + this.getTerminalPhotoList( + data.channelid, + this.dateValue, + this.zztermId + ); //获取图片列表是传当前设备的 id 和termid + }) + .catch((err) => { + console.log(err); //代码错误、请求失败捕获 + }); + //this.getTerminalPhotoList(data.channelid, this.dateValue, this.zztermId); + }, + //主动拍照 + handleCommandpic(command) { + console.log(command); + getTermStatus({ termId: this.zztermId }).then((res) => { + console.log(res); + if (res.data.isonline) { + takePicJoggle({ + captureType: 0, + channel: command, + termId: this.zztermId, + preset: 255, + }) + .then((res) => { + console.log(res); + this.requestId = res.data.requestId; //获取requestid 判断装置是否下发 + this.picTime = res.data.taketime; //获取时间 判断获取最新图片 + console.log(this.requestId); + this.btnpicloading = true; + this.statusTimer = window.setInterval(() => { + this.getTakePicStatus(this.requestId); + this.statusNum++; + }, 2000); + }) + .catch((err) => { + console.log(err); //代码错误、请求失败捕获 + }); + } else { + this.$message({ + duration: 1500, + showClose: true, + message: "装置下线,发送指令失败", + type: "error", + }); + } + }); + }, + //主动拍视频 + handleCommandvideo(command) { + console.log(command); + getTermStatus({ termId: this.zztermId }).then((res) => { + console.log(res); + if (res.data.isonline) { + takePicJoggle({ + captureType: 1, + channel: command, + termId: this.zztermId, + preset: 255, + }) + .then((res) => { + console.log(res); + this.requestId = res.data.requestId; //获取requestid 判断装置是否下发 + this.picTime = res.data.taketime; //获取时间 判断获取最新视频 + console.log(this.requestId); + this.btnvideoloading = true; + this.statusTimer = window.setInterval(() => { + this.getTakePicStatus(this.requestId); + this.statusNum++; + }, 2000); + }) + .catch((err) => { + console.log(err); //代码错误、请求失败捕获 + }); + } else { + this.$message({ + duration: 1500, + showClose: true, + message: "装置下线,发送指令失败", + type: "error", + }); + } + }); + }, + //获取装置是否下发状态 + getTakePicStatus(data) { + console.log(data); + getTakePicStatusJoggle({ + requestid: data, + }) + .then((res) => { + console.log(res); + //res.data 0 状态未知 1 成功 2失败 + if (res.data == 0 && this.statusNum >= 5) { + this.statusNum = 0; + clearInterval(this.statusTimer); + this.statusTimer = null; + this.btnpicloading = false; + this.btnvideoloading = false; + this.$message({ + duration: 1500, + showClose: true, + message: "下发指令超时,请重试!", + type: "warning", + }); + } else if (res.data == 1) { + this.statusNum = 0; + clearInterval(this.statusTimer); + this.statusTimer = null; + this.$message({ + duration: 1500, + showClose: true, + message: "下发指令成功!", + type: "success", + }); + this.timer = window.setInterval(() => { + this.newPicApi(); + this.i++; + }, 8000); + } else if (res.data == 2) { + this.statusNum = 0; + clearInterval(this.statusTimer); + this.statusTimer = null; + this.$message({ + duration: 1500, + showClose: true, + message: "下发指令失败!", + type: "error", + }); + } + }) + .catch((err) => { + console.log(err); //代码错误、请求失败捕获 + }); + }, + //获取最新图片 + newPicApi() { + getTakePicPhotoStatusJoggle({ + photoTime: new Date(this.picTime).getTime(), + termId: this.zztermId, + }).then((res) => { + console.log(res.data); + // // console.log(this.i); + if (res.data == true && this.i < 10) { + console.log(res.data); + this.i = 0; + clearInterval(this.timer); + this.timer = null; + this.btnpicloading = false; + this.btnvideoloading = false; + this.getTerminalPhotoList( + this.selectChannelValue, + this.dateValue, + this.zztermId + ); //获取图片列表是传当前设备的 id 和termid + this.$message({ + duration: 1500, + showClose: true, + message: "已返回最新图片!", + type: "success", + }); + console.log("返回最新图片"); + } else if (res.data == false && this.i > 10) { + this.i = 0; + clearInterval(this.timer); + this.timer = null; + } + }); + }, + //声光报警开启关闭 + handleCommandWarn(command) { + switch (command) { + case "open": //开启 + this.handleWarn(1); + break; + case "close": //关闭 + this.handleWarn(0); + break; + } + }, + //声光报警 + handleWarn(val) { + console.log("声光报警"); + console.log(this.zztermId); + getTermStatus({ termId: this.zztermId }).then((res) => { + console.log(res); + if (res.data.isonline) { + alarmMarkJoggle({ + cmdId: this.zzCmdid, + ctrl: val, + termId: this.zztermId, + }) + .then((res) => { + console.log(res); + if (res.code == 200) { + if (val == 1) { + this.$message({ + duration: 1500, + showClose: true, + message: "声光报警开启成功", + type: "success", + }); + } else { + this.$message({ + duration: 1500, + showClose: true, + message: "声光报警关闭成功", + type: "success", + }); + } + } + }) + .catch((err) => { + this.$message({ + duration: 1500, + showClose: true, + message: "声光报警操作失败", + type: "error", + }); + }); + } else { + this.$message({ + duration: 1500, + showClose: true, + message: "装置下线,发送指令失败", + type: "error", + }); + } + }); + }, + //设置时间表 + handleSetSchedule() { + this.$refs.setschedule_ref.display(); + this.$refs.setschedule_ref.getSingleAccess(this.zztermId, this.zzCmdid); + this.$refs.setschedule_ref.deviceList(); + }, + //线缆显示 + handleCommandLine(command) { + switch (command) { + case "open": //开启 + this.$refs.carouselpic.openline(); + break; + case "close": //关闭 + this.$refs.carouselpic.handelClear(); + break; + } + }, + //装置信息handleShowInfo + handleShowInfo() { + getTermStatus({ termId: this.zztermId }).then((res) => { + console.log(res); + if (res.data.isonline) { + this.$refs.infodialog_ref.display(this.zztermId, this.zzCmdid); + this.$refs.infodialog_ref.getinfo(); + //this.$refs.infodialog_ref.getListData(this.channelId, this.cmdid); + } else { + this.$message({ + duration: 1500, + showClose: true, + message: "装置下线,发送指令失败", + type: "error", + }); + } + }); + }, + //获取GPS位置 + handleShowGPS() { + this.$refs.gpsdialog_ref.display(this.zzCmdid, this.zztermId); + this.$refs.gpsdialog_ref.getgpssql(); + }, + //切换gps开启关闭 + handleCommandGps(command) { + switch (command) { + case "open": //开启 + this.changeGPS(1, this.zzCmdid); + break; + case "close": //关闭 + this.changeGPS(0, this.zzCmdid); + break; + } + }, + changeGPS(val, cmdid) { + console.log(val, cmdid); + setTermGPSJoggle({ gpsstatus: val, cmdId: cmdid }) + .then((res) => { + console.log(res); + if (val == 0) { + this.$message({ + duration: 1500, + message: "GPS已关闭", + type: "warning", + showClose: true, + }); + } else { + this.$message({ + duration: 1500, + message: "成功开启GPS", + type: "success", + showClose: true, + }); + } + }) + .catch((err) => { + console.log(err); //代码错误、请求失败捕获 + }); + }, + handlehistoryPic() { + console.log(this.CurrentData); + this.$router.push({ + path: "/realTimeSearch", + query: { lineName: this.CurrentData }, + }); + // sessionStorage.setItem("keyPath", " realTimeSearch"); + }, //拖拽 dragControllerDiv() { var resize = document.getElementsByClassName("resize"); @@ -839,14 +920,18 @@ export default { }, destroyed() { + //销毁左侧树状图 clearInterval(this.treetimer); this.treetimer = null; + //销毁主动拍照 + clearInterval(this.statusTimer); + this.statusTimer = null; //离开页面是销毁 - // if (this.timer) { - // console.log(this.timer); - // clearInterval(this.timer); - // this.timer = null; - // } //利用vue的生命周期函数 + if (this.timer) { + console.log(this.timer); + clearInterval(this.timer); + this.timer = null; + } //利用vue的生命周期函数 }, }; @@ -955,11 +1040,12 @@ export default { line-height: 32px; color: #fff; font-size: 12px; - background-color: #169e8cb0; + //background-color: #169e8cb0; + background: linear-gradient(180deg, #4cdbc8 10%, #128071 100%); .el-breadcrumb { line-height: 32px; color: #fff !important; - font-size: 12px; + font-size: 14px; height: 32px; .el-breadcrumb__inner, .el-breadcrumb__separator { @@ -979,11 +1065,12 @@ export default { color: #169e8c; font-size: 14px; font-weight: normal; - margin-bottom: 16px; + //margin-bottom: 16px; //background-color: #169e8cb0; } .paramsDate, - .monitorItemBox { + .monitorItemBox, + .setTimebtn { margin-bottom: 16px; position: relative; h3 { @@ -993,8 +1080,28 @@ export default { margin-bottom: 8px; } } + .setTimebtn { + .buttonGroup { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + .el-button { + margin-bottom: 8px; + width: 104px; + } + .el-button + .el-button { + margin-left: 0px; + } + } + } } } } } +.picdropStyle, +.videodropStyle, +.gpsdropStyle { + width: 104px; + margin-top: 0px !important; +} diff --git a/src/views/realTimeMonitor/picIndex.vue b/src/views/realTimeMonitor/picIndex.vue index 29c7f4a..c1876cf 100644 --- a/src/views/realTimeMonitor/picIndex.vue +++ b/src/views/realTimeMonitor/picIndex.vue @@ -375,7 +375,7 @@ export default { console.log(this.zzstatus); this.$nextTick(() => { this.$refs.tree.setCurrentKey(this.currentNodekey); //一定要加这个选中了否则样式没有出来 - this.channelId = this.currentNodekey; + this.getChannelList(this.channelId); //获取通道id接口 }); } diff --git a/src/views/realTimeMonitor/previewContain.vue b/src/views/realTimeMonitor/previewContain.vue index c5df55f..cb16500 100644 --- a/src/views/realTimeMonitor/previewContain.vue +++ b/src/views/realTimeMonitor/previewContain.vue @@ -1,5 +1,5 @@