wangzhe 2 سال پیش
والد
کامیت
f615a77b48
2فایلهای تغییر یافته به همراه49 افزوده شده و 5 حذف شده
  1. 5 2
      src/api/datacenter.js
  2. 44 3
      src/views/datacenter.vue

+ 5 - 2
src/api/datacenter.js

@@ -9,10 +9,13 @@ export function getResource() {
 }
 
 //点击左侧菜单列表查询落点
-export function getResourcePoint(resourceTable) {
+export function getResourcePoint(resourceTable, name) {
   return request({
     url: '/center-emergency/VisuEmergencyCenterDataController/getResourcePoint',
     method: 'post',
-    data:{"resourceTable":resourceTable}
+    data:{
+      "name": name,
+      "resourceTable": resourceTable
+    }
   })
 }

+ 44 - 3
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="indentleftSetMarkers(item.type)">
+                     v-on:click="indentleftSetMarkers(item.type, searchName)">
                      <!--v-on:click="indentleftSetMarkers(item.resourceTable)">-->
                   <div class="iconfont icon icon-normal" :class="item.icon"></div>
                   <div class="icon-text">
@@ -82,6 +97,12 @@ export default {
   },
   data() {
     return {
+      // 搜索框
+      showSearch: false,
+      // 搜索名称
+      searchName: undefined,
+      // 搜索类型
+      searchType: undefined,
       iconCurrentIndex: '',
       listCurrentIndex: '',
       markersList: [],
@@ -108,6 +129,11 @@ export default {
   },
 
   methods: {
+    // 根据名称筛选资源点位
+    searchByName() {
+      this.$modal.msgSuccess("正在查询,请稍后...");
+      this.indentleftSetMarkers(this.searchType, this.searchName);
+    },
     /** ----------------------------------底部按钮公用组件开始------------------------------------- */
     bottomMenuList() {
       this.$refs.bottomMenu.selectTaskList()//获取任务列表
@@ -212,18 +238,33 @@ export default {
           let icon ='sj' + '-' + 'icon' + '-' + data.type.replaceAll("_", "-").replaceAll("@", "-");
           console.log("icon_" + (index + 1) + "=", icon);
           that.$set(that.resourcesList[index], 'icon', icon);
+
+          if(index < 5){
+            // that.fireControlViewPoint(data.type, 'undefined');
+            that.indentleftSetMarkers(data.type, '所有');
+          }
         })
 
       })
     },
-    indentleftSetMarkers(resourceTable) {
+    indentleftSetMarkers(resourceTable, name) {
+      // 搜索框
+      // if(name == 'undefined' && this.showSearch == false){
+      // if(name == '所有' && this.showSearch == false){
+      if(name == '所有'){
+        name = undefined;
+      }else {
+        this.showSearch = true;
+      }
+      // 搜索类型
+      this.searchType = resourceTable;
       this.iconCurrentIndex = resourceTable
       let that = this
       that.resourceTable = resourceTable
       that.markersList = []
       that.source = []
       //点击左侧地图落点
-      getResourcePoint(resourceTable).then(res => {
+      getResourcePoint(resourceTable, name).then(res => {
         that.deptGroupList = res.data.deptGroupList
         if (res.data.deptGroupList != null && res.data.deptGroupList.length > 0) {
           for (let i = 0; i < res.data.deptGroupList.length; i++) {