|
|
@ -1,6 +1,6 @@ |
|
|
|
import React, { Component } from "react"; |
|
|
|
import React, { Component } from "react"; |
|
|
|
import onInput from "~/util/onInput"; |
|
|
|
import onInput from "~/util/onInput"; |
|
|
|
import { user } from "~/Redux/actions"; |
|
|
|
import { user, file } from "~/Redux/actions"; |
|
|
|
import { connect } from "react-redux"; |
|
|
|
import { connect } from "react-redux"; |
|
|
|
|
|
|
|
|
|
|
|
import Select from "./Select/index"; |
|
|
|
import Select from "./Select/index"; |
|
|
@ -14,8 +14,12 @@ import Loader from "~/components/Loader/index"; |
|
|
|
import Document from "./Document/index"; |
|
|
|
import Document from "./Document/index"; |
|
|
|
import logo from "../../../assets/icons/logo.png"; |
|
|
|
import logo from "../../../assets/icons/logo.png"; |
|
|
|
import pic from "../../../assets/images/pic.png"; |
|
|
|
import pic from "../../../assets/images/pic.png"; |
|
|
|
|
|
|
|
import { useHistory } from "react-router-dom"; |
|
|
|
import "./index.scss"; |
|
|
|
import "./index.scss"; |
|
|
|
|
|
|
|
function Navigate({ path }) { |
|
|
|
|
|
|
|
let history = useHistory(); |
|
|
|
|
|
|
|
return <>{history.push(path)}</>; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const maxDesktopSize = 1250; |
|
|
|
const maxDesktopSize = 1250; |
|
|
|
const maxMobileSize = 550; |
|
|
|
const maxMobileSize = 550; |
|
|
@ -40,7 +44,9 @@ const toastMessages = { |
|
|
|
class Profile extends Component { |
|
|
|
class Profile extends Component { |
|
|
|
state = { |
|
|
|
state = { |
|
|
|
render: false, |
|
|
|
render: false, |
|
|
|
file: null, |
|
|
|
file: this.props.uploads["file"] || this.props.profile.picFileId || null, |
|
|
|
|
|
|
|
picFileId: |
|
|
|
|
|
|
|
this.props.uploads["file"] || this.props.profile.picFileId || null, |
|
|
|
docFileIds: "", |
|
|
|
docFileIds: "", |
|
|
|
firstName: "", |
|
|
|
firstName: "", |
|
|
|
lastName: "", |
|
|
|
lastName: "", |
|
|
@ -48,8 +54,9 @@ class Profile extends Component { |
|
|
|
username: "", |
|
|
|
username: "", |
|
|
|
address: "", |
|
|
|
address: "", |
|
|
|
email: "", |
|
|
|
email: "", |
|
|
|
gender: "دختر", |
|
|
|
birthDate: "", |
|
|
|
userRoleId: "دانش آموز", |
|
|
|
gender: this.props.profile.gender || 1, |
|
|
|
|
|
|
|
status: this.props.profile.status || 1, |
|
|
|
nationalId: "", |
|
|
|
nationalId: "", |
|
|
|
provinceId: "", |
|
|
|
provinceId: "", |
|
|
|
phone: "", |
|
|
|
phone: "", |
|
|
@ -57,7 +64,8 @@ class Profile extends Component { |
|
|
|
zoneId: "", |
|
|
|
zoneId: "", |
|
|
|
schoolId: "", |
|
|
|
schoolId: "", |
|
|
|
postalCode: "", |
|
|
|
postalCode: "", |
|
|
|
gradeId: [], |
|
|
|
gradeIds: this.props.profile.gradeIds, |
|
|
|
|
|
|
|
|
|
|
|
validation: { |
|
|
|
validation: { |
|
|
|
firstName: "", |
|
|
|
firstName: "", |
|
|
|
lastName: "", |
|
|
|
lastName: "", |
|
|
@ -74,14 +82,19 @@ class Profile extends Component { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
onChange = (name, value) => { |
|
|
|
onChange = (name, value) => { |
|
|
|
if (name === "gardeId" && this.state.userRoleId === "معلم") { |
|
|
|
// if (name === "gradeIds" && this.state.status == 2) {
|
|
|
|
|
|
|
|
// this.setState((prevState) => ({
|
|
|
|
|
|
|
|
// gradeIds: [...prevState.gradeIds.split(","), value],
|
|
|
|
|
|
|
|
// }));
|
|
|
|
|
|
|
|
// } else
|
|
|
|
|
|
|
|
if (name === "status") { |
|
|
|
this.setState((prevState) => ({ |
|
|
|
this.setState((prevState) => ({ |
|
|
|
gradeId: [...prevState.gradeId, value], |
|
|
|
gradeIds: prevState.gradeIds.slice(0, 1) || [], |
|
|
|
|
|
|
|
[name]: value, |
|
|
|
})); |
|
|
|
})); |
|
|
|
} |
|
|
|
} else if (name === "file") { |
|
|
|
if (name === "userRoleId") { |
|
|
|
this.props.upload({ file: value, target: name }); |
|
|
|
this.setState({ |
|
|
|
this.setState({ |
|
|
|
gradeId: [], |
|
|
|
|
|
|
|
[name]: value, |
|
|
|
[name]: value, |
|
|
|
}); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -96,12 +109,19 @@ class Profile extends Component { |
|
|
|
firstName, |
|
|
|
firstName, |
|
|
|
lastName, |
|
|
|
lastName, |
|
|
|
username, |
|
|
|
username, |
|
|
|
cellphone, |
|
|
|
//cellphone,
|
|
|
|
password, |
|
|
|
password, |
|
|
|
postalCode, |
|
|
|
postalCode, |
|
|
|
address, |
|
|
|
address, |
|
|
|
email, |
|
|
|
email, |
|
|
|
phone, |
|
|
|
phone, |
|
|
|
|
|
|
|
picFileId, |
|
|
|
|
|
|
|
gender, |
|
|
|
|
|
|
|
nationalId, |
|
|
|
|
|
|
|
birthDate, |
|
|
|
|
|
|
|
schools, |
|
|
|
|
|
|
|
gradeIds, |
|
|
|
|
|
|
|
status, |
|
|
|
} = this.state; |
|
|
|
} = this.state; |
|
|
|
const { profile, setProfile } = this.props; |
|
|
|
const { profile, setProfile } = this.props; |
|
|
|
const data = { |
|
|
|
const data = { |
|
|
@ -114,11 +134,21 @@ class Profile extends Component { |
|
|
|
address: address || profile.address, |
|
|
|
address: address || profile.address, |
|
|
|
email: email || profile.email, |
|
|
|
email: email || profile.email, |
|
|
|
phone: phone || profile.phone, |
|
|
|
phone: phone || profile.phone, |
|
|
|
|
|
|
|
nationalId: nationalId || profile.nationalId, |
|
|
|
|
|
|
|
picFileId: String( |
|
|
|
|
|
|
|
this.props.uploads["file"] || picFileId || profile.picFileId |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
gender: gender || profile.gender, |
|
|
|
|
|
|
|
birthDate: birthDate || profile.birthDate, |
|
|
|
|
|
|
|
schools: schools || profile.schools, |
|
|
|
|
|
|
|
gradeIds: String(gradeIds || profile.gradeIds), |
|
|
|
|
|
|
|
status: status || profile.status, |
|
|
|
}; |
|
|
|
}; |
|
|
|
await setProfile(data); |
|
|
|
await setProfile(data); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
render() { |
|
|
|
render() { |
|
|
|
|
|
|
|
if (this.props.setDone) return <Navigate path="/" />; |
|
|
|
const grades = [ |
|
|
|
const grades = [ |
|
|
|
"پیش دبستان", |
|
|
|
"پیش دبستان", |
|
|
|
"اول", |
|
|
|
"اول", |
|
|
@ -134,7 +164,7 @@ class Profile extends Component { |
|
|
|
"یازدهم", |
|
|
|
"یازدهم", |
|
|
|
"دوازدهم", |
|
|
|
"دوازدهم", |
|
|
|
]; |
|
|
|
]; |
|
|
|
const { user, profile } = this.props; |
|
|
|
const { profile } = this.props; |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<> |
|
|
|
<> |
|
|
|
{window.innerWidth > 1000 ? ( |
|
|
|
{window.innerWidth > 1000 ? ( |
|
|
@ -145,7 +175,7 @@ class Profile extends Component { |
|
|
|
<p style={{ fontSize: fontSize.desktop.p }}> |
|
|
|
<p style={{ fontSize: fontSize.desktop.p }}> |
|
|
|
لطفا مشخصات خود را به صورت کامل نمایید. |
|
|
|
لطفا مشخصات خود را به صورت کامل نمایید. |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
<form |
|
|
|
<div |
|
|
|
className="auth-profile__box--form d-flex" |
|
|
|
className="auth-profile__box--form d-flex" |
|
|
|
onSubmit={(e) => this.onSubmit(e)} |
|
|
|
onSubmit={(e) => this.onSubmit(e)} |
|
|
|
> |
|
|
|
> |
|
|
@ -159,6 +189,7 @@ class Profile extends Component { |
|
|
|
label="نام" |
|
|
|
label="نام" |
|
|
|
parent={this} |
|
|
|
parent={this} |
|
|
|
defaultValue={profile} |
|
|
|
defaultValue={profile} |
|
|
|
|
|
|
|
onInput={onInput.persianOnly} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className="mb-2"> |
|
|
|
<div className="mb-2"> |
|
|
@ -167,6 +198,7 @@ class Profile extends Component { |
|
|
|
label="نام خانوادگی" |
|
|
|
label="نام خانوادگی" |
|
|
|
parent={this} |
|
|
|
parent={this} |
|
|
|
defaultValue={profile} |
|
|
|
defaultValue={profile} |
|
|
|
|
|
|
|
onInput={onInput.persianOnly} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className="mb-2"> |
|
|
|
<div className="mb-2"> |
|
|
@ -176,6 +208,7 @@ class Profile extends Component { |
|
|
|
parent={this} |
|
|
|
parent={this} |
|
|
|
defaultValue={profile} |
|
|
|
defaultValue={profile} |
|
|
|
align="left" |
|
|
|
align="left" |
|
|
|
|
|
|
|
onInput={onInput.englishAndNumberWithoutSpace} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
@ -190,14 +223,20 @@ class Profile extends Component { |
|
|
|
<div className="mb-2"> |
|
|
|
<div className="mb-2"> |
|
|
|
<Input |
|
|
|
<Input |
|
|
|
name="nationalId" |
|
|
|
name="nationalId" |
|
|
|
label="کد ملی" |
|
|
|
label="کد ملی/اتباع" |
|
|
|
parent={this} |
|
|
|
parent={this} |
|
|
|
align="left" |
|
|
|
align="left" |
|
|
|
|
|
|
|
maxLength={13} |
|
|
|
defaultValue={profile} |
|
|
|
defaultValue={profile} |
|
|
|
|
|
|
|
onInput={onInput.numberOnly} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className="mb-2"> |
|
|
|
<div className="mb-2"> |
|
|
|
<Birthdate /> |
|
|
|
<Birthdate |
|
|
|
|
|
|
|
defaultValue={profile} |
|
|
|
|
|
|
|
parent={this} |
|
|
|
|
|
|
|
name="birthDate" |
|
|
|
|
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{/* <div className="mb-2"> |
|
|
|
{/* <div className="mb-2"> |
|
|
|
<Input name="password" label="رمز عبور" parent={this} /> |
|
|
|
<Input name="password" label="رمز عبور" parent={this} /> |
|
|
@ -208,35 +247,36 @@ class Profile extends Component { |
|
|
|
<Gender |
|
|
|
<Gender |
|
|
|
parent={this} |
|
|
|
parent={this} |
|
|
|
options={["معلم", "دانش آموز"]} |
|
|
|
options={["معلم", "دانش آموز"]} |
|
|
|
name="userRoleId" |
|
|
|
name="status" |
|
|
|
label={"عنوان"} |
|
|
|
label={"عنوان"} |
|
|
|
selectedOption={this.state.userRoleId} |
|
|
|
selectedOption={this.state.status} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{this.state.userRoleId === "دانش آموز" ? ( |
|
|
|
{this.state.status === 1 ? ( |
|
|
|
<div className="mb-2"> |
|
|
|
<div className="mb-2"> |
|
|
|
<Select |
|
|
|
<Select |
|
|
|
parent={this} |
|
|
|
parent={this} |
|
|
|
options={grades} |
|
|
|
options={grades} |
|
|
|
name="gradeId" |
|
|
|
name="gradeIds" |
|
|
|
label={"پایه تحصیلی"} |
|
|
|
label={"پایه تحصیلی"} |
|
|
|
|
|
|
|
selectedOptions={this.state.gradeIds} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
) : null} |
|
|
|
) : null} |
|
|
|
{this.state.userRoleId === "معلم" ? ( |
|
|
|
{this.state.status === 2 ? ( |
|
|
|
<div className="mb-2"> |
|
|
|
<div className="mb-2"> |
|
|
|
<MultipleSelector |
|
|
|
<MultipleSelector |
|
|
|
parent={this} |
|
|
|
parent={this} |
|
|
|
options={grades} |
|
|
|
options={grades} |
|
|
|
name="gradeId" |
|
|
|
name="gradeIds" |
|
|
|
label={"پایه تحصیلی"} |
|
|
|
label={"پایه تحصیلی"} |
|
|
|
selectedOptions={this.state.gradeId} |
|
|
|
selectedOptions={this.state.gradeIds} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
) : null} |
|
|
|
) : null} |
|
|
|
|
|
|
|
|
|
|
|
{this.state.userRoleId === "دانش آموز" && |
|
|
|
{this.state.status === "دانش آموز" && |
|
|
|
this.state.gradeId > 9 ? ( |
|
|
|
this.state.gradeIds > 9 ? ( |
|
|
|
<div className="mb-2"> |
|
|
|
<div className="mb-2"> |
|
|
|
<Select |
|
|
|
<Select |
|
|
|
parent={this} |
|
|
|
parent={this} |
|
|
@ -250,7 +290,7 @@ class Profile extends Component { |
|
|
|
]} |
|
|
|
]} |
|
|
|
name="field" |
|
|
|
name="field" |
|
|
|
label={"رشته تحصیلی"} |
|
|
|
label={"رشته تحصیلی"} |
|
|
|
selectedOptions={this.state.gradeId} |
|
|
|
selectedOptions={this.state.gradeIds} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
) : null} |
|
|
|
) : null} |
|
|
@ -271,31 +311,33 @@ class Profile extends Component { |
|
|
|
label={"شهرستان"} |
|
|
|
label={"شهرستان"} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className="mb-2"> |
|
|
|
{/* <div className="mb-2"> |
|
|
|
<Select |
|
|
|
<Select |
|
|
|
parent={this} |
|
|
|
parent={this} |
|
|
|
options={["chaharbagh", "mahalat"]} |
|
|
|
options={["chaharbagh", "mahalat"]} |
|
|
|
name="zoneId" |
|
|
|
name="zoneId" |
|
|
|
label={"شهر/روستا"} |
|
|
|
label={"شهر/روستا"} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> */} |
|
|
|
{this.state.userRoleId === "دانش آموز" ? ( |
|
|
|
{this.state.status === "دانش آموز" ? ( |
|
|
|
<div className="mb-2"> |
|
|
|
<div className="mb-2"> |
|
|
|
<Input |
|
|
|
<Input |
|
|
|
parent={this} |
|
|
|
parent={this} |
|
|
|
name="schoolId" |
|
|
|
name="schools" |
|
|
|
label={"نام مدرسه"} |
|
|
|
label={"نام مدرسه"} |
|
|
|
defaultValue={profile} |
|
|
|
defaultValue={profile} |
|
|
|
|
|
|
|
onInput={onInput.persianOnly} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
) : null} |
|
|
|
) : null} |
|
|
|
{this.state.userRoleId === "معلم" ? ( |
|
|
|
{this.state.status === "معلم" ? ( |
|
|
|
<div className="mb-2"> |
|
|
|
<div className="mb-2"> |
|
|
|
<Input |
|
|
|
<Input |
|
|
|
parent={this} |
|
|
|
parent={this} |
|
|
|
name="schoolId" |
|
|
|
name="schools" |
|
|
|
label={"محل تدریس"} |
|
|
|
label={"محل تدریس"} |
|
|
|
defaultValue={profile} |
|
|
|
defaultValue={profile} |
|
|
|
|
|
|
|
onInput={onInput.persianOnly} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
) : null} |
|
|
|
) : null} |
|
|
@ -305,7 +347,10 @@ class Profile extends Component { |
|
|
|
name="postalCode" |
|
|
|
name="postalCode" |
|
|
|
label={"کد پستی"} |
|
|
|
label={"کد پستی"} |
|
|
|
align="left" |
|
|
|
align="left" |
|
|
|
|
|
|
|
maxLength={10} |
|
|
|
|
|
|
|
inputMode="numeric" |
|
|
|
defaultValue={profile} |
|
|
|
defaultValue={profile} |
|
|
|
|
|
|
|
onInput={onInput.numberOnly} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className="mb-2"> |
|
|
|
<div className="mb-2"> |
|
|
@ -313,13 +358,14 @@ class Profile extends Component { |
|
|
|
parent={this} |
|
|
|
parent={this} |
|
|
|
label={"آدرس محل سکونت"} |
|
|
|
label={"آدرس محل سکونت"} |
|
|
|
name="address" |
|
|
|
name="address" |
|
|
|
|
|
|
|
defaultValue={profile} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className="auth-profile__box--form__footer d-flex justify-content-center"> |
|
|
|
<div className="auth-profile__box--form__footer d-flex justify-content-center"> |
|
|
|
<button>ذخیره</button> |
|
|
|
<button onClick={() => this.onSubmit()}>ذخیره</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
@ -383,32 +429,37 @@ class Profile extends Component { |
|
|
|
inputMode="numeric" |
|
|
|
inputMode="numeric" |
|
|
|
onInput={onInput.numberOnly} |
|
|
|
onInput={onInput.numberOnly} |
|
|
|
/> |
|
|
|
/> |
|
|
|
<Birthdate /> |
|
|
|
<Birthdate |
|
|
|
|
|
|
|
defaultValue={profile} |
|
|
|
|
|
|
|
parent={this} |
|
|
|
|
|
|
|
name="birthDate" |
|
|
|
|
|
|
|
/> |
|
|
|
<Gender |
|
|
|
<Gender |
|
|
|
parent={this} |
|
|
|
parent={this} |
|
|
|
options={["معلم", "دانش آموز"]} |
|
|
|
options={["معلم", "دانش آموز"]} |
|
|
|
name="userRoleId" |
|
|
|
name="status" |
|
|
|
selectedOption={this.state.userRoleId} |
|
|
|
selectedOption={this.state.status} |
|
|
|
/> |
|
|
|
/> |
|
|
|
{this.state.userRoleId === "دانش آموز" ? ( |
|
|
|
{this.state.status === 1 ? ( |
|
|
|
<Select |
|
|
|
<Select |
|
|
|
parent={this} |
|
|
|
parent={this} |
|
|
|
options={grades} |
|
|
|
options={grades} |
|
|
|
name="gradeId" |
|
|
|
name="gradeIds" |
|
|
|
label={"پایه تحصیلی"} |
|
|
|
label={"پایه تحصیلی"} |
|
|
|
|
|
|
|
selectedOptions={this.state.gradeIds} |
|
|
|
/> |
|
|
|
/> |
|
|
|
) : null} |
|
|
|
) : null} |
|
|
|
{this.state.userRoleId === "معلم" ? ( |
|
|
|
{this.state.status === 2 ? ( |
|
|
|
<MultipleSelector |
|
|
|
<MultipleSelector |
|
|
|
parent={this} |
|
|
|
parent={this} |
|
|
|
options={grades} |
|
|
|
options={grades} |
|
|
|
name="gradeId" |
|
|
|
name="gradeIds" |
|
|
|
label={"پایه تحصیلی"} |
|
|
|
label={"پایه تحصیلی"} |
|
|
|
selectedOptions={this.state.gradeId} |
|
|
|
selectedOptions={this.state.gradeIds} |
|
|
|
/> |
|
|
|
/> |
|
|
|
) : null} |
|
|
|
) : null} |
|
|
|
{this.state.userRoleId === "دانش آموز" && |
|
|
|
{this.state.status === "دانش آموز" && |
|
|
|
Number(this.state.gradeId) > 9 ? ( |
|
|
|
Number(this.state.gradeIds) > 9 ? ( |
|
|
|
<Select |
|
|
|
<Select |
|
|
|
parent={this} |
|
|
|
parent={this} |
|
|
|
options={[ |
|
|
|
options={[ |
|
|
@ -421,7 +472,7 @@ class Profile extends Component { |
|
|
|
]} |
|
|
|
]} |
|
|
|
name="field" |
|
|
|
name="field" |
|
|
|
label={"رشته تحصیلی"} |
|
|
|
label={"رشته تحصیلی"} |
|
|
|
selectedOptions={this.state.gradeId} |
|
|
|
selectedOptions={this.state.gradeIds} |
|
|
|
/> |
|
|
|
/> |
|
|
|
) : null} |
|
|
|
) : null} |
|
|
|
|
|
|
|
|
|
|
@ -437,31 +488,31 @@ class Profile extends Component { |
|
|
|
name="cityId" |
|
|
|
name="cityId" |
|
|
|
label={"شهرستان"} |
|
|
|
label={"شهرستان"} |
|
|
|
/> |
|
|
|
/> |
|
|
|
<Select |
|
|
|
{/* <Select |
|
|
|
parent={this} |
|
|
|
parent={this} |
|
|
|
options={["chaharbagh", "mahalat"]} |
|
|
|
options={["chaharbagh", "mahalat"]} |
|
|
|
name="zoneId" |
|
|
|
name="zoneId" |
|
|
|
label={"شهر/روستا"} |
|
|
|
label={"شهر/روستا"} |
|
|
|
/> |
|
|
|
/> */} |
|
|
|
{this.state.userRoleId === "دانش آموز" ? ( |
|
|
|
{this.state.status === "دانش آموز" ? ( |
|
|
|
<Input |
|
|
|
<Input |
|
|
|
parent={this} |
|
|
|
parent={this} |
|
|
|
name="schoolId" |
|
|
|
name="schools" |
|
|
|
label={"نام مدرسه"} |
|
|
|
label={"نام مدرسه"} |
|
|
|
defaultValue={profile} |
|
|
|
defaultValue={profile} |
|
|
|
onInput={onInput.persianOnly} |
|
|
|
onInput={onInput.persianOnly} |
|
|
|
/> |
|
|
|
/> |
|
|
|
) : null} |
|
|
|
) : null} |
|
|
|
{this.state.userRoleId === "معلم" ? ( |
|
|
|
{this.state.status === "معلم" ? ( |
|
|
|
<Input |
|
|
|
<Input |
|
|
|
parent={this} |
|
|
|
parent={this} |
|
|
|
name="schoolId" |
|
|
|
name="schools" |
|
|
|
label={"محل تدریس"} |
|
|
|
label={"محل تدریس"} |
|
|
|
defaultValue={profile} |
|
|
|
defaultValue={profile} |
|
|
|
onInput={onInput.persianOnly} |
|
|
|
onInput={onInput.persianOnly} |
|
|
|
/> |
|
|
|
/> |
|
|
|
) : null} |
|
|
|
) : null} |
|
|
|
{this.state.userRoleId === "معلم" ? ( |
|
|
|
{this.state.status === "معلم" ? ( |
|
|
|
<Document parent={this} name="docFileIds" /> |
|
|
|
<Document parent={this} name="docFileIds" /> |
|
|
|
) : null} |
|
|
|
) : null} |
|
|
|
<Input |
|
|
|
<Input |
|
|
@ -469,14 +520,20 @@ class Profile extends Component { |
|
|
|
name="postalCode" |
|
|
|
name="postalCode" |
|
|
|
label={"کد پستی"} |
|
|
|
label={"کد پستی"} |
|
|
|
align="left" |
|
|
|
align="left" |
|
|
|
maxLength={13} |
|
|
|
maxLength={10} |
|
|
|
inputMode="numeric" |
|
|
|
inputMode="numeric" |
|
|
|
defaultValue={profile} |
|
|
|
defaultValue={profile} |
|
|
|
onInput={onInput.numberOnly} |
|
|
|
onInput={onInput.numberOnly} |
|
|
|
/> |
|
|
|
/> |
|
|
|
<TextArea parent={this} label={"آدرس محل سکونت"} name="address" /> |
|
|
|
<TextArea |
|
|
|
|
|
|
|
parent={this} |
|
|
|
|
|
|
|
label={"آدرس محل سکونت"} |
|
|
|
|
|
|
|
name="address" |
|
|
|
|
|
|
|
defaultValue={profile} |
|
|
|
|
|
|
|
defaultValue={profile} |
|
|
|
|
|
|
|
/> |
|
|
|
<div className="mobile-auth-profile__footer d-flex justify-content-center"> |
|
|
|
<div className="mobile-auth-profile__footer d-flex justify-content-center"> |
|
|
|
<button onClick={() => this.onSubmit()}>ذخیره</button> |
|
|
|
<button onClick={() => this.onSubmit()}>ذخیره</button>{" "} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
@ -496,9 +553,16 @@ class Profile extends Component { |
|
|
|
export default connect( |
|
|
|
export default connect( |
|
|
|
(state) => ({ |
|
|
|
(state) => ({ |
|
|
|
profile: state.user.status, |
|
|
|
profile: state.user.status, |
|
|
|
|
|
|
|
setDone: state.user.setDone, |
|
|
|
loading: state.user.loading, |
|
|
|
loading: state.user.loading, |
|
|
|
|
|
|
|
uploading: state.file.loading, |
|
|
|
|
|
|
|
uploads: state.file.uploads, |
|
|
|
}), |
|
|
|
}), |
|
|
|
{ getProfile: user.getProfile, setProfile: user.setProfile } |
|
|
|
{ |
|
|
|
|
|
|
|
getProfile: user.getProfile, |
|
|
|
|
|
|
|
setProfile: user.setProfile, |
|
|
|
|
|
|
|
upload: file.upload, |
|
|
|
|
|
|
|
} |
|
|
|
)(Profile); |
|
|
|
)(Profile); |
|
|
|
|
|
|
|
|
|
|
|
Profile.defaultProps = { |
|
|
|
Profile.defaultProps = { |
|
|
|