From 78345e3940e5252c63e2e52b57a1fd18af982a2b Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期五, 08 九月 2023 16:59:43 +0800
Subject: [PATCH] 发布管理改,资源查询界面修改

---
 src/views/resourceQuery/resourceQuery.vue |  285 ++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 244 insertions(+), 41 deletions(-)

diff --git a/src/views/resourceQuery/resourceQuery.vue b/src/views/resourceQuery/resourceQuery.vue
index 7abc8fe..2681ed6 100644
--- a/src/views/resourceQuery/resourceQuery.vue
+++ b/src/views/resourceQuery/resourceQuery.vue
@@ -1,6 +1,18 @@
 <template>
   <div class="resourceQuery">
     <moon-map></moon-map>
+    <div class="bottom_btn_TWO">
+      <div
+        v-show="mapFlag == '2D'"
+        class="ChangeMap twoImg"
+        @click="setMapImg('2D')"
+      ></div>
+      <div
+        v-show="mapFlag != '2D'"
+        class="ChangeMap threeImg"
+        @click="setMapImg('3D')"
+      ></div>
+    </div>
     <div
       class="left_menu"
       @click="leftDialog =true"
@@ -57,7 +69,7 @@
             <el-form-item label="鏃堕棿鑼冨洿">
               <el-date-picker
                 style="width: 100%"
-                v-model="form.acqTime"
+                v-model="acqTime"
                 type="datetimerange"
                 range-separator="鑷�"
                 start-placeholder="寮�濮嬫棩鏈�"
@@ -104,7 +116,7 @@
                 @click="setDrawMenu(5)"
               >
                 <span>娓呴櫎</span>
-                <div class="btn_bg db"></div>
+                <div class="btn_bg qc"></div>
               </div>
             </div>
           </div>
@@ -166,19 +178,19 @@
               <span class="attribute_content">{{ e.name }}</span>
             </div>
             <div class="attribute">
-              <span class="attribute_title">瀛樻儏浣嶉噺锛�</span>
-              <span class="attribute_content">{{ e.time }}</span>
+              <span class="attribute_title">瀛樺偍浣嶇疆锛�</span>
+              <span class="attribute_content">{{ e.dirName }}</span>
             </div>
             <div class="attribute">
               <span class="attribute_title">鐢熶骇鏃堕棿锛�</span>
-              <span class="attribute_content">{{ e.data }}</span>
+              <span class="attribute_content">{{ e.createTime }}</span>
             </div>
             <div
               class="attribute"
               style="margin: 0"
             >
               <span class="attribute_title">鏁版嵁澶у皬锛�</span>
-              <span class="attribute_content">dsadas</span>
+              <span class="attribute_content">{{ e.sizes }}M</span>
             </div>
           </div>
           <div
@@ -193,7 +205,7 @@
         class="bottom_box"
         v-show="listDialog"
       >
-        <span class="msg_box">鏄剧ず绗瑊{ (( (form.pageIndex - 1)*form.pageSize)+1 )}}鍒皗{(form.pageIndex*form.pageSize)
+        <span class="msg_box">鏄剧ず绗瑊{ (( (form.pageIndex - 1)* form.pageSize) + 1 )}}鍒皗{(form.pageIndex*form.pageSize)
             
           }}鏉★紝鍏眥{ list.length }}鏉¤褰曪紝宸查�夋嫨{{
             listChecked.length
@@ -224,18 +236,19 @@
         ></i>
       </div>
       <div class="details_table">
-        <div class="table_header">
-          <div class="table_td">灞炴��</div>
-          <div class="table_td">灞炴�у��</div>
-        </div>
         <div style="height: 430px;overflow: auto;">
+          <div class="table_header">
+            <div class="table_td">灞炴��</div>
+            <div class="table_td">灞炴�у��</div>
+          </div>
+
           <div
             class="table_tr"
-            v-for="(e,key, i) in tableList"
+            v-for="(e, i) in tableList"
             :key="i"
           >
-            <div class="table_td">{{ key}}</div>
-            <div class="table_td">{{ e }}</div>
+            <div class="table_td">{{ e.alias}}</div>
+            <div class="table_td">{{ e.value }}</div>
           </div>
         </div>
 
@@ -280,7 +293,7 @@
 import * as turf from "@turf/turf"
 import moonMap from "../../components/MapView/moonMap.vue"; //鍦板浘
 import { meta_type, sensor_type } from "../datamanage/js/layerManage";
-import { select_meta_ByPageAndCount, encr } from '../../api/api'
+import { select_meta_ByPageAndCount, encr, selectByPageAndCount } from '../../api/api'
 export default {
   components: {
     moonMap,
@@ -291,24 +304,22 @@
         pageNo: 1,
         pageSize: 10,
       },
-      tableList: [
-
-      ],
+      tableList: [],
       listChecked: [],
-      list: [
-
-      ],
+      list: [],
       currentPage4: 4,
       form: {
         name: "",
         sensorType: 0,
         mataType: 0,
-        acqTime: null,
         wkt: null,
         pageIndex: 1,
         pageSize: 100,
         count: 0,
+        startDate: null,
+        endDate: null
       },
+      acqTime: '',
       sensorOption: [],
       metaOption: [],
       detailsBox: false,
@@ -318,48 +329,173 @@
       dialogVisible: false,
       bufferNumber: 100,
       geoWkt: null,
-      wktEntity: null
+      wktEntity: null,
+      mapFlag: '2D'
     };
   },
   methods: {
+    setMapImg(res) {
+      if (res == "2D") {
+        this.mapFlag = "3D";
+        window.earthCtrl.coreMap.scene.mode = SmartEarth.Cesium.SceneMode.SCENE2D;
+      } else if (res == "3D") {
+        this.mapFlag = "2D";
+        window.earthCtrl.coreMap.scene.mode = SmartEarth.Cesium.SceneMode.SCENE3D;
+      }
+    },
     setListCheckAll() {
       for (var i in this.list) {
         var checked = this.list[i].checked
         if (!checked) {
           this.list[i].checked = true;
           this.listChecked.push(this.list[i]);
+          this.setAddCheckLayer(this.list[i]);
         }
       }
     },
     setListRemoveCheckAll() {
       for (var i in this.list) {
-        this.list[i].checked = false;
+        if (this.list[i].checked) {
+          this.list[i].checked = false;
+          this.setRemoveCheckLayer(this.list[i]);
+        }
+
+
+
       }
       this.listChecked = [];
     },
-    details(e) {
+    async details(e) {
+
+      const data = await selectByPageAndCount({
+        ns: 'lf',
+        pageIndex: 1,
+        pageSize: 100000,
+        tab: 'sys_meta'
+      })
+      if (data.code != 200) return
+      var std = [];
+      var result = data.result;
+
+      e.createUser = e.createName;
+      e.depcode = e.depName
+      e.dircode = e.dirName;
+      e.updateUser = e.updateName;
+
+      e.verid = e.verName;
+      if (e.sensortype > 0) {
+        for (var i in this.sensorOption) {
+          if (this.sensorOption[i].value == e.sensortype) {
+            e.sensortype = this.sensorOption[i].name
+          }
+        }
+      } else {
+        e.sensortype = null
+      }
+      if (e.mataType > 0) {
+        for (var i in this.metaOption) {
+          if (this.metaOption[i].value == e.mataType) {
+            e.mataType = this.metaOption[i].name
+          }
+        }
+      } else {
+        e.mataType = null
+      }
+      for (var i in result) {
+        for (var key in e) {
+          if (result[i].field == key) {
+            result[i].value = e[key]
+          }
+          if (result[i].field == 'gid' && key == 'id') {
+            result[i].value = e[key]
+          }
+
+        }
+      }
+
+
       this.detailsBox = true;
-      this.tableList = e;
+      this.tableList = result;
     },
     setQueryRestRetrieval() {
       this.listDialog = false;
       this.setFromStart();
       this.setDrawMenu(5);
       this.listChecked = [];
+      Viewer.entities.removeAll()
     },
     async setQueryRetrieval() {
+      var obj = JSON.parse(JSON.stringify(this.form))
       if (this.geoWkt) {
-        this.form.wkt = encr(this.geoWkt)
+        obj.wkt = encr(this.geoWkt)
       } else {
-        this.form.wkt = null;
+        obj.wkt = null;
       }
-      const data = await select_meta_ByPageAndCount(this.form);
-      if (data.code != 200) return;
+      if (this.acqTime) {
+        obj.endDate = this.setFromDate(this.acqTime[0])
+        obj.startDate = this.setFromDate(this.acqTime[1])
+      } else {
+        obj.endDate = null
+        obj.startDate = null
+      }
+      if (obj.sensorType == 0) {
+        obj.sensorType = ''
+      }
+      if (obj.mataType == 0) {
+        obj.mataType = ''
+      }
+      const data = await select_meta_ByPageAndCount(obj);
+      if (data.code != 200) return
       this.form.count = data.count;
-      this.list = data.result;
+      var result = data.result;
+      for (var i in result) {
+        if (result[i].createTime) {
+          result[i].createTime = this.setFromDate(result[i].createTime)
+        }
+        if (result[i].updateTime) {
+          result[i].updateTime = this.setFromDate(result[i].updateTime)
+        }
+        if (result[i].acqTime) {
+          result[i].acqTime = this.setFromDate(result[i].acqTime)
+        }
+
+      }
+
+      if (result) {
+        this.list = result;
+      } else {
+        this.list = [];
+      }
       this.listDialog = true;
     },
+    setFromDate(res) {
+      var time = new Date(res);
+      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) +
+        ' ' +
+        this.add0(h) +
+        ':' +
+        this.add0(mm) +
+        ':' +
+        this.add0(s)
+      );
+    },
+    //鏍煎紡鍖栨椂闂�
+    add0(m) {
 
+      return m < 10 ? "0" + m : m;
+    },
+    //澶у皬鍊兼敼鍙�
     handleSizeChange(val) {
       this.form.pageIndex = 1;
       this.form.pageSize = val;
@@ -376,6 +512,7 @@
       val.checked = !val.checked;
       if (val.checked) {
         this.listChecked.push(val);
+        this.setAddCheckLayer(val);
       }
 
       if (this.listChecked.length > 0) {
@@ -383,10 +520,46 @@
           this.listChecked.forEach((e, i) => {
             if (e.id == val.id) {
               this.listChecked.splice(i, 1);
+              this.setRemoveCheckLayer(val);
             }
           });
         }
       }
+    },
+    setAddCheckLayer(res) {
+      if (!res.geom) return
+      var wkt = this.$wkt.parse(res.geom).coordinates[0]
+      var geom = [];
+      for (var i in wkt) {
+        geom.push(Cesium.Cartesian3.fromDegrees(wkt[i][0], wkt[i][1]))
+      }
+      Viewer.entities.add({
+        name: res.name + "&&" + res.id,
+        polygon: {
+          hierarchy: geom,
+          material: Cesium.Color.WHITE.withAlpha(0.1),
+          // heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
+          outline: true,
+          outlineColor: Cesium.Color.fromCssColorString("rgba(130,167,33, 1)"),
+          outlineWidth: 10,
+          classificationType: Cesium.ClassificationType.BOTH,//璐村湴褰㈠拰3dtile
+          clampToGround: true,//寮�鍚创鍦�
+          height: 0,
+        },
+
+      });
+    },
+    setRemoveCheckLayer(res) {
+      var name = res.name + "&&" + res.id;
+      var entity = Viewer.entities._entities._array
+      for (var i = 0; i < entity.length; i++) {
+        if (entity[i].name == name) {
+          Viewer.entities.remove(entity[i])
+          i--;
+        }
+      }
+
+
     },
     setDrawMenu(res) {
       this.bufferNumber = 100;
@@ -433,7 +606,7 @@
       }
       var that = this;
       sgworld.Creator.createSimpleGraphic(this.drawType, config, (entity) => {
-        sgworld.Creator.SimpleGraphic.clear()
+
         that.querySatialQuery(entity);
       });
     },
@@ -453,10 +626,12 @@
           res_val = res.polygon.hierarchy.getValue().positions;
           break;
       }
+      sgworld.Creator.SimpleGraphic.clear()
       this.geoWkt = this.getEntityGeometry(res_val, this.drawType)
       if (this.geoWkt) {
-
-        this.setAddWktEntity(this.geoWkt)
+        this.$nextTick(() => {
+          this.setAddWktEntity(this.geoWkt)
+        })
       }
 
     },
@@ -464,18 +639,17 @@
       var wkt = this.$wkt.parse(res).coordinates[0];
       var geom = [];
       for (var i in wkt) {
-
         geom.push(Cesium.Cartesian3.fromDegrees(wkt[i][0], wkt[i][1], wkt[i][2] ?? 0))
       }
       this.wktEntity = Viewer.entities.add({
         name: '璧勬簮鏌ヨ',
         polygon: {
           hierarchy: geom,
-          material: Cesium.Color.BLUE.withAlpha(0),
-          heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
+          material: Cesium.Color.WHITE.withAlpha(0.2),
+          //heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
           outline: true,
-          outlineColor: Cesium.Color.GREEN,
-          outlineWidth: 5,
+          outlineColor: Cesium.Color.RED,
+          outlineWidth: 10,
           classificationType: Cesium.ClassificationType.BOTH,//璐村湴褰㈠拰3dtile
           clampToGround: true,//寮�鍚创鍦�
           height: 0,
@@ -535,7 +709,7 @@
     },
     setTurfBuffer(geom, distance, type) {
 
-      return turf.buffer(geom, distance, { units: 'miles' });
+      return turf.buffer(geom, distance, { units: 'meters' });
     },
     fixToPositon(restVal, digits = 6) {
       restVal.geometry.coordinates.forEach(coord => {
@@ -568,12 +742,14 @@
         name: "",
         sensorType: 0,
         mataType: 0,
-        acqTime: null,
         wkt: null,
         pageIndex: 1,
         pageSize: 100,
         count: 0,
+        startDate: null,
+        endDate: null
       }
+      this.acqTime = ''
     }
   },
   created() { },
@@ -684,6 +860,10 @@
           }
           .db {
             background: url("../../assets/img/db.png") no-repeat center;
+            background-size: 100% 100%;
+          }
+          .qc {
+            background: url("../../assets/img/娓呴櫎.png") no-repeat center;
             background-size: 100% 100%;
           }
         }
@@ -862,4 +1042,27 @@
 .dialogContent /deep/.el-icon-plus {
   color: #606266 !important;
 }
+.bottom_btn_TWO {
+  position: absolute;
+  z-index: 39;
+  /*  prettier-ignore */
+  bottom: 68PX;
+  /*  prettier-ignore */
+  right: 70PX;
+
+  .ChangeMap {
+    /*  prettier-ignore */
+    width: 30PX;
+    /*  prettier-ignore */
+    height: 30PX;
+    /*  prettier-ignore */
+    border: 1PX solid rgba(255, 255, 255, 0.1);
+  }
+  .twoImg {
+    background: url("../../assets/img/2D.png") no-repeat;
+  }
+  .threeImg {
+    background: url("../../assets/img/3D.png") no-repeat;
+  }
+}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3