fix: align reporting fields queries and disk monitoring
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
Modal,
|
||||
Pagination,
|
||||
QueryPanel,
|
||||
QueryButtons,
|
||||
Select,
|
||||
Tag,
|
||||
type DateRangeValue,
|
||||
@@ -97,6 +98,7 @@ export function ClientBatchTasksPage() {
|
||||
const [keyword, setKeyword] = useState(() => searchParams.get('taskNo') ?? '');
|
||||
const [application, setApplication] = useState('all');
|
||||
const [submittedDateRange, setSubmittedDateRange] = useState<DateRangeValue>(() => recentBeijingDateRange(7));
|
||||
const [applied, setApplied] = useState(() => ({ keyword, application, submittedDateRange }));
|
||||
const [hoveredTaskId, setHoveredTaskId] = useState<string | null>(null);
|
||||
const [page, setPage] = useState(1);
|
||||
const [selectedTask, setSelectedTask] = useState<BatchTask | null>(null);
|
||||
@@ -106,10 +108,10 @@ export function ClientBatchTasksPage() {
|
||||
function loadTasks(targetPage = page) {
|
||||
setLoading(true);
|
||||
clientApi.listBatchTasksPage({
|
||||
keyword: keyword.trim() || undefined,
|
||||
applicationKeyword: application === 'all' ? undefined : application,
|
||||
createdAtFrom: submittedDateRange.start,
|
||||
createdAtTo: submittedDateRange.end,
|
||||
keyword: applied.keyword.trim() || undefined,
|
||||
applicationKeyword: applied.application === 'all' ? undefined : applied.application,
|
||||
createdAtFrom: applied.submittedDateRange.start,
|
||||
createdAtTo: applied.submittedDateRange.end,
|
||||
page: targetPage,
|
||||
pageSize,
|
||||
})
|
||||
@@ -124,7 +126,21 @@ export function ClientBatchTasksPage() {
|
||||
|
||||
useEffect(() => {
|
||||
loadTasks(page);
|
||||
}, [page]);
|
||||
}, [applied, page]);
|
||||
|
||||
function query() {
|
||||
setPage(1);
|
||||
setApplied({ keyword, application, submittedDateRange });
|
||||
}
|
||||
|
||||
function reset() {
|
||||
const defaults = { keyword: '', application: 'all', submittedDateRange: recentBeijingDateRange(7) };
|
||||
setKeyword('');
|
||||
setApplication('all');
|
||||
setSubmittedDateRange(defaults.submittedDateRange);
|
||||
setPage(1);
|
||||
setApplied(defaults);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
clientApi.listApplicationOptions()
|
||||
@@ -236,8 +252,7 @@ export function ClientBatchTasksPage() {
|
||||
onChange={(event) => setKeyword(event.target.value)}
|
||||
onKeyDown={(event) => {
|
||||
if (event.key === 'Enter') {
|
||||
setPage(1);
|
||||
loadTasks(1);
|
||||
query();
|
||||
}
|
||||
}}
|
||||
placeholder="输入发送批次号搜索"
|
||||
@@ -246,7 +261,7 @@ export function ClientBatchTasksPage() {
|
||||
/>
|
||||
<Select label="选择应用" onChange={(event) => setApplication(event.target.value)} options={applicationOptions} value={application} />
|
||||
<DateRangeInput label="提交时间" onChange={setSubmittedDateRange} value={submittedDateRange} />
|
||||
<Button onClick={() => { setPage(1); loadTasks(1); }} variant="primary">查询</Button>
|
||||
<QueryButtons onQuery={query} onReset={reset} />
|
||||
</QueryPanel>
|
||||
|
||||
<div className="surface batch-table-card">
|
||||
|
||||
Reference in New Issue
Block a user