From dc412901096a7ea7d65d1c7e097d7f9043073d93 Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期一, 21 八月 2023 09:27:56 +0800
Subject: [PATCH] 代码更新

---
 src/views/datamanage/uploadmanage.vue |  529 +++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 483 insertions(+), 46 deletions(-)

diff --git a/src/views/datamanage/uploadmanage.vue b/src/views/datamanage/uploadmanage.vue
index 6af219c..89ed182 100644
--- a/src/views/datamanage/uploadmanage.vue
+++ b/src/views/datamanage/uploadmanage.vue
@@ -32,13 +32,24 @@
       </div>
       <div
         class="tabs_pane"
+        @click="setTabsChange(4)"
+      >
+        <div
+          class="tabsSpan"
+          :class="{ changetabs : active == 'fourth'}"
+        >
+          <span> {{$t('dataManage.uploadObj.publishTask')}}</span>
+        </div>
+      </div>
+      <div
+        class="tabs_pane"
         @click="setTabsChange(3)"
       >
         <div
           class="tabsSpan"
           :class="{ changetabs : active == 'third'}"
         >
-          <span> {{$t('dataManage.uploadObj.modelAttachMount')}}</span>
+          <span> {{$t('dataManage.uploadObj.attachMount')}}</span>
         </div>
       </div>
     </div>
@@ -93,6 +104,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 +150,38 @@
           >
             <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'  || active == 'fourth'">
+          <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"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item v-if="active == 'fourth'">
+          <el-select
+            size="small"
+            v-model="formInline.status"
+            @change="handleTypeChange2"
+            placeholder="璇烽�夋嫨鏁版嵁绫诲埆..."
+          >
+            <el-option
+              v-for="item in typeOption2"
               :key="item.value"
               :label="item.label"
               :value="item.value"
@@ -168,6 +233,7 @@
       <div class="dividing-line"></div>
       <div class="table_box content_Table">
         <el-table
+          v-if="active !='fourth'"
           :data="tableData"
           style="width: 100%"
           @selection-change="handleSelectionChange"
@@ -222,6 +288,7 @@
             key="7"
           />
           <el-table-column
+            v-if="active == 'first'"
             prop="verName"
             :label="$t('dataManage.vmobj.versionNumber')"
             align="center"
@@ -253,6 +320,7 @@
             align="center"
             key="12"
           />
+
           <el-table-column
             v-if="active == 'first'"
             prop="createTime"
@@ -265,6 +333,20 @@
 
             </template>
           </el-table-column>
+          <el-table-column
+            prop="updateName"
+            :label="$t('dataManage.vmobj.updateonuser')"
+            align="center"
+            key="14"
+          />
+          <el-table-column
+            prop="updateTime"
+            :label="$t('dataManage.vmobj.updateontime')"
+            :formatter="formatData"
+            align="center"
+            key="15"
+          />
+
           <el-table-column
             min-width="150"
             :label="$t('common.operate')"
@@ -306,6 +388,92 @@
                 plain
               >宸插彂甯�
 
+              </el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+        <el-table
+          v-if="active ==  'fourth'"
+          :data="tableData"
+          style="width: 100%"
+          height="calc(100% - 1px)"
+          ref="tableBox"
+        >
+          <!-- <el-table-column
+            prop="name"
+            :label="$t('dataManage.vmobj.name')"
+            align="center"
+            key="1"
+          ></el-table-column> -->
+          <el-table-column
+            prop="name"
+            :label="$t('dataManage.vmobj.name')"
+            align="center"
+            key="3"
+          ></el-table-column>
+          <el-table-column
+            prop="status"
+            :label="$t('dataManage.styleObj.status')"
+            align="center"
+            key="4"
+            :formatter="stateFormatStatus"
+          ></el-table-column>
+          <el-table-column
+            prop="type"
+            :label="$t('dataManage.styleObj.type')"
+            align="center"
+            key="5"
+          ></el-table-column>
+          <el-table-column
+            prop="descr"
+            :label="$t('dataManage.styleObj.descr')"
+            align="center"
+            key="6"
+          ></el-table-column>
+          <el-table-column
+            prop="err"
+            :label="$t('common.err')"
+            align="center"
+            key="7"
+          ></el-table-column>
+          <el-table-column
+            prop="createName"
+            :label="$t('common.rublisher')"
+            align="center"
+            key="8"
+          />
+          <el-table-column
+            prop="createTime"
+            :label="$t('common.releaseTime')"
+            :formatter="formatData"
+            align="center"
+            key="9"
+          />
+          <el-table-column
+            prop="updateName"
+            :label="$t('dataManage.vmobj.updateonuser')"
+            align="center"
+            key="10"
+          />
+          <el-table-column
+            prop="updateTime"
+            :label="$t('dataManage.vmobj.updateontime')"
+            :formatter="formatData"
+            align="center"
+            key="11"
+          />
+          <el-table-column
+            min-width="80"
+            :label="$t('common.operate')"
+          >
+            <template slot-scope="scope">
+              <el-button
+                v-if="scope.row.status == '1'"
+                size="small"
+                type="danger"
+                plain
+                @click="setCannelTask(scope.row)"
+              >{{$t('common.endTask')}}
               </el-button>
             </template>
           </el-table-column>
@@ -583,7 +751,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,29 +799,35 @@
     <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; justify-content: center; align-items: center; "
         >
-          <el-form-item :label="$t('dataManage.vmobj.heightOffset')">
+
+          <div style=" text-align: center; ">
+            {{ item.name }}
+          </div>
+          <!-- <div style="display: flex; align-items: center; margin: 0px 10px;">
+            <label class="contLable">楂樺害鍋忕Щ閲忥細</label>
             <el-input
-              :placeholder="$t('dataManage.vmobj.label1')"
-              v-model="osgbLasLayer.z"
-            ></el-input>
-          </el-form-item>
-          <el-form-item
-            v-if="formInline.type == 'LAS'"
-            :label="$t('dataManage.vmobj.coordinateSystemID')"
-          >
+              size="small"
+              v-model="item.zs"
+            >
+              <i slot="suffix">m</i></el-input>
+          </div>
+          <div style="display: flex;  align-items: center; ">
+            <label class="contLable">鍧愭爣绯伙細</label>
             <el-select
-              v-model="osgbLasLayer.strid"
-              :placeholder="$t('dataManage.vmobj.label2')"
+              v-if="!item.lids"
+              v-model="item.srids"
               style="width: 100%;"
+              size="small"
             >
               <el-option
                 v-for="item in stridOption"
@@ -660,8 +837,14 @@
               >
               </el-option>
             </el-select>
-          </el-form-item>
-        </el-form>
+            <el-input
+              v-if="item.lids"
+              v-model="item.srids"
+              size="small"
+              disabled
+            ></el-input>
+          </div> -->
+        </div>
         <div style="display: flex; justify-content: end;margin-top:10px;">
           <el-button
             size="small"
@@ -691,7 +874,7 @@
       <div
         v-loading="true"
         element-loading-background="rgba(0, 0, 0, 0.0) "
-        element-loading-text="鏁版嵁鍙戝竷涓�"
+        :element-loading-text="loadingText"
         style="margin: 0px 20px;widht:100%;height:calc(100% - 80px); "
       >
       </div>
@@ -714,7 +897,10 @@
   publish_deletes,
   publish_update,
   publish_insert,
-  dataUpload_selectCoords
+  dataUpload_selectCoords,
+  publish_selectLasCs,
+  task_selectByPageAndCount,
+  task_deleteTask
 } from '../../api/api.js'
 import { conditions } from '../Archive/Archive';
 
@@ -728,12 +914,16 @@
       active: 'first',
       formInline: {
         dirid: null,
+        dirid2: null,
         dirName: null,
+        dirName2: null,
         depid: null,
         verid: null,
         depName: null,
         name: "",
-        type: ""
+        type: "",
+        type1: "All",
+        status: 'All'
       },
       listData: {
         pageIndex: 1,
@@ -743,6 +933,7 @@
       multipleSelection: [],
       tableData: [],
       depOption: [],
+      dirOption2: [],
       dirOption: [],
       verOption: [],
       modelOptions: [],
@@ -771,6 +962,53 @@
         value: 'BIM',
         label: '涓夌淮妯″瀷(.fbx, .ifc, .rvt)'
       }],
+      typeOption1: [{
+        value: 'All',
+        label: '鍏ㄩ儴'
+      }, {
+        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)'
+      }],
+      typeOption2: [{
+        label: '鍏ㄩ儴',
+        value: 'All'
+      }, {
+        label: '鏈紑濮�',
+        value: 0
+      }, {
+        label: '杩涜涓�',
+        value: 1
+      }, {
+        label: '姝e父缁撴潫',
+        value: 2
+      }, {
+        label: '鐢ㄦ埛缁撴潫',
+        value: 3
+      }, {
+        label: '杩愯鍑洪敊',
+        value: 4
+      }],
       defaultProps: {
         label: "name",
         value: "id",
@@ -798,9 +1036,12 @@
         strid: ''
       },
       stridOption: [],
+      osgbLasOption: [],
+      loadingText: '鏁版嵁鍙戝竷涓�'
     }
   },
   methods: {
+
     setOsgbCanel() {
       this.insertOsgbVisible = false;
       this.osgbLasLayer = {
@@ -811,31 +1052,54 @@
     async setOsgbInsert() {
 
       var ids = [];
-      for (var i in this.multipleSelection) {
-        ids.push(this.multipleSelection[i].id)
+      var zs = []
+      var models = []
+      var srids = [];
+      var lerro = [];
+      for (var i in this.osgbLasOption) {
+        ids.push(this.osgbLasOption[i].id)
+        // zs.push(this.osgbLasOption[i].zs)
+        zs.push(0)
+        srids.push(0)
+        models.push(0)
       }
-      var strid;
+      var name = this.osgbLasOption[0].name
 
       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)
+          //   srids.push("00")
+          // } else {
+          //   lerro.push(this.osgbLasOption[i].name)
+          // }
+          srids.push(0)
         }
+        // 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,
         depcode: this.formInline.depid,
-        min: null,
-        max: null,
-        name: null,
+        min: 0,
+        max: 0,
+        name: name,
         type: this.formInline.type,
-        noData: null,
+        noData: 0,
         ids: ids,
-        models: null,
-        srid: parseInt(strid),
-        z: parseFloat(parseFloat(this.osgbLasLayer.z).toFixed(3))
+        models: models,
+        srids: [],
+        zs: zs
       }
+      this.loadingText = '鏁版嵁鍙戝竷涓�';
       this.loadDialogVisible = true
       this.setOsgbCanel();
       const data = await publish_insert(obj);
@@ -889,6 +1153,7 @@
         models: models
 
       }
+      this.loadingText = '鏁版嵁鍙戝竷涓�';
       this.loadDialogVisible = true
       this.insertModelVisible = false;
 
@@ -928,7 +1193,9 @@
       this.options = std;
     },
     setloadDialogVisible() {
-      this.loadDialogVisible = false
+
+      this.loadDialogVisible = false;
+      this.loadingText = '鏁版嵁鍙戝竷涓�';
     },
     setinsertLayerCancel() {
       this.insertDialogVisible = false;
@@ -979,6 +1246,7 @@
         type: this.formInline.type,
         noData: this.insertLayer.noData
       }
+      this.loadingText = '鏁版嵁鍙戝竷涓�';
       this.loadDialogVisible = true
       this.insertDialogVisible = false;
 
@@ -1002,6 +1270,7 @@
         this.$message("璇烽�夋嫨瑕佸彂甯冪殑鏁版嵁")
         return
       }
+
       if (this.formInline.type == "DOM" || this.formInline.type == "DEM") {
 
         this.insertLayer.name = this.multipleSelection[0].name.split('.')[0];
@@ -1016,14 +1285,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 = [];
@@ -1037,7 +1341,7 @@
           ids: std,
           type: this.formInline.type
         }
-
+        this.loadingText = '鏁版嵁鍙戝竷涓�';
         this.loadDialogVisible = true
         this.insertDialogVisible = false;
 
@@ -1094,6 +1398,24 @@
           });
       }
     },
+
+    async setCannelTask(res) {
+
+      const data = await task_deleteTask({ id: res.id })
+      if (data.result == 200) {
+        this.$message({
+          message: '浠诲姟缁撴潫鎴愬姛',
+          type: 'success'
+        });
+      } else {
+        this.$message.error({
+          message: '浠诲姟缁撴潫澶辫触',
+        });
+      }
+      this.getTableData();
+
+    },
+
     //淇敼寮圭獥
     setPreviewEdit(res) {
       this.updateLayer = JSON.stringify(res) //澶囦唤;
@@ -1108,6 +1430,7 @@
         var that = this
         this.$confirm('纭畾鏄惁鍒犻櫎鎵�閫夊唴瀹�?')
           .then(_ => {
+
             that.deletePage()
           })
           .catch(_ => {
@@ -1116,6 +1439,8 @@
       }
     },
     async deletePage() {
+      this.loadingText = '鏁版嵁鍒犻櫎涓�';
+      this.loadDialogVisible = true;
       var std = [];
       for (var i in this.multipleSelection) {
         std.push(this.multipleSelection[i].id);
@@ -1131,6 +1456,7 @@
         });
         this.getTableData();
       }
+      this.loadDialogVisible = false;
     },
     //棰勮寮圭獥鎵撳紑
     setPreviewLayer(res) {
@@ -1160,6 +1486,26 @@
         return val + " GB"
       } else {
         return row.sizes + " MB"
+      }
+    },
+    stateFormatStatus(row, column) {
+
+      switch (row.status) {
+        case 0:
+          return '鏈紑濮�';
+          break;
+        case 1:
+          return '杩涜涓�';
+          break;
+        case 2:
+          return '姝e父缁撴潫';
+          break;
+        case 3:
+          return '鐢ㄦ埛缁撴潫';
+          break;
+        case 4:
+          return '杩愯鍑洪敊';
+          break;
       }
     },
     //鏍煎紡鍖栧湴鍧�
@@ -1207,6 +1553,10 @@
           }
           this.active = 'third';
           break;
+        case 4:
+          this.active = 'fourth';
+          this.setPageStart();
+          break;
 
 
 
@@ -1221,14 +1571,25 @@
     setPageStart() {
       this.formInline = {
         dirid: null,
+        dirid2: null,
         dirName: null,
+        dirName2: null,
         depid: null,
         verid: null,
         depName: null,
         name: "",
-        type: ""
+        type: "",
+        type1: "All",
+        status: 'All'
       }
       if (this.active == "first") {
+        this.listData = {
+          pageIndex: 1,
+          pageSize: 10,
+          count: 0
+        }
+        this.showPageSize = [10, 50, 100, 200]
+      } if (this.active == "fourth") {
         this.listData = {
           pageIndex: 1,
           pageSize: 10,
@@ -1241,7 +1602,14 @@
           pageSize: 10,
           count: 0
         }
-        this.showPageSize = [10, 50, 100, 200]
+        this.showPageSize = [10, 50, 100, 200, 500]
+        this.formInline.type1 = this.typeOption1[0].value;
+        if (this.dirOption2.length > 0) {
+          this.formInline.dirid2 = this.dirOption2[0].code;
+
+          this.formInline.dirName2 = this.dirOption2[0].name;
+        }
+
       }
 
       this.formInline.type = this.typeOption[0].value;
@@ -1255,9 +1623,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)
     },
     //鑾峰彇鐗堟湰鍒楄〃
@@ -1273,13 +1657,22 @@
     },
     //鐗堟湰鍒楄〃鍒囨崲
     handleVerChange(value) {
-
       this.formInline.verid = value;
       this.getTableData();
     },
     //鏈嶅姟绫诲瀷鍒楄〃鍒囨崲
     handleTypeChange(value) {
       this.formInline.type = value;
+      this.getTableData();
+    },
+    handleTypeChange1(value) {
+      this.formInline.type1 = value;
+      this.getTableData();
+    },
+
+
+    handleTypeChange2(value) {
+      this.formInline.status = value;
       this.getTableData();
     },
     //鍗曚綅鍒楄〃鍒囨崲
@@ -1293,6 +1686,12 @@
       this.formInline.dirid = data.code
       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() {
@@ -1332,11 +1731,45 @@
           this.tableData = val;
           this.listData.count = data.count;
         }
-      }
-      else {
-        if (this.formInline.name) {
-          this.listData.name = this.formInline.name
+      } else if (this.active == "fourth") {
+        if (this.formInline.status == 'All') {
+          this.listData.status = null;
+
+        } else {
+          this.listData.status = this.formInline.status
         }
+
+        if (this.formInline.type1 == 'All') {
+          this.listData.type = null;
+        } else {
+          this.listData.type = this.formInline.type1
+        }
+
+        if (this.formInline.name) {
+          this.listData.name = this.formInline.name;
+        }
+        this.tableData = [];
+        const data = await task_selectByPageAndCount(this.listData)
+        if (data.code != 200) {
+
+        }
+        this.tableData = data.result;
+        this.listData.count = data.count;
+
+
+      } else {
+        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 +1921,9 @@
   /deep/.el-dialog__header {
     padding: 10px !important;
   }
+  .contLable {
+    width: 140px;
+    text-align: right;
+  }
 }
 </style>
\ No newline at end of file

--
Gitblit v1.9.3