|
@@ -215,7 +215,12 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="patrol-analysis part-box">
|
|
|
- <div class="patrol-analysis-legend" v-if="statData.length">
|
|
|
+ <div v-if="statData.length" class="patrol-analysis-action">
|
|
|
+ <el-button type="text" icon="el-icon-download" @click="toExport"
|
|
|
+ >导出</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <div v-if="statData.length" class="patrol-analysis-legend">
|
|
|
<div
|
|
|
class="legend-item"
|
|
|
v-for="item in statInfo"
|
|
@@ -235,6 +240,9 @@
|
|
|
:chart-click="barGroupClick"
|
|
|
></echart-render>
|
|
|
</div>
|
|
|
+ <!-- 导出时间段 -->
|
|
|
+ <export-set-dialog ref="ExportSetDialog" @confirm="exportData">
|
|
|
+ </export-set-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -244,6 +252,7 @@ import {
|
|
|
patrolReportList,
|
|
|
examBatchList,
|
|
|
examActivityRoomList,
|
|
|
+ exportPatrolReportList,
|
|
|
} from "@/api/invigilation";
|
|
|
import {
|
|
|
BOOLEAN_TYPE,
|
|
@@ -253,11 +262,13 @@ import {
|
|
|
import EchartRender from "../common/EchartRender";
|
|
|
import SummaryLine from "../common/SummaryLine";
|
|
|
import RightOrWrong from "../common/RightOrWrong";
|
|
|
+import ExportSetDialog from "./ExportSetDialog.vue";
|
|
|
import { mapState, mapMutations, mapActions } from "vuex";
|
|
|
+import { downloadBlob } from "@/utils/utils";
|
|
|
|
|
|
export default {
|
|
|
name: "OnlinePatrol",
|
|
|
- components: { EchartRender, SummaryLine, RightOrWrong },
|
|
|
+ components: { EchartRender, SummaryLine, RightOrWrong, ExportSetDialog },
|
|
|
data() {
|
|
|
return {
|
|
|
filter: {
|
|
@@ -424,6 +435,25 @@ export default {
|
|
|
},
|
|
|
});
|
|
|
},
|
|
|
+ toExport() {
|
|
|
+ this.$refs.ExportSetDialog.open();
|
|
|
+ },
|
|
|
+ async exportData(times) {
|
|
|
+ console.log(times);
|
|
|
+ const res = await downloadBlob(() => {
|
|
|
+ return exportPatrolReportList({
|
|
|
+ ...this.filter,
|
|
|
+ startTime: times[0],
|
|
|
+ endTime: times[1],
|
|
|
+ });
|
|
|
+ }).catch(() => {});
|
|
|
+
|
|
|
+ if (res) {
|
|
|
+ this.$message.success("导出成功!");
|
|
|
+ } else {
|
|
|
+ this.$message.error("导出失败,请重新尝试!");
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
beforeRouteEnter(to, from, next) {
|
|
|
if (from.name === "PatrolExamDetail") {
|
|
@@ -501,4 +531,10 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.patrol-analysis-action {
|
|
|
+ position: absolute;
|
|
|
+ top: 10px;
|
|
|
+ left: 10px;
|
|
|
+ z-index: 99;
|
|
|
+}
|
|
|
</style>
|