diff --git a/src/api/system/user.js b/src/api/system/user.js index 02a38d0..3b67ef5 100644 --- a/src/api/system/user.js +++ b/src/api/system/user.js @@ -93,3 +93,12 @@ } }) } + +// 在线用户查询 +export function getUserOnLine(params) { + return request({ + url: '/userDevice/userDeviceOnLine', + method: 'get', + params + }) +} diff --git a/src/api/system/user.js b/src/api/system/user.js index 02a38d0..3b67ef5 100644 --- a/src/api/system/user.js +++ b/src/api/system/user.js @@ -93,3 +93,12 @@ } }) } + +// 在线用户查询 +export function getUserOnLine(params) { + return request({ + url: '/userDevice/userDeviceOnLine', + method: 'get', + params + }) +} diff --git a/src/assets/case/offline.png b/src/assets/case/offline.png new file mode 100644 index 0000000..d0a290f --- /dev/null +++ b/src/assets/case/offline.png Binary files differ diff --git a/src/api/system/user.js b/src/api/system/user.js index 02a38d0..3b67ef5 100644 --- a/src/api/system/user.js +++ b/src/api/system/user.js @@ -93,3 +93,12 @@ } }) } + +// 在线用户查询 +export function getUserOnLine(params) { + return request({ + url: '/userDevice/userDeviceOnLine', + method: 'get', + params + }) +} diff --git a/src/assets/case/offline.png b/src/assets/case/offline.png new file mode 100644 index 0000000..d0a290f --- /dev/null +++ b/src/assets/case/offline.png Binary files differ diff --git a/src/assets/case/online.png b/src/assets/case/online.png new file mode 100644 index 0000000..767bcc5 --- /dev/null +++ b/src/assets/case/online.png Binary files differ diff --git a/src/api/system/user.js b/src/api/system/user.js index 02a38d0..3b67ef5 100644 --- a/src/api/system/user.js +++ b/src/api/system/user.js @@ -93,3 +93,12 @@ } }) } + +// 在线用户查询 +export function getUserOnLine(params) { + return request({ + url: '/userDevice/userDeviceOnLine', + method: 'get', + params + }) +} diff --git a/src/assets/case/offline.png b/src/assets/case/offline.png new file mode 100644 index 0000000..d0a290f --- /dev/null +++ b/src/assets/case/offline.png Binary files differ diff --git a/src/assets/case/online.png b/src/assets/case/online.png new file mode 100644 index 0000000..767bcc5 --- /dev/null +++ b/src/assets/case/online.png Binary files differ diff --git a/src/views/supControl/supControl.vue b/src/views/supControl/supControl.vue index 510d96e..490ec1c 100644 --- a/src/views/supControl/supControl.vue +++ b/src/views/supControl/supControl.vue @@ -49,7 +49,7 @@ 案卷 人员 - 部件 + @@ -75,7 +75,7 @@ - + 监督员 处置员 @@ -120,7 +120,9 @@ import request from '@/utils/request' import SupStatisPanel from '@/views/supControl/SupStatisPanel' import { getCaseType, getCaseDetailType } from '@/api/callCase/callCase' +import { getUserOnLine } from '@/api/system/user' import Leaflet from 'leaflet' +import { mapGetters } from 'vuex' const toHandleIcon = Leaflet.icon({ iconUrl: require('@/assets/case/status_toHandle.png'), @@ -144,10 +146,24 @@ }) const redIcon = Leaflet.icon({ - iconUrl: require('@/assets/case/status_overTime.png'), // icon阴影图片路径 - iconSize: [19, 31], // size of the icon - iconAnchor: [10, 31], // point of the icon which will correspond to marker's location - popupAnchor: [-0, -32] // point from which the popup should open relative to the iconAnchor + iconUrl: require('@/assets/case/status_overTime.png'), + iconSize: [19, 31], + iconAnchor: [10, 31], + popupAnchor: [-0, -32] +}) + +const offlineIcon = Leaflet.icon({ + iconUrl: require('@/assets/case/offline.png'), + iconSize: [32, 32], + iconAnchor: [16, 32], + popupAnchor: [-0, -32] +}) + +const onlineIcon = Leaflet.icon({ + iconUrl: require('@/assets/case/online.png'), + iconSize: [32, 32], + iconAnchor: [16, 32], + popupAnchor: [-0, -32] }) const esri = require('esri-leaflet') @@ -155,20 +171,10 @@ export default { name: 'SupControl', components: { SupStatisPanel }, - props: { - longitude: { - type: Number, - default: 116.5937 - }, - latitude: { - type: Number, - default: 28.249 - } - }, data() { return { map: '', - baselayer: [], + baseLayer: [], parts: { eorc: '2', // 类别 casetypeCode: '', // 部件大类编码, @@ -191,13 +197,6 @@ casepersonCode: 'supervisor', labelPosition: 'right', caseTypeOpts: [], // 部件大类下拉框 - casePersonOpts: [{ - value: 'supervisor', - label: '监督人员' - }, { - value: 'process', - label: '处置人员' - }], // 人员分类下拉框 caseDetailTypeOpts: [], // 部件小类下拉框 caseTypeCodeAuto: '', // 自动生成的案卷大类代码 caseTypeDetailCodeAuto: '', // 自动生成的案卷小类代码 @@ -213,13 +212,18 @@ toCheckListNot: [], // 待核查 toHandleListOt: [], // 处置中超时 toHandleListNot: [], // 处置中 - layerGroup: [], + caseLayerGroup: [], // 案卷图层组 toVerifyCaseNot: null, toVerifyCaseOt: null, toCheckCaseNot: null, toCheckCaseOt: null, toHandleCaseNot: null, toHandleCaseOt: null, + onlineList: [], // 在岗人员列表 + offlineList: [], // 离线人员列表 + personLayerGroup: [], // 人员图层组 + offlinePerson: null, + onlinePerson: null, imageBaseUrl: this.baseConfig.baseUrl + '/static/' } }, @@ -232,7 +236,12 @@ }, caseTypeDetail() { return this.parts.casetypeDetailCode - } + }, + ...mapGetters([ + 'baseUrl', + 'partsUrl', + 'mapUrl' + ]) }, watch: { caseType(typeVal) { @@ -253,12 +262,17 @@ this.initMap() this.switchContent() - this.layerGroup.push(this.toVerifyCaseNot) - this.layerGroup.push(this.toVerifyCaseOt) - this.layerGroup.push(this.toCheckCaseNot) - this.layerGroup.push(this.toCheckCaseOt) - this.layerGroup.push(this.toHandleCaseNot) - this.layerGroup.push(this.toHandleCaseOt) + // 案卷图层 + this.caseLayerGroup.push(this.toVerifyCaseNot) + this.caseLayerGroup.push(this.toVerifyCaseOt) + this.caseLayerGroup.push(this.toCheckCaseNot) + this.caseLayerGroup.push(this.toCheckCaseOt) + this.caseLayerGroup.push(this.toHandleCaseNot) + this.caseLayerGroup.push(this.toHandleCaseOt) + + // 人员图层 + this.personLayerGroup.push(this.offlinePerson) + this.personLayerGroup.push(this.onlinePerson) }, methods: { handleTimeTermChanged: function(caseCounts) { @@ -277,11 +291,14 @@ this.showPersonSelect = true this.showPartsSelect = false this.showCaseSelect = false - this.casePerson() + + // 查询人员 + this.queryPerson() } else if (this.queryEventSwitch === '0') { this.showCaseSelect = true this.showPartsSelect = false this.showPersonSelect = false + // 查询三个状态的案卷列表 this.queryCaseToVerify() this.queryCaseToCheck() @@ -330,13 +347,13 @@ } // 清除所有的图层 - this.layerGroup.forEach(item => { + this.caseLayerGroup.forEach(item => { that.map.removeLayer(item) }) // 重新添加指定状态的图层 filterIndex.forEach(i => { - that.layerGroup[i].addTo(that.map) + that.caseLayerGroup[i].addTo(that.map) }) }, queryCaseToVerify: function() { @@ -372,7 +389,7 @@ } }) }, - queryCaseToCheck() { + queryCaseToCheck: function() { const that = this const onePageParam = { limit: 1000, @@ -405,7 +422,7 @@ } }) }, - queryCaseToHandle() { + queryCaseToHandle: function() { const that = this const onePageParam = { limit: 1000, @@ -439,12 +456,40 @@ }) }, // 查询人员 - casePerson() { - this.clearPoint() + queryPerson: function() { + const that = this + + // 清除所有的人员图层 + this.personLayerGroup.forEach(item => { + that.map.removeLayer(item) + }) this.personQuery.roleTips = this.casepersonCode if (this.casepersonCode !== '') { - this.addPersonPoints() + getUserOnLine(this.personQuery).then(res => { + if (res.code === 200) { + if (res.data.length > 0) { + // 查询有新结果时清除原有的列表 + this.onlineList = [] + this.offlineList = [] + + // 清除图层组 + this.onlinePerson.clearLayers() + this.offlinePerson.clearLayers() + + res.data.forEach(item => { + if (item.onLine === true) { // 在线标志位 + that.onlineList.push(item) + } else { + that.offlineList.push(item) + } + }) + + this.addPersonPoints(this.onlineList, this.onlinePerson, onlineIcon) + this.addPersonPoints(this.offlineList, this.offlinePerson, offlineIcon) + } + } + }) } }, // 级联查询部件大类 @@ -493,23 +538,34 @@ } }, clearPoint: function() { + const that = this + // 清除所有案卷的图层 + this.caseLayerGroup.forEach(item => { + that.map.removeLayer(item) + }) + // 清除所有的人员图层 + this.personLayerGroup.forEach(item => { + that.map.removeLayer(item) + }) }, - addCasePointOnMap: function(caseList, layerGroup, icon) { + addCasePointOnMap: function(caseList, caseLayerGroup, icon) { caseList.forEach(caseDetail => { - let popupStr = '
案卷概要信息
' + - '
' + caseDetail.caseid + '
' + - '
' + caseDetail.caseStateName + '
' + - '
' + caseDetail.casetypeName + ' / ' + caseDetail.casetypeDetailName + '
' + - '
' + caseDetail.fieldintro + '
' + - '
' + caseDetail.description + '
' + - '
' + caseDetail.reportTime + '
' + let popupStr = '