diff --git a/src/components/Map/leafletMap.vue b/src/components/Map/leafletMap.vue index 3217e42..c2c2740 100644 --- a/src/components/Map/leafletMap.vue +++ b/src/components/Map/leafletMap.vue @@ -40,6 +40,7 @@ import 'leaflet/dist/leaflet.css' import { mapGetters } from 'vuex' import { merchantListPage } from '@/api/geoCoding/geoCoding' +import {getPartsTypeName} from "../../utils/constant"; const esri = require('esri-leaflet') @@ -204,9 +205,12 @@ '' result.forEach((item, index) => { - popupStr += '' + const dlCode = item.properties.objid.substring(6, 8) + const xlCode = item.properties.objid.substring(8, 10) + + popupStr += '' const comp = {} - comp.name = '部件' + (index + 1) + ':' + item.properties.dl + '/' + item.properties.xl + '[' + item.properties.objid + ']' + comp.name = '部件' + (index + 1) + ':' + getPartsTypeName(dlCode, xlCode) + '[' + item.properties.objid + ']' comp.value = item.properties.objid that.compListOpts.push(comp) }) diff --git a/src/components/Map/leafletMap.vue b/src/components/Map/leafletMap.vue index 3217e42..c2c2740 100644 --- a/src/components/Map/leafletMap.vue +++ b/src/components/Map/leafletMap.vue @@ -40,6 +40,7 @@ import 'leaflet/dist/leaflet.css' import { mapGetters } from 'vuex' import { merchantListPage } from '@/api/geoCoding/geoCoding' +import {getPartsTypeName} from "../../utils/constant"; const esri = require('esri-leaflet') @@ -204,9 +205,12 @@ '' result.forEach((item, index) => { - popupStr += '' + const dlCode = item.properties.objid.substring(6, 8) + const xlCode = item.properties.objid.substring(8, 10) + + popupStr += '' const comp = {} - comp.name = '部件' + (index + 1) + ':' + item.properties.dl + '/' + item.properties.xl + '[' + item.properties.objid + ']' + comp.name = '部件' + (index + 1) + ':' + getPartsTypeName(dlCode, xlCode) + '[' + item.properties.objid + ']' comp.value = item.properties.objid that.compListOpts.push(comp) }) diff --git a/src/views/supControl/supControl.vue b/src/views/supControl/supControl.vue index b6c153f..9cacb41 100644 --- a/src/views/supControl/supControl.vue +++ b/src/views/supControl/supControl.vue @@ -121,6 +121,7 @@ import SupStatisPanel from '@/views/supControl/SupStatisPanel' import { getCaseType, getCaseDetailType } from '@/api/callCase/callCase' import { getUserOnLine } from '@/api/system/user' +import { getPartsTypeName } from '@/utils/constant' import Leaflet from 'leaflet' import { mapGetters } from 'vuex' @@ -175,6 +176,7 @@ return { map: '', baseLayer: [], + partsLayer: [], parts: { eorc: '2', // 类别 casetypeCode: '', // 部件大类编码, @@ -623,20 +625,27 @@ this.baseLayer.push(Leaflet.tileLayer(this.baseConfig.mapUrl).addTo(map)) this.baseLayer.push(Leaflet.tileLayer(this.baseConfig.labelUrl).addTo(map)) + + // 加载部件分层的图层 const bjfcLayer = esri.dynamicMapLayer({ url: `${this.baseUrl}${this.partsUrl}`, minZoom: 20, // 最小缩放等级, zIndex: 10 // 设置显示层级,在底图之上 }).addTo(map) - +/* bjfcLayer.bindPopup(function(error, featureCollection) { if (error || featureCollection.features.length === 0) { return false } else { const bjItem = featureCollection.features[0] // 部件对象 + + console.log(bjItem) + const dlCode = bjItem.properties.ObjID.substring(6, 8) + const xlCode = bjItem.properties.ObjID.substring(8, 10) + const popupStr = '