|
@@ -0,0 +1,129 @@
|
|
|
+<template>
|
|
|
+ <div class="leader-analysis-export analysis-export-modal">
|
|
|
+ <div class="print-box">
|
|
|
+ <h1>
|
|
|
+ 分档详情数据
|
|
|
+ </h1>
|
|
|
+ <div class="quality-info">
|
|
|
+ <p>科目:{{ pageInfo.subjectName }}</p>
|
|
|
+ <p>考区:{{ pageInfo.areaName }}</p>
|
|
|
+ <p>截止时间:{{ currentTime }}</p>
|
|
|
+ </div>
|
|
|
+ <div class="print-chart">
|
|
|
+ <div class="print-chart-title">详细数值表:</div>
|
|
|
+ <table class="export-table">
|
|
|
+ <tr>
|
|
|
+ <th>档位</th>
|
|
|
+ <th>考区试卷数量</th>
|
|
|
+ <th>考区试卷占比</th>
|
|
|
+ <th>考区阈值</th>
|
|
|
+ <th>差值</th>
|
|
|
+ <th>累计数量</th>
|
|
|
+ <th>累计占比</th>
|
|
|
+ <th>调整</th>
|
|
|
+ <th>全部试卷数量</th>
|
|
|
+ <th>全部试卷占比</th>
|
|
|
+ <th>占比阈值</th>
|
|
|
+ </tr>
|
|
|
+ <tr v-for="(level, index) in chartData.levelData" :key="index">
|
|
|
+ <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="print-chart" v-if="chartData.lineChartData">
|
|
|
+ <div class="print-chart-title">考区试卷数量分布图</div>
|
|
|
+ <div class="print-chart-body">
|
|
|
+ <echart-render
|
|
|
+ :chart-data="chartData.lineChartData"
|
|
|
+ :animation-is-open="false"
|
|
|
+ chart-type="darkLines"
|
|
|
+ ref="lineChart"
|
|
|
+ v-if="!showImg"
|
|
|
+ ></echart-render>
|
|
|
+ <img src="" ref="lineChartImg" v-show="showImg" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import EchartRender from "@/components/EchartRender";
|
|
|
+import { download, formatDate } from "@/plugins/utils";
|
|
|
+import html2canvas from "html2canvas";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "leader-analysis-export",
|
|
|
+ components: { EchartRender },
|
|
|
+ props: {
|
|
|
+ chartData: {
|
|
|
+ type: Object,
|
|
|
+ default() {
|
|
|
+ return {};
|
|
|
+ }
|
|
|
+ },
|
|
|
+ pageInfo: {
|
|
|
+ type: Object,
|
|
|
+ default() {
|
|
|
+ return {};
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ currentTime: formatDate(),
|
|
|
+ showImg: false
|
|
|
+ };
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.lineChartImg.src = this.$refs.lineChart.getDataURL({
|
|
|
+ backgroundColor: "#fff"
|
|
|
+ });
|
|
|
+
|
|
|
+ this.showImg = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.toExport();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async toExport() {
|
|
|
+ const canvas = await html2canvas(this.$el.childNodes[0], {
|
|
|
+ allowTaint: true
|
|
|
+ }).catch(() => {});
|
|
|
+
|
|
|
+ if (!canvas) {
|
|
|
+ this.$emit("on-exported", false);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ let result = true;
|
|
|
+ const user = this.$ls.get("user", { token: "", id: "" });
|
|
|
+ await download({
|
|
|
+ type: "post",
|
|
|
+ url: `${this.GLOBAL.domain}/api/exportPdf`,
|
|
|
+ header: { Authorization: user.token, userId: user.id },
|
|
|
+ data: {
|
|
|
+ content: [canvas.toDataURL().split(",")[1]]
|
|
|
+ },
|
|
|
+ fileName: `${this.pageInfo.subjectName}-${this.pageInfo.areaName}-分档详情分析.pdf`
|
|
|
+ }).catch(() => {
|
|
|
+ result = false;
|
|
|
+ });
|
|
|
+
|
|
|
+ this.$emit("on-exported", result);
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|