| @@ -41,7 +41,7 @@ import AdminLogo from 'components/AdminLogo'; | |||||
| import MobileLogo from 'components/MobileLogo'; | import MobileLogo from 'components/MobileLogo'; | ||||
| import Profile from './HeaderContent/Profile'; | import Profile from './HeaderContent/Profile'; | ||||
| import "assets/style/navbarStyles.css"; | import "assets/style/navbarStyles.css"; | ||||
| import {isUserLoggedIn,isGLDLoggedIn} from "utils/Utils"; | |||||
| import {isUserLoggedIn,isGLDLoggedIn, isPrimaryLoggedIn} from "utils/Utils"; | |||||
| import { handleLogoutFunction } from 'auth/index'; | import { handleLogoutFunction } from 'auth/index'; | ||||
| // assets | // assets | ||||
| @@ -126,9 +126,14 @@ function Header(props) { | |||||
| <li> | <li> | ||||
| <Link className="userSetting" to='/dashboard'>設定<KeyboardArrowDownIcon/></Link> | <Link className="userSetting" to='/dashboard'>設定<KeyboardArrowDownIcon/></Link> | ||||
| <ul className='dropdown'> | <ul className='dropdown'> | ||||
| <li> | |||||
| <Link className="manageOrgUser" to='setting/manageUser'>公司/機構用戶記錄</Link> | |||||
| </li> | |||||
| { isPrimaryLoggedIn()? | |||||
| <li> | |||||
| <Link className="manageOrgUser" to='setting/manageUser'>公司/機構用戶記錄</Link> | |||||
| </li> | |||||
| : | |||||
| <></> | |||||
| } | |||||
| </ul> | </ul> | ||||
| </li> | </li> | ||||
| <li> | <li> | ||||
| @@ -8,6 +8,8 @@ import { | |||||
| Typography, Button, Grid | Typography, Button, Grid | ||||
| }from '@mui/material'; | }from '@mui/material'; | ||||
| import Checkbox from '@mui/material/Checkbox'; | |||||
| import MainCard from "../../components/MainCard"; | import MainCard from "../../components/MainCard"; | ||||
| import * as React from "react"; | 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 = [ | const columns = [ | ||||
| { | { | ||||
| @@ -122,8 +136,8 @@ const ManageOrgUserPage = () => { | |||||
| field: 'lastApply', | field: 'lastApply', | ||||
| headerName: getHeader('最後提交申請日期'), | headerName: getHeader('最後提交申請日期'), | ||||
| flex: 1, | flex: 1, | ||||
| valueGetter:(params)=>{ | |||||
| return DateUtils.datetimeStr(params.value); | |||||
| valueGetter:()=>{ | |||||
| return "--"; | |||||
| } | } | ||||
| }, | }, | ||||
| { | { | ||||
| @@ -135,6 +149,22 @@ const ManageOrgUserPage = () => { | |||||
| getActions: (params) => { | getActions: (params) => { | ||||
| return [getStatus(params)] | return [getStatus(params)] | ||||
| }, | }, | ||||
| }, | |||||
| { | |||||
| id: 'primaryUser', | |||||
| field: 'primaryUser', | |||||
| type: 'bool', | |||||
| headerName: getHeader('Primary'), | |||||
| flex: 1, | |||||
| renderCell: (params) => { | |||||
| console.log(params); | |||||
| return ( | |||||
| <Checkbox | |||||
| onClick={()=>{setPrimaryUser(params)}} | |||||
| checked={params.row.primaryUser} | |||||
| /> | |||||
| ); | |||||
| }, | |||||
| } | } | ||||
| ]; | ]; | ||||
| @@ -43,6 +43,8 @@ export const POST_PUBLIC_USER_REGISTER = apiPath+'/user/register'; | |||||
| //Public | //Public | ||||
| export const GET_PUBLIC_ORG_USER_LIST = apiPath+'/user/listOrg'; | 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 | //GLD User | ||||
| export const POST_ADMIN_USER_REGISTER = apiPath+'/user/registry'; | export const POST_ADMIN_USER_REGISTER = apiPath+'/user/registry'; | ||||