|
|
@@ -8,7 +8,7 @@ import { |
|
|
|
Stack, |
|
|
|
Dialog, DialogTitle, DialogContent, DialogActions, |
|
|
|
} from '@mui/material'; |
|
|
|
import * as UrlUtils from "utils/ApiPathConst"; |
|
|
|
import { GET_PUBLIC_NOTICE_LIST, SET_PUBLIC_NOTICE_STATUS_PUBLISH_BULK } from "utils/ApiPathConst"; |
|
|
|
import * as HttpUtils from "utils/HttpUtils"; |
|
|
|
import * as DateUtils from "utils/DateUtils"; |
|
|
|
import * as FormatUtils from "utils/FormatUtils"; |
|
|
@@ -21,17 +21,15 @@ import { FormattedMessage, useIntl } from "react-intl"; |
|
|
|
|
|
|
|
export default function SearchPublicNoticeTable({ searchCriteria }) { |
|
|
|
|
|
|
|
const [rows, setRows] = React.useState([]); |
|
|
|
const [_searchCriteria, set_searchCriteria] = React.useState(searchCriteria); |
|
|
|
|
|
|
|
const [rows, setRows] = React.useState(); |
|
|
|
const navigate = useNavigate() |
|
|
|
|
|
|
|
const [selectedRowItems, setSelectedRowItems] = React.useState([]); |
|
|
|
const [isConfirmPopUp, setIsConfirmPopUp] = React.useState(false); |
|
|
|
const [isWarningPopUp, setIsWarningPopUp] = React.useState(false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const intl = useIntl(); |
|
|
|
|
|
|
|
React.useEffect(() => { |
|
|
@@ -40,14 +38,14 @@ export default function SearchPublicNoticeTable({ searchCriteria }) { |
|
|
|
|
|
|
|
|
|
|
|
function genIssueNo(params) { |
|
|
|
const issueNo = params.row.issueYear+ " Vol. " + FormatUtils.zeroPad(params.row.issueVolume, 3)+ ", No. " + FormatUtils.zeroPad(params.row.issueNo, 2)+ ", " + DateUtils.dateFormat(params.row.issueDate, "D MMM YYYY (ddd)") |
|
|
|
const issueNo = params.row.issueYear + " Vol. " + FormatUtils.zeroPad(params.row.issueVolume, 3) + ", No. " + FormatUtils.zeroPad(params.row.issueNo, 2) + ", " + DateUtils.dateFormat(params.row.issueDate, "D MMM YYYY (ddd)") |
|
|
|
return issueNo |
|
|
|
} |
|
|
|
|
|
|
|
function genGroupNo(params) { |
|
|
|
let groupNo = params.row.groupNo |
|
|
|
if (groupNo!=null){ |
|
|
|
groupNo = <><br/><div>{groupNo}</div></> |
|
|
|
if (groupNo != null) { |
|
|
|
groupNo = <><br /><div>{groupNo}</div></> |
|
|
|
} |
|
|
|
return groupNo |
|
|
|
} |
|
|
@@ -77,7 +75,7 @@ export default function SearchPublicNoticeTable({ searchCriteria }) { |
|
|
|
headerName: 'With Proof', |
|
|
|
width: 120, |
|
|
|
renderCell: (params) => { |
|
|
|
return [params.row.proofId!=null?"Yes":""] |
|
|
|
return [params.row.proofId != null ? "Yes" : ""] |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
@@ -111,12 +109,12 @@ export default function SearchPublicNoticeTable({ searchCriteria }) { |
|
|
|
headerName: 'Gazette Issue No. / Gazette Code', |
|
|
|
flex: 1.5, |
|
|
|
minWidth: 350, |
|
|
|
renderCell: (params) =>( |
|
|
|
renderCell: (params) => ( |
|
|
|
<div> |
|
|
|
{genIssueNo(params)} |
|
|
|
{genGroupNo(params)} |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
) |
|
|
|
}, |
|
|
|
]; |
|
|
@@ -136,21 +134,20 @@ export default function SearchPublicNoticeTable({ searchCriteria }) { |
|
|
|
for (var i = 0; i < datas?.length; i++) { |
|
|
|
appIdList.push(datas[i].id); |
|
|
|
} |
|
|
|
if(appIdList.length<1){ |
|
|
|
if (appIdList.length < 1) { |
|
|
|
setIsWarningPopUp(true); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
HttpUtils.post({ |
|
|
|
url: UrlUtils.SET_PUBLIC_NOTICE_STATUS_PUBLISH_BULK, |
|
|
|
url: SET_PUBLIC_NOTICE_STATUS_PUBLISH_BULK, |
|
|
|
params: { |
|
|
|
ids: appIdList |
|
|
|
}, |
|
|
|
onSuccess: () => { |
|
|
|
reloadFunction() |
|
|
|
searchCriteria.reload = new Date(); |
|
|
|
notifyActionSuccess("Action Success!") |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return (<> |
|
|
@@ -159,7 +156,7 @@ export default function SearchPublicNoticeTable({ searchCriteria }) { |
|
|
|
<Grid container direction="row" justifyContent="flex-start" alignItems="center" sx={{ p: 1 }} > |
|
|
|
<Button |
|
|
|
variant="contained" |
|
|
|
onClick={()=>setIsConfirmPopUp(true)} |
|
|
|
onClick={() => setIsConfirmPopUp(true)} |
|
|
|
> |
|
|
|
Published |
|
|
|
</Button> |
|
|
@@ -179,13 +176,13 @@ export default function SearchPublicNoticeTable({ searchCriteria }) { |
|
|
|
customPageSize={10} |
|
|
|
getRowHeight={() => 'auto'} |
|
|
|
onRowDoubleClick={handleRowDoubleClick} |
|
|
|
doLoad={{ |
|
|
|
url:UrlUtils.GET_PUBLIC_NOTICE_LIST, |
|
|
|
params:_searchCriteria, |
|
|
|
callback: function(responseData){ |
|
|
|
doLoad={React.useMemo(() => ({ |
|
|
|
url: GET_PUBLIC_NOTICE_LIST, |
|
|
|
params: _searchCriteria, |
|
|
|
callback: function (responseData) { |
|
|
|
setRows(responseData?.records); |
|
|
|
} |
|
|
|
}} |
|
|
|
}), [_searchCriteria])} |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<div> |
|
|
@@ -207,7 +204,7 @@ export default function SearchPublicNoticeTable({ searchCriteria }) { |
|
|
|
</DialogTitle> |
|
|
|
<DialogContent style={{ display: 'flex', }}> |
|
|
|
<Stack direction="column" justifyContent="space-between"> |
|
|
|
<Typography variant="h4" style={{ padding: '16px' }}>Please Confirm to mark selected application as Published.</Typography> |
|
|
|
<Typography variant="h4" style={{ padding: '16px' }}>Please Confirm to mark selected application as Published.</Typography> |
|
|
|
</Stack> |
|
|
|
</DialogContent> |
|
|
|
<DialogActions> |
|
|
@@ -216,7 +213,7 @@ export default function SearchPublicNoticeTable({ searchCriteria }) { |
|
|
|
<FormattedMessage id="close" /> |
|
|
|
</Typography></Button> |
|
|
|
|
|
|
|
<Button onClick={()=>doPublish()} aria-label={intl.formatMessage({ id: 'confirm' })}> |
|
|
|
<Button onClick={() => doPublish()} aria-label={intl.formatMessage({ id: 'confirm' })}> |
|
|
|
<Typography variant="h5"> |
|
|
|
<FormattedMessage id="confirm" /> |
|
|
|
</Typography></Button> |
|
|
|