From 64479e2ce8b7c30e36f08c41eed226a1def1be82 Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期二, 09 五月 2023 17:00:39 +0800 Subject: [PATCH] 瓦片下载功能添加;综合展示图层管理修改;数据管理字段管理编辑修改 --- src/views/Tools/maplayer.vue | 7 src/api/api.js | 12 ++ src/views/Tools/LayerTree.vue | 69 ++++++++++++- src/views/datamanage/dictionaryManage.vue | 4 src/views/Synthesis/LeftMenu.vue | 6 + src/components/mapsdk.vue | 189 +++++++++++++++++++++++++++++++++++++ 6 files changed, 272 insertions(+), 15 deletions(-) diff --git a/src/api/api.js b/src/api/api.js index 65fd19c..8219aa6 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -547,6 +547,16 @@ export function inquiry_SelectTabs(params) { return request.get('/inquiry/selectTabs', { params: params }); } + +//缁煎悎灞曠ず=>鏌ヨ=>涓嬭浇鐡︾墖 +export function inquiry_downloadTiles(params) { + return service.post('/inquiry/downloadTiles', params); +} + + + + + //杩愮淮绠$悊=>鐢ㄦ埛绠$悊=>鑾峰彇鍒楄〃 export function userSelectByPageAndCount(params) { return request.get('/user/selectByPageAndCount', { params: params }); @@ -618,8 +628,6 @@ export function dataUpload_selectPageAndCountByPid(params) { return request.get('/dataUpload/selectPageAndCountByPid', { params: params }); } - - //鏁版嵁涓婁紶=鍒犻櫎鏁版嵁 diff --git a/src/components/mapsdk.vue b/src/components/mapsdk.vue index 0efb01d..2003a36 100644 --- a/src/components/mapsdk.vue +++ b/src/components/mapsdk.vue @@ -1,5 +1,10 @@ <template> - <div class="mapBox"> + <div + class="mapBox" + v-loading="loading" + :element-loading-text="loadingText" + element-loading-background="rgba(0, 0, 0, 0.8)" + > <div id="mapdiv"> <div class="menu_Top box_divm" @@ -646,6 +651,72 @@ </div> </el-dialog> + <el-dialog + title="鐡︾墖涓嬭浇" + :append-to-body="false" + :visible.sync="downTitleFlag" + :close-on-click-modal="false" + :show-close="false" + width="30%" + > + <el-form + :model="ruleForm" + status-icon + :rules="rules" + ref="ruleForm" + label-width="100px" + class="demo-ruleForm" + > + <el-form-item + label="鍚嶇О" + prop="title" + > + <el-input + v-model="ruleForm.title" + size="small" + placeholder="璇疯緭鍏ユ暟鎹悕绉�..." + ></el-input> + </el-form-item> + <el-form-item + label="瀵嗙爜" + prop="pass" + > + <el-input + show-password + type="password" + v-model="ruleForm.pass" + autocomplete="off" + size="small" + placeholder="璇疯緭鍏ュ瘑鐮�..." + ></el-input> + </el-form-item> + <el-form-item + label="纭瀵嗙爜" + prop="checkPass" + > + <el-input + show-password + type="password" + v-model="ruleForm.checkPass" + autocomplete="off" + size="small" + placeholder="纭瀵嗙爜..." + ></el-input> + </el-form-item> + + <el-form-item> + <el-button + type="primary" + size="small" + @click='submitTitleDown("ruleForm")' + >鎻愪氦</el-button> + <el-button + size="small" + @click='cannelTitleDown("ruleForm")' + >鍙栨秷</el-button> + </el-form-item> + </el-form> + </el-dialog> <!-- <div--> <!-- @click="changeMenulayer"--> <!-- class="center CenDiv"--> @@ -659,6 +730,11 @@ </div> <model-property ref='modelProperty'></model-property> + <iframe + id="downFrame" + src="" + style="display: none; border: 0; padding: 0; height: 0; width: 0" + ></iframe> </div> </template> @@ -673,7 +749,8 @@ comprehensive_selectRoute, dataLib_selectFiles, dataQuery_selectFields, dataQuery_selectDomains, dataQuery_selectByPage, - comprehensive_selectPubById, comprehensive_selectModelByGuid + comprehensive_selectPubById, comprehensive_selectModelByGuid, decr, + encr, inquiry_downloadTiles, sign_getPublicKey } from '../api/api' import { getToken } from '@/utils/auth' @@ -701,6 +778,35 @@ } } } + callback(); + } + }; + var checkAge = (rule, value, callback) => { + if (!value) { + return callback(new Error('鏁版嵁鍚嶇О涓嶈兘涓虹┖')); + } + callback(); + + }; + var validatePass = (rule, value, callback) => { + if (value === '') { + callback(new Error('璇疯緭鍏ュ瘑鐮�')); + } else { + var passwordreg = + /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![a-z0-9]+$)(?![a-z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![0-9\W!@#$%^&*`~()\\-_+=,.?;<>]+$)[a-zA-Z0-9\W!@#$%^&*`~()\\-_+=,.?;<>]{12,20}$/ + + if (!passwordreg.test(value)) { + callback(new Error("瀵嗙爜蹇呴』鐢辨暟瀛椼�佸瓧姣嶃�佺壒娈婂瓧绗︾粍鍚�,璇疯緭鍏�13-20浣�")) + } + callback(); + } + }; + var validatePass2 = (rule, value, callback) => { + if (value === '') { + callback(new Error('璇峰啀娆¤緭鍏ュ瘑鐮�')); + } else if (value !== this.ruleForm.pass) { + callback(new Error('涓ゆ杈撳叆瀵嗙爜涓嶄竴鑷�!')); + } else { callback(); } }; @@ -733,6 +839,15 @@ message: "鍧愭爣鐐圭粡绾害閿欒,鍧愭爣搴斿湪[116.xxx, 39.yyy]鑼冨洿", }, ], + pass: [ + { validator: validatePass, trigger: 'blur' } + ], + checkPass: [ + { validator: validatePass2, trigger: 'blur' } + ], + title: [ + { validator: checkAge, trigger: 'blur' } + ] }, bufFrom: { val: 50, @@ -786,6 +901,15 @@ valueX: 0, valueY: 0, terrainflag: false, + downTitleFlag: false, + downTitleData: null, + ruleForm: { + pass: '', + checkPass: '', + title: '' + }, + loadingText: '', + loading: false, }; }, mounted() { @@ -812,13 +936,72 @@ }); //妯″瀷鎹曟崏 this.catchmodel() - + this.$bus.$on("titleDown", res => { + this.setDownLoadTitle(res); + }) window.localStorage.setItem('slider_x', this.valueX); window.localStorage.setItem('slider_y', this.valueY); window.localStorage.setItem('slider_z', this.valueZ); }, methods: { + setDownLoadTitle(res) { + this.signGetPublicKey() + this.downTitleFlag = true; + this.downTitleData = res; + }, + async signGetPublicKey() { + const res = await sign_getPublicKey() + if (res && res.code == 200) { + window.encrypt = new JSEncrypt() + encrypt.setPublicKey(res.result) + } + }, + submitTitleDown(formName) { + this.$refs[formName].validate((valid) => { + if (valid) { + + this.downTitleData.title = this.ruleForm.title + // this.downTitleData.pwd = encr(this.ruleForm.pass) + this.downTitleData.pwd = encrypt.encrypt(this.ruleForm.pass) + this.getDownLoadTile(this.downTitleData); + this.cannelTitleDown(); + } else { + + console.log('error submit!!'); + return false; + } + }); + }, + async getDownLoadTile(res) { + this.loading = true; + this.loadingText = "鏁版嵁涓嬭浇涓�,璇风◢绛�..." + $.ajax({ + url: BASE_URL + "/inquiry/downloadTiles?token=" + getToken(), + type: "POST", + data: JSON.stringify(res), + dataType: 'json', // html銆乯son銆乯sonp銆乻cript銆乼ext + contentType: "application/json", // "application/x-www-form-urlencoded" + success: (data) => { + var token = getToken() + var url = BASE_URL + "/dataLib/downloadFile?token=" + token + "&guid=" + data.result + "&pwd=" + res.pwd; + $("#downFrame").attr("src", url).click(); + this.loading = false; + this.loadingText = "" + }, + error: function (e) { + } + }); + }, + cannelTitleDown(formName) { + this.downTitleFlag = false; + // this.$refs[formName].resetFields(); + this.ruleForm = { + pass: '', + checkPass: '', + title: '' + } + }, catchmodel() { var that = this; window.pickedFeature; diff --git a/src/views/Synthesis/LeftMenu.vue b/src/views/Synthesis/LeftMenu.vue index a593fbf..716a4f1 100644 --- a/src/views/Synthesis/LeftMenu.vue +++ b/src/views/Synthesis/LeftMenu.vue @@ -441,6 +441,12 @@ name: "鍦颁笅妯″紡", css: "twoMenu_imge29", }, + { + id: "b10", + label: "synthesis.undergroundMode", + name: "鐡︾墖涓嬭浇", + css: "twoMenu_imge29", + }, ], [ { diff --git a/src/views/Tools/LayerTree.vue b/src/views/Tools/LayerTree.vue index 3b587fb..cd3b9aa 100644 --- a/src/views/Tools/LayerTree.vue +++ b/src/views/Tools/LayerTree.vue @@ -126,6 +126,14 @@ > <i class="el-icon-tickets"></i> 閽诲瓟鏌辩姸鍥� </div> + <div + class="edit" + v-show="shwoTitle" + @click="tileDownload()" + > + <i class="el-icon-download"></i> 鐡︾墖涓嬭浇 + + </div> <!-- <div class="edit" v-show="showModelAttach" @@ -220,6 +228,7 @@ perms_selectLayers, inquiry_selectDomains, comprehensive_selectPubById, project_selectDirAll, project_selectByDirid, dataQuerySelectWktById } from "../../api/api.js"; +import { conditions } from '../Archive/Archive.js'; export default { name: "tree", components: { queryinfo }, @@ -271,11 +280,47 @@ mptLayer: [], optionts: [], proValue: null, - setCheeckedLayer: [] + setCheeckedLayer: [], + shwoTitle: false, }; }, methods: { + //鐡︾墖涓嬭浇 + tileDownload() { + var that = this; + this.menuVisible = false + sgworld.Creator.createSimpleGraphic( + "rectangle", + {}, + function (entity) { + that.getTileRectangle(entity); + sgworld.Creator.SimpleGraphic.clear() + } + ); + }, + getTileRectangle(res) { + var value = res.rectangle.coordinates.getValue(); + var val = { + pubid: this.currentData.pubid, + pwd: "", + title: "", + xmax: Cesium.Math.toDegrees( + value.east + ), + xmin: Cesium.Math.toDegrees( + value.west + ), + ymax: Cesium.Math.toDegrees( + value.north + ), + ymin: Cesium.Math.toDegrees( + value.south + ) + } + this.$bus.$emit("titleDown", val) + + }, //杞瓟鏌辩姸鍥� async histogram() { this.menuVisible = false @@ -325,10 +370,14 @@ this.currentNode = Node; this.$store.state.propertiesName = this.currentData; - if (this.currentData.serveType == "Tileset") { + this.showModelAttach = false; + this.shwoTitle = false; + + + if (this.currentData.serveType == 'TMS') { + this.shwoTitle = true + } else if (this.currentData.serveType == "Tileset") { this.showModelAttach = true; - } else { - this.showModelAttach = false; } if (this.currentData.enName == "s_explorationpoint") { this.shwoHistogram = true; @@ -1081,7 +1130,15 @@ let cloneData = JSON.parse(JSON.stringify(source)); // 瀵规簮鏁版嵁娣卞害鍏嬮殕 return cloneData.filter((father) => { // 寰幆鎵�鏈夐」 - let branchArr = cloneData.filter((child) => father.id == child.pid); // 瀵规瘮ID锛屽垎鍒笂涓嬬骇鑿滃崟锛屽苟杩斿洖鏁版嵁 + let branchArr = cloneData.filter((child) => father.id == child.pid); + if (branchArr.length > 0) { + + branchArr.sort(function (a, b) { + + return a.orderNum - b.orderNum + }) + } + branchArr.length > 0 ? (father.children = branchArr) : ""; // 缁欑埗绾ф坊鍔犱竴涓猚hildren灞炴�э紝骞惰祴鍊� // 灞炰簬鍚屼竴瀵硅薄闂锛屼緥濡傦細浠� a=b銆乧=1 锛岀劧鍚庡啀浠� b.c=c 锛� 閭d箞 a.c=b.c=c=1 锛涘悓鐞嗭紝鍚庣画浠� c.d=2 ,閭d箞 a.c.d 涔熸槸=2锛� // 鐢辨寰幆澶氭鍚庯紝灏辫兘褰㈡垚鐩稿簲鐨勬爲褰㈡暟鎹粨鏋� @@ -1391,7 +1448,9 @@ if (this.$store.state.showAllLayers == true) { this.layersStart(); this.$store.state.showAllLayers = false; + } else { + this.treeData = this.$store.state.treeData; this.$refs.tree.setCheckedKeys(this.$store.state.checkedKeys); } diff --git a/src/views/Tools/maplayer.vue b/src/views/Tools/maplayer.vue index 4afa171..1da7dd5 100644 --- a/src/views/Tools/maplayer.vue +++ b/src/views/Tools/maplayer.vue @@ -5,14 +5,13 @@ v-for="(data, index) in PopupData" :key="data.id" title="鍥惧眰绠$悊" - :maxHeight="data.maxHeight || '400px'" + :maxHeight="data.maxHeight || '700px'" @close="close(data.id)" :left="data.left || left" - :top="data.top || top + index * 42 + 'px'" + :top="data.top || top + index * 30 + 'px'" > - <div> + <div id="eagleMapContainer"> <div - id="eagleMapContainer" style="width:300px;height:400px;" v-drag @mousedown="dragEagle" diff --git a/src/views/datamanage/dictionaryManage.vue b/src/views/datamanage/dictionaryManage.vue index 8285579..4478a44 100644 --- a/src/views/datamanage/dictionaryManage.vue +++ b/src/views/datamanage/dictionaryManage.vue @@ -471,6 +471,7 @@ v-model="insertform.tab" autocomplete="off" style="width:85%" + disabled ></el-input> </el-form-item> <el-form-item @@ -711,7 +712,8 @@ //淇敼璇︽儏寮规 handleEdit(index, row) { this.dialogFormVisible = true; - this.upform = row; + var val = JSON.parse(JSON.stringify(row)) + this.upform = val; }, //鍒犻櫎鍒楄〃 DelFormData() { -- Gitblit v1.9.3