소스 검색

学生otherList添加

guhongwei 5 년 전
부모
커밋
20100b16e6
3개의 변경된 파일40개의 추가작업 그리고 29개의 파일을 삭제
  1. 11 1
      src/pages/student/views/resume/education.vue
  2. 28 27
      src/pages/student/views/resume/purpose.vue
  3. 1 1
      src/store/dictionary.js

+ 11 - 1
src/pages/student/views/resume/education.vue

@@ -130,6 +130,7 @@ export default {
     charList: [{ name: '中专' }, { name: '大专' }, { name: '本科' }, { name: '硕士' }, { name: '博士' }, { name: '其他' }],
   }),
   created() {
+    this.otherList();
     this.search();
   },
   computed: {
@@ -138,7 +139,7 @@ export default {
     }),
   },
   methods: {
-    ...mapActions(['userOperation', 'resumesOperation']),
+    ...mapActions(['userOperation', 'resumesOperation', 'dicOperation']),
     async search() {
       let result = await this.resumesOperation({ type: 'search', data: { id: this.user.id } });
       this.$set(this, `info`, result.data ? result.data : { info: {} });
@@ -199,6 +200,15 @@ export default {
       this.$set(this, `form`, object);
       this.dialog = true;
     },
+    async otherList() {
+      let result = await this.dicOperation('xl');
+      if (`${result.errcode}` === '0') {
+        //给this=>vue的实例下在中的list属性,赋予result。data的值
+        this.$set(this, `charList`, result.data);
+      } else {
+        this.$message.error(result.errmsg ? result.errmsg : 'error');
+      }
+    },
   },
 };
 </script>

+ 28 - 27
src/pages/student/views/resume/purpose.vue

@@ -33,10 +33,10 @@
           <el-col :span="6">&nbsp;</el-col>
         </el-row>
       </template>
-      <el-row v-for="(item, index) in classList" :key="index" @click.native="choose(item.label, 'isVisible', 'category')" class="select__options">
-        <el-col :span="20" style="text-indent: 1.25rem;">{{ item.label }}</el-col>
+      <el-row v-for="(item, index) in classList" :key="index" @click.native="choose(item.name, 'isVisible', 'category')" class="select__options">
+        <el-col :span="20" style="text-indent: 1.25rem;">{{ item.name }}</el-col>
         <el-col :span="4" style="text-align: center;">
-          <nut-icon v-if="isChoose(item.label, 'category')" type="tick"> </nut-icon>
+          <nut-icon v-if="isChoose(item.name, 'category')" type="tick"> </nut-icon>
         </el-col>
       </el-row>
     </el-drawer>
@@ -188,29 +188,8 @@ export default {
     info: {},
     loading: false,
     expect: {},
-    hyList: [{ name: '农、林、牧、渔业' }, { name: '采矿业' }, { name: '制造业' }, { name: '建筑业' }],
-    classList: [
-      {
-        label: 'IT',
-        value: '1',
-      },
-      {
-        label: 'test2',
-        value: '2',
-      },
-      {
-        label: 'test3',
-        value: '3',
-      },
-      {
-        label: 'test4',
-        value: '4',
-      },
-      { label: '产品', value: '5' },
-      { label: '设计', value: '6' },
-      { label: '编程/IT开发', value: '7' },
-      { label: '测试', value: '8' },
-    ],
+    hyList: [],
+    classList: [],
     salaList: [{ name: '4K' }, { name: '5K' }, { name: '6K' }, { name: '7K' }, { name: '8K' }, { name: '10K' }],
     cityList: [],
     charList: [{ name: '和平型' }, { name: '稳定型' }, { name: '上进型' }, { name: '思考型' }],
@@ -219,6 +198,7 @@ export default {
     secondList1: [{ label: '沈阳市', value: '210100' }, { label: '大连市', value: '210200' }],
   }),
   created() {
+    this.otherList();
     this.search();
   },
   computed: {
@@ -227,7 +207,7 @@ export default {
     }),
   },
   methods: {
-    ...mapActions(['userOperation', 'resumesOperation']),
+    ...mapActions(['userOperation', 'resumesOperation', 'dicOperation']),
     async search() {
       let result = await this.resumesOperation({ type: 'search', data: { id: this.user.id } });
       this.$set(this, `info`, result.data ? JSON.parse(JSON.stringify(result.data)) : { info: {} });
@@ -385,6 +365,27 @@ export default {
     switchActionSheet(param) {
       this[`${param}`] = !this[`${param}`];
     },
+    async otherList() {
+      let result = await this.dicOperation('hylb');
+      if (`${result.errcode}` === '0') {
+        //给this=>vue的实例下在中的list属性,赋予result。data的值
+        this.$set(this, `hyList`, result.data);
+      } else {
+        this.$message.error(result.errmsg ? result.errmsg : 'error');
+      }
+      result = await this.dicOperation('zwlb');
+      if (`${result.errcode}` === '0') {
+        this.$set(this, `classList`, result.data);
+      } else {
+        this.$message.error(result.errmsg ? result.errmsg : 'error');
+      }
+      result = await this.dicOperation('xzdy');
+      if (`${result.errcode}` === '0') {
+        this.$set(this, `salaList`, result.data);
+      } else {
+        this.$message.error(result.errmsg ? result.errmsg : 'error');
+      }
+    },
   },
 };
 </script>

+ 1 - 1
src/store/dictionary.js

@@ -4,7 +4,7 @@ import _ from 'lodash';
 
 Vue.use(Vuex);
 const api = {
-  dictionary: '/api/code/{type}/items', //type === xzqh:query:level(1/2);parent(无/code)
+  dictionary: '/code/{type}/items', //type === xzqh:query:level(1/2);parent(无/code)
 };
 
 export const state = () => ({});