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';