From ff2afbce0f31c6f75f4930ba8db7ccb7a99556a4 Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期四, 23 二月 2023 10:26:28 +0800 Subject: [PATCH] 源数据管理,图层管理,空间查询 --- src/views/Tools/pipeLineAnaly.vue | 507 ++++++++++++++++++++++++++------------------------------ 1 files changed, 237 insertions(+), 270 deletions(-) diff --git a/src/views/Tools/pipeLineAnaly.vue b/src/views/Tools/pipeLineAnaly.vue index b6a968c..05cabd3 100644 --- a/src/views/Tools/pipeLineAnaly.vue +++ b/src/views/Tools/pipeLineAnaly.vue @@ -2,11 +2,7 @@ <div class="pipeLineBox"> <div class="headerBox"> <div class="elFrom"> - <el-form - ref="form" - :model="ruleFrom" - label-width="120px" - > + <el-form ref="form" :model="ruleFrom" label-width="120px"> <el-form-item label="绠¢亾涓績绾�"> <el-select @change="selectChange" @@ -39,38 +35,32 @@ </el-form-item> </el-form> </div> - <div style="display:flex"> + <div style="display: flex"> <div class="transBox"> <label>鍩虹鏁版嵁鍥惧眰</label> <div class="checkBox"> <ul> <li @click="checkLeft(item)" - :class="{checkhover:checkedLeftflag == item.id}" - v-for='(item,index) in cities' + :class="{ checkhover: checkedLeftflag == item.id }" + v-for="(item, index) in cities" :label="item.label" :key="item.id" - >{{item.label}}</li> + > + {{ item.label }} + </li> </ul> </div> </div> <div class="transInfo"> <div> - <el-link - @click="setTransRight" - :underline="false" - ><i - style="color:white" - class="el-icon-d-arrow-right" - ></i></el-link> + <el-link @click="setTransRight" :underline="false" + ><i class="el-icon-d-arrow-right"></i + ></el-link> <br /> - <el-link - @click="setTransLeft" - :underline="false" - ><i - style="color:white" - class="el-icon-d-arrow-left" - ></i></el-link> + <el-link @click="setTransLeft" :underline="false" + ><i class="el-icon-d-arrow-left"></i + ></el-link> </div> </div> <div class="transBox"> @@ -79,28 +69,22 @@ <ul> <li @click="checkRight(item)" - :class="{checkhover:checkedRightflag == item.id}" - v-for='(item,index) in citiyData' + :class="{ checkhover: checkedRightflag == item.id }" + v-for="(item, index) in citiyData" :label="item.label" :key="item.id" - >{{item.label}}</li> + > + {{ item.label }} + </li> </ul> </div> </div> </div> <div class="sureButton"> - <div class="suerBox"> - <el-button - @click="setAnalysis" - size="small" - >鍒嗘瀽</el-button> - <el-button - @click="clearAnalysis" - size="small" - >鍙栨秷</el-button> + <el-button @click="setAnalysis" size="small">鍒嗘瀽</el-button> + <el-button @click="clearAnalysis" size="small">鍙栨秷</el-button> </div> - </div> </div> <div class="contentBox"> @@ -108,19 +92,19 @@ <ul> <li @click="setlistChange(item)" - :class="{checkhover:listflag == item.id}" + :class="{ checkhover: listflag == item.id }" v-for="item in listData" - >{{item.label}}</li> + > + {{ item.label }} + </li> </ul> </div> <div class="contentLeft"> - <div style="float:right;padding:2px"> - <el-button - @click="showDialogVivable()" - size="small" - type="info" - >涓嬭浇</el-button> + <div style="float: right; padding: 2px"> + <el-button @click="showDialogVivable()" size="small" type="info" + >涓嬭浇</el-button + > <!-- <el-button size="mini" type="info" @@ -130,22 +114,14 @@ type="info" >鍒犻櫎</el-button> --> </div> - <el-table - :data="tableData" - style="width: 100%" - height="70%" - > + <el-table :data="tableData" style="width: 100%" height="70%"> <el-table-column align="center" type="index" :label="$t('operatManage.ELM.index')" width="70px" /> - <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" @@ -154,41 +130,18 @@ ></el-button> </template> </el-table-column> - <el-table-column - prop="acrossName" - label="琚┛瓒婂湴鐗╁悕绉�" - width="180" - > + <el-table-column prop="acrossName" label="琚┛瓒婂湴鐗╁悕绉�" width="180"> </el-table-column> - <el-table-column - prop="acrossLength" - label="绌胯秺闀垮害" - width="100" - > + <el-table-column prop="acrossLength" label="绌胯秺闀垮害" width="100"> </el-table-column> - <el-table-column - prop="pipeName" - label="绠$嚎鍚嶇О" - width="180" - > + <el-table-column prop="pipeName" label="绠$嚎鍚嶇О" width="180"> </el-table-column> - <el-table-column - prop="segName" - label="绠℃鍚嶇О" - width="180" - > + <el-table-column prop="segName" label="绠℃鍚嶇О" width="180"> </el-table-column> - <el-table-column - prop="remarks" - label="澶囨敞" - width="100" - > + <el-table-column prop="remarks" label="澶囨敞" width="100"> </el-table-column> </el-table> - <div - class="pagination_box" - style="margin-top:10px" - > + <div class="pagination_box" style="margin-top: 10px"> <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" @@ -218,20 +171,14 @@ 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" @@ -239,16 +186,12 @@ ></el-input> </el-form-item> <el-form-item> - <el-button - type="info" - size="small" - @click="download " - >{{$t('common.confirm')}}</el-button> - <el-button - type="info" - size="small" - @click="closeDialog " - >{{$t('common.cancel')}}</el-button> + <el-button type="info" size="small" @click="download">{{ + $t("common.confirm") + }}</el-button> + <el-button type="info" size="small" @click="closeDialog">{{ + $t("common.cancel") + }}</el-button> </el-form-item> </el-form> </el-dialog> @@ -261,17 +204,22 @@ </template> <script> -import WKT from 'terraformer-wkt-parser' +import WKT from "terraformer-wkt-parser"; import { getToken } from "@/utils/auth"; -import { pipelines_selectSegNames, pipeline_selectPipeAnalysis, sign_getPublicKey, pipeline_downloadReq } from '../../api/api.js'; +import { + pipelines_selectSegNames, + pipeline_selectPipeAnalysis, + sign_getPublicKey, + pipeline_downloadReq, +} from "../../api/api.js"; import $ from "jquery"; export default { data() { var repasswordValidator = (rule, value, callback) => { - if (value === '') { - callback(new Error('璇峰啀娆¤緭鍏ュ瘑鐮�')); + if (value === "") { + callback(new Error("璇峰啀娆¤緭鍏ュ瘑鐮�")); } else if (value !== this.codeForm.password) { - callback(new Error('涓ゆ杈撳叆瀵嗙爜涓嶄竴鑷�!')); + callback(new Error("涓ゆ杈撳叆瀵嗙爜涓嶄竴鑷�!")); } else { callback(); } @@ -280,61 +228,68 @@ 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(new Error("瀵嗙爜蹇呴』鐢辨暟瀛椼�佸瓧姣嶃�佺壒娈婂瓧绗︾粍鍚�,璇疯緭鍏�13-20浣�")); } else { callback(); } }; return { rules: { - password: [{ required: true, message: '璇疯緭鍏ュ瘑鐮�', trigger: 'blur' }, { validator: passwordValidator, trigger: 'blur' }], + password: [ + { required: true, message: "璇疯緭鍏ュ瘑鐮�", trigger: "blur" }, + { validator: passwordValidator, trigger: "blur" }, + ], repassword: [ - { required: true, message: '璇疯緭鍏ョ‘璁ゅ瘑鐮�', trigger: 'blur' }, - { validator: repasswordValidator, trigger: 'blur' }, + { required: true, message: "璇疯緭鍏ョ‘璁ゅ瘑鐮�", trigger: "blur" }, + { validator: repasswordValidator, trigger: "blur" }, ], }, dialogVisible: false, codeForm: { - repassword: '', password: '' + repassword: "", + password: "", }, ruleFrom: { - value1: '', - value2: '' + value1: "", + value2: "", }, options1: [], options2: [], checkList: [], - checkData: [{ - id: 1, - label: '閾佽矾(dlg_25w_lrrl)', - tabs: 'dlg_25w_lrrl', - tabdesc: '閾佽矾', - table: 'bd.dlg_25w_lrrl', - checked: false, - }, { - id: 2, - label: '鍏矾(dlg_25w_lrdl)', - tabs: 'dlg_25w_lrdl', - tabdesc: '鍏矾', - table: 'bd.dlg_25w_lrdl', - checked: false, - }, { - id: 3, - label: '姘寸郴绾�(dlg_25w_hydl)', - tabs: 'dlg_25w_hydl', - tabdesc: '姘寸郴绾�', - table: 'bd.dlg_25w_hydl', - checked: false, - }, { - id: 4, - label: '姘寸郴闈�(dlg_25w_hyda)', - tabs: 'dlg_25w_hyda', - tabdesc: '姘寸郴闈�', - table: 'bd.dlg_25w_hyda', - checked: false, - }], + checkData: [ + { + id: 1, + label: "閾佽矾(dlg_25w_lrrl)", + tabs: "dlg_25w_lrrl", + tabdesc: "閾佽矾", + table: "bd.dlg_25w_lrrl", + checked: false, + }, + { + id: 2, + label: "鍏矾(dlg_25w_lrdl)", + tabs: "dlg_25w_lrdl", + tabdesc: "鍏矾", + table: "bd.dlg_25w_lrdl", + checked: false, + }, + { + id: 3, + label: "姘寸郴绾�(dlg_25w_hydl)", + tabs: "dlg_25w_hydl", + tabdesc: "姘寸郴绾�", + table: "bd.dlg_25w_hydl", + checked: false, + }, + { + id: 4, + label: "姘寸郴闈�(dlg_25w_hyda)", + tabs: "dlg_25w_hyda", + tabdesc: "姘寸郴闈�", + table: "bd.dlg_25w_hyda", + checked: false, + }, + ], citiyData: [], cities: [], checkedCities: [], @@ -350,12 +305,12 @@ pageData: { pageIndex: 1, pageSize: 10, - pageCount: 0 + pageCount: 0, }, multipleSelection: [], featurTable: null, featureLayer: [], - } + }; }, methods: { spaceLocation(index, row) { @@ -368,43 +323,55 @@ this.claerAll(); switch (geojson.type) { - case 'Point': - this.setShowImagePoint(geojson.coordinates) + case "Point": + this.setShowImagePoint(geojson.coordinates); break; - case 'MultiPoint': + case "MultiPoint": for (var i in geojson.coordinates) { - this.setShowImagePoint(geojson.coordinates[i]) + this.setShowImagePoint(geojson.coordinates[i]); } break; - case 'LineString': - this.setShowImageLine(geojson.coordinates) + case "LineString": + this.setShowImageLine(geojson.coordinates); break; - case 'MultiLineString': + case "MultiLineString": for (var i in geojson.coordinates) { - this.setShowImageLine(geojson.coordinates[i]) + this.setShowImageLine(geojson.coordinates[i]); } break; } }, setShowImagePoint(res) { - var obj = { X: res[0], Y: res[1], Altitude: 1000 } - var imageLabel = sgworld.Creator.CreateImageLabel(obj, SmartEarthRootUrl + "Workers/image/mark.png", {}, 0, "绠¢亾绌洪棿鍒嗘瀽"); - this.$store.state.pipelineEntity.push(imageLabel.item) + var obj = { X: res[0], Y: res[1], Altitude: 1000 }; + var imageLabel = sgworld.Creator.CreateImageLabel( + obj, + SmartEarthRootUrl + "Workers/image/mark.png", + {}, + 0, + "绠¢亾绌洪棿鍒嗘瀽" + ); + this.$store.state.pipelineEntity.push(imageLabel.item); sgworld.Navigate.flyToObj(imageLabel.item); }, setShowImageLine(res) { var obj = []; for (var i in res) { - obj.push({ x: res[i][0], y: res[i][1], z: 1000 }) + obj.push({ x: res[i][0], y: res[i][1], z: 1000 }); } - var line = sgworld.Creator.createPolyline(obj, "#ffff00", 1, 0, "绠¢亾绌洪棿鍒嗘瀽"); - this.$store.state.pipelineEntity.push(line.item) + var line = sgworld.Creator.createPolyline( + obj, + "#ffff00", + 1, + 0, + "绠¢亾绌洪棿鍒嗘瀽" + ); + this.$store.state.pipelineEntity.push(line.item); sgworld.Navigate.flyToObj(line.item); }, claerAll() { for (var i in this.$store.state.pipelineEntity) { - var item = this.$store.state.pipelineEntity[i] + var item = this.$store.state.pipelineEntity[i]; sgworld.Viewer.entities.remove(item); } this.$store.state.pipelineEntity = []; @@ -417,20 +384,17 @@ } }, async download() { - var std = []; for (var i in this.listData) { - - std.push(this.listData[i].table) + std.push(this.listData[i].table); } var obj = { pwd: encrypt.encrypt(this.codeForm.password), gid: this.analyGid, - tabs: std + tabs: std, }; const data = await pipeline_downloadReq(obj); if (data.code != 200) { - this.$message.error("涓嬭浇璇锋眰澶辫触"); this.closeDialog(); @@ -452,47 +416,47 @@ // this.$store.state.loading = false; }, showDialogVivable() { - if (this.listData.length == 0) return - this.dialogVisible = true + if (this.listData.length == 0) return; + this.dialogVisible = true; }, handleClose() { - this.$confirm('纭鍏抽棴锛�') - .then(_ => { - this.closeDialog() + this.$confirm("纭鍏抽棴锛�") + .then((_) => { + this.closeDialog(); }) - .catch(_ => { }); + .catch((_) => {}); }, closeDialog() { - this.dialogVisible = false + this.dialogVisible = false; this.codeForm = { - repassword: '', password: '' - } + repassword: "", + password: "", + }; }, handleSelectionChange(val) { this.multipleSelection = val; }, setTransLeft() { - if (this.rightChecked == null) return - this.cities.push(this.rightChecked) + if (this.rightChecked == null) return; + this.cities.push(this.rightChecked); this.citiyData.forEach((value, index, array) => { if (value.label == this.rightChecked.label) { - array.splice(index, 1) + array.splice(index, 1); } }); this.checkedLeftflag = null; - this.rightChecked = null - + this.rightChecked = null; }, setTransRight() { - if (this.leftChecked == null) return - this.citiyData.push(this.leftChecked) + if (this.leftChecked == null) return; + this.citiyData.push(this.leftChecked); this.cities.forEach((value, index, array) => { if (value.label == this.leftChecked.label) { - array.splice(index, 1) + array.splice(index, 1); } }); this.checkedRightflag = null; - this.leftChecked = null + this.leftChecked = null; }, checkLeft(res) { this.checkedLeftflag = res.id; @@ -503,10 +467,9 @@ this.rightChecked = res; }, selectChange(res) { - this.changeSelect2(res) + this.changeSelect2(res); }, selectChange1(res) { - this.analyGid = res; }, changeSelect2(res) { @@ -514,7 +477,7 @@ var value = this.featureLayer; for (var i in value) { if (value[i].pipeName == res) { - this.options2.push(value[i]) + this.options2.push(value[i]); } } this.ruleFrom.value2 = this.options2[0].segName; @@ -524,35 +487,40 @@ this.tableData = []; this.listData = []; - this.cities = [{ - id: 1, - label: '閾佽矾(dlg_25w_lrrl)', - tabs: 'dlg_25w_lrrl', - tabdesc: '閾佽矾', - table: 'bd.dlg_25w_lrrl', - checked: false, - }, { - id: 2, - label: '鍏矾(dlg_25w_lrdl)', - tabs: 'dlg_25w_lrdl', - tabdesc: '鍏矾', - table: 'bd.dlg_25w_lrdl', - checked: false, - }, { - id: 3, - label: '姘寸郴绾�(dlg_25w_hydl)', - tabs: 'dlg_25w_hydl', - tabdesc: '姘寸郴绾�', - table: 'bd.dlg_25w_hydl', - checked: false, - }, { - id: 4, - label: '姘寸郴闈�(dlg_25w_hyda)', - tabs: 'dlg_25w_hyda', - tabdesc: '姘寸郴闈�', - table: 'bd.dlg_25w_hyda', - checked: false, - }]; + this.cities = [ + { + id: 1, + label: "閾佽矾(dlg_25w_lrrl)", + tabs: "dlg_25w_lrrl", + tabdesc: "閾佽矾", + table: "bd.dlg_25w_lrrl", + checked: false, + }, + { + id: 2, + label: "鍏矾(dlg_25w_lrdl)", + tabs: "dlg_25w_lrdl", + tabdesc: "鍏矾", + table: "bd.dlg_25w_lrdl", + checked: false, + }, + { + id: 3, + label: "姘寸郴绾�(dlg_25w_hydl)", + tabs: "dlg_25w_hydl", + tabdesc: "姘寸郴绾�", + table: "bd.dlg_25w_hydl", + checked: false, + }, + { + id: 4, + label: "姘寸郴闈�(dlg_25w_hyda)", + tabs: "dlg_25w_hyda", + tabdesc: "姘寸郴闈�", + table: "bd.dlg_25w_hyda", + checked: false, + }, + ]; this.citiyData = []; this.getAllData(); this.listflag = null; @@ -561,40 +529,40 @@ this.pageData = { pageIndex: 1, pageSize: 10, - pageCount: 0 - } + pageCount: 0, + }; }, async setAnalysis() { if (this.citiyData.length == 0) { - this.$message.error('璇烽�夋嫨瑕佸垎鏋愮殑鍥惧眰!'); + this.$message.error("璇烽�夋嫨瑕佸垎鏋愮殑鍥惧眰!"); } var std = []; var listTable = []; for (var i in this.citiyData) { - std.push(this.citiyData[i].table) - listTable.push(this.citiyData[i]) + std.push(this.citiyData[i].table); + listTable.push(this.citiyData[i]); } this.listData = listTable; - this.listflag = this.listData[0].id + this.listflag = this.listData[0].id; var obj = { gid: this.analyGid, - tabs: std - } + tabs: std, + }; const data = await pipeline_selectPipeAnalysis(obj); if (data.code != 200) { - this.$message.error('鍒楄〃璋冪敤澶辫触'); + this.$message.error("鍒楄〃璋冪敤澶辫触"); } this.featureData = data.result; - this.featurTable = this.featureData[this.listData[0].table] + this.featurTable = this.featureData[this.listData[0].table]; this.pageData.pageCount = this.featurTable.length; this.pageData.pageIndex = 1; this.pageData.pageSize = 10; this.changePageData(); }, setlistChange(res) { - this.listflag = res.id - this.featurTable = this.featureData[res.table] + this.listflag = res.id; + this.featurTable = this.featureData[res.table]; this.pageData.pageCount = this.featurTable.length; this.pageData.pageIndex = 1; this.pageData.pageSize = 10; @@ -615,10 +583,9 @@ this.changePageData(); }, async getAllData() { - const data = await pipelines_selectSegNames(); if (data.code != 200) { - this.$message.error('鍒楄〃璋冪敤澶辫触'); + this.$message.error("鍒楄〃璋冪敤澶辫触"); } var std = []; var str = []; @@ -626,50 +593,54 @@ for (var i in result) { if (std.indexOf(result[i].pipeName) == -1) { std.push(result[i].pipeName); - str.push(result[i]) + str.push(result[i]); } } this.featureLayer = data.result; this.options1 = str; this.ruleFrom.value1 = this.options1[0].pipeName; - this.changeSelect2(this.ruleFrom.value1) + this.changeSelect2(this.ruleFrom.value1); }, }, mounted() { - - this.cities = [{ - id: 1, - label: '閾佽矾(dlg_25w_lrrl)', - tabs: 'dlg_25w_lrrl', - tabdesc: '閾佽矾', - table: 'bd.dlg_25w_lrrl', - checked: false, - }, { - id: 2, - label: '鍏矾(dlg_25w_lrdl)', - tabs: 'dlg_25w_lrdl', - tabdesc: '鍏矾', - table: 'bd.dlg_25w_lrdl', - checked: false, - }, { - id: 3, - label: '姘寸郴绾�(dlg_25w_hydl)', - tabs: 'dlg_25w_hydl', - tabdesc: '姘寸郴绾�', - table: 'bd.dlg_25w_hydl', - checked: false, - }, { - id: 4, - label: '姘寸郴闈�(dlg_25w_hyda)', - tabs: 'dlg_25w_hyda', - tabdesc: '姘寸郴闈�', - table: 'bd.dlg_25w_hyda', - checked: false, - }]; + this.cities = [ + { + id: 1, + label: "閾佽矾(dlg_25w_lrrl)", + tabs: "dlg_25w_lrrl", + tabdesc: "閾佽矾", + table: "bd.dlg_25w_lrrl", + checked: false, + }, + { + id: 2, + label: "鍏矾(dlg_25w_lrdl)", + tabs: "dlg_25w_lrdl", + tabdesc: "鍏矾", + table: "bd.dlg_25w_lrdl", + checked: false, + }, + { + id: 3, + label: "姘寸郴绾�(dlg_25w_hydl)", + tabs: "dlg_25w_hydl", + tabdesc: "姘寸郴绾�", + table: "bd.dlg_25w_hydl", + checked: false, + }, + { + id: 4, + label: "姘寸郴闈�(dlg_25w_hyda)", + tabs: "dlg_25w_hyda", + tabdesc: "姘寸郴闈�", + table: "bd.dlg_25w_hyda", + checked: false, + }, + ]; this.getAllData(); this.signGetPublicKey(); - } -} + }, +}; </script> <style scoped lang="less"> @@ -698,8 +669,6 @@ border-radius: 5px; overflow-y: auto; } - - } .transInfo { @@ -736,7 +705,7 @@ .checkhover { color: #409eff; } - + .country-group { display: flex; justify-content: center; @@ -745,7 +714,5 @@ margin: 4px 0; } } - - } -</style> \ No newline at end of file +</style> -- Gitblit v1.9.3