From c2a6c53657baaf0830cd881e1a23a15af23ac6fa Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期四, 21 九月 2023 18:35:14 +0800
Subject: [PATCH] 代码更新

---
 src/components/MapView/mapMenuPop.vue | 1013 ++++++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 750 insertions(+), 263 deletions(-)

diff --git a/src/components/MapView/mapMenuPop.vue b/src/components/MapView/mapMenuPop.vue
index adf0b5a..0afb133 100644
--- a/src/components/MapView/mapMenuPop.vue
+++ b/src/components/MapView/mapMenuPop.vue
@@ -1,6 +1,12 @@
 <template>
   <div class="menuPop">
     <div class="leftBox">
+      <!-- v-if="$store.state.download" -->
+      <div class="leftDown">
+        <div @click="getDownloadDep">
+          <el-link icon="el-icon-download"> </el-link>
+        </div>
+      </div>
       <ul>
         <li
           v-for="(item, index) in option"
@@ -12,25 +18,13 @@
       </ul>
     </div>
     <div class="rightBox">
-      <div class="rightTitle">
-        <span>绠¢亾</span>
-        <el-link @click="closeMenuBox" :underline="false" class="boxClose"
-          ><i class="el-icon-close"></i>
-        </el-link>
-        <el-link
-          :underline="false"
-          v-show="$store.state.download"
-          @click="dialogVisible = true"
-          class="boxClose"
-          ><i class="el-icon-download"></i>
-        </el-link>
-      </div>
       <div class="tableBox">
         <el-table
           :data="tableData"
           ref="dialogPayChannel"
-          height="230px"
+          height="100%"
           style="width: 100%"
+          border
         >
           <el-table-column
             align="center"
@@ -38,11 +32,15 @@
             label="搴忓彿"
             width="50"
           />
-          <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"
-                size="mini"
+                size="small"
                 @click="spaceLocation(scope.$index, scope.row)"
               ></el-button>
             </template>
@@ -57,12 +55,15 @@
           ></el-table-column>
         </el-table>
       </div>
-      <div class="pagination_box">
+      <div
+        class="pagination_box"
+        style="margin-top: 10px"
+      >
         <el-pagination
           @size-change="handleSizeChange"
           @current-change="handleCurrentChange"
           :current-page="listdata.pageIndex"
-          :page-sizes="[10, 20, 30, 40]"
+          :page-sizes="[10, 20, 50, 100]"
           :page-size="listdata.pageSize"
           layout="total, sizes, prev, pager, next, jumper"
           :total="pageCount"
@@ -85,14 +86,20 @@
         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"
@@ -104,14 +111,18 @@
             class="primary"
             size="small"
             @click="download('codeForm')"
-            >{{ $t('common.confirm') }}</el-button
-          >
-          <el-button type="info" size="small" @click="closeDown('codeForm')">{{
-            $t('common.cancel')
+          >{{ $t("common.confirm") }}</el-button>
+          <el-button
+            type="info"
+            size="small"
+            @click="closeDown('codeForm')"
+          >{{
+            $t("common.cancel")
           }}</el-button>
         </el-form-item>
       </el-form>
     </el-dialog>
+
     <iframe
       id="Iframe1"
       src=""
@@ -128,45 +139,69 @@
   dataQuerySelectWktById,
   sign_getPublicKey,
   dataLib_selectDownloadFile,
+  dataQuery_selectDbOverflowDep,
+  apply_insertApply,
   decr,
-} from '../../api/api.js';
-import { getToken } from '@/utils/auth';
-import $ from 'jquery';
+  encr,
+  dataLib_selectDepsByIds,
+  dataLib_selectDbOverflowDep
+} from "../../api/api.js"
+import { getToken } from "@/utils/auth"
+import $ from "jquery"
+import { View } from "ol"
 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();
+        callback()
       }
-    };
+    }
     var passwordValidator = (rule, value, callback) => {
       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}$/;
+        /^(?![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();
+        callback()
       }
-    };
+    }
     return {
+      ruleForm: {
+        depname: [],
+        tabs: [],
+        pwd: null,
+        repwd: null,
+        wkt: null,
+        descr: null,
+      },
       dialogVisible: false,
+      dialogInsertVisible: false,
+      insertFlag: null,
       codeForm: {
-        password: '',
-        repassword: '',
+        password: "",
+        repassword: "",
       },
       rules: {
         password: [
-          { required: true, message: '璇疯緭鍏ュ瘑鐮�', trigger: 'blur' },
-          { validator: passwordValidator, trigger: 'blur' },
+          { 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" },
         ],
+      },
+      insertOption: {
+        ids: [],
+        pwd: null,
+        tabs: [],
+        entity: [],
+        wkt: null,
+        descr: null,
       },
       listPage: {
         pageSize: 10,
@@ -190,106 +225,343 @@
       domainsLayer: [],
       optionx: [],
       imagePoint: null,
-    };
+      Layerprimit: null,
+      insertOption: null,
+      isflag: true,
+    }
   },
   methods: {
+    getInsertDown(res) {
+
+      // this.dialogInsertVisible = false
+      // this.dialogVisible = true
+      if (this.isflag) {
+        this.codeForm = res;
+        this.download1();
+        this.isflag = false
+      }
+
+    },
+    handleInsertClose() {
+      this.$confirm("纭鍏抽棴锛�")
+        .then(_ => {
+          this.closeInsertDown()
+        })
+        .catch(_ => { })
+    },
+    closeInsertDown() {
+      this.ruleForm = {
+        depname: [],
+        tabs: [],
+        pwd: null,
+        repwd: null,
+        wkt: null,
+        descr: null,
+      }
+      this.dialogInsertVisible = false
+    },
+    async getDownloadDep() {
+      this.$bus.$emit("setDialogInsertVisible", true)
+
+      // var std = []
+      // for (var i in this.option) {
+      //   std.push(this.option[i].entity)
+      // }
+      // var obj = {
+      //   entities: std,
+      //   wkt: this.listdata.wkt,
+      // }
+      // const data = await dataQuery_selectDbOverflowDep(JSON.stringify(obj))
+      // if (data.code != 200) {
+      //   this.$message.error("鏁版嵁璇锋眰澶辫触")
+      //   return
+      // }
+
+      // if (data.result.length == 0 || data.result == null) {
+      //   this.insertFlag = 1
+      //   // this.dialogVisible = true
+      //   
+      // } else {
+      //   this.insertFlag = 2
+      //   var std = []
+      //   this.insertOption.ids = data.result
+      //   var val = ""
+      //   for (var i in data.result) {
+      //     if (val == "") {
+      //       val += "codes=" + data.result[i]
+      //     } else {
+      //       val += "&codes=" + data.result[i]
+      //     }
+
+      //     std.push({
+      //       name: data.result[i],
+      //     })
+      //   }
+      //   const data1 = await dataLib_selectDepsByIds(val)
+
+      //   this.ruleForm.depid = data1.result
+      //   this.ruleForm.depname = std
+      //   this.ruleForm.wkt = decr(this.listdata.wkt)
+      //   this.ruleForm.tabs = this.option
+      //   // this.dialogInsertVisible = true
+      //   this.$bus.$emit("setDialogInsertVisible", this.ruleForm)
+      // }
+    },
     async signGetPublicKey() {
-      const res = await sign_getPublicKey();
+      const res = await sign_getPublicKey()
       if (res && res.code == 200) {
-        window.encrypt = new JSEncrypt();
-        encrypt.setPublicKey(res.result);
+        window.encrypt = new JSEncrypt()
+        encrypt.setPublicKey(res.result)
       }
     },
-    download() {
-      if (this.codeForm.password == '') return;
+    async download1() {
+      if (this.codeForm.password == "") return
+
+      var entities = [];
+      for (var i in this.option) {
+        entities.push(this.option[i].entity)
+      }
       var obj = {
         pwd: encrypt.encrypt(this.codeForm.password),
-        entities: [],
+        entities: entities,
         wkt: this.listdata.wkt,
-      };
-      for (var i in this.option) {
-        obj.entities.push(this.option[i].entity);
+        filter: null,
+        ids: null,
+        depcode: null,
+        dirs: null
       }
-      var token = getToken();
-      var that = this;
-      $.ajax(BASE_URL + '/dataLib/downloadDbReq?token=' + token, {
-        type: 'post',
-        data: JSON.stringify(obj),
-        async: true,
-        cache: false,
-        processData: false,
-        contentType: false,
-        success: (res) => {
-          if (res.code != 200) {
-            return;
+      const data = await dataLib_selectDbOverflowDep(obj)
+      if (data.code != 200) {
+        return
+      }
+
+      if (data.result.length == 0) {
+        var that = this;
+
+        $.ajax({
+          url: BASE_URL + "/dataLib/downloadDbData?token=" + getToken(),
+          type: "POST",
+          data: JSON.stringify(obj),
+          dataType: 'json', // html銆乯son銆乯sonp銆乻cript銆乼ext
+          contentType: "application/json", // "application/x-www-form-urlencoded"
+          success: (data) => {
+            if (data.code == 200) {
+
+              if (data.result) {
+                that.selectDownloadFile(data.result, obj.pwd)
+              }
+
+            }
+          },
+          error: function (e) {
           }
-          this.selectDownloadFile(res.result, obj.pwd);
-        },
-      });
+        });
+      } else {
+
+        var val = ""
+        var std = [];
+        for (var i in data.result) {
+          if (val == "") {
+            val += "codes=" + data.result[i]
+          } else {
+            val += "&codes=" + data.result[i]
+          }
+
+          std.push({
+            name: data.result[i],
+          })
+        }
+        const data1 = await dataLib_selectDepsByIds(val)
+        this.ruleForm.depid = data1.result
+        this.ruleForm.depname = std
+        this.ruleForm.wkt = decr(this.listdata.wkt)
+        this.ruleForm.tabs = this.option
+        this.$bus.$emit("setDialogInsertVisible", this.ruleForm)
+      }
+
+      // if (this.insertFlag == 1) {
+
+      //   for (var i in this.option) {
+      //     obj.entities.push(this.option[i].entity)
+      //   }
+      //   var token = getToken()
+      //   var that = this
+      //   $.ajax(BASE_URL + "/dataLib/downloadDbReq?token=" + token, {
+      //     type: "post",
+      //     data: JSON.stringify(obj),
+      //     async: true,
+      //     cache: false,
+      //     processData: false,
+      //     contentType: false,
+      //     success: res => {
+      //       if (res.code != 200) {
+      //         return
+      //       }
+
+      //       this.selectDownloadFile(res.result, obj.pwd)
+      //     },
+      //   })
+      // } else if (this.insertFlag == 2) {
+      //   var std = []
+      //   var std1 = []
+      //   for (var i in this.option) {
+      //     std.push(this.option[i].tabDesc)
+      //     std1.push(this.option[i].entity)
+      //   }
+      //   var obj = {
+      //     depcodes: this.insertOption.ids,
+      //     pwd: encr(this.codeForm.password),
+      //     tabs: std,
+      //     entities: std1,
+      //     wkt: this.listdata.wkt,
+      //     descr: this.ruleForm.descr,
+      //   }
+      //   const data1 = await apply_insertApply(JSON.stringify(obj))
+
+      //   this.closeDown()
+      // }
     },
+    async getInsertApply(res) {
+
+      if (!this.isflag) {
+        var entities = [];
+        var tabs = [];
+        if (this.option.length != res.tabs.length) {
+          return
+        }
+
+        for (var i in this.option) {
+          entities.push(this.option[i].entity)
+          tabs.push(this.option[i].tabDesc)
+        }
+        var std = [];
+        for (var i in this.ruleForm.depname) {
+          std.push(this.ruleForm.depname[i].name)
+        }
+        var obj = {
+          pwd: encr(this.codeForm.password),
+          entities: entities,
+          wkt: this.listdata.wkt,
+          filter: null,
+          ids: null,
+          depcode: null,
+          dirs: null,
+          depcodes: std,
+          descr: res.descr,
+          tabs: tabs
+        }
+        const data = await apply_insertApply(JSON.stringify(obj))
+        if (data.code != 200) {
+          this.$message.error("鏁版嵁鐢宠澶辫触")
+          return
+        }
+        this.$message({
+          message: "鏁版嵁鐢宠鎴愬姛",
+          type: "success",
+        })
+        this.isflag = true;
+      }
+    },
+
+
+
+
     async selectDownloadFile(rsid, rspwd) {
       var downObj = {
         guid: rsid,
         pwd: encodeURIComponent(rspwd),
-      };
-      const data = await dataLib_selectDownloadFile(downObj);
-      if (data.code != 200) {
-        this.$message.error('涓嬭浇璇锋眰澶辫触');
-        return;
       }
-      this.closeDown();
-      var token = getToken();
+      const data = await dataLib_selectDownloadFile(downObj)
+
+      if (data.code != 200) {
+        this.$message.error("涓嬭浇璇锋眰澶辫触")
+        return
+      }
+
+      this.closeDown()
+      var token = getToken()
       var url =
         BASE_URL +
-        '/dataLib/downloadFile?token=' +
+        "/dataLib/downloadFile?token=" +
         token +
-        '&guid=' +
+        "&guid=" +
         rsid +
-        '&pwd=' +
-        encodeURIComponent(rspwd);
-      $('#Iframe1').attr('src', url).click();
+        "&pwd=" +
+        encodeURIComponent(rspwd)
+      $("#Iframe1").attr("src", url).click()
+      // this.isflag = true;
     },
     handleCloseDown() {
-      this.$confirm('纭鍏抽棴锛�')
-        .then((_) => {
-          this.closeDown();
+      this.$confirm("纭鍏抽棴锛�")
+        .then(_ => {
+          this.closeDown()
         })
-        .catch((_) => {});
+        .catch(_ => { })
     },
     closeDown() {
-      this.dialogVisible = false;
-      this.codeForm.password = '';
-      this.codeForm.repassword = '';
+      this.dialogVisible = false
+      this.codeForm.password = ""
+      this.codeForm.repassword = ""
+      // this.closeInsertDown()
     },
     startTableMssage() {
-      this.listdata.pageIndex = 1;
-      this.listdata.pageSize = 10;
-      this.listdata.name = null;
-      this.option = [];
+      this.listdata.pageIndex = 1
+      this.listdata.pageSize = 10
+      this.listdata.name = null
+      this.option = []
+    },
+    clearQuerInfo() {
+      if (this.$store.state.queryInfo.length != 0) {
+        sgworld.Creator.SimpleGraphic.clear()
+        for (var i in this.$store.state.queryInfo) {
+          sgworld.Viewer.entities.remove(this.$store.state.queryInfo[i])
+        }
+        this.$store.state.queryInfo = []
+        if (this.$store.state.primitLayer != null) {
+          sgworld.Viewer.entities.remove(this.$store.state.primitLayer)
+          sgworld.Creator.DeleteObject(this.$store.state.primitLayer)
+          this.$store.state.primitLayer = null
+        }
+      }
     },
     setTableAll() {
-      this.signGetPublicKey();
-      this.startTableMssage();
-      this.listdata.wkt = this.$store.state.mapMenuShpFile;
-      this.querylayer = this.$store.state.mapSpaceQueryLayer;
-      this.option = this.$store.state.mapSpaceQueryLayer;
-      this.listdata.name = this.option[0].entity;
+      this.clearQuerInfo()
+      this.signGetPublicKey()
+      this.startTableMssage()
+      this.listdata.wkt = this.$store.state.mapMenuShpFile
+      this.querylayer = this.$store.state.mapSpaceQueryLayer
+      //  = this.$store.state.mapSpaceQueryLayer;
+      var arr = this.$store.state.mapSpaceQueryLayer
+      var obj = {}
+      arr = arr.reduce(function (item, next) {
+        obj[next.label] ? "" : (obj[next.label] = true && item.push(next))
+        return item
+      }, [])
+      this.option = arr
+      this.listdata.name = this.option[0].entity
 
-      this.getTableDateHidder();
+      this.getTableDateHidder()
     },
     async getTableDateHidder() {
-      const data = await inquiry_selectFields({ name: this.listdata.name });
+      this.$store.state.loading = true;
+      const data = await inquiry_selectFields({ name: this.listdata.name })
       if (data.code != 200) {
-        this.$message.error('鍒楄〃璋冪敤澶辫触');
+        this.$message.error("鍒楄〃璋冪敤澶辫触")
       }
-      const data1 = await inquiry_selectDomains({ name: this.listdata.name });
+      if (data.result.length == 0) {
+        this.$message("鍒楄〃瀛楁鏌ユ棤鏁版嵁")
+      }
+      const data1 = await inquiry_selectDomains({ name: this.listdata.name })
       if (data1.code != 200) {
-        this.$message.error('鍒楄〃璋冪敤澶辫触');
+        this.$message.error("鍒楄〃璋冪敤澶辫触")
       }
-      this.optionx = [];
-      this.attributeData = [];
-      var valadata = data.result;
-      var laydomain = data1.result;
+      // if (data.result.length == 0) {
+      //   this.$message("鍒楄〃闃堝�兼煡鏃犳暟鎹�")
+      // }
+      this.optionx = []
+      this.attributeData = []
+      var valadata = data.result
+      var laydomain = data1.result
 
       for (var i in valadata) {
         if (valadata[i].showtype == 1) {
@@ -299,113 +571,412 @@
           ) {
             for (var j in laydomain) {
               if (laydomain[j].domName == valadata[i].domainNa) {
-                valadata[i].domainNa = laydomain[j].codeDesc;
+                valadata[i].domainNa = laydomain[j].codeDesc
               }
             }
           }
-          this.optionx.push(valadata[i]);
-          this.attributeData.push(valadata[i]);
+          this.optionx.push(valadata[i])
+          this.attributeData.push(valadata[i])
         }
       }
-      this.getTableData();
+      this.getTableData()
     },
     async spaceLocation(index, row) {
       var param = {
         gid: row.gid,
         name: this.listdata.name,
-      };
-      const data = await dataQuerySelectWktById(param);
-      if (data.code != 200) {
-        this.$message.error('鍒楄〃璋冪敤澶辫触');
       }
-
-      var val1 = decr(data.result);
+      const data = await dataQuerySelectWktById(param)
+      if (data.code != 200) {
+        this.$message.error("鍒楄〃璋冪敤澶辫触")
+      }
+      // if (data.result.length == 0) {
+      //   return this.$message.error("鍒楄〃鏌ユ棤鏁版嵁")
+      // }
+      var val1 = decr(data.result)
       if (val1) {
         if (this.imagePoint != null) {
-          sgworld.Creator.DeleteObject(this.imagePoint);
-          this.imagePoint = null;
+          sgworld.Creator.DeleteObject(this.imagePoint)
+          this.imagePoint = null
         }
-        var wkt = this.$wkt.parse(val1);
-        this.setMapLoaction(wkt);
+        var wkt = this.$wkt.parse(val1)
+        this.setMapLoaction(wkt, row)
       }
     },
-    setMapLoaction(res) {
-      var coord = res.coordinates;
-      if (res.type == 'Point') {
-        this.imagePoint = sgworld.Creator.CreateLabel(
-          { X: coord[0], Y: coord[1], Altitude: 2000 },
-          '',
-          SmartEarthRootUrl + 'Workers/image/mark.png',
-          {
-            disableDepthTestDistance: Infinity,
-            scale: 0.8,
-          },
-          0,
-          '宸℃鐐�'
-        );
-        sgworld.Navigate.flyToObj(this.imagePoint.item);
+    setMapLoaction(res, properties) {
+      if (this.$store.state.primitLayer != null) {
+        sgworld.Creator.DeleteObject(this.$store.state.primitLayer)
+        // this.$store.state.primitLayer = null;
+        sgworld.Viewer.entities.remove(this.$store.state.primitLayer)
+        this.$store.state.primitLayer = null
       }
+      var coord = res.coordinates
+
+      switch (res.type) {
+        case "Point":
+          var val = Cesium.Cartesian3.fromDegrees(
+            res.coordinates[0],
+            res.coordinates[1]
+          )
+          var point = Viewer.entities.add({
+            properties: properties,
+            tag: "properties_point",
+            position: val,
+            billboard: {
+              // 鍥惧儚鍦板潃锛孶RI鎴朇anvas鐨勫睘鎬�
+              image: SmartEarthRootUrl + "Workers/image/mark.png",
+              heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
+              // 澶у皬鏄惁浠ョ背涓哄崟浣�
+              sizeInMeters: false,
+              // 鐩稿浜庡潗鏍囩殑鍨傜洿浣嶇疆
+              verticalOrigin: Cesium.VerticalOrigin.CENTER,
+              // 鐩稿浜庡潗鏍囩殑姘村钩浣嶇疆
+              horizontalOrigin: Cesium.HorizontalOrigin.LEFT,
+              // 搴旂敤浜庡浘鍍忕殑缁熶竴姣斾緥銆傛瘮渚嬪ぇ浜庝細1.0鏀惧ぇ鏍囩锛岃�屾瘮渚嬪皬浜庝細1.0缂╁皬鏍囩銆�
+              scale: 1.0,
+              // 鏄惁鏄剧ず
+              show: true,
+            },
+          })
+          point.billboard.disableDepthTestDistance = Number.POSITIVE_INFINITY
+          this.$store.state.queryInfo.push(point)
+          sgworld.Navigate.flyToObj(point)
+          this.$store.state.primitLayer = point
+
+          break
+        case "LineString":
+        case "MultiLineString":
+          var line = res.coordinates[0]
+          var std = []
+          for (var i in line) {
+            std.push(line[i][0], line[i][1])
+          }
+          var polyline = Viewer.entities.add({
+            properties: properties,
+            tag: "properties_line",
+            polyline: {
+              positions: Cesium.Cartesian3.fromDegreesArray(std),
+              width: 5,
+              material: new Cesium.Color(1.0, 0.0, 0.0, 0.3),
+              clampToGround: true,
+            },
+          })
+          this.$store.state.queryInfo.push(polyline)
+          sgworld.Navigate.flyToObj(polyline)
+          this.$store.state.primitLayer = polyline
+          break
+        case "MultiPolygon":
+          var val = res.coordinates[0][0]
+          var std = []
+          for (var i in val) {
+            std.push(val[i][0], val[i][1])
+          }
+          var entity = Viewer.entities.add({
+            properties: properties,
+            tag: "properties_polygon",
+            polygon: {
+              hierarchy: Cesium.Cartesian3.fromDegreesArray(std),
+              //height : 100000,
+              material: new Cesium.Color(1.0, 0.0, 0.0, 0.3),
+              outline: true,
+              outlineColor: new Cesium.Color(1.0, 0.0, 0.0, 0.3),
+            },
+          })
+          this.$store.state.queryInfo.push(entity)
+          sgworld.Navigate.flyToObj(entity)
+          this.$store.state.primitLayer = entity
+          break
+      }
+      this.setMapHandler()
+    },
+    setMapHandler() {
+      window.propertieshandler = new Cesium.ScreenSpaceEventHandler(
+        sgworld.Viewer.scene.canvas
+      )
+      window.propertieshandler.setInputAction(event => {
+        let pick = sgworld.Viewer.scene.pick(event.position)
+        if (pick && pick.id && pick.id.tag && pick.id.tag.includes('properties_')) {
+          this.$store.state.propertiesFlag = "1"
+          let properties = pick.id.properties
+          let propertyNames = pick.id.properties.propertyNames
+
+          let obj = {}
+          obj["eventid"] = properties["_eventid"]._value
+          //
+          this.attributeData.forEach(item => {
+            propertyNames.forEach(itemElement => {
+              if (itemElement == item.field) {
+                obj[item.alias] = properties[itemElement]._value
+              }
+            })
+          })
+
+          this.$store.state.propertiesInfo = obj
+        }
+      }, Cesium.ScreenSpaceEventType.LEFT_CLICK)
     },
     setTableChange(res) {
-      this.listdata.pageIndex = 1;
-      this.listdata.pageSize = 10;
-      this.listdata.name = res.entity;
-      this.getTableDateHidder();
+      this.listdata.pageIndex = 1
+      this.listdata.pageSize = 10
+      this.listdata.name = res.entity
+
+      this.$store.state.propertiesName = res
+      this.getTableDateHidder()
     },
     handleSizeChange(val) {
-      this.listdata.pageIndex = 1;
-      this.listdata.pageSize = val;
-      this.getTableData();
+      this.listdata.pageIndex = 1
+      this.listdata.pageSize = val
+      this.getTableData()
     },
     handleCurrentChange(val) {
-      this.listdata.pageIndex = val;
-      this.getTableData();
+      this.listdata.pageIndex = val
+      this.getTableData()
     },
     async getTableData() {
-      this.tableData = [];
+      this.tableData = []
 
-      const data = await dataQuery_selectByPage(this.listdata);
+      const data = await dataQuery_selectByPage(this.listdata)
+      this.$store.state.loading = false;
       if (data.code != 200) {
-        this.$message.error('鍒楄〃璋冪敤澶辫触');
+        return this.$message.error("鍒楄〃璋冪敤澶辫触")
+      }
+      if (data.result.length == 0) {
+
+        return this.$message.error("鍒楄〃鏌ユ棤鏁版嵁")
       }
 
-      var val_Data = data.result;
+
+      var val_Data = data.result
       for (var i in val_Data) {
-        var valste = val_Data[i];
+        var valste = val_Data[i]
         for (var j in this.optionx) {
           if (
             this.optionx[j].domainNa != null &&
             this.optionx[j].domainNa != undefined
           ) {
-            valste[this.optionx[j].field] = this.optionx[j].domainNa;
+            valste[this.optionx[j].field] = this.optionx[j].domainNa
           }
         }
       }
-      this.pageCount = data.count;
-      this.tableData = data.result;
-      this.$refs.dialogPayChannel.doLayout();
+      this.pageCount = data.count
+
+
+      var val = data.result;
+      val = val.filter((res) => {
+
+        if (res.dirName) {
+          res.dirid = res.dirName
+        }
+        if (res.depName) {
+          res.depid = res.depName
+        }
+        if (res.verName) {
+          res.verid = res.verName
+        }
+        if (res.updateName) {
+          res.updateuser = res.updateName
+        }
+        if (res.createName) {
+          res.createuser = res.createName
+        }
+
+        if (res.createtime) {
+          res.createtime = this.format(res.createtime)
+        }
+        if (res.updatetime) {
+          res.createtime = this.format(res.updatetime)
+        }
+        return res
+      })
+
+
+
+      this.tableData = val
+      this.$refs.dialogPayChannel.doLayout()
+      // this.showAllImage(data.result)
     },
+    //鏍煎紡鍖栨椂闂�
+    format(shijianchuo) {
+      //shijianchuo鏄暣鏁帮紝鍚﹀垯瑕乸arseInt杞崲
+      var time = new Date(shijianchuo);
+      var y = time.getFullYear();
+      var m = time.getMonth() + 1;
+      var d = time.getDate();
+      var h = time.getHours();
+      var mm = time.getMinutes();
+      var s = time.getSeconds();
+      return y + "-" + this.add0(m) + "-" + this.add0(d);
+    },
+    //鏍煎紡鍖栨椂闂�
+    add0(m) {
+      return m < 10 ? "0" + m : m;
+    },
+    async showAllImage(res) {
+      for (var i in res) {
+        let properties = res[i]
+        var param = {
+          gid: res[i].gid,
+          name: this.listdata.name,
+        }
+        const data = await dataQuerySelectWktById(param)
+        if (data.code != 200) {
+          this.$message.error("鍒楄〃璋冪敤澶辫触")
+        }
+        var val1 = decr(data.result)
+        if (val1) {
+          var wkt = this.$wkt.parse(val1)
+          // this.getprimitiLayer(wkt);
+          this.primitivesAddLayer(wkt, properties)
+        }
+      }
+    },
+    getprimitiLayer(res) {
+      switch (res.type) {
+        case "Point":
+          this.$store.state.primitLayer = window.Viewer.scene.primitives.add(
+            new Cesium.BillboardCollection()
+          )
+          break
+      }
+    },
+    primitivesAddLayer(res, properties) {
+      switch (res.type) {
+        case "Point":
+          var val = Cesium.Cartesian3.fromDegrees(
+            res.coordinates[0],
+            res.coordinates[1]
+          )
+          var point = Viewer.entities.add({
+            position: val,
+            properties: properties,
+            tag: "properties_point",
+            billboard: {
+              // 鍥惧儚鍦板潃锛孶RI鎴朇anvas鐨勫睘鎬�
+              image: SmartEarthRootUrl + "Workers/image/mark.png",
+              heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
+              // 澶у皬鏄惁浠ョ背涓哄崟浣�
+              sizeInMeters: false,
+              // 鐩稿浜庡潗鏍囩殑鍨傜洿浣嶇疆
+              verticalOrigin: Cesium.VerticalOrigin.CENTER,
+              // 鐩稿浜庡潗鏍囩殑姘村钩浣嶇疆
+              horizontalOrigin: Cesium.HorizontalOrigin.LEFT,
+              // 搴旂敤浜庡浘鍍忕殑缁熶竴姣斾緥銆傛瘮渚嬪ぇ浜庝細1.0鏀惧ぇ鏍囩锛岃�屾瘮渚嬪皬浜庝細1.0缂╁皬鏍囩銆�
+              scale: 1.0,
+              // 鏄惁鏄剧ず
+              show: true,
+            },
+          })
+          point.billboard.disableDepthTestDistance = Number.POSITIVE_INFINITY
+          this.$store.state.queryInfo.push(point)
+          //鐐瑰嚮浜嬩欢
+          window.propertieshandler = new Cesium.ScreenSpaceEventHandler(
+            sgworld.Viewer.scene.canvas
+          )
+          window.propertieshandler.setInputAction(event => {
+            let pick = sgworld.Viewer.scene.pick(event.position)
+            // ;
+            if (pick && pick.id && pick.id.tag == "properties_point") {
+              this.$store.state.propertiesFlag = "1"
+              let properties = pick.id.properties
+              let propertyNames = pick.id.properties.propertyNames
+              let obj = {}
+              obj["eventid"] = properties["_eventid"]._value
+              this.attributeData.forEach(item => {
+                propertyNames.forEach(itemElement => {
+                  if (itemElement == item.field) {
+                    obj[item.alias] = properties[itemElement]._value
+                  }
+                })
+              })
+              this.$store.state.propertiesInfo = obj
+            }
+          }, Cesium.ScreenSpaceEventType.LEFT_CLICK)
+          break
+        case "LineString":
+        case "MultiLineString":
+          var line = res.coordinates[0]
+          var std = []
+          for (var i in line) {
+            std.push(line[i][0], line[i][1])
+          }
+          var polyline = Viewer.entities.add({
+            polyline: {
+              properties: properties,
+              tag: "properties_line",
+              positions: Cesium.Cartesian3.fromDegreesArray(std),
+              width: 5,
+              material: new Cesium.Color(1.0, 0.0, 0.0, 0.3),
+              clampToGround: true,
+            },
+          })
+          this.$store.state.queryInfo.push(polyline)
+          break
+        case "MultiPolygon":
+          var val = res.coordinates[0][0]
+          var std = []
+          for (var i in val) {
+            std.push(val[i][0], val[i][1])
+          }
+          var entity = Viewer.entities.add({
+            properties: properties,
+            tag: "properties_polygon",
+            polygon: {
+              hierarchy: Cesium.Cartesian3.fromDegreesArray(std),
+              //height : 100000,
+              material: new Cesium.Color(1.0, 0.0, 0.0, 0.3),
+              outline: true,
+              outlineColor: new Cesium.Color(1.0, 0.0, 0.0, 0.3),
+            },
+          })
+          this.$store.state.queryInfo.push(entity)
+          break
+      }
+    },
+
     closeMenuBox() {
       if (this.imagePoint != null) {
-        sgworld.Creator.DeleteObject(this.imagePoint);
-        this.imagePoint = null;
+        sgworld.Creator.DeleteObject(this.imagePoint)
+        this.imagePoint = null
       }
-      sgworld.Creator.SimpleGraphic.clear();
-      this.$store.state.mapPopBoolean = false;
-      this.$store.state.mapPopBoxFlag = null;
+      sgworld.Creator.SimpleGraphic.clear()
+      this.$store.state.mapPopBoolean = false
+      this.$store.state.mapPopBoxFlag = null
     },
   },
   created() {
-    this.setTableAll();
+
+    this.setTableAll()
+
   },
   mounted() {
-    this.$bus.$on('changeMapMenuTop', (res) => {
-      if (res == 'true') {
-        this.setTableAll();
+
+    this.$bus.$on("changeMapMenuTop", res => {
+      if (res == "true") {
+        this.setTableAll()
       }
-    });
+    })
+    this.$bus.$on("setInsertDown2", res => {
+      this.getInsertDown(res)
+    })
+    this.$bus.$on("setInsertDown1", res => {
+      this.isflag = true;
+      this.getInsertDown(res)
+    })
+    this.$bus.$on("setInsertApply1", res => {
+
+      this.getInsertApply(res)
+    })
   },
-};
+  destroyed() {
+    this.$store.state.propertiesFlag = null
+    if (window.propertieshandler != null && Cesium.defined(window.propertieshandler)) {
+      window.propertieshandler.removeInputAction(
+        Cesium.ScreenSpaceEventType.LEFT_CLICK
+      )
+      window.propertieshandler = null
+    }
+  },
+}
 </script>
 
 <style scoped lang="less">
@@ -424,7 +995,6 @@
     float: left;
     border-right: 1px solid gray;
     li {
-      color: white;
       line-height: 20px;
       border-bottom: 1px solid gray;
       padding: 5px;
@@ -434,6 +1004,12 @@
       color: #409eff;
       background: rgba(128, 128, 128, 0.2);
     }
+    .leftDown {
+      width: 94%;
+      padding: 3%;
+      display: flex;
+      justify-content: flex-end;
+    }
   }
 
   .rightBox {
@@ -442,117 +1018,28 @@
     float: left;
     .rightTitle {
       padding: 5px;
-      color: white;
+
       width: 100%;
     }
     .tableBox {
-      height: 327px;
+      position: relative;
+      height: 89%;
     }
     .rightPage {
       margin-left: 50px;
       /*涓嶅彲鐐瑰嚮鐨�*/
     }
-    .pagination_box {
-      position: absolute;
-      bottom: 10px;
-      /deep/.el-input__inner {
-        background-color: transparent !important;
-        border: 1px solid;
-        color: white;
-      }
-      /deep/.el-pagination__total {
-        color: white;
-      }
-      /deep/.el-pagination__jump {
-        color: white;
-      }
-      /deep/.el-pager li.active {
-        color: #409eff;
-      }
-      /deep/.el-pager li {
-        color: white;
-        background: transparent;
-      }
-      /deep/.el-pager li {
-        color: white;
-      }
-      /deep/.btn-prev {
-        background: transparent;
-      }
-      /deep/.btn-next {
-        background: transparent;
-      }
-      /deep/.btn-next i {
-        color: white;
-      }
-      /deep/.btn-prev i {
-        color: white;
-      }
-    }
+
     .boxClose {
       float: right;
       margin-right: 20px;
-      color: white;
-    }
-  }
-  /deep/ .el-table {
-    background-color: transparent;
-
-    th,
-    td {
-      background-color: transparent;
-    }
-    .el-table__expanded-cell {
-      background-color: transparent !important;
-    }
-
-    // 琛ㄥご鑳屾櫙鑹�
-    th.el-table__cell {
-      background-color: #303030;
-      color: #fff;
-    }
-    tr > td {
-      background-color: #303030;
-      color: #fff;
-    }
-
-    // hover鏁堟灉
-    tr:hover > td {
-      background-color: rgba(255, 255, 255, 0.3) !important;
-    }
-
-    tbody tr:hover {
-      background-color: rgba(255, 255, 255, 0.3) !important;
-      // text-align: center;
-    }
-
-    // 婊氬姩鏉″楂�
-    .el-table__body-wrapper::-webkit-scrollbar {
-      width: 5px;
-      height: 5px;
-    }
-
-    .el-table__body-wrapper::-webkit-scrollbar {
-      width: 5px;
-      /*婊氬姩鏉″搴�*/
-      height: 5px;
-      /*婊氬姩鏉¢珮搴�*/
-    }
-    /*瀹氫箟婊氬姩鏉¤建閬� 鍐呴槾褰�+鍦嗚*/
-    .el-table__body-wrapper::-webkit-scrollbar-track {
-      box-shadow: 0px 1px 3px #216fe6 inset;
-      /*婊氬姩鏉$殑鑳屾櫙鍖哄煙鐨勫唴闃村奖*/
-      border-radius: 10px;
-    }
-
-    /*瀹氫箟婊戝潡 鍐呴槾褰�+鍦嗚*/
-    .el-table__body-wrapper::-webkit-scrollbar-thumb {
-      box-shadow: 0px 1px 3px #216fe6 inset;
-      border-radius: 6px;
-      background-color: #216fe6;
     }
   }
 }
+
+li {
+  line-height: 20px;
+  border-bottom: 1px solid gray;
+  padding: 5px;
+}
 </style>
-<style lang="less"></style>
-<style scoped lang="less"></style>

--
Gitblit v1.9.3