Sfoglia il codice sorgente

Merge branch 'Nov16thResetMusic' into online

lex-xin 4 anni fa
parent
commit
b6efd057db

+ 57 - 47
src/components/remote-search/index.vue

@@ -1,17 +1,17 @@
 <template>
   <div>
     <el-select
-    :value="value"
+      :value="value"
       filterable
       remote
       reserve-keyword
       clearable
-      :multiple='multiple'
+      :multiple="multiple"
       :placeholder="placeholder"
       :remote-method="remoteMethod"
       :loading="loading"
       @change="changeValue"
-      :style="{width:this.selectWidt+'px!important'}"
+      :style="{ width: this.selectWidt + 'px!important' }"
     >
       <el-option
         v-for="(item, index) in options"
@@ -31,55 +31,60 @@ const placeholder = {
 import { throttle, slice } from "lodash";
 import selects from "@/store/modules/selects";
 export default {
-  name:'remote-search',
-  props: ["commit", "number","value",'width','multiple'],
+  name: "remote-search",
+  props: ["commit", "number", "value", "width", "multiple"],
   data() {
     return {
       options: [],
       list: [],
       loading: false,
       constant: this.number || 50,
-      placeholder:placeholder[this.commit],
-      selectWidt:this.width || 180,
-      isFirst:true
+      placeholder: placeholder[this.commit],
+      selectWidt: this.width || 180,
+      isFirst: true,
     };
   },
   async mounted() {
-    await this.$store.dispatch(this.commit);
-
-    this.list = this.selects[this.enumer[this.commit]];
-
-    this.options =
-      this.list.length <= this.constant
-        ? this.list
-        : slice(this.list, 0, this.constant);
-
-    throttle(this.getOptions,800)('')
+    // this.getList();
 
   },
   methods: {
+    async getList() {
+      await this.$store.dispatch(this.commit);
+      this.list = this.selects[this.enumer[this.commit]];
+
+      this.options =
+        this.list.length <= this.constant
+          ? this.list
+          : slice(this.list, 0, this.constant);
+      // this.getOptions();
+    },
     remoteMethod(query) {
       // throttle
-      throttle(this.getOptions,800)(query)
-
+      throttle(this.getOptions, 800)(query);
     },
     getOptions(query) {
-      this.options = this.list.filter(item=>{
-         let flag = (query&&item.userName.toLowerCase().indexOf(query.toLowerCase())>-1) || item.userId == query
-        if(this.multiple){
-
-          return flag || this.value.includes(item.userId)
-        }else{
-           return flag || item.userId == this.value
-        }
-
-      })
+      if (query) {
+        let flag;
+        this.options = this.list.filter((item) => {
+          flag =
+            item.userName.toLowerCase().indexOf(query.toLowerCase()) > -1 ||
+            item.userId == query;
+          if (this.multiple) {
+            return flag || this.value.includes(item.userId);
+          } else {
+            return flag || item.userId == this.value;
+          }
+        });
+      } else {
+          this.getList();
+      }
+    },
+    changeValue(val) {
+      this.isFirst = false;
+      this.$emit("input", val);
+      this.$emit("change", val);
     },
-    changeValue(val){
-      this.isFirst = false
-       this.$emit("input", val);
-       this.$emit("change",val)
-    }
   },
   computed: {
     enumer() {
@@ -89,18 +94,23 @@ export default {
       };
     },
   },
-  watch:{
-    value:{
-      immediate:true,
-      deep:true,
-      handler(val){
-      if(val&&this.isFirst){
-        throttle(this.getOptions,800)('')
-      }
-      }
-
-    }
-  }
+  watch: {
+    value: {
+      immediate: true,
+      deep: true,
+      handler(val) {
+        if (this.multiple) {
+          if (val?.length > 0 && this.isFirst) {
+            this.getOptions();
+          }
+        } else {
+          if (val && this.isFirst) {
+            this.getOptions();
+          }
+        }
+      },
+    },
+  },
 };
 </script>
 <style lang="scss" scoped>

+ 1 - 1
src/views/teacherManager/teacherDetail/components/teacherInfo.vue

@@ -170,7 +170,7 @@
           </el-row>
              <el-row>
             <el-col :span="12">
-              <el-form-item label="转日期"
+              <el-form-item label="转日期"
                             :label-width="formLabelWidth">
                 <el-input disabled
                           v-model.trim="topForm.formalStaffDate"></el-input>

+ 3 - 3
src/views/teacherManager/teacherList.vue

@@ -107,7 +107,7 @@
             v-model.trim="searchForm.isProbationPeriod"
             clearable
             filterable
-            placeholder="人事状态"
+            placeholder="员工状态"
           >
             <el-option label="正式" value="0"></el-option>
             <el-option label="试用" value="1"></el-option>
@@ -184,7 +184,7 @@
               scope.row.jobNature | jobNature
             }}</template>
           </el-table-column>
-          <el-table-column align="center" label="人事状态">
+          <el-table-column align="center" label="员工状态">
             <template slot-scope="scope">
               {{ scope.row.isProbationPeriod == 0 ? "正式" : "试用" }}
             </template>
@@ -219,7 +219,7 @@
               }}</el-button>
             </template>
           </el-table-column>
-             <el-table-column align="center" label="转日期">
+             <el-table-column align="center" label="转日期">
             <template slot-scope="scope">
               <div>
                 {{scope.row.formalStaffDate | dayjsFormat}}

+ 5 - 5
src/views/teacherManager/teacherOperation/components/teacherOperation.vue

@@ -135,7 +135,7 @@
           <el-row>
             <el-col :span="12">
               <el-form-item
-                label="人事状态"
+                label="员工状态"
                 prop="isProbationPeriod"
                 :label-width="formLabelWidth"
               >
@@ -143,7 +143,7 @@
                   v-model.trim="topForm.isProbationPeriod"
                   clearable
                   filterable
-                  placeholder="人事状态"
+                  placeholder="员工状态"
                 >
                   <el-option label="正式" :value="0"></el-option>
                   <el-option label="试用" :value="1"></el-option>
@@ -282,12 +282,12 @@
           </el-row>
           <el-row>
             <el-col :span="12">
-              <el-form-item label="转日期" :label-width="formLabelWidth">
+              <el-form-item label="转日期" :label-width="formLabelWidth">
                 <el-date-picker
                    v-model="topForm.formalStaffDate"
                     value-format="yyyy-MM-dd"
                   type="date"
-                  placeholder="选择转日期"
+                  placeholder="选择转日期"
                 >
                 </el-date-picker>
               </el-form-item>
@@ -439,7 +439,7 @@ export default {
           { required: true, message: "请选择工作类型", trigger: "change" },
         ],
         isProbationPeriod: [
-          { required: true, message: "请选择人事状态", trigger: "change" },
+          { required: true, message: "请选择员工状态", trigger: "change" },
         ],
         organId: [
           { required: true, message: "请选择所属分部", trigger: "change" },

File diff suppressed because it is too large
+ 526 - 512
src/views/teamBuild/teamSeting/components/setClassV2.vue


Some files were not shown because too many files changed in this diff