|
|
|
|
@ -136,6 +136,8 @@ const filters = reactive({
|
|
|
|
|
is_active: undefined as '1' | '0' | undefined,
|
|
|
|
|
schedule_status: undefined as 'not_started' | 'ongoing' | 'ended' | undefined,
|
|
|
|
|
audit_status: undefined as 'approved' | 'pending' | 'rejected' | undefined,
|
|
|
|
|
/** 活动开始日期区间 [start, end] YYYY-MM-DD */
|
|
|
|
|
dateRange: undefined as string[] | undefined,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const exportActivitiesLoading = ref(false)
|
|
|
|
|
@ -150,6 +152,8 @@ function buildActivitiesListParams(page: number, pageSize: number) {
|
|
|
|
|
is_active: filters.is_active,
|
|
|
|
|
schedule_status: filters.schedule_status,
|
|
|
|
|
audit_status: filters.audit_status,
|
|
|
|
|
start_date: filters.dateRange?.[0] || undefined,
|
|
|
|
|
end_date: filters.dateRange?.[1] || undefined,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -163,7 +167,8 @@ async function exportActivitiesXlsx() {
|
|
|
|
|
let total = Infinity
|
|
|
|
|
while (all.length < total) {
|
|
|
|
|
const { data } = await http.get('/activities', {
|
|
|
|
|
params: buildActivitiesListParams(page, pageSize),
|
|
|
|
|
// for_export:带回 detail_html / 媒体等列表接口默认剔除的字段
|
|
|
|
|
params: { ...buildActivitiesListParams(page, pageSize), for_export: 1 },
|
|
|
|
|
})
|
|
|
|
|
const chunk = (data?.data ?? []) as Record<string, unknown>[]
|
|
|
|
|
total = Number(data?.total ?? 0)
|
|
|
|
|
@ -2138,6 +2143,13 @@ async function removeActivity(row: Activity) {
|
|
|
|
|
<a-option value="pending">待审核</a-option>
|
|
|
|
|
<a-option value="rejected">已退回</a-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
<a-range-picker
|
|
|
|
|
v-model="filters.dateRange"
|
|
|
|
|
allow-clear
|
|
|
|
|
value-format="YYYY-MM-DD"
|
|
|
|
|
:placeholder="['活动时间起', '活动时间止']"
|
|
|
|
|
style="width: 280px"
|
|
|
|
|
/>
|
|
|
|
|
<a-button type="primary" @click="onSearch">查询</a-button>
|
|
|
|
|
<a-button type="primary" @click="openCreate">新增活动</a-button>
|
|
|
|
|
<a-button :loading="exportActivitiesLoading" @click="exportActivitiesXlsx">导出</a-button>
|
|
|
|
|
|