zhangjie 1 éve
szülő
commit
e008430c4f

+ 64 - 0
src/components/base/CourseCommonSelect.vue

@@ -0,0 +1,64 @@
+<template>
+  <el-select
+    v-model="selected"
+    class="course-select"
+    :placeholder="placeholder"
+    filterable
+    :clearable="clearable"
+    :disabled="disabled"
+    @change="select"
+  >
+    <el-option
+      v-for="(item, index) in optionList"
+      :key="index"
+      :value="item.code"
+      :label="`${item.name}(${item.code})`"
+    >
+      <span>{{ `${item.name}(${item.code})` }}</span>
+    </el-option>
+  </el-select>
+</template>
+
+<script>
+import { unitQueryByType } from "../../modules/base/api";
+
+export default {
+  name: "course-common-select",
+  props: {
+    disabled: { type: Boolean, default: false },
+    placeholder: { type: String, default: "请选择" },
+    value: { type: [Number, String], default: "" },
+    clearable: { type: Boolean, default: true },
+  },
+  data() {
+    return {
+      optionList: [],
+      selected: "",
+    };
+  },
+  watch: {
+    value: {
+      immediate: true,
+      handler(val) {
+        this.selected = val;
+      },
+    },
+  },
+  async created() {
+    this.search();
+  },
+  methods: {
+    async search() {
+      const res = await unitQueryByType({}, "COURSE");
+      this.optionList = res;
+    },
+    select() {
+      this.$emit("input", this.selected);
+      this.$emit(
+        "change",
+        this.optionList.find((item) => item.code === this.selected)
+      );
+    },
+  },
+};
+</script>

+ 2 - 2
src/constants/enumerate.js

@@ -358,8 +358,8 @@ export const QUESTION_TYPE_LIST = [
 export const QUESTION_SCORE_TYPE = {
   NONE: "全对给分",
   ALL: "任选给半分",
-  LEAK: "漏选给半分",
-  PICK: "漏选给分",
+  LEAK_HALF: "漏选给半分",
+  LEAK: "漏选给分",
 };
 
 // mark

+ 1 - 1
src/modules/base/api.js

@@ -4,7 +4,7 @@ export const questionTeatherUserQuery = ({ courseCode, param }) => {
   return $postParam("/api/admin/sys/user/user_list", { courseCode, param });
 };
 export const unitQueryByType = (datas, dictionaryEnum) => {
-  // dictionaryEnum: SEMESTER("学期"),COLLEGE("学院"),MAJOR("专业"),CLAZZ("班级"),STUDENT("学生")
+  // dictionaryEnum: SEMESTER("学期"),COLLEGE("学院"),MAJOR("专业"),CLAZZ("班级"),STUDENT("学生"),COURSE("课程")
   return $postParam("/api/admin/common/get_dictionary", {
     ...datas,
     dictionaryEnum,

+ 3 - 5
src/modules/base/components/ModifyExamStudent.vue

@@ -32,13 +32,11 @@
         ></exam-select>
       </el-form-item>
       <el-form-item prop="courseCode" label="课程:">
-        <course-select
-          v-model.trim="modalForm.courseCode"
-          :semester-id="modalForm.semesterId"
-          :exam-id="modalForm.examId"
+        <course-common-select
+          v-model="modalForm.courseCode"
           placeholder="课程"
           clearable
-        ></course-select>
+        ></course-common-select>
       </el-form-item>
       <el-form-item prop="studentName" label="姓名:">
         <el-input

+ 1 - 1
src/modules/base/components/course-simple/ClazzSimpleManage.vue

@@ -84,13 +84,13 @@
 
     <!-- AddClazzSimpleDialog -->
     <add-clazz-simple-dialog
+      v-if="editable"
       ref="AddClazzSimpleDialog"
       :course="course"
       @modified="getList"
     ></add-clazz-simple-dialog>
     <!-- StudentSimpleManage -->
     <student-simple-manage
-      v-if="editable"
       ref="StudentSimpleManage"
       :clazz="curRow"
       @modified="getList"

+ 1 - 12
src/modules/base/components/course-simple/CourseEvaluationManage.vue

@@ -78,18 +78,7 @@ export default {
       });
       this.dataList = res || [];
     },
-    async toAdd() {
-      if (this.cwStatus.everSettingStatus) {
-        const confirm = await this.$confirm(
-          `新增评价方式会影响权重设置,确定要新增吗?`,
-          "提示",
-          {
-            type: "warning",
-          }
-        ).catch(() => {});
-        if (confirm !== "confirm") return;
-      }
-
+    toAdd() {
       this.curRow = {
         teachCourseId: this.course.id,
       };

+ 2 - 27
src/modules/base/components/course-simple/CourseTargetManage.vue

@@ -53,7 +53,6 @@
 <script>
 import { courseTargetList, deleteCourseTarget } from "../../api";
 import ModifyCourseTarget from "./ModifyCourseTarget.vue";
-import { mapState } from "vuex";
 
 export default {
   name: "CourseTargetManage",
@@ -72,9 +71,6 @@ export default {
       curRow: {},
     };
   },
-  computed: {
-    ...mapState("base", ["cwStatus"]),
-  },
   mounted() {
     this.getList();
   },
@@ -85,17 +81,7 @@ export default {
       });
       this.dataList = res || [];
     },
-    async toAdd() {
-      if (this.cwStatus.everSettingStatus) {
-        const confirm = await this.$confirm(
-          `新增课程目标会影响权重设置,确定要新增吗?`,
-          "提示",
-          {
-            type: "warning",
-          }
-        ).catch(() => {});
-        if (confirm !== "confirm") return;
-      }
+    toAdd() {
       this.curRow = {
         teachCourseId: this.course.id,
         disabledDimensionIds: this.getDisabledDimensionIds(),
@@ -112,18 +98,7 @@ export default {
       });
       return ids;
     },
-    async toEdit(row) {
-      if (this.cwStatus.everSettingStatus) {
-        const confirm = await this.$confirm(
-          `修改课程目标会影响权重设置,确定要修改吗?`,
-          "提示",
-          {
-            type: "warning",
-          }
-        ).catch(() => {});
-        if (confirm !== "confirm") return;
-      }
-
+    toEdit(row) {
       this.curRow = {
         ...row,
         teachCourseId: this.course.id,

+ 13 - 0
src/modules/base/components/course-simple/ModifyCourseEvaluation.vue

@@ -46,6 +46,7 @@
 
 <script>
 import { updateCourseEvaluation } from "../../api";
+import { mapState } from "vuex";
 
 const initModalForm = {
   evaluationId: null,
@@ -65,6 +66,7 @@ export default {
     },
   },
   computed: {
+    ...mapState("base", ["cwStatus"]),
     isEdit() {
       return !!this.instance.evaluationId;
     },
@@ -118,6 +120,17 @@ export default {
       const valid = await this.$refs.modalFormComp.validate().catch(() => {});
       if (!valid) return;
 
+      if (this.cwStatus.everSettingStatus) {
+        const confirm = await this.$confirm(
+          `${this.title}会影响权重设置,确定要${this.title}吗?`,
+          "提示",
+          {
+            type: "warning",
+          }
+        ).catch(() => {});
+        if (confirm !== "confirm") return;
+      }
+
       if (this.isSubmit) return;
       this.isSubmit = true;
       let datas = { ...this.modalForm };

+ 13 - 0
src/modules/base/components/course-simple/ModifyCourseTarget.vue

@@ -97,6 +97,7 @@
 <script>
 import { updateCourseTarget } from "../../api";
 import SelectDimensionDialog from "./SelectDimensionDialog.vue";
+import { mapState } from "vuex";
 
 const initModalForm = {
   id: null,
@@ -118,6 +119,7 @@ export default {
     },
   },
   computed: {
+    ...mapState("base", ["cwStatus"]),
     isEdit() {
       return !!this.instance.id;
     },
@@ -211,6 +213,17 @@ export default {
       const valid = await this.$refs.modalFormComp.validate().catch(() => {});
       if (!valid) return;
 
+      if (this.cwStatus.everSettingStatus) {
+        const confirm = await this.$confirm(
+          `${this.title}会影响权重设置,确定要${this.title}吗?`,
+          "提示",
+          {
+            type: "warning",
+          }
+        ).catch(() => {});
+        if (confirm !== "confirm") return;
+      }
+
       if (this.isSubmit) return;
       this.isSubmit = true;
       const res = await updateCourseTarget(this.modalForm).catch(() => {});

+ 16 - 12
src/modules/base/views/ExamStudentManage.vue

@@ -3,10 +3,17 @@
     <div class="part-box part-box-filter">
       <el-form ref="FilterForm" label-position="left" label-width="90px" inline>
         <secp-select
-          v-model="filter"
+          v-model="filterSe"
           defaultSelectExam
           @exam-default="search"
         ></secp-select>
+        <el-form-item label="课程(代码):">
+          <course-common-select
+            v-model="filter.courseCode"
+            placeholder="课程(代码)"
+            clearable
+          ></course-common-select>
+        </el-form-item>
         <el-form-item label="任课老师:">
           <el-input
             v-model.trim="filter.teacher"
@@ -201,7 +208,10 @@
       ref="ImportFile"
       title="导入考生"
       :upload-url="uploadUrl"
-      :upload-data="{ examId: filter.examId, semesterId: filter.semesterId }"
+      :upload-data="{
+        examId: filterSe.examId,
+        semesterId: filterSe.semesterId,
+      }"
       :format="['xls', 'xlsx']"
       :download-handle="() => downloadTemplate('examStudent')"
       :download-filename="dfilename"
@@ -234,9 +244,11 @@ export default {
   mixins: [templateDownload],
   data() {
     return {
-      filter: {
+      filterSe: {
         semesterId: "",
         examId: "",
+      },
+      filter: {
         courseCode: "",
         teacher: "",
         college: "",
@@ -244,7 +256,6 @@ export default {
         teachClazz: "",
         examStudentInfo: "",
       },
-      queriedFilter: {},
       current: 1,
       size: this.GLOBAL.pageSize,
       total: 0,
@@ -257,18 +268,12 @@ export default {
       dfilename: "考生导入模板.xlsx",
     };
   },
-  computed: {
-    filterHasQuery() {
-      return !Object.keys(this.filter).some(
-        (k) => this.filter[k] !== this.queriedFilter[k]
-      );
-    },
-  },
   methods: {
     async getList() {
       if (!this.checkPrivilege("list", "list")) return;
 
       const datas = {
+        ...this.filterSe,
         ...this.filter,
         pageNumber: this.current,
         pageSize: this.size,
@@ -276,7 +281,6 @@ export default {
       const data = await examStudentListPage(datas);
       this.dataList = data.records;
       this.total = data.total;
-      this.queriedFilter = { ...this.filter };
     },
     toPage(page) {
       this.current = page;

+ 4 - 0
src/modules/course/api.js

@@ -98,6 +98,10 @@ export const exportTargetReport = (datas) => {
     responseType: "blob",
   });
 };
+// 报告管理-报告数据发生变化
+export const targetReportChangeCheck = (datas) => {
+  return $post("/api/admin/course/degree/report/change", datas);
+};
 
 // 文档管理 ------------------->
 export const courseDocumentListPage = (datas) => {

+ 0 - 6
src/modules/course/components/NormalScoreManage.vue

@@ -114,12 +114,6 @@ export default {
   async mounted() {
     this.filter = this.$objAssign(this.filter, this.course);
     await this.toPage(1);
-
-    if (this.dataList[0] && this.dataList[0].change) {
-      this.$notify.warning(
-        "评价方式与已保存不一致,请重新设置权重及导入新的平时成绩"
-      );
-    }
   },
   methods: {
     async getList() {

+ 18 - 0
src/modules/course/components/TargetScoreDetail.vue

@@ -7,6 +7,7 @@
       :close-on-press-escape="false"
       append-to-body
       fullscreen
+      @open="checkChange"
     >
       <div slot="title">
         成绩管理<span class="color-gray ml-2"
@@ -36,6 +37,7 @@
 <script>
 import NormalScoreManage from "./NormalScoreManage.vue";
 import EndScoreManage from "./EndScoreManage.vue";
+import { targetReportChangeCheck } from "../api";
 
 export default {
   name: "target-score-detail",
@@ -77,6 +79,22 @@ export default {
     selectMenu(tab) {
       this.curTab = tab;
     },
+    async checkChange() {
+      const res = await targetReportChangeCheck({
+        examId: this.course.examId,
+        courseCode: this.course.courseCode,
+        paperNumber: this.course.paperNumber,
+      });
+
+      if (res.courseTargetChange) {
+        this.$notify.warning("课程目标与已保存不一致,请重新设置权重!");
+      }
+      if (res.evaluationChange) {
+        this.$notify.warning(
+          "评价方式与已保存不一致,请重新设置权重及导入新的平时成绩!"
+        );
+      }
+    },
   },
 };
 </script>

+ 74 - 54
src/modules/mark/components/markParam/MarkParamObjectiveAnswer.vue

@@ -50,7 +50,7 @@
           label="小题号"
           width="80"
         ></el-table-column>
-        <el-table-column prop="totalScore" label="ß" width="85">
+        <el-table-column prop="totalScore" label="小题满分" width="85">
         </el-table-column>
         <el-table-column label="答案" width="140px" class-name="answer-column">
           <div
@@ -78,49 +78,68 @@
           width="270px"
           class-name="answer-column"
         >
-          <template v-if="scope.row.questionType === 2" slot-scope="scope">
-            <el-select
-              v-model="scope.row.objectivePolicy"
-              style="width: 120px"
-              @change="objectivePolicyChange(scope.row)"
-            >
-              <el-option
-                v-for="(val, key) in QUESTION_SCORE_TYPE"
-                :key="key"
-                :value="key"
-                :label="val"
-              ></el-option>
-            </el-select>
-            <div
-              v-if="scope.row.objectivePolicy === 'PICK'"
-              :class="[
-                'el-form-item',
-                { 'is-error': scope.row.objectivePolicyError },
-              ]"
-              style="display: inline-block"
-            >
-              <div class="el-form-item__content">
-                <el-input-number
-                  v-model="scope.row.objectivePolicyPickScore"
-                  style="width: 110px; margin-left: 5px"
-                  size="small"
-                  :min="0"
-                  :max="100"
-                  :step="0.5"
-                  step-strictly
-                  :controls="false"
-                  placeholder="每个选项得分"
-                  @change="validateObjectivePolicy(scope.row)"
-                ></el-input-number>
-                <div
-                  v-if="scope.row.objectivePolicyError"
-                  class="el-form-item__error"
-                  style="padding-left: 5px"
-                >
-                  {{ scope.row.objectivePolicyError }}
+          <template slot-scope="scope">
+            <template v-if="scope.row.questionType === 2">
+              <el-select
+                v-model="scope.row.objectivePolicy"
+                style="width: 120px"
+                @change="objectivePolicyChange(scope.row)"
+              >
+                <el-option
+                  v-for="(val, key) in QUESTION_SCORE_TYPE"
+                  :key="key"
+                  :value="key"
+                  :label="val"
+                ></el-option>
+              </el-select>
+              <div
+                v-if="scope.row.objectivePolicy === 'LEAK'"
+                :class="[
+                  'el-form-item',
+                  { 'is-error': scope.row.objectivePolicyError },
+                ]"
+                style="display: inline-block"
+              >
+                <div class="el-form-item__content">
+                  <el-input-number
+                    v-model="scope.row.objectivePolicyScore"
+                    style="width: 110px; margin-left: 5px"
+                    size="small"
+                    :min="0"
+                    :max="100"
+                    :step="0.5"
+                    step-strictly
+                    :controls="false"
+                    placeholder="每个选项得分"
+                    @change="validateObjectivePolicy(scope.row)"
+                  ></el-input-number>
+                  <div
+                    v-if="scope.row.objectivePolicyError"
+                    class="el-form-item__error"
+                    style="padding-left: 5px"
+                  >
+                    {{ scope.row.objectivePolicyError }}
+                  </div>
                 </div>
               </div>
-            </div>
+            </template>
+            <template
+              v-if="
+                scope.row.questionType === 1 || scope.row.questionType === 3
+              "
+            >
+              <el-select
+                v-model="scope.row.objectivePolicy"
+                style="width: 120px"
+              >
+                <el-option
+                  v-for="(val, key) in QUESTION_SCORE_TYPE_SIMPLE"
+                  :key="key"
+                  :value="key"
+                  :label="val"
+                ></el-option>
+              </el-select>
+            </template>
           </template>
         </el-table-column>
       </el-table>
@@ -152,6 +171,10 @@ export default {
       tableData: [],
       QUESTION_SCORE_TYPE,
       abc: "abcdefghijklmnopqrstuvwxyz".toUpperCase(),
+      QUESTION_SCORE_TYPE_SIMPLE: {
+        NONE: "全对给分",
+        ALL: "任选给半分",
+      },
     };
   },
   computed: {
@@ -173,13 +196,13 @@ export default {
       this.tableData = objectiveStructure.map((item) => {
         let nitem = {
           ...item,
-          objectivePolicyPickScore: item.objectivePolicyPickScore || undefined,
+          objectivePolicyScore: item.objectivePolicyScore || undefined,
           mainFirstSub: false,
           expandSub: true,
           answerError: "",
           objectivePolicyError: "",
         };
-        if (item.questionType === 2 && !item.objectivePolicy) {
+        if (item.questionType <= 3 && !item.objectivePolicy) {
           nitem.objectivePolicy = "NONE";
         }
         if (nitem.mainNumber !== curMainNumber) {
@@ -255,18 +278,15 @@ export default {
       row.answerError = "";
     },
     validateObjectivePolicy(row) {
-      if (row.questionType === 2 && row.objectivePolicy === "PICK") {
-        if (
-          !row.objectivePolicyPickScore &&
-          row.objectivePolicyPickScore !== 0
-        ) {
+      if (row.questionType === 2 && row.objectivePolicy === "LEAK") {
+        if (!row.objectivePolicyScore && row.objectivePolicyScore !== 0) {
           row.objectivePolicyError = "不能为空";
           return;
         }
 
         if (
           row.answer &&
-          row.objectivePolicyPickScore * row.answer.length > row.totalScore
+          row.objectivePolicyScore * row.answer.length > row.totalScore
         ) {
           row.objectivePolicyError = "分值过大";
           return;
@@ -287,17 +307,17 @@ export default {
     },
     objectivePolicyChange(row) {
       const { totalScore, answer, objectivePolicy } = row;
-      if (objectivePolicy === "PICK") {
+      if (objectivePolicy === "LEAK") {
         if (answer) {
           const answerCount = answer.length;
           const pickScore = Math.floor((totalScore * 2) / answerCount) / 2;
 
-          row.objectivePolicyPickScore = pickScore;
+          row.objectivePolicyScore = pickScore;
         } else {
-          row.objectivePolicyPickScore = undefined;
+          row.objectivePolicyScore = undefined;
         }
       } else {
-        row.objectivePolicyPickScore = undefined;
+        row.objectivePolicyScore = null;
       }
       this.validateObjectivePolicy(row);
     },

+ 2 - 0
src/plugins/globalVuePlugins.js

@@ -10,6 +10,7 @@ import PlaceSelect from "../components/base/PlaceSelect.vue";
 import PrintPlanSelect from "../components/base/PrintPlanSelect.vue";
 import CardRuleSelect from "../components/base/CardRuleSelect.vue";
 import CourseSelect from "../components/base/CourseSelect.vue";
+import CourseCommonSelect from "../components/base/CourseCommonSelect.vue";
 import PaperNumberSelect from "../components/base/PaperNumberSelect.vue";
 import QuestionTeacherSelect from "../components/base/QuestionTeacherSelect.vue";
 import QuestionTeacherUserSelect from "../components/base/QuestionTeacherUserSelect.vue";
@@ -40,6 +41,7 @@ const components = {
   PrintPlanSelect,
   CardRuleSelect,
   CourseSelect,
+  CourseCommonSelect,
   PaperNumberSelect,
   QuestionTeacherSelect,
   QuestionTeacherUserSelect,