From 8f1cfcc373c88edd94d5b71cf00e35f899e8cdca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=95=E5=B5=A9?= <17854119262@163.com> Date: Wed, 28 Aug 2024 17:14:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=91=E6=9F=A5=E8=AF=A2=E7=AE=A1=E7=90=86-?= =?UTF-8?q?=E5=BC=B9=E7=AA=97-=E9=83=A8=E5=88=86=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A1=86=E6=98=BE=E7=A4=BA=E5=86=85=E5=AE=B9=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../demo/system/cloudManagement/Modal/modal.vue | 15 ++++++++++++--- .../geoservermanagement/clound/mapComponent.vue | 12 ++++++++++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/views/demo/system/cloudManagement/Modal/modal.vue b/src/views/demo/system/cloudManagement/Modal/modal.vue index a97c0aa8..e992fbd6 100644 --- a/src/views/demo/system/cloudManagement/Modal/modal.vue +++ b/src/views/demo/system/cloudManagement/Modal/modal.vue @@ -78,7 +78,7 @@ v-model:value="props.modalData.data.classField" placeholder="请先选择图层" :options="classFieldOptioins" - :fieldNames="{ label: 'column_name', value: 'column_name' }" + :fieldNames="{ label: 'nameAndValue', value: 'column_name' }" :disabled="props.modalData.data.layer == undefined" @change="classFieldChange" /> @@ -96,7 +96,7 @@ v-model:value="props.modalData.data.areaField" placeholder="请先选择图层" :options="classFieldOptioins" - :fieldNames="{ label: 'column_name', value: 'column_name' }" + :fieldNames="{ label: 'nameAndValue', value: 'column_name' }" :disabled="props.modalData.data.layer == undefined" /> @@ -205,7 +205,16 @@ // 分类字段、选择面积计算字段options function getClassFieldOptioins(tableName) { let query = { tableName: tableName }; - GetTableAndViewColumnList(query).then((res) => { + GetTableAndViewColumnList(query).then((res: any) => { + if (res) { + res.forEach((element) => { + if (element.description == null) { + element.nameAndValue = element.column_name; + } else { + element.nameAndValue = element.column_name + '(' + element.description + ')'; + } + }); + } classFieldOptioins.value = res; }); } diff --git a/src/views/demo/system/geoservermanagement/clound/mapComponent.vue b/src/views/demo/system/geoservermanagement/clound/mapComponent.vue index 43b97ecc..32e33127 100644 --- a/src/views/demo/system/geoservermanagement/clound/mapComponent.vue +++ b/src/views/demo/system/geoservermanagement/clound/mapComponent.vue @@ -117,7 +117,9 @@ }, }); } - map.moveLayer(layerName, ''); + if (layerName) { + map.moveLayer(layerName, ''); + } }; // 获取乡镇数据 @@ -169,7 +171,9 @@ }, }); map.moveLayer('countyLayer'); - map.moveLayer(layerName, ''); + if (layerName) { + map.moveLayer(layerName, ''); + } } }; @@ -306,6 +310,10 @@ onMounted(() => { mapboxgl.accessToken = MAPBOX_TOKEN; map = initMap(); + // 县区边界 + handlerDealStreet(null); + handlerDealCountry(null); + // handlerLocation([118.30207505530701, 35.30123435040745], 7.848587811931849); // map.on('load', () => { // map.flyTo({ // center: [118.30207505530701, 35.30123435040745],