zhangjie 2 rokov pred
rodič
commit
74cb2ae0bd

+ 5 - 0
src/components/ProjectsSelect.vue

@@ -27,10 +27,12 @@ const {
   value = null,
   rootOrgId = -1,
   disabled = false,
+  disableIds = [],
 } = defineProps<{
   value?: number | number[];
   rootOrgId: number;
   disabled?: boolean;
+  disableIds?: number[];
 }>();
 const emit = defineEmits(["update:value"]);
 
@@ -45,6 +47,9 @@ async function fetchData() {
     pageSize: 100,
   });
   optionList = res.data.content;
+  if (disableIds && disableIds.length) {
+    optionList = optionList.filter((item) => !disableIds.includes(item.id));
+  }
 }
 onMounted(fetchData);
 onUpdated(fetchData);

+ 5 - 0
src/features/paperAnalysis/SelectProject.vue

@@ -11,6 +11,7 @@
         <ProjectsSelect
           v-model:value="projectId"
           :rootOrgId="rootOrgId"
+          :disableIds="props.disableIds"
           placeholder="请选择对比项目"
           style="width: 400px"
         />
@@ -23,6 +24,10 @@
 import { useMainStore } from "@/store";
 import { onMounted } from "vue";
 
+const props = defineProps<{
+  disableIds?: number[];
+}>();
+
 const emit = defineEmits(["confirm"]);
 
 let rootOrgId = $ref(undefined as unknown as number);

+ 9 - 2
src/features/report/ReportBatchDownload.vue

@@ -6,7 +6,11 @@
     <iframe :src="reportPreviewUrl" frameborder="0"></iframe>
   </div>
 
-  <SelectProject ref="selectProjectRef" @confirm="projectSelected" />
+  <SelectProject
+    ref="selectProjectRef"
+    :disableIds="[props.curProject.id]"
+    @confirm="projectSelected"
+  />
 
   <a-modal
     v-model:visible="loadModalVisible"
@@ -48,7 +52,7 @@ import {
   getProjectReportResult,
 } from "@/api/allAnalysisPage";
 import { useRouter } from "vue-router";
-import { onBeforeMount, onMounted } from "vue";
+import { onBeforeMount, onMounted, nextTick } from "vue";
 import { downloadByLink } from "@/utils/utils";
 const router = useRouter();
 
@@ -222,6 +226,9 @@ function registWindowSubmit() {
     finishPaperIds.push(curPaperId as number);
     updateProgress(getPaperProgress());
 
+    reportPreviewUrl = "";
+    await nextTick();
+
     await startTask();
   };
 }

+ 1 - 3
src/features/report/ReportDiscrimination.vue

@@ -62,9 +62,7 @@ function chartOption() {
     },
     yAxis: {
       type: "value",
-      min: 0,
-      max: 1,
-      splitNumber: 10,
+      interval: 0.1,
       axisLine: {
         show: false,
       },

+ 72 - 19
src/features/report/ReportQuestionGroup.vue

@@ -1,5 +1,9 @@
 <template>
-  <div class="report-page report-question">
+  <div
+    v-for="(quesGroup, qindex) in questionGroupData"
+    :key="qindex"
+    class="report-page report-question"
+  >
     <div class="report-body">
       <div class="report-body-head">
         <h2>{{ props.partNo }}、试题难度分组分布</h2>
@@ -11,31 +15,24 @@
           <colgroup>
             <col style="width: 30px" />
             <col style="width: 30px" />
-            <col
-              v-for="(item, index) in props.paper.totalScore / scoreGap"
-              :key="index"
-            />
+            <col v-for="columnIndex in quesGroup.column" :key="columnIndex" />
           </colgroup>
           <tr>
             <th>大题号</th>
             <th>小题号</th>
-            <template
-              v-for="(item, index) in props.paper.totalScore / scoreGap"
-              :key="index"
-            >
-              <th v-if="index >= limitScoreIndex">{{ index * scoreGap }}-</th>
-            </template>
+
+            <th v-for="columnIndex in quesGroup.column" :key="columnIndex">
+              {{ columnIndex * scoreGap }}-
+            </th>
           </tr>
-          <tr v-for="(item, index) in props.questions" :key="index">
+          <tr v-for="(item, index) in quesGroup.datas" :key="index">
             <td>{{ item.mainNumber }}</td>
             <td>{{ item.subNumber }}</td>
             <template
               v-for="(item2, index2) in item.difficulityLevel"
               :key="index2"
             >
-              <td v-if="index2 >= limitScoreIndex" v-round-number>
-                {{ item2 }}
-              </td>
+              <td v-round-number>{{ item2 }}</td>
             </template>
           </tr>
         </table>
@@ -47,15 +44,71 @@
 
 <script setup lang="ts">
 import { SASQuestion, SASPaper } from "@/types";
-import { computed } from "vue";
+import { onMounted } from "vue";
 
 const props = defineProps<{
   questions: SASQuestion[];
   paper: SASPaper;
   partNo: string;
 }>();
-let limitScoreIndex = computed(() => {
-  return Math.floor(props.paper.startScore / scoreGap);
+
+const scoreGap = 10;
+
+interface QuestionGroupType {
+  column: number[];
+  datas: SASQuestion[];
+}
+let questionGroupData = $shallowRef<QuestionGroupType[]>([]);
+
+let scoreColumnGroup = $shallowRef<number[][]>([]);
+
+onMounted(() => {
+  initData();
 });
-let scoreGap = $ref(10);
+
+function initData() {
+  const totalScoreIndex = Math.floor(props.paper.totalScore / scoreGap) - 1;
+  const limitScoreIndex = Math.floor(props.paper.startScore / scoreGap);
+  const columnCount = totalScoreIndex - limitScoreIndex + 1;
+  const countsPerGroup = [8, 9, 10, 11, 12];
+  const remainCountsPerGroup = countsPerGroup.map((item) => columnCount % item);
+  const validRemainCountPerGroup = Math.max.apply(null, remainCountsPerGroup);
+  const validIndex = remainCountsPerGroup.indexOf(validRemainCountPerGroup);
+  const validCountPerGroup = countsPerGroup[validIndex];
+
+  let scoreColumn: number[] = [];
+  for (let index = limitScoreIndex; index <= totalScoreIndex; index++) {
+    if (scoreColumn.length >= validCountPerGroup) {
+      scoreColumnGroup.push(scoreColumn);
+      scoreColumn = [];
+    }
+    scoreColumn.push(index);
+  }
+  if (scoreColumn.length) {
+    scoreColumnGroup.push(scoreColumn);
+    scoreColumn = [];
+  }
+
+  const maxRowCount = 37;
+  const groupCount = Math.ceil(props.questions.length / maxRowCount);
+
+  let questionGroup: QuestionGroupType[] = [];
+  scoreColumnGroup.forEach((column) => {
+    const nQuestions = props.questions.map((item) => {
+      let nitem = { ...item };
+      nitem.difficulityLevel = column.map((ind) => item.difficulityLevel[ind]);
+      return nitem;
+    });
+
+    for (let i = 0; i < groupCount; i++) {
+      let datas = nQuestions.slice(i * maxRowCount, (i + 1) * maxRowCount);
+      questionGroup.push({
+        column,
+        datas,
+      });
+    }
+  });
+
+  questionGroupData = questionGroup;
+}
 </script>

+ 2 - 2
src/features/report/ReportScore.vue

@@ -2,7 +2,7 @@
   <div class="report-page report-score">
     <div class="report-body">
       <div class="report-body-head">
-        <h2>{{ props.partNo }}、科目成绩频分布</h2>
+        <h2>{{ props.partNo }}、科目成绩频分布</h2>
         <p class="report-name"></p>
       </div>
 
@@ -41,7 +41,7 @@
       </div>
 
       <div class="report-part score-chart chart-part">
-        <h4 class="report-part-title">频分布表({{ scoreGap }}分)</h4>
+        <h4 class="report-part-title">频分布表({{ scoreGap }}分)</h4>
         <v-chart
           :initOptions="{ renderer: 'svg' }"
           :option="chartOption()"

+ 0 - 460
src/features/report/assets/print-report.css

@@ -1,460 +0,0 @@
-/* common */
-.table {
-  width: 100%;
-  border-spacing: 0;
-  border-collapse: collapse;
-  text-align: left;
-}
-.table td,
-.table th {
-  padding: 8px 10px;
-  border: 1px solid #e1e5eb;
-}
-/* report */
-.report {
-  background-color: #f0f0f0;
-  color: #172c4d;
-  font-size: 15px;
-  user-select: text;
-}
-.report-page {
-  width: 793px;
-  height: 1120px;
-  position: relative;
-  padding: 80px 27px 67px;
-  page-break-after: always;
-  background-color: #e1e9f5;
-  margin: 10px auto;
-}
-.report.is-print .report-page {
-  margin: 0 auto;
-}
-.report-body-head {
-  position: absolute;
-  left: 27px;
-  top: 27px;
-  right: 27px;
-  height: 27px;
-  z-index: 9;
-
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-}
-.report-body-head > h2 {
-  font-size: 26px;
-  font-weight: bold;
-  line-height: 1;
-}
-.report-body-head > p {
-  font-size: 15px;
-  font-weight: 400;
-  color: #405980;
-  margin: 0;
-  width: 350px;
-  white-space: nowrap;
-  overflow: hidden;
-  text-overflow: ellipsis;
-}
-
-.report-phead {
-  position: absolute;
-  top: 27px;
-  left: 53px;
-  right: 53px;
-  z-index: 9;
-
-  height: 16px;
-  font-size: 15px;
-  font-weight: 400;
-  color: #405980;
-  line-height: 1;
-}
-.report-phead > p {
-  width: 580px;
-  white-space: nowrap;
-  overflow: hidden;
-  text-overflow: ellipsis;
-}
-.report-phead::after {
-  content: "";
-  position: absolute;
-  top: 7px;
-  right: 0;
-  width: 93px;
-  height: 3px;
-  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEYAAAACCAYAAADl56r+AAAAAXNSR0IArs4c6QAAADlJREFUKFNjZEj5/5+BCNAjTIQiBgaGojOZRClk1L9MlDoGk5dEqbPWv0OUumNPpxOljnE0YLCHEwD/nBSjeg9W+wAAAABJRU5ErkJggg==");
-  background-repeat: no-repeat;
-  background-size: 100% 100%;
-}
-.report-pfoot {
-  position: absolute;
-  bottom: 27px;
-  left: 53px;
-  right: 53px;
-  z-index: 9;
-
-  height: 13px;
-  font-size: 13px;
-  font-weight: 400;
-  color: #405980;
-  line-height: 1;
-  text-align: right;
-}
-.report-pfoot::after {
-  content: "";
-  position: absolute;
-  top: 5px;
-  left: 0;
-  width: 93px;
-  height: 3px;
-  background-image: url(./bg-color.png);
-  background-repeat: no-repeat;
-  background-size: 100% 100%;
-}
-
-.report-part {
-  padding: 27px;
-  border-radius: 5px;
-  background-color: #fff;
-  position: relative;
-}
-.report-part:not(:last-child) {
-  margin-bottom: 13px;
-}
-.report-part-title {
-  height: 20px;
-  font-size: 20px;
-  font-weight: bold;
-  line-height: 1;
-}
-
-.part-intro {
-  line-height: 27px;
-}
-.part-intro span {
-  font-weight: 600;
-}
-.chart-part .report-part-title {
-  position: absolute;
-  top: 27px;
-  z-index: 9;
-}
-
-/* report cover */
-.report-cover {
-  background-color: #fff;
-  color: #fff;
-}
-.report-cover-bg {
-  position: absolute;
-  width: 100%;
-  height: 100%;
-  top: 0;
-  left: 0;
-  z-index: 1;
-}
-.report-cover-bg img {
-  display: block;
-  width: 100%;
-  height: 100%;
-}
-.report-cover .report-body {
-  position: relative;
-  z-index: 2;
-}
-.report-cover .cover-title {
-  position: absolute;
-  font-size: 59px;
-  font-weight: 600;
-  line-height: 83px;
-  top: 149px;
-  left: 107px;
-  color: #fff;
-}
-.report-cover .cover-info {
-  position: absolute;
-  width: 580px;
-  left: 107px;
-  bottom: 107px;
-  font-weight: 400;
-  line-height: 23px;
-}
-.report-cover .cover-info p {
-  margin-top: 13px;
-}
-
-.report-intro,
-.report-noun {
-  background-color: #fff;
-  background-image: none;
-  padding: 83px 53px 93px;
-}
-
-.intro-title {
-  height: 27px;
-  font-size: 27px;
-  font-weight: bold;
-  line-height: 1;
-  margin-bottom: 27px;
-}
-
-.intro-title + p {
-  font-weight: 400;
-  line-height: 27px;
-  margin-bottom: 27px;
-}
-
-.intro-table th {
-  background-color: #0091ff;
-  color: #fff;
-  border-color: rgba(255, 255, 255, 0.1);
-}
-.intro-table td:first-child,
-.intro-table th:first-child {
-  text-align: center;
-}
-.intro-table td,
-.intro-table th {
-  line-height: 24px;
-}
-
-.noun-title {
-  height: 27px;
-  font-size: 27px;
-  font-weight: bold;
-  line-height: 1;
-  margin-bottom: 20px;
-}
-.noun-item {
-  padding: 20px 0;
-  border-bottom: 1px solid #e1e5eb;
-  min-height: 75px;
-}
-.noun-item .noun-label {
-  float: left;
-  width: 107px;
-  line-height: 32px;
-  height: 32px;
-  text-align: center;
-  color: #fff;
-  font-weight: bold;
-}
-.noun-item .noun-content {
-  margin-left: 131px;
-  font-weight: 400;
-  line-height: 27px;
-}
-
-.noun-item:nth-of-type(1) .noun-label {
-  background-color: #6236ff;
-}
-.noun-item:nth-of-type(2) .noun-label {
-  background-color: #0091ff;
-}
-.noun-item:nth-of-type(3) .noun-label {
-  background-color: #32c5ff;
-}
-.noun-item:nth-of-type(4) .noun-label {
-  background-color: #44d7b6;
-}
-.noun-item:nth-of-type(5) .noun-label {
-  background-color: #6dd400;
-}
-.noun-item:nth-of-type(6) .noun-label {
-  background-color: #f7b500;
-}
-.noun-item:nth-of-type(7) .noun-label {
-  background-color: #fa6400;
-}
-.noun-item:nth-of-type(8) .noun-label {
-  background-color: #e02020;
-}
-
-/* report compare */
-.summary-tabs {
-  margin-bottom: 5px;
-}
-.summary-tabs-item {
-  display: inline-block;
-  vertical-align: top;
-
-  background: rgba(0, 145, 255, 0.2);
-  border-radius: 1px;
-  padding: 8px 12px;
-  line-height: 21px;
-  margin-right: 5px;
-}
-.summary-tabs-item:nth-of-type(2) {
-  background: rgba(68, 215, 182, 0.2);
-}
-.summary-table td,
-.summary-table th {
-  text-align: center;
-  border-color: rgba(0, 0, 0, 0.1);
-}
-.summary-table th {
-  background-color: #0091ff;
-  color: #fff;
-  font-size: 15px;
-  padding: 5px 2px;
-  line-height: 18px;
-}
-.summary-table td {
-  font-size: 15px;
-  padding: 10px;
-  line-height: 20px;
-}
-.summary-table tr:nth-of-type(2) {
-  background: rgba(0, 145, 255, 0.2);
-}
-.summary-table tr:nth-of-type(3) {
-  background: rgba(68, 215, 182, 0.2);
-}
-.compare-count {
-  height: 255px;
-}
-.compare-rate {
-  height: 345px;
-}
-.result-part {
-  min-height: 86px;
-  padding-left: 72px;
-}
-.result-part::before {
-  content: "";
-  position: absolute;
-  width: 32px;
-  height: 32px;
-  top: 50%;
-  margin-top: -16px;
-  left: 27px;
-  z-index: 9;
-
-  background-image: url(./bg-start.png);
-  background-repeat: no-repeat;
-  background-size: 100% 100%;
-}
-/* report summary */
-.summary-part .summary-title {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  height: 48px;
-  background: #0091ff;
-  border-radius: 3px;
-  padding-left: 43px;
-  padding-right: 13px;
-  position: relative;
-  margin-bottom: 12px;
-}
-.summary-part .summary-title::before {
-  content: "";
-  position: absolute;
-  width: 16px;
-  height: 19px;
-  top: 50%;
-  left: 13px;
-  margin-top: -8px;
-  border-radius: 3px;
-  border-bottom-right-radius: 9px;
-  background-color: #fff;
-}
-.summary-part .summary-title > div {
-  font-size: 15px;
-  font-weight: 600;
-  color: #ffffff;
-  line-height: 21px;
-}
-.summary-part .summary-title > div:nth-of-type(2) {
-  font-weight: 400;
-}
-.summary-part .summary-body {
-  font-size: 0px;
-  margin: 0 -6px;
-}
-.summary-part .summary-item {
-  display: inline-block;
-  vertical-align: top;
-  width: 33.33%;
-  padding: 0 6px;
-}
-.summary-part .summary-item-body {
-  height: 123px;
-  background: rgba(0, 145, 255, 0.1);
-  border-radius: 3px;
-  padding: 21px;
-}
-.summary-part .summary-item-body > p {
-  line-height: 21px;
-  font-size: 15px;
-  margin-bottom: 8px;
-}
-.summary-intro-title {
-  margin-bottom: 20px;
-}
-.summary-intro-item {
-  padding: 17px 0;
-  line-height: 32px;
-  font-weight: 400;
-}
-.summary-intro-item:not(:last-child) {
-  border-bottom: 1px solid #ebeff5;
-}
-.summary-intro-item span {
-  float: left;
-  height: 32px;
-  font-size: 16px;
-  font-weight: 600;
-  line-height: 32px;
-  padding: 0 5px;
-  margin-right: 11px;
-  background: #e1e9f5;
-  border-radius: 1px;
-}
-/* report score */
-.report-score .score-table {
-  height: 404px;
-}
-.report-score .score-table th {
-  border: none;
-  border-bottom: 1px solid #a3b4cc;
-  padding: 0;
-  height: 24px;
-}
-.report-score .score-table td {
-  border: none;
-  border-bottom: 1px solid #e1e5eb;
-  padding: 0;
-}
-.report-score .score-chart {
-  height: 277px;
-}
-.report-score .freq-chart {
-  height: 384px;
-}
-/* report question */
-.report-question .question-table {
-  text-align: center;
-}
-.report-question .question-table th {
-  height: 84px;
-  font-weight: 500;
-  line-height: 19px;
-  padding: 13px;
-
-  background: #f2f3f6;
-}
-.report-question .question-table td {
-  padding: 0;
-  height: 22px;
-  line-height: 1;
-}
-/* report difficulty */
-.diff-part {
-  height: 776px;
-}
-.report-question .question-group-table th {
-  padding: 0;
-  /* font-size: 14px; */
-}

+ 2 - 4
src/features/report/assets/report.css

@@ -411,14 +411,12 @@
   height: 404px;
 }
 .report-score .score-table th {
-  border: none;
-  border-bottom: 1px solid #a3b4cc;
+  border-color: transparent transparent #a3b4cc transparent;
   padding: 0;
   height: 24px;
 }
 .report-score .score-table td {
-  border: none;
-  border-bottom: 1px solid #e1e5eb;
+  border-color: transparent transparent #e1e5eb transparent;
   padding: 0;
 }
 .report-score .score-chart {

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
src/features/report/reportTemp.ts


Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov