JX.LI 2 years ago
parent
commit
000d544163
1 changed files with 26 additions and 1 deletions
  1. 26 1
      src/views/leader.vue

+ 26 - 1
src/views/leader.vue

@@ -45,9 +45,17 @@
           <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
             <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;" />
             <div class="i-list-con h-27">
+              <el-input
+                v-model="nickName"
+                placeholder="请输入姓名"
+                clearable
+                size="small"
+                prefix-icon="el-icon-search"
+                style="margin-bottom: 20px"
+              />
               <div class="d-l-con-icon">
                 <div class="icon-con" :class="{on:listCurrentIndex1==item.userId}"
-                     v-for="(item,index) in peopleList" @click="getPlanList(item.userId)">
+                     v-for="(item,index) in peopleList2" @click="getPlanList(item.userId)">
                   <div class="icon icon-mid el-icon-user"></div>
                   <div class="icon-text personnel-name">
                     <h6>{{ item.nickName }}</h6>
@@ -172,6 +180,8 @@
         indentdisabled: false,
         visuForestCloudRYBO: [], //人员类型列表
         peopleList: [], //人员列表
+        nickName: '',
+        peopleList2: [], //人员列表
         connectList: [], //画线
         xunLinListOne: [], //巡林任务
         recordList: [], //巡查记录
@@ -192,6 +202,19 @@
     mounted(){
       this.bottomMenuList() //获取底部公共组件消息和任务
     },
+    watch:
+      {
+        nickName(val) {
+          this.peopleList2 = [];
+
+          for (let i in this.peopleList) {
+            if (this.peopleList[i].nickName.indexOf(val) != -1) {
+              this.peopleList2.push(this.peopleList[i]);
+            }
+          }
+          console.log(this.peopleList2)
+        }
+      },
     methods: {
       /** ----------------------------------底部按钮公用组件开始------------------------------------- */
       bottomMenuList() {
@@ -284,8 +307,10 @@
         this.listCurrentIndex2 = ''
         this.iconCurrentIndex1 = linJob
         this.peopleList = []
+        this.peopleList2 = []
         getForestLeader(linJob, linType).then(res => {
           this.peopleList = res.data
+          this.peopleList2 = res.data
         })
         this.connectList = []
         this.personId = null;