@@ -115,7 +115,7 @@ function Header(props) { | |||||
<Link className="dashboard" to='/dashboard'>主頁</Link> | <Link className="dashboard" to='/dashboard'>主頁</Link> | ||||
</li> | </li> | ||||
<li> | <li> | ||||
<Link className="myDocumet" to='/dashboard'>我的公共啟示</Link> | |||||
<Link className="myDocumet" to='/dashboard'>我的公共啟事</Link> | |||||
</li> | </li> | ||||
<li> | <li> | ||||
<Link className="documentRecord" to='/dashboard'>校對記錄</Link> | <Link className="documentRecord" to='/dashboard'>校對記錄</Link> | ||||
@@ -20,13 +20,7 @@ | |||||
import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
import { lazy } from 'react'; | import { lazy } from 'react'; | ||||
const CustomFormWizard = Loadable(lazy(() => import('./auth-forms/CustomFormWizard'))); | const CustomFormWizard = Loadable(lazy(() => import('./auth-forms/CustomFormWizard'))); | ||||
const AuthWrapper = Loadable(lazy(() => import('./AuthWrapperCustom'))); | |||||
// const CustomFormWizard = Loadable(lazy(() => import('./auth-forms/CustomFormWizard'))); | |||||
// const AuthWrapper = Loadable(lazy(() => import('./AuthWrapperCustom'))); | |||||
//import CustomFormWizard from './auth-forms/CustomFormWizard'; | |||||
//import AuthWrapper from './AuthWrapperCustom'; | |||||
const AuthWrapper = Loadable(lazy(() => import('./AuthWrapperCustom'))); | |||||
// ================================|| REGISTER ||================================ // | // ================================|| REGISTER ||================================ // | ||||
const stepStyle = { | const stepStyle = { | ||||
width:"80%", | width:"80%", | ||||
@@ -81,6 +81,7 @@ const BusCustomFormWizard = (props) => { | |||||
const [termsAndConAccept, setTermsAndConAccept] = useState(false); | const [termsAndConAccept, setTermsAndConAccept] = useState(false); | ||||
const [termsAndConNotAccept, setTermsAndConNotAccept] = useState(false); | const [termsAndConNotAccept, setTermsAndConNotAccept] = useState(false); | ||||
const [isValid, setisValid] = useState(false); | const [isValid, setisValid] = useState(false); | ||||
const [checkCountry, setCheckCountry] = useState(false); | |||||
const address4ComboList = | const address4ComboList = | ||||
["北區","長洲區","大埔區","大嶼山區","東區","觀塘區","黃大仙區","九龍城區","葵青區","南區","南丫島區", | ["北區","長洲區","大埔區","大嶼山區","東區","觀塘區","黃大仙區","九龍城區","葵青區","南區","南丫島區", | ||||
@@ -301,7 +302,7 @@ const BusCustomFormWizard = (props) => { | |||||
} | } | ||||
function handlePhone(phone) { | function handlePhone(phone) { | ||||
if (phone.length < 8) { | |||||
if (phone.length < 11) { | |||||
return false; | return false; | ||||
} else { | } else { | ||||
return true; | return true; | ||||
@@ -384,10 +385,10 @@ const BusCustomFormWizard = (props) => { | |||||
address3: yup.string().max(255).required('請輸入第三行地址'), | address3: yup.string().max(255).required('請輸入第三行地址'), | ||||
email: yup.string().email('請輸入電郵格式').max(255).required('請輸入電郵'), | email: yup.string().email('請輸入電郵格式').max(255).required('請輸入電郵'), | ||||
emailConfirm: yup.string().email('請輸入電郵格式').max(255).required('請輸入電郵').oneOf([yup.ref('email'), null], '請輸入相同電郵'), | emailConfirm: yup.string().email('請輸入電郵格式').max(255).required('請輸入電郵').oneOf([yup.ref('email'), null], '請輸入相同電郵'), | ||||
phoneCountryCode: yup.string().min(3,'請輸入3位數字').required('請輸入國際區號'), | |||||
faxCountryCode: yup.string().min(3,'請輸入3位數字'), | |||||
phone: yup.string().min(8,'請輸入8位數字').required('請輸入聯絡電話'), | |||||
fax: yup.string().min(8,'請輸入8位數字'), | |||||
phoneCountryCode: yup.string().min(2,'請輸入最少2位數字').required('請輸入國際區號'), | |||||
faxCountryCode: yup.string().min(2,'請輸入最少2位數字'), | |||||
phone: yup.string().min(8,'請輸入最少8位數字').required('請輸入聯絡電話'), | |||||
fax: yup.string().min(8,'請輸入最少8位數字'), | |||||
brExpiryDate: yup.string().min(8,'請輸入商業登記證有效日期'), | brExpiryDate: yup.string().min(8,'請輸入商業登記證有效日期'), | ||||
brNo: yup.string().min(8,'請輸入商業登記證號碼'), | brNo: yup.string().min(8,'請輸入商業登記證號碼'), | ||||
}) | }) | ||||
@@ -397,6 +398,8 @@ const BusCustomFormWizard = (props) => { | |||||
const handleReset = (resetForm) => { | const handleReset = (resetForm) => { | ||||
resetForm(); | resetForm(); | ||||
setSelectedAddress4("") | setSelectedAddress4("") | ||||
setFileList([]) | |||||
setFileListData([]) | |||||
}; | }; | ||||
const { values } = formik | const { values } = formik | ||||
@@ -745,6 +748,7 @@ const BusCustomFormWizard = (props) => { | |||||
id="address4-combo" | id="address4-combo" | ||||
value={selectedAddress4 === null ? null : selectedAddress4} | value={selectedAddress4 === null ? null : selectedAddress4} | ||||
options={address4ComboList} | options={address4ComboList} | ||||
disabled={checkCountry} | |||||
onChange={(event, newValue) => { | onChange={(event, newValue) => { | ||||
if (newValue !== null){ | if (newValue !== null){ | ||||
setSelectedAddress4(newValue); | setSelectedAddress4(newValue); | ||||
@@ -762,6 +766,13 @@ const BusCustomFormWizard = (props) => { | |||||
onChange={(event, newValue) => { | onChange={(event, newValue) => { | ||||
if (newValue !== null){ | if (newValue !== null){ | ||||
setSelectedAddress5(newValue); | setSelectedAddress5(newValue); | ||||
if(newValue=='香港'){ | |||||
setCheckCountry(false) | |||||
}else{ | |||||
setCheckCountry(true) | |||||
} | |||||
}else{ | |||||
setCheckCountry(true) | |||||
} | } | ||||
}} | }} | ||||
@@ -939,7 +950,7 @@ const BusCustomFormWizard = (props) => { | |||||
placeholder="聯絡電話" | placeholder="聯絡電話" | ||||
error={Boolean(formik.touched.phone && formik.errors.phone)} | error={Boolean(formik.touched.phone && formik.errors.phone)} | ||||
inputProps={{ | inputProps={{ | ||||
maxLength: 8, | |||||
maxLength: 11, | |||||
onKeyDown: (e) => { | onKeyDown: (e) => { | ||||
if (e.key === 'Enter') { | if (e.key === 'Enter') { | ||||
e.preventDefault(); | e.preventDefault(); | ||||
@@ -86,6 +86,7 @@ const CustomFormWizard = (props) => { | |||||
const [termsAndConAccept, setTermsAndConAccept] = useState(false); | const [termsAndConAccept, setTermsAndConAccept] = useState(false); | ||||
const [termsAndConNotAccept, setTermsAndConNotAccept] = useState(false); | const [termsAndConNotAccept, setTermsAndConNotAccept] = useState(false); | ||||
const [isValid, setisValid] = useState(false); | const [isValid, setisValid] = useState(false); | ||||
const [checkCountry, setCheckCountry] = useState(false); | |||||
const idDocTypeComboList = ComboData.idDocType; | const idDocTypeComboList = ComboData.idDocType; | ||||
const address4ComboList = ComboData.district; | const address4ComboList = ComboData.district; | ||||
@@ -122,8 +123,8 @@ const CustomFormWizard = (props) => { | |||||
handlePassword(data.password)&& | handlePassword(data.password)&& | ||||
handleEmail(data.email)&& | handleEmail(data.email)&& | ||||
handleIdNo(data.idNo,selectedIdDocType.type)&& | handleIdNo(data.idNo,selectedIdDocType.type)&& | ||||
handle8Digi(data.phone)&& | |||||
handle6Digi(data.username) | |||||
handlePhone(data.phone)&& | |||||
handleUsername(data.username) | |||||
) | ) | ||||
{ | { | ||||
setisValid(true) | setisValid(true) | ||||
@@ -309,15 +310,15 @@ const CustomFormWizard = (props) => { | |||||
} | } | ||||
} | } | ||||
function handle8Digi(value) { | |||||
if (value.length < 8) { | |||||
function handlePhone(value) { | |||||
if (value.length < 11) { | |||||
return false; | return false; | ||||
} else { | } else { | ||||
return true; | return true; | ||||
} | } | ||||
} | } | ||||
function handle6Digi(value) { | |||||
function handleUsername(value) { | |||||
if (value.length < 6) { | if (value.length < 6) { | ||||
return false; | return false; | ||||
} else { | } else { | ||||
@@ -399,7 +400,7 @@ const CustomFormWizard = (props) => { | |||||
.matches(/^(?=.*[!@#%&])/, '請包括最少1個特殊字符'), | .matches(/^(?=.*[!@#%&])/, '請包括最少1個特殊字符'), | ||||
confirmPassword: yup.string().min(8,'請最少輸入8位密碼').required('請確認密碼').oneOf([yup.ref('password'), null], '請輸入相同密碼'), | confirmPassword: yup.string().min(8,'請最少輸入8位密碼').required('請確認密碼').oneOf([yup.ref('password'), null], '請輸入相同密碼'), | ||||
enName: yup.string().max(255).required('請輸入英文姓名'), | enName: yup.string().max(255).required('請輸入英文姓名'), | ||||
chName: yup.string().max(255).required('請輸入中文姓名'), | |||||
chName: yup.string().max(6).required('請輸入中文姓名'), | |||||
address1: yup.string().max(255).required('請輸入第一行地址'), | address1: yup.string().max(255).required('請輸入第一行地址'), | ||||
address2: yup.string().max(255).required('請輸入第二行地址'), | address2: yup.string().max(255).required('請輸入第二行地址'), | ||||
address3: yup.string().max(255).required('請輸入第三行地址'), | address3: yup.string().max(255).required('請輸入第三行地址'), | ||||
@@ -408,9 +409,9 @@ const CustomFormWizard = (props) => { | |||||
idNo: yup.string().min(7,"請輸入證件號碼").required('請輸入證件號碼'), | idNo: yup.string().min(7,"請輸入證件號碼").required('請輸入證件號碼'), | ||||
checkDigit:yup.string().max(1).required('請輸入括號內的數字或字母'), | checkDigit:yup.string().max(1).required('請輸入括號內的數字或字母'), | ||||
idDocType: yup.string().max(255).required('請輸入證件類別'), | idDocType: yup.string().max(255).required('請輸入證件類別'), | ||||
phoneCountryCode: yup.string().min(3,'請輸入3位數字').required('請輸入國際區號'), | |||||
phoneCountryCode: yup.string().min(2,'請輸入最少2位數字').required('請輸入國際區號'), | |||||
// faxCountryCode: yup.string().min(3,'請輸入3位數字'), | // faxCountryCode: yup.string().min(3,'請輸入3位數字'), | ||||
phone: yup.string().min(8,'請輸入8位數字').required('請輸入聯絡電話'), | |||||
phone: yup.string().min(8,'請輸入最少8位數字').required('請輸入聯絡電話'), | |||||
// fax: yup.string().min(8,'請輸入8位數字'), | // fax: yup.string().min(8,'請輸入8位數字'), | ||||
}), | }), | ||||
}); | }); | ||||
@@ -420,7 +421,8 @@ const CustomFormWizard = (props) => { | |||||
setSelectedAddress4("") | setSelectedAddress4("") | ||||
setSelectedIdDocType({}) | setSelectedIdDocType({}) | ||||
setSelectedIdDocInputType(""); | setSelectedIdDocInputType(""); | ||||
setFileList([]) | |||||
setFileListData([]) | |||||
// setSelectedIdDocLabel("") | // setSelectedIdDocLabel("") | ||||
}; | }; | ||||
@@ -719,6 +721,7 @@ const CustomFormWizard = (props) => { | |||||
error={Boolean(formik.touched.idNo && formik.errors.idNo)} | error={Boolean(formik.touched.idNo && formik.errors.idNo)} | ||||
onBlur={formik.handleBlur} | onBlur={formik.handleBlur} | ||||
inputProps={{ | inputProps={{ | ||||
maxLength: 18, | |||||
onKeyDown: (e) => { | onKeyDown: (e) => { | ||||
if (e.key === 'Enter') { | if (e.key === 'Enter') { | ||||
e.preventDefault(); | e.preventDefault(); | ||||
@@ -779,6 +782,7 @@ const CustomFormWizard = (props) => { | |||||
onChange={formik.handleChange} | onChange={formik.handleChange} | ||||
placeholder="與你的身份證明文件相同" | placeholder="與你的身份證明文件相同" | ||||
inputProps={{ | inputProps={{ | ||||
maxLength: 6, | |||||
onKeyDown: (e) => { | onKeyDown: (e) => { | ||||
if (e.key === 'Enter') { | if (e.key === 'Enter') { | ||||
e.preventDefault(); | e.preventDefault(); | ||||
@@ -852,6 +856,7 @@ const CustomFormWizard = (props) => { | |||||
id="address4-combo" | id="address4-combo" | ||||
value={selectedAddress4} | value={selectedAddress4} | ||||
options={address4ComboList} | options={address4ComboList} | ||||
disabled={checkCountry} | |||||
onChange={(event, newValue) => { | onChange={(event, newValue) => { | ||||
setSelectedAddress4(newValue); | setSelectedAddress4(newValue); | ||||
}} | }} | ||||
@@ -865,8 +870,16 @@ const CustomFormWizard = (props) => { | |||||
value={selectedAddress5} | value={selectedAddress5} | ||||
options={address5ComboList} | options={address5ComboList} | ||||
onChange={(event, newValue) => { | onChange={(event, newValue) => { | ||||
setSelectedAddress5(newValue); | |||||
// if() | |||||
if (newValue !== null){ | |||||
setSelectedAddress5(newValue); | |||||
if(newValue=='香港'){ | |||||
setCheckCountry(false) | |||||
}else{ | |||||
setCheckCountry(true) | |||||
} | |||||
}else{ | |||||
setCheckCountry(true) | |||||
} | |||||
}} | }} | ||||
sx={{"& .MuiInputBase-root": { height: "41px" },"#address5-combo":{padding: "0px 0px 0px 0px"}, "& .MuiAutocomplete-endAdornment": { top: "auto" },}} | sx={{"& .MuiInputBase-root": { height: "41px" },"#address5-combo":{padding: "0px 0px 0px 0px"}, "& .MuiAutocomplete-endAdornment": { top: "auto" },}} | ||||
@@ -1014,7 +1027,7 @@ const CustomFormWizard = (props) => { | |||||
error={Boolean(formik.touched.phone && formik.errors.phone)} | error={Boolean(formik.touched.phone && formik.errors.phone)} | ||||
onBlur={formik.handleBlur} | onBlur={formik.handleBlur} | ||||
inputProps={{ | inputProps={{ | ||||
maxLength: 8, | |||||
maxLength: 11, | |||||
onKeyDown: (e) => { | onKeyDown: (e) => { | ||||
if (e.key === 'Enter') { | if (e.key === 'Enter') { | ||||
e.preventDefault(); | e.preventDefault(); | ||||
@@ -69,14 +69,14 @@ export default function UserTable({recordList}) { | |||||
headerName: 'Email', | headerName: 'Email', | ||||
flex: 1, | flex: 1, | ||||
}, | }, | ||||
{ | |||||
id: 'subDivisionId', | |||||
field: 'subDivisionId', | |||||
//type: 'date', | |||||
//sortable: false, | |||||
headerName: 'Sub-Division', | |||||
flex: 1, | |||||
}, | |||||
// { | |||||
// id: 'subDivisionId', | |||||
// field: 'subDivisionId', | |||||
// //type: 'date', | |||||
// //sortable: false, | |||||
// headerName: 'Sub-Division', | |||||
// flex: 1, | |||||
// }, | |||||
// { | // { | ||||
// id: 'subDivisionId', | // id: 'subDivisionId', | ||||
@@ -6,7 +6,9 @@ import { | |||||
Typography, | Typography, | ||||
Stack | Stack | ||||
} from '@mui/material'; | } from '@mui/material'; | ||||
import { | |||||
isORGLoggedIn, | |||||
} from "utils/Utils"; | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
@@ -25,7 +27,7 @@ const DashboardDefault = () => { | |||||
<Grid item xs={12} height='60px'> | <Grid item xs={12} height='60px'> | ||||
<Stack direction="row" height='100%' justifyContent="flex-start" alignItems="center"> | <Stack direction="row" height='100%' justifyContent="flex-start" alignItems="center"> | ||||
{/* <Typography variant="h5">我的公共啟事</Typography> */} | {/* <Typography variant="h5">我的公共啟事</Typography> */} | ||||
<Typography ml={10} color='#FFF' variant="h4">{userData.fullchName}, 午安! 請選擇所需服務。</Typography> | |||||
<Typography ml={10} color='#FFF' variant="h4">{isORGLoggedIn() ?userData.fullenName:userData.fullchName}, 午安! 請選擇所需服務。</Typography> | |||||
</Stack> | </Stack> | ||||
</Grid> | </Grid> | ||||
</div> | </div> | ||||