From d3f863f856df540c26f48726b332c7870da8e34f Mon Sep 17 00:00:00 2001 From: anna Date: Mon, 18 Sep 2023 17:32:15 +0800 Subject: [PATCH] fix bug --- src/layout/MainLayout/Header/index.js | 420 +++++++++--------- src/pages/ManageOrgUserPage/index.js | 2 +- src/pages/PublicNotice/ListPanel/BaseGrid.js | 14 +- .../ListPanel/PendingPaymentTab.js | 13 +- .../ListPanel/PublicNoteStatusUtils.js | 2 +- src/pages/PublicNoticeSearch_GLD/DataGrid.js | 1 - .../PublicNoticeSearch_GLD/SearchForm.js | 56 ++- 7 files changed, 264 insertions(+), 244 deletions(-) diff --git a/src/layout/MainLayout/Header/index.js b/src/layout/MainLayout/Header/index.js index 99a2024..7a62b2e 100644 --- a/src/layout/MainLayout/Header/index.js +++ b/src/layout/MainLayout/Header/index.js @@ -1,13 +1,13 @@ import PropTypes from 'prop-types'; import React -, { useState } - from 'react'; -import { useDispatch } from "react-redux"; -import { useNavigate } from "react-router-dom"; +,{useState} + from 'react'; +import {useDispatch} from "react-redux"; +import {useNavigate} from "react-router-dom"; // material-ui // import { useTheme } from '@mui/material/styles'; -import { +import { AppBar, // Container, Typography, @@ -29,7 +29,7 @@ import { IconButton, Drawer, // useMediaQuery -} from '@mui/material'; + } from '@mui/material'; import MenuIcon from '@mui/icons-material/Menu'; import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown'; @@ -41,7 +41,7 @@ import AdminLogo from 'components/AdminLogo'; import MobileLogo from 'components/MobileLogo'; import Profile from './HeaderContent/Profile'; import "assets/style/navbarStyles.css"; -import { isUserLoggedIn, isGLDLoggedIn, isPrimaryLoggedIn } from "utils/Utils"; +import {isUserLoggedIn,isGLDLoggedIn, isPrimaryLoggedIn} from "utils/Utils"; import { handleLogoutFunction } from 'auth/index'; // assets @@ -69,83 +69,77 @@ function Header(props) { //await handleLogoutFunction(); navigate('/login'); }; - + const loginContent = ( isGLDLoggedIn() ? -
-
  • - Dashboard -
  • -
  • - Application -
      -
    • - Search Application -
    • - -
    -
  • -
  • - Proof -
  • -
  • - Payment -
  • -
  • - Client -
      -
    • - Users (GLD) -
    • -
    • - Users (Individual) -
    • -
    • - Users (Organization) -
    • -
    • - Organization -
    • -
    • - User Group -
    • -
    -
  • -
  • - Logout -
  • -
    - : -
    -
  • - 主頁 -
  • -
  • - 我的公共啟事 -
  • -
  • - 校對記錄 -
  • -
  • - 付款記錄 -
  • -
  • - 設定 -
      - {isPrimaryLoggedIn() ? -
    • - 公司/機構用戶記錄 -
    • - : - <> - } - -
    -
  • -
  • - 登出 -
  • -
    +
    +
  • + Dashboard +
  • +
  • + Application +
  • +
  • + Proof +
  • +
  • + Payment +
  • +
  • + Client +
      +
    • + Users (GLD) +
    • +
    • + Users (Individual) +
    • +
    • + Users (Organization) +
    • +
    • + Organization +
    • +
    • + User Group +
    • +
    +
  • +
  • + Logout +
  • +
    + : +
    +
  • + 主頁 +
  • +
  • + 我的公共啟事 +
  • +
  • + 校對記錄 +
  • +
  • + 付款記錄 +
  • +
  • + 設定 +
      + { isPrimaryLoggedIn()? +
    • + 公司/機構用戶記錄 +
    • + : + <> + } + +
    +
  • +
  • + 登出 +
  • +
    ); const logoutContent = ( @@ -160,7 +154,7 @@ function Header(props) { ); const drawer = ( - isUserLoggedIn() ? + isUserLoggedIn()? PNSPS @@ -176,7 +170,7 @@ function Header(props) { - : + : PNSPS @@ -191,165 +185,165 @@ function Header(props) { const container = window !== undefined ? () => window().document.body : undefined; return ( - isUserLoggedIn() ? - // User Login success - - - - {isGLDLoggedIn() - ? - - - - + + + {isGLDLoggedIn() + ? + + + + - - - - - PNSPS - - : - - - - - - 公共啟事提交 - 及繳費系統 - + + + + + PNSPS + + : + + + + + + 公共啟事提交 + 及繳費系統 - - + + - - - - - - 公共啟事提交及繳費系統 - - - - } - - - - - - - - - - - - {drawer} - - - : - - - + + + + + + 公共啟事提交及繳費系統 + + + + } + + - + + + + + + + + + {drawer} + + + : + + + + + - - + + 公共啟事提交及繳費系統 - - - - - - 公共啟事提交及繳費系統 - + + + + + 公共啟事提交及繳費系統 + + + + + + {/* */} - - - - {/* */} - - - - - - - {drawer} - - + + + + + + {drawer} + + ); } Header.propTypes = { diff --git a/src/pages/ManageOrgUserPage/index.js b/src/pages/ManageOrgUserPage/index.js index f7f8198..4a47da4 100644 --- a/src/pages/ManageOrgUserPage/index.js +++ b/src/pages/ManageOrgUserPage/index.js @@ -73,7 +73,7 @@ const ManageOrgUserPage = () => { function getStatusTag({color="#000", textColor="#FFF",text=""}){ return ( -
    {text}
    +
    {text}
    ) } diff --git a/src/pages/PublicNotice/ListPanel/BaseGrid.js b/src/pages/PublicNotice/ListPanel/BaseGrid.js index f1c7d2a..85001ff 100644 --- a/src/pages/PublicNotice/ListPanel/BaseGrid.js +++ b/src/pages/PublicNotice/ListPanel/BaseGrid.js @@ -72,9 +72,8 @@ export default function BaseGrid({rows}) { }, { field: 'actions', - type: 'actions', headerName: '', - width: 50, + width: 80, cellClassName: 'actions', renderCell: () => { return ; @@ -83,7 +82,7 @@ export default function BaseGrid({rows}) { ]; return ( -
    +
    ); diff --git a/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js b/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js index 91ffc46..1c6b97f 100644 --- a/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js +++ b/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js @@ -80,7 +80,7 @@ export default function SubmittedTab({ rows }) { field: 'actions', type: 'actions', headerName: '', - width: 50, + width: 100, cellClassName: 'actions', renderCell: () => { return ; @@ -105,7 +105,7 @@ export default function SubmittedTab({ rows }) { return ( <> -
    +
    { setSelectedRowItems(newSelection); }} + sx={{ + margin: "4 2 4 2", + boxShadow: 1, + border: 1, + borderColor: '#DDD', + '& .super-app-theme--header': { + backgroundColor: '#EEE', + }, + }} />
    diff --git a/src/pages/PublicNotice/ListPanel/PublicNoteStatusUtils.js b/src/pages/PublicNotice/ListPanel/PublicNoteStatusUtils.js index 134e37d..2886144 100644 --- a/src/pages/PublicNotice/ListPanel/PublicNoteStatusUtils.js +++ b/src/pages/PublicNotice/ListPanel/PublicNoteStatusUtils.js @@ -48,6 +48,6 @@ export function getStatusEng(params) { export function getStatusTag({ color = "#000", textColor = "#FFF", text = "" }) { return ( -
    {text}
    +
    {text}
    ) } \ No newline at end of file diff --git a/src/pages/PublicNoticeSearch_GLD/DataGrid.js b/src/pages/PublicNoticeSearch_GLD/DataGrid.js index b1ccdd3..fd380b1 100644 --- a/src/pages/PublicNoticeSearch_GLD/DataGrid.js +++ b/src/pages/PublicNoticeSearch_GLD/DataGrid.js @@ -77,7 +77,6 @@ export default function SearchPublicNoticeTable({ recordList }) { }, { field: 'actions', - type: 'actions', headerName: '', width: 100, cellClassName: 'actions', diff --git a/src/pages/PublicNoticeSearch_GLD/SearchForm.js b/src/pages/PublicNoticeSearch_GLD/SearchForm.js index 0986703..bb5d577 100644 --- a/src/pages/PublicNoticeSearch_GLD/SearchForm.js +++ b/src/pages/PublicNoticeSearch_GLD/SearchForm.js @@ -16,6 +16,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData }) => { const [type, setType] = React.useState([]); const [status, setStatus] = React.useState(); + const [orgLabel, setOrgLabel] = React.useState(); const [orgId, setOrgId] = React.useState(); const [orgCombo, setOrgCombo] = React.useState(); @@ -35,21 +36,23 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData }) => { dateTo: data.dateTo, contact: data.contact, status: status?.type, - orgId:orgId?.key, + orgId: orgId?.key, }; applySearch(temp); }; - React.useEffect(()=>{ - if(orgComboData && orgComboData.length>0){ + React.useEffect(() => { + if (orgComboData && orgComboData.length > 0) { setOrgCombo(orgComboData); } - },[orgComboData]); + }, [orgComboData]); function resetForm() { setType([]); setStatus(); setOrgId(); + setOrgLabel(""); + //orgComboRef.current.clearValue(); reset(); } @@ -132,26 +135,33 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData }) => { /> - - option.label || ""} - onChange={(event, newValue) => { - if (newValue !== null) { - setOrgId(newValue); - } - }} - renderInput={(params) => ( - + { + if (newValue !== null) { + setOrgId(newValue); + setOrgLabel(newValue.label); + } else { + setOrgLabel(""); + } + }} + renderInput={(params) => ( + + )} /> - )} - /> - + + : <> + } +