fix(ui): StaffDetail分页查找+SmsList日期筛选+SyncStatus自动刷新

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
浅念
2026-08-12 14:09:43 +08:00
parent 9a953553ec
commit 9e4a5ee536
3 changed files with 90 additions and 15 deletions
+22
View File
@@ -13,6 +13,9 @@ const pageSize = ref(20)
const loading = ref(false)
const errorMsg = ref<string | null>(null)
/** [start, end] as Date[] | null. null = no date filter (all SMS). */
const dateRange = ref<[Date, Date] | null>(null)
// All-fields drawer state.
const drawerOpen = ref(false)
const drawerSms = ref<Sms | null>(null)
@@ -24,6 +27,8 @@ async function load(): Promise<void> {
const res = await getSms({
page: page.value,
page_size: pageSize.value,
start: dateRange.value?.[0]?.getTime(),
end: dateRange.value?.[1]?.getTime(),
})
list.value = res.items
total.value = res.total
@@ -46,6 +51,12 @@ function handlePageSizeChange(s: number): void {
load()
}
/** New date range → reset to page 1 and reload. */
function onDateChange(): void {
page.value = 1
load()
}
/**
* Read a raw_json camelCase key off an SMS, preferring the structured
* snake_case column when it is populated. The first argument is the row so the
@@ -96,6 +107,17 @@ onMounted(load)
<h2 style="margin: 0 0 4px; font-size: 16px">短信记录</h2>
<span class="yk-sms__sub">共 {{ total }} 条</span>
</div>
<el-date-picker
v-model="dateRange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
size="small"
clearable
style="width: 260px"
@change="onDateChange"
/>
</div>
<el-alert