Browse Source

莫名报错

mo 4 years ago
parent
commit
b33b42272e

+ 2 - 0
src/components/install.js

@@ -11,6 +11,7 @@ import selectall from '@/components/select-all'
 import copytext from '@/components/copy-text'
 import statistic from '@/components/statistic'
 import descriptions from '@/components/Descriptions/Descriptions.vue'
+import remoteSearch from "@/components/remote-search"
 
 export default {
   install(Vue) {
@@ -22,5 +23,6 @@ export default {
     Vue.component(copytext.name, copytext)
     Vue.component(statistic.name, statistic)
     Vue.component(descriptions.name, descriptions)
+    Vue.component(remoteSearch.name, remoteSearch)
   }
 }

+ 8 - 5
src/components/remote-search/index.vue

@@ -40,12 +40,15 @@ export default {
     };
   },
   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);
+         console.log(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);
 
     // console.log(this.options)
   },

+ 3 - 17
src/views/accompanyManager/accompanyList.vue

@@ -62,16 +62,7 @@
         </el-form-item>
 
         <el-form-item>
-          <el-select v-model.trim="searchForm.teacherId"
-                     clearable
-                     filterable
-                     :filter-method="filterMethod"
-                     placeholder="指导老师">
-            <el-option v-for="(item,index) in selects.teachers"
-                       :key="index"
-                       :value="item.id"
-                       :label="item.realName"></el-option>
-          </el-select>
+          <!-- <remoteSearch :commit='"setTeachers"' v-model='form.teacherId' /> -->
         </el-form-item>
         <el-form-item>
           <el-select v-model.trim="searchForm.groupStatus"
@@ -357,15 +348,10 @@ export default {
     this.init();
   },
   methods: {
-    filterMethod(inp) {
-      this.teacherList = this.selects.teachers.filter(item => (item.realName || '').indexOf(inp) > -1).slice(0, 49)
-    },
+
     init () {
       this.$store.dispatch('setBranchs')
-      this.$store.dispatch('setTeachers')
-        .then(() => {
-          this.teacherList = [...this.selects.teachers].slice(0, 49)
-        })
+
       this.getList();
     },
     permission (str, parent) {

+ 3 - 2
src/views/save-form-test/index.vue

@@ -57,7 +57,7 @@
           <remoteSearch :commit='"setEducations"'  v-model='form.educations' />
         </el-form-item>
          <el-form-item>
-          <remoteSearch :commit='"setTeachers"' v-model='form.educations' />
+          <remoteSearch :commit='"setTeachers"' v-model='form.teacher' />
         </el-form-item>
         <div>
           <el-button type="primary" native-type="submit">提交</el-button>
@@ -136,7 +136,8 @@ export default {
         resource: '',
         desc: '',
         times: [],
-        educations:''
+        educations:'',
+        teacher:''
       },
       list: [{
         id: 1,