From 2a561c75d2a000a9f2a5f2586a5dcd0315e84c13 Mon Sep 17 00:00:00 2001 From: kelvinsuen Date: Thu, 31 Jul 2025 17:41:34 +0800 Subject: [PATCH] add client code update layout update pdf page update user group combo --- src/menu-items/setting.js | 36 +++++----- .../client/ClientMaintainPage/ClientForm.js | 67 ++++++++++++++++++- src/pages/client/ClientMaintainPage/index.js | 2 +- .../ClientSearchPage/ClientSearchForm.js | 11 +++ .../client/ClientSearchPage/ClientTable.js | 32 +++++---- src/pages/lionerLoginLog/index.js | 2 +- src/pages/lionerPasswordPolicyPage/index.js | 2 +- src/pages/lionerSettingPage/index.js | 2 +- .../UserInformationCard.js | 8 +-- src/pages/lionerUserDetailPage/index.js | 2 +- src/pages/lionerUserSearchPage/index.js | 2 +- src/pages/pdf/PdfMaintainPage/index.js | 4 ++ src/pages/pdf/PdfSearchPage/PdfSearchForm.js | 4 +- src/pages/pdf/PdfSearchPage/PdfTable.js | 39 +++++++---- .../pdf/PdfSearchPage/SelectTemplateWindow.js | 17 ++++- src/utils/ComboConst.js | 2 +- 16 files changed, 171 insertions(+), 61 deletions(-) diff --git a/src/menu-items/setting.js b/src/menu-items/setting.js index d751acf..679100f 100644 --- a/src/menu-items/setting.js +++ b/src/menu-items/setting.js @@ -123,24 +123,24 @@ const setting = { breadcrumbs: false, ability:['VIEW','LOGIN_LOG'] }, - { - id: 'passwordPolicy', - title: 'Password Policy', - type: 'item', - url: '/passwordpolicy', - icon: icons.SafetyCertificateOutlined, - breadcrumbs: false, - ability:['MANAGE','SYSTEM_CONFIGURATION'] - }, - { - id: 'setting', - title: 'System Configuration', - type: 'item', - url: '/setting', - icon: icons.SettingOutlined, - breadcrumbs: false, - ability:['MANAGE','SYSTEM_CONFIGURATION'] - }, + // { + // id: 'passwordPolicy', + // title: 'Password Policy', + // type: 'item', + // url: '/passwordpolicy', + // icon: icons.SafetyCertificateOutlined, + // breadcrumbs: false, + // ability:['MANAGE','SYSTEM_CONFIGURATION'] + // }, + // { + // id: 'setting', + // title: 'System Configuration', + // type: 'item', + // url: '/setting', + // icon: icons.SettingOutlined, + // breadcrumbs: false, + // ability:['MANAGE','SYSTEM_CONFIGURATION'] + // }, // { // id: 'generateReminder', // title: 'Generate Reminder', diff --git a/src/pages/client/ClientMaintainPage/ClientForm.js b/src/pages/client/ClientMaintainPage/ClientForm.js index 6c8f1d3..cdfc6cf 100644 --- a/src/pages/client/ClientMaintainPage/ClientForm.js +++ b/src/pages/client/ClientMaintainPage/ClientForm.js @@ -562,6 +562,39 @@ const ClientForm = ({ refClientDetail,
+ + + + + Client Code: * + + + + + + + + + - + {/* @@ -769,7 +802,7 @@ const ClientForm = ({ refClientDetail, /> - + */} @@ -780,6 +813,21 @@ const ClientForm = ({ refClientDetail, + + + + {/* + + + + {/* { - {isNewRecord? "New Client" : "Maintain Client"} + {isNewRecord? "New Client" : "Maintain Client"} diff --git a/src/pages/client/ClientSearchPage/ClientSearchForm.js b/src/pages/client/ClientSearchPage/ClientSearchForm.js index d0792df..06b1750 100644 --- a/src/pages/client/ClientSearchPage/ClientSearchForm.js +++ b/src/pages/client/ClientSearchPage/ClientSearchForm.js @@ -240,6 +240,17 @@ const ClientSearchForm = ({applySearch, setExpanded,expanded}) => { {/*row 2*/} + + Client Code + + + Client Last Name // ), // }, + { + id: 'clientCode', + field: 'clientCode', + headerName: 'Client Code', + flex: 1.5, + }, { id: 'fullname', field: 'fullname', @@ -168,19 +174,19 @@ export default function ClientTable({recordList, pageSize}) { ); } }, - { - id: 'phone2', - field: 'phone2', - headerName: '2nd Phone No.', - flex: 1, - renderCell: (params) => { - return ( -
- {params.value} -
- ); - } - }, + // { + // id: 'phone2', + // field: 'phone2', + // headerName: '2nd Phone No.', + // flex: 1, + // renderCell: (params) => { + // return ( + //
+ // {params.value} + //
+ // ); + // } + // }, { id: 'remarks', field: 'remarks', diff --git a/src/pages/lionerLoginLog/index.js b/src/pages/lionerLoginLog/index.js index 04346a0..84c47e0 100644 --- a/src/pages/lionerLoginLog/index.js +++ b/src/pages/lionerLoginLog/index.js @@ -65,7 +65,7 @@ const LoginLogSearchPanel = () => { - Login Log + Login Log diff --git a/src/pages/lionerPasswordPolicyPage/index.js b/src/pages/lionerPasswordPolicyPage/index.js index 1b4d480..5ef24bd 100644 --- a/src/pages/lionerPasswordPolicyPage/index.js +++ b/src/pages/lionerPasswordPolicyPage/index.js @@ -156,7 +156,7 @@ const PasswordPolicyPage = () => { - Password Policy + Password Policy { : - System Configuration + System Configuration - - Information - + {/* + + */} {/* */} - + diff --git a/src/pages/lionerUserDetailPage/index.js b/src/pages/lionerUserDetailPage/index.js index 19b88be..11f8769 100644 --- a/src/pages/lionerUserDetailPage/index.js +++ b/src/pages/lionerUserDetailPage/index.js @@ -196,7 +196,7 @@ const UserMaintainPage = () => { - {isNewRecord? "Create User" : "Maintain User"} + {isNewRecord? "Create User" : "Maintain User"} {/*col 1*/} diff --git a/src/pages/lionerUserSearchPage/index.js b/src/pages/lionerUserSearchPage/index.js index 56a90ef..f361112 100644 --- a/src/pages/lionerUserSearchPage/index.js +++ b/src/pages/lionerUserSearchPage/index.js @@ -62,7 +62,7 @@ const UserSettingPage = () => { - View User + View User diff --git a/src/pages/pdf/PdfMaintainPage/index.js b/src/pages/pdf/PdfMaintainPage/index.js index ae3af12..2f12929 100644 --- a/src/pages/pdf/PdfMaintainPage/index.js +++ b/src/pages/pdf/PdfMaintainPage/index.js @@ -23,6 +23,7 @@ function PDF() { const viewerRef = useRef(null); // Ref for the DOM element where PDF will render const [pdfLoaded, setPdfLoaded] = useState(false); const [viewerLoaded, setViewerLoaded] = useState(false); + const [isSaving, setIsSaving] = useState(false); const [viewInstance,setViewInstance] = useState(); const [adobeDCView,setAdobeDCView] = useState(); const [pdfUrl, setPdfUrl] = useState(); @@ -194,6 +195,7 @@ function PDF() { const formData = new FormData(); formData.append('file', filledPdfBlob, 'filled_form.pdf'); formData.append('record', JSON.stringify(record)); + setIsSaving(true); // Send the filled PDF to your Spring Boot backend's save endpoint await axios.post(`${apiPath}${POST_PDF_PATH}`, formData, { headers: { @@ -201,6 +203,7 @@ function PDF() { }, }) .then(response => { + setIsSaving(false); console.log('PDF saved on server:', response.data); setRecord({ id: response.data.data.id, @@ -264,6 +267,7 @@ function PDF() { variant="contained" color="cancel" onClick={viewerLoaded ? handleBackClick : handleBack} + disabled={isSaving} > Back diff --git a/src/pages/pdf/PdfSearchPage/PdfSearchForm.js b/src/pages/pdf/PdfSearchPage/PdfSearchForm.js index c39c8fc..1eda7a2 100644 --- a/src/pages/pdf/PdfSearchPage/PdfSearchForm.js +++ b/src/pages/pdf/PdfSearchPage/PdfSearchForm.js @@ -246,7 +246,7 @@ const PdfSearchForm = ({applySearch, setExpanded,expanded, clientId}) => { - + {/* Remarks { id="remarks" autoComplete="off" /> - + */} diff --git a/src/pages/pdf/PdfSearchPage/PdfTable.js b/src/pages/pdf/PdfSearchPage/PdfTable.js index 1291a4e..e41f3dd 100644 --- a/src/pages/pdf/PdfSearchPage/PdfTable.js +++ b/src/pages/pdf/PdfSearchPage/PdfTable.js @@ -117,6 +117,19 @@ export default function PdfTable({recordList}) { ), }, + { + id: 'version', + field: 'version', + headerName: 'Version', + flex: 0.5, + renderCell: (params) => { + return ( +
+ {params.value} +
+ ); + } + }, { id: 'modified', field: 'modified', @@ -198,19 +211,19 @@ export default function PdfTable({recordList}) { // ); // } // }, - { - id: 'remarks', - field: 'remarks', - headerName: 'Remarks', - flex: 2, - renderCell: (params) => { - return ( -
- {params.value} -
- ); - } - }, + // { + // id: 'remarks', + // field: 'remarks', + // headerName: 'Remarks', + // flex: 2, + // renderCell: (params) => { + // return ( + //
+ // {params.value} + //
+ // ); + // } + // }, ]; diff --git a/src/pages/pdf/PdfSearchPage/SelectTemplateWindow.js b/src/pages/pdf/PdfSearchPage/SelectTemplateWindow.js index 9f60dca..f8e66fe 100644 --- a/src/pages/pdf/PdfSearchPage/SelectTemplateWindow.js +++ b/src/pages/pdf/PdfSearchPage/SelectTemplateWindow.js @@ -46,6 +46,19 @@ export function SelectTemplateWindow({ isWindowOpen, onNormalClose, onConfirmClo const createNewForm = (templateId) => { navigate(`/pdf/maintain/-${clientId}T${templateId}`); }; + + const generateColorFromKey = (key) => { + let hash = 0; + for (let i = 0; i < key.length; i++) { + hash += key.charCodeAt(i); + } + + const baseHue = (hash * 37) % 360; // Multiply by a prime number for better distribution + const saturation = 120; // Higher saturation for more vibrant colors + const lightness = 30; // Lower lightness for darker colors + + return `hsl(${baseHue}, ${saturation}%, ${lightness}%)`; + }; return (