|
@@ -9,7 +9,7 @@
|
|
|
</div>
|
|
|
<div style="flex: 1">
|
|
|
<!-- 原来的,F11不能自适应 -->
|
|
|
-<!-- <div ref="basicMap" class="basicMap" id="basicMap" :style="{ height: height }">-->
|
|
|
+ <!-- <div ref="basicMap" class="basicMap" id="basicMap" :style="{ height: height }">-->
|
|
|
<div ref="basicMap" class="basicMap" id="basicMap" :style="{ height: '100%' }">
|
|
|
<tool-bar v-model="isToolBar" ref="toolBar" :tools="mapTools" :v-if="toolsLoaded"></tool-bar>
|
|
|
<locate-by-geoinfo ref="locateByGeoinfo"></locate-by-geoinfo>
|
|
@@ -18,7 +18,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div v-if="analysisResult" id="right-sild" @click="handleDrawer" :style="drawerStyle">
|
|
|
- <p class="ttitle"><br/>分<br/>析<br/>结<br/>果</p>
|
|
|
+ <p class="ttitle"><br />分<br />析<br />结<br />果</p>
|
|
|
</div>
|
|
|
<!--显示弹窗-->
|
|
|
<div>
|
|
@@ -56,9 +56,7 @@ import IdentifyParameters from '@arcgis/core/rest/support/IdentifyParameters'
|
|
|
import BaseMap from './widgets/BaseMap'
|
|
|
import LocateByGeoinfo from './widgets/LocateByGeoinfo'
|
|
|
import ToolBar from './widgets/ToolBar'
|
|
|
-import {
|
|
|
- getAction
|
|
|
-} from '../../api/manage'
|
|
|
+import { getAction } from '../../api/manage'
|
|
|
import TileInfo from '@arcgis/core/layers/support/TileInfo'
|
|
|
import WebTileLayer from '@arcgis/core/layers/WebTileLayer'
|
|
|
import QueryInfo from '@comp/OneMap/widgets/QueryInfo'
|
|
@@ -69,7 +67,7 @@ export default {
|
|
|
ToolBar,
|
|
|
BaseMap,
|
|
|
LocateByGeoinfo,
|
|
|
- QueryInfo,
|
|
|
+ QueryInfo
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -123,20 +121,20 @@ export default {
|
|
|
权属起始时间: '',
|
|
|
权属结束时间: '',
|
|
|
担保: '',
|
|
|
- 土地使用现状: '',
|
|
|
- },
|
|
|
+ 土地使用现状: ''
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
props: {
|
|
|
resConfigUrl: {
|
|
|
- type: String,
|
|
|
+ type: String
|
|
|
},
|
|
|
toolsConfigUrl: {
|
|
|
- type: String,
|
|
|
+ type: String
|
|
|
},
|
|
|
topicId: {
|
|
|
type: String,
|
|
|
- default: 'null',
|
|
|
+ default: 'null'
|
|
|
},
|
|
|
height: {
|
|
|
type: String,
|
|
@@ -144,69 +142,65 @@ export default {
|
|
|
let calcHeight = window.document.documentElement.clientHeight - 130
|
|
|
let m_height = calcHeight.toString() + 'px'
|
|
|
return m_height
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
center: {
|
|
|
type: Array,
|
|
|
- default: function () {
|
|
|
+ default: function() {
|
|
|
return [118.9943, 36.4939]
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
extent: {
|
|
|
type: Array,
|
|
|
- default: function () {
|
|
|
+ default: function() {
|
|
|
/* return [118.109760, 35.019916, 118.475084, 35.388584];*/
|
|
|
/* return [118.109760, 35.019916, 118.475084, 35.388584];*/
|
|
|
return [114.5997, 34.5248, 123.2469, 38.5253]
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
wkid: {
|
|
|
type: Number,
|
|
|
- default: 102100,
|
|
|
+ default: 102100
|
|
|
},
|
|
|
zoom: {
|
|
|
type: Number,
|
|
|
- default: 8,
|
|
|
+ default: 8
|
|
|
},
|
|
|
isToolBar: {
|
|
|
type: Boolean,
|
|
|
- default: true,
|
|
|
- },
|
|
|
+ default: true
|
|
|
+ }
|
|
|
},
|
|
|
provide() {
|
|
|
return {
|
|
|
- basicMap: this,
|
|
|
+ basicMap: this
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
this.spatialReference = new SpatialReference({
|
|
|
- wkid: this.wkid,
|
|
|
+ wkid: this.wkid
|
|
|
})
|
|
|
this.initExtent = new Extent(this.extent[0], this.extent[1], this.extent[2], this.extent[3])
|
|
|
this.popupTemplate = {
|
|
|
overwriteActions: true,
|
|
|
outFields: ['*'],
|
|
|
- title: ({
|
|
|
- graphic: {
|
|
|
- attributes,
|
|
|
- layer
|
|
|
- }
|
|
|
- }) => {
|
|
|
+ title: ({ graphic: { attributes, layer } }) => {
|
|
|
const dkmc = layer.title
|
|
|
return `<div>${dkmc || ''}</div>`
|
|
|
},
|
|
|
content: this.selectChange,
|
|
|
- actions: [{
|
|
|
- title: '详情',
|
|
|
- id: 'showDKDetail',
|
|
|
- className: 'esri-icon-zoom-in-magnifying-glass',
|
|
|
- },
|
|
|
+ actions: [
|
|
|
+ {
|
|
|
+ title: '详情',
|
|
|
+ id: 'showDKDetail',
|
|
|
+ className: 'esri-icon-zoom-in-magnifying-glass'
|
|
|
+ },
|
|
|
{
|
|
|
title: '全景',
|
|
|
id: 'showAll',
|
|
|
- className: 'esri-icon-globe',
|
|
|
- },
|
|
|
- ],
|
|
|
+ className: 'esri-icon-globe'
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
this.baseRasterLayerUrl = window._CONFIG['mapBaseLayerURL']
|
|
|
},
|
|
@@ -224,12 +218,8 @@ export default {
|
|
|
methods: {
|
|
|
//获取专题配置
|
|
|
async getTopicConfig() {
|
|
|
- let {
|
|
|
- result,
|
|
|
- success,
|
|
|
- message
|
|
|
- } = await getAction('topicManage/topicsConfig/list', {
|
|
|
- topicid: this.topicId,
|
|
|
+ let { result, success, message } = await getAction('topicManage/topicsConfig/list', {
|
|
|
+ topicid: this.topicId
|
|
|
})
|
|
|
if (success) {
|
|
|
this.loadMapConfig(result.records[0].analysistypes)
|
|
@@ -238,13 +228,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
async loadMapConfig(analysistypes) {
|
|
|
- let {
|
|
|
- result,
|
|
|
- success,
|
|
|
- message
|
|
|
- } = await getAction(this.resConfigUrl, {
|
|
|
+ let { result, success, message } = await getAction(this.resConfigUrl, {
|
|
|
username: store.getters.userInfo.username,
|
|
|
- topicId: this.topicId,
|
|
|
+ topicId: this.topicId
|
|
|
})
|
|
|
if (success) {
|
|
|
this.layerList = JSON.parse(JSON.stringify(result))
|
|
@@ -252,12 +238,12 @@ export default {
|
|
|
let self = this
|
|
|
this.list.push(this.layerList, this.layerList2)
|
|
|
if (this.layerList && this.layerList.length !== 0) {
|
|
|
- this.layerList.forEach((layerItem) => {
|
|
|
+ this.layerList.forEach(layerItem => {
|
|
|
if (layerItem.layers) {
|
|
|
//累计记录需要加载的图层数量,用以之后判断图层是否全部加载完毕
|
|
|
self.layerNum += layerItem.layers.length
|
|
|
//记录所有的 图层配置,
|
|
|
- layerItem.layers.forEach((layerConfig) => {
|
|
|
+ layerItem.layers.forEach(layerConfig => {
|
|
|
if (layerConfig) {
|
|
|
if (analysistypes) {
|
|
|
if (analysistypes.includes(layerConfig.name)) {
|
|
@@ -281,13 +267,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
async loadMapTools() {
|
|
|
- let {
|
|
|
- result,
|
|
|
- success,
|
|
|
- message
|
|
|
- } = await getAction(this.toolsConfigUrl, {
|
|
|
+ let { result, success, message } = await getAction(this.toolsConfigUrl, {
|
|
|
username: store.getters.userInfo.username,
|
|
|
- topicId: this.topicId,
|
|
|
+ topicId: this.topicId
|
|
|
})
|
|
|
if (success) {
|
|
|
this.mapTools.push(...result)
|
|
@@ -313,7 +295,7 @@ export default {
|
|
|
// });
|
|
|
// })
|
|
|
this.esriMap = new Map({
|
|
|
- slider: true, //开启放大缩小
|
|
|
+ slider: true //开启放大缩小
|
|
|
|
|
|
// basemap: basemap
|
|
|
})
|
|
@@ -321,26 +303,25 @@ export default {
|
|
|
container: this.$refs.basicMap,
|
|
|
map: this.esriMap,
|
|
|
ui: {
|
|
|
- components: [],
|
|
|
+ components: []
|
|
|
},
|
|
|
extent: this.initExtent,
|
|
|
popup: {
|
|
|
- defaultPopupTemplateEnabled: true, // popup will be enabled on the wfslayer
|
|
|
- },
|
|
|
+ defaultPopupTemplateEnabled: true // popup will be enabled on the wfslayer
|
|
|
+ }
|
|
|
})
|
|
|
this.mapView.constraints = {
|
|
|
minZoom: 7,
|
|
|
- maxZoom: 18,
|
|
|
+ maxZoom: 18
|
|
|
}
|
|
|
|
|
|
// this.mapView.ui.remove('attribution'); //移除底部版权信息状态栏
|
|
|
// this.mapView.ui.components = [];
|
|
|
this.mapView.when(
|
|
|
() => {
|
|
|
-
|
|
|
this.initWeights()
|
|
|
},
|
|
|
- (error) => {
|
|
|
+ error => {
|
|
|
this.$message.error(error.message)
|
|
|
}
|
|
|
)
|
|
@@ -359,20 +340,20 @@ export default {
|
|
|
container: this.$refs.basicMap2,
|
|
|
map: this.esriMap2,
|
|
|
ui: {
|
|
|
- components: [],
|
|
|
+ components: []
|
|
|
},
|
|
|
- extent: this.mapView.extent,
|
|
|
+ extent: this.mapView.extent
|
|
|
})
|
|
|
this.mapView.when(
|
|
|
() => {
|
|
|
this.loadLayers(this.layerList2, this.esriMap2)
|
|
|
},
|
|
|
- function (error) {
|
|
|
+ function(error) {
|
|
|
this.$message.error(error.message)
|
|
|
}
|
|
|
)
|
|
|
let views = [this.mapView, this.mapView2]
|
|
|
- views.forEach((view) => {
|
|
|
+ views.forEach(view => {
|
|
|
// 定义一个范围变量
|
|
|
let fullextent = null
|
|
|
// 设置鼠标滚轮事件
|
|
@@ -388,11 +369,11 @@ export default {
|
|
|
}, 1)
|
|
|
})*/
|
|
|
// 设置鼠标拖拽事件
|
|
|
- view.on('drag', (e) => {
|
|
|
+ view.on('drag', e => {
|
|
|
// 获取操作图层的范围
|
|
|
fullextent = view.extent
|
|
|
// 遍历所有视图来设置这个范围
|
|
|
- views.forEach((nview) => {
|
|
|
+ views.forEach(nview => {
|
|
|
nview.extent = fullextent
|
|
|
})
|
|
|
})
|
|
@@ -407,7 +388,7 @@ export default {
|
|
|
},
|
|
|
loadLayers(list, map) {
|
|
|
if (list && list.length !== 0) {
|
|
|
- list.forEach((layerItem) => {
|
|
|
+ list.forEach(layerItem => {
|
|
|
if (layerItem.layers) {
|
|
|
this.loadLayers(layerItem.layers, map)
|
|
|
} else {
|
|
@@ -417,7 +398,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 载入图层到layers
|
|
|
- _loadLayer: function (layerItem, esriMap) {
|
|
|
+ _loadLayer: function(layerItem, esriMap) {
|
|
|
let layer = null
|
|
|
let layer_opacity = null
|
|
|
switch (layerItem.servicetype) {
|
|
@@ -425,18 +406,20 @@ export default {
|
|
|
layer = new MapImageLayer({
|
|
|
id: layerItem.id,
|
|
|
title: layerItem.alias,
|
|
|
- url: layerItem.url,
|
|
|
+ url: layerItem.url
|
|
|
})
|
|
|
let layerInfo = {
|
|
|
title: layerItem.alias,
|
|
|
- layer: layer,
|
|
|
+ layer: layer
|
|
|
}
|
|
|
if (layerItem.sublayerid != undefined && layerItem.sublayerid != null) {
|
|
|
- layer.sublayers = [{
|
|
|
- id: layerItem.sublayerid,
|
|
|
- visible: layerItem.visible,
|
|
|
- labelsVisible: layerItem.labelsvisible,
|
|
|
- },]
|
|
|
+ layer.sublayers = [
|
|
|
+ {
|
|
|
+ id: layerItem.sublayerid,
|
|
|
+ visible: layerItem.visible,
|
|
|
+ labelsVisible: layerItem.labelsvisible
|
|
|
+ }
|
|
|
+ ]
|
|
|
if (layerItem.visible && layerItem.queryable) {
|
|
|
this.v_layerIds.push(layerItem.sublayerid)
|
|
|
}
|
|
@@ -452,7 +435,7 @@ export default {
|
|
|
id: layerItem.id,
|
|
|
title: layerItem.alias,
|
|
|
url: layerItem.url,
|
|
|
- visible: layerItem.visible,
|
|
|
+ visible: layerItem.visible
|
|
|
})
|
|
|
break
|
|
|
}
|
|
@@ -462,30 +445,13 @@ export default {
|
|
|
title: layerItem.alias,
|
|
|
url: layerItem.url,
|
|
|
popupTemplate: this.popupTemplate,
|
|
|
- visible: layerItem.visible,
|
|
|
+ visible: layerItem.visible
|
|
|
})
|
|
|
break
|
|
|
}
|
|
|
- /*sugb 20240530 瓦片服务*/
|
|
|
- case 'WMTSLayer': {
|
|
|
- this.webTiledLayerId.push(layerItem.id)
|
|
|
- layer = new WMTSLayer({
|
|
|
- id: layerItem.id,
|
|
|
- url: layerItem.url, //WMTS服务的URL地址
|
|
|
- layerIdentifier: layerItem.name, //属性用于指定你要加载的WMTS图层的标识符(即图层名称)
|
|
|
- title: layerItem.alias, //描述
|
|
|
- style: layerItem.style, //图层的样式。通常为default
|
|
|
- format: 'image/png', //瓦片图像的格式,可默认
|
|
|
- activeLayer: {
|
|
|
- id: layerItem.name, //图层名称
|
|
|
- tileMatrixSetId: 'EPSG:4326', //瓦片矩阵集的标识符(通常为坐标参考系统的EPSG代码)
|
|
|
- },
|
|
|
- visible: layerItem.visible, //是否显示
|
|
|
- })
|
|
|
- break
|
|
|
- }
|
|
|
/*sugb 20240530 wms服务*/
|
|
|
case 'WFSLayer': {
|
|
|
+ console.log(layerItem)
|
|
|
// 更新要素样式
|
|
|
layer = new WMSLayer({
|
|
|
id: layerItem.id,
|
|
@@ -493,10 +459,12 @@ export default {
|
|
|
title: layerItem.alias,
|
|
|
name: layerItem.name,
|
|
|
style: layerItem.style,
|
|
|
- sublayers: [{
|
|
|
- name: layerItem.name
|
|
|
- }],
|
|
|
- visible: layerItem.visible,
|
|
|
+ sublayers: [
|
|
|
+ {
|
|
|
+ name: layerItem.name
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ visible: layerItem.visible
|
|
|
})
|
|
|
layer_opacity = new WFSLayer({
|
|
|
id: layerItem.id,
|
|
@@ -508,29 +476,45 @@ export default {
|
|
|
popupTemplate: {
|
|
|
overwriteActions: true,
|
|
|
outFields: ['*'],
|
|
|
- title: ({
|
|
|
- graphic: {
|
|
|
- attributes,
|
|
|
- layer
|
|
|
- }
|
|
|
- }) => {
|
|
|
+ title: ({ graphic: { attributes, layer } }) => {
|
|
|
const dkmc = layer.title
|
|
|
return `<div>${dkmc || ''}</div>`
|
|
|
},
|
|
|
content: this.selectChange,
|
|
|
- actions: [{
|
|
|
- title: '详情',
|
|
|
- id: 'showDKDetail',
|
|
|
- className: 'esri-icon-zoom-in-magnifying-glass',
|
|
|
- },
|
|
|
+ actions: [
|
|
|
+ {
|
|
|
+ title: '详情',
|
|
|
+ id: 'showDKDetail',
|
|
|
+ className: 'esri-icon-zoom-in-magnifying-glass'
|
|
|
+ },
|
|
|
{
|
|
|
title: '全景',
|
|
|
id: 'showAll',
|
|
|
- className: 'esri-icon-globe',
|
|
|
- },
|
|
|
- ],
|
|
|
+ className: 'esri-icon-globe'
|
|
|
+ }
|
|
|
+ ]
|
|
|
},
|
|
|
- visible: layerItem.visible,
|
|
|
+ visible: layerItem.visible
|
|
|
+ })
|
|
|
+ break
|
|
|
+ }
|
|
|
+ /*sugb 20240530 瓦片服务*/
|
|
|
+ case 'WMTSLayer': {
|
|
|
+ console.log('加载WMTS')
|
|
|
+ console.log(layerItem)
|
|
|
+ this.webTiledLayerId.push(layerItem.id)
|
|
|
+ layer = new WMTSLayer({
|
|
|
+ id: layerItem.id,
|
|
|
+ url: layerItem.url, //WMTS服务的URL地址
|
|
|
+ layerIdentifier: layerItem.name, //属性用于指定你要加载的WMTS图层的标识符(即图层名称)
|
|
|
+ title: layerItem.alias, //描述
|
|
|
+ style: layerItem.style, //图层的样式。通常为default
|
|
|
+ format: 'image/png', //瓦片图像的格式,可默认
|
|
|
+ activeLayer: {
|
|
|
+ id: layerItem.name, //图层名称
|
|
|
+ tileMatrixSetId: 'EPSG:4326' //瓦片矩阵集的标识符(通常为坐标参考系统的EPSG代码)
|
|
|
+ },
|
|
|
+ visible: layerItem.visible //是否显示
|
|
|
})
|
|
|
break
|
|
|
}
|
|
@@ -538,7 +522,7 @@ export default {
|
|
|
break
|
|
|
}
|
|
|
//所有的图层都加载完成事件
|
|
|
- layer.on('layerview-create', (evt) => {
|
|
|
+ layer.on('layerview-create', evt => {
|
|
|
this.layerCount++
|
|
|
if (this.layerNum == this.layerCount) {
|
|
|
this.$emit('layer-loadAll', true)
|
|
@@ -547,6 +531,7 @@ export default {
|
|
|
})
|
|
|
if (parseInt(layerItem.zIndex)) {
|
|
|
esriMap.add(layer, parseInt(layerItem.zIndex))
|
|
|
+ esriMap.add(layer_opacity)
|
|
|
} else {
|
|
|
esriMap.add(layer)
|
|
|
esriMap.add(layer_opacity)
|
|
@@ -554,57 +539,60 @@ export default {
|
|
|
},
|
|
|
initBaseLayer() {
|
|
|
let baseRasterLayer = new WMTSLayer({
|
|
|
- url: this.baseRasterLayerUrl,
|
|
|
+ url: this.baseRasterLayerUrl
|
|
|
})
|
|
|
let basemap = new Basemap({
|
|
|
baseLayers: [baseRasterLayer],
|
|
|
spatialReference: new SpatialReference({
|
|
|
- wkid: 102100,
|
|
|
- }),
|
|
|
+ wkid: 102100
|
|
|
+ })
|
|
|
})
|
|
|
this.esriMap.basemap = basemap
|
|
|
this.esriMap2.basemap = basemap
|
|
|
},
|
|
|
initGraphicsLayers() {
|
|
|
this.draw_GraphicsLayer = new GraphicsLayer({
|
|
|
- title: '绘图专用图层',
|
|
|
+ title: '绘图专用图层'
|
|
|
})
|
|
|
this.esriMap.add(this.draw_GraphicsLayer, 100)
|
|
|
this.layerSketch = new GraphicsLayer({
|
|
|
- title: '编辑图斑专用图层',
|
|
|
+ title: '编辑图斑专用图层'
|
|
|
})
|
|
|
this.esriMap.add(this.layerSketch, 100)
|
|
|
this.analysis_GraphicsLayer = new GraphicsLayer({
|
|
|
title: '分析专用图层',
|
|
|
- id: 'analysis',
|
|
|
+ id: 'analysis'
|
|
|
})
|
|
|
this.esriMap.add(this.analysis_GraphicsLayer, 100)
|
|
|
this.analysis_Drew_GraphicsLayer = new GraphicsLayer({
|
|
|
title: '分析绘制专用图层',
|
|
|
- id: 'analysisDraw',
|
|
|
+ id: 'analysisDraw'
|
|
|
})
|
|
|
this.esriMap.add(this.analysis_Drew_GraphicsLayer, 101)
|
|
|
this.path_GraphicsLayer = new GraphicsLayer({
|
|
|
title: '巡回轨迹专用图层',
|
|
|
- id: 'path',
|
|
|
+ id: 'path'
|
|
|
})
|
|
|
this.esriMap.add(this.path_GraphicsLayer, 100)
|
|
|
this.locate_GraphicsLayer = new GraphicsLayer({
|
|
|
- title: '定位专用图层',
|
|
|
+ title: '定位专用图层'
|
|
|
})
|
|
|
this.esriMap.add(this.locate_GraphicsLayer, 101)
|
|
|
},
|
|
|
+ // 加载弹出框
|
|
|
+ initPopup() {
|
|
|
+ let datas = this.getPopupData()
|
|
|
+ },
|
|
|
initWeights() {
|
|
|
// this.mapView.ui.remove('attribution'); //移除底部版权信息状态栏
|
|
|
this.mapView.ui.components = []
|
|
|
let zoom = new Zoom({
|
|
|
- view: this.mapView,
|
|
|
+ view: this.mapView
|
|
|
})
|
|
|
this.mapView.ui.add(zoom, 'top-left')
|
|
|
zoom.when(
|
|
|
- (evt) => {
|
|
|
- },
|
|
|
- (err) => {
|
|
|
+ evt => {},
|
|
|
+ err => {
|
|
|
if (this.routeList.indexOf(this.$route.name) != -1) {
|
|
|
location.reload(true)
|
|
|
}
|
|
@@ -614,13 +602,13 @@ export default {
|
|
|
let homeBtn = new Home({
|
|
|
view: this.mapView,
|
|
|
viewpoint: new Viewpoint({
|
|
|
- targetGeometry: this.initExtent,
|
|
|
- }),
|
|
|
+ targetGeometry: this.initExtent
|
|
|
+ })
|
|
|
})
|
|
|
this.mapView.ui.add(homeBtn, 'top-left')
|
|
|
|
|
|
let compass = new Compass({
|
|
|
- view: this.mapView,
|
|
|
+ view: this.mapView
|
|
|
})
|
|
|
this.mapView.ui.add(compass, 'top-left')
|
|
|
|
|
@@ -640,17 +628,17 @@ export default {
|
|
|
let scaleBar = new ScaleBar({
|
|
|
view: this.mapView,
|
|
|
unit: 'metric', //Possible Values:"non-metric"|"metric"|"dual"
|
|
|
- style: 'line', //Possible Values:"ruler"|"line"
|
|
|
+ style: 'line' //Possible Values:"ruler"|"line"
|
|
|
})
|
|
|
this.mapView.ui.add(scaleBar, 'bottom-left')
|
|
|
},
|
|
|
initMapEvents() {
|
|
|
- this.mapView.on('pointer-move', (evt) => {
|
|
|
+ this.mapView.on('pointer-move', evt => {
|
|
|
let point = this.mapView.toMap(evt)
|
|
|
this.currentCoords = point.longitude.toFixed(4) + ',' + point.latitude.toFixed(4)
|
|
|
})
|
|
|
|
|
|
- this.mapView.on('click', (evt) => {
|
|
|
+ this.mapView.on('click', evt => {
|
|
|
if (this.$refs.toolBar.enableIdentify) {
|
|
|
this.$refs.toolBar.doIdentify(evt)
|
|
|
}
|
|
@@ -661,11 +649,9 @@ export default {
|
|
|
initActiveViewEvents() {
|
|
|
if (this.mapView) {
|
|
|
// PopupViewModel的触发动作被触发,然后检查动作id
|
|
|
- this.mapView.popup.on('trigger-action', ({action}) => {
|
|
|
+ this.mapView.popup.on('trigger-action', ({ action }) => {
|
|
|
const actionId = action.id
|
|
|
- let {
|
|
|
- attributes
|
|
|
- } = this.mapView.popup.viewModel.selectedFeature
|
|
|
+ let { attributes } = this.mapView.popup.viewModel.selectedFeature
|
|
|
// 点击"地块详情"
|
|
|
if (actionId === 'showDKDetail' && this.resData.sysOrgCode != null) {
|
|
|
//获取弹出的popup所归属的graphic的attributes
|
|
@@ -687,13 +673,13 @@ export default {
|
|
|
},
|
|
|
/*点击地图时弹出信息*/
|
|
|
selectChange(feature) {
|
|
|
- this.isVr=false;
|
|
|
+ this.isVr = false
|
|
|
//console.log('selectChange'+JSON.stringify(feature))
|
|
|
let content = document.createElement('div')
|
|
|
this.resData = []
|
|
|
if (feature.graphic.attributes.DKBH != ' ') {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
- getAction('/qcsb/qcSsgqzysytdqk/queryBydkbh', {DKBH: feature.graphic.attributes.DKBH}).then((res) => {
|
|
|
+ getAction('/qcsb/qcSsgqzysytdqk/queryBydkbh', { DKBH: feature.graphic.attributes.DKBH }).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.resData = res.result
|
|
|
resolve(this.resData)
|
|
@@ -701,8 +687,8 @@ export default {
|
|
|
resolve(this.resData)
|
|
|
}
|
|
|
})
|
|
|
- }).then((res) => {
|
|
|
- console.log("获取的地块信息")
|
|
|
+ }).then(res => {
|
|
|
+ console.log('获取的地块信息')
|
|
|
// console.log(JSON.stringify(this.resData))
|
|
|
if (res.sysOrgCode.slice(0, 3) == 'A04') {
|
|
|
var dwmc = res.createBy
|
|
@@ -710,12 +696,13 @@ export default {
|
|
|
var sjyd = res.sjytText
|
|
|
var sjzytdmj = res.sjzytdmj
|
|
|
var sjsyjzmj = res.sjsyjzmj
|
|
|
- content.innerHTML =
|
|
|
- `<div><span style="font-weight: bold;">企业名称:</span> <span>${dwmc}<span/></div>
|
|
|
- <div><span style="font-weight: bold;">地块名称:</span> <span>${dkmc}</span></div>
|
|
|
- <div><span style="font-weight: bold;">实际用地:</span> <span>${sjyd}</span></div>
|
|
|
- <div class="ant-tag" style="background-color: #feeeeb;margin-top: 5px;color: #d57a55;border:1px solid #d57a55 " >实际占用土地面积:${sjzytdmj || 0}²</div>
|
|
|
- <div class="ant-tag" style="background-color: #feeeeb ;color: #d57a55;border:1px solid #d57a55 " >实际使用建筑面积:${sjsyjzmj || 0}²</div>`
|
|
|
+ content.innerHTML = `<div><span style='font-weight: bold;'>企业名称:</span> <span>${dwmc}<span/></div>
|
|
|
+ <div><span style='font-weight: bold;'>地块名称:</span> <span>${dkmc}</span></div>
|
|
|
+ <div><span style='font-weight: bold;'>实际用地:</span> <span>${sjyd}</span></div>
|
|
|
+ <div class='ant-tag' style='background-color: #feeeeb;margin-top: 5px;color: #d57a55;border:1px solid #d57a55 ' >实际占用土地面积:${sjzytdmj ||
|
|
|
+ 0}²</div>
|
|
|
+ <div class='ant-tag' style='background-color: #feeeeb ;color: #d57a55;border:1px solid #d57a55 ' >实际使用建筑面积:${sjsyjzmj ||
|
|
|
+ 0}²</div>`
|
|
|
return content
|
|
|
} else {
|
|
|
var dwmc = res.createBy
|
|
@@ -724,21 +711,20 @@ export default {
|
|
|
var sjzytdmj = res.sjzytdmj
|
|
|
var sjsyjzmj = res.sjsyjzmj
|
|
|
let content = document.createElement('div')
|
|
|
- content.innerHTML =
|
|
|
- `<div><span style="font-weight: bold;">企业名称:</span> <span>${dwmc}<span/></div>
|
|
|
- <div><span style="font-weight: bold;">地块名称:</span> <span>${dkmc}</span></div>
|
|
|
- <div><span style="font-weight: bold;">实际用地:</span> <span>${sjyd}</span></div>
|
|
|
- <div class="ant-tag" style="background-color: #feeeeb;margin-top: 5px;color: #d57a55;border:1px solid #d57a55 " >实际占用土地面积:${sjzytdmj || 0}²</div>
|
|
|
- <div class="ant-tag" style="background-color: #feeeeb ;color: #d57a55;border:1px solid #d57a55 " >实际使用建筑面积:${sjsyjzmj || 0}²</div>`
|
|
|
+ content.innerHTML = `<div><span style='font-weight: bold;'>企业名称:</span> <span>${dwmc}<span/></div>
|
|
|
+ <div><span style='font-weight: bold;'>地块名称:</span> <span>${dkmc}</span></div>
|
|
|
+ <div><span style='font-weight: bold;'>实际用地:</span> <span>${sjyd}</span></div>
|
|
|
+ <div class='ant-tag' style='background-color: #feeeeb;margin-top: 5px;color: #d57a55;border:1px solid #d57a55 ' >实际占用土地面积:${sjzytdmj ||
|
|
|
+ 0}²</div>
|
|
|
+ <div class='ant-tag' style='background-color: #feeeeb ;color: #d57a55;border:1px solid #d57a55 ' >实际使用建筑面积:${sjsyjzmj ||
|
|
|
+ 0}²</div>`
|
|
|
return content
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
- return (content.innerHTML =
|
|
|
- `<div><span style="font-weight: bold;">企业名称:</span> <span>${feature.graphic.attributes.DWMC}<span/></div>
|
|
|
- <div><span style="font-weight: bold;">证书编号:</span> <span>${feature.graphic.attributes.ZSBH}</span></div>
|
|
|
- <div class="ant-tag" style="background-color: #feeeeb;margin-top: 5px;color: #d57a55;border:1px solid #d57a55 " >地块信息未上报</div>`
|
|
|
- )
|
|
|
+ return (content.innerHTML = `<div><span style='font-weight: bold;'>企业名称:</span> <span>${feature.graphic.attributes.DWMC}<span/></div>
|
|
|
+ <div><span style='font-weight: bold;'>证书编号:</span> <span>${feature.graphic.attributes.ZSBH}</span></div>
|
|
|
+ <div class='ant-tag' style='background-color: #feeeeb;margin-top: 5px;color: #d57a55;border:1px solid #d57a55 ' >地块信息未上报</div>`)
|
|
|
// this.$info({
|
|
|
// title: '说明',
|
|
|
// content: (<div><p>{地块信息不存在}</p></div>),
|
|
@@ -758,7 +744,7 @@ export default {
|
|
|
},
|
|
|
//复选框处理方法
|
|
|
changeLayerVisible(layerConfig, visible, esriMap) {
|
|
|
- console.log("复选框处理事件")
|
|
|
+ console.log('复选框处理事件')
|
|
|
console.log(JSON.stringify(layerConfig))
|
|
|
console.log(JSON.stringify(visible))
|
|
|
if (layerConfig != null && layerConfig != '' && JSON.stringify(layerConfig) !== '{}') {
|
|
@@ -799,9 +785,9 @@ export default {
|
|
|
//根据图层id,更改资源目录列表中图层的表示状态
|
|
|
let layerList = this.list[0]
|
|
|
if (layerList && layerList.length !== 0) {
|
|
|
- layerList.forEach((layerItem) => {
|
|
|
+ layerList.forEach(layerItem => {
|
|
|
if (layerItem.layers) {
|
|
|
- layerItem.layers.forEach((layerSubItem) => {
|
|
|
+ layerItem.layers.forEach(layerSubItem => {
|
|
|
if (layerSubItem.id === layerConfig.id) {
|
|
|
layerSubItem.visible = visible
|
|
|
}
|
|
@@ -813,7 +799,7 @@ export default {
|
|
|
},
|
|
|
changeLayerVisibleByLayerName(layerName, visible) {
|
|
|
let layerConfig = {}
|
|
|
- this.layerConfigs.map((item) => {
|
|
|
+ this.layerConfigs.map(item => {
|
|
|
if (item.name == layerName) {
|
|
|
layerConfig = item
|
|
|
}
|
|
@@ -822,7 +808,7 @@ export default {
|
|
|
},
|
|
|
changeLayerVisibleByTableName(tableName, visible) {
|
|
|
let layerConfig = {}
|
|
|
- this.layerConfigs.map((item) => {
|
|
|
+ this.layerConfigs.map(item => {
|
|
|
if (item.tablename == tableName) {
|
|
|
layerConfig = item
|
|
|
}
|
|
@@ -852,8 +838,8 @@ export default {
|
|
|
}else {
|
|
|
this.drawerStyle="right:0"
|
|
|
}*/
|
|
|
- },
|
|
|
- },
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|