{"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\\CMGTDutyPatrolledMap.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Manage\\duty\\CMGTDutyPatrolledMap.vue","mtime":1695626572392},{"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//\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\nimport TeamMemberManage from '@/api/manager/duty/teamMemberManage.js'\r\nimport CmgtBasePositionApi from '@/views/Manage/base/api/CmgtBasePositionApi'\r\nexport default {\r\n name: 'DutyGQGWSSFB',\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 memberSelectOptions: [],\r\n jobValue: [],\r\n querys: [\r\n {\r\n group: 'main',\r\n operation: 'BETWEEN',\r\n parentGroup: '',\r\n property: 'receive_time_',\r\n relation: 'AND',\r\n value: [\r\n new Date().format('yyyy-MM-dd') + ' 00:00:00',\r\n new Date().format('yyyy-MM-dd HH:mm:ss')\r\n ]\r\n },\r\n {\r\n group: 'main',\r\n operation: 'EQUAL',\r\n parentGroup: '',\r\n property: 'member_id_',\r\n relation: 'AND',\r\n value: ''\r\n }\r\n ],\r\n point: {},\r\n showDialog: false,\r\n top: 0,\r\n left: 0,\r\n btnBoolen: true, //控制筛选弹层的显示与隐藏\r\n searchForm: {\r\n endTime: '',\r\n startTime: '',\r\n jobId: '',\r\n teamMemberId: ''\r\n },\r\n carList: [],\r\n rules: {\r\n teamMemberId: [\r\n {required: true, message: '请选择人员', trigger: 'blur'}\r\n ],\r\n endTime: [\r\n {required: true, message: '请选择开始时间', trigger: 'blur'}\r\n ],\r\n startTime: [\r\n {required: true, message: '请选择结束时间', trigger: 'blur'}\r\n ]\r\n },\r\n timer: null\r\n }\r\n },\r\n created() {\r\n this.initData()\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 // 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 this.loadMemberOptions()\r\n },\r\n loadMemberOptions(jobId) {\r\n TeamMemberManage.loadMember(\r\n {\r\n pageBean: {\r\n page: 1,\r\n pageSize: -1\r\n },\r\n params: {},\r\n querys: jobId\r\n ? [\r\n {\r\n group: 'main',\r\n operation: 'EQUAL',\r\n parentGroup: '',\r\n property: 'job_',\r\n relation: 'AND',\r\n value: jobId\r\n }\r\n ]\r\n : []\r\n },\r\n res => {\r\n console.log('========res===res===', res)\r\n this.memberSelectOptions = res.rows\r\n }\r\n )\r\n },\r\n loadAccident() {\r\n const queryParam = {\r\n pageBean: {\r\n pageSize: 20,\r\n page: 1\r\n },\r\n params: {},\r\n querys: [\r\n {\r\n group: 'main',\r\n operation: 'EQUAL',\r\n parentGroup: '',\r\n property: 'dtype_',\r\n relation: 'AND',\r\n value: 'ACCIDENT'\r\n }\r\n ]\r\n }\r\n\r\n CmgtBasePositionApi.loadCmgtBasePosition(queryParam, res => {\r\n // console.log('========res===loadCmgtBasePosition===', res)\r\n const vs = res.rows.map(m => {\r\n return {\r\n ...m,\r\n id: m.id,\r\n name: m.name,\r\n icon: 'DUTY_W4_WARNING.png',\r\n flashInterval: 300,\r\n dataType: 'ACCIDENT',\r\n point: [m.latitude, m.longitude].map(Number),\r\n areaCode: 'CQBZ_BGC_F1'\r\n }\r\n })\r\n this.$refs.windowiframe.contentWindow.deviceGisFunction.addCarData(\r\n vs\r\n )\r\n // this.$refs.windowiframe.contentWindow.deviceGisFunction.addPolyline([[106.545791, 29.6087, 216.76], [106.54605, 29.609011, 215.72], [106.546922, 29.608907, 216.95], [106.547482, 29.608453, 216.97], [106.548035, 29.608679, 216.76], [106.548598, 29.608584, 216.76]])\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 this.$refs.windowiframe.contentWindow.deviceGisFunction.clearPolyline()\r\n }\r\n\r\n if (this.querys[0].value) {\r\n query.rq = this.querys[0].value\r\n }\r\n\r\n if (this.querys[1].value) {\r\n query.member = this.querys[1].value\r\n }\r\n console.log('========query==========', query)\r\n CmgtDutyWorkarrangeApi.findCurrentStaffOnDuty(query, res => {\r\n const vs = res.value.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 dataType: 'TEAMMEMBER',\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.split(',', 2).map(Number),\r\n areaCode: 'CQBZ_BGC_F1'\r\n }\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 res.value.forEach(m => {\r\n this.$refs.windowiframe.contentWindow.deviceGisFunction.addPolyline(\r\n m.track\r\n )\r\n })\r\n }\r\n })\r\n },\r\n\r\n showDialogData(point) {\r\n if (point.data) {\r\n if (point.data.dataType === 'ACCIDENT') {\r\n return\r\n }\r\n this.point = point\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 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 // 获取图层数据\r\n getUserLat() {\r\n this.$refs.form.validate(valid => {\r\n if (valid) {\r\n this.$refs.windowiframe.contentWindow.deviceGisFunction.clearPolyline()\r\n CmgtDutyJobApi.getCmgtDutyUserLatByID(\r\n this.qs.stringify(this.searchForm),\r\n res => {\r\n console.log(res)\r\n if (res.value.length) {\r\n let arr = res.value[0].gpsInfo.map(item => {\r\n return [\r\n Number(item.latitude),\r\n Number(item.longitude)\r\n ]\r\n })\r\n console.log(arr)\r\n this.$refs.windowiframe.contentWindow.deviceGisFunction.addPolyline(\r\n arr,\r\n '#13d36a'\r\n )\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.searchForm.startTime = ''\r\n this.searchForm.endTime = ''\r\n this.$refs.windowiframe.contentWindow.deviceGisFunction.clearPolyline()\r\n },\r\n // 切换岗位\r\n changeJob(value) {\r\n this.searchForm.teamMemberId = ''\r\n this.loadMemberOptions(value)\r\n },\r\n // 切换人员\r\n changePerson(value) {\r\n this.$refs.windowiframe.contentWindow.deviceGisFunction.hiddenRegion()\r\n CmgtDutyJobApi.getAreaCodeByPersonId(value, res => {\r\n if (res.value.length) {\r\n let arr = res.value.map(item => {\r\n return item.CODE_\r\n })\r\n this.$refs.windowiframe.contentWindow.deviceGisFunction.showRegions(\r\n arr,\r\n '#0a0'\r\n )\r\n }\r\n })\r\n }\r\n },\r\n beforeDestroy() {\r\n clearInterval(this.timer)\r\n }\r\n}\r\n",null]}