Alex Cheung 1 年之前
父節點
當前提交
982ac96ece
共有 33 個文件被更改,包括 475 次插入9170 次删除
  1. +182
    -9114
      package-lock.json
  2. +1
    -0
      package.json
  3. +3
    -0
      src/App.js
  4. +2
    -0
      src/pages/OrganizationDetailPage/OrganizationCard.js
  5. +2
    -0
      src/pages/OrganizationDetailPage_FromUser/OrganizationCard_loadFromUser.js
  6. +5
    -0
      src/pages/OrganizationSearchPage/OrganizationTable.js
  7. +2
    -0
      src/pages/Proof/Create_FromApp/ProofForm.js
  8. +3
    -0
      src/pages/Proof/Reply_Public/ProofForm.js
  9. +5
    -0
      src/pages/Proof/Search_GLD/DataGrid.js
  10. +5
    -0
      src/pages/Proof/Search_Public/DataGrid.js
  11. +2
    -0
      src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js
  12. +2
    -0
      src/pages/PublicNotice/Details_GLD/ApplicationDetailCard.js
  13. +5
    -0
      src/pages/PublicNotice/Details_GLD/GazetteDetailCard.js
  14. +0
    -1
      src/pages/PublicNotice/Details_GLD/StatusChangeDialog.js
  15. +15
    -5
      src/pages/PublicNotice/Details_GLD/index.js
  16. +5
    -0
      src/pages/PublicNotice/ListPanel/BaseGrid.js
  17. +5
    -0
      src/pages/PublicNotice/ListPanel/PendingPaymentTab.js
  18. +27
    -12
      src/pages/PublicNotice/ListPanel/SearchPublicNoticeForm.js
  19. +4
    -0
      src/pages/PublicNotice/ListPanel/SearchPublicNoticeTable.js
  20. +6
    -0
      src/pages/PublicNotice/Search_GLD/DataGrid.js
  21. +37
    -6
      src/pages/PublicNotice/Search_GLD/SearchForm.js
  22. +5
    -3
      src/pages/User/DetailPage/index.js
  23. +5
    -0
      src/pages/User/DetailsPage_Individual/UserInformationCard_Individual.js
  24. +5
    -0
      src/pages/User/DetailsPage_Organization/UserInformationCard_Organization.js
  25. +4
    -4
      src/pages/User/DetailsPage_Organization/index.js
  26. +6
    -1
      src/pages/User/SearchPage/UserTable.js
  27. +5
    -1
      src/pages/User/SearchPage_Individual/UserTable_Individual.js
  28. +5
    -0
      src/pages/User/SearchPage_Organization/UserTable_Organization.js
  29. +1
    -1
      src/pages/authentication/auth-forms/AuthLogin.js
  30. +20
    -7
      src/pages/authentication/auth-forms/BusCustomFormWizard.js
  31. +4
    -3
      src/pages/pnspsUserGroupDetailPage/index.js
  32. +5
    -0
      src/pages/pnspsUserGroupSearchPage/UserGroupTable.js
  33. +92
    -12
      src/utils/CommonFunction.js

+ 182
- 9114
package-lock.json
文件差異過大導致無法顯示
查看文件


+ 1
- 0
package.json 查看文件

@@ -48,6 +48,7 @@
"react-scripts": "^5.0.1",
"react-syntax-highlighter": "^15.5.0",
"react-to-print": "^2.14.13",
"react-toastify": "^9.1.3",
"react-window": "^1.8.7",
"redux": "^4.2.0",
"simplebar": "^5.3.8",


+ 3
- 0
src/App.js 查看文件

@@ -2,6 +2,8 @@
import Routes from 'routes';
import ThemeCustomization from 'themes';
import ScrollTop from 'components/ScrollTop';
import {ToastContainer} from "react-toastify";
import 'react-toastify/dist/ReactToastify.css';
//import {isUserLoggedIn} from 'utils/Utils';
//import {DefaultRoute} from 'routes/index'
// ==============================|| APP - THEME, ROUTER, LOCAL ||============================== //
@@ -12,6 +14,7 @@ const App = () => (
<Routes>
</Routes>
</ScrollTop>
<ToastContainer/>
</ThemeCustomization>
);



+ 2
- 0
src/pages/OrganizationDetailPage/OrganizationCard.js 查看文件

@@ -15,6 +15,7 @@ import * as ComboData from "../../utils/ComboData";
const LoadingComponent = Loadable(lazy(() => import('../extra-pages/LoadingComponent')));
import Loadable from 'components/Loadable';
import { lazy } from 'react';
import { notifySaveSuccess } from 'utils/CommonFunction';

// ==============================|| DASHBOARD - DEFAULT ||============================== //

@@ -83,6 +84,7 @@ const OrganizationCard = ({ userData, loadDataFun, id }) => {
creditor: vaule.creditor,
},
onSuccess: function () {
notifySaveSuccess()
loadDataFun();
setEditMode(false);
}


+ 2
- 0
src/pages/OrganizationDetailPage_FromUser/OrganizationCard_loadFromUser.js 查看文件

@@ -15,6 +15,7 @@ import { useFormik } from 'formik';
const LoadingComponent = Loadable(lazy(() => import('../extra-pages/LoadingComponent')));
import Loadable from 'components/Loadable';
import { lazy } from 'react';
import { notifyCreateSuccess } from 'utils/CommonFunction';

// ==============================|| DASHBOARD - DEFAULT ||============================== //

@@ -81,6 +82,7 @@ const OrganizationCard_loadFromUser = ({ userData, userId }) => {
},
onSuccess: function (responseData) {
navigate('/org/' + responseData.id);
notifyCreateSuccess()
}
});
}


+ 5
- 0
src/pages/OrganizationSearchPage/OrganizationTable.js 查看文件

@@ -84,6 +84,10 @@ export default function OrganizationTable({ recordList }) {
},
];

function handleRowDoubleClick(params) {
navigate('/org/' + params.id);
}

return (
<div style={{ height: "fit-content", width: '100%' }}>
<FiDataGrid
@@ -94,6 +98,7 @@ export default function OrganizationTable({ recordList }) {
paginationModel: { page: 0, pageSize: 5 },
},
}}
onRowDoubleClick={handleRowDoubleClick}
/>
</div>
);


+ 2
- 0
src/pages/Proof/Create_FromApp/ProofForm.js 查看文件

@@ -18,6 +18,7 @@ import * as React from "react";
import { useFormik } from 'formik';
import { useNavigate } from "react-router-dom";
import Loadable from 'components/Loadable';
import { notifySaveSuccess } from 'utils/CommonFunction';
const UploadFileTable = Loadable(React.lazy(() => import('./UploadFileTable')));
// ==============================|| DASHBOARD - DEFAULT ||============================== //

@@ -118,6 +119,7 @@ const FormPanel = ({ formData }) => {
},
files: attachments,
onSuccess: function () {
notifySaveSuccess()
navigate("/proof/search");
}
});


+ 3
- 0
src/pages/Proof/Reply_Public/ProofForm.js 查看文件

@@ -21,6 +21,7 @@ import { useFormik } from 'formik';
import { useNavigate } from "react-router-dom";
import * as DateUtils from "utils/DateUtils"
import Loadable from 'components/Loadable';
import { notifyActionSuccess } from 'utils/CommonFunction';
const UploadFileTable = Loadable(React.lazy(() => import('./UploadFileTable')));

// ==============================|| DASHBOARD - DEFAULT ||============================== //
@@ -76,8 +77,10 @@ const FormPanel = ({ formData }) => {
files: attachments ? attachments : [],
onSuccess: function () {
if (actionValue) {
notifyActionSuccess("提交成功!")
navigate("/proof/pay/"+params.id);
} else {
notifyActionSuccess("提交成功!")
navigate("/proof/search");
}
},


+ 5
- 0
src/pages/Proof/Search_GLD/DataGrid.js 查看文件

@@ -125,6 +125,10 @@ export default function SearchPublicNoticeTable({ recordList }) {
var zero = places - num.toString().length + 1;
return Array(+(zero > 0 && zero)).join("0") + num;
}
function handleRowDoubleClick(params) {
navigate('/proof/reply/' + params.row.id);
}

return (
<div style={{ height: 400, width: '100%' }}>
@@ -138,6 +142,7 @@ export default function SearchPublicNoticeTable({ recordList }) {
paginationModel: { page: 0, pageSize: 5 },
},
}}
onRowDoubleClick={handleRowDoubleClick}
/>
</div>
);


+ 5
- 0
src/pages/Proof/Search_Public/DataGrid.js 查看文件

@@ -126,6 +126,10 @@ export default function SearchPublicNoticeTable({ recordList }) {
return Array(+(zero > 0 && zero)).join("0") + num;
}

function handleRowDoubleClick(params) {
navigate('/proof/reply/' + params.row.id);
}

return (
<div style={{ height: 400, width: '100%' }}>

@@ -138,6 +142,7 @@ export default function SearchPublicNoticeTable({ recordList }) {
paginationModel: { page: 0, pageSize: 5 },
},
}}
onRowDoubleClick={handleRowDoubleClick}
/>
</div>
);


+ 2
- 0
src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js 查看文件

@@ -17,6 +17,7 @@ import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png'


import { useNavigate } from "react-router-dom";
import { notifyActionSuccess } from 'utils/CommonFunction';

// ==============================|| DASHBOARD - DEFAULT ||============================== //

@@ -90,6 +91,7 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => {
},
files: [attachment],
onSuccess: function () {
notifyActionSuccess('申請成功!')
navigate("/publicNotice");
// location.reload();
}


+ 2
- 0
src/pages/PublicNotice/Details_GLD/ApplicationDetailCard.js 查看文件

@@ -27,6 +27,7 @@ import CloseIcon from '@mui/icons-material/Close';
import EditNoteIcon from '@mui/icons-material/EditNote';
import DownloadIcon from '@mui/icons-material/Download';
import ReplayIcon from '@mui/icons-material/Replay';
import { notifyDownloadSuccess } from 'utils/CommonFunction';

// ==============================|| DASHBOARD - DEFAULT ||============================== //
const ApplicationDetailCard = (
@@ -77,6 +78,7 @@ const ApplicationDetailCard = (
skey: fileDetail.skey,
filename: fileDetail.filename,
});
notifyDownloadSuccess()
setUploadStatus(true)
};



+ 5
- 0
src/pages/PublicNotice/Details_GLD/GazetteDetailCard.js 查看文件

@@ -59,6 +59,7 @@ const GazetteDetailCard = (
+" No. "+applicationDetailData.gazetteIssueDetail.issueNo);
setIssueDate(DateUtils.dateFormat(applicationDetailData.gazetteIssueDetail.issueDate, "D MMM YYYY (ddd)"));
setGazetteCode(applicationDetailData.data.groupNo)
console.log(gazetteCode)
setGroupTitle(applicationDetailData.data.groupTitle)
}
}, [applicationDetailData]);
@@ -153,6 +154,7 @@ const GazetteDetailCard = (
{
value: issueNum,
})}
value={issueNum}
id='issueNum'
sx={{
"& .MuiInputBase-input.Mui-disabled": {
@@ -181,6 +183,7 @@ const GazetteDetailCard = (
{
value: gazetteCode,
})}
value={gazetteCode}
id='gazetteCode'
sx={{
"& .MuiInputBase-input.Mui-disabled": {
@@ -212,6 +215,7 @@ const GazetteDetailCard = (
{
value: issueDate,
})}
value={issueDate}
id='issueDate'
sx={{
"& .MuiInputBase-input.Mui-disabled": {
@@ -240,6 +244,7 @@ const GazetteDetailCard = (
{
value: groupTitle,
})}
value={groupTitle}
id='groupTitle'
sx={{
"& .MuiInputBase-input.Mui-disabled": {


+ 0
- 1
src/pages/PublicNotice/Details_GLD/StatusChangeDialog.js 查看文件

@@ -23,7 +23,6 @@ import * as ComboData from "utils/ComboData";
import { useFormik, FormikProvider } from 'formik';
import * as yup from 'yup';


const StatusChangeDialog = (props) => {
const [content, setContent] = useState();
const [dialogTitle, setDialogTitle] = useState("Confirm");


+ 15
- 5
src/pages/PublicNotice/Details_GLD/index.js 查看文件

@@ -35,6 +35,7 @@ import {
} from "utils/ApiPathConst";
const StatusChangeDialog = Loadable(lazy(() => import('./StatusChangeDialog')));
import * as DateUtils from "utils/DateUtils";
import { notifyActionSuccess, notifySaveSuccess } from "utils/CommonFunction";


// ==============================|| Body - DEFAULT ||============================== //
@@ -193,7 +194,9 @@ const PublicNoticeDetail_GLD = () => {
if (response.status === 204) {
setOpen(false);
handleClose();
location.reload();
// location.reload();
loadApplicationDetail()
notifyActionSuccess("Gen Gazette Code Success!")
}
})
.catch(error => {
@@ -211,7 +214,9 @@ const PublicNoticeDetail_GLD = () => {
onSuccess: function () {
setOpen(false);
handleClose();
location.reload();
// location.reload();
loadApplicationDetail()
notifySaveSuccess()
}
});
}
@@ -223,7 +228,9 @@ const PublicNoticeDetail_GLD = () => {
if (response.status === 204) {
setOpen(false);
handleClose();
location.reload();
// location.reload();
loadApplicationDetail()
notifySaveSuccess()
}
})
.catch(error => {
@@ -240,7 +247,8 @@ const PublicNoticeDetail_GLD = () => {
if (response.status === 204) {
setOpen(false);
handleClose();
location.reload();
loadApplicationDetail()
notifyActionSuccess("Withdrawn Success!")
}
})
.catch(error => {
@@ -257,7 +265,9 @@ const PublicNoticeDetail_GLD = () => {
if (response.status === 204) {
setOpen(false);
handleClose();
location.reload();
// location.reload();
loadApplicationDetail()
notifySaveSuccess()
}
})
.catch(error => {


+ 5
- 0
src/pages/PublicNotice/ListPanel/BaseGrid.js 查看文件

@@ -83,6 +83,10 @@ export default function BaseGrid({rows}) {
},
}
];
function handleRowDoubleClick(params) {
navigate('/publicNotice/'+ params.id);
}

return (
<div style={{height: 400, width: '100%', padding: 4}}>
@@ -94,6 +98,7 @@ export default function BaseGrid({rows}) {
paginationModel: {page: 0, pageSize: 5},
},
}}
onRowDoubleClick={handleRowDoubleClick}
/>
</div>
);


+ 5
- 0
src/pages/PublicNotice/ListPanel/PendingPaymentTab.js 查看文件

@@ -106,6 +106,10 @@ export default function SubmittedTab({ rows }) {
return content;
}

function handleRowDoubleClick(params) {
navigate('/publicNotice/'+ params.id);
}

return (
<>
<div style={{ height: 400, width: '100%', padding: 4 }}>
@@ -122,6 +126,7 @@ export default function SubmittedTab({ rows }) {
onRowSelectionModelChange={(newSelection) => {
setSelectedRowItems(newSelection);
}}
onRowDoubleClick={handleRowDoubleClick}
/>
<Button variant="contained" onClick={() => { setIsPopUp(true) }}>付款</Button>
</div>


+ 27
- 12
src/pages/PublicNotice/ListPanel/SearchPublicNoticeForm.js 查看文件

@@ -16,14 +16,15 @@ import * as DateUtils from "utils/DateUtils";
const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => {

const [type, setType] = React.useState([]);
const [status, setStatus] = React.useState({ key: 0, label: '全部', type: 'all' });
const [status, setStatus] = React.useState([{ key: 0, label: 'All', labelCht: "全部", type: 'all' }]);

const [minDate, setMinDate] = React.useState(searchCriteria.dateFrom);
const [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo);
const [selectedLabelsString, setSelectedLabelsString] = React.useState('');

const { reset, register, handleSubmit } = useForm()
const onSubmit = (data) => {
data.status = selectedLabelsString
let typeArray = [];

for (let i = 0; i < type.length; i++) {
@@ -35,14 +36,14 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => {
dateFrom: data.dateFrom,
dateTo: data.dateTo,
contact: data.contact,
status: (status?.type&&status?.type!= 'all')?status?.type:"",
status: (data.status === "" || data.status.includes('all')) ? "" : data.status,
};
applySearch(temp);
};

function resetForm() {
setType([]);
setStatus({ key: 0, label: '全部', type: 'all' });
setStatus({ key: 0, label: 'All', labelCht: "全部", type: 'all' });
reset();
}

@@ -125,31 +126,45 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => {

<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}>
<Autocomplete
multiple
{...register("status")}
disablePortal
id="status"
filterOptions={(options)=>options}
// filterOptions={(options)=>options}
options={
localStorage.getItem('userData').creditor?
ComboData.publicNoticeStatic_Creditor:
ComboData.publicNoticeStatic
}
values={status}
inputValue={status?.labelCht}
// inputValue={status?.labelCht}
getOptionLabel={(option)=>option.labelCht}
onChange={(event, newValue) => {
if (newValue !== null) {
setStatus(newValue);
console.log(newValue)
const findAllIndex = newValue.findIndex((ele) => {
return ele.type === "all"
})

if (findAllIndex > -1) {
setStatus([newValue[findAllIndex]]);
setSelectedLabelsString('all')
} else {
const selectedLabels = newValue.map(option => option.type);
const selectedLabelsString = `${selectedLabels.join(',')}`;
setStatus(newValue);
console.log(newValue)
setSelectedLabelsString(selectedLabelsString);
}
console.log(selectedLabelsString)
console.log(status)
}}
renderInput={(params) => (
<TextField {...params}
label="狀態"
/>
)}
InputLabelProps={{
shrink: true
}}
// InputLabelProps={{
// shrink: true
// }}
/>
</Grid>
{/*<Grid item xs={9} s={6} md={5} lg={3} sx={{ml:3, mr:3, mb:3}}>*/}


+ 4
- 0
src/pages/PublicNotice/ListPanel/SearchPublicNoticeTable.js 查看文件

@@ -90,6 +90,9 @@ export default function SearchPublicNoticeTable({ recordList }) {
}
];

function handleRowDoubleClick(params) {
navigate('/publicNotice/'+ params.id);
}

return (
<div style={{ height: 400, width: '100%' }}>
@@ -102,6 +105,7 @@ export default function SearchPublicNoticeTable({ recordList }) {
paginationModel: { page: 0, pageSize: 5 },
},
}}
onRowDoubleClick={handleRowDoubleClick}
/>
</div>
);


+ 6
- 0
src/pages/PublicNotice/Search_GLD/DataGrid.js 查看文件

@@ -107,6 +107,11 @@ export default function SearchPublicNoticeTable({ recordList }) {
return Array(+(zero > 0 && zero)).join("0") + num;
}

function handleRowDoubleClick(params) {
// handleEditClick(params)
navigate('/application/'+ params.id);
}

return (
<div style={{ height: 400, width: '100%' }}>

@@ -118,6 +123,7 @@ export default function SearchPublicNoticeTable({ recordList }) {
paginationModel: { page: 0, pageSize: 5 },
},
}}
onRowDoubleClick={handleRowDoubleClick}
/>
</div>
);


+ 37
- 6
src/pages/PublicNotice/Search_GLD/SearchForm.js 查看文件

@@ -7,7 +7,7 @@ import {
} from '@mui/material';
import MainCard from "components/MainCard";
import { useForm } from "react-hook-form";
import * as React from "react";
import * as React from "react";
import * as ComboData from "utils/ComboData";
import * as DateUtils from "utils/DateUtils";
// ==============================|| DASHBOARD - DEFAULT ||============================== //
@@ -17,11 +17,13 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu
}) => {

const [type, setType] = React.useState([]);
const [status, setStatus] = React.useState({ key: 0, label: 'All', type: 'all' });
// const [status, setStatus] = React.useState({ key: 0, label: 'All', type: 'all' });
const [orgSelected, setOrgSelected] = React.useState({});
const [orgCombo, setOrgCombo] = React.useState();
const [issueSelected, setIssueSelected] = React.useState({});
const [issueCombo, setIssueCombo] = React.useState([]);
const [selectedStatus, setSelectedStatus] = React.useState([]);
const [selectedLabelsString, setSelectedLabelsString] = React.useState('');

const [minDate, setMinDate] = React.useState(searchCriteria.dateFrom);
const [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo);
@@ -29,7 +31,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu

const { reset, register, handleSubmit } = useForm()
const onSubmit = (data) => {
data.status = selectedLabelsString
let typeArray = [];

for (let i = 0; i < type.length; i++) {
@@ -41,7 +43,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu
dateFrom: data.dateFrom,
dateTo: data.dateTo,
contact: data.contact,
status: (status?.type && status?.type != 'all') ? status?.type : "",
status: (data.status === '' || data.status.includes("all")) ? "" : data.status,
orgId: (orgSelected?.key && orgSelected?.key > 0) ? orgSelected?.key : "",
issueId: issueSelected?.id,
groupNo: data.groupNo,
@@ -63,7 +65,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu

function resetForm() {
setType([]);
setStatus({ key: 0, label: 'All', type: 'all' });
// setStatus({ key: 0, label: 'All', type: 'all' });
setOrgSelected({});
setIssueSelected({});
reset();
@@ -162,7 +164,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu
</Grid>

<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}>
<Autocomplete
{/* <Autocomplete
{...register("status")}
disablePortal
id="status"
@@ -183,6 +185,35 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu
InputLabelProps={{
shrink: true
}}
/> */}
<Autocomplete
multiple
{...register("status")}
id="status"
options={ComboData.publicNoticeStatic_GLD}
value={selectedStatus}
onChange={(event, newValue) => {
const findAllIndex = newValue.findIndex((ele) => {
return ele.type === "all"
})

if (findAllIndex > -1) {
setSelectedStatus([newValue[findAllIndex]]);
setSelectedLabelsString('all')
} else {
const selectedLabels = newValue.map(option => option.type);
const selectedLabelsString = `${selectedLabels.join(',')}`;
setSelectedStatus(newValue);
setSelectedLabelsString(selectedLabelsString);
}
}}
getOptionLabel={(option) => option.label}
renderInput={(params) => (
<TextField
{...params}
label="Status"
/>
)}
/>
</Grid>



+ 5
- 3
src/pages/User/DetailPage/index.js 查看文件

@@ -20,6 +20,8 @@ const UserAuthorityCard = Loadable(lazy(() => import('./UserAuthorityCard')));
import {
GeneralConfirmWindow,
getDeletedRecordWithRefList,
notifyDeleteSuccess,
notifySaveSuccess,
} from "../../../utils/CommonFunction";

// ==============================|| DASHBOARD - DEFAULT ||============================== //
@@ -71,7 +73,7 @@ const UserMaintainPage = () => {
)
.then((response) => {
if (response.status === 204) {
// notifyDeleteSuccess();
notifyDeleteSuccess();
setIsWindowOpen(false);
navigate('/userSearchview');
}
@@ -148,7 +150,7 @@ const UserMaintainPage = () => {
},
).then((response) => {
if (response.status === 204) {
// notifySaveSuccess();
notifySaveSuccess();
navigate('/userSearchview');
}
})
@@ -173,7 +175,7 @@ const UserMaintainPage = () => {
},
).then((response) => {
if (response.status === 200) {
// notifySaveSuccess();
notifySaveSuccess();
navigate('/userSearchview');
}
})


+ 5
- 0
src/pages/User/DetailsPage_Individual/UserInformationCard_Individual.js 查看文件

@@ -15,6 +15,7 @@ import * as ComboData from "../../../utils/ComboData";
const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent')));
import Loadable from 'components/Loadable';
import { lazy } from 'react';
import { notifyActiveSuccess, notifyLockSuccess, notifySaveSuccess, notifyVerifySuccess } from 'utils/CommonFunction';
// ==============================|| DASHBOARD - DEFAULT ||============================== //


@@ -80,6 +81,7 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => {
},
},
onSuccess: function () {
notifySaveSuccess();
loadDataFun();
}
});
@@ -106,6 +108,7 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => {
HttpUtils.get({
url: UrlUtils.GET_IND_USER_VERIFY + "/" + formData.id,
onSuccess: function () {
notifyVerifySuccess()
loadDataFun();
}
});
@@ -115,6 +118,7 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => {
HttpUtils.get({
url: UrlUtils.GET_USER_LOCK + "/" + formData.id,
onSuccess: function () {
notifyLockSuccess()
loadDataFun();
}
});
@@ -124,6 +128,7 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => {
HttpUtils.get({
url: UrlUtils.GET_USER_UNLOCK + "/" + formData.id,
onSuccess: function () {
notifyActiveSuccess()
loadDataFun();
}
});


+ 5
- 0
src/pages/User/DetailsPage_Organization/UserInformationCard_Organization.js 查看文件

@@ -16,6 +16,7 @@ import * as yup from 'yup';
const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent')));
import Loadable from 'components/Loadable';
import { lazy } from 'react';
import { notifyActiveSuccess, notifyLockSuccess, notifySaveSuccess, notifyVerifySuccess } from 'utils/CommonFunction';
// ==============================|| DASHBOARD - DEFAULT ||============================== //


@@ -86,6 +87,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) =>

},
onSuccess: function () {
notifySaveSuccess()
loadDataFun();
}
});
@@ -119,6 +121,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) =>
HttpUtils.get({
url: UrlUtils.GET_IND_USER_VERIFY + "/" + userData.id,
onSuccess: function () {
notifyVerifySuccess()
loadDataFun();
}
});
@@ -136,6 +139,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) =>
HttpUtils.get({
url: UrlUtils.GET_USER_LOCK + "/" + userData.id,
onSuccess: function () {
notifyLockSuccess()
loadDataFun();
}
});
@@ -152,6 +156,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) =>
HttpUtils.get({
url: UrlUtils.GET_USER_UNLOCK + "/" + userData.id,
onSuccess: function () {
notifyActiveSuccess()
loadDataFun();
}
});


+ 4
- 4
src/pages/User/DetailsPage_Organization/index.js 查看文件

@@ -31,9 +31,9 @@ const UserMaintainPage_Organization = () => {
loadData();
},[]);

const reloadPage=()=>{
window.location.reload(false);
}
// const reloadPage=()=>{
// window.location.reload(false);
// }

const loadData = ()=>{
setLoding(true);
@@ -107,7 +107,7 @@ const UserMaintainPage_Organization = () => {
<Grid item xs={12} md={12} lg={12}>
<UserInformationCard
userData={userData}
loadDataFun={reloadPage}
loadDataFun={loadData}
orgData={orgData}
/>
</Grid>


+ 6
- 1
src/pages/User/SearchPage/UserTable.js 查看文件

@@ -121,6 +121,10 @@ export default function UserTable({recordList,setChangeLocked}) {
},
];

function handleRowDoubleClick(params) {
navigate('/user/'+ params.id);
}

return (
<div style={{height: "fit-content", width: '100%'}}>
<FiDataGrid
@@ -130,7 +134,8 @@ export default function UserTable({recordList,setChangeLocked}) {
pagination: {
paginationModel: {page: 0, pageSize: 5},
},
}}
}}
onRowDoubleClick={handleRowDoubleClick}
/>
</div>
);


+ 5
- 1
src/pages/User/SearchPage_Individual/UserTable_Individual.js 查看文件

@@ -129,6 +129,10 @@ export default function UserTable_Individual({ recordList }) {
},
];

function handleRowDoubleClick(params) {
navigate('/indUser/' + params.id);
}

return (
<div style={{ height: "fit-content", width: '100%' }}>
<FiDataGrid
@@ -139,7 +143,7 @@ export default function UserTable_Individual({ recordList }) {
paginationModel: { page: 0, pageSize: 5 },
},
}}
onRowDoubleClick={handleRowDoubleClick}
/>
</div>
);


+ 5
- 0
src/pages/User/SearchPage_Organization/UserTable_Organization.js 查看文件

@@ -126,6 +126,10 @@ export default function UserTable_Organization({recordList}) {
},
];

function handleRowDoubleClick(params) {
navigate('/orgUser/'+ params.id);
}

return (
<div style={{height: "fit-content", width: '100%'}}>
<FiDataGrid
@@ -136,6 +140,7 @@ export default function UserTable_Organization({recordList}) {
paginationModel: {page: 0, pageSize: 5},
},
}}
onRowDoubleClick={handleRowDoubleClick}
/>
</div>
);


+ 1
- 1
src/pages/authentication/auth-forms/AuthLogin.js 查看文件

@@ -34,6 +34,7 @@ import { EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons';
import axios from "axios";
import {useDispatch} from "react-redux";
import {handleLogin} from "auth/index";
import { notifyActionSuccess } from 'utils/CommonFunction';
// ============================|| FIREBASE - LOGIN ||============================ //

const AuthLogin = () => {
@@ -83,7 +84,6 @@ const AuthLogin = () => {

const data = {...userData, accessToken: response.data.accessToken, refreshToken: response.data.refreshToken}
dispatch(handleLogin(data))

navigate('/dashboard');
//history.push(getHomeRouteForLoggedInUser("user"))



+ 20
- 7
src/pages/authentication/auth-forms/BusCustomFormWizard.js 查看文件

@@ -136,8 +136,8 @@ const BusCustomFormWizard = (props) => {
data.password !==""&&
data.confirmPassword !==""&&
data.password == data.confirmPassword&&
(data.enCompanyName !=="" || selectedAddress5 ==="內地")&&
data.chCompanyName !==""&&
// (data.enCompanyName !=="" || selectedAddress5 ==="內地")&&
(data.chCompanyName !=="" || data.enCompanyName !== "")&&
data.enName !==""&&
data.chName !==""&&
data.address1 !==""&&
@@ -400,6 +400,7 @@ const BusCustomFormWizard = (props) => {
return true;
}
}

const formik = useFormik({
initialValues:({
@@ -423,6 +424,7 @@ const BusCustomFormWizard = (props) => {
emailConfirm:'',
captchaField:''
}),
validationSchema:yup.object().shape({
username: yup.string().min(6,'用戶名稱最少6位').required('請輸入用戶名稱')
.matches(/^[aA-zZ0-9\s]+$/, "用戶名稱不包含特殊字符")
@@ -435,8 +437,14 @@ const BusCustomFormWizard = (props) => {
.matches(/^(?=.*[!@#%&])/, '請包括最少1個特殊字符'),
confirmPassword: yup.string().min(8,'請最少輸入8位密碼').required('請確認密碼').oneOf([yup.ref('password'), null], '請輸入相同密碼'),
enName: yup.string().max(255).required('請輸入英文姓名'),
enCompanyName: yup.string().max(255).required('請輸入英文名稱'),
chCompanyName: yup.string().max(255).required('請輸入中文名稱'),
enCompanyName: yup.string().matches(/^[^$^*()]+$/, 'No special characters $/^/*/(/)').when('chCompanyName', {
is: (chCompanyName) => !chCompanyName || chCompanyName.length === 0,
then: yup.string().required('Please enter either English or Chinese name'),
}),
chCompanyName: yup.string().matches(/^[^$^*()]+$/, '不包含特殊字符 $/^/*/(/)').when('enCompanyName', {
is: (enCompanyName) => !enCompanyName || enCompanyName.length === 0,
then: yup.string().required('請輸入英文或中文名稱'),
}),
chName: yup.string().max(255).required('請輸入中文姓名'),
address1: yup.string().max(255).required('請輸入第一行地址'),
address2: yup.string().max(255).required('請輸入第二行地址'),
@@ -450,7 +458,7 @@ const BusCustomFormWizard = (props) => {
brExpiryDate: yup.date().min(new Date().toISOString().split("T")[0], '請輸入商業登記證有效日期').max("2099-12-31", '請輸入商業登記證有效日期').required('請輸入商業登記證有效日期'),
brNo: yup.string().min(8,'請輸入商業登記證號碼').required('請輸入商業登記證號碼'),
captchaField: yup.string().required('請輸入驗證').oneOf([captcha], '請輸入有效驗證'),
})
}, ['enCompanyName', 'chCompanyName']),
});

@@ -650,10 +658,16 @@ const BusCustomFormWizard = (props) => {
</Stack>
</Grid>
<Grid item xs={12} md={12}>
<Typography fontSize="0.75rem">
<br/>
•請輸入機構/公司英文名稱或中文名稱<br/>
•Please enter the English/Chinese name of the organisation/company
</Typography>
</Grid>
<Grid item xs={12} md={6}>
<Stack spacing={1}>
<InputLabel htmlFor="enCompanyName-signup">機構/公司英文名稱
{selectedAddress5 === "內地" ? "" : <span style={{color: '#f10000'}}>*</span>}
</InputLabel>
<OutlinedInput
id="enCompanyName-login"
@@ -683,7 +697,6 @@ const BusCustomFormWizard = (props) => {
<Grid item xs={12} md={6}>
<Stack spacing={1}>
<InputLabel htmlFor="chCompanyName-signup">機構/公司中文名稱
<span style={{color: '#f10000'}}>*</span>
</InputLabel>
<OutlinedInput
fullWidth


+ 4
- 3
src/pages/pnspsUserGroupDetailPage/index.js 查看文件

@@ -12,8 +12,9 @@ import {
GeneralConfirmWindow,
getDeletedRecordWithRefList,
getIdList,
notifyDeleteSuccess,
// notifyDeleteSuccess,
// notifySaveSuccess
notifySaveSuccess
} from "../../utils/CommonFunction";
import {POST_AND_UPDATE_USER_GROUP,GET_GROUP_LIST_PATH } from "../../utils/ApiPathConst";

@@ -58,7 +59,7 @@ const UserMaintainPage = () => {
)
.then((response) => {
if (response.status === 204) {
// notifyDeleteSuccess();
notifyDeleteSuccess()
setIsWindowOpen(false);
navigate('/usergroupSearchview');
}
@@ -142,8 +143,8 @@ const UserMaintainPage = () => {
)
.then((response) => {
if (response.status === 200) {
// notifySaveSuccess();
navigate('/usergroupSearchview');
notifySaveSuccess()
}
})
.catch(error => {


+ 5
- 0
src/pages/pnspsUserGroupSearchPage/UserGroupTable.js 查看文件

@@ -54,6 +54,10 @@ export default function UserGroupTable({recordList}) {
},
];

function handleRowDoubleClick(params) {
navigate('/userGroup/'+ params.id);
}

return (
<div style={{height: "fit-content", width: '100%'}}>
<FiDataGrid
@@ -65,6 +69,7 @@ export default function UserGroupTable({recordList}) {
},
}}
pageSizeOptions={[10, 15, 20]}
onRowDoubleClick={handleRowDoubleClick}
/>
</div>
);


+ 92
- 12
src/utils/CommonFunction.js 查看文件

@@ -6,6 +6,7 @@ import DialogActions from "@mui/material/DialogActions";
import {Button} from "@mui/material";
import Dialog from "@mui/material/Dialog";
import * as React from "react";
import { toast } from "react-toastify";

export function getDeletedRecordWithRefList(referenceList, updatedList){
return referenceList.filter(x => !updatedList.includes(x)) ;
@@ -48,18 +49,97 @@ export function getDateString(queryDateArray) {
)
}

// export const notifySaveSuccess = () => toast.success('Save success!', {
// position: "bottom-right",
// autoClose: 5000,
// hideProgressBar: false,
// closeOnClick: true,
// pauseOnHover: true,
// draggable: true,
// progress: undefined,
// theme: "light",
// });
export const notifySaveSuccess = () => {
const userType = JSON.parse(localStorage.getItem("userData")).type
toast.success(userType === "GLD" ? 'Save success!' : "儲存成功!", {
position: "bottom-right",
autoClose: 5000,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined,
theme: "light",
})};

export const notifyDeleteSuccess = () => toast.success('Delete Success!', {
export const notifyCreateSuccess = () => {
const userType = JSON.parse(localStorage.getItem("userData")).type
toast.success(userType === "GLD" ? 'Create success!' : "創建成功!", {
position: "bottom-right",
autoClose: 5000,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined,
theme: "light",
})};

export const notifyVerifySuccess = () => {
const userType = JSON.parse(localStorage.getItem("userData")).type
toast.success(userType === "GLD" ? 'Verify success!' : "驗證成功!", {
position: "bottom-right",
autoClose: 5000,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined,
theme: "light",
})};

export const notifyDeleteSuccess = () => {
const userType = JSON.parse(localStorage.getItem("userData")).type
toast.success(userType === "GLD" ? 'Delete success!' : "刪除成功!", {
position: "bottom-right",
autoClose: 5000,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined,
theme: "light",
})};

export const notifyLockSuccess = () => {
toast.success('Lock success!', {
position: "bottom-right",
autoClose: 5000,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined,
theme: "light",
})};

export const notifyActiveSuccess = () => {
toast.success('Active success!', {
position: "bottom-right",
autoClose: 5000,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined,
theme: "light",
})};

export const notifyDownloadSuccess = () => {
const userType = JSON.parse(localStorage.getItem("userData")).type
toast.success(userType === "GLD" ? 'Download success!' : "下載成功!", {
position: "bottom-right",
autoClose: 5000,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined,
theme: "light",
})};

export const notifyActionSuccess = (actionMsg) => {
toast.success(`${actionMsg}`, {
position: "bottom-right",
autoClose: 5000,
hideProgressBar: false,
@@ -68,7 +148,7 @@ export const notifyDeleteSuccess = () => toast.success('Delete Success!', {
draggable: true,
progress: undefined,
theme: "light",
});
})};

export function prettyJson(json){
console.log(json);


Loading…
取消
儲存