From 8e44ce5a0c75861e5fdca999e3dc5b6f61faa585 Mon Sep 17 00:00:00 2001 From: TreeWish <1131093754@qq.com> Date: 星期四, 16 二月 2023 09:42:06 +0800 Subject: [PATCH] Merge branch 'master' of http://103.85.165.99:8989/r/LFWEB_NEW --- src/views/datamanage/SpatialData.vue | 457 ++++++++++++++++++++++++++++++--------------------------- 1 files changed, 240 insertions(+), 217 deletions(-) diff --git a/src/views/datamanage/SpatialData.vue b/src/views/datamanage/SpatialData.vue index 60ce304..72f2f10 100644 --- a/src/views/datamanage/SpatialData.vue +++ b/src/views/datamanage/SpatialData.vue @@ -7,7 +7,7 @@ <el-divider /> <div class="spatialContent "> <div class="spatial_leftTree subpage_Div"> - <el-input v-model="filterText"></el-input> + <el-input v-model="filterText" style="width: 200px;"></el-input> <div style="width:300px"> <el-tree @@ -22,51 +22,27 @@ ></el-tree> </div> </div> - <div class="spatial_rightContent subpage_Div"> - <el-form + <div class="contentshuju"> + <div class="contentshujutou"> + <el-form ref="ruleForm" :model="ruleForm" :inline="true" > <el-form-item> + <!-- type="textarea" --> <el-input - type="textarea" v-model="ruleForm.fileName" class="nm-skin-pretty" show-word-limit :rows="2" resize='none' disabled - style="width: 545px;" + style="width: 200px;" ></el-input> </el-form-item> - <el-form-item> - <el-button - v-if="btnStatus.insert" - @click="conditionVisible = true" - size="small" - icon="el-icon-plus" - type="success" - >{{$t('common.append')}}</el-button> - </el-form-item> - <el-form-item> - <el-button - @click="submitForm" - type="primary" - size="small" - icon="el-icon-search" - >{{$t('common.iquery')}}</el-button> - </el-form-item> - <el-form-item> - <el-button - @click="resetForm" - size="small" - icon="el-icon-refresh" - type="info" - >{{$t('common.reset')}}</el-button> - </el-form-item> - <el-form-item> + <el-form-item style="float: right"> <el-button @click="getSpaceMapVisibale" size="small" @@ -75,17 +51,33 @@ $t('synthesis.rangequery') }}</el-button> </el-form-item> + <el-form-item style="float: right"> + <el-button + @click="submitForm" + type="primary" + size="small" + icon="el-icon-search" + >{{$t('common.iquery')}}</el-button> + </el-form-item> + <el-form-item style="float: right"> + <el-button + v-if="btnStatus.insert" + @click="conditionVisible = true" + size="small" + icon="el-icon-plus" + type="success" + >{{$t('common.append')}}</el-button> + </el-form-item> </el-form> - <el-divider class="eldivider" /> - <div> + </div> + <div class="contenttable"> <el-table ref="filterTable" :data="tableData" - border - style="width: 100% " - @selection-change="handleSelectionChange" + style="width: 100%" + height="100%" > - <el-table-column + <el-table-column type="selection" width="55" /> @@ -121,16 +113,15 @@ </el-table-column> </el-table> <div - style="margin-top: 20px" + style="margin-top: 20px; " class="pagination_box" > <el-pagination - v-if="changePag" @size-change="handleSizeChange" @current-change="handleCurrentChange" - :current-page="this.listData.pageIndex" + :current-page="listData.pageIndex" :page-sizes="[10, 20, 50, 100]" - :page-size="this.listData.pageSize" + :page-size="listData.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="count" > @@ -138,6 +129,7 @@ </div> </div> </div> + </div> <div class="infoBox box_div" @@ -357,9 +349,9 @@ </template> <script> -import MapSdk from '../../components/mapsdk.vue' -import $ from 'jquery'; -import { conditions } from '../Archive/Archive.js' +import MapSdk from "../../components/mapsdk.vue"; +import $ from "jquery"; +import { conditions } from "../Archive/Archive.js"; import { dataQuery_selectTabs, dataQuery_selectDomains, @@ -368,51 +360,61 @@ dataQuery_uploadFiles, dataQuery_selectFiles, dataQuery_deletes, -} from '../../api/api'; +} from "../../api/api"; import { getToken } from "../../utils/auth.js"; -import catalogueTree from '../../components/catalogueTree.vue'; -import MyBread from '../../components/MyBread.vue'; +import catalogueTree from "../../components/catalogueTree.vue"; +import MyBread from "../../components/MyBread.vue"; export default { //import寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢� - name: 'dataSearch', + name: "dataSearch", components: { MyBread, catalogueTree, MapSdk }, data() { return { - attachtable: ['b_pac_geologic_hazard', 'b_hydrogeology', 'b_pac_meteorological', 'b_pac_marine_meteorological', 'b_pac_frozensoil', 's_borehole', 'm_marker', 'm_hydraulic_protection', 'm_equipment_nameplate'], + attachtable: [ + "b_pac_geologic_hazard", + "b_hydrogeology", + "b_pac_meteorological", + "b_pac_marine_meteorological", + "b_pac_frozensoil", + "s_borehole", + "m_marker", + "m_hydraulic_protection", + "m_equipment_nameplate", + ], formInline: { - file: '', + file: "", }, formSql: { - field: '', - condition: '', - value: '', - type: '', - date: '', - + field: "", + condition: "", + value: "", + type: "", + date: "", }, fromSqlflag: false, tree: [ { - tabDesc: '鍩虹鏁版嵁', - label: '鍩虹鏁版嵁', - value: 'BD', - ns: 'bd', + tabDesc: "鍩虹鏁版嵁", + label: "鍩虹鏁版嵁", + value: "BD", + ns: "bd", id: 1, children: [], }, { id: 2, - tabDesc: '涓氬姟鏁版嵁', - label: '涓氬姟鏁版嵁', - value: 'BS', - ns: 'bs', + tabDesc: "涓氬姟鏁版嵁", + label: "涓氬姟鏁版嵁", + value: "BS", + ns: "bs", children: [], - }, { + }, + { id: 3, - tabDesc: '鍏冩暟鎹�', - label: '鍏冩暟鎹�', - value: 'MD', - ns: 'md', + tabDesc: "鍏冩暟鎹�", + label: "鍏冩暟鎹�", + value: "MD", + ns: "md", children: [], }, ], @@ -421,8 +423,8 @@ condOption: [], defaultProps: { - children: 'children', - label: 'label', + children: "children", + label: "label", }, btnStatus: { select: false, @@ -434,22 +436,22 @@ }, tableType: null, ruleForm: { - fileName: '' + fileName: "", }, FBtest: false, tableData: [], - formLabelWidth: '120px', + formLabelWidth: "120px", dialogFormVisible: false, upform: { - gid: '', - pipename: '', - sitename: '', - type: '', - seriesname: '', - stationvalue: '', - transportm: '', - diameter: '', - name: '', + gid: "", + pipename: "", + sitename: "", + type: "", + seriesname: "", + stationvalue: "", + transportm: "", + diameter: "", + name: "", }, changePag: true, @@ -458,7 +460,7 @@ attributeData: [], currentPage: 1, - searchName: '', + searchName: "", multipleSelection: [], filedsLayer: null, count: 0, @@ -478,8 +480,7 @@ tabName: null, eventid: null, }, - filterText: '' - + filterText: "", }; }, created() { @@ -491,7 +492,7 @@ watch: { filterText(val) { this.$refs.tree.filter(val); - } + }, }, methods: { @@ -503,18 +504,17 @@ this.dialogMapVisible = true; this.showMapVisible = true; this.$store.state.mapMenuBoolean = true; - this.$store.state.mapMenuBoxFlag = '1'; + this.$store.state.mapMenuBoxFlag = "1"; this.$store.state.mapPopBoolean = false; this.$store.state.mapPopBoxFlag = null; this.$store.state.download = true; - }, handleMapClose() { - this.$confirm('纭鍏抽棴锛�') + this.$confirm("纭鍏抽棴锛�") .then((_) => { this.closeMapDown(); }) - .catch((_) => { }); + .catch((_) => {}); }, closeMapDown() { this.dialogMapVisible = false; @@ -532,7 +532,7 @@ } const res = await dataQuery_deletes({ ids: std.toString() }); if (res.code != 200) { - this.$message.error('鏂囦欢鍒犻櫎澶辫触'); + this.$message.error("鏂囦欢鍒犻櫎澶辫触"); } this.getAttacthFlieList(); }, @@ -540,69 +540,75 @@ var token = getToken(); var fs = document.getElementById("insertFile"); if (fs.files.length == 0) { - this.$message({ - message: '璇烽�夋嫨瑕佷笂浼犵殑鏂囦欢锛�', - type: 'warning' + message: "璇烽�夋嫨瑕佷笂浼犵殑鏂囦欢锛�", + type: "warning", }); return; } - const formData = new FormData() + const formData = new FormData(); for (var i = 0, c = fs.files.length; i < c; i++) { - - formData.append('file', fs.files[i]); // fs.files[i].name,file + formData.append("file", fs.files[i]); // fs.files[i].name,file } - $.ajax(BASE_URL + "/dataQuery/uploadFiles?token=" + token + "&tabName= " + this.upAttach.tabName + "&eventid=" + this.upAttach.eventid, { - type: "post", - data: formData, - async: true, - cache: false, - processData: false, - contentType: false, - success: (rs) => { - this.$message({ - message: '闄勪欢娣诲姞鎴愬姛', - type: 'success' - }); - document.getElementById("insertFile").value = ""; - this.formInline = { - file: '', - } - this.getAttacthFlieList(); - }, - error: (e) => { - document.getElementById("insertFile").value = ""; - this.$message.error('闄勪欢娣诲姞澶辫触'); + $.ajax( + BASE_URL + + "/dataQuery/uploadFiles?token=" + + token + + "&tabName= " + + this.upAttach.tabName + + "&eventid=" + + this.upAttach.eventid, + { + type: "post", + data: formData, + async: true, + cache: false, + processData: false, + contentType: false, + success: (rs) => { + this.$message({ + message: "闄勪欢娣诲姞鎴愬姛", + type: "success", + }); + document.getElementById("insertFile").value = ""; + this.formInline = { + file: "", + }; + this.getAttacthFlieList(); + }, + error: (e) => { + document.getElementById("insertFile").value = ""; + this.$message.error("闄勪欢娣诲姞澶辫触"); + }, } - }); + ); }, async getAttacthFlieList() { - var obj = this.upAttach + var obj = this.upAttach; const res = await dataQuery_selectFiles(obj); if (res.code != 200) { - this.$message.error('鍒楄〃璋冪敤澶辫触'); - return + this.$message.error("鍒楄〃璋冪敤澶辫触"); + return; } this.tableAttach = res.result; }, - getAttachTable(index, row) { if (row.eventid != null) { this.upAttach.eventid = row.eventid; } else { - this.upAttach.eventid = ''; + this.upAttach.eventid = ""; } this.getAttacthFlieList(); this.dialogFormVisible = true; }, //闄勪欢=>鏂囦欢閫夋嫨 getInsertFile() { - $('#insertFile').click(); + $("#insertFile").click(); }, insertFile() { - var val = document.getElementById('insertFile').files; + var val = document.getElementById("insertFile").files; if (!val || !val.length) return; this.formInline.file = val[0].name; @@ -611,16 +617,16 @@ async getTreeDataAll() { const data = await dataQuery_selectTabs(); if (data.code != 200) { - this.$message.error('鍒楄〃璋冪敤澶辫触'); + this.$message.error("鍒楄〃璋冪敤澶辫触"); } var option = data.result; for (var i in option) { var val_Data = option[i]; - val_Data.id = '1' + i; + val_Data.id = "1" + i; // val_Data.label = val_Data.tabDesc + "(" + val_Data.tab + ")" - val_Data.label = val_Data.tabDesc - option[i].id = parseInt(option[i].id) + val_Data.label = val_Data.tabDesc; + option[i].id = parseInt(option[i].id); for (var j in this.tree) { if (this.tree[j].ns == option[i].ns) { this.tree[j].children.push(val_Data); @@ -633,7 +639,7 @@ // this.tree[1].children.push(val_Data); // } } - this.handleNodeClick(this.tree[0].children[0]) + this.handleNodeClick(this.tree[0].children[0]); }, //鎺堟潈绠$悊 showPermsBtn() { @@ -642,7 +648,6 @@ permsEntity .filter((item) => item.perms == currentPerms) .map((item) => { - this.btnStatus[item.tag.substr(1)] = true; }); }, @@ -666,7 +671,7 @@ res.then((val) => { this.attributeData = val; }); - if (this.ruleForm.fileName != '') { + if (this.ruleForm.fileName != "") { this.listData.filter = this.ruleForm.fileName; } else { this.listData.filter = null; @@ -674,7 +679,7 @@ const data = await dataQuery_selectByPage(this.listData); if (data.code != 200) { - this.$message.error('璋冪敤鍒楄〃澶辫触,璇疯仈绯诲伐浣滀汉鍛�!'); + this.$message.error("璋冪敤鍒楄〃澶辫触,璇疯仈绯诲伐浣滀汉鍛�!"); return; } var res_val = this.attributeData; @@ -699,7 +704,7 @@ name: this.listData.name, }); if (fileds.code != 200) { - this.$message.error('璋冪敤鍒楄〃澶辫触,璇疯仈绯诲伐浣滀汉鍛�!'); + this.$message.error("璋冪敤鍒楄〃澶辫触,璇疯仈绯诲伐浣滀汉鍛�!"); return; } @@ -708,15 +713,15 @@ name: this.listData.name, }); if (domains.code != 200) { - this.$message.error('璋冪敤鍒楄〃澶辫触,璇疯仈绯诲伐浣滀汉鍛�!'); + this.$message.error("璋冪敤鍒楄〃澶辫触,璇疯仈绯诲伐浣滀汉鍛�!"); return; } var data1 = fileds.result; var data2 = domains.result; var std = []; for (var i in data1) { - if (data1[i].type != 'geomtry' && data1[i].type != 'null') { - this.filedsOption.push(data1[i]) + if (data1[i].type != "geomtry" && data1[i].type != "null") { + this.filedsOption.push(data1[i]); } if (data1[i].showtype == 1) { if (data1[i].domainNa != null) { @@ -735,55 +740,54 @@ this.formSql.date = new Date(); }, handleconditionClose() { - this.$confirm('纭鍏抽棴锛�') - .then(_ => { + this.$confirm("纭鍏抽棴锛�") + .then((_) => { this.startFiledAndcondition(); }) - .catch(_ => { }); + .catch((_) => {}); }, fieldChange(value) { - var obj = {} + var obj = {}; obj = this.filedsOption.find(function (item) { return item.field === value; - }) - this.conditionChange(obj) - + }); + this.conditionChange(obj); }, conditionChange(res) { this.formSql.field = res.field; this.formSql.type = res.type; if (res.type == "date" || res.type == "datetime") { - this.fromSqlflag = true + this.fromSqlflag = true; } else { - this.fromSqlflag = false + this.fromSqlflag = false; } var std = []; this.condOption = []; - if (res.type == 'text' || res.type == 'blob') { - std = conditions[0] - } else if (res.type == 'date' || res.type == 'datetime') { - std = conditions[2] + if (res.type == "text" || res.type == "blob") { + std = conditions[0]; + } else if (res.type == "date" || res.type == "datetime") { + std = conditions[2]; } else { - std = conditions[1] + std = conditions[1]; } for (var i in std) { this.condOption.push({ label: std[i], value: std[i], - }) + }); } - this.formSql.condition = this.condOption[0].value + this.formSql.condition = this.condOption[0].value; }, appendQueryFilter() { if (this.formSql.type == "date" || this.formSql.type == "datetime") { if (this.formSql.date == null) { - this.$message.error('璇疯緭鍏ヨ鏌ヨ鐨勪俊鎭�!'); + this.$message.error("璇疯緭鍏ヨ鏌ヨ鐨勪俊鎭�!"); return; } } else { if (this.formSql.value == "") { - this.$message.error('璇疯緭鍏ヨ鏌ヨ鐨勪俊鎭�!'); + this.$message.error("璇疯緭鍏ヨ鏌ヨ鐨勪俊鎭�!"); return; } } @@ -795,32 +799,29 @@ if (this.formSql.type == "long" || this.formSql.type == "integer") { val = parseInt(this.formSql.value); - } else if (this.formSql.type == 'double') { - + } else if (this.formSql.type == "double") { if (this.formSql.value.indexOf(".") != -1) { val = this.formSql.value; } else { - val = parseFloat(this.formSql.value).toFixed(1) + val = parseFloat(this.formSql.value).toFixed(1); } - } else if (this.formSql.type == "date" || this.formSql.type == "datetime") { + } else if ( + this.formSql.type == "date" || + this.formSql.type == "datetime" + ) { var time = new Date(this.formSql.date); var m = time.getMonth() + 1; var d = time.getDate(); var y = time.getFullYear(); - val = "'" + y + - '-' + - this.add0(m) + - '-' + - this.add0(d) + "'"; + val = "'" + y + "-" + this.add0(m) + "-" + this.add0(d) + "'"; } else { val = "'" + this.formSql.value + "'"; } - this.ruleForm.fileName += this.formSql.field + " " + this.formSql.condition + " " + val; + this.ruleForm.fileName += + this.formSql.field + " " + this.formSql.condition + " " + val; this.startFiledAndcondition(); }, - - //鍊煎煙瀛楁鍖归厤 getDomainNaFild(res, result) { @@ -890,12 +891,11 @@ }, // 閲嶇疆鏌ヨ resetForm() { - this.ruleForm.fileName = ''; + this.ruleForm.fileName = ""; this.listData.pageIndex = 1; this.listData.pageSize = 10; //鑾峰彇table淇℃伅 this.getCollapseTable(this.filedsLayer); - }, // 鍙戝竷鎸夐挳 @@ -909,9 +909,9 @@ // .then(() => { const loading = this.$loading({ lock: true, - text: 'Loading', - spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)', + text: "Loading", + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", }); setTimeout(() => { loading.close(); @@ -950,15 +950,15 @@ // 鎻愪氦淇敼 updateForm() { let params = {}; - this.$confirm('鏄惁纭畾缂栬緫?', '鎻愮ず', { - confirmButtonText: '纭畾', - cancelButtonText: '鍙栨秷', - type: 'warning', + this.$confirm("鏄惁纭畾缂栬緫?", "鎻愮ず", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning", }) .then(() => { this.dialogFormVisible = false; switch (this.tableType) { - case '鍦虹珯鐐�': + case "鍦虹珯鐐�": params = { gid: this.upform.gid, pipename: this.upform.pipename, @@ -968,15 +968,15 @@ UpdateSitePoint(params).then((res) => { if (res.data == 1) { this.$message({ - message: '淇敼鎴愬姛', - type: 'success', + message: "淇敼鎴愬姛", + type: "success", }); } - this.getSPData(10, 1, ''); - this.getSPCount(''); + this.getSPData(10, 1, ""); + this.getSPCount(""); }); break; - case '绠¢亾涓績绾�': + case "绠¢亾涓績绾�": params = { gid: this.upform.gid, pipename: this.upform.pipename, @@ -988,15 +988,15 @@ UpdateStationSeries(params).then((res) => { if (res.data == 1) { this.$message({ - message: '淇敼鎴愬姛', - type: 'success', + message: "淇敼鎴愬姛", + type: "success", }); } - this.getSSData(10, 1, ''); - this.getSSCount(''); + this.getSSData(10, 1, ""); + this.getSSCount(""); }); break; - case '鏍囨々': + case "鏍囨々": params = { gid: this.upform.gid, pipename: this.upform.pipename, @@ -1006,12 +1006,12 @@ UpdatgeMarker(params).then((res) => { if (res.data == 1) { this.$message({ - message: '淇敼鎴愬姛', - type: 'success', + message: "淇敼鎴愬姛", + type: "success", }); } - this.getMData(10, 1, ''); - this.getMCount(''); + this.getMData(10, 1, ""); + this.getMCount(""); }); break; } @@ -1026,7 +1026,7 @@ // this.getMetaCount(""); // }); }) - .catch(() => { }); + .catch(() => {}); }, // 鑾峰彇澶氶�夐�変腑鐨勫璞� handleSelectionChange(val) { @@ -1041,47 +1041,47 @@ for (var i in this.multipleSelection) { std.push(this.multipleSelection[i].gid); } - this.$confirm('纭畾鏄惁鍒犻櫎鎵�閫夊唴瀹�?', '鎻愮ず', { - confirmButtonText: '纭畾', - cancelButtonText: '鍙栨秷', - type: 'warning', + this.$confirm("纭畾鏄惁鍒犻櫎鎵�閫夊唴瀹�?", "鎻愮ず", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning", }) .then(() => { switch (this.tableType) { - case '鍦虹珯鐐�': + case "鍦虹珯鐐�": dltSitePoint(std).then((res) => { if (res.data !== 0) { this.$message({ - message: '鍒犻櫎鎴愬姛', - type: 'success', + message: "鍒犻櫎鎴愬姛", + type: "success", }); } - this.getSPData(10, 1, ''); - this.getSPCount(''); + this.getSPData(10, 1, ""); + this.getSPCount(""); }); break; - case '绠¢亾涓績绾�': + case "绠¢亾涓績绾�": dltStationSeries(std).then((res) => { if (res.data !== 0) { this.$message({ - message: '鍒犻櫎鎴愬姛', - type: 'success', + message: "鍒犻櫎鎴愬姛", + type: "success", }); } - this.getSSData(10, 1, ''); - this.getSSCount(''); + this.getSSData(10, 1, ""); + this.getSSCount(""); }); break; - case '鏍囨々': + case "鏍囨々": dltMarker(std).then((res) => { if (res.data !== 0) { this.$message({ - message: '鍒犻櫎鎴愬姛', - type: 'success', + message: "鍒犻櫎鎴愬姛", + type: "success", }); } - this.getMData(10, 1, ''); - this.getMCount(''); + this.getMData(10, 1, ""); + this.getMCount(""); }); break; } @@ -1094,7 +1094,7 @@ // }); // }); }) - .catch(() => { }); + .catch(() => {}); }, }, }; @@ -1113,15 +1113,16 @@ justify-content: space-between; .spatial_leftTree { width: calc(15% - 0px); - height: 91%; + height: 100%; border-radius: 5px; padding: 1%; - overflow: auto; + max-height: 670px; + overflow-y: auto; } .spatial_rightContent { - width: 80%; - height: 91%; + // width: 80%; + // height: 91%; border-radius: 5px; padding: 1%; @@ -1129,4 +1130,26 @@ } } } +.contentshuju{ + width: 80%; + height: 91%; + border-radius: 5px; + padding: 1%; + max-height: 670px; + border: 1px solid #dcdfe6; +} +.contentshujutou{ + height: 50px; + padding: 1%; + border-radius: 5px; + border: 1px solid #dcdfe6; +} +.contenttable{ + min-height: 520px; + height: 530px; + margin-top: 10px; +} +/deep/ .el-table__body{ + min-height: 525px; +} </style> -- Gitblit v1.9.3