酒店
build / task (16.x, npm, macOS-latest) (push) Canceled after 0s
build / task (16.x, npm, ubuntu-latest) (push) Canceled after 0s
build / task (16.x, npm, windows-latest) (push) Canceled after 0s
build / task (16.x, pnpm, macOS-latest) (push) Canceled after 0s
build / task (16.x, pnpm, ubuntu-latest) (push) Canceled after 0s
build / task (16.x, pnpm, windows-latest) (push) Canceled after 0s
build / task (16.x, yarn, macOS-latest) (push) Canceled after 0s
build / task (16.x, yarn, ubuntu-latest) (push) Canceled after 0s
build / task (16.x, yarn, windows-latest) (push) Canceled after 0s
build / task (18.x, npm, macOS-latest) (push) Canceled after 0s
build / task (18.x, npm, ubuntu-latest) (push) Canceled after 0s
build / task (18.x, npm, windows-latest) (push) Canceled after 0s
build / task (18.x, pnpm, macOS-latest) (push) Canceled after 0s
build / task (18.x, pnpm, ubuntu-latest) (push) Canceled after 0s
build / task (18.x, pnpm, windows-latest) (push) Canceled after 0s
build / task (18.x, yarn, macOS-latest) (push) Canceled after 0s
build / task (18.x, yarn, ubuntu-latest) (push) Canceled after 0s
build / task (18.x, yarn, windows-latest) (push) Canceled after 0s
build / task (20.x, npm, macOS-latest) (push) Canceled after 0s
build / task (20.x, npm, ubuntu-latest) (push) Canceled after 0s
build / task (20.x, npm, windows-latest) (push) Canceled after 0s
build / task (20.x, pnpm, macOS-latest) (push) Canceled after 0s
build / task (20.x, pnpm, ubuntu-latest) (push) Canceled after 0s
build / task (20.x, pnpm, windows-latest) (push) Canceled after 0s
build / task (20.x, yarn, macOS-latest) (push) Canceled after 0s
build / task (20.x, yarn, ubuntu-latest) (push) Canceled after 0s
build / task (20.x, yarn, windows-latest) (push) Canceled after 0s
build / task (16.x, npm, macOS-latest) (push) Canceled after 0s
build / task (16.x, npm, ubuntu-latest) (push) Canceled after 0s
build / task (16.x, npm, windows-latest) (push) Canceled after 0s
build / task (16.x, pnpm, macOS-latest) (push) Canceled after 0s
build / task (16.x, pnpm, ubuntu-latest) (push) Canceled after 0s
build / task (16.x, pnpm, windows-latest) (push) Canceled after 0s
build / task (16.x, yarn, macOS-latest) (push) Canceled after 0s
build / task (16.x, yarn, ubuntu-latest) (push) Canceled after 0s
build / task (16.x, yarn, windows-latest) (push) Canceled after 0s
build / task (18.x, npm, macOS-latest) (push) Canceled after 0s
build / task (18.x, npm, ubuntu-latest) (push) Canceled after 0s
build / task (18.x, npm, windows-latest) (push) Canceled after 0s
build / task (18.x, pnpm, macOS-latest) (push) Canceled after 0s
build / task (18.x, pnpm, ubuntu-latest) (push) Canceled after 0s
build / task (18.x, pnpm, windows-latest) (push) Canceled after 0s
build / task (18.x, yarn, macOS-latest) (push) Canceled after 0s
build / task (18.x, yarn, ubuntu-latest) (push) Canceled after 0s
build / task (18.x, yarn, windows-latest) (push) Canceled after 0s
build / task (20.x, npm, macOS-latest) (push) Canceled after 0s
build / task (20.x, npm, ubuntu-latest) (push) Canceled after 0s
build / task (20.x, npm, windows-latest) (push) Canceled after 0s
build / task (20.x, pnpm, macOS-latest) (push) Canceled after 0s
build / task (20.x, pnpm, ubuntu-latest) (push) Canceled after 0s
build / task (20.x, pnpm, windows-latest) (push) Canceled after 0s
build / task (20.x, yarn, macOS-latest) (push) Canceled after 0s
build / task (20.x, yarn, ubuntu-latest) (push) Canceled after 0s
build / task (20.x, yarn, windows-latest) (push) Canceled after 0s
This commit is contained in:
1 parent
c30c6308ea
commit
87fbaf85a1
1 file changed
+80
-4
@@ -44,7 +44,34 @@
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row class="mb8">
|
||||
<div style="width: 100%">
|
||||
<div style="width: 100%" class="flex flex-wrap items-center gap-2">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
v-auth="'supermarket_smHotelDownstreamPushLog_del'"
|
||||
:loading="quickDeleting === 1"
|
||||
@click="handleDeleteRecentDays(1)"
|
||||
>
|
||||
删除过去1天
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
v-auth="'supermarket_smHotelDownstreamPushLog_del'"
|
||||
:loading="quickDeleting === 3"
|
||||
@click="handleDeleteRecentDays(3)"
|
||||
>
|
||||
删除过去3天
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
v-auth="'supermarket_smHotelDownstreamPushLog_del'"
|
||||
:loading="quickDeleting === 7"
|
||||
@click="handleDeleteRecentDays(7)"
|
||||
>
|
||||
删除过去7天
|
||||
</el-button>
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
@@ -52,7 +79,7 @@
|
||||
v-auth="'supermarket_smHotelDownstreamPushLog_del'"
|
||||
@click="rangeVisible = true"
|
||||
>
|
||||
按时间删除
|
||||
自定义时间删除
|
||||
</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" class="ml10 mr20" style="float: right" @queryTable="getDataList" />
|
||||
</div>
|
||||
@@ -143,14 +170,19 @@
|
||||
</div>
|
||||
</el-drawer>
|
||||
|
||||
<el-dialog v-model="rangeVisible" title="按创建时间删除" width="480px" destroy-on-close>
|
||||
<el-dialog v-model="rangeVisible" title="自定义时间删除" width="520px" destroy-on-close>
|
||||
<el-alert
|
||||
type="info"
|
||||
:closable="false"
|
||||
show-icon
|
||||
class="mb-3"
|
||||
title="按流水「创建时间」删除;至少选开始或结束。删除后不可恢复(逻辑删除)。"
|
||||
title="按流水「创建时间」删除;至少选开始或结束。也可用上方快捷:过去1/3/7天。删除后为逻辑删除。"
|
||||
/>
|
||||
<div class="mb-3 flex flex-wrap gap-2">
|
||||
<el-button size="small" @click="applyRecentDaysToRange(1)">填入过去1天</el-button>
|
||||
<el-button size="small" @click="applyRecentDaysToRange(3)">填入过去3天</el-button>
|
||||
<el-button size="small" @click="applyRecentDaysToRange(7)">填入过去7天</el-button>
|
||||
</div>
|
||||
<el-form label-width="100px">
|
||||
<el-form-item label="开始时间">
|
||||
<el-date-picker
|
||||
@@ -192,9 +224,53 @@ const detail = reactive<any>({})
|
||||
const retryingId = ref<string | number | null>(null)
|
||||
const rangeVisible = ref(false)
|
||||
const rangeDeleting = ref(false)
|
||||
/** 快捷删除中的天数,用于按钮 loading */
|
||||
const quickDeleting = ref<number | null>(null)
|
||||
const rangeBegin = ref("")
|
||||
const rangeEnd = ref("")
|
||||
|
||||
const pad2 = (n: number) => String(n).padStart(2, "0")
|
||||
const formatDateTime = (d: Date) => {
|
||||
return `${d.getFullYear()}-${pad2(d.getMonth() + 1)}-${pad2(d.getDate())} ${pad2(d.getHours())}:${pad2(d.getMinutes())}:${pad2(d.getSeconds())}`
|
||||
}
|
||||
|
||||
/** 过去 N 天:从现在往前推 N 天 00:00:00 ~ 当前时刻 */
|
||||
const recentDaysRange = (days: number) => {
|
||||
const end = new Date()
|
||||
const begin = new Date(end.getTime() - days * 24 * 60 * 60 * 1000)
|
||||
return {
|
||||
createTimeBegin: formatDateTime(begin),
|
||||
createTimeEnd: formatDateTime(end),
|
||||
}
|
||||
}
|
||||
|
||||
const applyRecentDaysToRange = (days: number) => {
|
||||
const r = recentDaysRange(days)
|
||||
rangeBegin.value = r.createTimeBegin
|
||||
rangeEnd.value = r.createTimeEnd
|
||||
}
|
||||
|
||||
const handleDeleteRecentDays = async (days: number) => {
|
||||
const r = recentDaysRange(days)
|
||||
try {
|
||||
await useMessageBox().confirm(
|
||||
`确认删除过去 ${days} 天内的推送流水?\n时间范围:${r.createTimeBegin} ~ ${r.createTimeEnd}`,
|
||||
)
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
quickDeleting.value = days
|
||||
try {
|
||||
const res: any = await delByRange(r)
|
||||
useMessage().success(res?.msg || `已删除 ${res?.data ?? 0} 条`)
|
||||
getDataList(false)
|
||||
} catch (e: any) {
|
||||
useMessage().error(e?.msg || e?.message || "删除失败")
|
||||
} finally {
|
||||
quickDeleting.value = null
|
||||
}
|
||||
}
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: { success: "0" },
|
||||
pageList: fetchList,
|
||||
|
||||
Reference in new issue
Block a user