From f0cf67e3f93bef082f2ca02139a7fe647b33e467 Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期三, 15 三月 2023 18:52:02 +0800 Subject: [PATCH] 优化图层管理的折叠会折叠其它的面板;优化柱状图属性界面;优化WMS图层加载效果;优化资料馆上传的附件,前端显示不出来效果;综合展示拾取功能 --- src/views/datamanage/uploadmanage.vue | 14 src/api/api.js | 7 src/components/MapView/mapPickUpPop.vue | 87 ++---- src/views/Tools/LayerTree.vue | 114 ++------ src/assets/css/config.css | 4 src/store/index.js | 2 src/views/Synthesis/LeftMenu.vue | 260 ++++++++++++--------- src/assets/css/configure.css | 4 src/components/MapView/mapMenuPop.vue | 60 +++- src/components/mapsdk.vue | 130 ++++++---- src/views/Tools/queryinfo.vue | 1 src/components/MapView/mapSpacePop.vue | 18 12 files changed, 370 insertions(+), 331 deletions(-) diff --git a/src/api/api.js b/src/api/api.js index acd801e..5f92795 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -1064,6 +1064,13 @@ return request.get('/inquiry/selectByBuffer', { params: params }); } +//鏁版嵁鏌ヨ=>鏍规嵁GID鏌ヨ +export function dataQuery_selectByGid(params) { + return request.get('/dataQuery/selectByGid', { params: params }); +} + + + diff --git a/src/assets/css/config.css b/src/assets/css/config.css index 4bb8902..2c9a420 100644 --- a/src/assets/css/config.css +++ b/src/assets/css/config.css @@ -513,4 +513,8 @@ .Black_theme .menuBox .el-dialog__wrapper .buffer-dialog { background-color: rgba(48, 48, 48, 0.85) !important; color: #fff; +} + +.Black_theme .tabsSpan { + color: #fff; } \ No newline at end of file diff --git a/src/assets/css/configure.css b/src/assets/css/configure.css index e58a01b..fc6cefe 100644 --- a/src/assets/css/configure.css +++ b/src/assets/css/configure.css @@ -397,4 +397,8 @@ .el-table th.gutter { display: table-cell !important; +} + +.tabsSpan { + color: #000; } \ No newline at end of file diff --git a/src/components/MapView/mapMenuPop.vue b/src/components/MapView/mapMenuPop.vue index 48a7d58..bb86547 100644 --- a/src/components/MapView/mapMenuPop.vue +++ b/src/components/MapView/mapMenuPop.vue @@ -1,7 +1,10 @@ <template> <div class="menuPop"> <div class="leftBox"> - <div class="leftDown" v-if="$store.state.download"> + <div + class="leftDown" + v-if="$store.state.download" + > <div @click="getDownloadDep"> <el-link icon="el-icon-download"> </el-link> </div> @@ -31,7 +34,11 @@ label="搴忓彿" width="50" /> - <el-table-column label="瀹氫綅" width="100" align="center"> + <el-table-column + label="瀹氫綅" + width="100" + align="center" + > <template slot-scope="scope"> <el-button icon="el-icon-map-location" @@ -50,7 +57,10 @@ ></el-table-column> </el-table> </div> - <div class="pagination_box" style="margin-top: 10px"> + <div + class="pagination_box" + style="margin-top: 10px" + > <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" @@ -78,14 +88,20 @@ label-width="100px" class="codeForm" > - <el-form-item :label="$t('common.passworld')" prop="password"> + <el-form-item + :label="$t('common.passworld')" + prop="password" + > <el-input type="password" v-model="codeForm.password" show-password ></el-input> </el-form-item> - <el-form-item :label="$t('common.SPassword')" prop="repassword"> + <el-form-item + :label="$t('common.SPassword')" + prop="repassword" + > <el-input type="password" v-model="codeForm.repassword" @@ -97,9 +113,12 @@ class="primary" size="small" @click="download('codeForm')" - >{{ $t("common.confirm") }}</el-button - > - <el-button type="info" size="small" @click="closeDown('codeForm')">{{ + >{{ $t("common.confirm") }}</el-button> + <el-button + type="info" + size="small" + @click="closeDown('codeForm')" + >{{ $t("common.cancel") }}</el-button> </el-form-item> @@ -114,7 +133,11 @@ :before-close="handleInsertClose" > <div style="width: 100%; max-height: 450px; overflow-y: auto"> - <el-form ref="form" :model="ruleForm" label-width="100px"> + <el-form + ref="form" + :model="ruleForm" + label-width="100px" + > <el-form-item label="瀹℃牳鍗曚綅"> <div> <ul> @@ -151,10 +174,18 @@ </el-input> </el-form-item> <el-form-item> - <el-button class="primary" size="small" @click="getInsertDown">{{ + <el-button + class="primary" + size="small" + @click="getInsertDown" + >{{ $t("common.confirm") }}</el-button> - <el-button type="info" size="small" @click="closeInsertDown">{{ + <el-button + type="info" + size="small" + @click="closeInsertDown" + >{{ $t("common.cancel") }}</el-button> </el-form-item> @@ -275,7 +306,7 @@ .then(_ => { this.closeInsertDown() }) - .catch(_ => {}) + .catch(_ => { }) }, closeInsertDown() { this.ruleForm = { @@ -420,7 +451,7 @@ .then(_ => { this.closeDown() }) - .catch(_ => {}) + .catch(_ => { }) }, closeDown() { this.dialogVisible = false @@ -632,6 +663,7 @@ this.listdata.pageIndex = 1 this.listdata.pageSize = 10 this.listdata.name = res.entity + this.$store.state.propertiesName = res this.getTableDateHidder() }, @@ -813,7 +845,7 @@ }, destroyed() { this.$store.state.propertiesFlag = null - if (propertieshandler != null && Cesium.defined(propertieshandler)) { + if (window.propertieshandler != null && Cesium.defined(window.propertieshandler)) { window.propertieshandler.removeInputAction( Cesium.ScreenSpaceEventType.LEFT_CLICK ) diff --git a/src/components/MapView/mapPickUpPop.vue b/src/components/MapView/mapPickUpPop.vue index fb95e86..5dde04c 100644 --- a/src/components/MapView/mapPickUpPop.vue +++ b/src/components/MapView/mapPickUpPop.vue @@ -1,16 +1,6 @@ <template> <div class="menuPop"> - <div class="leftBox"> - <ul> - <li - v-for="(item, index) in option" - @click="setTableChange(item)" - class="leftBoxLi" - > - {{ item.cnName }} - </li> - </ul> - </div> + <div class="rightBox"> <div class="tableBox"> <el-table @@ -45,6 +35,7 @@ dataQuery_selectByPage, inquiry_selectDomains, inquiry_selectFields, + dataQuery_selectByGid, dataQuerySelectWktById, sign_getPublicKey, dataLib_selectDownloadFile, @@ -60,23 +51,22 @@ export default { data() { return { - option:null, + option: null, tableData: [], - attributeData:[], - queryForm:{ - pageIndex:1, - pageSize:10, + attributeData: [], + queryForm: { + pageIndex: 1, + pageSize: 10, }, - pageCount:0, - pickupInfo:null, - optionx:[], - wkt:null, + pageCount: 0, + pickupInfo: null, + optionx: [], + wkt: null, } }, methods: { async getTableDateHidder() { - let name = this.pickupInfo.url.replaceAll("LF:",""); - name = name.replaceAll("_",""); + var name = this.$store.state.pickoption.name; const data = await inquiry_selectFields({ name: name }) if (data.code != 200) { this.$message.error("鍒楄〃璋冪敤澶辫触") @@ -114,45 +104,32 @@ }, async getTableData() { this.tableData = [] - let name = this.pickupInfo.url.replaceAll("LF:",""); - name = name.replaceAll("_",""); - let info = this.$store.state.pickUpPointInfo; - let params = { - buffer:10, - limit:20, - name:name, - wkt:`POINT (${info.lon} ${info.lat})`, - } - const data = await selectByBuffer(params) + const data = await dataQuery_selectByGid(this.$store.state.pickoption) if (data.code != 200) { - this.$message.error("鍒楄〃璋冪敤澶辫触") + return } + var valste = data.result - var val_Data = data.result - for (var i in val_Data) { - var valste = val_Data[i] - for (var j in this.optionx) { - if ( - this.optionx[j].domainNa != null && - this.optionx[j].domainNa != undefined - ) { - valste[this.optionx[j].field] = this.optionx[j].domainNa - } + + for (var j in this.optionx) { + if ( + this.optionx[j].domainNa != null && + this.optionx[j].domainNa != undefined + ) { + + valste[this.optionx[j].field] = this.optionx[j].domainNa } } - this.pageCount = data.count - this.tableData = data.result + + + this.tableData = [valste] + }, }, mounted() { - this.option = JSON.parse(sessionStorage.getItem("checkedLayers")); - this.pickupInfo = this.option.length > 0 ? this.option[0] : {}; + this.getTableDateHidder(); - this.$bus.$on("treeChanged", changed => { - if (changed){ - this.option = JSON.parse(sessionStorage.getItem("checkedLayers")); - } - }) + }, } </script> @@ -191,7 +168,7 @@ } .rightBox { - width: calc(80% - 1px); + width: calc(100% - 1px); height: 100%; float: left; .rightTitle { @@ -200,8 +177,8 @@ width: 100%; } .tableBox { - position: relative; - height: 89%; + position: rela0ive; + height: 100%; } .rightPage { margin-left: 50px; diff --git a/src/components/MapView/mapSpacePop.vue b/src/components/MapView/mapSpacePop.vue index 661cf6b..162a30f 100644 --- a/src/components/MapView/mapSpacePop.vue +++ b/src/components/MapView/mapSpacePop.vue @@ -473,10 +473,18 @@ } that.$store.state.propertiesFlag = "2" } else { - that.$store.state.propertiesFlag = propertiesFlag + if (propertiesFlag == 1) { + that.$store.state.propertiesFlag = propertiesFlag + } else { + that.$store.state.propertiesFlag = null + } } } else { - that.$store.state.propertiesFlag = propertiesFlag + if (propertiesFlag == 1) { + that.$store.state.propertiesFlag = propertiesFlag + } else { + that.$store.state.propertiesFlag = null + } } }, Cesium.ScreenSpaceEventType.MOUSE_MOVE) }, @@ -569,10 +577,6 @@ num -= val[i].botdepth; this.$store.state.histogramLayer.push(layer) } - - - - } }, @@ -864,7 +868,7 @@ }, destroyed() { this.$store.state.propertiesFlag = null - if (propertieshandler != null && Cesium.defined(propertieshandler)) { + if (window.propertieshandler != null && Cesium.defined(window.propertieshandler)) { window.propertieshandler.removeInputAction( Cesium.ScreenSpaceEventType.LEFT_CLICK ) diff --git a/src/components/mapsdk.vue b/src/components/mapsdk.vue index 81fb2b9..dd9844e 100644 --- a/src/components/mapsdk.vue +++ b/src/components/mapsdk.vue @@ -359,11 +359,11 @@ <span>灞炴�т俊鎭�</span> <div style="float: right; cursor: pointer"> <el-link - v-if="$store.state.propertiesName.tabDesc == '鍕樺療宸ョ偣'" - type="primary" - :underline="false" - @click="getPointInfo" - style="margin-right: 10px" + v-if="$store.state.propertiesName.tabDesc == '鍕樺療宸ョ偣'" + type="primary" + :underline="false" + @click="getPointInfo" + style="margin-right: 10px" >鍕樺療淇℃伅琛�</el-link> <el-link type="primary" @@ -397,31 +397,29 @@ </div> <!--鍕樺療淇℃伅寮圭獥--> <div - class="attributionPop" - v-if="showAttribute" + class="attributionPop" + v-if="showAttribute" > <el-card class="box-card"> <div slot="header"> <span>鍕樺療淇℃伅</span> <div style="float: right; cursor: pointer"> <i - class="el-icon-close" - @click="showAttribute=false" + class="el-icon-close" + @click="showAttribute=false" ></i> </div> </div> <div - class="pointInfoBoxContext" - style="height:250px;overflow-y: auto" + class="pointInfoBoxContext" + style="height:250px;overflow-y: auto" > <div - style="line-height: 20px" - v-for="(item, index) in attributeList" - :key="index" + style="line-height: 20px" + v-for="(item, index) in attributeList" + :key="index" > - <span - style="font-size: 14px;font-weight: bold;margin-right: 5px" - >{{item.alias}}:</span> + <span style="font-size: 14px;font-weight: bold;margin-right: 5px">{{item.alias}}:</span> <span>{{item.value ? item.value :'鏆傛棤鏁版嵁'}}</span> </div> </div> @@ -450,19 +448,37 @@ </div> <!--涓夌淮鎴潰鍒嗘瀽寮圭獥--> <div - class="modelClipPop" - v-if="$store.state.propertiesFlag == '3'" + class="modelClipPop" + v-if="$store.state.propertiesFlag == '3'" > <div class="slide-bg"> - <el-slider class="slide" @change="valveChange()" :min="-300" :max="300" v-model="valueX"></el-slider> + <el-slider + class="slide" + @change="valveChange()" + :min="-300" + :max="300" + v-model="valueX" + ></el-slider> <span>宸﹀彸鎴潰</span> </div> <div class="slide-bg"> - <el-slider class="slide" @change="valveChange()" :min="-300" :max="300" v-model="valueY"></el-slider> + <el-slider + class="slide" + @change="valveChange()" + :min="-300" + :max="300" + v-model="valueY" + ></el-slider> <span>鍓嶅悗鎴潰</span> </div> <div class="slide-bg"> - <el-slider class="slide" @change="valveChange()" :min="-300" :max="300" v-model="valueZ"></el-slider> + <el-slider + class="slide" + @change="valveChange()" + :min="-300" + :max="300" + v-model="valueZ" + ></el-slider> <span>涓婁笅鎴潰</span> </div> </div> @@ -677,9 +693,9 @@ }, showAttribute: false, attributeList: [], - valueZ:0, - valueX:0, - valueY:0 + valueZ: 0, + valueX: 0, + valueY: 0 }; }, mounted() { @@ -692,24 +708,24 @@ }); this.$bus.$on('closeMenuPop', (e) => { //闈炶矾寰勫垎鏋� - if (e != 'd3'){ + if (e != 'd3') { this.showPathAnalysisBoxDialog = false; } //闈炲潯搴﹀垎鏋� - if (e != 'd2'){ + if (e != 'd2') { this.showLengendDialog = false; } //闈炲湴褰㈠钩鏁� - if (e != 'd10'){ + if (e != 'd10') { this.showTerrainLevelDialog = false; } }); //妯″瀷鎹曟崏 this.catchmodel() - window.localStorage.setItem('slider_x',this.valueX); - window.localStorage.setItem('slider_y',this.valueY); - window.localStorage.setItem('slider_z',this.valueZ); + window.localStorage.setItem('slider_x', this.valueX); + window.localStorage.setItem('slider_y', this.valueY); + window.localStorage.setItem('slider_z', this.valueZ); }, methods: { @@ -1359,7 +1375,8 @@ if (this.$store.state.propertiesName == null) { return } - let tabName = this.$store.state.propertiesName.ns + '.' + this.$store.state.propertiesName.tab; + + let tabName = this.$store.state.propertiesName.ns + '.' + this.$store.state.propertiesName.enName; let eventid = this.$store.state.propertiesInfo.eventid; var obj = { @@ -1375,6 +1392,7 @@ this.$message.error('鏆傛棤闄勪欢'); return } + this.attachList = res.result; this.showAttach = true; }, @@ -1439,9 +1457,9 @@ return m < 10 ? '0' + m : m; }, //鍕樺療淇℃伅琛� - getPointInfo(){ + getPointInfo() { this.showAttribute = !this.showAttribute; - if (this.showAttribute){ + if (this.showAttribute) { let attrbuteOption = workSite; var name = attrbuteOption[0].table.replaceAll("_", ""); this.getAttributeDomFiled(name); @@ -1480,18 +1498,18 @@ std.push(data1[i]); } } - this.getAttributeTableData(std, res,this.$store.state.propertiesInfo.宸ョ偣鍚嶇О,data1) + this.getAttributeTableData(std, res, this.$store.state.propertiesInfo.宸ョ偣鍚嶇О, data1) }, //鑾峰彇琛ㄦ牸淇℃伅 - async getAttributeTableData(res, name,title,list) { + async getAttributeTableData(res, name, title, list) { let attributeFild = res; let parmams = { - name:name, - pageIndex:1, - pageSize:10, - count:0, - title:title, - filter : "workname = " + "'" + title + "'", + name: name, + pageIndex: 1, + pageSize: 10, + count: 0, + title: title, + filter: "workname = " + "'" + title + "'", } const data = await dataQuery_selectByPage(parmams); if (data.code != 200) { @@ -1507,12 +1525,12 @@ } } } - let info = data.result.length >0 ? data.result[0] : ''; - if (info){ + let info = data.result.length > 0 ? data.result[0] : ''; + if (info) { let keys = Object.keys(info); keys.forEach((obj) => { list.forEach((item) => { - if (item.field == obj){ + if (item.field == obj) { item.value = info[obj]; } }) @@ -1520,10 +1538,10 @@ this.attributeList = list; } }, - valveChange(){ - window.localStorage.setItem('slider_x',this.valueX); - window.localStorage.setItem('slider_y',this.valueY); - window.localStorage.setItem('slider_z',this.valueZ); + valveChange() { + window.localStorage.setItem('slider_x', this.valueX); + window.localStorage.setItem('slider_y', this.valueY); + window.localStorage.setItem('slider_z', this.valueZ); } }, destroyed() { @@ -1581,26 +1599,26 @@ padding: 10px 20px; } } - .modelClipPop{ + .modelClipPop { width: 350px; z-index: 40; position: absolute; left: 2%; top: 3%; - background: rgba(255,255,255,0.85); + background: rgba(255, 255, 255, 0.85); border: 1px solid rgba(32, 160, 255, 0.6); - .slide-bg{ - padding:10px; + .slide-bg { + padding: 10px; display: flex; align-items: center; - .slide{ + .slide { width: 250px; margin-left: 5px; margin-right: 15px; } } } - .pathAnalysisBox{ + .pathAnalysisBox { width: 412px; height: 370px; z-index: 40; @@ -1608,7 +1626,7 @@ right: 8%; bottom: 1%; } - .attributionPop{ + .attributionPop { width: 350px; height: 370px; z-index: 40; diff --git a/src/store/index.js b/src/store/index.js index 0a314fe..d944bf5 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -68,6 +68,8 @@ attachinfo: null, catModel: false, catModelInfo: null, + showPopBoxFlag: false, + pickoption: null, }, mutations: { //鑾峰彇鏉冮檺鍚堥泦 diff --git a/src/views/Synthesis/LeftMenu.vue b/src/views/Synthesis/LeftMenu.vue index ca3e32f..be8092f 100644 --- a/src/views/Synthesis/LeftMenu.vue +++ b/src/views/Synthesis/LeftMenu.vue @@ -475,12 +475,7 @@ name: "绌洪棿鏌ヨ", css: "twoMenu_imge52", }, - { - id: "e3", - label: "synthesis.pickup", - name: "鎷惧彇", - css: "twoMenu_imge52", - }, + ], [ { @@ -1416,7 +1411,7 @@ Viewer.screenSpaceEventHandler.setInputAction(function (event) { let p = sgworld.Navigate.getMouseDegrees(event); console.log(p); - if (that.showPickUp){ + if (that.showPickUp) { that.getPickUpData(p); } }, Cesium.ScreenSpaceEventType.LEFT_CLICK); @@ -1837,7 +1832,7 @@ if (!m_box) { m_box = Viewer.entities.add({ id: 'ClopBox', - modelMatrixPrimitive:modelMatrixPrimitive, + modelMatrixPrimitive: modelMatrixPrimitive, position: boundingSphere.center, box: { dimensions: new Cesium.Cartesian3(boundingSphere.radius * 1.2, boundingSphere.radius * 1.2, 40), @@ -1922,7 +1917,7 @@ return function () { var num_x = window.localStorage.getItem('slider_x') / 100000; var num_y = window.localStorage.getItem('slider_y') / 100000; - var num_z = window.localStorage.getItem('slider_z')/1.5;//璇诲彇婊戝姩鏉″�� + var num_z = window.localStorage.getItem('slider_z') / 1.5;//璇诲彇婊戝姩鏉″�� var origin_degree = cartesian3ToDegrees(origin); var target_degree_x = [origin_degree[0] + num_x, origin_degree[1], +origin_degree[2]]; var target_degree_y = [origin_degree[0], origin_degree[1] + num_y, +origin_degree[2]]; @@ -1970,7 +1965,7 @@ } else if (type == 'top') { if (num_z < 0) { - plane.distance = m_dis_z; + plane.distance = m_dis_z; // console.log('num_z=========',num_z) // console.log('m_dis_z=========',m_dis_z) // plane.distance = distance - m_dis_z; @@ -1986,9 +1981,9 @@ } function createPlanePos(origin, x, y, z) { - var clipbox=Viewer.entities.getById('ClopBox'); + var clipbox = Viewer.entities.getById('ClopBox'); if (clipbox) { - clipbox.position=new Cesium.CallbackProperty(function () { + clipbox.position = new Cesium.CallbackProperty(function () { return Cesium.Cartesian3.fromDegrees(origin[0] + x, origin[1] + y, +origin[2] + z);//瀹炴椂杩斿洖褰撳墠鐩掑瓙鐨勪綅缃� }, false); } @@ -2232,6 +2227,7 @@ if (data.code != 200) { return this.$message.error("鍥惧眰鍒楄〃鏌ヨ澶辫触"); } + var std = data.result; var that = this; var checkKey = []; @@ -2243,17 +2239,21 @@ if (str.url != null && str.type == 2) { if (str.isShow == 1) { checkKey.push(str.id); - that.setAddLayers(str); - if (str.serveType == "WMS" && str.url){ - checkedLayers.push(str); - } } return str; } }); - //瀛樺偍閫変腑鍥惧眰 - sessionStorage.setItem("checkedLayers",JSON.stringify(checkedLayers)); + var value = std.filter((str) => { + if (str.url != null && str.type == 2 && str.isShow == 1) { + + return str; + } + }) + + this.setAddLayers(value); var res = this.setTreeData(val); + //瀛樺偍閫変腑鍥惧眰 + // sessionStorage.setItem("checkedLayers", JSON.stringify(checkedLayers)); for (var i in res) { res[i].children = res[i].children.filter((val) => { @@ -2262,8 +2262,9 @@ } }); } + this.$store.state.treeData = res; - // this.$refs.tree.setCheckedKeys(checkKey); + this.$store.state.checkedKeys = checkKey; }, setTreeData(source) { @@ -2278,101 +2279,105 @@ }); }, setAddLayers(res) { - if (res.serveType == "WMS") { - var resource = geoServerURl; - if (res.resource != null && res.resource != undefined) { - resource = res.resource; + var std = [[]]; + for (var i in res) { + switch (res[i].serveType) { + case "WMS": + std[0].push(res[i]) + break; } - var imageryLayers = window.Viewer.scene.imageryLayers; - let layerWMS = new Cesium.WebMapServiceImageryProvider({ - url: resource, - layers: res.url, - parameters: { - transparent: true, - format: "image/png", - srs: "EPSG:4490", - styles: "", - }, - tileWidth: 512, - tileHeight: 512, - }); - layerWMS.name = res.cnName; - //閫忔槑搴� - var tdtAnnoLayer = imageryLayers.addImageryProvider(layerWMS); - if (res.opacity) { - tdtAnnoLayer.alpha = parseInt(res.opacity) / 100; - } - var layer2 = new Image({ - name: res.cnName, - source: new ImageWMS({ - crossOrigin: "anonymous", - url: resource, - params: { - FORMAT: "image/png", - VERSION: "1.1.1", - LAYERS: res.url, - }, - }), - }); - if (res.opacity) { - layer2.setOpacity(parseInt(res.opacity) / 100); - } - window.map.addLayer(layer2); - } else if (res.serveType == "WFS") { - var url = - res.resource + - "?service=WFS&version=1.0.0&request=GetFeature&typeName=" + - res.url + - "&outputFormat=application%2Fjson"; - $.ajax({ - url: url, - cache: false, - async: true, - success: function (data) { - var datasource = Cesium.GeoJsonDataSource.load(data, { - stroke: Cesium.Color.YELLOW, - fill: Cesium.Color.YELLOW.withAlpha(0.1), - alpha: 0.1, - strokeWidth: 8, - clampToGround: true, //鏄惁璐村湴 - }); - datasource.then((data) => { - data.name = res.cnName; - window.Viewer.dataSources.add(data); - }); - }, - error: function (data) { - console.log("error"); - }, - }); - - var vectorLayer = new VectorLayer({ - name: res.cnName, - source: new VectorSource({ - url: url, - format: new GeoJSON(), - }), - }); - window.map.addLayer(vectorLayer); - } else if (res.serveType == "Tileset") { - var tileset = Viewer.scene.primitives.add( - new Cesium.Cesium3DTileset({ - name: res.cnName, - url: modelUrl + "/" + res.url, //192.168.20.106,to4 - maximumScreenSpaceError: 64, // 鏈�澶у睆骞曠┖闂撮敊璇細16 - maximumMemoryUsage: 768, // 鏈�澶у唴瀛橈細512 - dynamicScreenSpaceError: true, // 鍑忓皯绂荤浉鏈鸿緝杩滅殑灞忓箷绌洪棿閿欒锛歠alse - skipLevelOfDetail: true, // 鍦ㄩ亶鍘嗘椂鍊欒烦杩囪鎯咃細false - }) - ); - - tileset.readyPromise.then(function (tileset) { - tileset.id = res.cnName; - tileset.layerId = res.id; - Viewer.flyTo(tileset); - }); + } + if (std[0].length != 0) { + this.setAddWmsLayer(std[0]) } }, + setAddWmsLayer(res) { + + for (var i = 0; i < window.Viewer.imageryLayers._layers.length; i++) { + var val_id = window.Viewer.imageryLayers._layers[i].imageryProvider.name; + if (val_id == "Wms_Layer") { + window.Viewer.imageryLayers.remove( + window.Viewer.imageryLayers._layers[i] + ); + } + } + var layers_ol = window.map.getAllLayers(); + for (var i in layers_ol) { + var layerOl = layers_ol[i]; + if (layerOl.values_.name == "Wms_Layer") { + window.map.removeLayer(layers_ol[i]); //鏄剧ず鍥惧眰 + } + } + var url = []; + for (var i in res) { + url.push(res[i].url) + } + url = url.reverse(); + var that = this; + var getFeatureInfoFormat = new Cesium.GetFeatureInfoFormat("html", null, function (html) { + that.getFeatureInfo(html) + }); + window.layerWMS = new Cesium.WebMapServiceImageryProvider({ + url: geoServerURl, + layers: url.toString(), + getFeatureInfoParameters: { info_format: 'text/html' }, + enablePickFeatures: true, + getFeatureInfoFormats: [getFeatureInfoFormat], + parameters: { + transparent: true, + format: "image/png", + srs: "EPSG:4490", + styles: "", + }, + tileWidth: 512, + tileHeight: 512, + }); + layerWMS.name = "Wms_Layer"; + window.Viewer.scene.imageryLayers.addImageryProvider(window.layerWMS); + var layer2 = new Image({ + name: "Wms_Layer", + source: new ImageWMS({ + crossOrigin: "anonymous", + url: geoServerURl, + params: { + FORMAT: "image/png", + VERSION: "1.1.1", + LAYERS: url.toString(), + }, + }), + }); + if (res.opacity) { + layer2.setOpacity(parseInt(res.opacity) / 100); + } + window.map.addLayer(layer2); + }, + async getFeatureInfo(html) { + var start = html.indexOf("<caption class=\"featureInfo\">") + "<caption class=\"featureInfo\">".length; + var end = html.indexOf("</caption>"); + var tab = html.substr(start, end - start); + start = html.lastIndexOf(tab) + tab.length + 1; + end = html.indexOf("</td>", start); + var gid = html.substr(start, end - start); + if (gid && tab) { + this.$store.state.pickoption = { + gid: gid, + name: tab.replaceAll("_", "") + } + + this.$refs && + this.$refs.queryinfo && + this.$refs.queryinfo.close("queryinfo"); + this.$store.state.mapPopBoxFlag = "4"; + + this.$refs && + this.$refs.queryinfo && + this.$refs.queryinfo.open("鎷惧彇鍒嗘瀽", null,); + } + + + }, + + showModelAttach() { if (this.$store.state.attachModel) { var name = this.$store.state.attachinfo.cnName; @@ -2621,6 +2626,29 @@ if (!showPop) { this.$message.warning("鏆傛棤鏁版嵁!"); } + }, + showPopBox() { + + if (this.$store.state.showPopBoxFlag == true) { + this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close(); + + + this.$refs && + this.$refs.queryinfo && + this.$refs.queryinfo.open("灞炴��", null, { + close: () => { + this.$store.state.showPopBoxFlag == false + if (this.$store.state.primitLayer != null) { + sgworld.Creator.DeleteObject(this.$store.state.primitLayer); + this.$store.state.primitLayer = null; + } + + if (window.Viewer.scene.primitives.length != 0) { + window.Viewer.scene.primitives.removeAll(); + } + }, + }); + } } }, mounted() { @@ -2638,7 +2666,9 @@ this.menuChange(res); } }); - + this.$bus.$on("showMenuLayer", ((res) => { + this.setAddLayers(res); + })); this.$store.state.showAllLayers = true; this.$store.state.layerMnage = false; this.$store.state.treeData = null; @@ -2653,6 +2683,9 @@ catch(newVal, oldVal) { this.showModelCatch(); }, + popObj(newVal, oldVal) { + this.showPopBox(); + } }, computed: { Obj() { @@ -2661,6 +2694,9 @@ catch() { return this.$store.state.catModel; }, + popObj() { + return this.$store.state.showPopBoxFlag; + } }, }; </script> diff --git a/src/views/Tools/LayerTree.vue b/src/views/Tools/LayerTree.vue index c9d2169..35b2b83 100644 --- a/src/views/Tools/LayerTree.vue +++ b/src/views/Tools/LayerTree.vue @@ -168,7 +168,7 @@ >纭� 瀹�</el-button> </span> </el-dialog> - <queryinfo ref="queryinfo" /> + </div> </template> @@ -241,21 +241,7 @@ var layer = this.currentData.enName.replaceAll("_", ""); this.$store.state.mapSpaceQueryLayer = layer; this.$store.state.mapPopBoxFlag = "2"; - this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close(); - this.$refs && - this.$refs.queryinfo && - this.$refs.queryinfo.open("灞炴��", null, { - close: () => { - if (this.$store.state.primitLayer != null) { - sgworld.Creator.DeleteObject(this.$store.state.primitLayer); - this.$store.state.primitLayer = null; - } - - if (window.Viewer.scene.primitives.length != 0) { - window.Viewer.scene.primitives.removeAll(); - } - }, - }); + this.$store.state.showPopBoxFlag = true; }, modelAttach() { this.menuVisible = false; @@ -293,6 +279,7 @@ rightClick(event, object, Node, element) { this.currentData = object; this.currentNode = Node; + this.$store.state.propertiesName = this.currentData; if (this.currentData.serveType == "Tileset") { this.showModelAttach = true; @@ -386,16 +373,10 @@ this.menuVisible = false var label = this.currentNode.data.cnName; if (this.currentNode.data.serveType == "WMS") { - for (var i in window.Viewer.imageryLayers._layers) { - if ( - window.Viewer.imageryLayers._layers[i].imageryProvider.name === - label - ) { - window.Viewer.imageryLayers.remove( - window.Viewer.imageryLayers._layers[i] - ); - } - } + var value = this.$refs.tree.getCheckedNodes(); + + this.$bus.$emit("showMenuLayer", value); + } else if (this.currentNode.data.serveType == "WFS") { for (var i in window.Viewer.dataSources._dataSources) { if (window.Viewer.dataSources._dataSources[i].name == label) { @@ -431,23 +412,10 @@ this.currentData = data ? data : this.currentData; var layer = this.currentData.enName.replaceAll("_", ""); this.$store.state.mapSpaceQueryLayer = layer; - + this.$store.state.showPopBoxFlag = true; this.$store.state.mapPopBoxFlag = "2"; - this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close(); - this.$refs && - this.$refs.queryinfo && - this.$refs.queryinfo.open("灞炴��", null, { - close: () => { - if (this.$store.state.primitLayer != null) { - sgworld.Creator.DeleteObject(this.$store.state.primitLayer); - this.$store.state.primitLayer = null; - } - if (window.Viewer.scene.primitives.length != 0) { - window.Viewer.scene.primitives.removeAll(); - } - }, - }); + }, //妯″瀷瀹氫綅 positioning() { @@ -534,36 +502,13 @@ handleCheckChange(data, checked, indeterminate) { if (data.type != 2) return; - var std = []; - if (data.serveType == "WMS") { - for (var i = 0; i < window.Viewer.imageryLayers._layers.length; i++) { - var val_id = - window.Viewer.imageryLayers._layers[i].imageryProvider.name; - if (val_id == data.cnName) { - std.push(data.label); + var value = this.$refs.tree.getCheckedNodes(); - const img_layer = window.Viewer.imageryLayers._layers[i]; - img_layer.show = checked; - } - } - //瀛樺偍閫変腑鍥惧眰 - let checkedLayers = JSON.parse(sessionStorage.getItem("checkedLayers")); - if (checked && data.url){ - checkedLayers.push(data); - } - else { - for (let i = 0; i < checkedLayers.length; i++) { - let item = checkedLayers[i]; - if (item.enName == data.enName){ - checkedLayers.splice(i,1); - } - } - } - sessionStorage.setItem("checkedLayers",JSON.stringify(checkedLayers)); - setTimeout(() => { - this.$bus.$emit("treeChanged", true); - }, 500) - } else if (data.serveType == "WFS") { + this.$bus.$emit("showMenuLayer", value); + + + + if (data.serveType == "WFS") { if (window.Viewer.dataSources._dataSources.length == 0) { this.setAddLayers(data); } else { @@ -575,28 +520,31 @@ } } } else if (data.serveType == "Tileset") { + if (Viewer.scene.primitives._primitives.length == 0) { this.setAddLayers(data); } else { + var std = []; for (var i in Viewer.scene.primitives._primitives) { Viewer.scene.primitives._primitives[i].show = checked; if (Viewer.scene.primitives._primitives[i].id == data.cnName) { - // std.push(res.id); + std.push(data.id); Viewer.flyTo(Viewer.scene.primitives._primitives[i]); } } } - } - if (std.length == 0 && checked == true) { - this.setAddLayers(data); - } else { - window.map.getLayers().getArray().forEach(item => { - if (item.get("name") == data.cnName) { - item.setVisible(checked); + if (std.length == 0 && checked == true) { + this.setAddLayers(data); + } else { + window.map.getLayers().getArray().forEach(item => { + if (item.get("name") == data.cnName) { + item.setVisible(checked); - } - }); + } + }); + } } + @@ -702,7 +650,7 @@ this.tileSet(tileset, parseFloat(res.elev)) Viewer.flyTo(tileset); }); - window.model = tileset + // window.model = tileset } }, @@ -748,7 +696,7 @@ if (str.isShow == 1) { checkKey.push(str.id); that.setAddLayers(str); - if (str.serveType == "WMS" && str.url){ + if (str.serveType == "WMS" && str.url) { checkedLayers.push(str); } } @@ -757,7 +705,7 @@ }); //瀛樺偍閫変腑鍥惧眰 - sessionStorage.setItem("checkedLayers",JSON.stringify(checkedLayers)); + sessionStorage.setItem("checkedLayers", JSON.stringify(checkedLayers)); var res = this.setTreeData(val); for (var i in res) { diff --git a/src/views/Tools/queryinfo.vue b/src/views/Tools/queryinfo.vue index 24277e1..649848c 100644 --- a/src/views/Tools/queryinfo.vue +++ b/src/views/Tools/queryinfo.vue @@ -66,6 +66,7 @@ console.log(item); return item.id === id; }); + this.$store.state.showPopBoxFlag = false; let data = this.PopupData.splice(index, 1)[0]; if (this.$store.state.pipelineEntity.length != 0) { for (var i in this.$store.state.pipelineEntity) { diff --git a/src/views/datamanage/uploadmanage.vue b/src/views/datamanage/uploadmanage.vue index 0a32823..3a5edd0 100644 --- a/src/views/datamanage/uploadmanage.vue +++ b/src/views/datamanage/uploadmanage.vue @@ -11,16 +11,22 @@ class="tabs_pane" @click="setTabsChange()" > - <div :class="{ changetabs : active == 'first'}"> - {{$t('dataManage.uploadObj.dataRelease')}} + <div + class="tabsSpan" + :class="{ changetabs : active == 'first'}" + > + <span> {{$t('dataManage.uploadObj.dataRelease')}}</span> </div> </div> <div class="tabs_pane" @click="setTabsChange()" > - <div :class="{ changetabs : active == 'second'}"> - {{$t('dataManage.uploadObj.releaseList')}} + <div + class="tabsSpan" + :class="{ changetabs : active == 'second'}" + > + <span> {{$t('dataManage.uploadObj.releaseList')}}</span> </div> </div> </div> -- Gitblit v1.9.3