瀏覽代碼

reset date range & update search results

tags/Baseline_30082024_FRONTEND_UAT
cyril.tsui 1 年之前
父節點
當前提交
4df034fbb0
共有 2 個檔案被更改,包括 5 行新增2 行删除
  1. +2
    -0
      src/components/SearchBox/SearchBox.tsx
  2. +3
    -2
      src/components/SearchResults/SearchResults.tsx

+ 2
- 0
src/components/SearchBox/SearchBox.tsx 查看文件

@@ -154,6 +154,7 @@ function SearchBox<T extends string>({
<DatePicker
label={c.label}
onChange={makeDateChangeHandler(c.paramName)}
value={inputs[c.paramName] ? dayjs(inputs[c.paramName]) : null}
/>
</FormControl>
<Box
@@ -168,6 +169,7 @@ function SearchBox<T extends string>({
<DatePicker
label={c.label2}
onChange={makeDateToChangeHandler(c.paramName)}
value={inputs[c.paramName.concat("To") as T] ? dayjs(inputs[c.paramName.concat("To") as T]) : null}
/>
</FormControl>
</Box>


+ 3
- 2
src/components/SearchResults/SearchResults.tsx 查看文件

@@ -11,7 +11,7 @@ import TablePagination, {
TablePaginationProps,
} from "@mui/material/TablePagination";
import TableRow from "@mui/material/TableRow";
import IconButton from "@mui/material/IconButton";
import IconButton, { IconButtonOwnProps, IconButtonPropsColorOverrides } from "@mui/material/IconButton";

export interface ResultWithId {
id: string | number;
@@ -20,6 +20,7 @@ export interface ResultWithId {
interface BaseColumn<T extends ResultWithId> {
name: keyof T;
label: string;
color?: IconButtonOwnProps["color"];
}

interface ColumnWithAction<T extends ResultWithId> extends BaseColumn<T> {
@@ -91,7 +92,7 @@ function SearchResults<T extends ResultWithId>({
<TableCell key={`${columnName.toString()}-${idx}`}>
{isActionColumn(column) ? (
<IconButton
color="primary"
color={column.color ?? "primary"}
onClick={() => column.onClick(item)}
>
{column.buttonIcon}


Loading…
取消
儲存