{"remainingRequest":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Manage\\duty\\CMGTDutyMonitorMap.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Manage\\duty\\CMGTDutyMonitorMap.vue","mtime":1691463999680},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nimport CommonApi from '@/views/Manage/CommonApi.js'\r\nimport CmgtDutyWorkarrangeApi from '@/views/Manage/duty/api/CmgtDutyWorkarrangeApi'\r\nimport CmgtDutyJobApi from '@/views/Manage/duty/api/CmgtDutyJobApi'\r\n\r\nexport default {\r\n name: 'CMGTDutyMonitorMap',\r\n components: {},\r\n data() {\r\n return {\r\n // src: '/gisapi/station-n-map/#/DeviceManagerGisView?mapMode=2D',\r\n src:\r\n window.context.map +\r\n '/station-n-map/#/DeviceManagerGisView?mapMode=2D',\r\n jobOptions: [],\r\n jobValue: [],\r\n timer: null,\r\n point: {},\r\n showDialog: false,\r\n top: 0,\r\n left: 0,\r\n btnBoolen: true, //控制筛选弹层的显示与隐藏\r\n searchForm: {\r\n jobId: ''\r\n },\r\n rules: {\r\n jobId: [\r\n {required: true, message: '请选择岗位', trigger: 'blur'}\r\n ]\r\n },\r\n timer: null,\r\n personTimer: null, // 人员实时点位刷新定时器\r\n tableData: [],\r\n spanArr: []\r\n }\r\n },\r\n created() {\r\n this.initData()\r\n },\r\n mounted() {\r\n const t = this\r\n this.timer = setInterval(function() {\r\n if (t.$refs.windowiframe.contentWindow.deviceGisFunction) {\r\n t.$refs.windowiframe.contentWindow.deviceGisFunction.layerVisible(\r\n []\r\n )\r\n t.$refs.windowiframe.contentWindow.deviceGisFunction.addPickListener(\r\n p => {\r\n // t.$refs.windowiframe.contentWindow.deviceGisFunction.removePopupLocator()\r\n console.log(p);\r\n t.showDialogData(p)\r\n }\r\n )\r\n clearInterval(t.timer)\r\n }\r\n }, 500)\r\n },\r\n methods: {\r\n initData() {\r\n CmgtDutyJobApi.loadCmgtDutyJob(\r\n {\r\n pageBean: {\r\n pageSize: 100,\r\n page: 1\r\n },\r\n params: {},\r\n querys: []\r\n },\r\n res => {\r\n this.jobOptions = res.rows\r\n }\r\n )\r\n },\r\n // loadStaff() {\r\n // const query = {}\r\n // if (this.jobValue && this.jobValue.length > 0) {\r\n // query.jobIds = this.jobValue\r\n // }\r\n // if (this.$refs.windowiframe) {\r\n // this.$refs.windowiframe.contentWindow.deviceGisFunction.clearElectronicFence()\r\n // this.$refs.windowiframe.contentWindow.deviceGisFunction.removeAllPeople()\r\n // }\r\n // CmgtDutyWorkarrangeApi.findCurrentStaffOnDuty(query, res => {\r\n // const vs = res.value\r\n // .map(m => {\r\n // return {\r\n // ...m,\r\n // id: m.id,\r\n // job: m.job,\r\n // name: m.name,\r\n // icon:\r\n // m.status === 'ONLINE'\r\n // ? 'DUTY_P3_ONLINE.png'\r\n // : m.status === 'CROSSING'\r\n // ? 'DUTY_P3_ERROR.png'\r\n // : 'DUTY_P3_OFFLINE.png',\r\n // point: m.location ? m.location.split(',', 2).map(Number) : [],\r\n // areaCode: 'CQBZ_BGC_F1'\r\n // }\r\n // })\r\n // .filter(item => {\r\n // return item.point.length > 0\r\n // })\r\n\r\n // // 加区域\r\n // if (query.jobIds) {\r\n // query.jobIds.forEach(j => {\r\n // const jobOpt = this.jobOptions.find(o => {\r\n // if (o.id === j) {\r\n // return true\r\n // }\r\n // return false\r\n // })\r\n // if (jobOpt.area) {\r\n // const peops = vs.filter(v => {\r\n // return v.job === j\r\n // })\r\n // this.$refs.windowiframe.contentWindow.deviceGisFunction.addElectronicFence(\r\n // {id: j, points: JSON.parse(jobOpt.area)},\r\n // peops\r\n // )\r\n // }\r\n // })\r\n // } else {\r\n // this.$refs.windowiframe.contentWindow.deviceGisFunction.addPeopleData(\r\n // vs\r\n // )\r\n // }\r\n // console.log('-------------res-------------', vs)\r\n // })\r\n // },\r\n\r\n showDialogData(point) {\r\n console.log('============', point)\r\n if (point.data) {\r\n this.point = point\r\n // this.left = this.point.position.x\r\n // this.top = this.point.position.y + 25\r\n this.showDialog = true\r\n this.$refs.windowiframe.contentWindow.deviceGisFunction.addPopupLocator(\r\n {\r\n position: point.gisPosition,\r\n locator: windowPosition => {\r\n this.left = parseInt(windowPosition.x) - 5\r\n this.top = parseInt(windowPosition.y) + 12\r\n }\r\n }\r\n )\r\n }\r\n },\r\n\r\n closeDialog() {\r\n this.$refs.windowiframe.contentWindow.deviceGisFunction.removePopupLocator()\r\n this.point = {\r\n data: null\r\n }\r\n this.showDialog = false\r\n },\r\n searchUserLat() {\r\n clearInterval(this.personTimer)\r\n this.getUserLat()\r\n this.personTimer = setInterval(() => {\r\n this.getUserLat()\r\n }, 10000)\r\n },\r\n // 获取图层数据\r\n getUserLat() {\r\n this.$refs.form.validate(valid => {\r\n if (valid) {\r\n this.$refs.windowiframe.contentWindow.deviceGisFunction.removeAllPeople()\r\n CmgtDutyJobApi.getCmgtDutyUserLatByID(\r\n this.qs.stringify(this.searchForm),\r\n res => {\r\n this.tableData = res.value\r\n this.tableData.forEach(it => {\r\n if(!it.deviceCode) {\r\n it.deviceCode = '11111111'\r\n }\r\n })\r\n this.getSpanArr()\r\n let arr = res.value.map(item => {\r\n return {\r\n id: item.id,\r\n point: [\r\n Number(item.latitude),\r\n Number(item.longitude)\r\n ],\r\n areaCode: item.areaCode,\r\n icon: 'DUTY_P1_ONLINE.png',\r\n name: item.name,\r\n ...item\r\n }\r\n })\r\n this.$refs.windowiframe.contentWindow.deviceGisFunction.addPeopleData(\r\n arr\r\n )\r\n }\r\n )\r\n }\r\n })\r\n },\r\n // 切换展开隐藏\r\n changeBtn() {\r\n this.btnBoolen = !this.btnBoolen\r\n },\r\n // 清空图层及搜索\r\n clearUserLat() {\r\n this.searchForm.jobId = ''\r\n this.tableData = []\r\n this.$refs.windowiframe.contentWindow.deviceGisFunction.removeAllPeople()\r\n clearInterval(this.personTimer)\r\n },\r\n getSpanArr() {\r\n for (var i = 0; i < this.tableData.length; i++) {\r\n if (i === 0) {\r\n this.spanArr.push(1)\r\n this.pos = 0\r\n } else {\r\n // 判断当前元素与上一个元素是否相同 deviceCode\r\n if (this.tableData[i].deviceCode === this.tableData[i - 1].deviceCode) {\r\n this.spanArr[this.pos] += 1\r\n this.spanArr.push(0)\r\n } else {\r\n this.spanArr.push(1)\r\n this.pos = i\r\n }\r\n }\r\n }\r\n },\r\n //进行表格合并\r\n objectSpanMethod({row, column, rowIndex, columnIndex}) {\r\n if (columnIndex === 0) {\r\n const _row = this.spanArr[rowIndex]\r\n const _col = _row > 0 ? 1 : 0\r\n return {\r\n rowspan: _row,\r\n colspan: _col\r\n }\r\n }\r\n }\r\n },\r\n beforeDestroy() {\r\n clearInterval(this.timer)\r\n clearInterval(this.personTimer)\r\n }\r\n}\r\n",null]}