Explorar o código

fix: 区域查询历史

TwoKe945 hai 1 ano
pai
achega
d06d1e99d5
Modificáronse 2 ficheiros con 153 adicións e 4 borrados
  1. 29 4
      app/src/components/SearchBox.vue
  2. 124 0
      app/src/components/data.js

+ 29 - 4
app/src/components/SearchBox.vue

@@ -1,6 +1,7 @@
 <script>
 import { area } from '@/api/area'
 import { getJdjcUnit } from "@/api/index.js";
+import { DEFAULT_BUILD_INFO } from "./data.js";
 
 export default {
   name: "SearchBox",
@@ -39,6 +40,7 @@ export default {
       result: [],
       total: 0,
       activeIndex: -1,
+      showList: true
     }
   },
   created() {
@@ -93,11 +95,27 @@ export default {
         qx: this.areaValue === "重庆市" ? "" : this.areaValue,
         gcjzmc: val.target.value,
         }).then((res) => {
-          this.result = res.data.rows;
-          this.total = res.data.total
-          this.activeIndex = -1;
+          if (res.data.total === 0) {
+            this.resetDefaultSearch()
+          } else {
+            this.result = res.data.rows;
+            this.total = res.data.total
+            this.activeIndex = -1;
+          }
         });
       }
+    },
+    onFocus() {
+      this.showList = true
+      this.resetDefaultSearch()
+    },
+    resetDefaultSearch() {
+      this.result = DEFAULT_BUILD_INFO;
+      this.total = DEFAULT_BUILD_INFO.length;
+      this.activeIndex = -1;
+    },
+    onBlur() {
+      this.showList = false
     }
   }
 }
@@ -114,8 +132,15 @@ export default {
       @keyup.up.native="toPrevNode" 
       @keyup.down.native="toNextNode" 
       @input.native="onInputSearchHandler"
+      @focus="onFocus"
+      @blur="onBlur"
+      autocomplete="off"
       v-model="searchValue" class="search-box-input" placeholder="请输入所要搜索的建筑名称"></el-input>
-      <div class="search-result" v-if="result.length > 0 && total > 0" >
+      <div class="search-result" v-if="result.length > 0 && total > 0"
+        :style="{
+          opacity: showList ? 1 : 0
+        }"
+        >
         <div class="search-result__item" :class="{
           active: (index === activeIndex)
         }" @click="toDetail(item)" v-for="(item,index) in result" :key="index">

+ 124 - 0
app/src/components/data.js

@@ -0,0 +1,124 @@
+export const DEFAULT_BUILD_INFO = [
+  {
+      "id": 117475,
+      "jzbh": "GCJZ-20220507-0347",
+      "qx": "北碚区",
+      "xzjd": "蔡家岗街道",
+      "gcjzmc": "两江名居B1栋",
+      "xxdz": "蔡家岗街道蔡顺路3号附1号",
+      "jzzp": "201602",
+      "jd": "106.49498",
+      "wd": "29.745763",
+      "jzmj": "16034.0",
+      "dslc": "32",
+      "dclc": null,
+      "dxlc": "1",
+      "gd": "88.0",
+      "jcnd": "2012",
+      "jzdx": "一类高层居住建筑",
+      "jznsygn": "住宅",
+      "xfaqglxs": "有管理单位(物业)",
+      "xfaqglr": "余武东",
+      "modedatacreatedate": "2022-05-07",
+      "modedatacreatetime": "15:22:08",
+      "modedatamodifydatetime": "2023-05-26 14:42:02",
+      "wbdwzl": "重庆朝升消防工程有限公司",
+      "wbdwxydm": "91500112MA5U5YNT7B",
+      "sjzt": 0,
+      "hs": null,
+      "dts": null,
+      "sfywbdw": "专业维保",
+      "dxjjqk": "无(消防设施无问题)",
+      "jzlb": "5.其他高层建筑",
+      "sfszcxfgcs": "否",
+      "szsq": "两江名居南社区居委会",
+      "xq": "两江名居",
+      "ld": "B1",
+      "glzthztjzd": "重庆发展置业管理有限公司",
+      "glztxydm": "5000001805553",
+      "fxdj": "低风险",
+      "fxdjgxsj": "2023-06-14 15:56:34",
+      "jzzp1": "https://rio.cq119.gov.cn/ecology/Alanxh/attachPreviewNlogin.jsp?fileid=201602",
+      "jzzp2": null,
+      "jzzp3": null,
+      "jzzp4": null,
+      "jzzp5": null,
+      "sfts": "未提示",
+      "lxfs": "13883995673",
+      "xfaqzrr": null,
+      "xfaqlxr": null,
+      "xfaqlxrdh": null,
+      "yhs": 0,
+      "wlw": "未接入",
+      "dl": "住宅建筑",
+      "wbdwfzr": "税朝斌",
+      "wbdwfzrdh": "18725974548",
+      "wbdwlxr": "税先生",
+      "wbdwlxrdh": "18725974548",
+      "sftssq": "未督办",
+      "sftsxzjd": "未督办",
+      "sftsxzf": "未督办",
+      "fxdjYs": "低风险(绿色)"
+  },
+  {
+      "id": 98181,
+      "jzbh": "GCJZ-20220422-2491",
+      "qx": "渝中区",
+      "xzjd": "解放碑街道",
+      "gcjzmc": "协信SFC中心A栋",
+      "xxdz": "五一路99号",
+      "jzzp": "169733",
+      "jd": "106.580662",
+      "wd": "29.557882",
+      "jzmj": "61874.0",
+      "dslc": "43",
+      "dclc": null,
+      "dxlc": "5",
+      "gd": "194.0",
+      "jcnd": "2015",
+      "jzdx": "超高层公共建筑",
+      "jznsygn": "办公,商业",
+      "xfaqglxs": "有管理单位(物业)",
+      "xfaqglr": "袁甲",
+      "modedatacreatedate": "2022-04-22",
+      "modedatacreatetime": "12:13:07",
+      "modedatamodifydatetime": "2023-06-07 15:32:13",
+      "wbdwzl": "重庆一建消防检测有限公司",
+      "wbdwxydm": "91500112339547531P",
+      "sjzt": 0,
+      "hs": null,
+      "dts": null,
+      "sfywbdw": "专业维保",
+      "dxjjqk": "有",
+      "jzlb": "1.超高层建筑",
+      "sfszcxfgcs": "否",
+      "szsq": "罗汉寺居委会",
+      "xq": "协信SFC中心",
+      "ld": "A栋",
+      "glzthztjzd": "天骄智慧服务集团股份有限公司",
+      "glztxydm": "5000000000004314",
+      "fxdj": "低风险",
+      "fxdjgxsj": "2023-06-14 15:56:34",
+      "jzzp1": "https://rio.cq119.gov.cn/ecology/Alanxh/attachPreviewNlogin.jsp?fileid=169733",
+      "jzzp2": null,
+      "jzzp3": null,
+      "jzzp4": null,
+      "jzzp5": null,
+      "sfts": "未提示",
+      "lxfs": "15823244266",
+      "xfaqzrr": null,
+      "xfaqlxr": null,
+      "xfaqlxrdh": null,
+      "yhs": 0,
+      "wlw": "未接入",
+      "dl": "公共建筑",
+      "wbdwfzr": "赵宗国",
+      "wbdwfzrdh": "18223180000",
+      "wbdwlxr": "黄勇",
+      "wbdwlxrdh": "18223271235",
+      "sftssq": "未督办",
+      "sftsxzjd": "未督办",
+      "sftsxzf": "未督办",
+      "fxdjYs": "低风险(绿色)"
+  }
+]