瀏覽代碼

Update

master
cyril.tsui 1 年之前
父節點
當前提交
0e835588b9
共有 13 個檔案被更改,包括 143 行新增120 行删除
  1. +2
    -2
      src/layout/MainLayout/Header/index.js
  2. +1
    -1
      src/pages/OrganizationDetailPage/OrganizationCard.js
  3. +1
    -1
      src/pages/OrganizationDetailPage/index.js
  4. +1
    -1
      src/pages/OrganizationDetailPage_FromUser/index.js
  5. +1
    -1
      src/pages/OrganizationSearchPage/index.js
  6. +1
    -1
      src/pages/Proof/Search_GLD/SearchForm.js
  7. +2
    -2
      src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js
  8. +15
    -15
      src/pages/PublicNotice/ApplyForm/index.js
  9. +1
    -1
      src/pages/PublicNotice/Search_GLD/SearchForm.js
  10. +5
    -5
      src/pages/User/DetailsPage_Organization/UserInformationCard_Organization.js
  11. +1
    -1
      src/pages/User/DetailsPage_Organization/index.js
  12. +1
    -1
      src/pages/User/SearchPage_Organization/index.js
  13. +111
    -88
      src/utils/CommonFunction.js

+ 2
- 2
src/layout/MainLayout/Header/index.js 查看文件

@@ -95,10 +95,10 @@ function Header(props) {
<Link className="indUser" to='/indUser'><Typography variant={"headerTitle1"} sx={{ ml: 2 }}>Users (Individual)</Typography></Link> <Link className="indUser" to='/indUser'><Typography variant={"headerTitle1"} sx={{ ml: 2 }}>Users (Individual)</Typography></Link>
</li> </li>
<li> <li>
<Link className="orgUser" to='/orgUser'><Typography variant={"headerTitle1"} sx={{ ml: 2 }}>Users (Organization)</Typography></Link>
<Link className="orgUser" to='/orgUser'><Typography variant={"headerTitle1"} sx={{ ml: 2 }}>Users (Organisation)</Typography></Link>
</li> </li>
<li> <li>
<Link className="org" to='/org'><Typography variant={"headerTitle1"} sx={{ ml: 2 }}>Organization</Typography></Link>
<Link className="org" to='/org'><Typography variant={"headerTitle1"} sx={{ ml: 2 }}>Organisation</Typography></Link>
</li> </li>
<li> <li>
<Link className="usergroupSearchview" to='/usergroupSearchview'><Typography variant={"headerTitle1"} sx={{ ml: 2 }}>User Group</Typography></Link> <Link className="usergroupSearchview" to='/usergroupSearchview'><Typography variant={"headerTitle1"} sx={{ ml: 2 }}>User Group</Typography></Link>


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

@@ -201,7 +201,7 @@ const OrganizationCard = ({ userData, loadDataFun, id }) => {
<Grid container spacing={1}> <Grid container spacing={1}>
<Grid item xs={12}> <Grid item xs={12}>
<Typography variant="h4" sx={{mb: 2, mr: 3, borderBottom: "1px solid black" }}> <Typography variant="h4" sx={{mb: 2, mr: 3, borderBottom: "1px solid black" }}>
Organization Details
Organisation Details
</Typography> </Typography>
</Grid> </Grid>
<Grid item lg={4} > <Grid item lg={4} >


+ 1
- 1
src/pages/OrganizationDetailPage/index.js 查看文件

@@ -77,7 +77,7 @@ const OrganizationDetailPage = () => {
<Grid item xs={12}> <Grid item xs={12}>
<div style={BackgroundHead}> <div style={BackgroundHead}>
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">
<Typography ml={15} color='#FFF' variant="h4">Maintain Organization</Typography>
<Typography ml={15} color='#FFF' variant="h4">Maintain Organisation</Typography>
</Stack> </Stack>
</div> </div>
</Grid> </Grid>


+ 1
- 1
src/pages/OrganizationDetailPage_FromUser/index.js 查看文件

@@ -66,7 +66,7 @@ const OrganizationDetailPage_FromUser = () => {
: :
<Grid container rowSpacing={4.5} columnSpacing={2.75}> <Grid container rowSpacing={4.5} columnSpacing={2.75}>
<Grid item xs={12} sx={{mb: -2.25}}> <Grid item xs={12} sx={{mb: -2.25}}>
<Typography variant="h5">Organization (Create From User)</Typography>
<Typography variant="h5">Organisation (Create From User)</Typography>
</Grid> </Grid>
{/*col 1*/} {/*col 1*/}
<Grid item xs={12} > <Grid item xs={12} >


+ 1
- 1
src/pages/OrganizationSearchPage/index.js 查看文件

@@ -70,7 +70,7 @@ const OrganizationSearchPage = () => {
<Grid item xs={12}> <Grid item xs={12}>
<div style={BackgroundHead}> <div style={BackgroundHead}>
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">
<Typography ml={15} color='#FFF' variant="h4">View Organization</Typography>
<Typography ml={15} color='#FFF' variant="h4">View Organisation</Typography>
</Stack> </Stack>
</div> </div>
</Grid> </Grid>


+ 1
- 1
src/pages/Proof/Search_GLD/SearchForm.js 查看文件

@@ -264,7 +264,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss
}} }}
renderInput={(params) => ( renderInput={(params) => (
<TextField {...params} <TextField {...params}
label="Organization"
label="Organisation"
InputLabelProps={{ InputLabelProps={{
shrink: true shrink: true
}} }}


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

@@ -169,7 +169,7 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => {
<Grid container alignItems={"center"}> <Grid container alignItems={"center"}>
<Grid item xs={12} md={3} lg={3} <Grid item xs={12} md={3} lg={3}
sx={{ display: 'flex', alignItems: 'center' }}> sx={{ display: 'flex', alignItems: 'center' }}>
目標期數:
<Typography variant="h5">目標期數:</Typography>
</Grid> </Grid>
<Grid item xs={12} md={6} lg={6}> <Grid item xs={12} md={6} lg={6}>
<RadioGroup <RadioGroup
@@ -192,7 +192,7 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => {
<Grid container direction="row" justifyContent="flex-start" alignItems="center"> <Grid container direction="row" justifyContent="flex-start" alignItems="center">
<Grid item xs={12} md={3} lg={3} <Grid item xs={12} md={3} lg={3}
sx={{ display: 'flex', alignItems: 'center' }}> sx={{ display: 'flex', alignItems: 'center' }}>
稿件檔案 ({"檔案大小應<10MB"}):
<Typography variant="h5">稿件檔案 ({"檔案大小應<10MB"}):</Typography>
</Grid> </Grid>
<Grid item xs={12} md={3} lg={3}> <Grid item xs={12} md={3} lg={3}>
<input <input


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

@@ -7,7 +7,7 @@ import * as FormatUtils from "utils/FormatUtils";


import { import {
Radio, Radio,
FormControlLabel
FormControlLabel
} from '@mui/material'; } from '@mui/material';


import Loadable from 'components/Loadable'; import Loadable from 'components/Loadable';
@@ -19,19 +19,19 @@ const PublicNoticeApplyForm = Loadable(lazy(() => import('./PublicNoticeApplyFor
// ==============================|| DASHBOARD - DEFAULT ||============================== // // ==============================|| DASHBOARD - DEFAULT ||============================== //


const ApplyForm = () => { const ApplyForm = () => {
const [userData, setUserData] = React.useState([]);
const [selections, setSelection] = React.useState([]);
const [userData, setUserData] = React.useState(null);
const [selections, setSelection] = React.useState([]);
const [isLoading, setLoding] = React.useState(true); const [isLoading, setLoding] = React.useState(true);


React.useEffect(()=>{
React.useEffect(() => {
loadUserData(); loadUserData();
},[]);
}, []);


const loadUserData = ()=>{
const loadUserData = () => {
setLoding(true); setLoding(true);
HttpUtils.get({ HttpUtils.get({
url: `${UrlUtils.GET_PUBLIC_NOTICE_getApplyUser}`, url: `${UrlUtils.GET_PUBLIC_NOTICE_getApplyUser}`,
onSuccess: function(response){
onSuccess: function (response) {
response["tel_countryCode"] = response?.contactTelNo?.countryCode; response["tel_countryCode"] = response?.contactTelNo?.countryCode;
response["phoneNumber"] = response?.contactTelNo?.phoneNumber; response["phoneNumber"] = response?.contactTelNo?.phoneNumber;
response["fax_countryCode"] = response?.contactFaxNo?.countryCode; response["fax_countryCode"] = response?.contactFaxNo?.countryCode;
@@ -45,26 +45,26 @@ const ApplyForm = () => {
selection.push(<FormControlLabel value={data.id} control={<Radio />} label={label} />); selection.push(<FormControlLabel value={data.id} control={<Radio />} label={label} />);
} }
setSelection(selection); setSelection(selection);
console.log(response.issueId)
setUserData(response); setUserData(response);
} }
}); });
}; };


function getIssueLabel(data){
return data.year
+" Vol. "+FormatUtils.zeroPad(data.volume,3)
+", No. "+FormatUtils.zeroPad(data.issueNo,2)
+", "+DateUtils.dateFormat(data.issueDate, "D MMM YYYY (ddd)");
function getIssueLabel(data) {
return data.year
+ " Vol. " + FormatUtils.zeroPad(data.volume, 3)
+ ", No. " + FormatUtils.zeroPad(data.issueNo, 2)
+ ", " + DateUtils.dateFormat(data.issueDate, "D MMM YYYY (ddd)");
} }


React.useEffect(() => { React.useEffect(() => {
setLoding(false);
if (userData !== null) setLoding(false);
}, [userData]); }, [userData]);


return ( return (
isLoading ? isLoading ?
<LoadingComponent/>
<LoadingComponent />
: :
<PublicNoticeApplyForm <PublicNoticeApplyForm
loadedData={userData} loadedData={userData}


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

@@ -236,7 +236,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss
}} }}
renderInput={(params) => ( renderInput={(params) => (
<TextField {...params} <TextField {...params}
label="Organization"
label="Organisation"
InputLabelProps={{ InputLabelProps={{
shrink: true shrink: true
}} }}


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

@@ -126,7 +126,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) =>
} }
}); });
} else { } else {
setWarningText("Please select Organization before active this account.")
setWarningText("Please select Organisation before active this account.")
setIsWarningPopUp(true); setIsWarningPopUp(true);
} }


@@ -235,7 +235,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) =>
{/*end top button*/} {/*end top button*/}
<div style={{ paddingLeft: 24, paddingRight: 24 }}> <div style={{ paddingLeft: 24, paddingRight: 24 }}>
<Typography variant="h4" sx={{ mt: 3, mb: 2, mr: 3, borderBottom: "1px solid black" }}> <Typography variant="h4" sx={{ mt: 3, mb: 2, mr: 3, borderBottom: "1px solid black" }}>
Organization User Details
Organisation User Details
</Typography> </Typography>
<Grid container spacing={1}> <Grid container spacing={1}>
<Grid item lg={4}> <Grid item lg={4}>
@@ -297,7 +297,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) =>


<Grid item lg={4}> <Grid item lg={4}>
{FieldUtils.getComboField({ {FieldUtils.getComboField({
label: "Organization:",
label: "Organisation:",
valueName: "orgId", valueName: "orgId",
disabled: (!editMode), disabled: (!editMode),
dataList: orgData, dataList: orgData,
@@ -466,7 +466,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) =>
<Button variant="contained" <Button variant="contained"
onClick={createOrgClick} onClick={createOrgClick}
> >
<Typography variant="h5">Create Organization</Typography>
<Typography variant="h5">Create Organisation</Typography>
</Button> </Button>
</Grid> </Grid>
: null : null
@@ -475,7 +475,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) =>
</Grid> </Grid>
<Grid item lg={12} > <Grid item lg={12} >
<Typography variant="h4" sx={{ mt: 3, mb: 2, mr: 3, borderBottom: "1px solid black" }}> <Typography variant="h4" sx={{ mt: 3, mb: 2, mr: 3, borderBottom: "1px solid black" }}>
Organization
Organisation
</Typography> </Typography>
</Grid> </Grid>
<Grid item lg={4}> <Grid item lg={4}>


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

@@ -133,7 +133,7 @@ const UserMaintainPage_Organization = () => {
<Grid item xs={12}> <Grid item xs={12}>
<div style={BackgroundHead}> <div style={BackgroundHead}>
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">
<Typography ml={15} color='#FFF' variant="h4">Maintain Organization User</Typography>
<Typography ml={15} color='#FFF' variant="h4">Maintain Organisation User</Typography>
</Stack> </Stack>
</div> </div>
</Grid> </Grid>


+ 1
- 1
src/pages/User/SearchPage_Organization/index.js 查看文件

@@ -72,7 +72,7 @@ const UserSearchPage_Organization = () => {
<Grid item xs={12}> <Grid item xs={12}>
<div style={BackgroundHead}> <div style={BackgroundHead}>
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">
<Typography ml={15} color='#FFF' variant="h4">View Organization User</Typography>
<Typography ml={15} color='#FFF' variant="h4">View Organisation User</Typography>
</Stack> </Stack>
</div> </div>
</Grid> </Grid>


+ 111
- 88
src/utils/CommonFunction.js 查看文件

@@ -3,27 +3,27 @@ import DialogTitle from "@mui/material/DialogTitle";
import DialogContent from "@mui/material/DialogContent"; import DialogContent from "@mui/material/DialogContent";
import DialogContentText from "@mui/material/DialogContentText"; import DialogContentText from "@mui/material/DialogContentText";
import DialogActions from "@mui/material/DialogActions"; import DialogActions from "@mui/material/DialogActions";
import {Button} from "@mui/material";
import { Button } from "@mui/material";
import Dialog from "@mui/material/Dialog"; import Dialog from "@mui/material/Dialog";
import * as React from "react"; import * as React from "react";
import { toast } from "react-toastify"; import { toast } from "react-toastify";


export function getDeletedRecordWithRefList(referenceList, updatedList){
return referenceList.filter(x => !updatedList.includes(x)) ;
export function getDeletedRecordWithRefList(referenceList, updatedList) {
return referenceList.filter(x => !updatedList.includes(x));
} }


export function getIdList(input){
export function getIdList(input) {
const output = input.map(function (obj) { const output = input.map(function (obj) {
return obj.id; return obj.id;
}); });
return output; return output;
} }


export function getObjectById(list, id){
export function getObjectById(list, id) {
const obj = list.find((element) => { const obj = list.find((element) => {
return element.id === id; return element.id === id;
}); });
return obj === undefined || Object.keys(obj).length <= 0? null : obj
return obj === undefined || Object.keys(obj).length <= 0 ? null : obj
} }


export function removeObjectWithId(arr, id) { export function removeObjectWithId(arr, id) {
@@ -34,7 +34,7 @@ export function removeObjectWithId(arr, id) {
} }


export function getDateString(queryDateArray) { export function getDateString(queryDateArray) {
return(
return (
queryDateArray[0] queryDateArray[0]
+ "-" + + "-" +
queryDateArray[1] queryDateArray[1]
@@ -60,7 +60,8 @@ export const notifySaveSuccess = () => {
draggable: true, draggable: true,
progress: undefined, progress: undefined,
theme: "light", theme: "light",
})};
})
};


export const notifyCreateSuccess = () => { export const notifyCreateSuccess = () => {
const userType = JSON.parse(localStorage.getItem("userData")).type const userType = JSON.parse(localStorage.getItem("userData")).type
@@ -73,108 +74,130 @@ export const notifyCreateSuccess = () => {
draggable: true, draggable: true,
progress: undefined, progress: undefined,
theme: "light", theme: "light",
})};
})
};


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


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


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


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


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


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


export const notifyActionSuccess = (actionMsg) => { export const notifyActionSuccess = (actionMsg) => {
toast.success(`${actionMsg}`, { toast.success(`${actionMsg}`, {
position: "bottom-right",
autoClose: 5000,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined,
theme: "light",
})};
position: "bottom-right",
autoClose: 5000,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined,
theme: "light",
})
};


export const notifyActionError = (actionMsg) => { export const notifyActionError = (actionMsg) => {
toast.error(`${actionMsg}`, { toast.error(`${actionMsg}`, {
position: "bottom-right",
autoClose: 5000,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined,
theme: "light",
})};

export function prettyJson(json){
position: "bottom-right",
autoClose: 5000,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined,
theme: "light",
})
};

export const notifyActionWarning = (actionMsg) => {
toast.warn(`${actionMsg}`, {
position: "bottom-right",
autoClose: 5000,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined,
theme: "light",
})
}

export function prettyJson(json) {
console.log(json); console.log(json);
console.log(JSON.stringify(json, null, 2)); console.log(JSON.stringify(json, null, 2));
return ( return (
@@ -183,11 +206,11 @@ export function prettyJson(json){
} }


export function GeneralConfirmWindow({ export function GeneralConfirmWindow({
isWindowOpen,
title,
content,
onNormalClose,
onConfirmClose}){
isWindowOpen,
title,
content,
onNormalClose,
onConfirmClose }) {
return ( return (
<Dialog <Dialog
open={isWindowOpen} open={isWindowOpen}


Loading…
取消
儲存