|
|
@@ -126,30 +126,38 @@
|
|
|
<div class="drill-container--line"></div>
|
|
|
<span>演练参与部门</span>
|
|
|
</div>
|
|
|
- <el-button style="margin-top: 20px" type="primary" :icon="Download" @click=""> 下载签到名单 </el-button>
|
|
|
+ <el-button style="margin-top: 20px" type="primary" :icon="Download" @click="downloadSignList(Number(id))">
|
|
|
+ 下载签到名单
|
|
|
+ </el-button>
|
|
|
<BasicTable style="margin-top: 20px" :tableConfig="tableConfig" :tableData="drillData.planDetailList!">
|
|
|
<template #drillScriptStatus="scope">
|
|
|
<span>{{ scope.row.drillScriptStatus === 1 ? '未会签' : '已会签' }}</span>
|
|
|
</template>
|
|
|
</BasicTable>
|
|
|
+ <PreviewOnline ref="previewOnlineRef" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import { onMounted, ref } from 'vue';
|
|
|
- import { ElPopover } from 'element-plus';
|
|
|
+ import { ElMessage, ElPopover } from 'element-plus';
|
|
|
import BasicTable from '@/components/BasicTable.vue';
|
|
|
import { Download } from '@element-plus/icons-vue';
|
|
|
import { useRoute } from 'vue-router';
|
|
|
import { DrillPlanItemDetail } from '../types';
|
|
|
import useTableConfig from '@/hooks/useTableConfigHook';
|
|
|
import { getAllApproval } from '@/api/approval/approval';
|
|
|
- import { queryEmergencyDrillPlanDetail, queryEmergencyPlanDetail } from '@/api/emergency-drill/emergency-drill';
|
|
|
+ import {
|
|
|
+ queryEmergencyDrillPlanDetail,
|
|
|
+ queryEmergencyPlanDetail,
|
|
|
+ getSignListFile,
|
|
|
+ } from '@/api/emergency-drill/emergency-drill';
|
|
|
import { DRILL_PLAN_ACTIVITIES_TABLE_OPTIONS, DRILL_PLAN_ACTIVITIES_TABLE_COLUMNS } from '../configs/plan/table';
|
|
|
import { useEmergencyDrillHook } from '../hook';
|
|
|
import QrCode from '@/components/Qrcode/src/Qrcode.vue';
|
|
|
import PreviewOnline from '@/views/disaster/components/PreviewOnline.vue';
|
|
|
import { FILE_TYPE_ICON } from '@/views/disaster/constant';
|
|
|
+ import { downloadFile } from '@/views/disaster/utils/download';
|
|
|
|
|
|
const route = useRoute();
|
|
|
const id = route.query.id;
|
|
|
@@ -210,6 +218,19 @@
|
|
|
if (!url) return;
|
|
|
previewOnlineRef.value?.open(url, type);
|
|
|
};
|
|
|
+
|
|
|
+ async function downloadSignList(id: number) {
|
|
|
+ try {
|
|
|
+ const res = await getSignListFile(id);
|
|
|
+ if (res.size === 0) return;
|
|
|
+ const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
|
|
+ const url = window.URL.createObjectURL(blob);
|
|
|
+ downloadFile(url, '演练签到名单.xlsx');
|
|
|
+ } catch (e) {
|
|
|
+ ElMessage.error('下载失败');
|
|
|
+ console.log(e);
|
|
|
+ }
|
|
|
+ }
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|