From 0a722969a72ced13136b82d8c01939bea2c43745 Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期四, 27 七月 2023 17:21:53 +0800
Subject: [PATCH] 项目管理,数据发布修改

---
 src/views/datamanage/uploadmanage.vue |  274 +++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 247 insertions(+), 27 deletions(-)

diff --git a/src/views/datamanage/uploadmanage.vue b/src/views/datamanage/uploadmanage.vue
index 6af219c..7d78f65 100644
--- a/src/views/datamanage/uploadmanage.vue
+++ b/src/views/datamanage/uploadmanage.vue
@@ -93,6 +93,28 @@
             </el-option>
           </el-select>
         </el-form-item>
+        <!-- 鐩綍 -->
+        <el-form-item v-if="active == 'second'">
+          <el-select
+            size="small"
+            v-model="formInline.dirid2"
+            placeholder="璇烽�夋嫨椤圭洰鐩綍..."
+          >
+            <el-option
+              :value="formInline.dirid2"
+              :label="formInline.dirName2"
+              style="height: auto"
+            >
+              <el-tree
+                ref="tree"
+                :data="dirOption2"
+                node-key="id"
+                :props="defaultProps"
+                @node-click="handleDirChange2"
+              />
+            </el-option>
+          </el-select>
+        </el-form-item>
         <!-- 鐗堟湰 -->
         <el-form-item v-if="active == 'first'">
           <el-select
@@ -117,6 +139,22 @@
           >
             <el-option
               v-for="item in typeOption"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item v-if="active == 'second'">
+          <el-select
+            size="small"
+            v-model="formInline.type1"
+            @change="handleTypeChange1"
+            placeholder="璇烽�夋嫨鏁版嵁绫诲埆..."
+          >
+            <el-option
+              v-for="item in typeOption1"
               :key="item.value"
               :label="item.label"
               :value="item.value"
@@ -583,7 +621,10 @@
         >
           <el-row :gutter="20">
             <el-col :span="10">
-              <div style="height: 64px; display: flex; align-items: center;">
+              <div
+                class="contLable"
+                style="height: 64px; display: flex; align-items: center;"
+              >
                 {{ item.name }}
               </div>
             </el-col>
@@ -628,22 +669,69 @@
     <el-dialog
       :title="$t('common.publish')"
       :visible.sync="insertOsgbVisible"
-      width="25%"
       :close-on-click-modal="false"
       :show-close="false"
+      width="35%"
     >
-      <div style="width:100%; ">
-        <el-form
-          :model="osgbLasLayer"
-          label-width="160px"
+      <div>
+
+        <div
+          v-for="item in osgbLasOption"
+          style="margin-top: 10px; display: flex; align-items: center; justify-content: space-around;  "
         >
-          <el-form-item :label="$t('dataManage.vmobj.heightOffset')">
+          <div
+            class="contLable"
+            style=" margin: 0px 10px;"
+          >
+            {{ item.name }}
+          </div>
+          <div>
+            <div style="display: flex; align-items: center; margin: 0px 10px;">
+              <label class="contLable">楂樺害鍋忕Щ閲忥細</label>
+              <el-input
+                size="small"
+                v-model="item.zs"
+              >
+                <i slot="suffix">m</i></el-input>
+            </div>
+
+          </div>
+
+          <div v-show="formInline.type =='LAS'">
+            <div style="display: flex;  align-items: center; margin: 0px 10px;">
+              <label class="contLable">鍧愭爣绯伙細</label>
+              <el-select
+                v-if="!item.lids"
+                v-model="item.srids"
+                style="width: 100%;"
+                size="small"
+              >
+                <el-option
+                  v-for="item in stridOption"
+                  :key="item.id"
+                  :label="item.coordinate"
+                  :value="item.epsgcode"
+                >
+                </el-option>
+              </el-select>
+              <el-input
+                v-if="item.lids"
+                v-model="item.srids"
+                size="small"
+                disabled
+              ></el-input>
+            </div>
+
+          </div>
+
+        </div>
+        <!-- <el-form-item :label="$t('dataManage.vmobj.heightOffset')">
             <el-input
               :placeholder="$t('dataManage.vmobj.label1')"
               v-model="osgbLasLayer.z"
             ></el-input>
-          </el-form-item>
-          <el-form-item
+          </el-form-item> -->
+        <!-- <el-form-item
             v-if="formInline.type == 'LAS'"
             :label="$t('dataManage.vmobj.coordinateSystemID')"
           >
@@ -660,8 +748,8 @@
               >
               </el-option>
             </el-select>
-          </el-form-item>
-        </el-form>
+          </el-form-item> -->
+
         <div style="display: flex; justify-content: end;margin-top:10px;">
           <el-button
             size="small"
@@ -714,7 +802,8 @@
   publish_deletes,
   publish_update,
   publish_insert,
-  dataUpload_selectCoords
+  dataUpload_selectCoords,
+  publish_selectLasCs
 } from '../../api/api.js'
 import { conditions } from '../Archive/Archive';
 
@@ -728,12 +817,15 @@
       active: 'first',
       formInline: {
         dirid: null,
+        dirid2: null,
         dirName: null,
+        dirName2: null,
         depid: null,
         verid: null,
         depName: null,
         name: "",
-        type: ""
+        type: "",
+        type1: "All",
       },
       listData: {
         pageIndex: 1,
@@ -743,10 +835,39 @@
       multipleSelection: [],
       tableData: [],
       depOption: [],
+      dirOption2: [],
       dirOption: [],
       verOption: [],
       modelOptions: [],
       typeOption: [{
+        value: 'DOM',
+        label: '褰卞儚鏁版嵁(.tif, .img)'
+      }, {
+        value: 'DEM',
+        label: '楂樼▼鏁版嵁(.tif)'
+      }, {
+        value: 'MPT',
+        label: '鍦烘櫙鏁版嵁(.mpt)'
+      }, {
+        value: 'OSGB',
+        label: '鍊炬枩鏁版嵁(.osgb)'
+      }, {
+        value: 'LAS',
+        label: '鐐逛簯鏁版嵁(.las, .laz)'
+      }, {
+        value: 'CPT',
+        label: '鐐逛簯鏁版嵁(.cpt)'
+      }, {
+        value: '3DML',
+        label: '涓夌淮妯″瀷(.3dml)'
+      }, {
+        value: 'BIM',
+        label: '涓夌淮妯″瀷(.fbx, .ifc, .rvt)'
+      }],
+      typeOption1: [{
+        value: 'All',
+        label: '鍏ㄩ儴'
+      }, {
         value: 'DOM',
         label: '褰卞儚鏁版嵁(.tif, .img)'
       }, {
@@ -798,6 +919,7 @@
         strid: ''
       },
       stridOption: [],
+      osgbLasOption: [],
     }
   },
   methods: {
@@ -811,17 +933,31 @@
     async setOsgbInsert() {
 
       var ids = [];
-      for (var i in this.multipleSelection) {
-        ids.push(this.multipleSelection[i].id)
+      var zs = []
+      for (var i in this.osgbLasOption) {
+        ids.push(this.osgbLasOption[i].id)
+        zs.push(this.osgbLasOption[i].zs)
       }
-      var strid;
-
+      var srids = [];
+      var lerro = [];
       if (this.formInline.type == 'LAS') {
-        if (!this.osgbLasLayer.strid) {
-          return this.$message('璇烽�夋嫨鍙戝竷鏁版嵁鐨勫潗鏍囩郴');
-        } else {
-          strid = this.osgbLasLayer.strid.replace('EPSG:', '')
+        for (var i in this.osgbLasOption) {
+          if (this.osgbLasOption[i].srids) {
+            var epsg = this.osgbLasOption[i].srids.replace('EPSG:', '')
+            srids.push(epsg)
+          } else {
+            lerro.push(this.osgbLasOption[i].name)
+          }
         }
+        if (lerro.length > 0) {
+          return this.$message(lerro + '鏈�夋嫨鍙戝竷鏁版嵁鐨勫潗鏍囩郴');
+        }
+
+        // if (!this.osgbLasLayer.strid) {
+        //   return this.$message('璇烽�夋嫨鍙戝竷鏁版嵁鐨勫潗鏍囩郴');
+        // } else {
+        //   strid = this.osgbLasLayer.strid.replace('EPSG:', '')
+        // }
       }
       var obj = {
         dircode: this.formInline.dirid,
@@ -833,8 +969,8 @@
         noData: null,
         ids: ids,
         models: null,
-        srid: parseInt(strid),
-        z: parseFloat(parseFloat(this.osgbLasLayer.z).toFixed(3))
+        srids: srids,
+        zx: zs
       }
       this.loadDialogVisible = true
       this.setOsgbCanel();
@@ -1002,6 +1138,7 @@
         this.$message("璇烽�夋嫨瑕佸彂甯冪殑鏁版嵁")
         return
       }
+
       if (this.formInline.type == "DOM" || this.formInline.type == "DEM") {
 
         this.insertLayer.name = this.multipleSelection[0].name.split('.')[0];
@@ -1016,14 +1153,49 @@
         this.modelOptions = val;
         this.insertModelVisible = true;
       } else if (this.formInline.type == "OSGB") {
+
+        var val = JSON.parse(JSON.stringify(this.multipleSelection))
+        for (var i in val) {
+          val[i].zs = 0;
+          val[i].srids = null;
+        }
+        this.osgbLasOption = val;
         this.insertOsgbVisible = true;
+
       } else if (this.formInline.type == "LAS") {
+        var lids = [];
+        var val = JSON.parse(JSON.stringify(this.multipleSelection))
+        for (var i in val) {
+          val[i].zs = 0;
+          val[i].srids = null;
+          val[i].lids = false;
+          lids.push('ids=' + val[i].id)
+        }
+
+        var url = lids.join('&')
+        const data1 = await publish_selectLasCs(url);
+
+        if (data1.code != 200) {
+          this.$message('Las鏂囦欢鍧愭爣绯籌D澶辫触');
+        } else {
+          for (var i = 0; i < val.length; i++) {
+            var coord = data1.result[i]
+            if (coord > 0) {
+              val[i].srids = "EPSG:" + coord;
+              val[i].lids = true;
+            }
+          }
+
+        }
+
         const data = await dataUpload_selectCoords();
+
         if (data.code != 200) {
           this.$message('鍧愭爣绯绘暟鎹幏鍙栧け璐�');
         }
         this.stridOption = data.result;
 
+        this.osgbLasOption = val;
         this.insertOsgbVisible = true;
       } else {
         var std = [];
@@ -1221,12 +1393,15 @@
     setPageStart() {
       this.formInline = {
         dirid: null,
+        dirid2: null,
         dirName: null,
+        dirName2: null,
         depid: null,
         verid: null,
         depName: null,
         name: "",
-        type: ""
+        type: "",
+        type1: "All"
       }
       if (this.active == "first") {
         this.listData = {
@@ -1241,7 +1416,10 @@
           pageSize: 10,
           count: 0
         }
-        this.showPageSize = [10, 50, 100, 200]
+        this.showPageSize = [10, 50, 100, 200, 500]
+        this.formInline.type1 = this.typeOption1[0].value;
+        this.formInline.dirid2 = this.dirOption2[0].code;
+        this.formInline.dirName2 = this.dirOption2[0].name;
       }
 
       this.formInline.type = this.typeOption[0].value;
@@ -1255,9 +1433,25 @@
         this.$message.error("鍗曚綅鍒楄〃鑾峰彇澶辫触")
         return
       }
+      var res = JSON.parse(JSON.stringify(data.result));
+      var res_val = res.filter((rs) => {
+        if (rs.pid == 0) {
+          return rs
+        }
+      })
+
+      res_val.unshift({
+        name: '鍏ㄩ儴',
+        id: 'All',
+        pid: 0,
+        code: "All"
+      })
+      this.dirOption2 = this.treeData(res_val)
       this.dirOption = this.treeData(data.result);
       this.formInline.dirid = this.dirOption[0].code;
       this.formInline.dirName = this.dirOption[0].name;
+      this.formInline.dirid2 = this.dirOption2[0].code;
+      this.formInline.dirName2 = this.dirOption2[0].name;
       this.getVerList(this.dirOption[0].id)
     },
     //鑾峰彇鐗堟湰鍒楄〃
@@ -1282,6 +1476,10 @@
       this.formInline.type = value;
       this.getTableData();
     },
+    handleTypeChange1(value) {
+      this.formInline.type1 = value;
+      this.getTableData();
+    },
     //鍗曚綅鍒楄〃鍒囨崲
     handleDepChange(data, node, nodeData) {
       this.formInline.depid = data.code
@@ -1294,6 +1492,16 @@
       this.formInline.dirName = data.name
       this.getVerList(data.id)
     },
+    //鐩綍鍒楄〃鍒囨崲
+    handleDirChange2(data, node, nodeData) {
+      this.formInline.dirid2 = data.code
+      this.formInline.dirName2 = data.name
+      this.getTableData();
+    },
+
+
+
+
     //鑾峰彇Table琛ㄦ牸鏁版嵁
     async getTableData() {
 
@@ -1334,9 +1542,18 @@
         }
       }
       else {
-        if (this.formInline.name) {
-          this.listData.name = this.formInline.name
+        this.listData.name = this.formInline.name
+        if (this.formInline.dirid2 == 'All') {
+          this.listData.dircode = this.formInline.dirid2.replace('All', '');
+        } else {
+          this.listData.dircode = this.formInline.dirid2
         }
+        if (this.formInline.type1 == 'All') {
+          this.listData.type = this.formInline.type1.replace('All', '');
+        } else {
+          this.listData.type = this.formInline.type1
+        }
+
 
         const data = await publish_selectByPage(this.listData);
 
@@ -1488,5 +1705,8 @@
   /deep/.el-dialog__header {
     padding: 10px !important;
   }
+  .contLable {
+    width: 160px;
+  }
 }
 </style>
\ No newline at end of file

--
Gitblit v1.9.3