ソースを参照

题目编辑bug

zhangjie 2 年 前
コミット
ebfe9a9ccb

+ 41 - 0
src/assets/styles/pages.scss

@@ -914,3 +914,44 @@
     }
   }
 }
+
+// build-paper
+.build-paper {
+  .part-box-header {
+    h1.part-box-title {
+      display: inline-block;
+      vertical-align: middle;
+    }
+    span {
+      display: inline-block;
+      vertical-align: middle;
+      margin-left: 15px;
+    }
+  }
+
+  .build-step-title {
+    padding-bottom: 20px;
+    border-bottom: 1px solid #f0f2f6;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+
+    > h3 {
+      font-size: 14px;
+      line-height: 20px;
+      font-weight: 600;
+      margin: 0;
+
+      &::before {
+        content: "";
+        display: inline-block;
+        vertical-align: middle;
+        width: 4px;
+        height: 10px;
+        border-radius: 2px;
+        background-color: $--color-primary;
+        margin-right: 10px;
+      }
+    }
+  }
+}

+ 12 - 0
src/modules/paper/api.js

@@ -0,0 +1,12 @@
+import { $httpWithMsg } from "../../plugins/axios";
+import { QUESTION_API } from "@/constants/constants";
+
+// common select
+export const courseQueryApi = (name, enable) => {
+  return $httpWithMsg.get(`${QUESTION_API}/course/query`, {
+    params: {
+      name,
+      enable: enable || undefined,
+    },
+  });
+};

+ 13 - 0
src/modules/paper/components/BuildPaperAuto.vue

@@ -0,0 +1,13 @@
+<template>
+  <div class="build-paper-auto">BuildPaperAuto</div>
+</template>
+
+<script>
+export default {
+  name: "BuildPaperAuto",
+  data() {
+    return {};
+  },
+  methods: {},
+};
+</script>

+ 13 - 0
src/modules/paper/components/BuildPaperManual.vue

@@ -0,0 +1,13 @@
+<template>
+  <div class="build-paper-manual">BuildPaperManual</div>
+</template>
+
+<script>
+export default {
+  name: "BuildPaperManual",
+  data() {
+    return {};
+  },
+  methods: {},
+};
+</script>

+ 17 - 0
src/modules/paper/components/BuildPaperSimple.vue

@@ -0,0 +1,17 @@
+<template>
+  <div class="build-paper-simple">
+    <div class="build-step-title">
+      <h3></h3>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "BuildPaperSimple",
+  data() {
+    return {};
+  },
+  methods: {},
+};
+</script>

+ 9 - 0
src/modules/paper/router.js

@@ -0,0 +1,9 @@
+import BuildPaper from "./views/BuildPaper.vue";
+
+export default [
+  {
+    path: "/build-paper/:courseId",
+    name: "BuildPaper",
+    component: BuildPaper,
+  },
+];

+ 127 - 0
src/modules/paper/views/BuildPaper.vue

@@ -0,0 +1,127 @@
+<template>
+  <div class="build-paper">
+    <div class="part-box">
+      <div class="part-box-header">
+        <div>
+          <h1 class="part-box-title">组卷</h1>
+          <span>课程代码:{{ modalForm.courseCode }}</span>
+          <span>课程名称:{{ modalForm.courseName }}</span>
+        </div>
+        <div>
+          <el-button
+            type="primary"
+            size="small"
+            icon="icon icon-save-white"
+            @click="confirm"
+            >确定</el-button
+          >
+          <el-button
+            type="danger"
+            size="small"
+            plain
+            icon="icon icon-back"
+            @click="toback"
+            >返回</el-button
+          >
+        </div>
+      </div>
+      <el-form class="part-filter-form" :model="modalForm" inline>
+        <el-form-item prop="paperName" label="试卷名称">
+          <el-input
+            v-model="modalForm.paperName"
+            placeholder="试卷名称"
+          ></el-input>
+        </el-form-item>
+        <el-form-item prop="genNumber" label="组卷套数">
+          <el-input-number
+            v-model="modalForm.genNumber"
+            :min="1"
+            :max="5"
+            :step="1"
+            step-strictly
+          ></el-input-number>
+        </el-form-item>
+        <el-form-item style="border: none">
+          <el-checkbox v-model="modalForm.topicRepeat"
+            >多套试卷间试题不能重复</el-checkbox
+          >
+        </el-form-item>
+      </el-form>
+      <el-form>
+        <el-form-item label="组卷模式" style="margin: 0">
+          <el-radio-group
+            v-model="modalForm.genModelType"
+            style="padding-left: 15px"
+          >
+            <el-radio
+              v-for="item in modelTypes"
+              :key="item.code"
+              :label="item.code"
+              >{{ item.name }}</el-radio
+            >
+          </el-radio-group>
+        </el-form-item>
+      </el-form>
+    </div>
+
+    <div class="part-box">
+      <component
+        :is="buildCompName"
+        ref="BuildPaperDetail"
+        :course-id="modalForm.courseId"
+      ></component>
+    </div>
+  </div>
+</template>
+
+<script>
+import BuildPaperAuto from "../components/BuildPaperAuto.vue";
+import BuildPaperManual from "../components/BuildPaperManual.vue";
+import BuildPaperSimple from "../components/BuildPaperSimple.vue";
+
+export default {
+  name: "BuildPaper",
+  components: { BuildPaperAuto, BuildPaperManual, BuildPaperSimple },
+  data() {
+    return {
+      modalForm: {
+        courseId: "",
+        courseCode: "",
+        courseName: "",
+        paperName: "",
+        genNumber: 1,
+        topicRepeat: false,
+        genModelType: "simple",
+      },
+      modelTypes: [
+        {
+          code: "simple",
+          name: "简易成卷",
+        },
+        {
+          code: "auto",
+          name: "自动成卷",
+        },
+        {
+          code: "manual",
+          name: "手动组卷",
+        },
+      ],
+    };
+  },
+  computed: {
+    buildCompName() {
+      return `build-paper-${this.modalForm.genModelType}`;
+    },
+  },
+  created() {
+    this.modalForm.courseId = this.$route.params.courseId;
+  },
+  methods: {
+    confirm() {},
+    toback() {
+      window.history.go(-1);
+    },
+  },
+};
+</script>

+ 1 - 0
src/modules/question/components/edit/BankedClozeQuestion.vue

@@ -196,6 +196,7 @@ export default {
     addSubQuestion(index = null) {
       let newQuestion = getMatchQuestionModel();
       newQuestion.questionKey = randomCode();
+      newQuestion.courseId = this.question.courseId;
       const nindex =
         index === null ? this.modalForm.subQuestions.length : index + 1;
       this.modalForm.subQuestions.splice(nindex, 0, newQuestion);

+ 1 - 0
src/modules/question/components/edit/NestedQuestion.vue

@@ -163,6 +163,7 @@ export default {
     addSubQuestion(questionType, index = null) {
       let newQuestion = getInitQuestionModel(questionType);
       newQuestion.questionKey = randomCode();
+      newQuestion.courseId = this.question.courseId;
       const nindex =
         index === null ? this.modalForm.subQuestions.length : index + 1;
       this.modalForm.subQuestions.splice(nindex, 0, newQuestion);

+ 1 - 0
src/modules/question/components/model/questionModel.js

@@ -127,6 +127,7 @@ export const getInitQuestionModel = (qtype) => {
 export const getMatchQuestionModel = () => {
   return {
     number: 1,
+    courseId: "",
     quesAnswer: null,
     difficulty: "易",
     quesProperties: [],

+ 2 - 1
src/modules/questions/routes/routes.js

@@ -11,7 +11,8 @@ import PropertyInfo from "../views/PropertyInfo.vue";
 import ImportPaper from "../../question/views/QuestionManage";
 import GenPaper from "../views/GenPaper.vue";
 import ImportPaperInfo from "../views/ImportPaperInfo.vue";
-import GenPaperDetail from "../views/GenPaperDetail.vue";
+// import GenPaperDetail from "../views/GenPaperDetail.vue";
+import GenPaperDetail from "../../paper/views/BuildPaper.vue";
 import Question from "../views/Question.vue";
 import EditSelectQuestion from "../views/EditSelectQuestion.vue";
 import EditOtherQuestion from "../views/EditOtherQuestion.vue";