|
|
@@ -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 <Typography variant="h5" >{headerStr}</Typography>; |
|
|
|
} |
|
|
|
|
|
|
|
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 [ |
|
|
|
<GridActionsCellItem |
|
|
|
key="OutSave" |
|
|
|
icon={<Icon.Download/>} |
|
|
|
label="Download" |
|
|
|
className="textPrimary" |
|
|
|
onClick={onActiveClick(params)} |
|
|
|
color="primary" |
|
|
|
/>] |
|
|
|
}, |
|
|
|
} |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
<MainCard elevation={0} border={false} content={false} > |
|
|
|
<Typography variant="h5" sx={{mt: 3, ml: 3, mb: 1}}> |
|
|
|
公司/機構用戶記錄 |
|
|
|
</Typography> |
|
|
|
|
|
|
|
<br/> |
|
|
|
|
|
|
|
<DataGrid |
|
|
|
rows={rows} |
|
|
|
columns={columns} |
|
|
|
editMode="row" |
|
|
|
rowModesModel={rowModesModel} |
|
|
|
initialState={{ |
|
|
|
pagination: { |
|
|
|
paginationModel: {page: 0, pageSize: 10}, |
|
|
|
}, |
|
|
|
}} |
|
|
|
pageSizeOptions={[5, 10]} |
|
|
|
autoHeight = {true} |
|
|
|
/> |
|
|
|
</MainCard> |
|
|
|
); |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export default ManageOrgUserPage; |