xiatian il y a 4 ans
Parent
commit
51a1276866

+ 17 - 1
src/modules/questions/views/InsertPaperTitle.vue

@@ -151,13 +151,14 @@ export default {
       courseList: [],
       tableData: [],
       detailsData: [],
-      quesTypes: [
+      allQuesTypes: [
         { value: "SINGLE_ANSWER_QUESTION", label: "单选" },
         { value: "MULTIPLE_ANSWER_QUESTION", label: "多选" },
         { value: "BOOL_ANSWER_QUESTION", label: "判断" },
         { value: "FILL_BLANK_QUESTION", label: "填空" },
         { value: "TEXT_ANSWER_QUESTION", label: "问答" },
       ],
+      quesTypes: [],
       rules: {
         name: [{ required: true, message: "请输入试卷名称", trigger: "blur" }],
       },
@@ -236,6 +237,21 @@ export default {
     },
     ...mapState({ user: (state) => state.user }),
   },
+  created() {
+    var url =
+      QUESTION_API +
+      "/org/property/" +
+      this.user.rootOrgId +
+      "/ROOT_ORG_QUESTION_TYPES";
+    this.$http.get(url).then((response) => {
+      if (response.data && response.data.length > 0) {
+        this.quesTypes = this.allQuesTypes.filter((m) =>
+          response.data.includes(m.value)
+        );
+      }
+    });
+    this.initVue();
+  },
   methods: {
     //远端查询课程
     queryCoursesByKeyword(query) {

+ 20 - 3
src/modules/questions/views/Question.vue

@@ -204,7 +204,11 @@
           <template slot-scope="scope">
             <div class="operate_left">
               <el-button
-                v-if="scope.row.questionType !== 'NESTED_ANSWER_QUESTION'"
+                v-if="
+                  scope.row.questionType !== 'NESTED_ANSWER_QUESTION' &&
+                  scope.row.questionType !== 'LISTENING_QUESTION' &&
+                  scope.row.questionType !== 'MATCHING_QUESTION'
+                "
                 size="mini"
                 type="primary"
                 plain
@@ -341,6 +345,7 @@
 <script>
 import { QUESTION_API } from "@/constants/constants";
 import { QUESTION_TYPES, LEVEL_TYPE } from "../constants/constants";
+import { mapState } from "vuex";
 export default {
   data() {
     return {
@@ -356,13 +361,12 @@ export default {
       },
       courseList: [], //课程list
       levelList: LEVEL_TYPE, //层次list
-      questionTypeList: [], //题型
       tableData: [],
       currentPage: 1,
       pageSize: 10,
       total: 10,
       quesModel: {},
-      questionTypes: QUESTION_TYPES,
+      questionTypes: [],
       quesDialog: false,
       loading: false,
       deleteDialogVisible: false,
@@ -380,6 +384,7 @@ export default {
     };
   },
   computed: {
+    ...mapState({ user: (state) => state.user }),
     courseInfoSelect() {
       var courseList = [];
       for (let course of this.courseList) {
@@ -423,6 +428,18 @@ export default {
   },
   //钩子函数
   created() {
+    var url =
+      QUESTION_API +
+      "/org/property/" +
+      this.user.rootOrgId +
+      "/ROOT_ORG_QUESTION_TYPES";
+    this.$http.get(url).then((response) => {
+      if (response.data && response.data.length > 0) {
+        this.questionTypes = QUESTION_TYPES.filter((m) =>
+          response.data.includes(m.value)
+        );
+      }
+    });
     this.initVue();
   },
   methods: {

+ 9 - 8
src/modules/questions/views/School.vue

@@ -193,14 +193,14 @@
           <el-row>
             <el-form-item label="可用题型" prop="questionTypeArr">
               <el-checkbox-group v-model="questionTypeArr">
-                <el-checkbox :label="1">单选</el-checkbox>
-                <el-checkbox :label="2">多选</el-checkbox>
-                <el-checkbox :label="3">判断</el-checkbox>
-                <el-checkbox :label="4">填空</el-checkbox>
-                <el-checkbox :label="5">问答</el-checkbox>
-                <el-checkbox :label="6">套题</el-checkbox>
-                <el-checkbox :label="7">听力题</el-checkbox>
-                <el-checkbox :label="8">配对题</el-checkbox>
+                <el-checkbox label="SINGLE_ANSWER_QUESTION">单选</el-checkbox>
+                <el-checkbox label="MULTIPLE_ANSWER_QUESTION">多选</el-checkbox>
+                <el-checkbox label="BOOL_ANSWER_QUESTION">判断</el-checkbox>
+                <el-checkbox label="FILL_BLANK_QUESTION">填空</el-checkbox>
+                <el-checkbox label="TEXT_ANSWER_QUESTION">问答</el-checkbox>
+                <el-checkbox label="NESTED_ANSWER_QUESTION">套题</el-checkbox>
+                <el-checkbox label="LISTENING_QUESTION">听力题</el-checkbox>
+                <el-checkbox label="MATCHING_QUESTION">配对题</el-checkbox>
               </el-checkbox-group></el-form-item
             >
           </el-row>
@@ -607,6 +607,7 @@ export default {
       this.schoolDialog = true;
     },
     orgSet(row) {
+      this.questionTypeArr = [];
       this.setLoading = true;
       var url = QUESTION_API + "/org/allProperties/" + row.id;
       this.$httpWithMsg.get(url).then((response) => {

+ 17 - 1
src/modules/questions/views/SelectQuestion.vue

@@ -225,6 +225,7 @@
 import { QUESTION_API } from "@/constants/constants";
 import { QUESTION_TYPES } from "../constants/constants";
 import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
+import { mapState } from "vuex";
 export default {
   components: { LinkTitlesCustom },
   data() {
@@ -245,7 +246,7 @@ export default {
       total: 10,
       courseName: "",
       quesModel: {},
-      questionTypes: QUESTION_TYPES,
+      questionTypes: [],
       quesDialog: false,
       loading: false,
       dialogLoading: false,
@@ -253,8 +254,23 @@ export default {
       multipleRightAnswer: [], //接收多选答案
     };
   },
+  computed: {
+    ...mapState({ user: (state) => state.user }),
+  },
   //钩子函数
   created() {
+    var url =
+      QUESTION_API +
+      "/org/property/" +
+      this.user.rootOrgId +
+      "/ROOT_ORG_QUESTION_TYPES";
+    this.$http.get(url).then((response) => {
+      if (response.data && response.data.length > 0) {
+        this.questionTypes = QUESTION_TYPES.filter((m) =>
+          response.data.includes(m.value)
+        );
+      }
+    });
     this.paperId = this.$route.params.id;
     this.courseName = this.$route.params.courseName;
     var courseNo = this.$route.params.courseNo;