Commit f356590c3d2d10238078742b5627013cf9497923

Authored by 阿宝
1 parent 4ad1ef07

即时测列表,分析页面

src/views/ask/index.vue
... ... @@ -77,10 +77,13 @@
77 77 >今天</span
78 78 >
79 79 <span @click="setDate(2)" :class="[date == 2 ? 'active' : '', 's1']"
80   - >昨天</span
  80 + >本周</span
81 81 >
82 82 <span @click="setDate(3)" :class="[date == 3 ? 'active' : '', 's1']"
83   - >本周</span
  83 + >本月</span
  84 + >
  85 + <span @click="setDate(4)" :class="[date == 4 ? 'active' : '', 's1']"
  86 + >本季度</span
84 87 >
85 88 </p>
86 89 <el-button type="primary" round @click="_QueryData()">筛选</el-button>
... ... @@ -460,9 +463,11 @@ export default {
460 463 });
461 464 },
462 465  
463   - setDate(index) {
  466 + setDate(index) {
464 467 const that = this;
465 468 this.date = index == this.date ? "" : index;
  469 + let aYear = new Date().getFullYear();
  470 + let aMonth = new Date().getMonth() + 1;
466 471 that.query.day = "";
467 472 that.query.startDay = "";
468 473 that.query.endDay = "";
... ... @@ -472,25 +477,36 @@ export default {
472 477 that.query.startDay = that.query.day;
473 478 that.query.endDay = that.query.day;
474 479 break;
475   - case 2: {
476   - let times = new Date().getTime() - 24 * 60 * 60 * 1000;
477   - that.query.day = formatDate(new Date(times), "yyyy-MM-dd");
478   - that.query.startDay = that.query.day;
479   - that.query.endDay = that.query.day;
480   - break;
481   - }
482   - case 3: {
  480 + case 2:
483 481 let day = new Date().getDay();
484 482 if (day == 0) {
485 483 //中国式星期天是一周的最后一天
486 484 day = 7;
487 485 }
488   - let times1 = new Date().getTime() - 24 * 60 * 60 * 1000 * (day - 1);
489   - let times2 = new Date().getTime() - 24 * 60 * 60 * 1000 * (day - 7);
490   - that.query.startDay = formatDate(new Date(times1), "yyyy-MM-dd");
491   - that.query.endDay = formatDate(new Date(times2), "yyyy-MM-dd");
  486 + let aTime = new Date().getTime() - 24 * 60 * 60 * 1000 * day;
  487 + that.query.startDay = formatDate(new Date(aTime), "yyyy-MM-dd");
  488 + that.query.endDay = formatDate(new Date(), "yyyy-MM-dd");
  489 + break;
  490 + case 3:
  491 + aMonth = aMonth < 10 ? "0" + aMonth : aMonth;
  492 + that.query.startDay = `${aYear}-${aMonth}-01`;
  493 + that.query.endDay = formatDate(new Date(), "yyyy-MM-dd");
  494 + break;
  495 + case 4:
  496 + if (aMonth > 1 && aMonth < 4) {
  497 + aMonth = "01";
  498 + } else if (aMonth > 3 && aMonth < 7) {
  499 + aMonth = "04";
  500 + } else if (aMonth > 6 && aMonth < 10) {
  501 + aMonth = "07";
  502 + } else {
  503 + aMonth = "10";
  504 + }
  505 +
  506 + aMonth = aMonth < 10 ? "0" + aMonth : aMonth;
  507 + that.query.startDay = `${aYear}-${aMonth}-01`;
  508 + that.query.endDay = formatDate(new Date(), "yyyy-MM-dd");
492 509 break;
493   - }
494 510 }
495 511 this.page = 1;
496 512 this._QueryData();
... ...
src/views/examinationPaper/add.vue
... ... @@ -95,8 +95,8 @@
95 95 </el-form-item>
96 96 <el-form-item label="分享范围:" prop="sharingType">
97 97 <el-radio-group v-model="form.sharingType">
98   - <el-radio :label="1">任课班级分享</el-radio>
99   - <el-radio :label="2">全年级分享</el-radio>
  98 + <el-radio :label="0">任课班级分享</el-radio>
  99 + <el-radio :label="1">全年级分享</el-radio>
100 100 </el-radio-group>
101 101 </el-form-item>
102 102 </el-form>
... ...
src/views/examinationPaper/index.vue
... ... @@ -381,8 +381,8 @@ export default {
381 381 const { data, status, info } = await this.$request.fetchPaperList({
382 382 ...query,
383 383 status: 1,
384   - // page: this.page,
385   - // size: this.size,
  384 + page: this.page,
  385 + size: this.size,
386 386 });
387 387 this.loading = false;
388 388 if (status === 0) {
... ...
src/views/test/analysis.vue
1 1 <template>
2   - <div>报表分析</div>
  2 + <div>
  3 + <back-box>
  4 + <template slot="title">
  5 + <span>单卷分析</span>
  6 + </template>
  7 + </back-box>
  8 + <div class="tips" v-if="paperModifyLog.modifiedTime">
  9 + <p class="tips-p">
  10 + <i class="fa fa-bell-o"></i>
  11 + {{
  12 + `${paperModifyLog.modifiedTime} ${paperModifyLog.realName}`
  13 + }}修改了答案,是否重新记分?
  14 + </p>
  15 + <div class="btn-box">
  16 + <el-button type="danger" round size="mini">重新计分</el-button>
  17 + <el-button type="danger" round plain size="mini">暂时不计</el-button>
  18 + </div>
  19 + </div>
  20 + <div class="page-content">
  21 + <div class="tab-box">
  22 + <span
  23 + class="tab-item"
  24 + :class="type == 1 ? 'active' : ''"
  25 + @click="type = 1"
  26 + >试题分析</span
  27 + >
  28 + <span
  29 + class="tab-item"
  30 + :class="type == 2 ? 'active' : ''"
  31 + @click="type = 2"
  32 + >成绩排名</span
  33 + >
  34 + <span
  35 + class="tab-item"
  36 + :class="type == 3 ? 'active' : ''"
  37 + @click="type = 3"
  38 + >小题分报表</span
  39 + >
  40 + <span
  41 + class="tab-item"
  42 + :class="type == 4 ? 'active' : ''"
  43 + @click="type = 4"
  44 + >作答明细表</span
  45 + >
  46 + </div>
  47 + <el-table
  48 + v-if="type == 1"
  49 + :data="tableData"
  50 + border
  51 + style="width: 100%"
  52 + :default-sort="{ prop: 'dadui', order: 'descending' }"
  53 + >
  54 + <el-table-column prop="questionIndex" label="题号" align="center"
  55 + ><template slot-scope="scoped"
  56 + >Q{{ scoped.row.questionIndex }}</template
  57 + ></el-table-column
  58 + >
  59 + <el-table-column
  60 + prop="questionType"
  61 + label="题型"
  62 + align="center"
  63 + ></el-table-column>
  64 + <el-table-column
  65 + prop="manfen"
  66 + label="满分值"
  67 + sortable
  68 + align="center"
  69 + ></el-table-column>
  70 + <el-table-column
  71 + prop="zuigao"
  72 + label="班最高分"
  73 + sortable
  74 + align="center"
  75 + ></el-table-column>
  76 + <el-table-column
  77 + prop="zuidi"
  78 + label="班最低分"
  79 + sortable
  80 + align="center"
  81 + ></el-table-column>
  82 + <el-table-column
  83 + prop="pingjun"
  84 + label="班平均分"
  85 + sortable
  86 + align="center"
  87 + ></el-table-column>
  88 + <el-table-column
  89 + prop="defenlv"
  90 + sortable
  91 + label="班级得分率"
  92 + align="center"
  93 + ><template slot-scope="scoped"
  94 + >{{ scoped.row.defenlv }}%</template
  95 + ></el-table-column
  96 + >
  97 + <el-table-column
  98 + prop="correctAnswer"
  99 + label="答案"
  100 + align="center"
  101 + ></el-table-column>
  102 + <el-table-column
  103 + prop="x1"
  104 + label="选项1"
  105 + align="center"
  106 + ></el-table-column>
  107 + <el-table-column
  108 + prop="x2"
  109 + label="选项1"
  110 + align="center"
  111 + ></el-table-column>
  112 + <el-table-column
  113 + prop="weida"
  114 + label="未答"
  115 + align="center"
  116 + ></el-table-column>
  117 + </el-table>
  118 + <el-table
  119 + v-if="type == 2"
  120 + :data="tableData2"
  121 + border
  122 + style="width: 100%"
  123 + :default-sort="{ prop: 'dadui', order: 'descending' }"
  124 + >
  125 + <el-table-column
  126 + prop="xuehao"
  127 + label="学号"
  128 + align="center"
  129 + fixed
  130 + ></el-table-column>
  131 + <el-table-column
  132 + prop="xingming"
  133 + label="姓名"
  134 + fixed
  135 + align="center"
  136 + ></el-table-column>
  137 + <el-table-column
  138 + prop="totalScore"
  139 + label="总分"
  140 + sortable
  141 + align="center"
  142 + ></el-table-column>
  143 + <el-table-column
  144 + prop="defenlv"
  145 + label="得分率"
  146 + sortable
  147 + align="center"
  148 + ></el-table-column>
  149 + <el-table-column
  150 + prop="rank"
  151 + label="班名"
  152 + sortable
  153 + align="center"
  154 + ></el-table-column>
  155 + <el-table-column label="客观题" align="center">
  156 + <el-table-column
  157 + prop="defen1"
  158 + label="得分"
  159 + align="center"
  160 + ></el-table-column>
  161 + <el-table-column
  162 + prop="defenlv1"
  163 + label="得分率"
  164 + align="center"
  165 + ></el-table-column>
  166 + </el-table-column>
  167 + <el-table-column label="主观题" align="center">
  168 + <el-table-column
  169 + prop="defen2"
  170 + label="得分"
  171 + align="center"
  172 + ></el-table-column>
  173 + <el-table-column
  174 + prop="defenlv2"
  175 + label="得分率"
  176 + align="center"
  177 + ></el-table-column>
  178 + </el-table-column>
  179 + </el-table>
  180 + <el-table
  181 + v-if="type == 3"
  182 + :data="tableData3"
  183 + border
  184 + style="width: 100%"
  185 + :default-sort="{ prop: '', order: 'descending' }"
  186 + >
  187 + <el-table-column
  188 + prop="xuehao"
  189 + label="学号"
  190 + align="center"
  191 + ></el-table-column>
  192 + <el-table-column
  193 + prop="xingming"
  194 + label="姓名"
  195 + align="center"
  196 + ></el-table-column>
  197 + <el-table-column
  198 + prop="totalScore"
  199 + label="总分"
  200 + sortable
  201 + align="center"
  202 + ></el-table-column>
  203 + <el-table-column label="分数组成" align="center">
  204 + <el-table-column
  205 + prop="keguan"
  206 + label="客观题分"
  207 + align="center"
  208 + ></el-table-column>
  209 + <el-table-column
  210 + prop="zhuguan"
  211 + label="主观题分"
  212 + align="center"
  213 + ></el-table-column>
  214 + </el-table-column>
  215 + <el-table-column
  216 + align="center"
  217 + v-for="(item, index) in questionList"
  218 + :key="index"
  219 + :label="item.title"
  220 +
  221 + >
  222 + <template v-for="items in item.subQuestions">
  223 + <el-table-column
  224 + :key="items.questionIndex"
  225 + :prop="'score' + items.questionIndex"
  226 + :label="`${items.questionIndex}`"
  227 + align="center"
  228 + ></el-table-column>
  229 + </template>
  230 + </el-table-column>
  231 + </el-table>
  232 + <el-table
  233 + v-if="type == 4"
  234 + :data="tableData4"
  235 + border
  236 + style="width: 100%"
  237 + :default-sort="{ prop: '', order: 'descending' }"
  238 + >
  239 + <el-table-column
  240 + prop="xuehao"
  241 + label="学号"
  242 + align="center"
  243 + ></el-table-column>
  244 + <el-table-column
  245 + prop="xingming"
  246 + label="姓名"
  247 + align="center"
  248 + ></el-table-column>
  249 + <el-table-column
  250 + prop="banji"
  251 + label="班级"
  252 + align="center"
  253 + ></el-table-column>
  254 + <el-table-column
  255 + prop="totalScore"
  256 + label="总分"
  257 + sortable
  258 + align="center"
  259 + ></el-table-column>
  260 + <el-table-column
  261 + align="center"
  262 + v-for="(item, index) in questionList"
  263 + :key="index"
  264 + :label="item.title"
  265 + >
  266 + <template v-for="items in item.subQuestions">
  267 + <el-table-column
  268 + :key="items.questionIndex"
  269 + :prop="'daan' + items.questionIndex"
  270 + :label="`${items.questionIndex}`"
  271 + align="center"
  272 + ></el-table-column>
  273 + </template>
  274 + </el-table-column>
  275 + </el-table>
  276 + </div>
  277 + </div>
3 278 </template>
4 279  
5 280 <script>
6 281 export default {
7   -
8   -}
  282 + data() {
  283 + return {
  284 + id: "",
  285 + type: 1,
  286 + paperModifyLog: {
  287 + realName: "张老师",
  288 + modifiedTime: "12-20",
  289 + },
  290 + tableData: [
  291 + {
  292 + questionIndex: 1,
  293 + questionType: "单选题",
  294 + manfen: 100,
  295 + zuigao: 100,
  296 + zuidi: 20,
  297 + pingjun: 80,
  298 + defenlv: 90,
  299 + correctAnswer: "A",
  300 + x1: "A",
  301 + x2: "B",
  302 + weida: "",
  303 + },
  304 + {
  305 + questionIndex: 2,
  306 + questionType: "单选题",
  307 + manfen: 100,
  308 + zuigao: 99,
  309 + zuidi: 50,
  310 + pingjun: 90,
  311 + defenlv: 100,
  312 + correctAnswer: "B",
  313 + x1: "A",
  314 + x2: "B",
  315 + weida: "",
  316 + },
  317 + ],
  318 + tableData2: [
  319 + {
  320 + xuehao: 1,
  321 + xingming: "丁芳菲",
  322 + totalScore: 5,
  323 + defenlv: 50,
  324 + rank: 1,
  325 + defen1: 1,
  326 + defenlv1: 1,
  327 + defen2: 1,
  328 + defenlv2: 1,
  329 + },
  330 + ],
  331 + tableData3: [
  332 + {
  333 + xuehao: 1,
  334 + xingming: "丁芳菲",
  335 + totalScore: 5,
  336 + rank: 1,
  337 + keguan: 20,
  338 + zhuguan: 20,
  339 + score1: 1,
  340 + score2: 2,
  341 + score3: 3,
  342 + score4: 4,
  343 + },
  344 + ],
  345 + tableData4: [
  346 + {
  347 + xuehao: 1,
  348 + xingming: "丁芳菲",
  349 + banji: 'xx',
  350 + totalScore: 5,
  351 + daan1: 1,
  352 + daan2: 2,
  353 + daan3: 3,
  354 + daan4: 4,
  355 + },
  356 + ],
  357 + questionList: [{
  358 + title:'大题1',
  359 + subQuestions:[
  360 + {questionIndex:1, daan:1},
  361 + {questionIndex:2, daan:1},
  362 + ]
  363 + },{
  364 + title:'大题2',
  365 + subQuestions:[
  366 + {questionIndex:3, daan:2},
  367 + {questionIndex:4, daan:2},
  368 + ]
  369 + }],
  370 + };
  371 + },
  372 + created() {
  373 + this.id = this.$route.query.id;
  374 + // this._QueryData()
  375 + },
  376 + methods: {
  377 + async _QueryData() {
  378 + let { data, info, status } = this.$request.quizDetail({
  379 + id: this.id,
  380 + });
  381 + },
  382 + },
  383 +};
9 384 </script>
10 385  
11   -<style>
12   -
  386 +<style lang="scss" scoped>
  387 +.page-content {
  388 + padding: 20px 20px 0;
  389 +}
  390 +.tips {
  391 + height: 48px;
  392 + box-sizing: border-box;
  393 + line-height: 48px;
  394 + padding: 0 16px;
  395 + border: 1px solid #fac7cc;
  396 + border-radius: 5px;
  397 + background-color: #ffebec;
  398 + font-size: 14px;
  399 + color: #fd9795;
  400 + margin: 10px 20px 20px 20px;
  401 + display: flex;
  402 + &-p {
  403 + flex: 1;
  404 + }
  405 + .fa-bell-o {
  406 + font-size: 18px;
  407 + margin-right: 5px;
  408 + }
  409 +}
  410 +.tab-box {
  411 + width: 800px;
  412 + margin: 0 auto 12px;
  413 + background: #f8f8f8;
  414 + border-radius: 20px;
  415 + display: flex;
  416 + user-select: none;
  417 + .tab-item {
  418 + flex: 1;
  419 + height: 40px;
  420 + line-height: 40px;
  421 + text-align: center;
  422 + font-size: 16px;
  423 + color: #666;
  424 + font-weight: 500;
  425 + background: transparent;
  426 + border-radius: 20px;
  427 + cursor: pointer;
  428 + &.active {
  429 + background: #667ffd;
  430 + color: #fff;
  431 + }
  432 + }
  433 +}
13 434 </style>
14 435 \ No newline at end of file
... ...
src/views/test/index.vue
1 1 <template>
2   - <div>即时测报表
3   - <router-link to="/TestAnalysis">报表分析</router-link>
4   -
  2 + <div>
  3 + <back-box>
  4 + <template slot="title">
  5 + <span>即时测-数据报表</span>
  6 + </template>
  7 + </back-box>
  8 + <div class="answer-header">
  9 + <div class="sel-box">
  10 + <el-select
  11 + class="sel"
  12 + v-model="query.classId"
  13 + placeholder="选择班级"
  14 + @change="changClazz"
  15 + >
  16 + <el-option
  17 + v-for="item in classList"
  18 + :key="item.value"
  19 + :label="item.label"
  20 + :value="item.value"
  21 + >
  22 + </el-option>
  23 + </el-select>
  24 + <el-select
  25 + v-if="role == 'ROLE_BANZHUREN'"
  26 + class="sel"
  27 + multiple
  28 + collapse-tags
  29 + v-model="query.subjectId"
  30 + placeholder=""
  31 + @change="_QueryData"
  32 + >
  33 + <el-option
  34 + v-for="item in subjectList"
  35 + :key="item.value"
  36 + :label="item.label"
  37 + :value="item.value"
  38 + >
  39 + </el-option>
  40 + </el-select>
  41 + <el-select
  42 + v-else
  43 + class="sel"
  44 + v-model="query.subjectId"
  45 + placeholder=""
  46 + @change="_QueryData"
  47 + >
  48 + <el-option
  49 + v-for="item in subjectList"
  50 + :key="item.value"
  51 + :label="item.label"
  52 + :value="item.value"
  53 + >
  54 + </el-option>
  55 + </el-select>
  56 + <div class="d1">
  57 + <el-date-picker
  58 + v-model="query.startDay"
  59 + type="date"
  60 + @change="handleChangeTimeStart"
  61 + placeholder="选择日期时间"
  62 + value-format="yyyy-MM-dd"
  63 + >
  64 + </el-date-picker>
  65 + ~
  66 + <el-date-picker
  67 + v-model="query.endDay"
  68 + type="date"
  69 + placeholder="选择日期时间"
  70 + @change="handleChangeTimeEnd"
  71 + value-format="yyyy-MM-dd"
  72 + >
  73 + </el-date-picker>
  74 + </div>
  75 + <p class="p1">
  76 + <span @click="setDate(1)" :class="[date == 1 ? 'active' : '', 's1']"
  77 + >今天</span
  78 + >
  79 + <span @click="setDate(2)" :class="[date == 2 ? 'active' : '', 's1']"
  80 + >本周</span
  81 + >
  82 + <span @click="setDate(3)" :class="[date == 3 ? 'active' : '', 's1']"
  83 + >本月</span
  84 + >
  85 + <span @click="setDate(4)" :class="[date == 4 ? 'active' : '', 's1']"
  86 + >本季度</span
  87 + >
  88 + </p>
  89 + <el-button type="primary" round @click="_QueryData()">筛选</el-button>
  90 + </div>
  91 + </div>
  92 + <div class="table-box">
  93 + <el-radio-group v-model="tabIndex" style="margin-bottom: 20px">
  94 + <el-radio-button :label="1">单卷测练报表</el-radio-button>
  95 + <el-radio-button :label="2">阶段测练报表</el-radio-button>
  96 + </el-radio-group>
  97 + <div v-if="tabIndex == 1">
  98 + <el-table
  99 + :data="tableData"
  100 + border
  101 + style="width: 100%"
  102 + :default-sort="{ prop: '', order: 'descending' }"
  103 + >
  104 + <el-table-column
  105 + prop="title"
  106 + label="试卷名称"
  107 + align="center"
  108 + ></el-table-column>
  109 + <el-table-column
  110 + prop="totalScore"
  111 + label="卷面分"
  112 + align="center"
  113 + width="100"
  114 + ></el-table-column>
  115 + <el-table-column
  116 + prop="ceyan"
  117 + label="测验人数"
  118 + align="center"
  119 + ></el-table-column>
  120 + <el-table-column
  121 + prop="shijian"
  122 + label="测验时间"
  123 + align="center"
  124 + ></el-table-column>
  125 + <el-table-column
  126 + prop="pingjun"
  127 + label="班平均分"
  128 + align="center"
  129 + ></el-table-column>
  130 + <el-table-column
  131 + prop="zuigao"
  132 + label="班最高分"
  133 + align="center"
  134 + ></el-table-column>
  135 + <el-table-column
  136 + prop="zuidi"
  137 + label="班最低分"
  138 + align="center"
  139 + ></el-table-column>
  140 + <el-table-column
  141 + prop="youxiu"
  142 + label="优秀数(率)"
  143 + sortable
  144 + align="center"
  145 + ><template slot-scope="scoped"
  146 + >{{ scoped.row.youxiu }}%</template
  147 + ></el-table-column
  148 + >
  149 + <el-table-column
  150 + prop="lianghao"
  151 + label="良好数(率)"
  152 + sortable
  153 + align="center"
  154 + ><template slot-scope="scoped"
  155 + >{{ scoped.row.lianghao }}%</template
  156 + ></el-table-column
  157 + >
  158 + <el-table-column
  159 + prop="jige"
  160 + label="及格数(率)"
  161 + sortable
  162 + align="center"
  163 + ><template slot-scope="scoped"
  164 + >{{ scoped.row.jige }}%</template
  165 + ></el-table-column
  166 + >
  167 + <el-table-column
  168 + prop="bujige"
  169 + label="不及格数(率)"
  170 + sortable
  171 + align="center"
  172 + ><template slot-scope="scoped"
  173 + >{{ scoped.row.bujige }}%</template
  174 + ></el-table-column
  175 + >
  176 + <el-table-column label="操作" align="center">
  177 + <template slot-scope="scoped">
  178 + <el-tooltip effect="dark" content="详情" placement="left">
  179 + <el-button
  180 + type="primary"
  181 + circle
  182 + size="mini"
  183 + icon="fa fa-arrow-right"
  184 + @click="linkTo(scoped.row)"
  185 + ></el-button>
  186 + </el-tooltip>
  187 + <el-tooltip effect="dark" content="修改答案" placement="right">
  188 + <el-button
  189 + type="primary"
  190 + circle
  191 + size="mini"
  192 + icon="fa fa-file-text"
  193 + @click="edit(scoped.row)"
  194 + ></el-button>
  195 + </el-tooltip>
  196 + </template>
  197 + </el-table-column>
  198 + </el-table>
  199 + </div>
  200 + <div v-if="tabIndex == 2">
  201 + <el-table
  202 + :data="tableStage"
  203 + border
  204 + style="width: 100%"
  205 + :default-sort="{ prop: '', order: 'descending' }"
  206 + >
  207 + <el-table-column
  208 + prop="xuehao"
  209 + label="学号"
  210 + align="center"
  211 + fixed
  212 + ></el-table-column>
  213 + <el-table-column
  214 + prop="xingming"
  215 + label="姓名"
  216 + fixed
  217 + align="center"
  218 + ></el-table-column>
  219 + <el-table-column label="阶段汇总" align="center">
  220 + <el-table-column
  221 + prop="totalScore"
  222 + label="总分"
  223 + align="center"
  224 + ></el-table-column>
  225 + <el-table-column
  226 + prop="rank"
  227 + label="排名"
  228 + align="center"
  229 + ></el-table-column>
  230 + </el-table-column>
  231 + <el-table-column
  232 + align="center"
  233 + v-for="(item, index) in answerList"
  234 + :key="index"
  235 + :label="item.title"
  236 + >
  237 + <el-table-column
  238 + :prop="item.title + 'totalScore'"
  239 + label="成绩"
  240 + align="center"
  241 + ></el-table-column>
  242 + <el-table-column
  243 + :prop="item.title + 'rank'"
  244 + label="班名"
  245 + align="center"
  246 + ></el-table-column>
  247 + </el-table-column>
  248 + </el-table>
  249 + </div>
  250 + <p class="down" v-if="tabIndex == 2">
  251 + <el-button type="info" plain round icon="fa fa-cloud-download"
  252 + >导出报表</el-button
  253 + >
  254 + </p>
  255 + </div>
  256 + <set-answer
  257 + :diaVisible="dialogVisible"
  258 + :questionList="form.questionList"
  259 + :paperId="form.id"
  260 + @saveSuccess="handleSuccess"
  261 + @cancel="cancel"
  262 + />
5 263 </div>
6 264 </template>
7 265  
8 266 <script>
  267 +import { formatDate, deepClone, checkAnswer } from "utils";
9 268 export default {
  269 + data() {
  270 + return {
  271 + role: "",
  272 + loading: false,
  273 + dialogVisible: false,
  274 + form: { questionList: [] },
  275 + date: "", //今天-昨天-本周
  276 + query: {
  277 + //搜索条件
  278 + classId: "",
  279 + subjectId: "",
  280 + startDay: "",
  281 + endDay: "",
  282 + day: "",
  283 + },
  284 + classList: [], //班级
  285 + subjectList: [], //科目
  286 + tabIndex: 1, //选项卡
  287 + tableData: [
  288 + {
  289 + title: "试卷一",
  290 + totalScore: 10,
  291 + ceyan: "40/50",
  292 + shijian: "2022-11-9 21:30至22:30",
  293 + pingjun: 60,
  294 + zuigao: 90,
  295 + zuidi: 50,
  296 + youxiu: 50,
  297 + lianghao: 40,
  298 + jige: 30,
  299 + bujige: 20,
  300 + },
  301 + {
  302 + title: "试卷二",
  303 + totalScore: 20,
  304 + ceyan: "30/50",
  305 + shijian: "2022-11-9 21:30至22:30",
  306 + pingjun: 80,
  307 + zuigao: 92,
  308 + zuidi: 53,
  309 + youxiu: 45,
  310 + lianghao: 56,
  311 + jige: 20,
  312 + bujige: 30,
  313 + },
  314 + ],
  315 + tableStage: [
  316 + {
  317 + xuehao: 1,
  318 + xingming: "丁芳菲",
  319 + totalScore: 5,
  320 + rank: 1,
  321 + 周测卷20221130totalScore:10,
  322 + 周测卷20221130rank:0,
  323 + 周测卷20221131totalScore:11,
  324 + 周测卷20221131rank:1,
  325 + 周测卷20221132totalScore:12,
  326 + 周测卷20221132rank:2,
  327 + 周测卷20221132totalScore:13,
  328 + 周测卷20221132rank:3,
  329 + },
  330 + {
  331 + xuehao: 2,
  332 + xingming: "丁芳",
  333 + totalScore: 4,
  334 + rank: 2,
  335 + 周测卷20221130totalScore:20,
  336 + 周测卷20221130rank:3,
  337 + 周测卷20221131totalScore:21,
  338 + 周测卷20221131rank:4,
  339 + 周测卷20221132totalScore:22,
  340 + 周测卷20221132rank:5,
  341 + 周测卷20221132totalScore:22,
  342 + 周测卷20221132rank:5,
  343 + },
  344 + ],
  345 + answerList: [//设置多卷内容供tabel表格数据用
  346 + {
  347 + title: "周测卷20221130",
  348 + totalScore: 6,
  349 + rank: 2,
  350 + },
  351 + {
  352 + title: "周测卷20221131",
  353 + totalScore: 7,
  354 + rank: 3,
  355 + },
  356 + {
  357 + title: "周测卷20221132",
  358 + totalScore: 8,
  359 + rank: 4,
  360 + },
  361 + ],
  362 + };
  363 + },
  364 + async created() {
  365 + this.role = this.$store.getters.info.permissions[0]?.role || "";
  366 + if (this.role == "ROLE_BANZHUREN") {
  367 + this.query.subjectId = [];
  368 + }
  369 + await this._QueryClassList();
  370 + await this._QuerySubjectList();
  371 + // await this.setDate(1);
  372 + let startDay = this.query?.startDay;
  373 + if (!startDay) {
  374 + this.query.startDay = new Date();
  375 + this.query.endDay = new Date();
  376 + }
  377 + },
  378 + methods: {
  379 + linkTo(obj) {
  380 + //去详情
  381 + this.$router.push({
  382 + path: "/testAnalysis",
  383 + query: {
  384 + id: obj.id,
  385 + },
  386 + });
  387 + },
10 388  
11   -}
  389 + setDate(index) {
  390 + const that = this;
  391 + this.date = index == this.date ? "" : index;
  392 + let aYear = new Date().getFullYear();
  393 + let aMonth = new Date().getMonth() + 1;
  394 + that.query.day = "";
  395 + that.query.startDay = "";
  396 + that.query.endDay = "";
  397 + switch (index) {
  398 + case 1:
  399 + that.query.day = formatDate(new Date(), "yyyy-MM-dd");
  400 + that.query.startDay = that.query.day;
  401 + that.query.endDay = that.query.day;
  402 + break;
  403 + case 2:
  404 + let day = new Date().getDay();
  405 + if (day == 0) {
  406 + //中国式星期天是一周的最后一天
  407 + day = 7;
  408 + }
  409 + let aTime = new Date().getTime() - 24 * 60 * 60 * 1000 * day;
  410 + that.query.startDay = formatDate(new Date(aTime), "yyyy-MM-dd");
  411 + that.query.endDay = formatDate(new Date(), "yyyy-MM-dd");
  412 + break;
  413 + case 3:
  414 + aMonth = aMonth < 10 ? "0" + aMonth : aMonth;
  415 + that.query.startDay = `${aYear}-${aMonth}-01`;
  416 + that.query.endDay = formatDate(new Date(), "yyyy-MM-dd");
  417 + break;
  418 + case 4:
  419 + if (aMonth > 1 && aMonth < 4) {
  420 + aMonth = "01";
  421 + } else if (aMonth > 3 && aMonth < 7) {
  422 + aMonth = "04";
  423 + } else if (aMonth > 6 && aMonth < 10) {
  424 + aMonth = "07";
  425 + } else {
  426 + aMonth = "10";
  427 + }
  428 +
  429 + aMonth = aMonth < 10 ? "0" + aMonth : aMonth;
  430 + that.query.startDay = `${aYear}-${aMonth}-01`;
  431 + that.query.endDay = formatDate(new Date(), "yyyy-MM-dd");
  432 + break;
  433 + }
  434 + this.page = 1;
  435 + this._QueryData();
  436 + },
  437 + handleChangeTimeStart(val) {
  438 + this.query.day = "";
  439 + this.date = "";
  440 + if (this.query.endDay) {
  441 + if (new Date(val).getTime() > new Date(this.query.endDay).getTime()) {
  442 + this.$message.error("任务结束时间不能任务开始时间前面,请重新设置");
  443 + this.query.startDay = "";
  444 + }
  445 + }
  446 + },
  447 + handleChangeTimeEnd(val) {
  448 + this.query.day = "";
  449 + this.date = "";
  450 + if (this.query.startDay) {
  451 + if (new Date(val).getTime() < new Date(this.query.startDay).getTime()) {
  452 + this.$message.error("任务结束时间不能任务开始时间前面,请重新设置");
  453 + this.query.endDay = "";
  454 + }
  455 + }
  456 + },
  457 + edit(item) {
  458 + this.form = deepClone(item);
  459 + this.dialogVisible = true;
  460 + },
  461 + cancel() {
  462 + this.dialogVisible = false;
  463 + },
  464 + handleSuccess() {
  465 + this.dialogVisible = false;
  466 + this._QueryData();
  467 + },
  468 + async changClazz() {
  469 + await this._QuerySubjectList();
  470 + await this.setDate(1);
  471 + },
  472 + async _QueryClassList() {
  473 + const { data, status, info } = await this.$request.fetchClassList();
  474 + if (status === 0) {
  475 + this.classList = data.list.map((item) => {
  476 + return {
  477 + value: item.classId,
  478 + label: item.clazzName,
  479 + };
  480 + });
  481 + this.query.classId = this.classList[0]?.value;
  482 + } else {
  483 + this.$message.error(info);
  484 + }
  485 + },
  486 + async _QuerySubjectList() {
  487 + const { data, status, info } = await this.$request.fetchSubjectList({
  488 + classId: this.query.classId,
  489 + });
  490 + if (status === 0) {
  491 + this.subjectList =
  492 + data.list?.map((item) => {
  493 + return {
  494 + value: item.subjectId,
  495 + label: item.subjectName,
  496 + };
  497 + }) || [];
  498 + if (this.role == "ROLE_BANZHUREN") {
  499 + this.subjectList.unshift({
  500 + value: "",
  501 + label: "全部",
  502 + });
  503 + }
  504 + this.query.subjectId = this.subjectList[0]?.value;
  505 + } else {
  506 + this.$message.error(info);
  507 + }
  508 + },
  509 + async _QueryData() {
  510 + this.loading = true;
  511 + //多课时对比
  512 + let query = {};
  513 + for (let key in this.query) {
  514 + if (this.query[key] != "") {
  515 + query[key] = this.query[key];
  516 + }
  517 + }
  518 + const { data, status, info } = await this.$request.fetchQuizList({
  519 + ...query,
  520 + });
  521 + this.loading = false;
  522 + if (status === 0) {
  523 + } else {
  524 + this.$message.error(info);
  525 + }
  526 + },
  527 + },
  528 +};
12 529 </script>
13 530  
14   -<style>
  531 +<style lang="scss" scoped>
  532 +.table-box {
  533 + margin: 0 20px;
  534 + padding: 16px;
  535 + background: #f8f8f8;
  536 + border-radius: 5px;
  537 + :deep(.fa-arrow-right) {
  538 + padding-left: 2px;
  539 + }
  540 + :deep(.fa-file-text) {
  541 + padding-left: 2px;
  542 + }
  543 +}
15 544  
  545 +.fa-exchange {
  546 + color: #667ffd;
  547 + cursor: pointer;
  548 + font-size: 16px;
  549 + margin-left: 10px;
  550 +}
  551 +.dia-btn {
  552 + border-radius: 20px;
  553 + margin: 0 20px;
  554 + padding: 10px 20px;
  555 +}
  556 +.dia-tips {
  557 + padding-bottom: 10px;
  558 +}
  559 +.dia-question-box {
  560 + padding: 16px 16px 1px;
  561 + background: #f8f8f8;
  562 + border-radius: 10px;
  563 +
  564 + .answer-s {
  565 + width: 36px;
  566 + height: 28px;
  567 + cursor: pointer;
  568 + }
  569 +}
  570 +.set-questions {
  571 + display: flex;
  572 + margin-bottom: 12px;
  573 + width: 100%;
  574 + .qs-num {
  575 + flex-shrink: 0;
  576 + margin-right: 10px;
  577 + }
  578 + .qs-options {
  579 + flex: 1;
  580 + .ipt {
  581 + margin-bottom: 5px;
  582 + }
  583 + }
  584 + .delButton {
  585 + border-color: #ff6868;
  586 + background: #ff6868 url("../../assets/images/arrow.png") no-repeat center;
  587 + background-size: 19px;
  588 + color: transparent;
  589 + }
  590 + .ac {
  591 + border-color: #ff6868;
  592 + background: #ff6868;
  593 + color: #fff;
  594 + }
  595 +}
  596 +.down {
  597 + padding-top: 16px;
  598 +}
16 599 </style>
17 600 \ No newline at end of file
... ...