您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

82 行
2.3 KiB

  1. // material-ui
  2. import {
  3. Box,
  4. Typography
  5. } from '@mui/material';
  6. import MainCard from "components/MainCard";
  7. import * as React from "react";
  8. import { FiDataGrid } from "components/FiDataGrid";
  9. import { GET_SYS_PARAMS } from "utils/ApiPathConst";
  10. // ==============================|| DASHBOARD - DEFAULT ||============================== //
  11. const Table = ({onRowClick, searchCriteria}) => {
  12. const [_searchCriteria, set_searchCriteria] = React.useState(searchCriteria);
  13. React.useEffect(() => {
  14. set_searchCriteria(searchCriteria);
  15. }, [searchCriteria]);
  16. const columns = [
  17. {
  18. field: 'name',
  19. headerName: 'Name',
  20. width: 300,
  21. },
  22. {
  23. id: 'type',
  24. field: 'type',
  25. headerName: 'Type',
  26. width: 150,
  27. valueGetter: (params) => {
  28. return params.row.type
  29. }
  30. },
  31. {
  32. id: 'category',
  33. field: 'category',
  34. headerName: 'Category',
  35. width: 150,
  36. },
  37. {
  38. id: 'value',
  39. field: 'value',
  40. headerName: 'Value',
  41. flex: 1,
  42. minWidth: 400,
  43. renderCell:(params)=>{
  44. return <div dangerouslySetInnerHTML={{__html: params.value}} />
  45. }
  46. },
  47. ];
  48. return (
  49. <MainCard elevation={0}
  50. border={false}
  51. content={false}
  52. height='100%'
  53. >
  54. <Typography variant="h5" sx={{mt: 3, ml: 3, mr: 3, borderBottom: "1px solid black"}}>
  55. System Params
  56. </Typography>
  57. <div style={{ width: '100%' }}>
  58. <Box sx={{ backgroundColor: "#fff", ml: 2 }} height='100%'>
  59. <FiDataGrid
  60. columns={columns}
  61. customPageSize={10}
  62. getRowHeight={() => 'auto'}
  63. onRowClick={onRowClick}
  64. doLoad={{
  65. url:GET_SYS_PARAMS,
  66. params:_searchCriteria
  67. }}
  68. />
  69. </Box>
  70. </div>
  71. </MainCard>
  72. );
  73. };
  74. export default Table;