From f9c19765b1787cf7a78d8aad9604b36477c5ba88 Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Fri, 14 Jul 2023 11:52:11 +0800 Subject: [PATCH 01/45] =?UTF-8?q?=E7=BA=BF=E8=B7=AF=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=9D=86=E5=A1=94=E6=B7=BB=E5=8A=A0=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lineInformation/components/addTowerDialog.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/views/management/userEquipment/lineInformation/components/addTowerDialog.vue b/src/views/management/userEquipment/lineInformation/components/addTowerDialog.vue index e193d72..d970fcf 100644 --- a/src/views/management/userEquipment/lineInformation/components/addTowerDialog.vue +++ b/src/views/management/userEquipment/lineInformation/components/addTowerDialog.vue @@ -24,6 +24,9 @@ + + + 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 @@ diff --git a/src/components/common/devicePixelRatio.js b/src/components/common/devicePixelRatio.js new file mode 100644 index 0000000..d43985e --- /dev/null +++ b/src/components/common/devicePixelRatio.js @@ -0,0 +1,60 @@ +class DevicePixelRatio { + constructor() { + //this.flag = false; + } + //获取系统类型 + _getSystem() { + let flag = false; + var agent = navigator.userAgent.toLowerCase(); + // var isMac = /macintosh|mac os x/i.test(navigator.userAgent); + // if(isMac) { + // return false; + // } + //现只针对windows处理,其它系统暂无该情况,如有,继续在此添加 + if (agent.indexOf("windows") >= 0) { + return true; + } + } + //获取页面缩放比例 + // _getDevicePixelRatio() { + // let t = this; + // } + //监听方法兼容写法 + _addHandler(element, type, handler) { + if (element.addEventListener) { + element.addEventListener(type, handler, false); + } else if (element.attachEvent) { + element.attachEvent("on" + type, handler); + } else { + element["on" + type] = handler; + } + } + //校正浏览器缩放比例 + _correct() { + let t = this; + //页面devicePixelRatio(设备像素比例)变化后,计算页面body标签zoom修改其大小,来抵消devicePixelRatio带来的变化。 + document.getElementsByTagName("body")[0].style.zoom = + 1 / window.devicePixelRatio; + } + //监听页面缩放 + _watch() { + let t = this; + t._addHandler(window, "resize", function () { + //注意这个方法是解决全局有两个window.resize + //重新校正 + t._correct(); + }); + } + //初始化页面比例 + init() { + let t = this; + if (t._getSystem()) { + //判断设备,目前只在windows系统下校正浏览器缩放比例 + //初始化页面校正浏览器缩放比例 + t._correct(); + //开启监听页面缩放 + t._watch(); + } + } +} +export default DevicePixelRatio; diff --git a/src/views/management/userEquipment/lineInformation/components/addTowerDialog.vue b/src/views/management/userEquipment/lineInformation/components/addTowerDialog.vue index d970fcf..bb4cb19 100644 --- a/src/views/management/userEquipment/lineInformation/components/addTowerDialog.vue +++ b/src/views/management/userEquipment/lineInformation/components/addTowerDialog.vue @@ -56,6 +56,9 @@ export default { trigger: "blur", }, ], + address: [ + { required: true, message: "请输入杆塔地址", trigger: "blur" }, + ], }, }; }, diff --git a/src/views/management/userEquipment/towerInformation/components/addDialog.vue b/src/views/management/userEquipment/towerInformation/components/addDialog.vue index 70acec2..bea43b0 100644 --- a/src/views/management/userEquipment/towerInformation/components/addDialog.vue +++ b/src/views/management/userEquipment/towerInformation/components/addDialog.vue @@ -61,6 +61,9 @@ export default { lineId: [ { required: true, message: "请选择线路编号", trigger: "blur" }, ], + address: [ + { required: true, message: "请输入杆塔地址", trigger: "blur" }, + ], order: [{ required: true, message: "请输入排序号", trigger: "blur" }], }, }; diff --git a/src/views/stritl/index.vue b/src/views/stritl/index.vue index b9f38c7..8b12f2f 100644 --- a/src/views/stritl/index.vue +++ b/src/views/stritl/index.vue @@ -26,7 +26,12 @@

装置在线统计

-
+
@@ -44,7 +49,11 @@ >
-
+

告警类型统计

@@ -59,7 +68,11 @@ >
-
+
@@ -91,13 +104,21 @@ export default { pieloading: false, barloading: false, pie2loading: false, + zoom: 1, }; }, + created() { + console.log(window.devicePixelRatio); + }, mounted() { this.getDateTime(); //获取当前时间 this.getTermData(); this.getWeekAlarmStatistics(); this.getTodayAlarmStatistics(); + this.zoom = 1 / document.body.style.zoom; + window.addEventListener("resize", () => { + this.zoom = 1 / document.body.style.zoom; + }); }, watch: { "$store.state.collapse"(val) { @@ -393,6 +414,8 @@ export default { .chartClass { height: calc(100% - 32px); width: 100%; + transform-origin: 0 0; + zoom: 1; } h3 { font-size: 18px; From 1c0bec39d8892fd57afe1472bf49966630eb86e9 Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Mon, 24 Jul 2023 11:38:11 +0800 Subject: [PATCH 15/45] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E4=B8=8B=E5=8F=91?= =?UTF-8?q?=E6=8C=87=E4=BB=A4=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/realTimeMonitor/index.vue | 64 +++++++++++++++++++---------- src/views/stritl/index.vue | 2 +- 2 files changed, 44 insertions(+), 22 deletions(-) diff --git a/src/views/realTimeMonitor/index.vue b/src/views/realTimeMonitor/index.vue index 6397444..51022f9 100644 --- a/src/views/realTimeMonitor/index.vue +++ b/src/views/realTimeMonitor/index.vue @@ -274,6 +274,7 @@ export default { type: "", //选中的类型 lineTreeData: [], filterText: "", + searchName: "", defaultProps: { //指定参数格式回显数据 children: "list", @@ -348,6 +349,7 @@ export default { // }, //点击当前选中的treenode handleNodeClick(data) { + this.clearfun(); console.log(data); this.selectData = data; this.zztermId = data.id; @@ -394,12 +396,17 @@ export default { }); }, //树状图搜索 - filterNode(value, data) { - console.log(value, data); - if (!value) return true; - console.log(data.name); + filterNode(value, data, node) { + console.log(value, data, node); - return data.name.indexOf(value) !== -1; + // 如果什么都没填全部匹配全部返回 + if (!value) return true; + this.searchName = data.name + data.cmdid; + console.log(this.searchName); + // 如果传入的value和data中的label相同,匹配成功 + if (this.searchName.indexOf(value) !== -1) { + return true; + } }, //获取左侧树结构 getLineTreeList() { @@ -509,6 +516,7 @@ export default { }, //获取图片 getTerminalPhotoList(id, date, termId) { + this.clearfun(); this.terminalPhoto = []; console.log(id, date, termId); this.swiperLoading = true; @@ -628,9 +636,10 @@ export default { this.requestId = res.data.requestId; //获取requestid 判断装置是否下发 this.picTime = res.data.taketime; //获取时间 判断获取最新图片 console.log(this.requestId); + console.log(this.picTime); this.btnpicloading = true; this.statusTimer = window.setInterval(() => { - this.getTakePicStatus(this.requestId); + this.getTakePicStatus(res.data); this.statusNum++; }, 2000); }) @@ -650,6 +659,7 @@ export default { //主动拍视频 handleCommandvideo(command) { console.log(command); + this.clearfun(); getTermStatus({ termId: this.zztermId }).then((res) => { console.log(res); if (res.data.isonline) { @@ -689,12 +699,14 @@ export default { getTakePicStatus(data) { console.log(data); getTakePicStatusJoggle({ - requestid: data, + requestid: data.requestId, + termId: this.zztermId, + photoTime: new Date(data.taketime).getTime(), }) .then((res) => { console.log(res); //res.data 0 状态未知 1 成功 2失败 - if (res.data == 0 && this.statusNum >= 5) { + if (res.data.cmaStatus == 0 && this.statusNum >= 5) { this.statusNum = 0; clearInterval(this.statusTimer); this.statusTimer = null; @@ -706,7 +718,7 @@ export default { message: "下发指令超时,请重试!", type: "warning", }); - } else if (res.data == 1) { + } else if (res.data.cmaStatus == 1) { this.statusNum = 0; this.btnpicloading = false; this.btnvideoloading = false; @@ -722,7 +734,7 @@ export default { this.newPicApi(); this.i++; }, 8000); - } else if (res.data == 2) { + } else if (res.data.cmaStatus == 2) { this.statusNum = 0; this.btnpicloading = false; this.btnvideoloading = false; @@ -745,6 +757,7 @@ export default { getTakePicPhotoStatusJoggle({ photoTime: new Date(this.picTime).getTime(), termId: this.zztermId, + requestid: this.requestId, }).then((res) => { console.log(res.data); // // console.log(this.i); @@ -789,6 +802,7 @@ export default { handleWarn(val) { console.log("声光报警"); console.log(this.zztermId); + this.clearfun(); getTermStatus({ termId: this.zztermId }).then((res) => { console.log(res); if (res.data.isonline) { @@ -837,12 +851,14 @@ export default { }, //设置时间表 handleSetSchedule() { + this.clearfun(); this.$refs.setschedule_ref.display(); this.$refs.setschedule_ref.getSingleAccess(this.zztermId, this.zzCmdid); this.$refs.setschedule_ref.deviceList(); }, //线缆显示 handleCommandLine(command) { + this.clearfun(); switch (command) { case "open": //开启 this.$refs.carouselpic.openline(); @@ -854,6 +870,7 @@ export default { }, //装置信息handleShowInfo handleShowInfo() { + this.clearfun(); getTermStatus({ termId: this.zztermId }).then((res) => { console.log(res); if (res.data.isonline) { @@ -872,6 +889,7 @@ export default { }, //获取GPS位置 handleShowGPS() { + this.clearfun(); this.$refs.gpsdialog_ref.display(this.zzCmdid, this.zztermId); this.$refs.gpsdialog_ref.getgpssql(); }, @@ -888,6 +906,7 @@ export default { }, changeGPS(val, cmdid) { console.log(val, cmdid); + this.clearfun(); setTermGPSJoggle({ gpsstatus: val, cmdId: cmdid }) .then((res) => { console.log(res); @@ -942,6 +961,7 @@ export default { }, }); // sessionStorage.setItem("keyPath", " realTimeSearch"); + this.clearfun(); }, //拖拽 dragControllerDiv() { @@ -985,6 +1005,19 @@ export default { }; } }, + clearfun() { + console.log("清除轮询"); + this.statusNum = 0; + this.i = 0; + //销毁主动拍照 + clearInterval(this.statusTimer); + this.statusTimer = null; + if (this.timer) { + console.log(this.timer); + clearInterval(this.timer); + this.timer = null; + } //利用vue的生命周期函数 + }, }, destroyed() { @@ -994,23 +1027,12 @@ export default { //销毁主动拍照 clearInterval(this.statusTimer); this.statusTimer = null; - //离开页面是销毁 if (this.timer) { console.log(this.timer); clearInterval(this.timer); this.timer = null; } //利用vue的生命周期函数 }, - beforeRouteLeave(to, from, next) { - // 路由跳转前,清除轮询 - - next(); - if (this.timer) { - console.log(this.timer); - clearInterval(this.timer); - this.timer = null; - } - }, }; diff --git a/src/views/stritl/index.vue b/src/views/stritl/index.vue index 8b12f2f..bb28980 100644 --- a/src/views/stritl/index.vue +++ b/src/views/stritl/index.vue @@ -142,7 +142,7 @@ export default { // 隐患分类统计 changedate2() { console.log(this.dateValue2.getTime()); - this.dateValue = this.dateValue2.getTime(); + this.dateValue2 = this.dateValue2.getTime(); this.getTodayAlarmStatistics(); }, //获取当前时间 From b56114300f14c1031482d51375516e5f018565ce Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Mon, 24 Jul 2023 13:22:27 +0800 Subject: [PATCH 16/45] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E4=B8=8B=E5=8F=91?= =?UTF-8?q?=E6=8C=87=E4=BB=A4=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/realTimeMonitor/index.vue | 10 +++++++--- vue.config.js | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/views/realTimeMonitor/index.vue b/src/views/realTimeMonitor/index.vue index 51022f9..fe66711 100644 --- a/src/views/realTimeMonitor/index.vue +++ b/src/views/realTimeMonitor/index.vue @@ -641,7 +641,7 @@ export default { this.statusTimer = window.setInterval(() => { this.getTakePicStatus(res.data); this.statusNum++; - }, 2000); + }, 3000); }) .catch((err) => { console.log(err); //代码错误、请求失败捕获 @@ -706,7 +706,11 @@ export default { .then((res) => { console.log(res); //res.data 0 状态未知 1 成功 2失败 - if (res.data.cmaStatus == 0 && this.statusNum >= 5) { + if ( + res.data.cmaStatus == 0 && + res.data.picStatus == false && + this.statusNum >= 5 + ) { this.statusNum = 0; clearInterval(this.statusTimer); this.statusTimer = null; @@ -718,7 +722,7 @@ export default { message: "下发指令超时,请重试!", type: "warning", }); - } else if (res.data.cmaStatus == 1) { + } else if (res.data.cmaStatus == 1 || res.data.picStatus == true) { this.statusNum = 0; this.btnpicloading = false; this.btnvideoloading = false; diff --git a/vue.config.js b/vue.config.js index 0c32024..2d81f4c 100644 --- a/vue.config.js +++ b/vue.config.js @@ -29,7 +29,7 @@ module.exports = defineConfig({ proxy: { "/api": { //表示拦截以/api开头的请求路径 - // target: "http://47.96.238.157:8093", //阿里云服务器环境 + //target: "http://47.96.238.157:8093", //阿里云服务器环境 target: "http://180.166.218.222:40080", //dell changOrigin: true, //是否开启跨域 pathRewrite: { From c93c8bc0cd4bfd6fac9f96846029563fdfe8292f Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Mon, 24 Jul 2023 14:10:40 +0800 Subject: [PATCH 17/45] =?UTF-8?q?=E7=A6=BB=E7=BA=BF=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/fonts/iconfont.css | 10 +++++++++- src/assets/fonts/iconfont.ttf | Bin 4436 -> 5064 bytes src/views/realTimeMonitor/index.vue | 9 ++++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/assets/fonts/iconfont.css b/src/assets/fonts/iconfont.css index e5912cc..fc2555f 100644 --- a/src/assets/fonts/iconfont.css +++ b/src/assets/fonts/iconfont.css @@ -1,6 +1,6 @@ @font-face { font-family: "iconfont"; /* Project id */ - src: url('iconfont.ttf?t=1683175912652') format('truetype'); + src: url('iconfont.ttf?t=1690177575312') format('truetype'); } .iconfont { @@ -23,10 +23,18 @@ content: "\e791"; } +.icon-shexiangtoulixian:before { + content: "\e7b2"; +} + .icon-video-camera:before { content: "\e962"; } +.icon-shexiangtou-lixian:before { + content: "\ef1c"; +} + .icon-shudianxianlu_2722010801:before { content: "\efed"; } diff --git a/src/assets/fonts/iconfont.ttf b/src/assets/fonts/iconfont.ttf index 6cd3db663b9162ee6bedb18cdd040a67c21094c1..0dcedeb086e854a22642d4b1626cb1866ae02eeb 100644 GIT binary patch delta 1096 zcmZuwL2MIO5S^L-_wN!LJ5Dxh5W!CDWKAU}I40OgfKy_n2pUzD5TfExWQd6)B{3p) z8zO{hfzVb(N=PLR99zMqhm@!{4nedMm$sLlDkLH*#X@SD9!k{%wL9OY6_xtGX8z2Z zc{BTGcYlmLiY+86`L74=1CSR0e;=Q`aQ3SAi3dR10N&+7J~!4={q`^btg)mD447-; zBet0XJ%y>#Y!@5M{e@N6WbsU{<&p6X^EKEum76_>gEY_aZ8|=ko65I-eqb4(m2+tP zTybV=>DIC5j{(}_oN#;besstJWRvBGFaOwn%75TFcpBAU?dR3I9C>-xFG~~`*|mT) z%1iUCr4X*)Bzcp9m4yZZ@Ck^973Z^s(-!#g-sRj@-U48~fBi^xv3l>>>CMi~je7n6 z5MBP?g$<@=H@EIgTuFif3QTsD&Rx1jFWUIz(efH=XaI9*LAbA1?*VAhgL-zlDa?k= z&Zcl3*xYD}uE^^S{D!0WD_x>>_0Gyq;x<*7P+t`f#0l;ZgHbpEXSsPYgtiYO{WzFG zBaBWM_oP!{RDM)uw8Qpe#Ek_8(+2x?7)`B0ID|nbIfNP9jcKjih#zBa1f8HVd)?hQ zm}(EA8;!8n&&e62)i)~Tk&*JJTGc!_N{Gk1NoJ*t3-zHGC4N7+f$f5_!-8yKiR>_0 z(iX@DtACK%t}i~YeRVJp#m7YceFw7_`)UuB6m!y#t1mlnn_cKbF`JRt=kXpj@CuDk zhzREdp64$AE&pmi-5;IO$sIetlIjQ&c3^GZNhQ~$Pkpb9m6Gbl3V#Rns(311gB=iu zLjb*d`PQ!L2-wbkOs5Xw9v)AMAwTsp&ckzp$Rnea+Z(jm+>h);O%;u~=$h!D9)Tcw zQ(iV@O317b*iF-a-B7K@oRo^v##Y03*TffpqI#Rc(&%ZCK?l2BX${vrgiqd=d}E^8 zJc$sBE9#^aaU#lG#Rrni@08!D6@~OHs`ll>rct{tti;~!ohperq?OOisVxDEZ!1uu zfeKBuaLbY}(D_zirjVbV$W4!zisi`(ZF%3D7|R#?&hYY5S`ikGVv}6Ns}T-(4dWqh*$-+Rf0djLb-gH6Y@n&!U+MbEXA;;HX>N1 z2n0kVSVz>(GR4_MB8F&TC&al^5odWjZ)V?{UA8^-IDS00e{@~H0$?Hlw$qut?VFtE z5Cu*jb9y%AJC8Q#$fP^dh5W8o((aZX0DKk+inZ3nvJ6O+u+S)PYq*NWJ*q!aJKG%BjL4P;| z_+QyWoj_9mF8dxvvqX@H%KVId@&;49s-ukkI3!*dCL_H#fDIDEp#KfqMsWde7{iXV u-t>zntog2lvH9f6xHK6V3Mit4GAevC5Yp7jPBN9BNzm^VbzTpI5WWC6No3Rj diff --git a/src/views/realTimeMonitor/index.vue b/src/views/realTimeMonitor/index.vue index fe66711..37c20f3 100644 --- a/src/views/realTimeMonitor/index.vue +++ b/src/views/realTimeMonitor/index.vue @@ -50,7 +50,14 @@ + From 6b56d3010ab9658e47a90fd598a7d082773aee10 Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Mon, 24 Jul 2023 14:21:58 +0800 Subject: [PATCH 18/45] =?UTF-8?q?=E7=82=B9=E5=87=BB=E7=9C=8B=E5=A4=A7?= =?UTF-8?q?=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/components/carouselChart.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/views/components/carouselChart.vue b/src/views/components/carouselChart.vue index 591983c..e9a6818 100644 --- a/src/views/components/carouselChart.vue +++ b/src/views/components/carouselChart.vue @@ -268,13 +268,19 @@ export default { methods: { showbigpicPath(data) { console.log(data); - this.bigPicPath = data.substring(0, data.length - 9); + if (data.includes("!")) { + this.bigPicPath = data.substring(0, data.length - 9); + } else { + this.bigPicPath = data; + } + console.log(this.bigPicPath); }, handleBigPicbox() { this.showBigpic = true; }, - closePic() { + closePic(data) { + console.log(data); this.showBigpic = false; }, openline() { From 2b332d2f8f9d608b5b18d2044598b64a566f22a9 Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Mon, 24 Jul 2023 16:25:35 +0800 Subject: [PATCH 19/45] =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E8=A3=85=E7=BD=AE?= =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/stritl/index.vue | 115 +++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) diff --git a/src/views/stritl/index.vue b/src/views/stritl/index.vue index bb28980..7e0cbcc 100644 --- a/src/views/stritl/index.vue +++ b/src/views/stritl/index.vue @@ -3,6 +3,12 @@

装置数量统计

+ 查看

@@ -75,6 +81,34 @@ >

+ +
+ 导出 + + + + + +
+
+ diff --git a/src/views/alarmHandling/index.vue b/src/views/alarmHandling/index.vue index 4a8fd15..4769640 100644 --- a/src/views/alarmHandling/index.vue +++ b/src/views/alarmHandling/index.vue @@ -37,6 +37,16 @@ > + + + + + -
-
+
+ + + +
-
-

- {{ item.lineName }} / - {{ - item.displayName !== null && item.displayName !== "" - ? item.displayName - : item.cmdid - }} - / - {{ - item.alias !== null && item.alias !== "" - ? item.alias - : item.channnelName - }} - / 告警原因:({{ item.enname }}) + [已读] + [未读] + + {{ item.lineName }} / + {{ + item.displayName !== null && item.displayName !== "" + ? item.displayName + : item.cmdid + }} + / + {{ + item.alias !== null && item.alias !== "" + ? item.alias + : item.channnelName + }} +

- 告警时间:{{ + {{ $moment(item.alarmTime).format("YYYY-MM-DD HH:mm:ss") - }} - 主动拍照 - 历史图片 + }} + ({{ item.enname }})

-
+
@@ -372,8 +382,10 @@ export default { dyOptions: [{ id: -1, name: "全部" }], //电压数据 xlOptions: [{ id: -1, name: "全部" }], //线路数据 gtOptions: [{ id: -1, name: "全部" }], //杆塔数据 + tdOptions: [{ id: -1, name: "全部", alias: null }], //通道数据 gjOptions: [{ id: -1, label: -1, name: "全部" }], //告警数据 formdata: { + channel: 1, dyId: -1, lineId: -1, towerId: -1, @@ -548,9 +560,14 @@ export default { .then((res) => { this.gjOptions = [{ id: -1, label: -1, name: "全部" }]; this.gjOptions = this.gjOptions.concat(res.data.list); + this.tdOptions = [{ id: -1, name: "全部", alias: null }]; + this.tdOptions = this.tdOptions.concat(res.data.channellist); + console.log(this.tdOptions); console.log(this.gjOptions); this.formdata.label = this.gjOptions[0].label; + this.formdata.channel = this.tdOptions[1].id; console.log(this.formdata.label); + console.log(this.formdata.channel); }) .catch((err) => {}); }, @@ -822,9 +839,9 @@ export default { console.log(this.requestId); this.btnpicloading = true; this.statusTimer = window.setInterval(() => { - this.getTakePicStatus(this.requestId); + this.getTakePicStatus(res.data); this.statusNum++; - }, 2000); + }, 3000); }) .catch((err) => { console.log(err); //代码错误、请求失败捕获 @@ -843,12 +860,18 @@ export default { getTakePicStatus(data) { console.log(data); getTakePicStatusJoggle({ - requestid: data, + requestid: data.requestId, + termId: this.selectRow.termId, + photoTime: new Date(data.taketime).getTime(), }) .then((res) => { console.log(res); //res.data 0 状态未知 1 成功 2失败 - if (res.data == 0 && this.statusNum >= 5) { + if ( + res.data.cmaStatus == 0 && + res.data.picStatus == false && + this.statusNum >= 5 + ) { this.statusNum = 0; clearInterval(this.statusTimer); this.statusTimer = null; @@ -860,16 +883,16 @@ export default { message: "下发指令超时,请重试!", type: "warning", }); - } else if (res.data == 1) { - this.statusNum = 0; - clearInterval(this.statusTimer); - this.statusTimer = null; + } else if (res.data.cmaStatus == 1 || res.data.picStatus == true) { this.$message({ duration: 1500, showClose: true, message: "下发指令成功!", type: "success", }); + this.statusNum = 0; + clearInterval(this.statusTimer); + this.statusTimer = null; this.timer = window.setInterval(() => { this.newPicApi(); this.i++; @@ -895,6 +918,7 @@ export default { getTakePicPhotoStatusJoggle({ photoTime: new Date(this.picTime).getTime(), termId: this.selectRow.termId, + requestid: this.requestId, }).then((res) => { console.log(res.data); if (res.data == true && this.i < 10) { @@ -957,11 +981,26 @@ export default { console.log(val); this.bigPhotoPic = val.path; this.showBigpic = true; - this.$nextTick(() => { console.log("huatu"); this.drawlineList(val, index); }); + //未读变已读 + if (val.isread == 0) { + setTimeout(function () { + readAlarm({ + id: val.id, + }) + .then((res) => { + console.log(res); + val.isread = 1; + console.log(val.isread); + }) + .catch((err) => { + console.log(err); + }); + }, 300); + } } }, dateFormat(row, column) { @@ -1096,7 +1135,7 @@ export default { background-color: rgba(18, 128, 113, 0.2); } .readbox { - color: #e49e61; + color: #169e8c; } } .pageNation { @@ -1166,34 +1205,36 @@ export default { margin: auto; } .piclist { - display: flex; - // justify-content: space-around; - flex-wrap: wrap; + // display: flex; + // // justify-content: space-around; + // flex-wrap: wrap; overflow: auto; border: 1px solid #eee; height: calc(100% - 2px); } .imgList { - width: calc((100% - 104px) / 3); + width: calc((100% - 40px) / 4); position: relative; display: inline-block; - margin: 8px; + margin: 2px; position: relative; - padding: 4px; border-radius: 3px; background: #fff; - height: fit-content; - //height: auto; + height: 30%; border: 2px solid transparent; - .el-card__body { - padding: 0px; - } .bigpic { width: 100%; height: 100%; background-size: 100% 100%; + position: relative; .picshow { position: relative; + height: 100%; + img { + cursor: pointer; + width: 100%; + height: 100%; + } .myCanvas { position: absolute; width: 100%; @@ -1204,48 +1245,65 @@ export default { pointer-events: none; } } - } - img { - cursor: pointer; - width: 100%; - height: 250px; - object-fit: fill; - } - - .caption { - padding: 9px; - color: #333; - .alarmInfo { - color: #e49e61; - } - .infoTop { - font-size: 14px; - color: #000; - font-weight: normal; - margin-top: 2px; - padding-left: 5px; - padding-right: 5px; - } - .infoBottom { - color: #000; - font-size: 12px; - font-weight: normal; - margin-top: 6px; - padding-left: 5px; - padding-right: 5px; - .el-button--small { - margin-left: 24px; - padding: 4px; - width: 78px; + .caption { + padding: 6px; + color: #fff; + position: absolute; + left: 0; + bottom: 0px; + background: rgba(0, 0, 0, 0.5); + width: calc(100% - 12px); + .alarmInfo { + color: #fff; } - .el-button + .el-button { - margin-left: 10px; + .infoTop { + font-size: 14px; + color: #fff; + font-weight: normal; + margin-top: 2px; + padding-left: 5px; + padding-right: 5px; + .readbox { + color: #169e8c; + } + } + .infoBottom { + color: #fff; + font-size: 12px; + font-weight: normal; + margin-top: 6px; + padding-left: 5px; + padding-right: 5px; + display: flex; + justify-content: space-between; + .el-button--small { + margin-left: 24px; + padding: 4px; + width: 78px; + } + .el-button + .el-button { + margin-left: 10px; + } + } + } + .toolsBtn { + position: absolute; + right: 4px; + top: 4px; + z-index: 2; + .el-button { + width: auto; + background: rgba(0, 0, 0, 0.5); + border: 1px solid transparent; + color: #fff; + font-size: 20px; + padding: 2px; } } } } .bgColor { - border: 2px solid #e49e61; + border: 2px solid #169e8c; } } } diff --git a/src/views/stritl/index.vue b/src/views/stritl/index.vue index 7e0cbcc..84751c7 100644 --- a/src/views/stritl/index.vue +++ b/src/views/stritl/index.vue @@ -298,6 +298,7 @@ export default { // title: { // text: "装置在线统计", // }, + color: ["#169e8c", "#bbb"], tooltip: { trigger: "item", }, From 3b50cf87c00623da2eb641664b23ca9e70048a6f Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Tue, 25 Jul 2023 10:58:23 +0800 Subject: [PATCH 21/45] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/alarmHandling/index.vue | 139 ++++++++++++++---------------- 1 file changed, 63 insertions(+), 76 deletions(-) diff --git a/src/views/alarmHandling/index.vue b/src/views/alarmHandling/index.vue index 4769640..776959a 100644 --- a/src/views/alarmHandling/index.vue +++ b/src/views/alarmHandling/index.vue @@ -271,18 +271,19 @@ icon="el-icon-picture-outline" @click.stop="handlePicHistory(item)" > -
-
- +
+ +

@@ -337,8 +338,14 @@ :style="{ transform: 'scale(' + zoomD + ')' }" @mousedown="move" > - - + +

@@ -510,12 +517,13 @@ export default { this.canvasloading = true; this.canvansdata = val; if (val.path !== "" && this.tableData.length !== 0) { - console.log(val); this.bigPhotoPic = val.path; this.showBigpic = true; - this.$nextTick(() => { - this.drawline2(val); - }); + setTimeout(() => { + this.$nextTick(() => { + this.drawline2(val); + }); + }, 100); } }, closePic() { @@ -586,8 +594,17 @@ export default { this.photoPic = res.data.list[0].path; this.selectRow = res.data.list[0]; console.log(this.selectRow); - this.$refs.multipleTable.setCurrentRow(this.selectRow); - this.handleRowClick(this.selectRow); + + if (this.tableShow) { + this.$nextTick(() => { + this.$refs.multipleTable.setCurrentRow(this.selectRow); + this.handleRowClick(this.selectRow); + }); + } else { + this.$nextTick(() => { + this.drawlineListAll(this.tableData); + }); + } }) .catch((err) => { console.log(err); @@ -662,9 +679,12 @@ export default { //绘制大图告警区域 drawline2(data) { console.log(data); + console.log(document.getElementById("bigCanvas")); + console.log(document.getElementById("bigimg")); + this.canvas = document.getElementById("bigCanvas"); + this.imgpic = document.getElementById("bigimg"); console.log(this.canvas); - this.canvas = this.$refs.myCanvasbig; - this.imgpic = this.$refs.picJpg; + console.log(this.imgpic); this.textInfo = data.enname; this.canvas.width = this.imgpic.offsetWidth; //设置画布大小 this.canvas.height = this.imgpic.offsetHeight; //设置画布大小 @@ -688,7 +708,7 @@ export default { // this.ctx.strokeStyle = "red"; //线的颜色 this.ctx.strokeRect(top, left, width, height); //绘制路径矩形 //this.ctx.strokeRect(data.x, data.y, data.width, data.height); - this.ctx.font = "12px normal"; + this.ctx.font = "14px normal"; this.ctx.fillStyle = "#ff0000"; //this.ctx.fillText(this.textInfo, top, left + 24); //距离上面有空间 @@ -700,14 +720,15 @@ export default { this.ctx.closePath(); this.ctx.stroke(); }, + //绘制所有的图片告警区域 drawlineListAll(val) { for (let i = 0; i < val.length; i++) { console.log(i); - console.log(this.$refs.myCanvas); - console.log(this.$refs.picJpg); - this.canvas = this.$refs.myCanvas; - this.imgpic = this.$refs.picJpg; + console.log(document.getElementById("canvas_" + i)); + console.log(document.getElementById("img" + i)); + this.canvas = document.getElementById("canvas_" + i); + this.imgpic = document.getElementById("img" + i); this.textInfo = val[i].enname; console.log(this.textInfo); console.log(this.imgpic.offsetWidth); @@ -747,49 +768,7 @@ export default { this.ctx.stroke(); } }, - //绘制列表大图 - drawlineList(data, index) { - console.log(data); - console.log(this.$refs.myCanvasbig); - console.log(this.$refs.picJpg); - console.log("picJpg" + index); - this.canvas = this.$refs.myCanvasbig; - this.imgpic = this.$refs.picJpg; - this.textInfo = data.enname; - this.canvas.width = this.imgpic[index].offsetWidth; //设置画布大小 - this.canvas.height = this.imgpic[index].offsetHeight; //设置画布大小 - console.log(this.canvas.width, this.canvas.height); - this.ctx = this.canvas.getContext("2d"); - this.ctx.beginPath(); - //设置线条颜色,必须放在绘制之前 - this.ctx.strokeStyle = "#ff0000"; - // 线宽设置,必须放在绘制之前 - this.ctx.lineWidth = 1; - // 绘制矩形 - var scaleX = this.canvas.width / data.photoWidth, //this.iw图片的宽 - scaleY = this.canvas.height / data.photoHeight; //this.ih图片的高 - console.log(scaleX, scaleY); - var top = data.x * scaleX, - left = data.y * scaleY, - width = data.width * scaleX, - height = data.height * scaleY; - console.log(top, left, width, height); - // this.ctx.strokeStyle = "red"; //线的颜色 - this.ctx.strokeRect(top, left, width, height); //绘制路径矩形 - //this.ctx.strokeRect(data.x, data.y, data.width, data.height); - this.ctx.font = "12px normal"; - this.ctx.fillStyle = "#ff0000"; - //this.ctx.fillText(this.textInfo, top, left + 24); - //距离上面有空间 - if (left > 32) { - this.ctx.fillText(this.textInfo, top, left - 4); - } else if (this.canvas.height - left + height > 32) { - this.ctx.fillText(this.textInfo, top, height - 4); - } - this.ctx.closePath(); - this.ctx.stroke(); - }, //点击当前行 handleRowClick(row) { //this.$refs.multipleTable.toggleRowSelection(row); @@ -814,7 +793,6 @@ export default { }); }, 300); } - this.$nextTick(() => { this.drawline(row); this.imgOnload(); @@ -957,7 +935,14 @@ export default { this.tableShow = !this.tableShow; this.zoomD = 1; if (!this.tableShow) { - this.drawlineListAll(this.tableData); + this.$nextTick(() => { + this.drawlineListAll(this.tableData); + }); + } else { + this.$nextTick(() => { + this.$refs.multipleTable.setCurrentRow(this.selectRow); + this.handleRowClick(this.selectRow); + }); } }, @@ -975,16 +960,18 @@ export default { handlePicAlarm(val, index) { console.log(val, index); this.current = index; - this.canvansdata = val; this.canvasloading = true; + this.canvansdata = val; if (val.path !== "" && this.tableData.length !== 0) { console.log(val); this.bigPhotoPic = val.path; this.showBigpic = true; - this.$nextTick(() => { - console.log("huatu"); - this.drawlineList(val, index); - }); + setTimeout(() => { + this.$nextTick(() => { + this.drawline2(val); + }); + }, 100); + //未读变已读 if (val.isread == 0) { setTimeout(function () { @@ -1235,7 +1222,7 @@ export default { width: 100%; height: 100%; } - .myCanvas { + .canvasAll { position: absolute; width: 100%; height: 100%; From 6fd01caea5136f8bb13c0692ecad4c705e148d7c Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Tue, 25 Jul 2023 11:53:13 +0800 Subject: [PATCH 22/45] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E8=A3=85=E7=BD=AE?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E7=BB=9F=E8=AE=A1=EF=BC=8Cexcle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/api/index.js | 18 ++ src/views/stritl/index copy.vue | 502 -------------------------------- src/views/stritl/index.vue | 113 +++---- 3 files changed, 54 insertions(+), 579 deletions(-) delete mode 100644 src/views/stritl/index copy.vue diff --git a/src/utils/api/index.js b/src/utils/api/index.js index 6357008..b70088e 100644 --- a/src/utils/api/index.js +++ b/src/utils/api/index.js @@ -774,3 +774,21 @@ export function getTerminalListExcel() { responseType: "blob", }); } + +//首页查看数据 + +export function getOnlineTerminalList(data) { + return request({ + url: "/api/getOnlineTerminalList", + method: "get", + params: data, + }); +} +//导出数据 +export function getOnlineTerminalListExcel() { + return request({ + url: "/api/getOnlineTerminalListExcel", + method: "post", + responseType: "blob", + }); +} diff --git a/src/views/stritl/index copy.vue b/src/views/stritl/index copy.vue deleted file mode 100644 index e95bac0..0000000 --- a/src/views/stritl/index copy.vue +++ /dev/null @@ -1,502 +0,0 @@ - - - - - diff --git a/src/views/stritl/index.vue b/src/views/stritl/index.vue index 84751c7..361da14 100644 --- a/src/views/stritl/index.vue +++ b/src/views/stritl/index.vue @@ -3,10 +3,7 @@

装置数量统计

- 查看
@@ -84,28 +81,31 @@ -
- 导出 +
+ 导出 + + + - +
@@ -116,6 +116,8 @@ import { getTermStatistics, getWeekAlarmStatistics, getTodayAlarmStatistics, + getOnlineTerminalList, + getOnlineTerminalListExcel, } from "@/utils/api/index"; export default { name: "", @@ -140,68 +142,8 @@ export default { pie2loading: false, zoom: 1, dialogTableVisible: false, - gridData: [ - { - date: "2016-05-02", - name: "王小虎", - address: "上海市普陀区金沙江路 1518 弄", - }, - { - date: "2016-05-04", - name: "王小虎", - address: "上海市普陀区金沙江路 1518 弄", - }, - { - date: "2016-05-01", - name: "王小虎", - address: "上海市普陀区金沙江路 1518 弄", - }, - { - date: "2016-05-03", - name: "王小虎", - address: "上海市普陀区金沙江路 1518 弄", - }, - { - date: "2016-05-02", - name: "王小虎", - address: "上海市普陀区金沙江路 1518 弄", - }, - { - date: "2016-05-04", - name: "王小虎", - address: "上海市普陀区金沙江路 1518 弄", - }, - { - date: "2016-05-01", - name: "王小虎", - address: "上海市普陀区金沙江路 1518 弄", - }, - { - date: "2016-05-03", - name: "王小虎", - address: "上海市普陀区金沙江路 1518 弄", - }, - { - date: "2016-05-02", - name: "王小虎", - address: "上海市普陀区金沙江路 1518 弄", - }, - { - date: "2016-05-04", - name: "王小虎", - address: "上海市普陀区金沙江路 1518 弄", - }, - { - date: "2016-05-01", - name: "王小虎", - address: "上海市普陀区金沙江路 1518 弄", - }, - { - date: "2016-05-03", - name: "王小虎", - address: "上海市普陀区金沙江路 1518 弄", - }, - ], + onLineData: [], + exportLoading: false, }; }, created() { @@ -230,6 +172,23 @@ export default { }, }, methods: { + //查看在线列表 + handleLook() { + this.dialogTableVisible = true; + this.exportLoading = true; + getOnlineTerminalList() + .then((res) => { + console.log(res); + this.onLineData = res.data; + this.exportLoading = false; + console.log(this.onLineData); + }) + .catch((err) => {}); + }, + //导出 + handleExport() { + window.location.href = "/api/api/getOnlineTerminalListExcel"; + }, // 隐患数量统计 changedate() { console.log(this.dateValue.getTime()); From 9399138d371945a541a9907898b09bae8c210bb0 Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Tue, 25 Jul 2023 13:50:07 +0800 Subject: [PATCH 23/45] =?UTF-8?q?=E6=8E=A7=E5=88=B6=E9=80=9A=E9=81=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/api/index.js | 11 +++++++ src/views/alarmHandling/index.vue | 19 ++--------- src/views/system/globalTools/index.vue | 45 +++++++++++++++++++++++++- 3 files changed, 57 insertions(+), 18 deletions(-) diff --git a/src/utils/api/index.js b/src/utils/api/index.js index b70088e..6880bc0 100644 --- a/src/utils/api/index.js +++ b/src/utils/api/index.js @@ -752,7 +752,18 @@ export function updateMarkEnableStatus(data) { }, }); } +//全局设置通道 +export function updateAlarmChannel(data) { + return request({ + url: "/api/updateAlarmChannel", + method: "post", + data, + headers: { + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + }, + }); +} ///api/getTermStatus export function getTermStatus(data) { return request({ diff --git a/src/views/alarmHandling/index.vue b/src/views/alarmHandling/index.vue index 776959a..0286948 100644 --- a/src/views/alarmHandling/index.vue +++ b/src/views/alarmHandling/index.vue @@ -37,16 +37,7 @@ > - - - - - +
4) { @@ -406,6 +412,7 @@ export default { this.activeSmall = index; this.mediaType = row.mediaType; this.bigPicPath = row.path + "!1366x768"; + this.bgbigPath = row.path + "!1366x768"; getCoordinate({ channelId: row.channelId, needPic: "1", @@ -570,6 +577,9 @@ export default { position: absolute; z-index: 3; opacity: 0; + .animImg { + opacity: 0; + } } .mark { position: absolute; diff --git a/src/views/realTimeMonitor/index.vue b/src/views/realTimeMonitor/index.vue index 37c20f3..f0e212d 100644 --- a/src/views/realTimeMonitor/index.vue +++ b/src/views/realTimeMonitor/index.vue @@ -466,41 +466,46 @@ export default { .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) => { + if (this.channelList.length == 0) { + console.log("没有通道"); + this.getTerminalPhotoList(-1, this.dateValue, this.zztermId); //获取图片列表是传当前设备的 id 和termid + } else { + 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: item.channelname, - value: item.channelid, - termid: item.termId, - alias: item.alias, + label: "全部", + value: -1, + termid: "", + alias: "", }); - }); - this.selectChannelValue = this.channelListOption[0].value; //默认选中所有通道 - this.getTerminalPhotoList( - this.selectChannelValue, - this.dateValue, - this.channelList[0].termId - ); //获取图片列表是传当前设备的 id 和termid - this.selectDyId = res.data.dyId; - this.selectLineId = res.data.lineId; - this.selectTowerId = res.data.towerId; + this.channelList.forEach((item) => { + this.channelListOption.push({ + label: item.channelname, + value: item.channelid, + termid: item.termId, + alias: item.alias, + }); + }); + this.selectChannelValue = this.channelListOption[0].value; //默认选中所有通道 + this.getTerminalPhotoList( + this.selectChannelValue, + this.dateValue, + this.channelList[0].termId + ); //获取图片列表是传当前设备的 id 和termid + this.selectDyId = res.data.dyId; + this.selectLineId = res.data.lineId; + this.selectTowerId = res.data.towerId; + } }) .catch((err) => { console.log(err); //代码错误、请求失败捕获 diff --git a/src/views/stritl/index.vue b/src/views/stritl/index.vue index b4327a5..2c4a8ec 100644 --- a/src/views/stritl/index.vue +++ b/src/views/stritl/index.vue @@ -3,12 +3,12 @@

装置数量统计

- 查看 + > -->
-

+

装置总数 {{ termDataNum.totalNum }}

@@ -47,11 +47,7 @@ >
-
+

告警类型统计

@@ -66,11 +62,7 @@ >
-
+
{ - return this.$moment(x.date).format("yy-MM-DD"); + return this.$moment(x.date).format("MM-DD"); }), axisTick: { alignWithLabel: true, @@ -489,6 +491,12 @@ export default { flex-direction: column; justify-content: space-around; box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); + &:first-child { + &:hover { + cursor: pointer; + } + } + span { color: #333; font-size: 16px; From 94645bad0e47b79937765ec02b12a3c2dcf56b78 Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Wed, 26 Jul 2023 09:28:00 +0800 Subject: [PATCH 27/45] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E5=A4=A7=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/components/carouselChart.vue | 289 ++++++++++++++++--------- 1 file changed, 187 insertions(+), 102 deletions(-) diff --git a/src/views/components/carouselChart.vue b/src/views/components/carouselChart.vue index 93be162..c942e4e 100644 --- a/src/views/components/carouselChart.vue +++ b/src/views/components/carouselChart.vue @@ -8,23 +8,16 @@ bigPicPath.indexOf('nopic') == -1 && bigPicPath.indexOf('videos') == -1 " - :style="bigPicPath ? 'backgroundImage:url(' + bgbigPath + ')' : ''" + :style="bigPicPath ? 'backgroundImage:url(' + bigPicPath + ')' : ''" > - +
-
- +
+
-
@@ -45,28 +38,6 @@ />
-
-
- -
-
- -
-
@@ -182,6 +153,30 @@
+ + +
+
+ + +
+
+ +
+
@@ -228,13 +223,16 @@ export default { showBigpic: false, flagline: true, markEnable: "", + zoomD: 1, + canvasloading: false, + bigImgPath: "", }; }, mounted() { console.log(this.terminalPhoto); this.mediaType = this.terminalPhoto[0].mediaType; this.bigPicPath = this.terminalPhoto[0].path + "!1366x768"; - this.bgbigPath = this.terminalPhoto[0].path + "!1366x768"; + // this.bigPicPath = this.terminalPhoto[0].path + "!1366x768"; this.fiveList = this.terminalPhoto.slice(this.page - 1, this.pagesize); this.total = this.terminalPhoto.length / this.pagesize; @@ -261,26 +259,97 @@ export default { watch: { terminalPhoto: function (newVal, oldVal) { this.bigPicPath = this.terminalPhoto[0].path + "!1366x768"; - this.bgbigPath = this.terminalPhoto[0].path + "!1366x768"; + this.fiveList = this.terminalPhoto.slice(this.page - 1, this.pagesize); this.total = this.terminalPhoto.length / this.pagesize; }, }, created() {}, methods: { - showbigpicPath(data) { - console.log(data); - if (data.includes("!")) { - this.bigPicPath = data.substring(0, data.length - 9); + // showbigpicPath(data) { + // console.log(data); + // if (data.includes("!")) { + // this.bigPicPath = data.substring(0, data.length - 9); + // } else { + // this.bigPicPath = data; + // this.bgbigPath = data; + // } + + // console.log(this.bigPicPath); + // }, + // handleBigPicbox() { + // this.showBigpic = true; + // }, + //移动demo + move(e) { + console.log(e); + e.preventDefault(); + // 获取元素 + var personBox = document.querySelector(".picboxI"); + var img = document.querySelector(".img"); + var x = e.pageX - img.offsetLeft; + var y = e.pageY - img.offsetTop; + // 添加鼠标移动事件 + personBox.addEventListener("mousemove", move); + console.log(personBox.addEventListener("mousemove", move)); + console.log(personBox.style); + function move(e) { + console.log(personBox.style.left); + personBox.style.left = e.pageX - x + "px"; + personBox.style.top = e.pageY - y + "px"; + } + // 添加鼠标抬起事件,鼠标抬起,将事件移除 + img.addEventListener("mouseup", function () { + personBox.removeEventListener("mousemove", move); + }); + // 鼠标离开父级元素,把事件移除 + personBox.addEventListener("mouseout", function () { + personBox.removeEventListener("mousemove", move); + }); + }, + // 缩放图片 + rollImg(e) { + let direction = e.deltaY > 0 ? "down" : "up"; + if (direction === "up") { + // 滑轮向上滚动 + this.large(); } else { - this.bigPicPath = data; - this.bgbigPath = data; + // 滑轮向下滚动 + this.Small(); } - - console.log(this.bigPicPath); }, - handleBigPicbox() { + //大 + large() { + this.$nextTick(() => { + if (this.zoomD < 6) { + this.zoomD += 0.1; + } + document.querySelector( + ".picboxI" + ).style.transform = `matrix(${this.zoomD}, 0, 0,${this.zoomD}, 0, 0)`; + }); + }, + // 小 + Small() { + this.$nextTick(() => { + if (this.zoomD > 0.3) { + this.zoomD -= 0.1; + } + document.querySelector( + ".picboxI" + ).style.transform = `matrix(${this.zoomD}, 0, 0, ${this.zoomD}, 0, 0)`; + }); + }, + imgOnload() { + console.log("加载完成"); + this.canvasloading = false; + }, + //放大图 + handleBigPicbox(val) { + console.log(val); + //this.canvasloading = true; this.showBigpic = true; + this.bigImgPath = val.substring(0, val.length - 9); }, closePic(data) { console.log(data); @@ -347,7 +416,7 @@ export default { ); this.bigPicPath = this.fiveList[this.activeSmall].path + "!1366x768"; - this.bgbigPath = this.terminalPhoto[0].path + "!1366x768"; + this.videopath = this.fiveList[this.activeSmall].thumb; }, //大图点击左侧切换图片 @@ -355,7 +424,7 @@ export default { this.bigNum--; //执行下一张 this.mediaType = this.terminalPhoto[this.bigNum].mediaType; this.bigPicPath = this.terminalPhoto[this.bigNum].path + "!1366x768"; - this.bgbigPath = this.terminalPhoto[0].path + "!1366x768"; + this.activeSmall--; console.log("activeSmall", this.activeSmall, "bigNum", this.bigNum); console.log(this.page); @@ -383,7 +452,7 @@ export default { this.bigNum++; //执行下一张 this.mediaType = this.terminalPhoto[this.bigNum].mediaType; this.bigPicPath = this.terminalPhoto[this.bigNum].path + "!1366x768"; - this.bgbigPath = this.terminalPhoto[0].path + "!1366x768"; + this.activeSmall++; console.log("activeSmall", this.activeSmall, "bigNum", this.bigNum); if (this.activeSmall > 4) { @@ -412,7 +481,7 @@ export default { this.activeSmall = index; this.mediaType = row.mediaType; this.bigPicPath = row.path + "!1366x768"; - this.bgbigPath = row.path + "!1366x768"; + // this.bgbigPath = row.path + "!1366x768"; getCoordinate({ channelId: row.channelId, needPic: "1", @@ -492,58 +561,6 @@ export default { height: calc(100% - 32px); box-sizing: border-box; - .showPic { - position: fixed; - background-color: rgba(0, 0, 0, 0.5); - bottom: 0; - left: 0; - overflow: hidden; - right: 0; - top: 0; - z-index: 9999; - display: flex; - cursor: pointer; - .picboxI { - position: relative; - max-width: 1366px; - max-height: 768px; - margin: auto; - animation-name: scaleDraw; - /*关键帧名称*/ - animation-timing-function: ease; - /*动画的速度曲线*/ - animation-iteration-count: 1; - /*动画播放的次数*/ - animation-duration: 0.65s; - overflow: hidden; - border: 2px solid #f00; - img { - width: 100%; - height: 100%; - margin: auto; - } - } - .viewClose { - -webkit-app-region: no-drag; - background-color: rgba(0, 0, 0, 0.5); - border-radius: 50%; - cursor: pointer; - height: 80px; - overflow: hidden; - position: absolute; - right: -40px; - top: -40px; - transition: background-color 0.15s; - width: 80px; - .el-icon-close { - bottom: 16px; - left: 16px; - position: absolute; - color: #fff; - font-size: 18px; - } - } - } .picTop { width: 100%; height: 80%; @@ -741,6 +758,75 @@ export default { right: 16px; } } + //放大图 + .showPic { + position: fixed; + background-color: rgba(0, 0, 0, 50%); + bottom: 0; + left: 0; + overflow: hidden; + right: 0; + top: 0; + z-index: 9999; + width: 100%; + height: 100%; + display: flex; + cursor: pointer; + .picboxI { + position: relative; + width: 85%; + height: 85%; + margin: auto; + animation-name: scaleDraw; + /*关键帧名称*/ + animation-timing-function: ease; + /*动画的速度曲线*/ + animation-iteration-count: 1; + /*动画播放的次数*/ + animation-duration: 0.65s; + display: flex; + align-items: center; + justify-content: center; + img { + max-width: 100%; + max-height: 100%; + + margin: auto; + position: absolute; + cursor: grab; + } + .myCanvas { + position: absolute; + // top: 0; + // left: 0; + max-width: 100%; + max-height: 100%; + margin: 0 auto; + cursor: pointer; + pointer-events: none; + } + } + .viewClose { + -webkit-app-region: no-drag; + background-color: rgba(0, 0, 0, 0.5); + border-radius: 50%; + cursor: pointer; + height: 80px; + overflow: hidden; + position: absolute; + right: -40px; + top: -40px; + transition: background-color 0.15s; + width: 80px; + .el-icon-close { + bottom: 16px; + left: 16px; + position: absolute; + color: #fff; + font-size: 18px; + } + } + } } @keyframes scaleDraw { /*定义关键帧、scaleDrew是需要绑定到选择器的关键帧名称*/ @@ -753,6 +839,5 @@ export default { transform: scale(1); } } - // https://v1.github.surmon.me/vue-awesome-swiper/ From bf615e6a87d7659ebe3e10d3b4016ca4214c15b9 Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Wed, 26 Jul 2023 09:33:06 +0800 Subject: [PATCH 28/45] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E5=A4=A7=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/components/carouselChart.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/views/components/carouselChart.vue b/src/views/components/carouselChart.vue index c942e4e..41a9973 100644 --- a/src/views/components/carouselChart.vue +++ b/src/views/components/carouselChart.vue @@ -353,6 +353,7 @@ export default { }, closePic(data) { console.log(data); + this.zoomD = 1; this.showBigpic = false; }, openline() { From 04cfdb716fe44b2ee43070f286eae23545e0f9d7 Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Wed, 26 Jul 2023 10:29:33 +0800 Subject: [PATCH 29/45] =?UTF-8?q?=E4=BC=98=E5=8C=96transform?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/alarmHandling/components/historyimg.vue | 7 +++++++ src/views/pictureRotation/index.vue | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/src/views/alarmHandling/components/historyimg.vue b/src/views/alarmHandling/components/historyimg.vue index 4987e30..12ef6fc 100644 --- a/src/views/alarmHandling/components/historyimg.vue +++ b/src/views/alarmHandling/components/historyimg.vue @@ -97,9 +97,16 @@ export default { diff --git a/src/views/devicePhotoSchedule/index copy.vue b/src/views/devicePhotoSchedule/index copy.vue new file mode 100644 index 0000000..40c3a2c --- /dev/null +++ b/src/views/devicePhotoSchedule/index copy.vue @@ -0,0 +1,280 @@ + + + diff --git a/vue.config.js b/vue.config.js index 2d81f4c..040028d 100644 --- a/vue.config.js +++ b/vue.config.js @@ -29,11 +29,11 @@ module.exports = defineConfig({ proxy: { "/api": { //表示拦截以/api开头的请求路径 - //target: "http://47.96.238.157:8093", //阿里云服务器环境 - target: "http://180.166.218.222:40080", //dell + target: "http://47.96.238.157:8093", //阿里云服务器环境 + //target: "http://180.166.218.222:40080", //dell changOrigin: true, //是否开启跨域 pathRewrite: { - "^/api": "/api", //重写api,把api变成空字符,因为我们真正请求的路径是没有api的 + "^/api": "", //重写api,把api变成空字符,因为我们真正请求的路径是没有api的 }, }, }, From 3a754cf8cfdc20bcee5047c8bdcdd574cd731483 Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Thu, 27 Jul 2023 15:02:18 +0800 Subject: [PATCH 33/45] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/components/carouselChart.vue | 26 ++++++++++++++----- .../towerInformation/components/addDialog.vue | 6 ++--- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/views/components/carouselChart.vue b/src/views/components/carouselChart.vue index 41a9973..803411e 100644 --- a/src/views/components/carouselChart.vue +++ b/src/views/components/carouselChart.vue @@ -155,7 +155,12 @@
-
+
-
+
@@ -351,10 +356,19 @@ export default { this.showBigpic = true; this.bigImgPath = val.substring(0, val.length - 9); }, - closePic(data) { - console.log(data); - this.zoomD = 1; - this.showBigpic = false; + closePic(e) { + console.log(e); + var btn = this.$refs.bigimgref; + console.log(btn); + if (btn) { + if (!btn.contains(event.target)) { + //按钮.app-download以外的区域 + this.zoomD = 1; + this.showBigpic = false; + } + } + // + // this.showBigpic = false; }, openline() { this.flagline = true; diff --git a/src/views/management/userEquipment/towerInformation/components/addDialog.vue b/src/views/management/userEquipment/towerInformation/components/addDialog.vue index bea43b0..cc85d8f 100644 --- a/src/views/management/userEquipment/towerInformation/components/addDialog.vue +++ b/src/views/management/userEquipment/towerInformation/components/addDialog.vue @@ -61,9 +61,9 @@ export default { lineId: [ { required: true, message: "请选择线路编号", trigger: "blur" }, ], - address: [ - { required: true, message: "请输入杆塔地址", trigger: "blur" }, - ], + // address: [ + // { required: true, message: "请输入杆塔地址", trigger: "blur" }, + // ], order: [{ required: true, message: "请输入排序号", trigger: "blur" }], }, }; From 50f3822bc7cb1d4cae480854639a1d638a90292d Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Fri, 28 Jul 2023 17:31:34 +0800 Subject: [PATCH 34/45] =?UTF-8?q?=E6=97=B6=E9=97=B4=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/adddeviceDialog copy.vue | 260 ++++++++++++++++++ .../components/adddeviceDialog.vue | 56 +++- src/views/devicePhotoSchedule/index.vue | 78 ++++-- 3 files changed, 356 insertions(+), 38 deletions(-) create mode 100644 src/views/devicePhotoSchedule/components/adddeviceDialog copy.vue diff --git a/src/views/devicePhotoSchedule/components/adddeviceDialog copy.vue b/src/views/devicePhotoSchedule/components/adddeviceDialog copy.vue new file mode 100644 index 0000000..d559381 --- /dev/null +++ b/src/views/devicePhotoSchedule/components/adddeviceDialog copy.vue @@ -0,0 +1,260 @@ + + + diff --git a/src/views/devicePhotoSchedule/components/adddeviceDialog.vue b/src/views/devicePhotoSchedule/components/adddeviceDialog.vue index e9fc558..7ace0c5 100644 --- a/src/views/devicePhotoSchedule/components/adddeviceDialog.vue +++ b/src/views/devicePhotoSchedule/components/adddeviceDialog.vue @@ -20,12 +20,12 @@
- + @@ -54,7 +56,7 @@ icon="el-icon-plus" type="primary" @click="addModule()" - v-if="index + 1 == ruleForm.list.length" + v-if="index + 1 == ruleForm.listTime.length" >
@@ -91,25 +93,25 @@ export default { if (val == null) { return (this.ruleForm = { name: "", - list: [ + listTime: [ { - hour: "", - minute: "", - preset: "", + time: "", + span: "", }, ], + list: [], remark: "", }); } //this.ruleForm = val; this.ruleForm = JSON.parse(JSON.stringify(val)); - this.ruleForm.list.forEach((val) => { + this.ruleForm.listTime.forEach((val) => { this.$set(val, "time", [val.startTime, val.endTime]); }); }, addModule() { //新增一行 - this.ruleForm.list.push({ + this.ruleForm.listTime.push({ time: "", span: "", }); @@ -136,11 +138,39 @@ export default { this.$refs.formInfo.validate((valid) => { if (valid) { // delete this.ruleForm.time; - this.ruleForm.list.forEach((val) => { - console.log(val); + this.ruleForm.listTime.forEach((val) => { this.$set(val, "startTime", val.time[0]); this.$set(val, "endTime", val.time[1]); + // console.log(val.time[0]); + // console.log(typeof val.time[0]); + // console.log(new Date(val.time[0])); + // console.log(new Date(val.time[1])); + // console.log(new Date(val.time[0]).getHours()); + // console.log(new Date(val.time[0]).getMinutes()); }); + let arr = []; + for (var i = 0; i < this.ruleForm.listTime.length; i++) { + console.log(this.ruleForm.listTime); + arr.push( + { + hour: Math.floor(this.ruleForm.listTime[i].span / 60), + minute: this.ruleForm.listTime[i].span % 60, + preset: 255, + }, + { + hour: this.ruleForm.listTime[i].startTime.getHours(), + minute: this.ruleForm.listTime[i].startTime.getMinutes(), + preset: 255, + }, + { + hour: this.ruleForm.listTime[i].endTime.getHours(), + minute: this.ruleForm.listTime[i].endTime.getMinutes(), + preset: 255, + } + ); + } + console.log(arr); + this.ruleForm.list = arr; if (this.title == "新增") { addScheduleRulel(this.ruleForm) .then((res) => { diff --git a/src/views/devicePhotoSchedule/index.vue b/src/views/devicePhotoSchedule/index.vue index 40c3a2c..331330e 100644 --- a/src/views/devicePhotoSchedule/index.vue +++ b/src/views/devicePhotoSchedule/index.vue @@ -13,7 +13,7 @@
- @@ -127,6 +106,8 @@ export default { return { title: "", //弹窗标题 deviceTableData: [], + newList: [], + listTime: [], //multipleSelection: [], //获取当前选中 page: 1, // 当前页数 pageSize: 20, // 每页数量 @@ -146,9 +127,56 @@ export default { pagesize: this.pageSize, }) .then((res) => { + this.newList = []; this.deviceTableData = res.data.list; this.total = res.data.total; this.loading = false; + // for (var i = 0; i < this.deviceTableData.list.length; i++) { + // console.log(this.deviceTableData.list[i]); + // } + // console.log(this.deviceTableData); + + for (var i = 0; i < this.deviceTableData.length; i++) { + var arr = []; + console.log(this.deviceTableData[i]); + for (var k = 0; k < this.deviceTableData[i].list.length; k++) { + if (k % 3 == 0) { + var obj = {}; + obj.span = + this.deviceTableData[i].list[k].hour * 60 + + this.deviceTableData[i].list[k].minute; + console.log("时间间隔"); + } else if (k % 3 == 1) { + console.log("开始时间"); + console.log("a"); + // obj.startTime = + // this.deviceTableData[i].list[k].hour + + // ":" + + // this.deviceTableData[i].list[k].minute; + obj.startTime = new Date().toISOString(); + } else if (k % 3 == 2) { + console.log("结束时间"); + obj.endTime = + this.deviceTableData[i].list[k].hour + + ":" + + this.deviceTableData[i].list[k].minute; + arr.push(obj); + console.log("2222222222222222222222222222"); + console.log(arr); + console.log("2222222222222222222222222222"); + } + console.log(this.deviceTableData[i].list[k]); + } + this.newList.push({ + id: this.deviceTableData[i].id, + list: this.deviceTableData[i].list, + name: this.deviceTableData[i].name, + remark: this.deviceTableData[i].remark, + listTime: arr, + }); + } + console.log("this.newList"); + console.log(this.newList); }) .catch((err) => {}); }, From 548ecb0bfcee0610988821bba8d0de2a49123736 Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Mon, 31 Jul 2023 15:57:40 +0800 Subject: [PATCH 35/45] =?UTF-8?q?=E6=8B=8D=E7=85=A7=E8=A3=85=E7=BD=AE?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=96=B0=E5=A2=9E=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/adddeviceDialog.vue | 7 +- .../components/setdevice.vue | 41 ++++-- src/views/devicePhotoSchedule/index.vue | 75 ++++++++++- .../components/setschedule.vue | 123 ++++++++++++++++-- 4 files changed, 220 insertions(+), 26 deletions(-) diff --git a/src/views/devicePhotoSchedule/components/adddeviceDialog.vue b/src/views/devicePhotoSchedule/components/adddeviceDialog.vue index 7ace0c5..fb39916 100644 --- a/src/views/devicePhotoSchedule/components/adddeviceDialog.vue +++ b/src/views/devicePhotoSchedule/components/adddeviceDialog.vue @@ -138,9 +138,10 @@ export default { this.$refs.formInfo.validate((valid) => { if (valid) { // delete this.ruleForm.time; + this.ruleForm.listTime.forEach((val) => { - this.$set(val, "startTime", val.time[0]); - this.$set(val, "endTime", val.time[1]); + this.$set(val, "startTime", new Date(val.time[0])); + this.$set(val, "endTime", new Date(val.time[1])); // console.log(val.time[0]); // console.log(typeof val.time[0]); // console.log(new Date(val.time[0])); @@ -148,9 +149,11 @@ export default { // console.log(new Date(val.time[0]).getHours()); // console.log(new Date(val.time[0]).getMinutes()); }); + let arr = []; for (var i = 0; i < this.ruleForm.listTime.length; i++) { console.log(this.ruleForm.listTime); + arr.push( { hour: Math.floor(this.ruleForm.listTime[i].span / 60), diff --git a/src/views/devicePhotoSchedule/components/setdevice.vue b/src/views/devicePhotoSchedule/components/setdevice.vue index 3e6a8b4..395b457 100644 --- a/src/views/devicePhotoSchedule/components/setdevice.vue +++ b/src/views/devicePhotoSchedule/components/setdevice.vue @@ -14,13 +14,29 @@

{{ - val.startTime.substring(0, val.startTime.lastIndexOf(":")) + new Date(val.startTime).getHours() < 10 + ? "0" + new Date(val.startTime).getHours() + : new Date(val.startTime).getHours() + }}: + {{ + new Date(val.startTime).getMinutes() < 10 + ? "0" + new Date(val.startTime).getMinutes() + : new Date(val.startTime).getMinutes() }} ~ - {{ - val.endTime.substring(0, val.endTime.lastIndexOf(":")) - }} + {{ + new Date(val.endTime).getHours() < 10 + ? "0" + new Date(val.endTime).getHours() + : new Date(val.endTime).getHours() + }}: + {{ + new Date(val.endTime).getMinutes() < 10 + ? "0" + new Date(val.endTime).getMinutes() + : new Date(val.endTime).getMinutes() + }} 间隔:{{ val.span }}分钟

@@ -65,6 +81,10 @@ :max="9" >
+
+ 规约: + {{ data.protocol }} +
{}); }, - //// 给数组里的每一个对象都添加一个isEdit属性 + // 给数组里的每一个对象都添加一个isEdit属性 getChildren(data) { console.log(data); return data.map((item) => { @@ -224,14 +245,16 @@ export default { }, //时间表 sureSum() { - //console.log(this.termidArr); + console.log(this.ruleSchedule); + console.log(this.checkedAisle); var ruleBox = []; for (var i = 0; i < this.allCheckNode.length; i++) { var parmsobj = { termid: this.allCheckNode[i].id, - channelidlist: [this.checkedAisle], + channelidlist: this.checkedAisle, offset: this.allCheckNode[i].offsetNum, + list: [], }; console.log(parmsobj); ruleBox.push(parmsobj); diff --git a/src/views/devicePhotoSchedule/index.vue b/src/views/devicePhotoSchedule/index.vue index 331330e..a4c6dea 100644 --- a/src/views/devicePhotoSchedule/index.vue +++ b/src/views/devicePhotoSchedule/index.vue @@ -37,9 +37,32 @@ v-for="(val, index) in scope.row.listTime" :key="index" > - {{ val.startTime }} + + {{ + new Date(val.startTime).getHours() < 10 + ? "0" + new Date(val.startTime).getHours() + : new Date(val.startTime).getHours() + }}: + {{ + new Date(val.startTime).getMinutes() < 10 + ? "0" + new Date(val.startTime).getMinutes() + : new Date(val.startTime).getMinutes() + }} + ~ - {{ val.endTime }} + {{ + new Date(val.endTime).getHours() < 10 + ? "0" + new Date(val.endTime).getHours() + : new Date(val.endTime).getHours() + }}: + {{ + new Date(val.endTime).getMinutes() < 10 + ? "0" + new Date(val.endTime).getMinutes() + : new Date(val.endTime).getMinutes() + }} 间隔:{{ val.span }}分钟

@@ -134,7 +157,7 @@ export default { // for (var i = 0; i < this.deviceTableData.list.length; i++) { // console.log(this.deviceTableData.list[i]); // } - // console.log(this.deviceTableData); + console.log(this.deviceTableData); for (var i = 0; i < this.deviceTableData.length; i++) { var arr = []; @@ -153,17 +176,55 @@ export default { // this.deviceTableData[i].list[k].hour + // ":" + // this.deviceTableData[i].list[k].minute; - obj.startTime = new Date().toISOString(); + // console.log(new Date()); + let timeDate = new Date(); + timeDate.setHours(this.deviceTableData[i].list[k].hour); + timeDate.setMinutes(this.deviceTableData[i].list[k].minute); + console.log(timeDate); + // console.log(new Date().getHours()); + // console.log( + // new Date().setHours(this.deviceTableData[i].list[k].hour) + // ); + // console.log(d.getHours() + ":" + d.getMinutes()); + // if (timeDate.getHours() < 10) { + // console.log(timeDate.getHours()); + // obj.startTime = + // "0" + timeDate.getHours() + ":" + timeDate.getMinutes(); + // } else { + + // } + + // let timeHour = + // timeDate.getHours() < 10 + // ? "0" + timeDate.getHours() + // : timeDate.getHours(); + // let timeMinute = + // timeDate.getMinutes() < 10 + // ? "0" + timeDate.getMinutes() + // : timeDate.getMinutes(); + obj.startTime = timeDate.toUTCString(); } else if (k % 3 == 2) { console.log("结束时间"); obj.endTime = this.deviceTableData[i].list[k].hour + ":" + this.deviceTableData[i].list[k].minute; + let timeDate = new Date(); + timeDate.setHours(this.deviceTableData[i].list[k].hour); + timeDate.setMinutes(this.deviceTableData[i].list[k].minute); + // obj.endTime = c.toJSON(); + let timeHour = + timeDate.getHours() < 10 + ? "0" + timeDate.getHours() + : timeDate.getHours(); + let timeMinute = + timeDate.getMinutes() < 10 + ? "0" + timeDate.getMinutes() + : timeDate.getMinutes(); + //obj.startTime = timeHour + ":" + timeMinute; + // obj.endTime = timeHour + ":" + timeMinute; + obj.endTime = timeDate.toUTCString(); arr.push(obj); - console.log("2222222222222222222222222222"); - console.log(arr); - console.log("2222222222222222222222222222"); } console.log(this.deviceTableData[i].list[k]); } diff --git a/src/views/realTimeMonitor/components/setschedule.vue b/src/views/realTimeMonitor/components/setschedule.vue index 9bc62d9..309dd5a 100644 --- a/src/views/realTimeMonitor/components/setschedule.vue +++ b/src/views/realTimeMonitor/components/setschedule.vue @@ -92,7 +92,7 @@
- + @@ -259,6 +276,8 @@ export default { selaccess: "", //选中的通道 shedulenr: [], //查询的时间表 deviceTableData: [], //时间表-表格 + newList: [], + listTime: [], page: 1, // 当前页数 pageSize: 10, // 每页数量 total: 0, //总条数 @@ -416,10 +435,98 @@ export default { pagesize: this.pageSize, }) .then((res) => { + // this.deviceTableData = res.data.list; + // this.total = res.data.total; + // console.log(this.deviceTableData); + // this.loading = false; + this.newList = []; this.deviceTableData = res.data.list; this.total = res.data.total; - console.log(this.deviceTableData); this.loading = false; + // for (var i = 0; i < this.deviceTableData.list.length; i++) { + // console.log(this.deviceTableData.list[i]); + // } + // console.log(this.deviceTableData); + + for (var i = 0; i < this.deviceTableData.length; i++) { + var arr = []; + console.log(this.deviceTableData[i]); + for (var k = 0; k < this.deviceTableData[i].list.length; k++) { + if (k % 3 == 0) { + var obj = {}; + obj.span = + this.deviceTableData[i].list[k].hour * 60 + + this.deviceTableData[i].list[k].minute; + console.log("时间间隔"); + } else if (k % 3 == 1) { + console.log("开始时间"); + console.log("a"); + // obj.startTime = + // this.deviceTableData[i].list[k].hour + + // ":" + + // this.deviceTableData[i].list[k].minute; + // console.log(new Date()); + let timeDate = new Date(); + timeDate.setHours(this.deviceTableData[i].list[k].hour); + timeDate.setMinutes(this.deviceTableData[i].list[k].minute); + console.log(timeDate); + // console.log(new Date().getHours()); + // console.log( + // new Date().setHours(this.deviceTableData[i].list[k].hour) + // ); + // console.log(d.getHours() + ":" + d.getMinutes()); + // if (timeDate.getHours() < 10) { + // console.log(timeDate.getHours()); + // obj.startTime = + // "0" + timeDate.getHours() + ":" + timeDate.getMinutes(); + // } else { + + // } + + // let timeHour = + // timeDate.getHours() < 10 + // ? "0" + timeDate.getHours() + // : timeDate.getHours(); + // let timeMinute = + // timeDate.getMinutes() < 10 + // ? "0" + timeDate.getMinutes() + // : timeDate.getMinutes(); + obj.startTime = timeDate.toUTCString(); + } else if (k % 3 == 2) { + console.log("结束时间"); + obj.endTime = + this.deviceTableData[i].list[k].hour + + ":" + + this.deviceTableData[i].list[k].minute; + let timeDate = new Date(); + timeDate.setHours(this.deviceTableData[i].list[k].hour); + timeDate.setMinutes(this.deviceTableData[i].list[k].minute); + // obj.endTime = c.toJSON(); + let timeHour = + timeDate.getHours() < 10 + ? "0" + timeDate.getHours() + : timeDate.getHours(); + let timeMinute = + timeDate.getMinutes() < 10 + ? "0" + timeDate.getMinutes() + : timeDate.getMinutes(); + //obj.startTime = timeHour + ":" + timeMinute; + // obj.endTime = timeHour + ":" + timeMinute; + obj.endTime = timeDate.toUTCString(); + arr.push(obj); + } + console.log(this.deviceTableData[i].list[k]); + } + this.newList.push({ + id: this.deviceTableData[i].id, + list: this.deviceTableData[i].list, + name: this.deviceTableData[i].name, + remark: this.deviceTableData[i].remark, + listTime: arr, + }); + } + console.log("this.newList"); + console.log(this.newList); }) .catch((err) => {}); }, From 8d55d7b02306eff99eb7e60714a1ea0f4c7e7567 Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Mon, 31 Jul 2023 17:21:01 +0800 Subject: [PATCH 36/45] =?UTF-8?q?=E6=8B=8D=E7=85=A7=E8=A3=85=E7=BD=AE?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=96=B0=E5=A2=9E=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/setdevice.vue | 78 +++++++++++++++++-- 1 file changed, 73 insertions(+), 5 deletions(-) diff --git a/src/views/devicePhotoSchedule/components/setdevice.vue b/src/views/devicePhotoSchedule/components/setdevice.vue index 395b457..53614db 100644 --- a/src/views/devicePhotoSchedule/components/setdevice.vue +++ b/src/views/devicePhotoSchedule/components/setdevice.vue @@ -232,6 +232,7 @@ export default { this.allCheckNode = this.$refs.tree.getCheckedNodes(); // console.log(this.allCheckNode); console.log(nodeObj); + this.isactive = nodeObj.id; this.isCheck = this.$refs.tree.getCheckedNodes().indexOf(nodeObj) > -1; console.log(this.isCheck); @@ -245,16 +246,23 @@ export default { }, //时间表 sureSum() { - console.log(this.ruleSchedule); - console.log(this.checkedAisle); + var ruleBox = []; for (var i = 0; i < this.allCheckNode.length; i++) { + console.log(this.allCheckNode[i].protocol); + + if (this.allCheckNode[i].protocol == "65283") { + //湖南规约 + this.getHnTime(this.allCheckNode[i]); + } else if (this.allCheckNode[i].protocol == "65286") { + //郑州规约 + this.getZzTime(this.allCheckNode[i]); + } var parmsobj = { termid: this.allCheckNode[i].id, - channelidlist: this.checkedAisle, + channelid: this.checkedAisle, offset: this.allCheckNode[i].offsetNum, - list: [], }; console.log(parmsobj); ruleBox.push(parmsobj); @@ -283,6 +291,67 @@ export default { }); }); }, + //获取到时间规则,把时间规则转化为对应的规约格式 + //湖南规约 + getHnTime(val) { + console.log("湖南"); + console.log(val); + + var numberoff = val.offsetNum; + console.log(numberoff); + console.log(this.ruleSchedule); + let arr = []; + for (var i = 0; i < this.ruleSchedule.length; i++) { + console.log(this.ruleSchedule[i].startTime); + console.log(this.ruleSchedule[i].endTime); + let sTime = new Date(this.ruleSchedule[i].startTime); + let eTime = new Date(this.ruleSchedule[i].endTime); + console.log(sTime, eTime); + arr.push( + { + hour: Math.floor(this.ruleSchedule[i].span / 60), + minute: this.ruleSchedule[i].span % 60, + preset: 255, + }, + { + hour: new Date(this.ruleSchedule[i].startTime).getHours(), + minute: + new Date(this.ruleSchedule[i].startTime).getMinutes() + numberoff, + preset: 255, + }, + { + hour: new Date(this.ruleSchedule[i].endTime).getHours(), + minute: + new Date(this.ruleSchedule[i].endTime).getMinutes() + numberoff, + + preset: 255, + } + ); + console.log(arr); + // arr.push( + // { + // hour: Math.floor(this.ruleForm.listTime[i].span / 60), + // minute: this.ruleForm.listTime[i].span % 60, + // preset: 255, + // }, + // { + // hour: this.ruleForm.listTime[i].startTime.getHours(), + // minute: this.ruleForm.listTime[i].startTime.getMinutes(), + // preset: 255, + // }, + // { + // hour: this.ruleForm.listTime[i].endTime.getHours(), + // minute: this.ruleForm.listTime[i].endTime.getMinutes(), + // preset: 255, + // } + // ); + } + }, + //河南规约 + getZzTime() { + console.log("河南"); + console.log(this.ruleSchedule); + }, //根据requestid查询时间表下发状态 requestTime() { this.sureloading = true; @@ -297,7 +366,6 @@ export default { arr ) { console.log(value, index, arr); - return value.status !== 1; }); if (this.requestList.length == 0) { From 9df6f03ee6abb6f7f580a974f8eea2d29cc44524 Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Mon, 31 Jul 2023 17:57:16 +0800 Subject: [PATCH 37/45] =?UTF-8?q?=E6=8B=8D=E7=85=A7=E8=A3=85=E7=BD=AE?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A7=84=E7=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/css/element.less | 3 +++ .../monitoringEquipment/photographicDevice/index.vue | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/src/assets/css/element.less b/src/assets/css/element.less index 2af53cf..c2dbdc4 100644 --- a/src/assets/css/element.less +++ b/src/assets/css/element.less @@ -72,3 +72,6 @@ .el-select-dropdown { margin-top: 4px !important; } +.el-link { + font-size: 12px; +} diff --git a/src/views/management/monitoringEquipment/photographicDevice/index.vue b/src/views/management/monitoringEquipment/photographicDevice/index.vue index 2d3def3..8a306bc 100644 --- a/src/views/management/monitoringEquipment/photographicDevice/index.vue +++ b/src/views/management/monitoringEquipment/photographicDevice/index.vue @@ -177,6 +177,13 @@ :formatter="dateFormat" > --> + Date: Tue, 1 Aug 2023 14:56:20 +0800 Subject: [PATCH 38/45] =?UTF-8?q?=E6=8B=8D=E7=85=A7=E8=A3=85=E7=BD=AE?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A7=84=E7=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/setdevice.vue | 260 ++++++++++++------ src/views/realTimeMonitor/index.vue | 4 +- 2 files changed, 182 insertions(+), 82 deletions(-) diff --git a/src/views/devicePhotoSchedule/components/setdevice.vue b/src/views/devicePhotoSchedule/components/setdevice.vue index 53614db..3c4e9d0 100644 --- a/src/views/devicePhotoSchedule/components/setdevice.vue +++ b/src/views/devicePhotoSchedule/components/setdevice.vue @@ -119,6 +119,7 @@ import { getTermListByChannelJoggle, getCmaSchelduleUpload, } from "@/utils/api/index"; +import moment from "moment"; export default { props: { title: String, @@ -168,6 +169,7 @@ export default { flag: false, sureloading: false, showtag: false, + checkOffset: "", }; }, mounted() {}, @@ -177,6 +179,7 @@ export default { console.log(val); this.selid = val.id; this.ruleSchedule = val.listTime; + console.log(this.ruleSchedule); // console.log(this.ruleSchedule, "时间规则"); this.getlistnr(); }, @@ -232,11 +235,34 @@ export default { this.allCheckNode = this.$refs.tree.getCheckedNodes(); // console.log(this.allCheckNode); console.log(nodeObj); - + console.log(this.allCheckNode); this.isactive = nodeObj.id; this.isCheck = this.$refs.tree.getCheckedNodes().indexOf(nodeObj) > -1; console.log(this.isCheck); }, + // //获取开始时间和结束时间的偏移量 + // getruleSchedule() { + // for (var j = 0; j < this.allCheckNode.length; j++) { + // console.log(this.allCheckNode[j].offsetNum); + // for (var i = 0; i < this.ruleSchedule.length; i++) { + // console.log(typeof this.ruleSchedule[i].startTime); + // console.log(this.ruleSchedule[i].startTime); + // var Stime = moment(this.ruleSchedule[i].startTime).format("HH:mm"); + // var Etime = moment(this.ruleSchedule[i].endTime).format("HH:mm"); + // console.log(Stime, Etime); + + // // this.ruleSchedule[i].startTime = new Date( + // // this.ruleSchedule[i].startTime + // // ); + // // this.ruleSchedule[i].endTime = new Date(this.ruleSchedule[i].endTime); + // // console.log(this.ruleSchedule[i].startTime); + // // console.log(this.ruleSchedule[i].endTime); + // // moment().add(offsetSeconds, "seconds").toObject(); + + // // console.log(time); + // } + // } + // }, // 保存确定操作 submitForm() { @@ -249,25 +275,155 @@ export default { console.log(this.checkedAisle); var ruleBox = []; + //循环装置 for (var i = 0; i < this.allCheckNode.length; i++) { - console.log(this.allCheckNode[i].protocol); + console.log(this.allCheckNode[i].bsManufacturer); + if ( + this.allCheckNode[i].bsManufacturer == null || + this.allCheckNode[i].bsManufacturer == undefined + ) { + console.log(this.allCheckNode[i].offsetNum); + //循环时间规则 + let timearr = []; + let dayArr = []; + for (var j = 0; j < this.ruleSchedule.length; j++) { + console.log(this.ruleSchedule); + console.log(this.ruleSchedule[j].startTime); + // var Stime = moment(this.ruleSchedule[j].startTime).format("HH:mm"); + // var Etime = moment(this.ruleSchedule[j].endTime).format("HH:mm"); + + var Stime = moment(this.ruleSchedule[j].startTime) + .add(this.allCheckNode[i].offsetNum, "minute") + .format(); + var Etime = moment(this.ruleSchedule[j].endTime) + .add(this.allCheckNode[i].offsetNum, "minute") + .format(); + var spanTime = this.ruleSchedule[j].span; + console.log(spanTime); + console.log(moment(this.ruleSchedule[j].endTime).hour()); + //判断湖南规约 + if (this.allCheckNode[i].protocol == "65283") { + console.log("湖南规约"); + console.log(Stime, Etime); + console.log(typeof Stime); + console.log( + moment(this.ruleSchedule[j].endTime) + .add(this.allCheckNode[i].offsetNum, "minute") + .hour() + ); + console.log( + moment(this.ruleSchedule[j].endTime) + .add(this.allCheckNode[i].offsetNum, "minute") + .minute() + ); + + //如果偏移之后的时间是第二天,那么不做偏移 + console.log(moment().isSame(moment(Etime), "day")); + //判断是不是同一天 + if (moment().isSame(moment(Etime), "day")) { + //如果是同一天 + timearr.push( + { + hour: Math.floor(this.ruleSchedule[j].span / 60), + minute: this.ruleSchedule[j].span % 60, + preset: 255, + }, + { + hour: moment(this.ruleSchedule[j].startTime) + .add(this.allCheckNode[i].offsetNum, "minute") + .hour(), + minute: moment(this.ruleSchedule[j].startTime) + .add(this.allCheckNode[i].offsetNum, "minute") + .minute(), + preset: 255, + }, + { + hour: moment(this.ruleSchedule[j].endTime) + .add(this.allCheckNode[i].offsetNum, "minute") + .hour(), + minute: moment(this.ruleSchedule[j].endTime) + .add(this.allCheckNode[i].offsetNum, "minute") + .minute(), + preset: 255, + } + ); + } else { + timearr.push( + { + hour: Math.floor(this.ruleSchedule[j].span / 60), + minute: this.ruleSchedule[j].span % 60, + preset: 255, + }, + { + hour: moment(this.ruleSchedule[j].startTime) + .add(this.allCheckNode[i].offsetNum, "minute") + .hour(), + minute: moment(this.ruleSchedule[j].startTime) + .add(this.allCheckNode[i].offsetNum, "minute") + .minute(), + preset: 255, + }, + { + hour: moment(this.ruleSchedule[j].endTime).hour(), + minute: moment(this.ruleSchedule[j].endTime).minute(), + preset: 255, + } + ); + } + + console.log(timearr); + } + ////判断河南规约 + if (this.allCheckNode[i].protocol == "65286") { + console.log("河南规约"); + //偏移时间 + //this.getDayArr(startDay, endDay); + let startDay = Stime; + let endDay = Etime; + console.log(startDay, endDay); + let startVal = this.$moment(new Date(startDay)).format( + "YYYY-MM-DD HH:mm" + ); + console.log(startVal); + + while (this.$moment(startVal).isBefore(endDay)) { + dayArr.push(startVal); + // 自增 + startVal = this.$moment(new Date(startVal)) + .add(spanTime, "minute") + .format("YYYY-MM-DD HH:mm"); + console.log(startVal); + } + + // // 将结束日期的天放进数组 + dayArr.push( + this.$moment(new Date(endDay)).format("YYYY-MM-DD HH:mm") + ); + console.log(dayArr); + for (var k = 0; k < dayArr.length; k++) { + //console.log(moment(dayArr[k]).hour()); + timearr.push({ + hour: moment(dayArr[k]).hour(), + minute: moment(dayArr[k]).minute(), + preset: 255, + }); + } - if (this.allCheckNode[i].protocol == "65283") { - //湖南规约 - this.getHnTime(this.allCheckNode[i]); - } else if (this.allCheckNode[i].protocol == "65286") { - //郑州规约 - this.getZzTime(this.allCheckNode[i]); + // return dayArr; + } + } + + var parmsobj = { + termid: this.allCheckNode[i].id, + channelid: this.checkedAisle, + offset: this.allCheckNode[i].offsetNum, + list: timearr, + }; + console.log(parmsobj); + ruleBox.push(parmsobj); } - var parmsobj = { - termid: this.allCheckNode[i].id, - channelid: this.checkedAisle, - offset: this.allCheckNode[i].offsetNum, - }; - console.log(parmsobj); - ruleBox.push(parmsobj); + console.log(ruleBox); } - console.log(ruleBox); setScheduleRulel({ list: ruleBox, scheduleid: this.selid, @@ -283,75 +439,19 @@ export default { }, 3000); }) .catch((err) => { - this.$message({ - duration: 1500, - showClose: true, - message: "添加失败", - type: "error", - }); + // this.$message({ + // duration: 1500, + // showClose: true, + // message: "添加失败", + // type: "error", + // }); }); }, //获取到时间规则,把时间规则转化为对应的规约格式 //湖南规约 - getHnTime(val) { - console.log("湖南"); - console.log(val); - - var numberoff = val.offsetNum; - console.log(numberoff); - console.log(this.ruleSchedule); - let arr = []; - for (var i = 0; i < this.ruleSchedule.length; i++) { - console.log(this.ruleSchedule[i].startTime); - console.log(this.ruleSchedule[i].endTime); - let sTime = new Date(this.ruleSchedule[i].startTime); - let eTime = new Date(this.ruleSchedule[i].endTime); - console.log(sTime, eTime); - arr.push( - { - hour: Math.floor(this.ruleSchedule[i].span / 60), - minute: this.ruleSchedule[i].span % 60, - preset: 255, - }, - { - hour: new Date(this.ruleSchedule[i].startTime).getHours(), - minute: - new Date(this.ruleSchedule[i].startTime).getMinutes() + numberoff, - preset: 255, - }, - { - hour: new Date(this.ruleSchedule[i].endTime).getHours(), - minute: - new Date(this.ruleSchedule[i].endTime).getMinutes() + numberoff, - - preset: 255, - } - ); - console.log(arr); - // arr.push( - // { - // hour: Math.floor(this.ruleForm.listTime[i].span / 60), - // minute: this.ruleForm.listTime[i].span % 60, - // preset: 255, - // }, - // { - // hour: this.ruleForm.listTime[i].startTime.getHours(), - // minute: this.ruleForm.listTime[i].startTime.getMinutes(), - // preset: 255, - // }, - // { - // hour: this.ruleForm.listTime[i].endTime.getHours(), - // minute: this.ruleForm.listTime[i].endTime.getMinutes(), - // preset: 255, - // } - // ); - } - }, + getHnTime() {}, //河南规约 - getZzTime() { - console.log("河南"); - console.log(this.ruleSchedule); - }, + getZzTime() {}, //根据requestid查询时间表下发状态 requestTime() { this.sureloading = true; diff --git a/src/views/realTimeMonitor/index.vue b/src/views/realTimeMonitor/index.vue index f0e212d..ba73e97 100644 --- a/src/views/realTimeMonitor/index.vue +++ b/src/views/realTimeMonitor/index.vue @@ -687,9 +687,9 @@ export default { this.picTime = res.data.taketime; //获取时间 判断获取最新视频 console.log(this.requestId); this.btnvideoloading = true; - this.getTakePicStatus(this.requestId); + this.getTakePicStatus(res.data); this.statusTimer = window.setInterval(() => { - this.getTakePicStatus(this.requestId); + this.getTakePicStatus(res.data); this.statusNum++; }, 2000); }) From 78bfd4ead90ef1cc99d8c6a19d549f76ce74e6da Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Tue, 1 Aug 2023 18:24:44 +0800 Subject: [PATCH 39/45] =?UTF-8?q?=E6=8B=8D=E7=85=A7=E8=A3=85=E7=BD=AE?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A7=84=E7=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/api/index.js | 10 ++ .../components/setdevice.vue | 1 - src/views/realTimeMonitor/index.vue | 128 +++++++++++++++++- 3 files changed, 137 insertions(+), 2 deletions(-) diff --git a/src/utils/api/index.js b/src/utils/api/index.js index 6880bc0..021044a 100644 --- a/src/utils/api/index.js +++ b/src/utils/api/index.js @@ -803,3 +803,13 @@ export function getOnlineTerminalListExcel() { responseType: "blob", }); } + +//调节焦距 + +export function updateTermCamera(data) { + return request({ + url: "/api/updateTermCamera", + method: "get", + params: data, + }); +} diff --git a/src/views/devicePhotoSchedule/components/setdevice.vue b/src/views/devicePhotoSchedule/components/setdevice.vue index 3c4e9d0..cd4150b 100644 --- a/src/views/devicePhotoSchedule/components/setdevice.vue +++ b/src/views/devicePhotoSchedule/components/setdevice.vue @@ -408,7 +408,6 @@ export default { preset: 255, }); } - // return dayArr; } } diff --git a/src/views/realTimeMonitor/index.vue b/src/views/realTimeMonitor/index.vue index ba73e97..2858cc0 100644 --- a/src/views/realTimeMonitor/index.vue +++ b/src/views/realTimeMonitor/index.vue @@ -235,6 +235,49 @@ >
+
+

焦距调节

+
+ 选择通道 + + + {{ + item.alias !== null && item.alias !== "" + ? item.alias + : item.label + }} + + +
+
+ 放大 + 缩小 +
+
@@ -255,6 +298,7 @@ import { getTakePicPhotoStatusJoggle, getTakePicStatusJoggle, setTermGPSJoggle, + updateTermCamera, } from "@/utils/api/index"; import previewContain from "./previewContain.vue"; import carouselChart from "../components/carouselChart.vue"; @@ -307,6 +351,8 @@ export default { }, channelListOption: [], //通道内容 channelOption: [], //主动拍照通道 + channelarr: [], + channelarrValue: null, selectChannelValue: null, //选中的通道 channelId: "", //选中的通道id btnpicloading: false, //主动拍照按钮loading @@ -466,12 +512,14 @@ export default { .then((res) => { console.log(res); this.channelList = res.data.list; + this.channelarr = res.data.list; if (this.channelList.length == 0) { console.log("没有通道"); this.getTerminalPhotoList(-1, this.dateValue, this.zztermId); //获取图片列表是传当前设备的 id 和termid } else { console.log(this.channelList); this.channelOption = []; + this.channelList.forEach((item) => { this.channelOption.push({ label: item.channelname, @@ -497,6 +545,7 @@ export default { }); }); this.selectChannelValue = this.channelListOption[0].value; //默认选中所有通道 + this.channelarrValue = this.channelOption[0].value; this.getTerminalPhotoList( this.selectChannelValue, this.dateValue, @@ -516,6 +565,10 @@ export default { console.log(val); this.getTerminalPhotoList(val, this.dateValue, this.zztermId); }, + //焦距切换通道 + changeChannelarrValue(val) { + console.log(val); + }, //选择时间 changedate() { console.log(this.dateValue.getTime()); @@ -1034,6 +1087,53 @@ export default { this.timer = null; } //利用vue的生命周期函数 }, + //焦距放大缩小 + amplify() { + getTermStatus({ termId: this.zztermId }).then((res) => { + console.log(res); + if (res.data.isonline) { + updateTermCamera({ + termId: this.zztermId, + channelId: this.channelarrValue, + type: 6, + }) + .then((res) => {}) + .catch(); + //this.$refs.infodialog_ref.getListData(this.channelId, this.cmdid); + } else { + this.$message({ + duration: 1500, + showClose: true, + message: "装置下线,发送指令失败", + type: "error", + }); + } + }); + console.log(this.channelarrValue, this.zztermId); + }, + //焦距缩小 + reduce() { + getTermStatus({ termId: this.zztermId }).then((res) => { + console.log(res); + if (res.data.isonline) { + updateTermCamera({ + termId: this.zztermId, + channelId: this.channelarrValue, + type: 7, + }) + .then((res) => {}) + .catch(); + //this.$refs.infodialog_ref.getListData(this.channelId, this.cmdid); + } else { + this.$message({ + duration: 1500, + showClose: true, + message: "装置下线,发送指令失败", + type: "error", + }); + } + }); + }, }, destroyed() { @@ -1202,7 +1302,8 @@ export default { } .paramsDate, .monitorItemBox, - .setTimebtn { + .setTimebtn, + .setfocalLength { margin-bottom: 16px; position: relative; h3 { @@ -1226,6 +1327,31 @@ export default { } } } + .setfocalLength { + .selectChannel { + display: flex; + align-items: center; + margin-bottom: 12px; + .labelname { + font-size: 14px; + margin-right: 4px; + width: 80px; + color: #666; + } + } + .buttonGroup { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + .el-button { + margin-bottom: 8px; + width: 104px; + } + .el-button + .el-button { + margin-left: 0px; + } + } + } } } } From 9ee2b57776b9751652a0e16cb297c674506f38de Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Wed, 2 Aug 2023 14:40:15 +0800 Subject: [PATCH 40/45] =?UTF-8?q?=E6=8B=8D=E7=85=A7=E8=A3=85=E7=BD=AE?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A7=84=E7=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/setdevice.vue | 16 +- .../components/setschedule.vue | 493 +++++++++++++++++- src/views/realTimeMonitor/index.vue | 8 +- 3 files changed, 491 insertions(+), 26 deletions(-) diff --git a/src/views/devicePhotoSchedule/components/setdevice.vue b/src/views/devicePhotoSchedule/components/setdevice.vue index cd4150b..5bc8730 100644 --- a/src/views/devicePhotoSchedule/components/setdevice.vue +++ b/src/views/devicePhotoSchedule/components/setdevice.vue @@ -298,6 +298,8 @@ export default { var Etime = moment(this.ruleSchedule[j].endTime) .add(this.allCheckNode[i].offsetNum, "minute") .format(); + var lastETime = moment(this.ruleSchedule[j].endTime).format(); + var spanTime = this.ruleSchedule[j].span; console.log(spanTime); console.log(moment(this.ruleSchedule[j].endTime).hour()); @@ -378,14 +380,17 @@ export default { console.log("河南规约"); //偏移时间 //this.getDayArr(startDay, endDay); + let startDay = Stime; let endDay = Etime; + var lastendDay = lastETime; + console.log(lastETime); console.log(startDay, endDay); let startVal = this.$moment(new Date(startDay)).format( "YYYY-MM-DD HH:mm" ); console.log(startVal); - + console.log(moment().isSame(moment(endDay), "day")); while (this.$moment(startVal).isBefore(endDay)) { dayArr.push(startVal); // 自增 @@ -396,9 +401,12 @@ export default { } // // 将结束日期的天放进数组 - dayArr.push( - this.$moment(new Date(endDay)).format("YYYY-MM-DD HH:mm") - ); + if (!moment().isSame(moment(endDay), "day")) { + dayArr.push( + this.$moment(new Date(lastETime)).format("YYYY-MM-DD HH:mm") + ); + } + console.log(dayArr); for (var k = 0; k < dayArr.length; k++) { //console.log(moment(dayArr[k]).hour()); diff --git a/src/views/realTimeMonitor/components/setschedule.vue b/src/views/realTimeMonitor/components/setschedule.vue index 309dd5a..ebcecc3 100644 --- a/src/views/realTimeMonitor/components/setschedule.vue +++ b/src/views/realTimeMonitor/components/setschedule.vue @@ -50,12 +50,22 @@
时间表:
{{ val.substring(0, val.lastIndexOf(":")) }}{{ val.substring(val.length - 5) }} + {{ $moment(val).format("HH:mm") }} +
@@ -65,11 +75,20 @@ >
{{ val.substring(val.length - 5) }} + {{ val.substring(0, val.lastIndexOf(":")) }}{{ $moment(val).format("HH:mm") }}
@@ -101,10 +120,10 @@ - + + +
+ + 全部 + 在线 + 离线 + +
{ - console.log(res); - this.lineTreeData = res.data.list; - this.$nextTick(() => { - this.$refs.tree.setCurrentKey(this.selectData.id); //一定要加这个选中了否则样式没有出来 + console.log("11111111"); + console.log(this.filterText); + if (this.filterText !== "") { + this.$refs.tree.filter(this.filterText); + } else { + getdyTreeListJoggle() + .then((res) => { + console.log(res); + this.lineTreeData = res.data.list; + this.$nextTick(() => { + this.$refs.tree.setCurrentKey(this.selectData.id); //一定要加这个选中了否则样式没有出来 + }); + }) + .catch((err) => { + console.log(err); //代码错误、请求失败捕获 }); - }) - .catch((err) => { - console.log(err); //代码错误、请求失败捕获 - }); + } }, //树状图搜索 filterNode(value, data, node) { - console.log(value, data, node); - + //console.log(value, data, node); + this.filterText = value; + console.log(this.filterText); // 如果什么都没填全部匹配全部返回 if (!value) return true; this.searchName = data.name + data.cmdid; - console.log(this.searchName); + //console.log(this.searchName); // 如果传入的value和data中的label相同,匹配成功 if (this.searchName.indexOf(value) !== -1) { return true; @@ -1200,6 +1219,20 @@ export default { } } } + .radioFilter { + width: 94%; + margin: 0 auto; + margin-bottom: 8px; + font-size: 12px; + .el-radio-group { + display: flex; + align-items: center; + justify-content: center; + .el-radio { + margin-right: 16px; + } + } + } .el-tree { overflow-y: auto; overflow-x: hidden; From de7af2db3d238b0d02c9835593ad0eb19f6a938b Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Thu, 3 Aug 2023 17:50:56 +0800 Subject: [PATCH 44/45] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=A6=BB=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/api/index.js | 7 ++- src/views/components/carouselChart.vue | 49 ++++++++++++++++++ src/views/realTimeMonitor/index.vue | 71 +++++++++++++++++++++++--- vue.config.js | 2 +- 4 files changed, 119 insertions(+), 10 deletions(-) diff --git a/src/utils/api/index.js b/src/utils/api/index.js index 021044a..21dc317 100644 --- a/src/utils/api/index.js +++ b/src/utils/api/index.js @@ -54,8 +54,11 @@ export function alarmMarkJoggle(data) { export function getdyTreeListJoggle(data) { return request({ url: "/api/getdyTreeList", - method: "post", - data, + method: "get", + params: data, + headers: { + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + }, }); } //获取图片接口 diff --git a/src/views/components/carouselChart.vue b/src/views/components/carouselChart.vue index 803411e..aeb294c 100644 --- a/src/views/components/carouselChart.vue +++ b/src/views/components/carouselChart.vue @@ -2,6 +2,7 @@
+
+ 下载图片
{ + const canvas = document.createElement("canvas"); + canvas.width = image.width; + canvas.height = image.height; + const ctx = canvas.getContext("2d"); + ctx.drawImage(image, 0, 0, image.width, image.height); + canvas.toBlob((blob) => { + const url = URL.createObjectURL(blob); + this.download(url, name); + // 用完释放URL对象 + URL.revokeObjectURL(url); + }); + }; + }, + download(href, name) { + const eleLink = document.createElement("a"); + eleLink.download = name; + eleLink.href = href; + eleLink.click(); + eleLink.remove(); + }, // showbigpicPath(data) { // console.log(data); // if (data.includes("!")) { @@ -582,6 +618,19 @@ export default { overflow: hidden; margin-bottom: 4px; position: relative; + .downBtn { + position: absolute; + background: rgba(0, 0, 0, 0.5); + border: none; + right: 8px; + bottom: 16px; + color: #fff; + z-index: 5; + &:hover { + background: rgba(0, 0, 0, 0.9); + color: #169e8c; + } + } &:hover { .arrow { opacity: 1; diff --git a/src/views/realTimeMonitor/index.vue b/src/views/realTimeMonitor/index.vue index 4362a13..2491621 100644 --- a/src/views/realTimeMonitor/index.vue +++ b/src/views/realTimeMonitor/index.vue @@ -22,10 +22,17 @@
- 全部 - 在线 - 离线 + 全部 + 在线 + 离线 + 刷新
{ setTimeout(this.getLineTreeStatus(), 0); @@ -401,7 +410,9 @@ export default { methods: { //获取当前选中的radio getRadio() { - console.log(); + console.log(this.zzradio); + localStorage.setItem("radio", JSON.stringify(this.zzradio)); + this.getLineTreeStatus(); }, //获取当前时间 getDateTime() { @@ -455,10 +466,11 @@ export default { if (this.filterText !== "") { this.$refs.tree.filter(this.filterText); } else { - getdyTreeListJoggle() + getdyTreeListJoggle({ type: this.zzradio }) .then((res) => { console.log(res); this.lineTreeData = res.data.list; + this.$nextTick(() => { this.$refs.tree.setCurrentKey(this.selectData.id); //一定要加这个选中了否则样式没有出来 }); @@ -484,11 +496,13 @@ export default { }, //获取左侧树结构 getLineTreeList() { - getdyTreeListJoggle() + console.log(this.zzradio); + getdyTreeListJoggle({ type: this.zzradio }) .then((res) => { console.log(res); this.lineTreeData = res.data.list; console.log(this.lineTreeData); + this.onlineNum = res.data.onlineNum; this.totalNum = res.data.totalNum; this.currentData = JSON.parse(localStorage.getItem("currentData")); @@ -521,6 +535,45 @@ export default { this.$refs.tree.setCurrentKey(this.currentNodekey); //一定要加这个选中了否则样式没有出来 }); } + // if (this.zzradio == -1) { + // this.lineTreeData = this.lineTreeData; + // } else if (this.zzradio == 1) { + // //在线 + // var data = JSON.parse(JSON.stringify(this.lineTreeData)); + // console.log(data); + // const filterId = (data, id) => { + // if (!Array.isArray(data)) { + // return data; + // } + // return data.filter((item) => { + // if ("list" in item) { + // item.list = filterId(item.list, id); + // } + // return item.onlinestatus !== 0; + // }); + // }; + // const filtredData = filterId(data); + // console.log(filtredData); + // this.lineTreeData = filtredData; + // } else if (this.zzradio == 0) { + // //离线 + // var data = JSON.parse(JSON.stringify(this.lineTreeData)); + // console.log(data); + // const filterId = (data, id) => { + // if (!Array.isArray(data)) { + // return data; + // } + // return data.filter((item) => { + // if ("list" in item) { + // item.list = filterId(item.list, id); + // } + // return item.onlinestatus !== 1; + // }); + // }; + // const filtredData = filterId(data); + // console.log(filtredData); + // this.lineTreeData = filtredData; + // } }) .catch((err) => { console.log(err); //代码错误、请求失败捕获 @@ -1224,6 +1277,10 @@ export default { margin: 0 auto; margin-bottom: 8px; font-size: 12px; + display: flex; + justify-content: space-around; + .refresh { + } .el-radio-group { display: flex; align-items: center; diff --git a/vue.config.js b/vue.config.js index 040028d..31ee2c5 100644 --- a/vue.config.js +++ b/vue.config.js @@ -30,7 +30,7 @@ module.exports = defineConfig({ "/api": { //表示拦截以/api开头的请求路径 target: "http://47.96.238.157:8093", //阿里云服务器环境 - //target: "http://180.166.218.222:40080", //dell + // target: "http://180.166.218.222:40080", //dell changOrigin: true, //是否开启跨域 pathRewrite: { "^/api": "", //重写api,把api变成空字符,因为我们真正请求的路径是没有api的 From 948adb6ee03a150e68e659d70aed5fdb590aeccb Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Fri, 4 Aug 2023 10:57:40 +0800 Subject: [PATCH 45/45] =?UTF-8?q?=E6=97=B6=E9=97=B4=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/realTimeMonitor/components/setschedule.vue | 6 +++++- src/views/realTimeMonitor/index.vue | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/views/realTimeMonitor/components/setschedule.vue b/src/views/realTimeMonitor/components/setschedule.vue index 2c00f6d..6e5432f 100644 --- a/src/views/realTimeMonitor/components/setschedule.vue +++ b/src/views/realTimeMonitor/components/setschedule.vue @@ -870,7 +870,10 @@ export default { dyid: this.listnr[0].id, xlname: this.listnr[0].list[0].name, xlid: this.listnr[0].list[0].id, - zzname: this.listnr[0].list[0].list[0].name, + zzname: + this.listnr[0].list[0].list[0].name == null + ? this.listnr[0].list[0].list[0].cmdid + : this.listnr[0].list[0].list[0].name, zzcmid: this.listnr[0].list[0].list[0].cmdid, zzid: this.listnr[0].list[0].list[0].id, zzprotocol: this.timeProtocol, @@ -1155,6 +1158,7 @@ export default { }, closebtn() { this.isShowset = false; + this.deviceListData = []; this.checkList = ""; // this.setNum = this.offsetnum; this.deviceList(); diff --git a/src/views/realTimeMonitor/index.vue b/src/views/realTimeMonitor/index.vue index 2491621..46b17be 100644 --- a/src/views/realTimeMonitor/index.vue +++ b/src/views/realTimeMonitor/index.vue @@ -400,7 +400,10 @@ export default { }, created() { //获取日期 - this.zzradio = JSON.parse(localStorage.getItem("radio")); + this.zzradio = + JSON.parse(localStorage.getItem("radio")) !== null + ? JSON.parse(localStorage.getItem("radio")) + : -1; this.getRadio(); this.getLineTreeList(); this.treetimer = window.setInterval(() => {