xiatian 3 lat temu
rodzic
commit
be4d005753

+ 15 - 0
src/modules/questions/styles/EditPaper.css

@@ -206,6 +206,21 @@ textarea {
   align-content: flex-start;
   gap: 5px;
 }
+.ques-tag-main2 {
+  padding: 5px;
+  display: flex;
+  flex-wrap: wrap;
+  align-content: flex-start;
+  gap: 5px;
+}
+.ques-tag-main3 {
+  padding: 5px;
+  display: flex;
+  flex-wrap: wrap;
+  align-content: flex-start;
+  line-height: 50px;
+  gap: 5px;
+}
 
 .ques-tag-container {
   border-radius: 5px;

+ 93 - 0
src/modules/questions/views/AuditInfo.vue

@@ -0,0 +1,93 @@
+<template>
+  <section class="content">
+    <div class="box-body">
+      <el-table
+        :data="auditInfoList"
+        border
+        style="width: 100%; text-align: center"
+      >
+        <el-table-column
+          prop="operateUserName"
+          label="执行人"
+        ></el-table-column>
+        <el-table-column prop="operateTime" label="执行时间"></el-table-column>
+        <el-table-column prop="operate" label="执行事项"></el-table-column>
+        <el-table-column prop="auditRemark" label="审核意见"></el-table-column>
+      </el-table>
+      <div class="page pull-right">
+        <el-pagination
+          :current-page="auditInfoCurPage"
+          :page-size="auditInfoPageSize"
+          :page-sizes="[10, 20, 50, 100, 200, 300]"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="auditInfoTotal"
+          @current-change="auditInfoCurChange"
+          @size-change="handleAuditInfoSizeChange"
+        ></el-pagination>
+      </div>
+      <div style="margin-top: 10px"></div>
+    </div>
+  </section>
+</template>
+<script>
+import { QUESTION_API } from "@/constants/constants.js";
+import { mapState } from "vuex";
+
+export default {
+  props: {
+    paperId: {
+      type: String,
+      default: "",
+    },
+  },
+  data() {
+    return {
+      auditInfoLoading: false,
+      auditInfoList: [],
+      auditInfoCurPage: 1,
+      auditInfoPageSize: 10,
+      auditInfoTotal: 10,
+    };
+  },
+  computed: {
+    ...mapState({ user: (state) => state.user }),
+  },
+  //初始化查询
+  created() {
+    this.auditInfoSearch(1);
+  },
+  methods: {
+    auditInfoSearch(curPage) {
+      this.auditInfoLoading = true;
+      var url =
+        QUESTION_API +
+        "/paper/audit/page/" +
+        curPage +
+        "/" +
+        this.auditInfoPageSize +
+        "?paperId=" +
+        this.paperId;
+      this.$httpWithMsg
+        .get(url)
+        .then((response) => {
+          this.auditInfoList = response.data.content;
+          this.auditInfoTotal = response.data.totalElements;
+          this.auditInfoLoading = false;
+        })
+        .catch(function () {
+          this.auditInfoLoading = false;
+        });
+    },
+    auditInfoCurChange(val) {
+      this.auditInfoCurPage = val;
+      this.auditInfoSearch(val);
+    },
+    handleAuditInfoSizeChange(val) {
+      this.auditInfoPageSize = val;
+      this.auditInfoSearch(val);
+    },
+  },
+};
+</script>
+<style scoped src="../styles/EditPaper.css"></style>
+<style scoped src="../styles/Common.css"></style>

+ 60 - 4
src/modules/questions/views/EditPaper.vue

@@ -101,13 +101,23 @@
     <div class="edit-paper-top2">
       <div class="edit-paper-top-inline">
         <div class="paper-top-left-div">
-          <el-button type="primary" size="small" @click="savePaper">
-            保存
+          <el-button type="primary" size="small" @click="showBasicDialog">
+            基础构成
+          </el-button>
+        </div>
+        <div class="paper-top-left-div">
+          <el-button type="primary" size="small" @click="showTypeDialog">
+            题型分布
           </el-button>
         </div>
         <div class="paper-top-left-div">
-          <el-button type="primary" size="small" @click="savePaper">
-            保存2
+          <el-button type="primary" size="small" @click="showBlueDialog">
+            蓝图分布
+          </el-button>
+        </div>
+        <div class="paper-top-left-div">
+          <el-button type="primary" size="small" @click="showAuditDialog">
+            审核记录
           </el-button>
         </div>
 
@@ -970,6 +980,28 @@
           }}</span>
         </div>
       </el-dialog>
+      <el-dialog title="基础构成" width="80%" :visible.sync="basicDialog">
+        <PaperBasicComposition
+          v-if="basicDialog"
+          :paper-id="paperId"
+        ></PaperBasicComposition>
+      </el-dialog>
+      <el-dialog title="题型分布" width="80%" :visible.sync="typeDialog">
+        <PaperQuestionType
+          v-if="typeDialog"
+          :paper-id="paperId"
+        ></PaperQuestionType>
+      </el-dialog>
+      <el-dialog title="蓝图分布" width="80%" :visible.sync="blueDialog">
+        <PaperBlue
+          v-if="blueDialog"
+          :paper-id="paperId"
+          :course-code="paper.course.code"
+        ></PaperBlue>
+      </el-dialog>
+      <el-dialog title="审核记录" width="80%" :visible.sync="auditInfoDialog">
+        <AuditInfo v-if="auditInfoDialog" :paper-id="paperId"></AuditInfo>
+      </el-dialog>
     </div>
   </div>
 </template>
@@ -981,15 +1013,27 @@ import { mapState } from "vuex";
 import reduplicate_mark from "../component/reduplicate_mark.vue";
 import randomColor from "randomcolor";
 import ckeditor from "../component/ckeditor.vue";
+import PaperBasicComposition from "./PaperBasicComposition.vue";
+import PaperQuestionType from "./PaperQuestionType.vue";
+import PaperBlue from "./PaperBlue.vue";
+import AuditInfo from "./AuditInfo.vue";
 
 export default {
   name: "EditPaperApp",
   components: {
     reduplicate_mark,
     ckeditor,
+    PaperBasicComposition,
+    PaperQuestionType,
+    PaperBlue,
+    AuditInfo,
   },
   data() {
     return {
+      auditInfoDialog: false,
+      blueDialog: false,
+      typeDialog: false,
+      basicDialog: false,
       quesAnswerShow: true,
       quesTagShow: true,
       hValue: "100px",
@@ -1136,6 +1180,18 @@ export default {
     };
   },
   methods: {
+    showAuditDialog() {
+      this.auditInfoDialog = true;
+    },
+    showBlueDialog() {
+      this.blueDialog = true;
+    },
+    showTypeDialog() {
+      this.typeDialog = true;
+    },
+    showBasicDialog() {
+      this.basicDialog = true;
+    },
     quesAnswerShowHide() {
       this.quesAnswerShow = !this.quesAnswerShow;
       sessionStorage.setItem("quesAnswerShow", this.quesAnswerShow);

+ 8 - 71
src/modules/questions/views/ImportPaper.vue

@@ -419,38 +419,11 @@
         </el-row>
       </el-form>
     </el-dialog>
-    <el-dialog
-      v-loading="auditInfoLoading"
-      title="审核记录"
-      width="60%"
-      :visible.sync="auditInfoDialog"
-      element-loading-text="拼命加载中"
-    >
-      <el-table
-        :data="auditInfoList"
-        border
-        style="width: 100%; text-align: center"
-      >
-        <el-table-column
-          prop="operateUserName"
-          label="执行人"
-        ></el-table-column>
-        <el-table-column prop="operateTime" label="执行时间"></el-table-column>
-        <el-table-column prop="operate" label="执行事项"></el-table-column>
-        <el-table-column prop="auditRemark" label="审核意见"></el-table-column>
-      </el-table>
-      <div class="page pull-right">
-        <el-pagination
-          :current-page="auditInfoCurPage"
-          :page-size="auditInfoPageSize"
-          :page-sizes="[10, 20, 50, 100, 200, 300]"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="auditInfoTotal"
-          @current-change="auditInfoChange"
-          @size-change="handleAuditInfoSizeChange"
-        ></el-pagination>
-      </div>
-      <div style="margin-top: 10px"></div>
+    <el-dialog title="审核记录" width="80%" :visible.sync="auditInfoDialog">
+      <AuditInfo
+        v-if="auditInfoDialog"
+        :paper-id="auditInfoPaperId"
+      ></AuditInfo>
     </el-dialog>
   </section>
 </template>
@@ -460,17 +433,13 @@ import { QUESTION_API } from "@/constants/constants";
 import { LEVEL_TYPE, PUBLICITY_LIST } from "../constants/constants";
 import { mapState } from "vuex";
 import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
+import AuditInfo from "./AuditInfo.vue";
 export default {
-  components: { LinkTitlesCustom },
+  components: { LinkTitlesCustom, AuditInfo },
   data() {
     return {
-      auditInfoPaperId: "",
-      auditInfoLoading: false,
+      auditInfoPaperId: null,
       auditInfoDialog: false,
-      auditInfoList: [],
-      auditInfoCurPage: 1,
-      auditInfoPageSize: 10,
-      auditInfoTotal: 10,
       courseLoading: false,
       quesLoading: false,
       formSearch: {
@@ -558,41 +527,9 @@ export default {
     this.initVue();
   },
   methods: {
-    auditInfoSearch(curPage) {
-      this.auditInfoLoading = true;
-      var url =
-        QUESTION_API +
-        "/paper/audit/page/" +
-        curPage +
-        "/" +
-        this.auditInfoPageSize +
-        "?paperId=" +
-        this.auditInfoPaperId;
-      this.$httpWithMsg
-        .get(url)
-        .then((response) => {
-          this.auditInfoList = response.data.content;
-          this.auditInfoTotal = response.data.totalElements;
-          this.auditInfoLoading = false;
-        })
-        .catch(function () {
-          this.auditInfoLoading = false;
-        });
-    },
     auditInfo(row) {
-      this.auditInfoList = [];
-      this.auditInfoTotal = 0;
       this.auditInfoPaperId = row.id;
       this.auditInfoDialog = true;
-      this.auditInfoSearch(1);
-    },
-    auditInfoCurChange(val) {
-      this.auditInfoCurPage = val;
-      this.auditInfoSearch(val);
-    },
-    handleAuditInfoSizeChange(val) {
-      this.auditInfoPageSize = val;
-      this.auditInfoSearch(val);
     },
     searchFrom() {
       this.currentPage = 1;

+ 75 - 0
src/modules/questions/views/PaperBasicComposition.vue

@@ -0,0 +1,75 @@
+<template>
+  <section class="content">
+    <div class="box-body">
+      <div class="ques-tag-main2">
+        <div>整卷属性</div>
+        <div
+          v-for="(paperTag, tagIndex) in paperData.tags"
+          :key="tagIndex"
+          class="ques-tag-container"
+        >
+          <div class="ques-tag">
+            <div class="ques-tag-title">{{ paperTag.tag }}</div>
+            <div>{{ paperTag.content }}</div>
+          </div>
+        </div>
+      </div>
+      <div class="ques-tag-main2">
+        <div>组成结构</div>
+        <div style="width: 100%">
+          <el-table :data="paperData.data" border>
+            <el-table-column
+              v-for="(colval, colIndex) in paperData.head"
+              :key="colIndex"
+              width="100"
+            >
+              <template slot="header">
+                <span style="margin-left: 10px">{{ colval }}</span>
+              </template>
+              <template slot-scope="scope">
+                <span style="margin-left: 10px">{{ scope.row[colIndex] }}</span>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
+    </div>
+  </section>
+</template>
+<script>
+import { QUESTION_API } from "@/constants/constants.js";
+import { mapState } from "vuex";
+
+export default {
+  props: {
+    paperId: {
+      type: String,
+      default: "",
+    },
+  },
+  data() {
+    return {
+      paperData: {},
+      loading: false,
+    };
+  },
+  computed: {
+    ...mapState({ user: (state) => state.user }),
+  },
+  //初始化查询
+  created() {
+    this.init();
+  },
+  methods: {
+    init() {
+      this.$http
+        .get(QUESTION_API + "/paper/basic/composition?id=" + this.paperId)
+        .then((response) => {
+          this.paperData = response.data;
+        });
+    },
+  },
+};
+</script>
+<style scoped src="../styles/EditPaper.css"></style>
+<style scoped src="../styles/Common.css"></style>

+ 155 - 0
src/modules/questions/views/PaperBlue.vue

@@ -0,0 +1,155 @@
+<template>
+  <section class="content">
+    <div class="box-body">
+      <div class="ques-tag-main3">
+        <div>可选属性</div>
+        <div>
+          <el-select
+            v-model="coursePropertyId"
+            placeholder="属性名"
+            @change="onSelChange"
+          >
+            <el-option
+              v-for="item in coursePropertyList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+        </div>
+      </div>
+      <div class="ques-tag-main2">
+        <div style="width: 100%">
+          <el-table
+            :data="paperData.data"
+            style="width: 100%"
+            border
+            :span-method="objectSpanMethod"
+          >
+            <el-table-column label="蓝图属性" align="center">
+              <el-table-column
+                v-for="(colval, colIndex) in headFirst"
+                :key="colIndex"
+                width="120"
+              >
+                <template slot="header">
+                  <span style="margin-left: 10px">{{ colval }}</span>
+                </template>
+                <template slot-scope="scope">
+                  <span style="margin-left: 10px">{{
+                    scope.row[colIndex]
+                  }}</span>
+                </template>
+              </el-table-column>
+            </el-table-column>
+            <el-table-column label="大题" align="center">
+              <el-table-column
+                v-for="(colval, colIndex) in headSecond"
+                :key="colIndex"
+                width="120"
+              >
+                <template slot="header">
+                  <span style="margin-left: 10px">{{ colval }}</span>
+                </template>
+                <template slot-scope="scope">
+                  <span style="margin-left: 10px">{{
+                    scope.row[colIndex + 2]
+                  }}</span>
+                </template>
+              </el-table-column>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
+    </div>
+  </section>
+</template>
+<script>
+import { QUESTION_API } from "@/constants/constants.js";
+import { mapState } from "vuex";
+
+export default {
+  props: {
+    paperId: {
+      type: String,
+      default: "",
+    },
+    courseCode: {
+      type: String,
+      default: "",
+    },
+  },
+  data() {
+    return {
+      coursePropertyList: [],
+      paperData: {},
+      coursePropertyId: null,
+      loading: false,
+    };
+  },
+  computed: {
+    ...mapState({ user: (state) => state.user }),
+    headFirst: function () {
+      if (!this.paperData.head) {
+        return null;
+      }
+      return this.paperData.head.slice(0, 2);
+    },
+    headSecond: function () {
+      if (!this.paperData.head) {
+        return null;
+      }
+      return this.paperData.head.slice(2);
+    },
+  },
+  //初始化查询
+  created() {
+    this.init();
+  },
+  methods: {
+    onSelChange() {
+      this.$http
+        .get(
+          QUESTION_API +
+            "/paper/blue?id=" +
+            this.paperId +
+            "&coursePropertyId=" +
+            this.coursePropertyId +
+            "&rootOrgId=" +
+            this.user.rootOrgId
+        )
+        .then((response) => {
+          this.paperData = response.data;
+        });
+    },
+    objectSpanMethod({ rowIndex, columnIndex }) {
+      if (columnIndex === 0) {
+        for (let span of this.paperData.rowspan) {
+          if (span[0] == rowIndex) {
+            return {
+              rowspan: span[1] - span[0] + 1,
+              colspan: 1,
+            };
+          } else if (span[0] < rowIndex && span[1] >= rowIndex) {
+            return {
+              rowspan: 0,
+              colspan: 0,
+            };
+          }
+        }
+      }
+    },
+
+    init() {
+      this.$http
+        .get(QUESTION_API + "/courseProperty/enable/" + this.courseCode)
+        .then((response) => {
+          this.coursePropertyList = response.data;
+        });
+    },
+  },
+};
+</script>
+<style scoped src="../styles/EditPaper.css"></style>
+<style scoped src="../styles/Common.css"></style>

+ 145 - 0
src/modules/questions/views/PaperQuestionType.vue

@@ -0,0 +1,145 @@
+<template>
+  <section class="content">
+    <div class="box-body">
+      <div class="ques-tag-main3">
+        <div>统计维度</div>
+        <div>
+          <el-select v-model="type" @change="onSelChange">
+            <el-option label="题数" value="count"></el-option>
+            <el-option label="分值" value="score"></el-option>
+          </el-select>
+        </div>
+      </div>
+      <div class="ques-tag-main2">
+        <div style="width: 100%">
+          <el-table
+            :data="paperData.data"
+            style="width: 100%"
+            border
+            :span-method="objectSpanMethod"
+          >
+            <el-table-column label="题型" align="center">
+              <el-table-column
+                v-for="(colval, colIndex) in headFirst"
+                :key="colIndex"
+                width="120"
+              >
+                <template slot="header">
+                  <span style="margin-left: 10px">{{ colval }}</span>
+                </template>
+                <template slot-scope="scope">
+                  <span style="margin-left: 10px">{{
+                    scope.row[colIndex]
+                  }}</span>
+                </template>
+              </el-table-column>
+            </el-table-column>
+            <el-table-column label="大题" align="center">
+              <el-table-column
+                v-for="(colval, colIndex) in headSecond"
+                :key="colIndex"
+                width="120"
+              >
+                <template slot="header">
+                  <span style="margin-left: 10px">{{ colval }}</span>
+                </template>
+                <template slot-scope="scope">
+                  <span style="margin-left: 10px">{{
+                    scope.row[colIndex + 2]
+                  }}</span>
+                </template>
+              </el-table-column>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
+    </div>
+  </section>
+</template>
+<script>
+import { QUESTION_API } from "@/constants/constants.js";
+import { mapState } from "vuex";
+
+export default {
+  props: {
+    paperId: {
+      type: String,
+      default: "",
+    },
+  },
+  data() {
+    return {
+      paperData: {},
+      type: "count",
+      loading: false,
+    };
+  },
+  computed: {
+    ...mapState({ user: (state) => state.user }),
+    headFirst: function () {
+      if (!this.paperData.head) {
+        return null;
+      }
+      return this.paperData.head.slice(0, 2);
+    },
+    headSecond: function () {
+      if (!this.paperData.head) {
+        return null;
+      }
+      return this.paperData.head.slice(2);
+    },
+  },
+  //初始化查询
+  created() {
+    this.init();
+  },
+  methods: {
+    onSelChange() {
+      this.init();
+    },
+    objectSpanMethod({ rowIndex, columnIndex }) {
+      // console.log(row, column);
+      if (columnIndex === 0 && rowIndex === 0) {
+        return {
+          rowspan: 5,
+          colspan: 1,
+        };
+      }
+      if (columnIndex === 0 && rowIndex > 0 && rowIndex < 5) {
+        return {
+          rowspan: 0,
+          colspan: 0,
+        };
+      }
+      if (columnIndex === 0 && rowIndex === 5) {
+        return {
+          rowspan: 4,
+          colspan: 1,
+        };
+      }
+      if (columnIndex === 0 && rowIndex > 5 && rowIndex < 9) {
+        return {
+          rowspan: 0,
+          colspan: 0,
+        };
+      }
+    },
+
+    init() {
+      this.$http
+        .get(
+          QUESTION_API +
+            "/paper/question/type?id=" +
+            this.paperId +
+            "&type=" +
+            this.type
+        )
+        .then((response) => {
+          this.paperData = response.data;
+        });
+    },
+  },
+};
+</script>
+<style scoped src="../styles/EditPaper.css"></style>
+<style scoped src="../styles/Common.css"></style>