Browse Source

Merge branch 'zz-test' into master

LAPTOP-U5GOA5HA\zz 1 year ago
parent
commit
2bd9f8c461
1 changed files with 19 additions and 9 deletions
  1. 19 9
      app/src/views/Home/components/BasicInfoModalContent.vue

+ 19 - 9
app/src/views/Home/components/BasicInfoModalContent.vue

@@ -1,5 +1,6 @@
 <script>
 import { getJdjcUnit, getGcjztjUnit } from "@/api/index.js";
+import { area } from '@/api/area'
 export default {
   name: "BasicInfoModalContent",
   data() {
@@ -44,13 +45,13 @@ export default {
     },
   },
   methods: {
-    rowClickHandler() {
-      this.$router.push("/detail");
+    rowClickHandler(val) {
+      this.$router.push(`/detail?id=${val.id}`);
     },
     funUnitList() {
       getJdjcUnit({
         ...this.params,
-        qx: this.value === "重庆市" ? "" : this.value,
+        qx: this.value === "重庆市" ? "" : this.value,gcjzmc:this.search
       }).then((res) => {
         this.tableData = res.data.rows;
         this.total = res.data.total;
@@ -67,7 +68,7 @@ export default {
     handUnitList() {
       getGcjztjUnit({
         ...this.params,
-        qy: this.value === "重庆市" ? "" : this.value,
+        qy: this.value === "重庆市" ? "" : this.value
       }).then((res) => {
         const list = res.data.rows[0];
         this.unitList = [
@@ -94,10 +95,21 @@ export default {
         ];
       });
     },
+    resetForm(){
+      this.value=''
+      this.search=''
+      this.funUnitList()
+    }
   },
   created() {
     this.funUnitList();
     this.handUnitList();
+    area({
+      pageNum: 1,
+      pageSize: 100
+    }).then(res => {
+      this.options = res.data.rows
+    })
   },
 };
 </script>
@@ -122,10 +134,7 @@ export default {
         <div>
           <el-select v-model="value" placeholder="请选择">
             <el-option
-              v-for="item in options"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
+            :value="item.areaTitle" :label="item.areaTitle" v-for="(item,index) in options" :key="index"
             >
             </el-option>
           </el-select>
@@ -133,7 +142,8 @@ export default {
         <div class="inp">
           <el-input v-model="search" placeholder="请输入建筑名称"></el-input>
         </div>
-        <el-button>搜索</el-button>
+        <el-button @click="funUnitList">搜索</el-button>
+        <el-button @click="resetForm">重置</el-button>
       </div>
     </div>