fix(analytics): 流失页导出成功提示与空检+排序仅当前页提示
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
<el-tab-pane label="从未激活" name="inactive" />
|
||||
<el-tab-pane label="待交接" name="handover" />
|
||||
</el-tabs>
|
||||
<div class="kind-hint">{{ kindHint }}</div>
|
||||
<div class="kind-hint">{{ kindHint }}(列排序仅当前页)</div>
|
||||
|
||||
<el-alert v-if="error" type="error" :title="error" :closable="false" class="error-bar" />
|
||||
|
||||
@@ -150,9 +150,14 @@ function goChat(row: ChurnRow) {
|
||||
// CSV 平铺带「归属员工」列 = v1 简化:spec 的「按员工分组」语义由表格列承担
|
||||
// (spec §3.3 注)。exportListToCsv 自带全量翻页 + BOM + 10000 行安全上限。
|
||||
async function exportCsv() {
|
||||
// 空检 + 成功条数提示:项目所有 exportListToCsv 调用点的统一 UX(CustomerList 等)
|
||||
if (!total.value) {
|
||||
ElMessage.warning('当前列表为空,无数据可导出')
|
||||
return
|
||||
}
|
||||
exporting.value = true
|
||||
try {
|
||||
await exportListToCsv<ChurnRow>({
|
||||
const result = await exportListToCsv<ChurnRow>({
|
||||
fetchPage: (p, size) =>
|
||||
getChurn({
|
||||
channel: channel.value,
|
||||
@@ -176,6 +181,7 @@ async function exportCsv() {
|
||||
],
|
||||
filename: `流失预警_${kind.value}_${channel.value}`,
|
||||
})
|
||||
ElMessage.success(`已导出 ${result.rows} 条`)
|
||||
} catch (e) {
|
||||
ElMessage.error(`导出失败:${e instanceof Error ? e.message : String(e)}`)
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user