From ec3342e1b34dd02f33dae9bed2db16a14ae8096d Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期三, 21 十二月 2022 17:06:11 +0800 Subject: [PATCH] 1 --- src/views/exportMap/index.vue | 34 + src/views/Archive/index.vue | 10 src/components/MapDiv.vue | 2 src/store/index.js | 1 src/views/datamanage/projectManage.vue | 18 src/views/AuthorizationManagement/roleResAuthorization.vue | 2 src/views/Synthesis/LeftMenu.vue | 56 ++- src/components/mapsdk.vue | 58 --- src/views/datamanage/dataLoader.vue | 474 +++++++++++++++++-------------- src/components/ProjectOl.vue | 4 src/router/index.js | 2 src/views/datamanage/dataUpdata.vue | 45 ++ src/api/api.js | 4 src/assets/lang/zh.js | 4 src/views/Synthesis/index.vue | 13 src/views/Tools/LayerTree.vue | 92 +++-- src/components/MapView/mapMenuTop.vue | 14 src/views/Thematic/index.vue | 6 src/assets/lang/en.js | 4 src/components/navMenu.vue | 11 src/components/MapView/mapSpacePop.vue | 16 21 files changed, 493 insertions(+), 377 deletions(-) diff --git a/src/api/api.js b/src/api/api.js index 7843107..e85bb0d 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -590,6 +590,10 @@ return request.get('/dataLoader/selectDbData', { params: params }); } +export function dataQuerySelectByPage(params) { + return request.get('/inquiry/selectByPage', { params: params }); +} + // //鏁版嵁鍏ュ簱=>鏌ヨ鏂囦欢 // export function dataLoader_selectDirAll(params) { // return request.get('/dataUpload/selectFiles?path=' + params); diff --git a/src/assets/lang/en.js b/src/assets/lang/en.js index e9822e8..6537610 100644 --- a/src/assets/lang/en.js +++ b/src/assets/lang/en.js @@ -166,8 +166,8 @@ index: 'Index', name: 'Name', type: 'Type', - dirid: 'Directory ID', - depid: 'Unit ID', + dirid: 'Directory', + depid: 'Unit', ver: 'Edition', status: 'State', precision: 'Accuracy', diff --git a/src/assets/lang/zh.js b/src/assets/lang/zh.js index 6d19e9e..60885a3 100644 --- a/src/assets/lang/zh.js +++ b/src/assets/lang/zh.js @@ -165,8 +165,8 @@ index: '搴忓彿', name: '鍚嶇О', type: '绫诲瀷', - dirid: '鐩綍ID', - depid: '鍗曚綅ID', + dirid: '鐩綍 ', + depid: '鍗曚綅 ', ver: '鐗堟湰', status: '鐘舵��', precision: '绮惧害', diff --git a/src/components/MapDiv.vue b/src/components/MapDiv.vue index dadd287..8c76f52 100644 --- a/src/components/MapDiv.vue +++ b/src/components/MapDiv.vue @@ -13,7 +13,7 @@ <div id="ds" v-show="isShowDs"></div> <!--openLayers鏄剧ず鐣岄潰--> <div - v-if="isOlMapFlag" + v-show="isOlMapFlag" id="map" class="olMap" :class="[isShowOlMap ? 'olMapTwo' : 'olMapOne']" diff --git a/src/components/MapView/mapMenuTop.vue b/src/components/MapView/mapMenuTop.vue index eeea973..58ae11c 100644 --- a/src/components/MapView/mapMenuTop.vue +++ b/src/components/MapView/mapMenuTop.vue @@ -233,10 +233,19 @@ //娓呯┖鏍囩粯 sgworld.Creator.SimpleGraphic.edit(false, { editProp: false }); sgworld.Creator.SimpleGraphic.clear(); + + if (this.treeChange.length == 0) { + this.$message.error('璇烽�夋嫨瑕佹煡璇㈢殑鏁版嵁'); + return; + } if (this.menuTopFrom.queryType != 'inputFile') { sgworld.Creator.createSimpleGraphic( this.menuTopFrom.queryType, - {}, + { + color: '#00FF0060', + outlineColor: '#0f0', + outlineWidth: 5, + }, (entity) => { this.setTurfGeometry(entity); } @@ -297,7 +306,6 @@ if (type == 'polyline') { var line = turf.lineString(std, { name: 'polyline' }); restVal = turf.buffer(line, 10, { units: 'miles' }); - console.log('line', restVal); } else if (type == 'rectangle') { var ste = this.setCartesianToEightFour(res[0]); std.push([ste.lng, ste.lat]); @@ -325,6 +333,8 @@ this.$store.state.mapPopBoxFlag = '1'; } this.$bus.$emit('changeMapMenuTop', 'true'); + sgworld.Creator.SimpleGraphic.edit(false, { editProp: false }); + sgworld.Creator.SimpleGraphic.clear(); //娓呯┖inputFile // var file = document.getElementById('getMenuTopFile'); // file.outerHTML = file.outerHTML; diff --git a/src/components/MapView/mapSpacePop.vue b/src/components/MapView/mapSpacePop.vue index 9c43282..78a1ffe 100644 --- a/src/components/MapView/mapSpacePop.vue +++ b/src/components/MapView/mapSpacePop.vue @@ -47,12 +47,17 @@ ></el-input> </el-form-item> <el-form-item> - <el-button plain @click="setSpaceTableLayer">鏌ヨ</el-button> + <el-button plain @click="setSpaceTableLayer">鏌ヨ</el-button> <el-button plain @click="restSpacePopLayer">閲嶇疆</el-button> </el-form-item> </el-form> <div class="centTable"> - <el-table :data="tableData" height="220" style="width: 100%"> + <el-table + :data="tableData" + height="220px" + ref="filterTable" + style="width: 100%" + > <el-table-column align="center" type="index" @@ -308,6 +313,7 @@ } } this.tableData = data.result; + this.$refs.filterTable.doLayout(); }, async spaceLocation(index, row) { var param = { @@ -367,7 +373,9 @@ overflow: hidden; border: 1px solid gray; float: left; - + .centTable { + height: 230px; + } .rightTitle { padding: 5px; color: white; @@ -378,7 +386,6 @@ color: white; } } - .bottomPage { position: absolute; bottom: 1%; @@ -394,7 +401,6 @@ } /deep/ .el-table { background-color: transparent; - th, td { background-color: transparent; diff --git a/src/components/ProjectOl.vue b/src/components/ProjectOl.vue index 153fd1e..4261106 100644 --- a/src/components/ProjectOl.vue +++ b/src/components/ProjectOl.vue @@ -62,7 +62,7 @@ var a1 = value.split(' '); console.log(a1); var a2 = transform( - [parseFloat(a1[1]), parseFloat(a1[2])], + [parseFloat(a1[0]), parseFloat(a1[1])], 'EPSG:4326', 'EPSG:3857' ); @@ -116,7 +116,7 @@ var a1 = transform([extent[0], extent[1]], 'EPSG:3857', 'EPSG:4326'); this.$store.state.projeOl = - 'POINT( ' + a1[0].toFixed(6) + ' ' + a1[1].toFixed(6) + ')'; + 'POINT(' + a1[0].toFixed(6) + ' ' + a1[1].toFixed(6) + ')'; this.mapol.removeInteraction(this.draw); }); }, diff --git a/src/components/mapsdk.vue b/src/components/mapsdk.vue index 8dfcc10..58c587c 100644 --- a/src/components/mapsdk.vue +++ b/src/components/mapsdk.vue @@ -229,56 +229,7 @@ selFrom: {}, selectTree: null, - menuList: [ - { - id: 1, - label: '涓�绾� 1', - children: [ - { - id: 4, - label: '浜岀骇 1-1', - children: [ - { - id: 9, - label: '涓夌骇 1-1-1', - }, - { - id: 10, - label: '涓夌骇 1-1-2', - }, - ], - }, - ], - }, - { - id: 2, - label: '涓�绾� 2', - children: [ - { - id: 5, - label: '浜岀骇 2-1', - }, - { - id: 6, - label: '浜岀骇 2-2', - }, - ], - }, - { - id: 3, - label: '涓�绾� 3', - children: [ - { - id: 7, - label: '浜岀骇 3-1', - }, - { - id: 8, - label: '浜岀骇 3-2', - }, - ], - }, - ], + menuList: [], defaultProps: { children: 'children', label: 'label', @@ -306,9 +257,9 @@ sgworld.Navigate.jumpTo({ //璺宠浆瑙嗚 destination: new Cesium.Cartesian3.fromDegrees( - 116.055913, - 39.937685, - 8000 + 116.3911, + 39.9115, + 100000 ), }); Viewer.imageryLayers.addImageryProvider( @@ -373,6 +324,7 @@ }; sgworld.Creator.sfsterrainprovider('mpt', option, '', true, ''); window.elevationTool = new SmartEarth.ElevationTool(window.sgworld); + elevationTool.setContourColor('#F1D487'); }, changeMenulayer() { diff --git a/src/components/navMenu.vue b/src/components/navMenu.vue index ee9de80..641cdd0 100644 --- a/src/components/navMenu.vue +++ b/src/components/navMenu.vue @@ -94,7 +94,7 @@ itemdetail: {}, formLabelWidth: '70px', count: 5, - changeSelectStyle: 5, + changeSelectStyle: null, changeliSelect: null, changeSelectdiv: false, listMenu: [ @@ -215,8 +215,15 @@ res[i].children = result.result.filter((value) => { return value.pid == res[i].id; }); + this.listMenu.push(res[i]); + this.changeSelectStyle = this.listMenu.length - 1; + var strartMneu = res[i].children[0]; + this.$store.commit('currentPerms', strartMneu.perms); + this.changeliSelect = strartMneu.cnName; + this.$bus.$emit('currentPerms', strartMneu.perms); + } else { + this.listMenu.push(res[i]); } - this.listMenu.push(res[i]); } }, treeData(source) { diff --git a/src/router/index.js b/src/router/index.js index bf58e3d..4c68a22 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -65,7 +65,7 @@ path: '/', name: 'Home', component: Home, - redirect: '/mochaitmo', + redirect: '/Synthesis', children: [ { path: '/mochaitmo', diff --git a/src/store/index.js b/src/store/index.js index 3705119..6753c49 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -45,6 +45,7 @@ //椤圭洰绠$悊 projeOl: null, download: false, + showAllLayers: true, }, mutations: { //鑾峰彇鏉冮檺鍚堥泦 diff --git a/src/views/Archive/index.vue b/src/views/Archive/index.vue index 565591d..d7fbced 100644 --- a/src/views/Archive/index.vue +++ b/src/views/Archive/index.vue @@ -8,18 +8,18 @@ </div> <div class="top_right"> <el-form :inline="true" :model="formInline" class="demo-form-inline"> - <!-- <el-form-item> + <el-form-item> <el-input v-model="formInline.user" suffix-icon="el-icon-search" :placeholder="$t('common.pleaseInput')" ></el-input> - </el-form-item> --> - <!-- <el-form-item> + </el-form-item> + <el-form-item> <el-button icon="el-icon-search" class="primaries">{{ $t('common.iquery') }}</el-button> - </el-form-item> --> + </el-form-item> <el-form-item> <el-button @click="getSpaceMapVisibale" class="primaries">{{ $t('synthesis.rangequery') @@ -659,8 +659,6 @@ this.closeMapDown(); }) .catch((_) => {}); - - }, closeMapDown(){ this.dialogMapVisible =false; diff --git a/src/views/AuthorizationManagement/roleResAuthorization.vue b/src/views/AuthorizationManagement/roleResAuthorization.vue index 7cb2d88..25ed484 100644 --- a/src/views/AuthorizationManagement/roleResAuthorization.vue +++ b/src/views/AuthorizationManagement/roleResAuthorization.vue @@ -98,7 +98,7 @@ " > <span> - {{ $t('operatManage.UserRoleAuthorizationObj.userTable') }}</span + {{ $t('operatManage.UserRoleAuthorizationObj.ResTable') }}</span > <div class="btn" style="margin-left: auto"> <el-button diff --git a/src/views/Synthesis/LeftMenu.vue b/src/views/Synthesis/LeftMenu.vue index 96982d6..3afc38a 100644 --- a/src/views/Synthesis/LeftMenu.vue +++ b/src/views/Synthesis/LeftMenu.vue @@ -437,28 +437,45 @@ } }, handleOpenClick() { - // let that = this; + sgworld.Creator.SimpleGraphic.edit(true, { editProp: true }); let fileInput = document.querySelector('.file'); fileInput.onchange = function (evt) { let files = evt.target.files; if (files.length > 0) { let file = evt.target.files[0]; - sgworld.Creator.addKmlLayer('kml鏁版嵁', file, true); - // let fileReader = new FileReader(); - // fileReader.readAsDataURL(file); - // fileReader.onload = () => { - // sgworld.Viewer.dataSources - // .add( - // Cesium.KmlDataSource.load(fileReader.result, { - // camera: sgworld.Viewer.scene.camera, - // canvas: sgworld.Viewer.scene.canvas, - // }) - // ) - // .then((KmlDataSource) => { - // console.log(KmlDataSource); - // // let entities = kmlDataSource.entities; - // }); - // }; + let fileReader = new FileReader(); + fileReader.readAsDataURL(file); + fileReader.onload = () => { + var kmlOptions = { + camera: sgworld.Viewer.scene.camera, + canvas: sgworld.Viewer.scene.canvas, + clampToGround: true, + }; + var geocachePromise = Cesium.KmlDataSource.load( + fileReader.result, + kmlOptions + ); + geocachePromise.then(function (dataSource) { + var geocacheEntities = dataSource.entities.values; + + for (var i = 0; i < geocacheEntities.length; i++) { + var entity = geocacheEntities[i]; + + sgworld.Viewer.entities.add(entity); + } + }); + // sgworld.Viewer.dataSources + // .add( + // Cesium.KmlDataSource.load(fileReader.result, { + // camera: sgworld.Viewer.scene.camera, + // canvas: sgworld.Viewer.scene.canvas, + // }) + // ) + // .then((KmlDataSource) => { + // console.log(KmlDataSource); + // // let entities = kmlDataSource.entities; + // }); + }; } // fileInput.value = null; }; @@ -957,6 +974,11 @@ this.$bus.$on('setChangeTwoMenu', (res) => { this.menuChange(res); }); + this.$bus.$on('showLeftMenu', (res) => { + this.$store.state.showAllLayers = true; + this.setCoverage('a1'); + // this.$bus.$emit('setAllLayers', true); + }); }, }; </script> diff --git a/src/views/Synthesis/index.vue b/src/views/Synthesis/index.vue index eec6c0b..7b76008 100644 --- a/src/views/Synthesis/index.vue +++ b/src/views/Synthesis/index.vue @@ -120,7 +120,14 @@ } }, //鍒濆鍖栬彍鍗曟巿鏉� - getPermsMenu() { + async getPermsMenu() { + if (this.$store.state.currentPerms == '') { + this.$store.state.currentPerms = '/comprehensive'; + } + if (this.$store.state.permsEntity.length == 0) { + const data = await getPerms(); + this.$store.state.permsEntity = data.result; + } var val = this.$store.state.currentPerms; var permsEntity = this.$store.state.permsEntity; for (var i = 0; i < permsEntity.length; i++) { @@ -159,6 +166,8 @@ }, }, mounted() { + this.getPermsMenu(); + this.$bus.$emit('showLeftMenu', true); this.$store.state.mapMenuBoolean = false; this.$store.state.mapMenuBoxFlag = null; this.$store.state.mapPopBoolean = false; @@ -166,7 +175,7 @@ }, //鍒濆鍖栬彍鍗曟巿鏉� created() { - this.getPermsMenu(); + // this.getPermsMenu(); }, }; </script> diff --git a/src/views/Thematic/index.vue b/src/views/Thematic/index.vue index 47d3181..3415fc8 100644 --- a/src/views/Thematic/index.vue +++ b/src/views/Thematic/index.vue @@ -301,7 +301,11 @@ //瀹氫綅 sgworld.Navigate.jumpTo({ //璺宠浆瑙嗚 - destination: new Cesium.Cartesian3.fromDegrees(105.02, 34.9, 8000000), + destination: new Cesium.Cartesian3.fromDegrees( + 116.3911, + 39.9115, + 100000 + ), }); MapViewer.imageryLayers.addImageryProvider( diff --git a/src/views/Tools/LayerTree.vue b/src/views/Tools/LayerTree.vue index 0c2d1a8..66c1c7c 100644 --- a/src/views/Tools/LayerTree.vue +++ b/src/views/Tools/LayerTree.vue @@ -94,6 +94,8 @@ </template> <script> +import ImageWMS from 'ol/source/ImageWMS'; +import Image from 'ol/layer/Image'; export default { name: 'tree', data() { @@ -158,14 +160,12 @@ }, methods: { NodeBlur(Node, data) { - console.log(Node, data); if (data.label.length === 0) { this.$message.error('鑿滃崟鍚嶄笉鍙负绌猴紒'); return false; } else { if (data.isEdit) { this.$set(data, 'isEdit', false); - console.log(data.isEdit); } this.$nextTick(() => { this.$refs['slotTreeInput' + data.id].$refs.input.focus(); @@ -297,36 +297,48 @@ handleCheckChange(data, checked, indeterminate) { if (data.children != null) return; var std = []; - if (checked == true) { - 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.label) { - std.push(data.label); - } - } - if (std.length == 0) { - let layerWMS = new Cesium.WebMapServiceImageryProvider({ - url: geoServerURl, - layers: data.resource, - parameters: { - transparent: true, - format: 'image/png', - }, - }); - layerWMS.name = data.label; - window.Viewer.imageryLayers.addImageryProvider(layerWMS); - } - } else { - 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.label) { - const img_layer = window.Viewer.imageryLayers._layers[i]; - window.Viewer.imageryLayers.remove(img_layer); - } + var layers_ol = window.map.getAllLayers(); + 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.label) { + const img_layer = window.Viewer.imageryLayers._layers[i]; + img_layer.show = checked; } } + for (var i in layers_ol) { + var layerOl = layers_ol[i]; + if (layerOl.values_.name == data.label) { + layerOl.setVisible(checked); //鏄剧ず鍥惧眰 + } + } + }, + setAddLayers(res) { + let layerWMS = new Cesium.WebMapServiceImageryProvider({ + url: geoServerURl, + layers: res.resource, + parameters: { + transparent: true, + format: 'image/png', + }, + }); + layerWMS.name = res.label; + window.Viewer.imageryLayers.addImageryProvider(layerWMS); + + var layer2 = new Image({ + name: res.label, + source: new ImageWMS({ + crossOrigin: 'anonymous', + url: geoServerURl, + + params: { + FORMAT: 'image/png', + VERSION: '1.1.1', + LAYERS: res.resource, + }, + }), + }); + window.map.addLayer(layer2); }, }, watch: { @@ -337,14 +349,26 @@ mounted() { var std = []; var val = this.treeData[0].children; - for (var i = 0; i < window.Viewer.imageryLayers._layers.length; i++) { - var val_id = window.Viewer.imageryLayers._layers[i].imageryProvider.name; + if (this.$store.state.showAllLayers == true) { for (var j = 0; j < val.length; j++) { - if (val_id == val[j].label) { - std.push(val[j].id); + std.push(val[j].id); + this.setAddLayers(val[j]); + } + + this.$store.state.showAllLayers = false; + } else { + for (var i = 0; i < window.Viewer.imageryLayers._layers.length; i++) { + var val_id = window.Viewer.imageryLayers._layers[i]; + if (val_id.show == true) { + for (var j = 0; j < val.length; j++) { + if (val_id.imageryProvider.name == val[j].label) { + std.push(val[j].id); + } + } } } } + this.$refs.tree.setCheckedKeys(std); }, }; diff --git a/src/views/datamanage/dataLoader.vue b/src/views/datamanage/dataLoader.vue index d07e9a6..8538644 100644 --- a/src/views/datamanage/dataLoader.vue +++ b/src/views/datamanage/dataLoader.vue @@ -41,20 +41,32 @@ </el-option> </el-select> </el-form-item> - <el-form-item :label="$t('dataManage.dataUpObj.entryTime')"> - <el-date-picker - v-model.trim="formInline.gather" - :picker-options="pickerOptions" - type="datetime" - placeholder="璇烽�夋嫨" - value-format="yyyy-MM-dd HH:mm:ss" - /> - </el-form-item> + <el-form-item> <input id="uploadfile" @change= "handleFileChange" type="file" name="file" multiple="multiple" accept=".xls,.xlsx,.mdb,.shp.zip,.gdb.zip" style="display: none"></input> - <el-button icon="el-icon-document-add" @click="fileSelect" class="primary">{{ + <!-- <el-button icon="el-icon-document-add" @click="fileSelect" class="primary">{{ $t('common.file') - }}</el-button> + }}</el-button> --> + + <el-input v-model="formInline.fileName" disabled> + <template slot="append"> + <el-button v-if="formInline.fileName == '鏈�夋嫨鏂囦欢'" + type="info" + @click="fileSelect"> + 閫夋嫨鏂囦欢 + </el-button> + <el-button + v-else + type="info" + @click="clearFileSelect" + > + 閲嶇疆 + </el-button> + </template> + </el-input> + + + </el-form-item> <br /> <el-form-item :label="$t('dataManage.dataUpObj.describe')"> @@ -155,6 +167,7 @@ > <el-table-column type="selection" + width="55"> </el-table-column> <el-table-column @@ -162,50 +175,50 @@ type="index" :label="$t('common.index')" width="70px" - fixed + /> <el-table-column align="center" prop="name" :label="$t('common.name')" - fixed + /> <el-table-column align="center" prop="dirName" :label="$t('dataManage.dataUpObj.catalogue')" - fixed + /> <el-table-column align="center" prop="depName" :label="$t('dataManage.dataUpObj.company')" - fixed + /> <el-table-column align="center" prop="verName" :label="$t('dataManage.dataUpObj.versionNo')" - fixed + /> <el-table-column align="center" prop="type" :label="$t('common.type')" - fixed + /> <el-table-column align="center" prop="sizes" :label="$t('common.size')" - fixed + :formatter="changeSizeFile" /> <el-table-column align="center" :label="$t('dataManage.dataUpObj.tableName')" - fixed + > <template slot-scope="scope"> <a @click="detail(scope.row)" >{{ @@ -236,8 +249,7 @@ align="center" prop="createTime" :label="$t('dataManage.vmobj.createontime')" - - :formatter="changetimeFile" + :formatter="changetimeFile" /> </el-table> @@ -264,7 +276,7 @@ <el-dialog :title="$t('dataManage.datawarehousing')" :visible.sync="dialogWarehousing" - width="50%" + width="70%" :before-close="handleWareClose" > <div class="dialogBox"> @@ -280,7 +292,7 @@ </div> <div class="transFarBox"> <ul> - <li @click="singleElection2(item)" v-for="(item, i) in tableWareTwo" :class="{ active: activeName2 == item.entity }">{{item.tabDesc}} ( {{item.tab}})</li> + <li @click="singleElection2(item)" v-for="(item, i) in tableWareTwo" :class="{ active: activeName2 == item.entity }">{{item.tabDesc}} ( {{item.ns}}.{{item.tab}})</li> </ul> </div> <div class="tarnsbtton"> @@ -289,7 +301,7 @@ </div> <div class="transFarBox"> <ul> - <li @click="singleElection3(i)" v-for="(item, i) in tableWareThree" :class="{ active: activeName3 ==( item.tab+i)}">{{item.tab}} ( {{item.tabDesc}}:{{item.entity}} )</li> + <li @click="singleElection3(i)" v-for="(item, i) in tableWareThree" :class="{ active: activeName3 ==( item.tab+i)}">{{item.tab}} ( {{item.tabDesc}} {{item.ns}}.{{item.tabs}} )</li> </ul> </div> </div> @@ -357,9 +369,9 @@ dataLoader_selectMappers, dataLoader_SelectTabs, dataLoader_selectByPageForUpload, -dataLoader_deleteMetas, -dataLoader_selectFields, -dataLoader_selectDbData + dataLoader_deleteMetas, + dataLoader_selectFields, + dataLoader_selectDbData } from '../../api/api'; export default { name: 'dataUpdata', @@ -368,11 +380,13 @@ }, data() { return { - formWarehousing: { - name:'' + + formWarehousing: { + name: '', + }, -waretableData:[], - activeTabName:'first', + waretableData: [], + activeTabName: 'first', wareStatus: false, dialogWarehousing: false, btnStatus: 0, @@ -380,6 +394,7 @@ formInline: { verid: '', gather: '', + fileName:'鏈�夋嫨鏂囦欢' }, tableWareOne: [], tableWareTwo: [], @@ -393,7 +408,7 @@ listData: { pageIndex: 1, pageSize: 10, - name:'' + name: '' }, pickerOptions: { disabledDate(time) { @@ -416,16 +431,16 @@ activeName2: '', activeName3: '', wareTableFlag: null, - multipleDelete:[], - dialogVisible:false, - attributeData:[], - listLoader:{ - id:null, - pageSize:1, - pageSize:10, + multipleDelete: [], + dialogVisible: false, + attributeData: [], + listLoader: { + id: null, + pageSize: 1, + pageSize: 10, }, - count1:0, - dbTableData:[], + count1: 0, + dbTableData: [], }; }, @@ -468,51 +483,68 @@ }, methods: { - async detail(res){ + async detail(res) { var val = res.tab.split("."); const data = await dataLoader_selectFields({ - ns:val[0], - tab:val[1] + ns: val[0], + tab: val[1] }) - if(data.code != 200){ - this.$message.error('瀛楁鍒楄〃璋冪敤澶辫触'); + if (data.code != 200) { + this.$message.error('瀛楁鍒楄〃璋冪敤澶辫触'); return } + var val_data= data.result; + for(var i in val_data){ + if(val_data[i].alias.indexOf('ID') != -1){ + val_data[i].alias = val_data[i].alias.replace('ID','') + } + } this.dialogVisible = true; - this.attributeData =data.result; - this.listLoader={ - id:res.id, - pageIndex:1, - pageSize:10, + this.attributeData = val_data; + + this.listLoader = { + id: res.id, + pageIndex: 1, + pageSize: 10, } this.getDataLoaderSelectDbData(); }, - async getDataLoaderSelectDbData (){ - const data1 = await dataLoader_selectDbData(this.listLoader); - if(data1.code != 200){ - this.$message.error('瀛楁鍒楄〃璋冪敤澶辫触'); + async getDataLoaderSelectDbData() { + const data1 = await dataLoader_selectDbData(this.listLoader); + if (data1.code != 200) { + this.$message.error('瀛楁鍒楄〃璋冪敤澶辫触'); return } - this.dbTableData =data1.result; - this.count1 = data1.count; + var val = data1.result; + for(var i in val){ + val[i].createuser = val[i].createName; + val[i].depid= val[i].depName; + val[i].dirid= val[i].dirName; + val[i].verid= val[i].verName; + val[i].updateuser= val[i].updateName; + if(val[i].createtime != null){ + val[i].createtime= this.changetimeLayer(val[i].createtime ) + } + if(val[i].updatetime != null){ + val[i].updatetime= this.changetimeLayer(val[i].updatetime ) + } + } + this.dbTableData = data1.result; + this.count1 = data1.count; }, - handleLoaderSizeChange(val){ - this.listLoader.pageIndex= 1; - this.listLoader.pageSize =val; - this.getDataLoaderSelectDbData(); + handleLoaderSizeChange(val) { + this.listLoader.pageIndex = 1; + this.listLoader.pageSize = val; + this.getDataLoaderSelectDbData(); }, -handleLoaderCurrentChange(val){ - this.listLoader.pageIndex= val; - this.getDataLoaderSelectDbData(); -}, + handleLoaderCurrentChange(val) { + this.listLoader.pageIndex = val; + this.getDataLoaderSelectDbData(); + }, - - - changetimeFile(res){ - -//shijianchuo鏄暣鏁帮紝鍚﹀垯瑕乸arseInt杞崲 - var time = new Date(res.createTime); - var y = time.getFullYear(); +changetimeLayer(res){ + var time = new Date(res ); + var y = time.getFullYear(); var m = time.getMonth() + 1; var d = time.getDate(); var h = time.getHours(); @@ -531,75 +563,79 @@ ':' + s ); +}, + + changetimeFile(res) { + return this.changetimeLayer(res.createTime) }, - //鏍煎紡鍖栨椂闂� + //鏍煎紡鍖栨椂闂� add0(m) { return m < 10 ? '0' + m : m; }, - setWarehouseSearch(){ + setWarehouseSearch() { - this.listData={ - pageIndex:1, - pageSize:10, - name:this.formWarehousing.name, - } - this.getAllWareTable(); + this.listData = { + pageIndex: 1, + pageSize: 10, + name: this.formWarehousing.name, + } + this.getAllWareTable(); }, - async setWarehouseDel(){ -var std = []; - for (var i in this.multipleDelete) { - std.push(this.multipleDelete[i].id); - } - const res = await dataLoader_deleteMetas({ids: std.toString() }) - if(res.code != 200){ - this.$message.error('鍒犻櫎澶辫触'); - }else{ - this.$message({ + async setWarehouseDel() { + var std = []; + for (var i in this.multipleDelete) { + std.push(this.multipleDelete[i].id); + } + const res = await dataLoader_deleteMetas({ ids: std.toString() }) + if (res.code != 200) { + this.$message.error('鍒犻櫎澶辫触'); + } else { + this.$message({ message: '鍒犻櫎鎴愬姛', type: 'success' }); - this.listData.pageIndex=1; + this.listData.pageIndex = 1; this.listData.pageSize = 10; - this.getAllWareTable(); - } + this.getAllWareTable(); + } }, - handleDelteChange(val){ - this.multipleDelete = val; + handleDelteChange(val) { + this.multipleDelete = val; }, - setWarehouseReset(){ - this.formWarehousing.name=''; - this.listData={ - pageIndex:1, - pageSize:10, - name:null, - } - this.getAllWareTable(); + setWarehouseReset() { + this.formWarehousing.name = ''; + this.listData = { + pageIndex: 1, + pageSize: 10, + name: null, + } + this.getAllWareTable(); }, handleTabClick(tab, event) { - if(this.activeTabName =='second'){ - this.setWarehouseReset(); - } + if (this.activeTabName == 'second') { + this.setWarehouseReset(); + } }, - handleSizeChange(val){ - this.listData.pageIndex= 1; - this.listData.pageSize =val; - this.getAllWareTable(); + handleSizeChange(val) { + this.listData.pageIndex = 1; + this.listData.pageSize = val; + this.getAllWareTable(); }, -handleCurrentChange(val){ - this.listData.pageIndex= val; - this.getAllWareTable(); -}, + handleCurrentChange(val) { + this.listData.pageIndex = val; + this.getAllWareTable(); + }, //鑾峰彇鍏ュ簱鏁版嵁鍒楄〃 - async getAllWareTable(){ + async getAllWareTable() { const res = await dataLoader_selectByPageForUpload(this.listData); - if (res.code != 200) { + if (res.code != 200) { this.$message.error('鍒楄〃鏁版嵁鑾峰彇澶辫触'); return; } this.count = res.count; - this.waretableData =res.result; + this.waretableData = res.result; }, //澶у皬鍊兼敼璁� changeSizeFile(row, column, cellValue, index) { @@ -610,24 +646,24 @@ return cellValue + "MB" } }, - setInsrtWareTableClose(){ - this.dialogWarehousing = false; - this.setClearAttartch(); + setInsrtWareTableClose() { + this.dialogWarehousing = false; + this.setClearAttartch(); }, - async setInsrtWareTable(){ + async setInsrtWareTable() { var obj = { - metaEntity: this.formInline, - fileEntities: this.tableData, - tabEntities: this.tableWareThree - }; - const res = await dataLoader_InsertFiles(JSON.stringify(obj)); + metaEntity: this.formInline, + fileEntities: this.tableData, + tabEntities: this.tableWareThree + }; + const res = await dataLoader_InsertFiles(JSON.stringify(obj)); - if (res.code != 200) { + if (res.code != 200) { this.$message.error('鏁版嵁鍏ュ簱澶辫触'); return; - }else{ + } else { - this.$message({ + this.$message({ message: '鏁版嵁鍏ュ簱鎴愬姛', type: 'success' }); @@ -637,13 +673,13 @@ } }, - setClearAttartch(){ - this.activeName = ''; + setClearAttartch() { + this.activeName = ''; this.activeName2 = ''; this.activeName3 = ''; - this.tableWareThree =[]; - this.tableWareTwo=[]; - this.tableWareOne=[]; + this.tableWareThree = []; + this.tableWareTwo = []; + this.tableWareOne = []; }, autoMatchWare() { var val1 = this.tableWareOne; @@ -656,24 +692,27 @@ if (val2[j].tab == stdTab) { std.push(val1[i].tab) val1[i].entity = val2[j].entity; - val1[i].tabDesc= val2[j].tabDesc; + val1[i].tabDesc = val2[j].tabDesc; + val1[i].tabs=val2[j].tab; + val1[i].ns=val2[j].ns; + this.tableWareThree.push(val1[i]); } } } - std.forEach(item => { - this.tableWareOne = this.tableWareOne.filter(items => items.tab!== item); - }); + std.forEach(item => { + this.tableWareOne = this.tableWareOne.filter(items => items.tab !== item); + }); }, setSplitWare(res) { if (res.indexOf(".shp") != -1) { return res.split(".shp").join(""); - }else if (res.indexOf(".mdb") != -1){ - return res.split(".mdb").join(""); - }else if (res.indexOf(".gdb") != -1){ - return res.split(".gdb").join(""); - }else{ + } else if (res.indexOf(".mdb") != -1) { + return res.split(".mdb").join(""); + } else if (res.indexOf(".gdb") != -1) { + return res.split(".gdb").join(""); + } else { return res; } }, @@ -689,35 +728,35 @@ var res = this.wareTableFlag; var value1 = this.tableWareThree[res]; value1.entity = null; - value1.tabDesc= null; - if(this.tableWareOne.indexOf(value1)!=-1 ){ + value1.tabDesc = null; + if (this.tableWareOne.indexOf(value1) != -1) { - }else{ - this.tableWareOne.push(value1); - this.tableWareThree.splice(res, 1) - this.activeName = ''; - this.activeName2 = ''; - this.activeName3 = ''; - } + } else { + this.tableWareOne.push(value1); + this.tableWareThree.splice(res, 1) + this.activeName = ''; + this.activeName2 = ''; + this.activeName3 = ''; + } }, setWareTableChangeRight() { this.wareSelectOne.entity = this.wareSelectTwo.entity; - this.wareSelectOne.tabDesc = this.wareSelectTwo.tabDesc; - if(this.tableWareThree.indexOf(this.wareSelectOne) != -1){ + this.wareSelectOne.tabDesc = this.wareSelectTwo.tabDesc; + if (this.tableWareThree.indexOf(this.wareSelectOne) != -1) { - }else{ - this.tableWareThree.push(this.wareSelectOne) - this.tableWareOne.forEach((value, index, array) => { - if (value.tab == this.wareSelectOne.tab) { - this.tableWareOne.splice(index, 1) - } - }) - this.activeName = ''; - this.activeName2 = ''; - this.activeName3 = ''; - } + } else { + this.tableWareThree.push(this.wareSelectOne) + this.tableWareOne.forEach((value, index, array) => { + if (value.tab == this.wareSelectOne.tab) { + this.tableWareOne.splice(index, 1) + } + }) + this.activeName = ''; + this.activeName2 = ''; + this.activeName3 = ''; + } }, singleElection(row) { this.wareSelectOne = row; @@ -763,11 +802,11 @@ const res = await dataUploadDeleteFiles(data); if (res.code != 200) { this.$message.error('鍒犻櫎澶辫触'); - this.handlerLoading(false); + this.handlerLoading(false); return; } this.getFileLength(); - this.handlerLoading(false); + this.handlerLoading(false); @@ -836,14 +875,15 @@ this.getFileLength(); - this.$message({ - message: '鏁版嵁涓婁紶鎴愬姛', - type: 'success' - }); - + this.$message({ + message: '鏁版嵁涓婁紶鎴愬姛', + type: 'success' + }); + this.clearFileSelect(); }, error: (rs) => { this.$message.error('鏁版嵁涓婁紶澶辫触'); + this.clearFileSelect(); } }); @@ -895,9 +935,16 @@ fileSelect() { $("#uploadfile").click(); }, - handleFileChange() { - var fs = document.getElementById("uploadfile"); + handleFileChange(event) { + // var fs = document.getElementById("uploadfile"); + var f = event.currentTarget.files[0] + this.formInline.fileName = f.name; + + }, + clearFileSelect(){ + this.formInline.fileName="鏈�夋嫨鏂囦欢"; + document.getElementById("uploadfile").value = ""; }, //褰撳墠鏃堕棿鑾峰彇 timeDefault() { @@ -957,7 +1004,7 @@ async getselectVerByDirid() { this.verOption = []; this.formInline.verid = ""; - const res = await dataLoader_selectVerByDirid({dirid:this.formInline.dirid}); + const res = await dataLoader_selectVerByDirid({ dirid: this.formInline.dirid }); if (res.code != 200) { this.$message.error('鐗堟湰鍒楄〃鑾峰彇澶辫触'); @@ -1077,7 +1124,6 @@ background-color: #216fe6; } } - } .primary { background: #409eff; @@ -1231,47 +1277,47 @@ background-color: #216fe6; } } - /deep/.el-tabs__active-bar { + /deep/.el-tabs__active-bar { background: #409eff; } - /deep/ .el-tabs__item { + /deep/ .el-tabs__item { color: #409eff; } - .pagination_box { - margin-top: 20px; - /deep/.el-input__inner { - background-color: transparent !important; - border: 1px solid; - color: white; - } - /deep/.el-pagination__total { - color: white; - } - /deep/.el-pagination__jump { - color: white; - } - /deep/.el-pager li.active { - color: #409eff; - } - /deep/.el-pager li { - color: white; - background: transparent; - } - /deep/.el-pager li { - color: white; - } - /deep/.btn-prev { - background: transparent; - } - /deep/.btn-next { - background: transparent; - } - /deep/.btn-next i { - color: white; - } - /deep/.btn-prev i { - color: white; - } - } + .pagination_box { + margin-top: 20px; + /deep/.el-input__inner { + background-color: transparent !important; + border: 1px solid; + color: white; + } + /deep/.el-pagination__total { + color: white; + } + /deep/.el-pagination__jump { + color: white; + } + /deep/.el-pager li.active { + color: #409eff; + } + /deep/.el-pager li { + color: white; + background: transparent; + } + /deep/.el-pager li { + color: white; + } + /deep/.btn-prev { + background: transparent; + } + /deep/.btn-next { + background: transparent; + } + /deep/.btn-next i { + color: white; + } + /deep/.btn-prev i { + color: white; + } + } } </style> diff --git a/src/views/datamanage/dataUpdata.vue b/src/views/datamanage/dataUpdata.vue index 7271333..475cc54 100644 --- a/src/views/datamanage/dataUpdata.vue +++ b/src/views/datamanage/dataUpdata.vue @@ -40,7 +40,7 @@ </el-option> </el-select> </el-form-item> - <el-form-item :label="$t('dataManage.dataUpObj.entryTime')"> + <!-- <el-form-item :label="$t('dataManage.dataUpObj.entryTime')"> <el-date-picker v-model.trim="formInline.gather" :picker-options="pickerOptions" @@ -48,12 +48,30 @@ placeholder="璇烽�夋嫨" value-format="yyyy-MM-dd HH:mm:ss" /> - </el-form-item> + </el-form-item> --> <el-form-item> <input id="uploadfile" @change= "handleFileChange" type="file" name="file" multiple="multiple" style="display: none"></input> - <el-button icon="el-icon-document-add" @click="fileSelect" class="primary">{{ + <!-- <el-button icon="el-icon-document-add" @click="fileSelect" class="primary">{{ $t('common.file') - }}</el-button> + }}</el-button> --> + + <el-input v-model="formInline.fileName" disabled> + <template slot="append"> + <el-button v-if="formInline.fileName == '鏈�夋嫨鏂囦欢'" + type="info" + @click="fileSelect"> + 閫夋嫨鏂囦欢 + </el-button> + <el-button + v-else + type="info" + @click="clearFileSelect" + > + 閲嶇疆 + </el-button> + </template> + </el-input> + </el-form-item> <br /> <el-form-item :label="$t('dataManage.dataUpObj.describe')"> @@ -126,12 +144,12 @@ fixed :formatter="changeSizeFile" /> - <el-table-column + <!-- <el-table-column align="center" prop="guid" :label="$t('common.md5')" fixed - /> + /> --> </el-table> </div> @@ -288,6 +306,7 @@ formInline: { verid: '', gather: '', + fileName:'鏈�夋嫨鏂囦欢' }, formWarehousing: { name:'' @@ -542,13 +561,14 @@ message: '涓婁紶鎴愬姛', type: 'success' }); - +this.clearFileSelect(); }, error: (rs) => { alert("涓婁紶鏂囦欢澶辫触锛�"); + this.clearFileSelect(); } }); - document.getElementById("uploadfile").value = ""; + this.handlerLoading(false); }, //鑾峰彇鏂囦欢涓婁紶鏁版嵁 @@ -590,10 +610,15 @@ fileSelect() { $("#uploadfile").click(); }, - handleFileChange() { - var fs = document.getElementById("uploadfile"); + handleFileChange(event) { + var f = event.currentTarget.files[0] + this.formInline.fileName = f.name; }, + clearFileSelect(){ + this.formInline.fileName="鏈�夋嫨鏂囦欢"; + document.getElementById("uploadfile").value = ""; + }, //褰撳墠鏃堕棿鑾峰彇 timeDefault() { var date = new Date(); diff --git a/src/views/datamanage/projectManage.vue b/src/views/datamanage/projectManage.vue index 3a72c25..e3c0176 100644 --- a/src/views/datamanage/projectManage.vue +++ b/src/views/datamanage/projectManage.vue @@ -57,7 +57,7 @@ :label="$t('dataManage.projectObj.projtype')" /> <el-table-column - prop="location" + prop="geom" :label="$t('dataManage.projectObj.location')" /> <el-table-column @@ -114,7 +114,7 @@ </el-table-column> </el-table> <div style="margin-top: 10px" class="pagination_box"> - <el-pagination + <!-- <el-pagination @size-change="handleLoaderSizeChange" @current-change="handleLoaderCurrentChange" :current-page="listLoader.pageIndex" @@ -123,7 +123,7 @@ layout="total, sizes, prev, pager, next, jumper" :total="count1" > - </el-pagination> + </el-pagination> --> </div> <!-- <el-form class="projFrom" @@ -235,7 +235,7 @@ <el-input v-model="editFrom.projtype"></el-input> </el-form-item> <el-form-item :label="$t('dataManage.projectObj.location')"> - <el-input :disabled="true" v-model="editFrom.location"></el-input> + <el-input :disabled="true" v-model="editFrom.geom"></el-input> <el-link @click="ShowInner" style="color: white; margin-left: 20px" @@ -307,7 +307,7 @@ showMap: false, count: null, projectFrom: {}, - editFrom: { location: ' ' }, + editFrom: { geom: ' ' }, dirId: null, elProject: [], dirList: [], //el鏍戞暟鎹� @@ -362,7 +362,8 @@ innerClose() { this.showMap = false; this.innerVisible = false; - this.editFrom.location = this.$store.state.projeOl; + debugger; + this.editFrom.geom = this.$store.state.projeOl; }, async insertEditFrom() { if (this.behavior == '鏂板椤圭洰') { @@ -386,13 +387,12 @@ this.setRestEditFrom(); }, setRestEditFrom() { - this.editFrom = { location: ' ' }; + this.editFrom = { geom: ' ' }; this.$store.state.projeOl = null; }, //鍒犻櫎椤圭洰 async deleteProject(row) { - debugger; const data = await project_delete({ gid: row.gid }); if (data.code != 200) { this.$message.error('椤圭洰鍒犻櫎澶辫触'); @@ -405,7 +405,7 @@ this.behavior = '淇敼椤圭洰'; this.outerVisible = true; this.editFrom = row; - this.$store.state.projeOl = row.location; + this.$store.state.projeOl = row.geom; }, //鏂板椤圭洰 insertProject() { diff --git a/src/views/exportMap/index.vue b/src/views/exportMap/index.vue index 4f60428..111f88b 100644 --- a/src/views/exportMap/index.vue +++ b/src/views/exportMap/index.vue @@ -275,24 +275,32 @@ label: '鍥惧眰', children: [ { - id: '11', + id: 11, + label: '椤圭洰', + value: '椤圭洰', + layer: 'LF:bs_project', + isEdit: false, + }, + { + id: 12, label: '绔欏満', value: '绔欏満', layer: 'LF:m_sitepoint', - box: [ - 84.21228790283203, 30.412200927734375, 121.11393737792969, - 41.46569061279297, - ], + isEdit: false, }, { - id: '12', + id: 13, label: '绠¢亾涓績绾�', value: '绠¢亾涓績绾�', layer: 'LF:m_pipeline', - box: [ - 25.245140075683594, 11.197434425354004, 121.11258697509766, - 49.65690231323242, - ], + isEdit: false, + }, + { + id: 14, + label: '鎴樼暐閫氶亾', + value: '鎴樼暐閫氶亾', + layer: 'LF:th_strategic_channel', + isEdit: false, }, ], }, @@ -322,7 +330,7 @@ showMapLayer() { var val = this.data[0].children; var std = []; - for (var i = val.length - 1; i >= 0; i--) { + for (var i = 0; i < val.length; i++) { var layer2 = new Image({ name: val[i].label, source: new ImageWMS({ @@ -505,8 +513,8 @@ val_data.push('鐭㈤噺鍥�'); val_data.push('鐭㈤噺娉ㄨ'); } else { - val_data.push('楂樺痉褰卞儚'); - val_data.push('楂樺痉褰卞儚娉ㄨ'); + val_data.push('褰卞儚'); + val_data.push('褰卞儚娉ㄨ'); } this.setExportMapLayer(val_data); this.showMapApply = false; -- Gitblit v1.9.3