️ improve: webUI improve

This commit is contained in:
MartialBE 2024-04-05 15:56:42 +08:00
parent 7503b688ed
commit bd74a1d4ac
No known key found for this signature in database
GPG Key ID: F5A7AC860020C896
6 changed files with 26 additions and 13 deletions

View File

@ -1,9 +1,12 @@
import { styled } from '@mui/material/styles'; import { styled } from '@mui/material/styles';
import { Container } from '@mui/material'; import { Container } from '@mui/material';
const AdminContainer = styled(Container)({ const AdminContainer = styled(Container)(({ theme }) => ({
paddingLeft: '0px !important', paddingLeft: '0px !important',
paddingRight: '0px !important' paddingRight: '0px !important',
}); [theme.breakpoints.up('md')]: {
maxWidth: '1400px'
}
}));
export default AdminContainer; export default AdminContainer;

View File

@ -31,7 +31,7 @@ const KeywordTableHead = ({ order, orderBy, headLabel, onRequestSort }) => {
headCell.hide && headCell.hide === true ? null : ( headCell.hide && headCell.hide === true ? null : (
<TableCell <TableCell
key={headCell.id} key={headCell.id}
align={headCell.align || 'left'} align={headCell.align || 'right'}
// sortDirection={orderBy === headCell.id ? order : false} // sortDirection={orderBy === headCell.id ? order : false}
sx={{ width: headCell.width, minWidth: headCell.minWidth }} sx={{ width: headCell.width, minWidth: headCell.minWidth }}
> >

View File

@ -257,7 +257,7 @@ export default function ChannelTableRow({ item, manageChannel, handleOpenModal,
</TableCell> </TableCell>
<TableCell> <TableCell>
<Stack direction="row" spacing={1}> <Stack direction="row" justifyContent="center" alignItems="center" spacing={1}>
<Button <Button
id="test-model-button" id="test-model-button"
aria-controls={openTest ? 'test-model-menu' : undefined} aria-controls={openTest ? 'test-model-menu' : undefined}
@ -267,6 +267,7 @@ export default function ChannelTableRow({ item, manageChannel, handleOpenModal,
disableElevation disableElevation
onClick={handleTestModel} onClick={handleTestModel}
endIcon={<KeyboardArrowDownIcon />} endIcon={<KeyboardArrowDownIcon />}
size="small"
> >
测试 测试
</Button> </Button>

View File

@ -182,7 +182,8 @@ const Single = ({ ownedby, prices, reloadData }) => {
field: 'model', field: 'model',
sortable: true, sortable: true,
headerName: '模型名称', headerName: '模型名称',
width: 220, minWidth: 220,
flex: 1,
editable: true, editable: true,
hideable: false hideable: false
}, },
@ -190,7 +191,8 @@ const Single = ({ ownedby, prices, reloadData }) => {
field: 'type', field: 'type',
sortable: true, sortable: true,
headerName: '类型', headerName: '类型',
width: 220, flex: 1,
minWidth: 220,
type: 'singleSelect', type: 'singleSelect',
valueOptions: priceType, valueOptions: priceType,
editable: true, editable: true,
@ -200,7 +202,8 @@ const Single = ({ ownedby, prices, reloadData }) => {
field: 'channel_type', field: 'channel_type',
sortable: true, sortable: true,
headerName: '供应商', headerName: '供应商',
width: 220, flex: 1,
minWidth: 220,
type: 'singleSelect', type: 'singleSelect',
valueOptions: ownedby, valueOptions: ownedby,
editable: true, editable: true,
@ -210,7 +213,8 @@ const Single = ({ ownedby, prices, reloadData }) => {
field: 'input', field: 'input',
sortable: false, sortable: false,
headerName: '输入倍率', headerName: '输入倍率',
width: 150, flex: 0.8,
minWidth: 150,
type: 'number', type: 'number',
editable: true, editable: true,
valueFormatter: (params) => ValueFormatter(params.value), valueFormatter: (params) => ValueFormatter(params.value),
@ -220,7 +224,8 @@ const Single = ({ ownedby, prices, reloadData }) => {
field: 'output', field: 'output',
sortable: false, sortable: false,
headerName: '输出倍率', headerName: '输出倍率',
width: 150, flex: 0.8,
minWidth: 150,
type: 'number', type: 'number',
editable: true, editable: true,
valueFormatter: (params) => ValueFormatter(params.value), valueFormatter: (params) => ValueFormatter(params.value),
@ -230,7 +235,9 @@ const Single = ({ ownedby, prices, reloadData }) => {
field: 'actions', field: 'actions',
type: 'actions', type: 'actions',
headerName: '操作', headerName: '操作',
width: 100, flex: 0.5,
minWidth: 100,
// width: 100,
cellClassName: 'actions', cellClassName: 'actions',
hideable: false, hideable: false,
getActions: ({ id }) => { getActions: ({ id }) => {
@ -320,6 +327,7 @@ const Single = ({ ownedby, prices, reloadData }) => {
> >
<DataGrid <DataGrid
autoHeight autoHeight
autosizeOnMount
rows={rows} rows={rows}
columns={modelRatioColumns} columns={modelRatioColumns}
editMode="row" editMode="row"

View File

@ -78,10 +78,11 @@ export default function RedemptionTableRow({ item, manageRedemption, handleOpenM
<TableCell>{timestamp2string(item.created_time)}</TableCell> <TableCell>{timestamp2string(item.created_time)}</TableCell>
<TableCell>{item.redeemed_time ? timestamp2string(item.redeemed_time) : '尚未兑换'}</TableCell> <TableCell>{item.redeemed_time ? timestamp2string(item.redeemed_time) : '尚未兑换'}</TableCell>
<TableCell> <TableCell>
<Stack direction="row" spacing={1}> <Stack direction="row" justifyContent="center" alignItems="center" spacing={1}>
<Button <Button
variant="contained" variant="contained"
color="primary" color="primary"
size="small"
onClick={() => { onClick={() => {
copy(item.key, '兑换码'); copy(item.key, '兑换码');
}} }}

View File

@ -205,7 +205,7 @@ export default function TokensTableRow({ item, manageToken, handleOpenModal, set
<TableCell>{item.expired_time === -1 ? '永不过期' : timestamp2string(item.expired_time)}</TableCell> <TableCell>{item.expired_time === -1 ? '永不过期' : timestamp2string(item.expired_time)}</TableCell>
<TableCell> <TableCell>
<Stack direction="row" spacing={1}> <Stack direction="row" justifyContent="center" alignItems="center" spacing={1}>
<ButtonGroup size="small" aria-label="split button"> <ButtonGroup size="small" aria-label="split button">
<Button <Button
color="primary" color="primary"