From 2fbbb1e6a843216881a5cda1bfb8b16e8291b04f Mon Sep 17 00:00:00 2001 From: anna Date: Mon, 11 Sep 2023 14:30:56 +0800 Subject: [PATCH 1/2] org user --- src/layout/MainLayout/Header/index.js | 13 ++++++---- src/pages/ManageOrgUserPage/index.js | 34 +++++++++++++++++++++++++-- src/utils/ApiPathConst.js | 2 ++ 3 files changed, 43 insertions(+), 6 deletions(-) diff --git a/src/layout/MainLayout/Header/index.js b/src/layout/MainLayout/Header/index.js index 1f644ef..d3f39d1 100644 --- a/src/layout/MainLayout/Header/index.js +++ b/src/layout/MainLayout/Header/index.js @@ -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} from "utils/Utils"; +import {isUserLoggedIn,isGLDLoggedIn, isPrimaryLoggedIn} from "utils/Utils"; import { handleLogoutFunction } from 'auth/index'; // assets @@ -126,9 +126,14 @@ function Header(props) {
  • 設定
      -
    • - 公司/機構用戶記錄 -
    • + { isPrimaryLoggedIn()? +
    • + 公司/機構用戶記錄 +
    • + : + <> + } +
  • diff --git a/src/pages/ManageOrgUserPage/index.js b/src/pages/ManageOrgUserPage/index.js index e82473b..f7f8198 100644 --- a/src/pages/ManageOrgUserPage/index.js +++ b/src/pages/ManageOrgUserPage/index.js @@ -8,6 +8,8 @@ import { Typography, Button, Grid }from '@mui/material'; +import Checkbox from '@mui/material/Checkbox'; + import MainCard from "../../components/MainCard"; import * as React from "react"; @@ -76,6 +78,18 @@ const ManageOrgUserPage = () => { } + const setPrimaryUser=(params)=>{ + HttpUtils.get( + { + url: (!params.row.primaryUser?UrlUtils.GET_SET_PRIMARY_USER:UrlUtils.GET_SET_UN_PRIMARY_USER)+"/"+params.row.id, + onSuccess:function(){ + loadData(); + } + } + ); + } + + const columns = [ { @@ -122,8 +136,8 @@ const ManageOrgUserPage = () => { field: 'lastApply', headerName: getHeader('最後提交申請日期'), flex: 1, - valueGetter:(params)=>{ - return DateUtils.datetimeStr(params.value); + valueGetter:()=>{ + return "--"; } }, { @@ -135,6 +149,22 @@ const ManageOrgUserPage = () => { getActions: (params) => { return [getStatus(params)] }, + }, + { + id: 'primaryUser', + field: 'primaryUser', + type: 'bool', + headerName: getHeader('Primary'), + flex: 1, + renderCell: (params) => { + console.log(params); + return ( + {setPrimaryUser(params)}} + checked={params.row.primaryUser} + /> + ); + }, } ]; diff --git a/src/utils/ApiPathConst.js b/src/utils/ApiPathConst.js index aaffdb7..403e74b 100644 --- a/src/utils/ApiPathConst.js +++ b/src/utils/ApiPathConst.js @@ -43,6 +43,8 @@ export const POST_PUBLIC_USER_REGISTER = apiPath+'/user/register'; //Public export const GET_PUBLIC_ORG_USER_LIST = apiPath+'/user/listOrg'; +export const GET_SET_PRIMARY_USER = apiPath+'/user/primary'; +export const GET_SET_UN_PRIMARY_USER = apiPath+'/user/un-primary'; //GLD User export const POST_ADMIN_USER_REGISTER = apiPath+'/user/registry'; From fe4a71ee623c4b456165dc8d2acce62493b927e2 Mon Sep 17 00:00:00 2001 From: Jason Chuang Date: Mon, 11 Sep 2023 14:37:57 +0800 Subject: [PATCH 2/2] ui update --- src/assets/style/navbarStyles.css | 4 ++-- src/pages/authentication/AuthWrapper.js | 2 +- src/pages/authentication/BusRegister.js | 4 ++-- src/pages/authentication/Register.js | 6 +++--- src/pages/authentication/RegisterCustom.js | 2 +- src/pages/authentication/auth-forms/AuthLoginCustom.js | 2 +- src/pages/authentication/auth-forms/BusCustomFormWizard.js | 1 - src/pages/authentication/auth-forms/CustomFormWizard.js | 1 - 8 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/assets/style/navbarStyles.css b/src/assets/style/navbarStyles.css index 3b03836..28daa43 100644 --- a/src/assets/style/navbarStyles.css +++ b/src/assets/style/navbarStyles.css @@ -37,10 +37,10 @@ #navbar div li a:focus::after{ content: ""; width: 80%; - height: 2px; + height: 3px; background:#0C489E; position: absolute; - bottom: 3px; + bottom: -5px; left: 20px; } #navbar div li ul { diff --git a/src/pages/authentication/AuthWrapper.js b/src/pages/authentication/AuthWrapper.js index 3409f58..c96d079 100644 --- a/src/pages/authentication/AuthWrapper.js +++ b/src/pages/authentication/AuthWrapper.js @@ -38,7 +38,7 @@ const AuthWrapper = ({ children }) => ( minHeight: '90vh' }} > - + import('./AuthWrapperCustom'))); // ================================|| REGISTER ||================================ // const stepStyle = { - width:"80%", - boxShadow: 2, - backgroundColor: "rgba(0,0,0,0.1)", + width:"40%", + boxShadow: 1, + backgroundColor: "#FFFFFF", padding: 2, "& .Mui-active": { "&.MuiStepIcon-root": { diff --git a/src/pages/authentication/RegisterCustom.js b/src/pages/authentication/RegisterCustom.js index ba5bc54..afed143 100644 --- a/src/pages/authentication/RegisterCustom.js +++ b/src/pages/authentication/RegisterCustom.js @@ -30,7 +30,7 @@ const RegisterCustom = () => ( - 立即成為憲報刊登公告用戶 + 立即成為憲報刊登公告用戶 只需4-5分鐘 diff --git a/src/pages/authentication/auth-forms/AuthLoginCustom.js b/src/pages/authentication/auth-forms/AuthLoginCustom.js index f1c9584..623eca7 100644 --- a/src/pages/authentication/auth-forms/AuthLoginCustom.js +++ b/src/pages/authentication/auth-forms/AuthLoginCustom.js @@ -260,7 +260,7 @@ const AuthLoginCustom = () => { - + diff --git a/src/pages/authentication/auth-forms/BusCustomFormWizard.js b/src/pages/authentication/auth-forms/BusCustomFormWizard.js index a30ed67..91ba2b7 100644 --- a/src/pages/authentication/auth-forms/BusCustomFormWizard.js +++ b/src/pages/authentication/auth-forms/BusCustomFormWizard.js @@ -503,7 +503,6 @@ const BusCustomFormWizard = (props) => { 密碼 * - 密碼規則 { 密碼 * - 密碼規則