wangzhe 2 år sedan
förälder
incheckning
1fc6d9604c
2 ändrade filer med 58 tillägg och 9 borttagningar
  1. 5 2
      src/api/datacenter.js
  2. 53 7
      src/views/datacenter.vue

+ 5 - 2
src/api/datacenter.js

@@ -15,11 +15,14 @@ export function fireControlViewList() {
   })
 }
 //点击左侧菜单列表查询落点+按部门分组 NEW
-export function fireControlViewPoint(type) {
+export function fireControlViewPoint(type, name) {
   return request({
     url: '/center-firecontrol/VisuForestDataCenterController/fireControlViewPoint',
     method: 'post',
-    data:{"type":type}
+    data:{
+      "name": name,
+      "type": type
+    }
   })
 }
 

+ 53 - 7
src/views/datacenter.vue

@@ -12,9 +12,24 @@
             <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;"/>
             <div class="i-list-con h-78">
               <div class="d-l-con-icon">
+
+                <div class="i-list-con h-65" v-show="showSearch == true">
+                  <div class="head-container">
+                    <el-input
+                      v-model="searchName"
+                      placeholder="请输入名称"
+                      @blur="searchByName()"
+                      clearable
+                      size="small"
+                      prefix-icon="el-icon-search"
+                      style="margin-bottom: 20px"
+                    />
+                  </div>
+                </div>
+
                 <div class="icon-con" :class="{on:iconCurrentIndex==item.resourceTable}"
                      v-for="(item,index) in resourcesList"
-                     v-on:click="fireControlViewPoint(item.type)">
+                     v-on:click="fireControlViewPoint(item.type, searchName)">
                   <div class="iconfont icon icon-normal" :class="item.icon"></div>
                   <div class="icon-text">
                     <h6>{{ item.num }}</h6>
@@ -106,6 +121,12 @@ export default {
   },
   data() {
     return {
+      // 搜索框
+      showSearch: false,
+      // 搜索名称
+      searchName: undefined,
+      // 搜索类型
+      searchType: undefined,
       iconCurrentIndex: '',
       listCurrentIndex: '',
       markersList: [],
@@ -123,8 +144,19 @@ export default {
       source: [],
     }
   },
-
+  watch: {
+    // // 根据名称筛选资源点位
+    // searchName(searchName) {
+    //   // alert(val)
+    //   this.fireControlViewPoint(this.searchType, searchName);
+    // },
+  },
   methods: {
+    // 根据名称筛选资源点位
+    searchByName() {
+      this.$modal.msgSuccess("正在查询,请稍后...");
+      this.fireControlViewPoint(this.searchType, this.searchName);
+    },
     /** ----------------------------------底部按钮公用组件开始------------------------------------- */
     bottomMenuList() {
       this.$refs.bottomMenu.selectTaskList()//获取任务列表
@@ -281,7 +313,8 @@ export default {
 
           // v-on:click="fireControlViewPoint(item.type)">
           if(index < 5){
-            that.fireControlViewPoint(data.type);
+            // that.fireControlViewPoint(data.type, 'undefined');
+            that.fireControlViewPoint(data.type, '所有');
           }
         })
         // console.log(JSON.stringify(res.data));
@@ -303,12 +336,25 @@ export default {
 
           })
         },*/
-    fireControlViewPoint(resourceTable) {
+    fireControlViewPoint(resourceTable, name) {
+      // 搜索框
+      // if(name == 'undefined' && this.showSearch == false){
+      // if(name == '所有' && this.showSearch == false){
+      if(name == '所有'){
+        name = undefined;
+      }else {
+        this.showSearch = true;
+      }
+      // console.log("name=", name = "111111111235464")
+      console.log("name=", name)
+      console.log("this.showSearch=", this.showSearch)
+      // 搜索类型
+      this.searchType = resourceTable;
       let that = this
       that.resourceTable = resourceTable
       that.markersList = []
       that.source = []
-      fireControlViewPoint(resourceTable).then(res => {
+      fireControlViewPoint(resourceTable, name).then(res => {
         let pointList = res.data.pointList
         that.deptGroupList = res.data.deptList
         if (res.data.deptList != null && res.data.deptList.length > 0) {
@@ -418,14 +464,14 @@ export default {
           '                  <h4>负责人:' + item.contacts + '</h4>' +
           '                </div>' +
           '                </div>' +
-          '                </span>' +
+          '                </span>' + (item.phone?(
           '<span>' +
           '                  <div class="d-l-con">' +
           '                  <div class="d-l-l-text">' +
           '                  <h4>联系电话:' + item.phone + '</h4>' +
           '                </div>' +
           '                </div>' +
-          '                </span></div>'
+          '                </span></div>'):'')
       } else if (resourceTable == 'centerdata_t_forest_watercrane') { //水鹤
         markersMap.icon = 'sj-icon-map-centerdata-t-forest-watercrane'
         markersMap.lng = item.longitude