소스 검색

完善列表数据置换

yellowtaotao 4 년 전
부모
커밋
c2cc148577
1개의 변경된 파일25개의 추가작업 그리고 8개의 파일을 삭제
  1. 25 8
      src/views/examQuestionManagement/examQuestionList.vue

+ 25 - 8
src/views/examQuestionManagement/examQuestionList.vue

@@ -92,6 +92,12 @@ export default {
   components: {},
   data() {
     return {
+      defaultType: [
+        { title: '填空题', code: 'TianKong' },
+        { title: '单选题', code: 'DanXuan' },
+        { title: '多选题', code: 'DuoXuan' },
+        { title: '判断题', code: 'PanDuan' },
+      ],
       examQuestionType: [], // 所属题目类型列表
       checkedType: '', // 所选题目类型
       engineeringWorkList: [], // 工种数据列表
@@ -140,10 +146,7 @@ export default {
       // 题目分类
       this.examQuestionType = [
         { title: '全部', code: '' },
-        { title: '填空题', code: 'TianKong' },
-        { title: '单选题', code: 'DanXuan' },
-        { title: '多选题', code: 'DuoXuan' },
-        { title: '判断题', code: 'PanDuan' },
+        ...this.defaultType,
       ];
       this.checkedType = this.examQuestionType[0].code;
 
@@ -170,14 +173,14 @@ export default {
         },
         {
           title: '题目类别',
-          dataIndex: 'questionType',
-          key: 'questionType',
+          dataIndex: 'questionTypeTxt',
+          key: 'questionTypeTxt',
           width: 150,
         },
         {
           title: '工种',
-          dataIndex: 'engineeringWork',
-          key: 'engineeringWork',
+          dataIndex: 'engineeringWorkTxt',
+          key: 'engineeringWorkTxt',
           width: 150,
         },
         {
@@ -213,6 +216,8 @@ export default {
       this.loading = false;
       // let params = {
       //   pagination: pagination,
+      //   questionType: this.checkedType,
+      //   engineeringWork: this.engineeringWorkChooseValue
       // };
       // this.$_http
       //   .get(this.$_API.INTERFACE_GET_USER_ADMIN_USERS, { params })
@@ -334,6 +339,18 @@ export default {
         },
       ];
       this.pagination.total = resData.length;
+      resData.forEach((item) => {
+        this.engineeringWorkList.forEach((it) => {
+          if (item.engineeringWork === it.value) {
+            item.engineeringWorkTxt = it.title;
+          }
+        });
+        this.defaultType.forEach((it) => {
+          if (item.questionType === it.code) {
+            item.questionTypeTxt = it.title;
+          }
+        });
+      });
       this.tableData = [...resData];
     },
     // 操作:详情