Kaynağa Gözat

影响服务子图层显示设置

maxiaoxiao 6 ay önce
ebeveyn
işleme
3576ec98f0

+ 3 - 3
src/views/farmlandProtection/config.js

@@ -23,9 +23,9 @@ export const zzForm = [
   ]
 ]
 export const legends = [
-  { id: '0101', label: "水田", color: '#caf982' },
-  { id: '0102', label: "水浇地", color: '#80ffff' },
-  { id: '0103', label: "旱地", color: '#facd91' }
+  { id: '0101', label: "水田", color: '#caf982', index: 1 },
+  { id: '0102', label: "水浇地", color: '#80ffff', index: 2 },
+  { id: '0103', label: "旱地", color: '#facd91', index: 3 }
 ]
 
 export const reasonList = [

+ 33 - 27
src/views/farmlandProtection/gdzl/index.vue

@@ -245,6 +245,7 @@ export default {
       },
       cityList: [],
       imagelayers: {},
+      nowlayer: "",
       provider: null,
       layers: [],
     };
@@ -256,7 +257,7 @@ export default {
   created() {
     // this.getYear();
     // this.GetDate();
-    this.typeList = [{ id: "01", label: "耕地" }, ...legends];
+    this.typeList = [{ id: "01", label: "耕地", index: 0 }, ...legends];
   },
   mounted() {},
   methods: {
@@ -275,25 +276,29 @@ export default {
       this.setLnbh(this.lnbndata);
     },
     dlbmChange() {
-      this.gtype = this.typeList.find((x) => x.id == this.dlbm).label;
+      let nowtype = this.typeList.find((x) => x.id == this.dlbm);
+      this.gtype = nowtype.label;
       this.regionChange();
-      // serverfwmc
-      console.log(this.provider);
-      if (this.layers.length) {
-        this.sourcesshow(false);
-        SetParameters(
-          this.layers[0].name,
-          `dlbm like '${this.dlbm}%'`,
-          // `dlbm = ${this.dlbm}`,
-          this.provider,
-          (lid) => {
-            let yobj = this.yearList.find((y) => y.year == this.nowyear);
-            console.log(yobj, this.yearList, this.nowyear, "obj");
-            if (yobj) this.setImager({ ...yobj, lid });
-          }
-        );
+      if (this.dlbm == "01") {
+        this.nowlayer = this.nowyear;
+      } else {
+        if (nowtype.layerID) {
+          this.nowlayer = this.nowyear + nowtype.layerID;
+          console.log(nowtype, "----nowtype");
+        } else if (this.layers.length) {
+          let yobj = this.yearList.find((y) => y.year == this.nowyear);
+          if (yobj) this.goLayer(yobj, nowtype);
+        }
       }
     },
+    goLayer(lobj, nowtype) {
+      let lname = this.layers[0].name; // `dlbm like '${this.dlbm}%'`,
+      SetParameters(lname, `dlbm = '${this.dlbm}'`, this.provider, (lid) => {
+        this.typeList[nowtype.index].layerID = lid;
+        this.nowlayer = this.nowyear + lid;
+        this.setImager({ ...lobj, lid });
+      });
+    },
     async GetDate() {
       this.yearList = [];
       let res = {};
@@ -315,6 +320,7 @@ export default {
       });
 
       this.nowyear = this.yearList.length ? this.yearList[0].year : "";
+      this.nowlayer = this.nowyear;
       init_handler(this.yearList[0], this.showInfo);
       store.setaddNode([
         { id: "gdbb", url: this.yearList[0].url, label: "耕地保护" },
@@ -341,17 +347,12 @@ export default {
     },
     setImager(obj, isshow = true, fun) {
       let lkey = obj.year + (obj.lid || "");
-      console.log(lkey, isshow, this.imagelayers[lkey], "---");
+      // console.log(lkey, isshow, this.imagelayers[lkey], "---");
       if (this.imagelayers[lkey]) this.imagelayers[lkey].show = isshow;
-      else if (isshow) {
-        let superProvider = new Cesium.SuperMapImageryProvider({
-          url: obj.url,
-          name: obj.year,
-          layersID: obj.lid || undefined,
-        });
-        if (!obj.lid) this.provider = superProvider;
-        this.imagelayers[lkey] =
-          viewer.imageryLayers.addImageryProvider(superProvider);
+      else if (isshow && obj.url) {
+        let { supProvider, layer } = addImagery(obj);
+        if (!obj.lid) this.provider = supProvider;
+        this.imagelayers[lkey] = layer;
       }
       if (obj.top) viewer.imageryLayers.raiseToTop(this.imagelayers[lkey]);
       fun && fun(this.imagelayers[lkey]);
@@ -471,6 +472,11 @@ export default {
     region(newValue) {
       console.log(newValue, "---");
     },
+    nowlayer(newValue, oldVal) {
+      console.log(newValue, oldVal, "-ssssss--");
+      this.setImager({ year: oldVal }, false);
+      this.setImager({ year: newValue }, true);
+    },
   },
   beforeDestroy() {
     store.setaddNode([]);

+ 80 - 47
src/views/farmlandProtection/gdzl/wrjxx.vue

@@ -1,42 +1,22 @@
 <template>
-  <div>
-    <div class="detailList">
-      <el-descriptions :column="1" border>
-        <el-descriptions-item
-          label="图斑编号"
-          label-class-name="my-label"
-          content-class-name="my-content"
-          >{{ "6401812024070108270002" }}</el-descriptions-item
-        >
-        <el-descriptions-item
-          label="外业核实情况"
-          content-class-name="my-content"
-          :span="3"
-          >{{ "已核实" }}</el-descriptions-item
+  <div class="wrjxx">
+    <div class="timeCheck">
+      <ul>
+        <li
+          :class="{ liActive: i == activeIndex }"
+          v-for="(item, i) in checkList"
+          :key="i"
+          @click="onClick(i)"
         >
-        <el-descriptions-item label="实际地类代码">{{
-          "4601"
-        }}</el-descriptions-item>
-        <el-descriptions-item label="调查人员">{{
-          "刘子规"
-        }}</el-descriptions-item>
-        <el-descriptions-item label="调查时间">{{
-          "20240116"
-        }}</el-descriptions-item>
-        <el-descriptions-item label="扩展信息1">{{ "1" }}</el-descriptions-item>
-        <el-descriptions-item label="扩展信息2">{{
-          "无"
-        }}</el-descriptions-item>
-        <el-descriptions-item label="扩展信息3">{{
-          "无"
-        }}</el-descriptions-item>
-      </el-descriptions>
+          {{ item }}
+        </li>
+      </ul>
     </div>
     <div class="imgCon">
       <div class="echartTitle">
-        <div class="block-title">
-          监测类型情况 <span @click="ceshi">测试</span>
-        </div>
+        <div class="block-title">巡查时间:2024/11/27</div>
+        <!-- <span @click="ceshi">测试</span> -->
+        现场图片
       </div>
       <div class="imgList">
         <div
@@ -53,6 +33,11 @@
         </div>
       </div>
     </div>
+    <div class="imgCon">
+      <div class="echartTitle">
+        <div class="block-title">巡查时间:2024/11/20</div>
+      </div>
+    </div>
   </div>
 </template>
 
@@ -66,6 +51,8 @@ export default {
   components: {},
   data() {
     return {
+      activeIndex: 0,
+      checkList: ["近一个月", "近三个月", "近半年", "自定义"],
       monitorList: [
         {
           id: "s1",
@@ -130,25 +117,25 @@ export default {
       // this.colorChange();
       // this.ccc();
       // this.onClickButton();
-      this.ddd();
+      // this.ddd();
     });
   },
   methods: {
-    handleMouseEnter(a, b) {
-      console.log("鼠标移入", a, b);
-      this.ceshi('111')
-    },
-    handleMouseLeave(a, b) {
-      console.log("鼠标移出");
-      this.ceshi()
-    },
+    // handleMouseEnter(a, b) {
+    //   console.log("鼠标移入", a, b);
+    //   this.ceshi('111')
+    // },
+    // handleMouseLeave(a, b) {
+    //   console.log("鼠标移出");
+    //   this.ceshi()
+    // },
     changeData(name, updata) {
       this[name] = updata;
     },
-    clickImg(val) {
-      this.$emit("updateParent", "emitImgList", this.monitorList);
-      this.$emit("updateParent", "emitImgIndex", val);
-    },
+    // clickImg(val) {
+    //   this.$emit("updateParent", "emitImgList", this.monitorList);
+    //   this.$emit("updateParent", "emitImgIndex", val);
+    // },
     aaa() {
       var redLine = viewer.entities.add({
         // 贴在地面上 两点之间的直线距离
@@ -487,6 +474,52 @@ export default {
 </script>
 
 <style lang="less" scoped>
+.wrjxx{
+  height: 695px;
+  overflow-x: hidden;
+  overflow-y: auto;
+}
+.timeCheck {
+  width: 100%;
+  height: 50px;
+
+  z-index: 99;
+  pointer-events: none;
+  ul {
+    list-style: none;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    height: 100%;
+    li {
+      width: 22%;
+      height: 28px;
+      background: inherit;
+
+      box-sizing: border-box;
+      border-width: 2px;
+      border-style: solid;
+      border-color: #64daff;
+      border-radius: 9px;
+
+      color: #64daff;
+      text-align: center;
+      line-height: 28px;
+      pointer-events: all;
+      cursor: pointer;
+    }
+    li:active,
+    li:focus {
+      background-color: rgba(128, 255, 255, 0.39) !important;
+    }
+  }
+  .liActive {
+    background-color: rgba(128, 255, 255, 0.39) !important;
+  }
+  .liItem {
+    background-color: transparent !important;
+  }
+}
 /deep/ .el-descriptions-item__label.is-bordered-label {
   color: #fff;
   background-color: transparent;