JX.LI 2 yıl önce
ebeveyn
işleme
51e99b3a38
1 değiştirilmiş dosya ile 26 ekleme ve 1 silme
  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>
@@ -173,6 +181,8 @@
 				visuForestCloudRYBO: [], //人员类型列表
         personId: null, //人员
         peopleList: [], //人员列表
+        nickName: '',
+        peopleList2: [], //人员列表
         connectList: [], //画线
         patrolTrajectory: null, //任务画线
 				xunLinListOne: [], //巡林任务
@@ -194,6 +204,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() {
@@ -286,8 +309,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;