|
|
|
@ -2,7 +2,7 @@ |
|
|
|
import { nextTick, onMounted, onUnmounted, reactive, ref } from 'vue'; |
|
|
|
import { ElMessage } from 'element-plus'; |
|
|
|
import { getDicts } from '@/api/system/dict/data'; |
|
|
|
import { listScanArea, listScanAreaDetails, exportScanArea, type ScanTimeParams } from '@/api/efcode/report/scan-data-situation'; |
|
|
|
import { listScanArea, listScanAreaDetails, exportScanArea, exportScanAreaDetails, type ScanTimeParams } from '@/api/efcode/report/scan-data-situation'; |
|
|
|
|
|
|
|
/** 表格行数据 */ |
|
|
|
interface DistrictRow { |
|
|
|
@ -302,6 +302,33 @@ const handleDetailPageChange = (page: number) => { |
|
|
|
getDetailList(); |
|
|
|
}; |
|
|
|
|
|
|
|
const detailExporting = ref(false); |
|
|
|
|
|
|
|
/** 详情导出 */ |
|
|
|
const handleDetailExport = async () => { |
|
|
|
if (!detailArea.value) return; |
|
|
|
detailExporting.value = true; |
|
|
|
try { |
|
|
|
const res = await exportScanAreaDetails({ |
|
|
|
...buildTimeParams(), |
|
|
|
districtCode: detailArea.value.districtCode |
|
|
|
}); |
|
|
|
const blob = new Blob([res as any], { |
|
|
|
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' |
|
|
|
}); |
|
|
|
const url = window.URL.createObjectURL(blob); |
|
|
|
const link = document.createElement('a'); |
|
|
|
link.href = url; |
|
|
|
link.download = `区街道扫码情况-${detailArea.value.districtName || detailArea.value.areaName || ''}.xlsx`; |
|
|
|
link.click(); |
|
|
|
window.URL.revokeObjectURL(url); |
|
|
|
} catch (e) { |
|
|
|
ElMessage.error('导出失败'); |
|
|
|
} finally { |
|
|
|
detailExporting.value = false; |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
loadAreaDict(); |
|
|
|
applyYearFilter(); |
|
|
|
@ -422,9 +449,13 @@ onUnmounted(() => { |
|
|
|
top="5vh" |
|
|
|
destroy-on-close |
|
|
|
> |
|
|
|
<div class="detail-toolbar"> |
|
|
|
<el-button type="primary" :loading="detailExporting" @click="handleDetailExport">导出</el-button> |
|
|
|
</div> |
|
|
|
|
|
|
|
<el-table v-loading="detailLoading" :data="detailTableData" border stripe style="width: 100%" max-height="55vh"> |
|
|
|
<el-table-column label="序号" type="index" :index="detailIndexMethod" width="70" align="center" /> |
|
|
|
<el-table-column label="单位" min-width="160" align="center"> |
|
|
|
<el-table-column label="单位" min-width="240" align="center"> |
|
|
|
<template #default="{ row }">{{ row.streetName || row.districtName || '-' }}</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="行政执法数量(条)" min-width="170" align="center"> |
|
|
|
@ -433,7 +464,7 @@ onUnmounted(() => { |
|
|
|
<el-table-column label="行政执法数量排名" min-width="170" align="center"> |
|
|
|
<template #default="{ row }">{{ row.xzzfslpm ?? '-' }}</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="行政执法数量占比(%)" min-width="160" align="center"> |
|
|
|
<el-table-column label="行政执法数量占比(%)" min-width="180" align="center"> |
|
|
|
<template #default="{ row }">{{ row.xzzfslzb ?? '-' }}</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="非行政执法数量(条)" min-width="180" align="center"> |
|
|
|
@ -503,4 +534,10 @@ onUnmounted(() => { |
|
|
|
margin-top: 16px; |
|
|
|
justify-content: flex-end; |
|
|
|
} |
|
|
|
|
|
|
|
.detail-toolbar { |
|
|
|
display: flex; |
|
|
|
justify-content: flex-end; |
|
|
|
margin-bottom: 12px; |
|
|
|
} |
|
|
|
</style> |
|
|
|
|