diff --git a/src/assets/scss/buttonstyle copy.scss b/src/assets/scss/buttonstyle copy.scss deleted file mode 100644 index d10764f3..00000000 --- a/src/assets/scss/buttonstyle copy.scss +++ /dev/null @@ -1,67 +0,0 @@ -//新增 -.el-button--add { - color: #fff; - background-color: #22c1c3; - border-color: #22c1c3; -} -.el-button--add:hover { - color: #fff; - background-color: #05b1b4; - border-color: #05b1b4; -} -.el-button--add:focus { - color: #fff; - background-color: #22c1c3; - border-color: #22c1c3; -} - -//删除、导入 -.el-button--delete { - color: #fff; - background-color: #fe6252; - border-color: #fe6252; -} -.el-button--delete:hover { - color: #fff; - background-color: #fe6252; - border-color: #fe6252; -} -.el-button--delete:focus { - color: #fff; - background-color: #fe6252; - border-color: #fe6252; -} - -//重置、导出 -.el-button--reset { - color: #fff; - background-color: #feb349; - border-color: #feb349; -} -.el-button--reset:hover { - color: #fff; - background-color: #feb349; - border-color: #feb349; -} -.el-button--reset:focus { - color: #fff; - background-color: #feb349; - border-color: #feb349; -} - -//查询、确定 -.el-button--search:hover { - color: #fff; - background-color: #3e8ef7; - border-color: #3e8ef7; -} -.el-button--search:focus { - color: #fff; - background-color: #3e8ef7; - border-color: #3e8ef7; -} -.el-button--search { - color: #fff; - background-color: #3e8ef7; - border-color: #3e8ef7; -} diff --git a/src/views/modules/workSys/mapConfig.vue b/src/views/modules/workSys/mapConfig.vue index a991576b..f8b73ff8 100644 --- a/src/views/modules/workSys/mapConfig.vue +++ b/src/views/modules/workSys/mapConfig.vue @@ -49,8 +49,8 @@ resize="none" size="small" style="width:200px" - :precision="6" - :step="0.00001" + :precision="5" + :step="0.0001" placeholder='请输入经度偏差' v-model="xOffset"> @@ -58,8 +58,8 @@ @@ -100,14 +100,52 @@ width="50%" :before-close="handleClose">
- - +
+ 中心点经度: + + + 中心点纬度: + + +
+
+ + +
+
+ 经度偏差: + + + 纬度偏差: + + +
+ 取 消 @@ -248,10 +286,14 @@ const vueGis = { showOffset: false, // polygonManullyString: "POLYGON (( 120.33902844 36.10290786, 120.33928218 36.10292997, 120.33956336 36.10316381, 120.34016675 36.10367715, 120.34044913 36.10391476, 120.34045707 36.10392145, 120.34068696 36.10411489, 120.34103181 36.10436285, 120.34117309 36.10441824, 120.34134613 36.10447927, 120.34164715 36.10465122, 120.34124679 36.10507284, 120.34088128 36.10538902, 120.34076198 36.10549222, 120.34053890 36.10520966, 120.34044967 36.10507284, 120.34030632 36.10494761, 120.34019091 36.10484679, 120.33976558 36.10448095, 120.33966658 36.10439980, 120.33947147 36.10425822, 120.33932037 36.10417613, 120.33913002 36.10411307, 120.33895751 36.10406073, 120.33879451 36.10403693, 120.33864104 36.10403158, 120.33864031 36.10395235, 120.33863211 36.10305897, 120.33902175 36.10290728, 120.33902844 36.10290786))", polygonManullyString: "", - polygonStringResult: '', xOffset: 0, yOffset: 0, + xOffset_customize: 0.0051, + yOffset_customize: 0.0002, + + longitude: '', + latitude: '', } }, async mounted () { @@ -725,6 +767,14 @@ const vueGis = { }, handleManuallyOk () { + if (this.longitude || this.latitude) { + if (!(this.longitude && this.latitude)) { + this.$message({ + type: "warning", + message: "请同时填写中心点经纬度,或不填写" + }); + } + } //转化成需要的格式 //120.54033616308595,36.53603370922851,120.69620469335939,36.5408402277832,120.63166001562502,36.46771248120117,120.52728989843752,36.458786089599606,120.54033616308595,36.53603370922851 //中国经纬度范围 @@ -734,18 +784,27 @@ const vueGis = { const arrayString = this.polygonManullyString let array = arrayString.split(/[, ]/) console.log(array) - this.polygonStringResult = '' + let polygonStringResult = '' + + array.forEach(element => { let num = Number(element) if (num) { - this.polygonStringResult = this.polygonStringResult + element + ',' + polygonStringResult = polygonStringResult + element + ',' } }); - this.polygonStringResult = this.polygonStringResult.substring(0, this.polygonStringResult.length - 1) + polygonStringResult = polygonStringResult.substring(0, polygonStringResult.length - 1) + + if (this.xOffset_customize !== 0 || this.yOffset_customize !== 0) { + this.saveOffset(this.xOffset_customize, this.yOffset_customize, polygonStringResult) + } else { + this.addPolygon(polygonStringResult) + } + + - this.addPolygon(this.polygonStringResult) }, handleSetOffset () { @@ -753,7 +812,7 @@ const vueGis = { }, handleOffsetOk () { let selPolygonString = "" - let offsetPolygonString = ''//偏移后的坐标字符串 + this.subAgencyArray.forEach(element => { if (element.id === this.selAgencyId && element.coordinates && element.coordinates.length > 0) { selPolygonString = element.coordinates @@ -761,35 +820,32 @@ const vueGis = { }); if (selPolygonString) { - let tempArray = selPolygonString.split(',') - - tempArray.forEach((element, index) => { - let aaa = 0 - - if (index % 2 === 0) {//偶数 - aaa = parseFloat(element) + parseFloat(this.xOffset) - } else { - aaa = parseFloat(element) + parseFloat(this.yOffset) - } - - if (index % 2 !== 0) {//奇数 + this.saveOffset(tyhis.xOffset, this.yOffset, selPolygonString) + } - } - offsetPolygonString = offsetPolygonString + aaa + ',' + }, + saveOffset (xOffset, yOffset, selPolygonString) { + let offsetPolygonString = ''//偏移后的坐标字符串 + let tempArray = selPolygonString.split(',') - }); + tempArray.forEach((element, index) => { + let aaa = 0 - offsetPolygonString = offsetPolygonString.substring(0, offsetPolygonString.length - 1) - } + if (index % 2 === 0) {//偶数 + aaa = parseFloat(element) + parseFloat(xOffset) + } else { + aaa = parseFloat(element) + parseFloat(yOffset) + } + if (index % 2 !== 0) {//奇数 + } + offsetPolygonString = offsetPolygonString + aaa + ',' - console.log('selPolygonString', selPolygonString) - console.log('offsetPolygonString', offsetPolygonString) + }); + offsetPolygonString = offsetPolygonString.substring(0, offsetPolygonString.length - 1) this.addPolygon(offsetPolygonString) - - }, handleSetOffset () { this.handleOffsetCancel = false @@ -924,7 +980,9 @@ const vueGis = { let params = { orgId: this.selAgency.id, level: this.selAgency.level, - coordinates: coorString + coordinates: coorString, + longitude: this.longitude, + latitude: this.latitude } const { data, code, msg } = await requestPost(url, params) @@ -935,6 +993,7 @@ const vueGis = { message: "绘制成功" }); if (this.dialogVisible) { + this.polygonManullyString = ' ' this.dialogVisible = false } this.refreshMap(false)