Quellcode durchsuchen

跳转转译组件

Lijy vor 2 Jahren
Ursprung
Commit
6470cfbd69
1 geänderte Dateien mit 47 neuen und 3 gelöschten Zeilen
  1. 47 3
      fhKeeper/formulahousekeeper/timesheet/src/components/select.vue

+ 47 - 3
fhKeeper/formulahousekeeper/timesheet/src/components/select.vue

@@ -12,7 +12,7 @@
                     <span v-if="!tile">
                         <span class="all">
                             <ww-open-data type='userName' :openid='multiSelectList[0].name'></ww-open-data>
-                            <!-- {{multiSelectList[0].name}} -->
+                            {{multiSelectList[0].name}}
                             <i class="el-icon-error" v-if="!disabled" @click.stop="deleteMultiSelectList('-1')"></i>
                         </span>
                         <span class="all" v-if="multiSelectList.length > 1"> + {{multiSelectList.length - 1}}</span>
@@ -34,7 +34,13 @@
     </div>
     <transition name="el-zoom-in-top">
       <div v-show="show" style="position: relative;z-index: 99;"> 
-        <div class="transitionBox">
+        <!-- 搜索框 -->
+        <div class="searchBox">
+            <el-input :placeholder="$t('peaseenterthe')" size="mini" v-model="searchTex" style="width: 150px" @focus="searchBox()">
+                <el-button slot="append" icon="el-icon-search" size="mini" @click="searchLick()"></el-button>
+            </el-input>
+        </div>
+        <div class="transitionBox" :style="filterable ? 'margin: 30px 0;' : ''">
             <ul class="transitionBoxUl">
                 <li :class="transitionBoxLiIdx == index ? 'liHover' : ''" v-for="(item, index) in options" :key="index" @mouseover="liMouseOver(index)" @click="liClick(item, index)"> 
                     <span v-if="!multiSelect">
@@ -155,7 +161,9 @@ export default {
             dailyListIndex: null, // 日报点的索引
             move: false,
             moveIon: false,
-            multiSelectList: []
+            multiSelectList: [],
+            searchTex: '', // 搜索文字
+            cursor: '', // 搜索的标记(需传给后端)
         };
     },
     computed: {},
@@ -263,6 +271,7 @@ export default {
                 this.classDiv = !this.classDiv
                 this.show = !this.show
                 this.move = !this.move
+                this.searchTex = ''
             }
         },
         selectClihide() {
@@ -388,6 +397,37 @@ export default {
                 name: this.selectName
             }
             this.$emit("selectCal", obj)
+        },
+        searchBox() {
+            this.selectCli()
+        },
+        // 搜索
+        searchLick() {
+            console.log('文字')
+            this.getSimpleActiveUserList()
+        },
+        // 针对  getSimpleActiveUserList 获取所有人员接口
+        getSimpleActiveUserList() {
+            this.http.post('/user/getSimpleActiveUserList', {
+                keyword: this.searchTex,
+                cursor: this.cursor
+            },
+            res => {
+                if (res.code == "ok") {
+                    console.log('数据')
+                } else {
+                    this.$message({
+                        message: res.msg,
+                        type: "error"
+                    });
+                }
+            },
+            error => {
+                this.$message({
+                    message: error,
+                    type: "error"
+                });
+            });
         }
     },
     triggerOption(){
@@ -452,6 +492,10 @@ export default {
     .iostuHover {
         transform: rotate(-180deg);
     }
+    .searchBox {
+        position: absolute; 
+        width: 100%;
+    }
     .transitionBox {
         background: #FFF;
         position: absolute;