Selaa lähdekoodia

耕地总览2023年份图斑查询

maxiaoxiao 7 kuukautta sitten
vanhempi
commit
21b6058d4b

+ 1 - 1
src/views/farmlandProtection/gdzl/details.vue

@@ -52,7 +52,7 @@ export default {
       this.type = type;
       this.activeTabs = "jbxx";
       this.jbxxData = [];
-      if (!e.features[0].fieldNames) {
+      if (!e || !e.features || !e.features[0].fieldNames) {
         this.$message({
           message: "查询结果为空!",
           type: "warning",

+ 8 - 2
src/views/farmlandProtection/gdzl/index.vue

@@ -221,8 +221,14 @@ export default {
       this.setLnbh(this.lnbndata);
     },
     yearChange() {
-      let yobj = this.yearList.find((y) => y.year == this.nowyear);
-      this.setImager(yobj);
+      // let yobj = this.yearList.find((y) => y.year == this.nowyear);
+      // this.setImager(yobj);
+      this.yearList.forEach((yobj) => {
+        this.setImager(yobj, yobj.year == this.nowyear);
+        if (yobj.year == this.nowyear) {
+          init_handler(yobj, this.showInfo);
+        }
+      });
       this.regionChange();
     },
     dlbmChange() {