From 7236c5df603501440986bc453861f6da08e49fe5 Mon Sep 17 00:00:00 2001 From: "jason.lam" Date: Wed, 3 Jan 2024 09:44:23 +0800 Subject: [PATCH 1/5] update spacing --- src/layout/MainLayout/Header/HeaderContent/LocaleSelector.js | 2 +- src/pages/authentication/auth-forms/BusCustomFormWizard.js | 4 +--- src/pages/authentication/auth-forms/CustomFormWizard.js | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/layout/MainLayout/Header/HeaderContent/LocaleSelector.js b/src/layout/MainLayout/Header/HeaderContent/LocaleSelector.js index 3d276ee..1bb266c 100644 --- a/src/layout/MainLayout/Header/HeaderContent/LocaleSelector.js +++ b/src/layout/MainLayout/Header/HeaderContent/LocaleSelector.js @@ -42,7 +42,7 @@ const LocaleSelector = () => { }; const iconBackColorOpen = 'grey.300'; - const iconBackColor = 'grey.100'; + const iconBackColor = '#ffffff'; return ( diff --git a/src/pages/authentication/auth-forms/BusCustomFormWizard.js b/src/pages/authentication/auth-forms/BusCustomFormWizard.js index 3b91408..bd9355a 100644 --- a/src/pages/authentication/auth-forms/BusCustomFormWizard.js +++ b/src/pages/authentication/auth-forms/BusCustomFormWizard.js @@ -739,9 +739,8 @@ const BusCustomFormWizard = (props) => { )} - + -
•至少8個字元,字元越多越好
•字母和數字的混合
•英文字母大寫與小寫的混合
@@ -763,7 +762,6 @@ const BusCustomFormWizard = (props) => { -
•請輸入機構/公司英文名稱或中文名稱
•Please enter the English/Chinese name of the organisation/company
diff --git a/src/pages/authentication/auth-forms/CustomFormWizard.js b/src/pages/authentication/auth-forms/CustomFormWizard.js index 7952e4f..0cb183d 100644 --- a/src/pages/authentication/auth-forms/CustomFormWizard.js +++ b/src/pages/authentication/auth-forms/CustomFormWizard.js @@ -771,7 +771,7 @@ const CustomFormWizard = (props) => { )} - + From 5610db4d9bde04e6f88934c597f64f8a1ea24733 Mon Sep 17 00:00:00 2001 From: "jason.lam" Date: Wed, 3 Jan 2024 10:31:47 +0800 Subject: [PATCH 2/5] update combo spacing --- src/pages/authentication/Register.js | 2 ++ .../authentication/auth-forms/BusCustomFormWizard.js | 8 +++----- src/pages/authentication/auth-forms/CustomFormWizard.js | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pages/authentication/Register.js b/src/pages/authentication/Register.js index 150edb2..2a39fe5 100644 --- a/src/pages/authentication/Register.js +++ b/src/pages/authentication/Register.js @@ -184,6 +184,7 @@ const Register = () => { disabled={true} onClick={handleBack} sx={{ mr: 1 }} + variant="h5" > 返回 @@ -193,6 +194,7 @@ const Register = () => { disabled={activeStep === 0} onClick={handleBack} sx={{ mr: 1 }} + variant="h5" > 返回 diff --git a/src/pages/authentication/auth-forms/BusCustomFormWizard.js b/src/pages/authentication/auth-forms/BusCustomFormWizard.js index bd9355a..423f293 100644 --- a/src/pages/authentication/auth-forms/BusCustomFormWizard.js +++ b/src/pages/authentication/auth-forms/BusCustomFormWizard.js @@ -964,8 +964,7 @@ const BusCustomFormWizard = (props) => { onChange={(event, newValue) => { setSelectedAddress4(newValue); }} - size="small" - sx={{ "& .MuiInputBase-root": { height: "41px" }, /*"#address4-combo": { padding: "0px 0px 0px 0px" },*/ "& .MuiAutocomplete-endAdornment": { top: "auto" }, }} + sx={{ "& .MuiInputBase-root": { height: "41px" }, "#address4-combo": { padding: "0px 0px 0px 3px" }, "& .MuiAutocomplete-endAdornment": { top: "auto" }, }} renderInput={(params) => } /> { id="address5-combo" value={selectedAddress5} options={address5ComboList} - size="small" onChange={(event, newValue) => { if (newValue !== null) { setSelectedAddress5(newValue); - if (newValue == '香港') { + if (newValue === '香港') { setCheckCountry(false) } else { setSelectedAddress4(""); @@ -989,7 +987,7 @@ const BusCustomFormWizard = (props) => { } }} - 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 3px" }, "& .MuiAutocomplete-endAdornment": { top: "auto" }, }} renderInput={(params) => } /> {formik.touched.address1 && formik.errors.address1 && ( diff --git a/src/pages/authentication/auth-forms/CustomFormWizard.js b/src/pages/authentication/auth-forms/CustomFormWizard.js index 0cb183d..3e7e4f3 100644 --- a/src/pages/authentication/auth-forms/CustomFormWizard.js +++ b/src/pages/authentication/auth-forms/CustomFormWizard.js @@ -1163,7 +1163,7 @@ const CustomFormWizard = (props) => { onChange={(event, newValue) => { setSelectedAddress4(newValue); }} - sx={{ "& .MuiInputBase-root": { height: "48px" }, "#address4-combo": { padding: "0px 0px 0px 0px" }, "& .MuiAutocomplete-endAdornment": { top: "auto" }, }} + sx={{ "& .MuiInputBase-root": { height: "41px" }, "#address4-combo": { padding: "0px 0px 0px 3px" }, "& .MuiAutocomplete-endAdornment": { top: "auto" }, }} renderInput={(params) => } /> { } }} - sx={{ "& .MuiInputBase-root": { height: "48px" }, "#address5-combo": { padding: "0px 0px 0px 0px" }, "& .MuiAutocomplete-endAdornment": { top: "auto" }, }} + sx={{ "& .MuiInputBase-root": { height: "41px" }, "#address5-combo": { padding: "0px 0px 0px 3px" }, "& .MuiAutocomplete-endAdornment": { top: "auto" }, }} renderInput={(params) => } /> {formik.touched.address1 && formik.errors.address1 && ( From 845c81e10ccb8a51c008c1257dc7ad6b1ca69d03 Mon Sep 17 00:00:00 2001 From: "jason.lam" Date: Wed, 3 Jan 2024 12:34:52 +0800 Subject: [PATCH 3/5] update phone layout --- src/pages/authentication/BusRegister.js | 78 ++++++++----- src/pages/authentication/Register.js | 109 +++++++++++------- .../auth-forms/BusCustomFormWizard.js | 2 +- .../auth-forms/CustomFormWizard.js | 5 + .../auth-forms/UploadFileTable.js | 4 +- src/themes/buttonConst.js | 4 +- 6 files changed, 126 insertions(+), 76 deletions(-) diff --git a/src/pages/authentication/BusRegister.js b/src/pages/authentication/BusRegister.js index fb1747f..f97eb0f 100644 --- a/src/pages/authentication/BusRegister.js +++ b/src/pages/authentication/BusRegister.js @@ -9,7 +9,7 @@ import { // Grid, Stack, Typography, - Button, + Button, StepLabel, } from '@mui/material'; import VisibilityIcon from '@mui/icons-material/Visibility'; @@ -22,34 +22,11 @@ const CustomFormWizard = Loadable(lazy(() => import('./auth-forms/BusCustomFormW const AuthWrapper = Loadable(lazy(() => import('./AuthWrapperCustom'))); import axios from "axios"; import { GET_USERNAME, POST_VERIFY_CAPTCHA } from "utils/ApiPathConst"; +import {useTheme} from "@emotion/react"; // import CustomFormWizard from './auth-forms/BusCustomFormWizard'; // import AuthWrapper from './AuthWrapperCustom'; // ================================|| REGISTER ||================================ // -const stepStyle = { - width: "40%", - boxShadow: 2, - backgroundColor: "#FFFFFF", - padding: 2, - "& .Mui-active": { - "&.MuiStepIcon-root": { - color: "warning.main", - fontSize: "2rem", - }, - "& .MuiStepConnector-line": { - borderColor: "warning.main" - } - }, - "& .Mui-completed": { - "&.MuiStepIcon-root": { - color: "secondary.main", - fontSize: "2rem", - }, - "& .MuiStepConnector-line": { - borderColor: "secondary.main" - } - } -} const steps = ['個人資料', '預覽', '完成提交']; const BusRegister = () => { @@ -59,6 +36,39 @@ const BusRegister = () => { const [username, setUsername] = useState("") const [base64Url, setBase64Url] = useState("") const [checkCode, setCheckCode] = useState("") + const theme = useTheme(); + const stepStyle = { + [theme.breakpoints.up('lg')]: { + width: '40%', + }, + [theme.breakpoints.up('md')]: { + width: '70%', + }, + [theme.breakpoints.up('xs')]: { + width: '95%', + }, + boxShadow: 1, + backgroundColor: "#FFFFFF", + padding: 2, + "& .Mui-active": { + "&.MuiStepIcon-root": { + color: "warning.main", + fontSize: "2rem", + }, + "& .MuiStepConnector-line": { + borderColor: "warning.main" + } + }, + "& .Mui-completed": { + "&.MuiStepIcon-root": { + color: "secondary.main", + fontSize: "2rem", + }, + "& .MuiStepConnector-line": { + borderColor: "secondary.main" + } + } + } const totalSteps = () => { return steps.length; @@ -131,7 +141,7 @@ const BusRegister = () => { return ( // - + {steps.map((label, index) => ( @@ -140,14 +150,26 @@ const BusRegister = () => { ( - {label} + + {label} + ) : (} // onClick={handleStep(index)} > - {label} + + {label} + ) } diff --git a/src/pages/authentication/Register.js b/src/pages/authentication/Register.js index 2a39fe5..c0ab887 100644 --- a/src/pages/authentication/Register.js +++ b/src/pages/authentication/Register.js @@ -12,7 +12,7 @@ import { // Grid, Stack, Typography, - Button, + Button, StepLabel, } from '@mui/material'; import VisibilityIcon from '@mui/icons-material/Visibility'; import { GET_USERNAME, POST_VERIFY_CAPTCHA } from "utils/ApiPathConst"; @@ -22,33 +22,11 @@ import Loadable from 'components/Loadable'; import { lazy } from 'react'; import { notifyActionError } from 'utils/CommonFunction'; import axios from "axios"; +import {useTheme} from "@emotion/react"; const CustomFormWizard = Loadable(lazy(() => import('./auth-forms/CustomFormWizard'))); const AuthWrapper = Loadable(lazy(() => import('./AuthWrapperCustom'))); // ================================|| REGISTER ||================================ // -const stepStyle = { - width: "40%", - boxShadow: 1, - backgroundColor: "#FFFFFF", - padding: 2, - "& .Mui-active": { - "&.MuiStepIcon-root": { - color: "warning.main", - fontSize: "2rem", - }, - "& .MuiStepConnector-line": { - borderColor: "warning.main" - } - }, - "& .Mui-completed": { - "&.MuiStepIcon-root": { - color: "secondary.main", - fontSize: "2rem", - }, - "& .MuiStepConnector-line": { - borderColor: "secondary.main" - } - } -} + const steps = ['個人資料', '預覽', '完成提交']; const Register = () => { @@ -58,6 +36,39 @@ const Register = () => { const [username, setUsername] = useState(""); const [base64Url, setBase64Url] = useState("") const [checkCode, setCheckCode] = useState("") + const theme = useTheme(); + const stepStyle = { + [theme.breakpoints.up('lg')]: { + width: '40%', + }, + [theme.breakpoints.up('md')]: { + width: '70%', + }, + [theme.breakpoints.up('xs')]: { + width: '95%', + }, + boxShadow: 1, + backgroundColor: "#FFFFFF", + padding: 2, + "& .Mui-active": { + "&.MuiStepIcon-root": { + color: "warning.main", + fontSize: "2rem", + }, + "& .MuiStepConnector-line": { + borderColor: "warning.main" + } + }, + "& .Mui-completed": { + "&.MuiStepIcon-root": { + color: "secondary.main", + fontSize: "2rem", + }, + "& .MuiStepConnector-line": { + borderColor: "secondary.main" + } + } + } const totalSteps = () => { return steps.length; @@ -132,27 +143,39 @@ const Register = () => { return ( // - + {steps.map((label, index) => ( - - { - index < 2 ? - ( - {label} - ) : - (} - // onClick={handleStep(index)} - > - {label} - ) - } + + { + index < 2 ? + ( + + {label} + + ) : + (} + // onClick={handleStep(index)} + > + + {label} + + ) + } - + ))} {allStepsCompleted() ? ( diff --git a/src/pages/authentication/auth-forms/BusCustomFormWizard.js b/src/pages/authentication/auth-forms/BusCustomFormWizard.js index 423f293..deb8354 100644 --- a/src/pages/authentication/auth-forms/BusCustomFormWizard.js +++ b/src/pages/authentication/auth-forms/BusCustomFormWizard.js @@ -832,7 +832,7 @@ const BusCustomFormWizard = (props) => { - + 商業登記證號碼 (e.g. 12341234-123-12-12-1) * diff --git a/src/pages/authentication/auth-forms/CustomFormWizard.js b/src/pages/authentication/auth-forms/CustomFormWizard.js index 3e7e4f3..956c6f9 100644 --- a/src/pages/authentication/auth-forms/CustomFormWizard.js +++ b/src/pages/authentication/auth-forms/CustomFormWizard.js @@ -970,6 +970,11 @@ const CustomFormWizard = (props) => { // sx={{height:"53px"}} startAdornment={(} endAdornment={)} + sx={{ + '& .MuiOutlinedInput-input': { + padding: '5px 5px 5px 5px', // Set the desired padding inline + }, + }} inputProps={{ maxLength: 1, onKeyDown: (e) => { diff --git a/src/pages/authentication/auth-forms/UploadFileTable.js b/src/pages/authentication/auth-forms/UploadFileTable.js index 4770c1e..d69c184 100644 --- a/src/pages/authentication/auth-forms/UploadFileTable.js +++ b/src/pages/authentication/auth-forms/UploadFileTable.js @@ -77,7 +77,7 @@ export default function UploadFileTable({ recordList, setUpdateRows, }) { id: 'name', field: 'name', headerName: 檔案名稱, - flex: 5, + flex: 4, }, { id: 'size', @@ -87,7 +87,7 @@ export default function UploadFileTable({ recordList, setUpdateRows, }) { // console.log(params) return Math.ceil(params.value / 1024) + " KB"; }, - flex: 1, + flex: 2, }, ]; diff --git a/src/themes/buttonConst.js b/src/themes/buttonConst.js index 2d889ad..a8c6073 100644 --- a/src/themes/buttonConst.js +++ b/src/themes/buttonConst.js @@ -128,7 +128,7 @@ export const PNSPS_LONG_BUTTON_THEME = createTheme({ root: { fontSize: '1.0rem', height: '40px', - width: '40vw', // Default width for xs screen sizes + width: '70vw', // Default width for xs screen sizes '@media (min-width: 600px)': { // sm breakpoint width: '30vw', }, @@ -136,7 +136,7 @@ export const PNSPS_LONG_BUTTON_THEME = createTheme({ width: '25vw', }, '@media (min-width: 1280px)': { // lg breakpoint - width: '14vw', + width: '19vw', }, textTransform: "none", alignItems: 'center' From 1e82f0d23527db65535dcb93bdc06eb0ec8b8c64 Mon Sep 17 00:00:00 2001 From: anna Date: Wed, 3 Jan 2024 14:28:25 +0800 Subject: [PATCH 4/5] dn file upload --- src/pages/DemandNote/Search/DataGrid.js | 37 ++++++++++++++++++- src/utils/HttpUtils.js | 49 +------------------------ 2 files changed, 37 insertions(+), 49 deletions(-) diff --git a/src/pages/DemandNote/Search/DataGrid.js b/src/pages/DemandNote/Search/DataGrid.js index b026814..5c3ab52 100644 --- a/src/pages/DemandNote/Search/DataGrid.js +++ b/src/pages/DemandNote/Search/DataGrid.js @@ -67,6 +67,18 @@ export default function SearchDemandNote({ recordList, reloadFun }) { } + const doUploadFile = (event) => { + let file = event.target.files[0]; + HttpUtils.postWithFiles({ + url:"", + files:[file], + onSuccess() { + 202222 + }, + }); + document.getElementById("uploadFileBtn").value = ""; + } + const markPaid = () => { setConfirmPopUp(false); let idList = []; @@ -171,11 +183,32 @@ export default function SearchDemandNote({ recordList, reloadFun }) { return (
+ + { + doUploadFile(event) + }} + /> + +