diff --git a/src/components/FileList.js b/src/components/FileList.js index f03ce26..7addaf9 100644 --- a/src/components/FileList.js +++ b/src/components/FileList.js @@ -4,7 +4,6 @@ import { DataGrid, GridActionsCellItem, } from "@mui/x-data-grid"; -import {useEffect} from "react"; import * as Icon from '../utils/IconUtils'; import * as HttpUtils from "../utils/HttpUtils" import * as UrlUtils from "../utils/ApiPathConst" @@ -15,7 +14,7 @@ export default function FileList({refType, refId, allowDelete, sx}) { const [rows, setRows] = React.useState([]); const [rowModesModel] = React.useState({}); - useEffect(() => { + React.useEffect(() => { loadData(); }, []); diff --git a/src/layout/MainLayout/Header/index.js b/src/layout/MainLayout/Header/index.js index a1a9b63..787f5e2 100644 --- a/src/layout/MainLayout/Header/index.js +++ b/src/layout/MainLayout/Header/index.js @@ -124,7 +124,12 @@ function Header(props) { 付款記錄
  • - 設定 + 設定 +
  • 登出 diff --git a/src/pages/ManageOrgUserPage/index.js b/src/pages/ManageOrgUserPage/index.js new file mode 100644 index 0000000..51417b3 --- /dev/null +++ b/src/pages/ManageOrgUserPage/index.js @@ -0,0 +1,148 @@ +// material-ui +import { + DataGrid, + GridActionsCellItem +} from "@mui/x-data-grid"; + +import { + Typography +}from '@mui/material'; +import MainCard from "../../components/MainCard"; + +import * as React from "react"; +import * as Icon from '../../utils/IconUtils'; +import * as HttpUtils from "../../utils/HttpUtils"; +import * as UrlUtils from "../../utils/ApiPathConst"; +import * as DateUtils from "../../utils/DateUtils"; + + + +// ==============================|| DASHBOARD - DEFAULT ||============================== // + + +const ManageOrgUserPage = () => { + const [rows, setRows] = React.useState([]); + const [rowModesModel] = React.useState({}); + + React.useEffect(() => { + loadData(); + }, []); + + + const loadData = ()=>{ + HttpUtils.get( + { + url: UrlUtils.GET_PUBLIC_ORG_USER_LIST, + onSuccess: function(responseData){ + setRows(responseData); + } + } + ); + }; + + const onActiveClick=()=>{ + + } + + const getHeader=(headerStr)=>{ + return {headerStr}; + } + + const columns = [ + { + id: 'username', + field: 'username', + headerName: getHeader('登錄名稱'), + flex: 1, + + }, + { + id: 'contactPerson', + field: 'contactPerson', + headerName: getHeader('用戶名稱'), + flex: 1, + + }, + { + id: 'contactTel', + field: 'contactTel', + headerName: getHeader('聯絡電話'), + flex: 1, + valueGetter:(params)=>{ + let contactTel = JSON.parse(params.value) + return contactTel?.countryCode+" "+contactTel?.phoneNumber; + } + }, + { + id: 'emailBus', + field: 'emailBus', + headerName: getHeader('電郵'), + flex: 1, + }, + { + id: 'lastLogin', + field: 'lastLogin', + headerName: getHeader('最後登入日期'), + flex: 1, + valueGetter:(params)=>{ + return DateUtils.datetimeStr(params.value); + } + }, + { + id: 'lastApply', + field: 'lastApply', + headerName: getHeader('最後提交申請日期'), + flex: 1, + valueGetter:(params)=>{ + return DateUtils.datetimeStr(params.value); + } + }, + { + field: 'actions', + type: 'actions', + headerName: getHeader('狀態'), + flex: 1, + cellClassName: 'actions', + getActions: (params) => { + return [ + } + label="Download" + className="textPrimary" + onClick={onActiveClick(params)} + color="primary" + />] + }, + } + ]; + + + + return ( + + + 公司/機構用戶記錄 + + +
    + + +
    + ); +}; + + +export default ManageOrgUserPage; diff --git a/src/routes/PublicUserRoutes.js b/src/routes/PublicUserRoutes.js index 3380cfe..41ca198 100644 --- a/src/routes/PublicUserRoutes.js +++ b/src/routes/PublicUserRoutes.js @@ -7,6 +7,7 @@ const MainLayout = Loadable(lazy(() => import('layout/MainLayout'))); // render - dashboard const DashboardDefault = Loadable(lazy(() => import('pages/publicDashboard'))); +const ManageOrgUser = Loadable(lazy(() => import('pages/ManageOrgUserPage'))); // ==============================|| MAIN ROUTING ||============================== // @@ -24,6 +25,10 @@ const PublicDashboard = { { path: 'dashboard', element: + }, + { + path: 'setting/manageUser', + element: } ] }, diff --git a/src/utils/ApiPathConst.js b/src/utils/ApiPathConst.js index f28dd3a..e148ada 100644 --- a/src/utils/ApiPathConst.js +++ b/src/utils/ApiPathConst.js @@ -38,3 +38,8 @@ export const POST_LOGIN = '/login'; //register export const POST_PUBLIC_USER_REGISTER = apiPath+'/user/register'; + + + +//Public +export const GET_PUBLIC_ORG_USER_LIST = apiPath+'/user/listOrg'; \ No newline at end of file