Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

98 lignes
3.4 KiB

  1. // material-ui
  2. import {useMemo} from 'react';
  3. import {
  4. useMediaQuery,
  5. } from '@mui/material';
  6. import * as DateUtils from "utils/DateUtils";
  7. import * as ProofStatus from "utils/statusUtils/ProofStatus";
  8. import {FiDataGrid} from "components/FiDataGrid";
  9. import * as FormatUtils from "utils/FormatUtils"
  10. import {useTheme} from "@emotion/react";
  11. import {useIntl} from "react-intl";
  12. import { clickableLink } from 'utils/CommonFunction';
  13. import {GET_PUBLIC_NOTICE_APPLY_DETAIL_PROOF } from "utils/ApiPathConst"
  14. // ==============================|| EVENT TABLE ||============================== //
  15. export default function ProofTab({appId, setCount}) {
  16. const intl = useIntl();
  17. const theme = useTheme();
  18. const isMdOrLg = useMediaQuery(theme.breakpoints.up('md'));
  19. const { locale } = intl;
  20. const renderHeaderWithAria = (params) => (
  21. <span aria-label={params.colDef.headerName}>{params.colDef.headerName}</span>
  22. );
  23. const columns = [
  24. {
  25. field: 'refNo',
  26. headerName: intl.formatMessage({id: 'proofId'}),
  27. width: 200,
  28. cellClassName: 'actions',
  29. renderHeader: renderHeaderWithAria,
  30. renderCell: (params) => {
  31. return clickableLink('/proof/reply/' + params.row.id, params.row.refNo);
  32. },
  33. },
  34. {
  35. field: 'status',
  36. headerName: intl.formatMessage({id: 'status'}),
  37. width: isMdOrLg ? 'auto' : 160,
  38. flex: isMdOrLg ? 1 : undefined,
  39. renderHeader: renderHeaderWithAria,
  40. renderCell: (params) => {
  41. return locale === 'en' ? ProofStatus.getStatus_Eng(params) : ProofStatus.getStatus_Cht(params);
  42. },
  43. },
  44. {
  45. id: 'reviseDeadline',
  46. field: 'reviseDeadline',
  47. headerName: intl.formatMessage({id: 'proofDate'}),
  48. width: isMdOrLg ? 'auto' : 160,
  49. flex: isMdOrLg ? 1 : undefined,
  50. renderHeader: renderHeaderWithAria,
  51. valueGetter: (params) => {
  52. return DateUtils.datetimeStr(params?.value);
  53. }
  54. },
  55. {
  56. id: 'replyDate',
  57. field: 'replyDate',
  58. headerName: intl.formatMessage({id: 'replyDate'}),
  59. width: isMdOrLg ? 'auto' : 160,
  60. flex: isMdOrLg ? 1 : undefined,
  61. renderHeader: renderHeaderWithAria,
  62. valueGetter: (params) => {
  63. return params?.value?DateUtils.datetimeStr(params?.value):"";
  64. }
  65. },
  66. {
  67. id: 'fee',
  68. field: 'fee',
  69. headerName: intl.formatMessage({id: 'fee'}),
  70. width: isMdOrLg ? 'auto' : 160,
  71. flex: isMdOrLg ? 1 : undefined,
  72. renderHeader: renderHeaderWithAria,
  73. valueGetter: (params) => {
  74. return (params?.value)?"$ "+FormatUtils.currencyFormat(params?.value):"";
  75. }
  76. },
  77. ];
  78. return (
  79. <div style={{height:'20%', width: '100%'}}>
  80. <FiDataGrid
  81. columns={columns}
  82. customPageSize={10}
  83. doLoad={useMemo(() => ({
  84. url: GET_PUBLIC_NOTICE_APPLY_DETAIL_PROOF+"/"+appId,
  85. params: {},
  86. callback: function (responseData) {
  87. setCount(responseData?.count);
  88. }
  89. }), [appId])}
  90. />
  91. </div>
  92. );
  93. }