Sfoglia il codice sorgente

feat: 培养方案管理接口调试

zhangjie 1 anno fa
parent
commit
a7d3ce8493

+ 2 - 0
src/constants/enumerate.js

@@ -396,10 +396,12 @@ export const EVALUATION_MODE = {
   EXAMINE: "考查类",
   COURSE_DESIGN: "课程设计类",
   GRADUATE_DESIGN: "毕业设计类",
+  OTHER: "其他",
 };
 export const COURSE_TYPE = {
   ENGINEERING_BASIC: "工程基础类课程",
   MAJOR_BASIC: "专业基础类课程",
   MAJOR: "专业类课程",
   ENGINEERING_PRACTICE_AND_GRADUATE_DESIGN: "工程实践与毕业设计(论文)",
+  OTHER: "其他",
 };

+ 10 - 4
src/modules/target/api.js

@@ -103,7 +103,7 @@ export const courseOutlineTargetListPage = (datas) => {
   return $postParam("/api/admin/obe/course_target/list", datas);
 };
 export const deleteCourseOutlineTarget = (id) => {
-  return $postParam("/api/admin/obe/course_target/remove", { id });
+  return $postParam("/api/admin/obe/course_target/delete", { id });
 };
 export const updateCourseOutlineTarget = (datas) => {
   return $post("/api/admin/obe/course_target/save", datas);
@@ -112,10 +112,13 @@ export const updateCourseOutlineTargetPredict = (datas) => {
   return $post("/api/admin/obe/course_target/setting_expect_value", datas);
 };
 export const courseOutlineTargetKnowledgeList = (datas) => {
-  return $post("/api/admin/obe/course_target/dimension_tree", datas);
+  return $postParam("/api/admin/obe/course_target/dimension_tree", datas);
 };
 export const courseOutlineTargetRequirementKnowledge = (datas) => {
-  return $post("/api/admin/obe/course_target/requirement_dimension", datas);
+  return $postParam(
+    "/api/admin/obe/course_target/requirement_dimension",
+    datas
+  );
 };
 
 // 不要了
@@ -135,7 +138,10 @@ export const courseOutlineTargetRequirementKnowledge = (datas) => {
 
 // 课程考核方式和内容 ------------------->
 export const courseExamineListPage = (datas) => {
-  return $postParam("/api/admin/obe/course_outline/page", datas);
+  return $postParam(
+    "/api/admin/obe/course_outline/assessment_setting_page",
+    datas
+  );
 };
 export const deleteCourseExamine = (id) => {
   return $postParam("/api/admin/obe/course_outline/delete", { id });

+ 1 - 1
src/modules/target/components/course-examine/CourseExamineEvaluation.vue

@@ -58,7 +58,7 @@ import {
 import ModifyCourseExamineEvaluation from "./ModifyCourseExamineEvaluation.vue";
 
 export default {
-  name: "CourseExamineEvaluation",
+  name: "course-examine-evaluation",
   components: { ModifyCourseExamineEvaluation },
   props: {
     rowData: {

+ 72 - 20
src/modules/target/components/course-examine/CourseExamineWeight.vue

@@ -8,15 +8,17 @@
           width="200"
           fixed="left"
         ></el-table-column>
-        <el-table-column label="考核项目及比例(%)">
+        <el-table-column label="考核项目及比例(%)" align="center">
           <el-table-column
             v-for="(column, cindex) in columns"
             :key="cindex"
             :label="column"
+            align="center"
           >
             <template slot-scope="scope">
               <el-input-number
                 v-model="scope.row.evaluationList[cindex].weight"
+                :disabled="scope.row.evaluationList[cindex].disabled"
                 class="width-50"
                 size="small"
                 :min="0"
@@ -24,22 +26,26 @@
                 :step="1"
                 step-strictly
                 :controls="false"
-                @change="weightChange"
+                @change="weightChange(scope.$index, cindex)"
               >
               </el-input-number>
             </template>
           </el-table-column>
         </el-table-column>
-        <el-table-column label="权重(%)" prop="totalWeight">
+        <el-table-column label="权重(%)" prop="totalWeight" align="center">
         </el-table-column>
       </el-table>
-      <div class="text-center">
-        <el-button type="primary" :loading="loading" @click="submit"
+      <div class="text-center mt-2">
+        <el-button
+          class="width-200"
+          type="primary"
+          :loading="loading"
+          @click="submit"
           >保存</el-button
         >
       </div>
 
-      <div class="part-box part-box-pad">
+      <div>
         <p>说明:</p>
         <p>
           1.课程目标评价依据来源于平时成绩和期末考试成绩二部分,请录入平时成绩,期末成绩整体权重及各目标的权重;
@@ -53,10 +59,9 @@
 <script>
 import { courseExamineWeightDetail, courseExamineWeightSave } from "../../api";
 import { calcSum } from "@/plugins/utils";
-import { mapState, mapActions } from "vuex";
 
 export default {
-  name: "course-weight-manage",
+  name: "course-examine-weight",
   props: {
     rowData: {
       type: Object,
@@ -72,43 +77,90 @@ export default {
       loading: false,
     };
   },
-  computed: {
-    ...mapState("base", ["cwStatus"]),
-  },
   mounted() {
     this.initData();
   },
   methods: {
-    ...mapActions("base", ["updateCwStatus"]),
     async initData() {
-      await this.updateCwStatus({
-        obeCourseOutlineId: this.rowData.id,
-      });
       await this.getList();
     },
     async getList() {
       const res = await courseExamineWeightDetail({
         obeCourseOutlineId: this.rowData.id,
       });
-      this.dataList = res || [];
+      const dataList = res.submitForm || [];
 
-      this.columns = this.dataList[0].evaluationList.map(
+      this.columns = dataList[0].evaluationList.map(
         (item) => item.evaluationName
       );
+
+      this.columns.forEach((column, cindex) => {
+        if (cindex === 0) {
+          dataList.forEach((item, eindex) => {
+            const node = item.evaluationList[cindex];
+            node.disabled = false;
+            node.enable = !!node.weight;
+            node.weight = node.weight || undefined;
+          });
+          return;
+        }
+
+        const rowIndex = dataList.findIndex((item, eindex) => {
+          return !!item.evaluationList[cindex].weight;
+        });
+        if (rowIndex !== -1) {
+          dataList.forEach((item, eindex) => {
+            const node = item.evaluationList[cindex];
+            node.disabled = eindex !== rowIndex;
+            node.weight = node.weight || undefined;
+          });
+        } else {
+          dataList.forEach((item, eindex) => {
+            const node = item.evaluationList[cindex];
+            node.disabled = false;
+            node.weight = node.weight || undefined;
+          });
+        }
+      });
+
+      this.dataList = dataList;
     },
-    weightChange() {
+    weightChange(rowIndex, cindex) {
       this.dataList.forEach((item, tindex) => {
         item.totalWeight = calcSum(
-          item.evaluationList.map((item) => item.weight || 0)
+          item.evaluationList.map((elem) => elem.weight || 0)
         );
       });
+
+      if (cindex === 0) {
+        this.dataList.forEach((item, eindex) => {
+          const node = item.evaluationList[cindex];
+          node.enable = !!node.weight;
+        });
+        return;
+      }
+
+      const val = this.dataList[rowIndex].evaluationList[cindex].weight;
+      if (val) {
+        this.dataList.forEach((item, eindex) => {
+          const node = item.evaluationList[cindex];
+          node.disabled = eindex !== rowIndex;
+          node.enable = eindex === rowIndex;
+        });
+      } else {
+        this.dataList.forEach((item, eindex) => {
+          const node = item.evaluationList[cindex];
+          node.disabled = false;
+          node.enable = false;
+        });
+      }
     },
     checkDataList() {
       if (!this.dataList.length) return;
 
       // 目标整体权重
       const totalWeight = calcSum(
-        this.dataList.some((item) => item.totalWeight || 0)
+        this.dataList.map((item) => item.totalWeight || 0)
       );
       if (totalWeight !== 100) {
         this.$message.error("目标整体权重合计不等于100%");

+ 9 - 3
src/modules/target/components/course-examine/DetailCourseExamine.vue

@@ -7,8 +7,9 @@
     append-to-body
     fullscreen
     @close="closeHandle"
+    @open="visibleChange"
   >
-    <div slot="title">{{ rowData.name }}</div>
+    <div slot="title">{{ rowData.outlineName }}</div>
     <div class="mb-4 tab-btns">
       <el-button
         v-for="tab in tabs"
@@ -34,7 +35,7 @@ import CourseExamineWeight from "./CourseExamineWeight.vue";
 import { mapActions } from "vuex";
 
 export default {
-  name: "detail-course-evaluation",
+  name: "detail-course-examine",
   components: {
     CourseExamineEvaluation,
     CourseExamineWeight,
@@ -64,13 +65,18 @@ export default {
     };
   },
   methods: {
-    ...mapActions("base", ["updateCwStatus"]),
+    ...mapActions("target", ["updateCwStatus"]),
     cancel() {
       this.modalIsShow = false;
     },
     open() {
       this.modalIsShow = true;
     },
+    visibleChange() {
+      this.updateCwStatus({
+        obeCourseOutlineId: this.rowData.id,
+      });
+    },
     selectMenu(tab) {
       this.curTab = tab;
       this.updateCwStatus({

+ 2 - 2
src/modules/target/components/course-examine/ModifyCourseExamineEvaluation.vue

@@ -51,13 +51,13 @@ import { mapState } from "vuex";
 
 const initModalForm = {
   evaluationId: null,
-  teachCourseId: "",
+  obeCourseOutlineId: "",
   evaluation: "",
   evaluationDesc: "",
 };
 
 export default {
-  name: "modify-course-evaluation",
+  name: "modify-course-examine-evaluation",
   props: {
     instance: {
       type: Object,

+ 28 - 17
src/modules/target/components/course-outline/CourseOutlineTarget.vue

@@ -4,12 +4,8 @@
       <div class="box-justify mb-2">
         <div></div>
         <div>
-          <el-button type="primary" icon="el-icon-add" @click="toAdd"
-            >新增课程目标</el-button
-          >
-          <el-button type="primary" icon="el-icon-add" @click="toPredict"
-            >预期值</el-button
-          >
+          <el-button type="primary" @click="toAdd">新增课程目标</el-button>
+          <el-button type="success" @click="toPredict">预期值</el-button>
         </div>
       </div>
       <el-table ref="TableList" :data="dataList">
@@ -19,21 +15,28 @@
           width="70"
           :index="indexMethod"
         ></el-table-column>
-        <el-table-column prop="targetName" label="课程目标" width="160">
+        <el-table-column prop="targetName" label="课程目标" min-width="120">
         </el-table-column>
-        <el-table-column prop="expectValue" label="预期值" width="160">
+        <el-table-column prop="expectValue" label="预期值" width="120">
         </el-table-column>
         <el-table-column prop="degreeRequirement" label="内容" min-width="300">
         </el-table-column>
         <el-table-column
-          prop="obeCultureProgramRequirementContent"
+          prop="obeCultureProgramRequirementName"
           label="指标点"
+          width="140"
         >
-          <!-- <template slot-scope="scope">
-            <p v-for="item in scope.row.dimensionList" :key="item.id">
-              {{ item.name }}({{ item.code }})
-            </p>
-          </template> -->
+          <template slot-scope="scope">
+            <span>{{ scope.row.obeCultureProgramRequirementName }}</span>
+            <el-tooltip
+              v-if="scope.row.obeCultureProgramRequirementContent"
+              :content="scope.row.obeCultureProgramRequirementContent"
+              effect="dark"
+              placement="top"
+            >
+              <i class="el-icon-info ml-1"></i>
+            </el-tooltip>
+          </template>
         </el-table-column>
         <el-table-column
           class-name="action-column"
@@ -69,6 +72,7 @@
     <modify-course-outline-target-predict
       ref="ModifyCourseOutlineTargetPredict"
       :rowData="rowData"
+      @modified="getList"
     ></modify-course-outline-target-predict>
   </div>
 </template>
@@ -113,14 +117,21 @@ export default {
       this.dataList = data || [];
     },
     toAdd() {
-      this.curRow = { obeCourseOutlineId: this.rowData.id };
+      this.curRow = {
+        obeCourseOutlineId: this.rowData.id,
+        cultureProgramId: this.rowData.cultureProgramId,
+      };
       this.$refs.ModifyCourseOutlineTarget.open();
     },
     toPredict() {
       this.$refs.ModifyCourseOutlineTargetPredict.open();
     },
     toEdit(row) {
-      this.curRow = row;
+      this.curRow = {
+        ...row,
+        obeCourseOutlineId: this.rowData.id,
+        cultureProgramId: this.rowData.cultureProgramId,
+      };
       this.$refs.ModifyCourseOutlineTarget.open();
     },
     async toDelete(row) {
@@ -135,7 +146,7 @@ export default {
 
       await deleteCourseOutlineTarget(row.id);
       this.$message.success("删除成功!");
-      this.deletePageLastItem();
+      this.getList();
     },
   },
 };

+ 1 - 1
src/modules/target/components/course-outline/DetailCourseOutline.vue

@@ -8,7 +8,7 @@
     fullscreen
     @close="closeHandle"
   >
-    <div slot="title">{{ rowData.name }}</div>
+    <div slot="title">{{ rowData.outlineName }}</div>
     <div class="mb-4 tab-btns">
       <el-button
         v-for="tab in tabs"

+ 21 - 9
src/modules/target/components/course-outline/ModifyCourseOutline.vue

@@ -3,7 +3,7 @@
     :visible.sync="modalIsShow"
     :title="title"
     top="10vh"
-    width="500px"
+    width="600px"
     :close-on-click-modal="false"
     :close-on-press-escape="false"
     append-to-body
@@ -14,11 +14,11 @@
       :model="modalForm"
       :key="modalForm.id"
       :rules="rules"
-      label-width="100px"
+      label-width="120px"
     >
-      <el-form-item prop="name" label="课程大纲名称:">
+      <el-form-item prop="outlineName" label="课程大纲名称:">
         <el-input
-          v-model.trim="modalForm.name"
+          v-model.trim="modalForm.outlineName"
           placeholder="课程大纲名称"
           clearable
         ></el-input>
@@ -63,7 +63,6 @@
         <semester-select
           v-model="modalForm.semesterId"
           placeholder="修读学期"
-          :org-id="userOrgId"
         ></semester-select>
       </el-form-item>
       <el-form-item prop="cultureProgramId" label="所属专业:">
@@ -89,7 +88,7 @@ import { EVALUATION_MODE, COURSE_TYPE } from "@/constants/enumerate";
 
 const initModalForm = {
   id: null,
-  name: "",
+  outlineName: "",
   courseId: "",
   evaluationMode: "",
   courseType: "",
@@ -113,8 +112,9 @@ export default {
       EVALUATION_MODE,
       COURSE_TYPE,
       modalForm: { ...initModalForm },
+      userOrgId: this.$ls.get("orgId", ""),
       rules: {
-        name: [
+        outlineName: [
           { required: true, message: "请输入课程大纲名称", trigger: "change" },
           {
             message: "课程大纲名称不能超过30个字",
@@ -122,8 +122,20 @@ export default {
             trigger: "change",
           },
         ],
-        professionalId: [
-          { required: true, message: "请选择专业", trigger: "change" },
+        courseId: [
+          { required: true, message: "请选择课程", trigger: "change" },
+        ],
+        evaluationMode: [
+          { required: true, message: "请选择考核方式", trigger: "change" },
+        ],
+        courseType: [
+          { required: true, message: "请选择课程类别", trigger: "change" },
+        ],
+        semesterId: [
+          { required: true, message: "请选择修读学期", trigger: "change" },
+        ],
+        cultureProgramId: [
+          { required: true, message: "请选择所属专业", trigger: "change" },
         ],
       },
     };

+ 4 - 3
src/modules/target/components/course-outline/ModifyCourseOutlineTarget.vue

@@ -16,7 +16,7 @@
         :model="modalForm"
         :rules="rules"
         :key="modalForm.id"
-        label-width="100px"
+        label-width="120px"
       >
         <el-form-item prop="targetName" label="课程目标名称:">
           <el-input
@@ -31,6 +31,7 @@
         >
           <requirement-select
             v-model="modalForm.obeCultureProgramRequirementId"
+            :filter-param="{ cultureProgramId: instance.cultureProgramId }"
             @change="requirementChange"
           ></requirement-select>
 
@@ -80,7 +81,7 @@ import {
   courseOutlineTargetRequirementKnowledge,
 } from "../../api";
 import RequirementSelect from "./RequirementSelect.vue";
-import SelectDimensionDialog from "../../SelectDimensionDialog.vue";
+import SelectDimensionDialog from "./SelectDimensionDialog.vue";
 
 const initModalForm = {
   id: null,
@@ -137,7 +138,7 @@ export default {
                 return callback(new Error("请选择毕业要求指标点"));
               }
 
-              if (this.modalForm.dimensionIdList.length) {
+              if (!this.modalForm.dimensionIdList.length) {
                 return callback(new Error("请选择知识点"));
               }
 

+ 2 - 2
src/modules/target/components/course-outline/ModifyCourseOutlineTargetPredict.vue

@@ -3,7 +3,7 @@
     :visible.sync="modalIsShow"
     title="课程目标预期值"
     top="10vh"
-    width="500px"
+    width="300px"
     :close-on-click-modal="false"
     :close-on-press-escape="false"
     append-to-body
@@ -39,7 +39,7 @@ const initModalForm = {
 };
 
 export default {
-  name: "modify-training-plan-requirement-predict",
+  name: "modify-course-outline-target-predict",
   props: {
     rowData: {
       type: Object,

+ 2 - 4
src/modules/target/components/course-outline/RequirementSelect.vue

@@ -86,7 +86,7 @@ import { trainingPlanRequirementListPage } from "../../api";
 import Clickoutside from "element-ui/src/utils/clickoutside";
 
 export default {
-  name: "org-select",
+  name: "requirement-select",
   props: {
     value: {
       type: [Array, String],
@@ -145,9 +145,7 @@ export default {
   },
   methods: {
     async getList() {
-      const data = await trainingPlanRequirementListPage({
-        cultureProgramId: this.instance.cultureProgramId,
-      });
+      const data = await trainingPlanRequirementListPage(this.filterParam);
       this.orgs = (data || []).map((item) => {
         item.label = `${item.sortNum}.${item.name}`;
         item.children = item.subRequirementList.map((elem) => {

+ 1 - 1
src/modules/target/components/training-plan/AddTrainingPlanCourse.vue

@@ -74,7 +74,7 @@
 import { trainingPlanCourseQueryList, trainingPlanCourseSave } from "../../api";
 
 export default {
-  name: "add-professional-course",
+  name: "add-training-plan-course",
   props: {
     rowData: {
       type: Object,

+ 1 - 1
src/modules/target/components/training-plan/TrainingPlanCourse.vue

@@ -67,7 +67,7 @@ import {
 import AddTrainingPlanCourse from "./AddTrainingPlanCourse.vue";
 
 export default {
-  name: "professional-course",
+  name: "training-plan-course",
   components: {
     AddTrainingPlanCourse,
   },

+ 1 - 1
src/modules/target/components/training-plan/TrainingPlanCourseMatrix.vue

@@ -118,7 +118,7 @@ import {
 import { calcSum } from "@/plugins/utils";
 
 export default {
-  name: "professional-matrix",
+  name: "training-plan-course-matrix",
   props: {
     rowData: {
       type: Object,

+ 12 - 0
src/modules/target/router.js

@@ -1,4 +1,6 @@
 import TrainingPlanManage from "./views/TrainingPlanManage.vue";
+import CourseOutlineManage from "./views/CourseOutlineManage.vue";
+import CourseExamine from "./views/CourseExamine.vue";
 
 export default [
   {
@@ -6,4 +8,14 @@ export default [
     name: "CultureProgram",
     component: TrainingPlanManage,
   },
+  {
+    path: "/target/course-outline-manage",
+    name: "CourseOutlineManager",
+    component: CourseOutlineManage,
+  },
+  {
+    path: "/target/course-examine",
+    name: "CourseAssessmentSetting",
+    component: CourseExamine,
+  },
 ];

+ 2 - 2
src/modules/target/views/CourseExamine.vue

@@ -47,7 +47,7 @@
         <el-table-column prop="courseCode" label="课程代码"> </el-table-column>
         <el-table-column prop="outlineName" label="课程大纲名称">
         </el-table-column>
-        <el-table-column prop="evaluationMode" label="考核方式" width="100">
+        <el-table-column prop="evaluationMode" label="考核方式" width="120">
           <span slot-scope="scope">
             {{ scope.row.evaluationMode | evaluationModeFilter }}
           </span>
@@ -93,7 +93,7 @@
     </div>
     <!-- DetailCourseExamine -->
     <detail-course-examine
-      v-if="checkPrivilege('button', 'add')"
+      v-if="checkPrivilege('link', 'edit')"
       ref="DetailCourseExamine"
       :row-data="curRow"
       @modified="getList"

+ 6 - 5
src/modules/target/views/CourseOutlineManage.vue

@@ -42,7 +42,7 @@
       </el-form>
       <div class="part-box-action">
         <el-button
-          v-if="checkPrivilege('button', 'add')"
+          v-if="checkPrivilege('button', 'Save')"
           type="primary"
           icon="el-icon-add"
           @click="toAdd"
@@ -61,7 +61,8 @@
         ></el-table-column>
         <el-table-column prop="outlineName" label="课程大纲"> </el-table-column>
         <el-table-column prop="courseName" label="课程名称"> </el-table-column>
-        <el-table-column prop="credit" label="学分"> </el-table-column>
+        <el-table-column prop="credit" label="学分" width="80">
+        </el-table-column>
         <el-table-column prop="evaluationMode" label="考核方式">
           <span slot-scope="scope">
             {{ scope.row.evaluationMode | evaluationModeFilter }}
@@ -72,7 +73,7 @@
             {{ scope.row.courseType | courseTypeFilter }}
           </span>
         </el-table-column>
-        <el-table-column prop="semesterName" label="修读学期">
+        <el-table-column prop="semesterName" label="修读学期" width="200">
         </el-table-column>
         <el-table-column prop="cultureProgramName" label="所属培养方案">
         </el-table-column>
@@ -123,14 +124,14 @@
     </div>
     <!-- ModifyCourseOutline -->
     <modify-course-outline
-      v-if="checkPrivilege('button', 'add')"
+      v-if="checkPrivilege('button', 'Save') || checkPrivilege('link', 'edit')"
       ref="ModifyCourseOutline"
       :instance="curRow"
       @modified="getList"
     ></modify-course-outline>
     <!-- DetailCourseOutline -->
     <detail-course-outline
-      v-if="checkPrivilege('button', 'add')"
+      v-if="checkPrivilege('link', 'detail')"
       ref="DetailCourseOutline"
       :row-data="curRow"
       @modified="getList"

+ 1 - 1
src/modules/target/views/RequirementStatistics.vue

@@ -83,7 +83,7 @@ import { trainingPlanListPage } from "../api";
 import DetailRequirementStatistics from "../components/requirement-statistics/DetailRequirementStatistics.vue";
 
 export default {
-  name: "training-plan-manage",
+  name: "requirement-statistics",
   components: { DetailRequirementStatistics },
   data() {
     return {

+ 2 - 0
src/store.js

@@ -14,6 +14,7 @@ import base from "./modules/base/store";
 import baseConfigs from "./modules/analysis/components/baseConfig/baseConfigsStore";
 import markParam from "./modules/mark/components/markParam/store";
 import report from "./modules/mark/components/report/store";
+import target from "./modules/target/store";
 
 export default new Vuex.Store({
   state: {
@@ -38,5 +39,6 @@ export default new Vuex.Store({
     baseConfigs,
     markParam,
     report,
+    target,
   },
 });