Browse Source

Merge branch 'main' of https://git.2fi-solutions.com/wayne.lee/tsms

tags/Baseline_30082024_FRONTEND_UAT
leoho2fi 1 year ago
parent
commit
ce1705a521
2 changed files with 5 additions and 2 deletions
  1. +2
    -0
      src/components/SearchBox/SearchBox.tsx
  2. +3
    -2
      src/components/SearchResults/SearchResults.tsx

+ 2
- 0
src/components/SearchBox/SearchBox.tsx View File

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


+ 3
- 2
src/components/SearchResults/SearchResults.tsx View File

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


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


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


Loading…
Cancel
Save