Browse Source

级联查询显示修改

maxiaoxiao 6 tháng trước cách đây
mục cha
commit
aa98983c49
1 tập tin đã thay đổi với 29 bổ sung20 xóa
  1. 29 20
      src/components/Query/clickQuery/MultiLevelQuery.vue

+ 29 - 20
src/components/Query/clickQuery/MultiLevelQuery.vue

@@ -14,7 +14,7 @@
       :key="index"
       v-if="item.show"
     >
-      <div v-if="item.name == '规划地块'">
+      <div v-if="index == 0">
         <el-table
           :header-cell-style="{
             background: 'rgba(10, 25, 38, 0.6)',
@@ -43,7 +43,7 @@
         </el-table>
       </div>
 
-      <div v-else-if="item.name != '权属'">
+      <div v-else-if="!item.value.data.child">
         <pie
           class="echart"
           unit="平方米"
@@ -82,10 +82,10 @@
           <pie class="echart" unit="平方米" :ref="`qwnership_pie`"></pie>
 
           <el-tab-pane
-            v-for="(item, index) in qwnershipTabs"
+            v-for="(citem, index) in item.value.data.child"
             :key="index"
-            :label="item.dataname"
-            :name="item.dataname"
+            :label="citem.dataname"
+            :name="citem.dataname"
           >
             <el-table
               :data="tableData_qwnership"
@@ -125,7 +125,7 @@
         ></el-checkbox>
       </el-checkbox-group>
       <div style="margin-bottom: 20px">
-        <el-button size="small" @click="addTab()"> 添加 </el-button>
+        <el-button size="small" @click="addTab()"> 确认 </el-button>
       </div>
     </el-tab-pane>
   </el-tabs>
@@ -495,7 +495,8 @@ export default {
           let res = await GetTabsPane(pane_obj);
 
           let filteredData =
-            element.name == "规划地块"
+            // element.name == "规划地块"
+            index == 0
               ? res.data.data[0].filter((res) => {
                   return res.filed != "geom";
                 })
@@ -521,7 +522,7 @@ export default {
         // this.highlightResults(longitude, latitude);
         this.highlightResultsPng(longitude, latitude);
         this.activeName = store.state.query_pick_pane[0].name;
-        this.handleClick({});
+        this.handleClick({ index: "0" });
         that.handler_multi_level_query.destroy();
         that.handler_multi_level_query = null;
       }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
@@ -560,8 +561,8 @@ export default {
         (s) => s.name === this.activeName
       );
 
-      if (this.activeName == "权属") {
-        this.qwnershipTabsFun();
+      if (tabData.value.data.child) {
+        this.qwnershipTabsFun(tabData.value.data);
       } else if (tabData) {
         this.active_tabs_table = tabData.value.data.data;
         this.rawData = tabData.value.data.data;
@@ -576,7 +577,7 @@ export default {
           );
         });
 
-        if (this.activeName !== "规划地块") {
+        if (tab.index && tab.index !== "0") {
           let data = [];
           tabData.value.data.datalist.forEach((res) => {
             data.push({
@@ -584,7 +585,7 @@ export default {
               value: res.sumvalue,
             });
           });
-          this.setEchart(data, "vertical", tab.index || 0);
+          this.setEchart(data, "vertical", tab.index);
         }
       }
     },
@@ -613,14 +614,12 @@ export default {
       });
     },
     // 权属tabs
-    qwnershipTabsFun() {
-      store.state.query_pick_pane.forEach((res) => {
-        if (res.name == "权属") {
-          this.qwnershipTabs = res.value.data.child;
-          this.activeNameQwnership = this.qwnershipTabs[0].dataname;
-          this.handleClickQwnership({ name: this.qwnershipTabs[0].dataname });
-        }
-      });
+    qwnershipTabsFun(data) {
+      // store.state.query_pick_pane.forEach((res) => {
+        this.qwnershipTabs = data.child;
+        this.activeNameQwnership = data.child[0].dataname;
+        this.handleClickQwnership({ name: data.child[0].dataname });
+      // });
     },
     setEchart_qwnership(data, type, index) {
       this.$nextTick(() => {
@@ -846,6 +845,7 @@ export default {
 .el-tab-pane {
   height: 33rem;
   overflow: auto;
+  overflow-x: hidden;
 }
 
 .list_vector_multi {
@@ -916,6 +916,15 @@ export default {
     color: #30fdff;
   }
 }
+.el-checkbox-group {
+  text-align: left;
+}
+.el-checkbox {
+  display: block;
+  width: 100%;
+  /* background: red; */
+  padding-left: 30px;
+}
 </style>