xiatian 4 роки тому
батько
коміт
6f6dc7fad4

+ 5 - 5
src/modules/questions/views/InsertBluePaperStructure.vue

@@ -38,12 +38,12 @@
             </el-col>
             <el-col :span="8">
               <el-form-item label="总 分">
-                <el-input
-                  v-model.number="blueStruct.totalScore"
-                  class="search_width"
-                  placeholder="请输入总分"
+                <el-input-number
+                  v-model="blueStruct.totalScore"
+                  :precision="1"
+                  :min="0"
                   size="small"
-                ></el-input>
+                ></el-input-number>
               </el-form-item>
             </el-col>
           </el-row>

+ 19 - 6
src/modules/questions/views/InsertBluePaperStructureInfo.vue

@@ -42,13 +42,13 @@
             </el-col>
             <el-col :span="6">
               <el-form-item label="每题分值" class="pull-left">
-                <el-input
+                <el-input-number
                   v-model="paperDetailStruct.score"
-                  class="search_width"
-                  placeholder="请输入"
                   size="small"
+                  :precision="1"
+                  :min="0"
                   @change="muli(paperDetailStruct)"
-                ></el-input>
+                ></el-input-number>
               </el-form-item>
             </el-col>
           </el-row>
@@ -339,6 +339,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,
@@ -364,7 +365,7 @@ export default {
         remark: "", //备注
       },
       paperDetailStructId: "",
-      quesTypes: QUESTION_TYPES,
+      quesTypes: [],
       coursePropertyNumberDtos: [],
       properties: [],
       loading: false,
@@ -390,7 +391,7 @@ export default {
       },
     };
   },
-  computed: {},
+  computed: { ...mapState({ user: (state) => state.user }) },
   watch: {
     count() {
       this.paperDetailStruct.totalScore =
@@ -399,6 +400,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.quesTypes = QUESTION_TYPES.filter((m) =>
+          response.data.includes(m.value)
+        );
+      }
+    });
     this.paperStructId = this.$route.params.paperStructId;
     this.paperDetailStructId = this.$route.params.id;
     this.searchPaperDetail();

+ 4 - 2
src/modules/questions/views/InsertPaperStructure.vue

@@ -27,12 +27,14 @@
             </el-col>
             <el-col :span="8">
               <el-form-item label="总分" prop="score">
-                <el-input
+                <el-input-number
                   v-model.number="paperStruct.totalScore"
                   class="search_width"
                   placeholder="请输入总分"
                   size="small"
-                ></el-input>
+                  :precision="1"
+                  :min="0.1"
+                ></el-input-number>
               </el-form-item>
             </el-col>
             <el-col :span="8">

+ 20 - 6
src/modules/questions/views/InsertPaperStructureInfo.vue

@@ -32,13 +32,13 @@
           </el-col>
           <el-col :span="6">
             <el-form-item label="每题分值" prop="score">
-              <el-input
-                v-model.number="paperUnitForm.score"
-                class="search_width"
-                placeholder="请输入"
+              <el-input-number
+                v-model="paperUnitForm.score"
                 size="small"
+                :precision="1"
+                :min="0.1"
                 @change="muli"
-              ></el-input>
+              ></el-input-number>
             </el-form-item>
           </el-col>
           <el-col :span="6">
@@ -720,6 +720,7 @@ import { QUESTION_API } from "@/constants/constants";
 import { QUESTION_TYPES } from "../constants/constants";
 import _ from "lodash";
 import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
+import { mapState } from "vuex";
 export default {
   components: { LinkTitlesCustom },
   data() {
@@ -765,7 +766,7 @@ export default {
       }
     };
     return {
-      quesTypes: QUESTION_TYPES,
+      quesTypes: [],
       courseNo: "",
       quesNameList: [],
       paperUnitForm: {
@@ -829,6 +830,7 @@ export default {
     };
   },
   computed: {
+    ...mapState({ user: (state) => state.user }),
     totalScore() {
       var sum = 0.0;
       for (let unitStruct of this.unitStructs) {
@@ -853,6 +855,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.quesTypes = QUESTION_TYPES.filter((m) =>
+          response.data.includes(m.value)
+        );
+      }
+    });
     this.paperStructId = this.$route.params.id;
     this.detailName = this.$route.params.name;
     this.detailId = this.$route.params.detailId;