|
|
@@ -1,6 +1,6 @@ |
|
|
|
// material-ui |
|
|
|
import { |
|
|
|
Grid, TextField, Typography |
|
|
|
Grid, TextField, Typography, Select, Button, Snackbar, Alert |
|
|
|
} from '@mui/material'; |
|
|
|
import MainCard from "../../components/MainCard"; |
|
|
|
import * as React from "react"; |
|
|
@@ -8,6 +8,9 @@ import {useForm} from "react-hook-form"; |
|
|
|
import {useEffect, useState} from "react"; |
|
|
|
import Checkbox from "@mui/material/Checkbox"; |
|
|
|
import LoadingComponent from "../extra-pages/LoadingComponent"; |
|
|
|
|
|
|
|
import {POST_UP_FILE} from "../../utils/ApiPathConst"; |
|
|
|
import axios from "axios"; |
|
|
|
//import {useParams} from "react-router-dom"; |
|
|
|
|
|
|
|
// ==============================|| DASHBOARD - DEFAULT ||============================== // |
|
|
@@ -35,6 +38,7 @@ const UserInformationCard_Public = ({isCollectData, updateUserObject,userData}) |
|
|
|
if (Object.keys(userData).length > 0 &¤tUserData !== undefined) { |
|
|
|
setLocked(currentUserData.locked); |
|
|
|
setOnReady(true); |
|
|
|
|
|
|
|
} |
|
|
|
}, [currentUserData]); |
|
|
|
|
|
|
@@ -48,6 +52,33 @@ const UserInformationCard_Public = ({isCollectData, updateUserObject,userData}) |
|
|
|
updateUserObject(objectData); |
|
|
|
}, [isCollectData]); |
|
|
|
|
|
|
|
|
|
|
|
const uploadFile = (event)=>{ |
|
|
|
var formData = new FormData(); |
|
|
|
formData.append("multipartFile", event.target.files[0]); |
|
|
|
formData.append("refType", "userId"); |
|
|
|
formData.append("refId", currentUserData.id); |
|
|
|
axios.post(POST_UP_FILE,formData,{ |
|
|
|
headers: { |
|
|
|
"Content-Type":"multipart/form-data" |
|
|
|
} |
|
|
|
}).then( |
|
|
|
(response)=>{ |
|
|
|
console.log(response); |
|
|
|
setOpen(true); |
|
|
|
} |
|
|
|
).catch(error => { |
|
|
|
console.log(error); |
|
|
|
return false; |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
const [open, setOpen] = React.useState(false); |
|
|
|
const handleClose = () => { |
|
|
|
|
|
|
|
setOpen(false); |
|
|
|
}; |
|
|
|
|
|
|
|
return ( |
|
|
|
!onReady ? |
|
|
|
<LoadingComponent/> |
|
|
@@ -60,10 +91,14 @@ const UserInformationCard_Public = ({isCollectData, updateUserObject,userData}) |
|
|
|
Information |
|
|
|
</Typography> |
|
|
|
|
|
|
|
|
|
|
|
<form> |
|
|
|
<Snackbar open={open} autoHideDuration={6000} onClose={handleClose}> |
|
|
|
<Alert onClose={handleClose} severity="success" sx={{ width: '100%' }}> |
|
|
|
This is a success message! |
|
|
|
</Alert> |
|
|
|
</Snackbar> |
|
|
|
<Grid container> |
|
|
|
<Grid item xs={12} s={12} md={12} lg={12} sx={{ml: 3, mr: 3, mb: 3}}> |
|
|
|
<Grid sm={12} sx={{ml: 3, mr: 3, mb: 3}}> |
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
<Grid item xs={4} s={4} md={4} lg={4} |
|
|
|
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> |
|
|
@@ -94,7 +129,10 @@ const UserInformationCard_Public = ({isCollectData, updateUserObject,userData}) |
|
|
|
<Grid item xs={7} s={7} md={7} lg={6}> |
|
|
|
<TextField |
|
|
|
fullWidth |
|
|
|
{...register("idDocType")} |
|
|
|
{...register("idDocType", |
|
|
|
{ |
|
|
|
value: currentUserData.idDocType, |
|
|
|
})} |
|
|
|
id='idDocType' |
|
|
|
disabled |
|
|
|
/> |
|
|
@@ -113,7 +151,10 @@ const UserInformationCard_Public = ({isCollectData, updateUserObject,userData}) |
|
|
|
<Grid item xs={7} s={7} md={7} lg={6}> |
|
|
|
<TextField |
|
|
|
fullWidth |
|
|
|
{...register("identification")} |
|
|
|
{...register("identification", |
|
|
|
{ |
|
|
|
value: currentUserData.identification, |
|
|
|
})} |
|
|
|
id='identification' |
|
|
|
disabled |
|
|
|
/> |
|
|
@@ -121,6 +162,16 @@ const UserInformationCard_Public = ({isCollectData, updateUserObject,userData}) |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
|
|
|
|
<input |
|
|
|
//accept="image/*" |
|
|
|
//className={classes.input} |
|
|
|
id="contained-button-file" |
|
|
|
multiple |
|
|
|
type="file" |
|
|
|
onChange={uploadFile} |
|
|
|
/> |
|
|
|
<Button variant="contained" >View Identification File</Button> |
|
|
|
|
|
|
|
<Grid item xs={12} s={12} md={12} lg={12} sx={{ml: 3, mr: 3, mb: 3}}> |
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
<Grid item xs={4} s={4} md={4} lg={4} |
|
|
@@ -133,7 +184,7 @@ const UserInformationCard_Public = ({isCollectData, updateUserObject,userData}) |
|
|
|
fullWidth |
|
|
|
{...register("enName", |
|
|
|
{ |
|
|
|
value: currentUserData.fullname, |
|
|
|
value: currentUserData.enName, |
|
|
|
})} |
|
|
|
id='enName' |
|
|
|
disabled={readOnly} |
|
|
@@ -154,7 +205,7 @@ const UserInformationCard_Public = ({isCollectData, updateUserObject,userData}) |
|
|
|
fullWidth |
|
|
|
{...register("chName", |
|
|
|
{ |
|
|
|
value: currentUserData.fullname, |
|
|
|
value: currentUserData.chName, |
|
|
|
})} |
|
|
|
id='chName' |
|
|
|
disabled={readOnly} |
|
|
@@ -163,6 +214,113 @@ const UserInformationCard_Public = ({isCollectData, updateUserObject,userData}) |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
|
|
|
|
<Grid item xs={12} s={12} md={12} lg={12} sx={{ml: 3, mr: 3, mb: 3}}> |
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
<Grid item xs={4} s={4} md={4} lg={4} |
|
|
|
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> |
|
|
|
Chinese Name: |
|
|
|
</Grid> |
|
|
|
|
|
|
|
<Grid item xs={7} s={7} md={7} lg={6}> |
|
|
|
<TextField |
|
|
|
fullWidth |
|
|
|
{...register("chName", |
|
|
|
{ |
|
|
|
value: currentUserData.chName, |
|
|
|
})} |
|
|
|
id='chName' |
|
|
|
disabled={readOnly} |
|
|
|
/> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
|
|
|
|
<Grid item xs={12} s={12} md={12} lg={12} sx={{ml: 3, mr: 3, mb: 3}}> |
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
<Grid item xs={4} s={4} md={4} lg={4} |
|
|
|
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> |
|
|
|
Country: |
|
|
|
</Grid> |
|
|
|
|
|
|
|
<Grid item xs={7} s={7} md={7} lg={6}> |
|
|
|
|
|
|
|
<Select |
|
|
|
fullWidth |
|
|
|
{...register("country", |
|
|
|
{ |
|
|
|
value: currentUserData.country, |
|
|
|
})} |
|
|
|
id='country' |
|
|
|
disabled={readOnly} |
|
|
|
> |
|
|
|
</Select> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
|
|
|
|
<Grid item xs={12} s={12} md={12} lg={12} sx={{ml: 3, mr: 3, mb: 3}}> |
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
<Grid item xs={4} s={4} md={4} lg={4} |
|
|
|
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> |
|
|
|
Address: |
|
|
|
</Grid> |
|
|
|
|
|
|
|
<Grid item xs={7} s={7} md={12} lg={6}> |
|
|
|
<TextField |
|
|
|
fullWidth |
|
|
|
{...register("addressLine1", |
|
|
|
{ |
|
|
|
value: currentUserData.address?.addressLine1, |
|
|
|
})} |
|
|
|
id='addressLine1' |
|
|
|
disabled={readOnly} |
|
|
|
/> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
|
|
|
|
<Grid sm={12} sx={{ml: 3, mr: 3, mb: 3}}> |
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
<Grid item xs={4} s={4} md={4} lg={4} |
|
|
|
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> |
|
|
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
<Grid item xs={7} s={7} md={7} lg={6}> |
|
|
|
<TextField |
|
|
|
fullWidth |
|
|
|
{...register("addressLine2", |
|
|
|
{ |
|
|
|
value: currentUserData.address?.addressLine2, |
|
|
|
})} |
|
|
|
id='addressLine2' |
|
|
|
disabled |
|
|
|
/> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
<Grid sm={12} sx={{ml: 3, mr: 3, mb: 3}}> |
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
<Grid item xs={4} s={4} md={4} lg={4} |
|
|
|
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> |
|
|
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
<Grid item xs={7} s={7} md={7} lg={6}> |
|
|
|
<TextField |
|
|
|
fullWidth |
|
|
|
{...register("addressLine3", |
|
|
|
{ |
|
|
|
value: currentUserData.address?.addressLine3, |
|
|
|
})} |
|
|
|
id='addressLine3' |
|
|
|
disabled |
|
|
|
/> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
|
|
|
<Grid item xs={12} s={12} md={12} lg={12} sx={{ml: 3, mr: 3, mb: 3}}> |
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
<Grid item xs={4} s={4} md={4} lg={4} |
|
|
|