|
|
@@ -57,6 +57,13 @@
|
|
|
</div>
|
|
|
</el-row>
|
|
|
|
|
|
+ <!-- 操作按钮 -->
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button type="success" plain icon="Download" @click="handleExport">导出</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
<el-table v-loading="loading" :data="list" style="margin-top: 20px;" @row-click="handleRowClick">
|
|
|
<el-table-column label="序号" type="index" width="50" align="center" />
|
|
|
<el-table-column label="姓名" prop="fullName" align="center" />
|
|
|
@@ -260,10 +267,10 @@ function renderPieChart(stayDaysDistribution = {}) {
|
|
|
if (Object.keys(stayDaysDistribution).length > 0) {
|
|
|
// 定义合理的排序顺序(按照天数递增)
|
|
|
const rangeOrder = ['0-15天', '15-30天', '30-60天', '60-90天', '90-120天', '120天以上'];
|
|
|
-
|
|
|
+
|
|
|
// 标记是否已经遇到非零值
|
|
|
let foundNonZero = false;
|
|
|
-
|
|
|
+
|
|
|
// 按照预定顺序处理数据
|
|
|
for (const range of rangeOrder) {
|
|
|
if (stayDaysDistribution.hasOwnProperty(range)) {
|
|
|
@@ -301,7 +308,7 @@ function renderPieChart(stayDaysDistribution = {}) {
|
|
|
// 如果是前面的0值,则跳过不添加
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 处理不在预定义区间中的其他区间
|
|
|
for (const [range, count] of Object.entries(stayDaysDistribution)) {
|
|
|
if (!rangeOrder.includes(range)) {
|
|
|
@@ -395,6 +402,22 @@ function getDateRangeForQuery() {
|
|
|
return [`${year}-01-01`, `${year}-12-31`];
|
|
|
}
|
|
|
|
|
|
+/** 导出按钮操作 */
|
|
|
+function handleExport() {
|
|
|
+ // 准备查询参数
|
|
|
+ const params = {};
|
|
|
+ params.year = queryParams.value.year;
|
|
|
+ params.minDays = queryParams.value.minDays;
|
|
|
+
|
|
|
+ // 添加分页参数,以便导出所有数据
|
|
|
+ params.pageNum = queryParams.value.pageNum;
|
|
|
+ params.pageSize = queryParams.value.pageSize;
|
|
|
+
|
|
|
+ proxy.download('biz/anal/overseas/export', {
|
|
|
+ ...params
|
|
|
+ }, `境外滞留数据_${new Date().getTime()}.xlsx`)
|
|
|
+}
|
|
|
+
|
|
|
// 页面加载时获取数据
|
|
|
onMounted(() => {
|
|
|
// 初始化时直接查询,使用reactive中设置的默认值
|
|
|
@@ -506,6 +529,10 @@ onMounted(() => {
|
|
|
padding: 15px;
|
|
|
}
|
|
|
|
|
|
+.mb8 {
|
|
|
+ margin-bottom: 8px;
|
|
|
+}
|
|
|
+
|
|
|
.el-row {
|
|
|
margin-bottom: 15px;
|
|
|
}
|