Ver Fonte

Merge branch 'master' of http://114.244.114.158:8802/siwei/real3d-portalsite

maxiaoxiao há 7 meses atrás
pai
commit
b26c0bd891

+ 16 - 0
src/api/ghss/hgxfx.js

@@ -8,6 +8,7 @@ const hgxfxApi = {
     UpdateScx: '/apply/hgxfx/UpdateScx',
     // ShapeUpload:'/file/uploadShpZip',
     ShapeUpload: '/file/upload/geom',
+    ShapeUploadV1: '/file/upload/geom/v1',
     GetLog: '/apply/hgxfx/GetLog',
     AddHgxfxV1:'/apply/hgxfx/AddHgxfxV1'
 }
@@ -27,6 +28,21 @@ export function ShapeUpload(parameter) {
         }
     })
 }
+/**
+ * 上传SHP文件v1版本
+ * @param parameter
+ * @returns {*}
+ */
+export function ShapeUploadV1(parameter) {
+    return request({
+        method: 'post',
+        url: hgxfxApi.ShapeUploadV1,
+        data: parameter,
+        headers: {
+            'Content-Type': 'application/json;charset=UTF-8'
+        }
+    })
+}
 /**
  * 根据任务编号查询任务
  * @param parameter

+ 92 - 44
src/components/mapView/range-version.vue

@@ -87,11 +87,14 @@
             >
             </el-option>
           </el-select>
+        </div>
+        <div class="el-col headerInp">
           <el-input
             v-model="input"
             placeholder="请输入监测编号搜索"
             @keyup.enter.native="initNew"
           ></el-input>
+          <el-button plain icon="edit-pen" size="mini">查询</el-button>
         </div>
         <el-table
           ref="singleTable"
@@ -166,7 +169,7 @@
 </template>
 
 <script>
-import { ShapeUpload } from "@/api/ghss/hgxfx.js";
+import { ShapeUpload, ShapeUploadV1 } from "@/api/ghss/hgxfx.js";
 import { ElMessage } from "element-ui";
 import { GetXzqhTree } from "@/api/map";
 import {
@@ -203,18 +206,19 @@ export default {
       yearsOpt: [], //检测图斑时间季度数据数组
       monitorOpt: [],
       monitorVal: "",
-      yearsVal: "",//时间季度绑定
-      input: "",//图斑编号搜索条件绑定
-      updateObj: {//搜索条件
+      yearsVal: "", //时间季度绑定
+      input: "", //图斑编号搜索条件绑定
+      updateObj: {
+        //搜索条件
         region: "4602",
         tab: 1,
         val0: "",
         val1: "",
         val2: "",
       },
-      active_dableData: [],//表格数据
-      multipleSelection: [],//选择表格选中的数据
-      idArr: [],//存储id数组用于删除
+      active_dableData: [], //表格数据
+      multipleSelection: [], //选择表格选中的数据
+      idArr: [], //存储id数组用于删除
       // -----------以上为选择图斑功能所需数据------------
       userXZQ: "", //store.state.user.user.dept.district,
       fwlist: {
@@ -244,6 +248,7 @@ export default {
         xzfw: "",
         xzmj: 0,
         feature: null,
+        yptype:1,
       },
       handlerDraw: null,
       draw: null, //绘制
@@ -257,9 +262,11 @@ export default {
   },
   methods: {
     creatTb() {
+      this.yptype = 2
       this.dialogVisible = false;
       this.multipleSelection.forEach((item, index) => {
-        this.model.xzmj += item.jcmj
+        this.model.xzmj += item.jcmj;
+        this.fileDataID += item.id + ",";
         item.type = "图斑上图";
         if (item.geom)
           loadGeoJSON(item.geom, "#55A1E3", { isfly: true }, (data) => {
@@ -268,11 +275,14 @@ export default {
               entity.properties = item;
             });
           });
-          this.idArr.push(item.jcbh);
+        this.idArr.push(item.jcbh);
       });
+      //去掉最后一个逗号(如果不需要去掉,就不用写)
+      if (this.multipleSelection.length > 0) {
+        this.fileDataID = this.fileDataID.substr(0, this.fileDataID.length - 1);
+      }
     },
     handleSelectionChange(val) {
-      console.log(val, "====");
       this.multipleSelection = val;
     },
     handleClose(done) {
@@ -290,7 +300,6 @@ export default {
       this.updateObj.val0 = val.startTime;
       this.updateObj.val1 = val.endTime;
       this.yearsVal = val.quarter;
-      console.log(this.updateObj.val0, this.updateObj.val1, this.yearsVal);
     },
     getXzqTreeData() {
       GetXzqhTree().then((res) => {
@@ -329,7 +338,7 @@ export default {
         startTime: this.updateObj.val0,
         endTime: this.updateObj.val1,
         pageNum: 1,
-        pageSize: '9999999',
+        pageSize: "9999999",
         jcbh: this.input,
       };
       JctbList(obj).then((res) => {
@@ -356,11 +365,14 @@ export default {
         this.fileList = [fileList[fileList.length - 1]]; //这一步,是展示最后一次选择文件
         this.clearAll(false);
       }
+      this.yptype = 1
       const formdata = new FormData();
       formdata.append("file", file.raw);
       formdata.append("fromType", 2);
       formdata.append("fromRoute", this.$route.path);
-      ShapeUpload(formdata).then((res) => {
+      formdata.append("storeStats", 0);
+      formdata.append("followup", "");
+      ShapeUploadV1(formdata).then((res) => {
         if (res.success) {
           this.model.xzmj = (res.data.area * 0.0015).toFixed(2);
           // viewer.entities.removeAll();
@@ -411,13 +423,13 @@ export default {
     },
     //绘制
     drawMap() {
-      this.remove()//删除选择的图斑
+      this.remove(); //删除选择的图斑
+      this.yptype = 1
       if (!window.handlerPolygon) {
         common.initHandler("Polygon");
       }
       common.handlerDrawing("Polygon").then(
         (res) => {
-          // console.log(res.positions, "------");
           //过滤掉高度
           const filteredArr = res.positions.filter((item, index) => {
             if ((index + 1) % 3 !== 0) {
@@ -443,13 +455,11 @@ export default {
           }
 
           var matrix = listToMatrix(filteredArr, 2);
-          // console.log(matrix, "max-----");
 
           matrix.push(matrix[0]);
           const geojsonPolygon = turf.polygon([matrix]);
           // var parse = require("wellknown"); //引入wellknow
           const wktPolygon = parse.stringify(geojsonPolygon);
-          // console.log("WKT Polygon:", wktPolygon);
           if (this.$props.type == "cutfill") {
             this.model.geom = wktPolygon;
             this.$emit("cutfill", this.model.geom);
@@ -464,8 +474,10 @@ export default {
           formdata.append("fromType", 1);
           formdata.append("geom", wktPolygon);
           formdata.append("fromRoute", this.$route.path);
+          formdata.append("storeStats", 0);
+          formdata.append("followup", "");
           // this.addPolygon();
-          ShapeUpload(formdata).then((res) => {
+          ShapeUploadV1(formdata).then((res) => {
             if (res.success) {
               this.fileDataID = res.data.id;
               this.model.xzmj = (res.data.area * 0.0015).toFixed(2);
@@ -498,7 +510,7 @@ export default {
     clearAll(clearfile = true) {
       //销毁上传创建的面
       // viewer.entities.removeAll();
-      this.remove()
+      this.remove();
       this.resetDataSources();
       this.model.xzfw = "";
       this.model.xzmj = 0;
@@ -580,32 +592,68 @@ export default {
     }
   }
 }
-.headerSelect {
-  width: 100%;
-  height: 26px;
-  //   background: #00ffff;
-  margin: 5px 0px;
-  display: flex;
-  justify-content: space-between;
-  /deep/ .el-select {
-    padding: 0 10px;
-  }
-  /deep/ .el-input--suffix .el-input__inner {
-    padding-right: 15px;
-    // height: 26px;
-    background: #041c3273 !important;
-    border: 1px dashed #0f7ac8;
-    color: #fff;
-  }
-  /deep/ .el-cascader {
-    // line-height: 26px;
-  }
-  /deep/.el-input__icon {
-    // line-height: 1;
-    color: #fff;
+.gdzl {
+  .headerSelect {
+    width: 100%;
+    height: 26px;
+    //   background: #00ffff;
+    margin: 5px 0px;
+    display: flex;
+    justify-content: space-between;
+    /deep/ .el-select {
+      width: 95%;
+      // padding: 0 10px;
+      // margin-right: 10px;
+    }
+    /deep/ .el-input--suffix .el-input__inner {
+      padding-right: 15px;
+      // height: 26px;
+      background: #041c3273 !important;
+      border: 1px dashed #0f7ac8;
+      color: #fff;
+    }
+    /deep/ .el-cascader {
+      // line-height: 26px;
+    }
+    /deep/.el-input__icon {
+      // line-height: 1;
+      color: #fff;
+    }
+    /deep/ .el-input__inner::placeholder {
+      color: #fff;
+    }
   }
-  /deep/ .el-input__inner::placeholder {
-    color: #fff;
+  .headerInp {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    /deep/ .el-button--mini {
+      background: #0f7ac8;
+      border: none;
+      border-radius: 0;
+      color: #fff;
+      width: 60px;
+      height: 26px;
+      font-size: 12px;
+      padding: 0;
+    }
+    /deep/ .el-input__inner {
+      height: 26px;
+      width: 80%;
+    }
   }
 }
+.ghzc .el-col .el-cascader--mini {
+  width: 33% !important;
+}
+.ghzc .el-col .el-select {
+  width: 33% !important;
+}
+
+/deep/ .el-dialog__header {
+  padding: 10px 20px 0px;
+}
+/deep/ .el-dialog__body {
+  padding: 0px 20px;
+}
 </style>

+ 1 - 0
src/views/farmlandProtection/components/fzjcyp.vue

@@ -165,6 +165,7 @@ export default {
               xzfw: this.$refs.range.fileDataID,
               xmmc: this.ruleForm.xmmc,
               mxlist: this.multipleSelection,
+              yptype:this.$refs.range.yptype,
             };
 
             const loading = this.$loading({

+ 6 - 36
src/views/farmlandProtection/components/interDetails.vue

@@ -27,7 +27,7 @@
             </el-table-column>
             <el-table-column
               show-overflow-tooltip="true"
-              prop="siweiarea"
+              prop="geomarea"
               label="图斑面积(㎡)"
             >
             </el-table-column>
@@ -187,9 +187,10 @@ export default {
         if (res.statuscode == 200) {
           this.viewsData = res.data;
           this.yzjgData = res.data.yzjg;
-          this.jbxxData = Object.keys(res.data.tbxx).map((key) => ({
+          let geomJson = JSON.parse(res.data.tbxx.geomJson);
+          this.jbxxData = Object.keys(geomJson).map((key) => ({
             name: key,
-            value: res.data.tbxx[key],
+            value: geomJson[key],
           }));
         } else {
           this.$message.error(res.message);
@@ -217,8 +218,8 @@ export default {
     getAll() {
       getgeoms(this.interObj).then((res) => {
         if (res.statuscode == 200) {
-          this.tableData = res.data.dataListMap;
-          this.active_tableData(res.data.dataListMap);
+          this.tableData = res.data;
+          this.active_tableData(res.data);
         } else {
           this.$message.error(res.message);
         }
@@ -267,37 +268,6 @@ export default {
 
 .tableCon {
   height: 48rem;
-
-  // /deep/ .el-table tr {
-  //   background: rgba(10, 25, 38, 0.5) !important;
-  // }
-
-  // /deep/ .el-table td.el-table__cell,
-  // .el-table th.el-table__cell.is-leaf {
-  //   background: rgba(10, 25, 38, 0.5) !important;
-
-  //   border-bottom: 0px solid #ebeef5;
-  // }
-
-  // .el-table {
-  //   color: #fff;
-  //   background: rgba(10, 25, 38, 0.5) !important;
-  // }
-
-  // /deep/ .el-table__fixed-right::before,
-  // .el-table__fixed::before {
-  //   background: rgba(10, 25, 38, 0.9) !important;
-  // }
-
-  // /deep/ .el-table__fixed-right-patch {
-  //   background: rgba(10, 25, 38, 0.9) !important;
-  // }
-
-  // /deep/ .el-table--border::after,
-  // .el-table--group::after,
-  // .el-table::before {
-  //   background: rgba(10, 25, 38, 0) !important;
-  // }
 }
 
 /deep/ .el-icon-close:before {