|
@@ -1,174 +1,175 @@
|
|
|
-<template>
|
|
|
- <Modal
|
|
|
- v-model="modalIsShow"
|
|
|
- class="leader-statistics marker-modal"
|
|
|
- title="统计分析"
|
|
|
- footer-hide
|
|
|
- fullscreen
|
|
|
- @on-visible-change="visibleChange"
|
|
|
- >
|
|
|
- <div class="box-justify mb-2">
|
|
|
- <div>
|
|
|
- <p>{{ curArea.areaName }}:{{ curSubject.name }}</p>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <Button
|
|
|
- class="marker-btn-primary"
|
|
|
- size="small"
|
|
|
- type="primary"
|
|
|
- @click="toExport"
|
|
|
- :loading="isDownload"
|
|
|
- >导出表格</Button
|
|
|
- >
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="marker-statistics-table">
|
|
|
- <table class="table table-dark">
|
|
|
- <tr>
|
|
|
- <th>档位</th>
|
|
|
- <th>考区试卷数量</th>
|
|
|
- <th>考区试卷占比</th>
|
|
|
- <th>考区阈值</th>
|
|
|
- <th>差值</th>
|
|
|
- <th>累计数量</th>
|
|
|
- <th>累计占比</th>
|
|
|
- <th>调整</th>
|
|
|
- <th class="td-bl">全部试卷数量</th>
|
|
|
- <th>全部试卷占比</th>
|
|
|
- <th>占比阈值</th>
|
|
|
- </tr>
|
|
|
- <tr v-for="(level, sindex) in levelData" :key="sindex">
|
|
|
- <td>{{ level.code }}</td>
|
|
|
- <td>{{ level.levelCount }}</td>
|
|
|
- <td>{{ level.levelProp }}%</td>
|
|
|
- <td>{{ level.examLevelProp }}%</td>
|
|
|
- <td>{{ level.diffProp }}%</td>
|
|
|
- <td>{{ level.cumulateCount }}</td>
|
|
|
- <td>{{ level.cumulateProp }}%</td>
|
|
|
- <td>{{ level.adjustmentCount }}</td>
|
|
|
- <td class="td-bl">{{ level.gcount }}</td>
|
|
|
- <td>{{ level.gpercent }}%</td>
|
|
|
- <td>{{ level.pt }}%</td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
- </div>
|
|
|
- <div class="marker-statistics-chart">
|
|
|
- <h3>考区试卷数量分布图</h3>
|
|
|
- <echart-render
|
|
|
- :chart-data="lineChartData"
|
|
|
- chart-type="darkLines"
|
|
|
- v-if="lineChartData"
|
|
|
- ></echart-render>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- LeaderAnalysisExport -->
|
|
|
- <leader-analysis-export
|
|
|
- ref="LeaderAnalysisExport"
|
|
|
- :chart-data="renderChartData"
|
|
|
- :page-info="renderPageInfo"
|
|
|
- @on-exported="exportOver"
|
|
|
- v-if="renderExportPage"
|
|
|
- ></leader-analysis-export>
|
|
|
- </Modal>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
-import { mapState } from "vuex";
|
|
|
-import { gradingStatData } from "@/api";
|
|
|
-import EchartRender from "@/components/EchartRender";
|
|
|
-import LeaderAnalysisExport from "./LeaderAnalysisExport";
|
|
|
-
|
|
|
-export default {
|
|
|
- name: "leader-statistics",
|
|
|
- components: { EchartRender, LeaderAnalysisExport },
|
|
|
- props: {
|
|
|
- questionId: {
|
|
|
- type: [Number, String],
|
|
|
- required: true
|
|
|
- }
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- modalIsShow: false,
|
|
|
- levelData: [],
|
|
|
- lineChartData: null,
|
|
|
- // export
|
|
|
- renderExportPage: false,
|
|
|
- renderChartData: {},
|
|
|
- renderPageInfo: {},
|
|
|
- isDownload: false
|
|
|
- };
|
|
|
- },
|
|
|
- computed: {
|
|
|
- ...mapState("marker", ["paramsSet", "curSubject", "curArea", "areas"])
|
|
|
- },
|
|
|
- methods: {
|
|
|
- visibleChange(visible) {
|
|
|
- if (visible) {
|
|
|
- this.initData();
|
|
|
- } else {
|
|
|
- this.lineChartData = null;
|
|
|
- }
|
|
|
- },
|
|
|
- async initData() {
|
|
|
- const subs = this.$route.params.subjectId.split("-");
|
|
|
- this.levelData = await gradingStatData({
|
|
|
- questionId: this.questionId,
|
|
|
- workId: subs[0],
|
|
|
- subject: subs[1]
|
|
|
- });
|
|
|
-
|
|
|
- const groups = [
|
|
|
- {
|
|
|
- key: "levelProp",
|
|
|
- label: "考区"
|
|
|
- },
|
|
|
- {
|
|
|
- key: "gpercent",
|
|
|
- label: "全部"
|
|
|
- }
|
|
|
- ];
|
|
|
- const groupList = this.areas.length === 1 ? groups.slice(0, 1) : groups;
|
|
|
- this.lineChartData = groupList.map(group => {
|
|
|
- const data = this.levelData.map(item => {
|
|
|
- return {
|
|
|
- name: item.code,
|
|
|
- value: item[group.key]
|
|
|
- };
|
|
|
- });
|
|
|
- return {
|
|
|
- name: group.label,
|
|
|
- data
|
|
|
- };
|
|
|
- });
|
|
|
- },
|
|
|
- // export
|
|
|
- toExport() {
|
|
|
- if (this.isDownload) return;
|
|
|
- this.isDownload = true;
|
|
|
- this.renderPageInfo = {
|
|
|
- subjectName: this.curSubject.name,
|
|
|
- areaName: this.curArea.areaName
|
|
|
- };
|
|
|
- this.renderChartData = {
|
|
|
- levelData: this.levelData,
|
|
|
- lineChartData: this.lineChartData
|
|
|
- };
|
|
|
- this.renderExportPage = true;
|
|
|
- },
|
|
|
- exportOver(result) {
|
|
|
- if (!result) {
|
|
|
- this.$Message.error("导出失败,请重新尝试!");
|
|
|
- }
|
|
|
- this.renderExportPage = false;
|
|
|
- this.isDownload = false;
|
|
|
- },
|
|
|
- cancel() {
|
|
|
- this.modalIsShow = false;
|
|
|
- },
|
|
|
- open() {
|
|
|
- this.modalIsShow = true;
|
|
|
- }
|
|
|
- }
|
|
|
-};
|
|
|
-</script>
|
|
|
+<template>
|
|
|
+ <Modal
|
|
|
+ v-model="modalIsShow"
|
|
|
+ class="leader-statistics marker-modal"
|
|
|
+ title="统计分析"
|
|
|
+ footer-hide
|
|
|
+ fullscreen
|
|
|
+ @on-visible-change="visibleChange"
|
|
|
+ >
|
|
|
+ <div class="box-justify mb-2">
|
|
|
+ <div>
|
|
|
+ <p>{{ curArea.areaName }}:{{ curSubject.name }}</p>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <Button
|
|
|
+ class="marker-btn-primary"
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ @click="toExport"
|
|
|
+ :loading="isDownload"
|
|
|
+ >导出表格</Button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="marker-statistics-table">
|
|
|
+ <table class="table table-dark">
|
|
|
+ <tr>
|
|
|
+ <th>档位</th>
|
|
|
+ <th>考区试卷数量</th>
|
|
|
+ <th>考区试卷占比</th>
|
|
|
+ <th>考区阈值</th>
|
|
|
+ <th>差值</th>
|
|
|
+ <th>累计数量</th>
|
|
|
+ <th>累计占比</th>
|
|
|
+ <th>调整</th>
|
|
|
+ <th class="td-bl">全部试卷数量</th>
|
|
|
+ <th>全部试卷占比</th>
|
|
|
+ <th>占比阈值</th>
|
|
|
+ </tr>
|
|
|
+ <tr v-for="(level, sindex) in levelData" :key="sindex">
|
|
|
+ <td>{{ level.code | levelNameFilter }}</td>
|
|
|
+ <td>{{ level.levelCount }}</td>
|
|
|
+ <td>{{ level.levelProp }}%</td>
|
|
|
+ <td>{{ level.examLevelProp }}%</td>
|
|
|
+ <td>{{ level.diffProp }}%</td>
|
|
|
+ <td>{{ level.cumulateCount }}</td>
|
|
|
+ <td>{{ level.cumulateProp }}%</td>
|
|
|
+ <td>{{ level.adjustmentCount }}</td>
|
|
|
+ <td class="td-bl">{{ level.gcount }}</td>
|
|
|
+ <td>{{ level.gpercent }}%</td>
|
|
|
+ <td>{{ level.pt }}%</td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ <div class="marker-statistics-chart">
|
|
|
+ <h3>考区试卷数量分布图</h3>
|
|
|
+ <echart-render
|
|
|
+ :chart-data="lineChartData"
|
|
|
+ chart-type="darkLines"
|
|
|
+ v-if="lineChartData"
|
|
|
+ ></echart-render>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- LeaderAnalysisExport -->
|
|
|
+ <leader-analysis-export
|
|
|
+ ref="LeaderAnalysisExport"
|
|
|
+ :chart-data="renderChartData"
|
|
|
+ :page-info="renderPageInfo"
|
|
|
+ @on-exported="exportOver"
|
|
|
+ v-if="renderExportPage"
|
|
|
+ ></leader-analysis-export>
|
|
|
+ </Modal>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { mapState } from "vuex";
|
|
|
+import { gradingStatData } from "@/api";
|
|
|
+import EchartRender from "@/components/EchartRender";
|
|
|
+import LeaderAnalysisExport from "./LeaderAnalysisExport";
|
|
|
+import { levelNameTransform } from "@/plugins/utils";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "leader-statistics",
|
|
|
+ components: { EchartRender, LeaderAnalysisExport },
|
|
|
+ props: {
|
|
|
+ questionId: {
|
|
|
+ type: [Number, String],
|
|
|
+ required: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ modalIsShow: false,
|
|
|
+ levelData: [],
|
|
|
+ lineChartData: null,
|
|
|
+ // export
|
|
|
+ renderExportPage: false,
|
|
|
+ renderChartData: {},
|
|
|
+ renderPageInfo: {},
|
|
|
+ isDownload: false
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState("marker", ["paramsSet", "curSubject", "curArea", "areas"])
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ visibleChange(visible) {
|
|
|
+ if (visible) {
|
|
|
+ this.initData();
|
|
|
+ } else {
|
|
|
+ this.lineChartData = null;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async initData() {
|
|
|
+ const subs = this.$route.params.subjectId.split("-");
|
|
|
+ this.levelData = await gradingStatData({
|
|
|
+ questionId: this.questionId,
|
|
|
+ workId: subs[0],
|
|
|
+ subject: subs[1]
|
|
|
+ });
|
|
|
+
|
|
|
+ const groups = [
|
|
|
+ {
|
|
|
+ key: "levelProp",
|
|
|
+ label: "考区"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: "gpercent",
|
|
|
+ label: "全部"
|
|
|
+ }
|
|
|
+ ];
|
|
|
+ const groupList = this.areas.length === 1 ? groups.slice(0, 1) : groups;
|
|
|
+ this.lineChartData = groupList.map(group => {
|
|
|
+ const data = this.levelData.map(item => {
|
|
|
+ return {
|
|
|
+ name: levelNameTransform(item.code),
|
|
|
+ value: item[group.key]
|
|
|
+ };
|
|
|
+ });
|
|
|
+ return {
|
|
|
+ name: group.label,
|
|
|
+ data
|
|
|
+ };
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // export
|
|
|
+ toExport() {
|
|
|
+ if (this.isDownload) return;
|
|
|
+ this.isDownload = true;
|
|
|
+ this.renderPageInfo = {
|
|
|
+ subjectName: this.curSubject.name,
|
|
|
+ areaName: this.curArea.areaName
|
|
|
+ };
|
|
|
+ this.renderChartData = {
|
|
|
+ levelData: this.levelData,
|
|
|
+ lineChartData: this.lineChartData
|
|
|
+ };
|
|
|
+ this.renderExportPage = true;
|
|
|
+ },
|
|
|
+ exportOver(result) {
|
|
|
+ if (!result) {
|
|
|
+ this.$Message.error("导出失败,请重新尝试!");
|
|
|
+ }
|
|
|
+ this.renderExportPage = false;
|
|
|
+ this.isDownload = false;
|
|
|
+ },
|
|
|
+ cancel() {
|
|
|
+ this.modalIsShow = false;
|
|
|
+ },
|
|
|
+ open() {
|
|
|
+ this.modalIsShow = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|