|
|
@ -6,6 +6,9 @@ import Select from "./Select/index"; |
|
|
|
import Input from "./Input/index"; |
|
|
|
import Input from "./Input/index"; |
|
|
|
import TextArea from "./TextArea/index"; |
|
|
|
import TextArea from "./TextArea/index"; |
|
|
|
import Upload from "./Upload/index"; |
|
|
|
import Upload from "./Upload/index"; |
|
|
|
|
|
|
|
import Gender from "./GenderSwitch/index"; |
|
|
|
|
|
|
|
import Birthdate from "./Birthdate/index"; |
|
|
|
|
|
|
|
import MultipleSelector from "./MultipleSelector/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"; |
|
|
@ -13,12 +16,17 @@ import pic from "../../../assets/images/pic.png"; |
|
|
|
import "./index.scss"; |
|
|
|
import "./index.scss"; |
|
|
|
|
|
|
|
|
|
|
|
const maxDesktopSize = 1250; |
|
|
|
const maxDesktopSize = 1250; |
|
|
|
|
|
|
|
const maxMobileSize = 550; |
|
|
|
|
|
|
|
|
|
|
|
const fontSize = { |
|
|
|
const fontSize = { |
|
|
|
desktop: { |
|
|
|
desktop: { |
|
|
|
h1: window.innerWidth > maxDesktopSize ? 25 : window.innerWidth / 55, |
|
|
|
h1: window.innerWidth > maxDesktopSize ? 25 : window.innerWidth / 55, |
|
|
|
p: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 90, |
|
|
|
p: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 90, |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
mobile: { |
|
|
|
|
|
|
|
h1: window.innerWidth > maxMobileSize ? 20 : window.innerWidth / 18, |
|
|
|
|
|
|
|
p: window.innerWidth > maxMobileSize ? 14 : window.innerWidth / 28, |
|
|
|
|
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
class Profile extends Component { |
|
|
|
class Profile extends Component { |
|
|
|
state = { |
|
|
|
state = { |
|
|
@ -30,6 +38,13 @@ class Profile extends Component { |
|
|
|
address: "", |
|
|
|
address: "", |
|
|
|
gender: "", |
|
|
|
gender: "", |
|
|
|
userRoleId: "", |
|
|
|
userRoleId: "", |
|
|
|
|
|
|
|
nationalId: "", |
|
|
|
|
|
|
|
provinceId: "", |
|
|
|
|
|
|
|
cityId: "", |
|
|
|
|
|
|
|
zoneId: "", |
|
|
|
|
|
|
|
schoolId: "", |
|
|
|
|
|
|
|
postalCode: "", |
|
|
|
|
|
|
|
gradeId: [], |
|
|
|
validation: { |
|
|
|
validation: { |
|
|
|
firstName: { name: "نام", status: "" }, |
|
|
|
firstName: { name: "نام", status: "" }, |
|
|
|
lastName: { name: "نام خانوادگی", status: "" }, |
|
|
|
lastName: { name: "نام خانوادگی", status: "" }, |
|
|
@ -38,9 +53,15 @@ class Profile extends Component { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
onChange = (name, value) => { |
|
|
|
onChange = (name, value) => { |
|
|
|
|
|
|
|
if (name === "gardeId" && this.state.userRoleId === "معلم") { |
|
|
|
|
|
|
|
this.setState((prevState) => ({ |
|
|
|
|
|
|
|
gradeId: [...prevState.gradeId, value], |
|
|
|
|
|
|
|
})); |
|
|
|
|
|
|
|
} else { |
|
|
|
this.setState({ |
|
|
|
this.setState({ |
|
|
|
[name]: value, |
|
|
|
[name]: value, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() { |
|
|
|
componentDidMount() { |
|
|
@ -68,7 +89,7 @@ class Profile extends Component { |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<> |
|
|
|
<> |
|
|
|
{window.innerWidth > 1000 ? ( |
|
|
|
{window.innerWidth > 1000 ? ( |
|
|
|
<div className="auth-profile d-flex justify-content-center align-items-center"> |
|
|
|
<div className="auth-profile d-flex justify-content-center"> |
|
|
|
<div className="auth-profile__box d-flex flex-column p-4"> |
|
|
|
<div className="auth-profile__box d-flex flex-column p-4"> |
|
|
|
<h1 style={{ fontSize: fontSize.desktop.h1 }}>حساب کاربری</h1> |
|
|
|
<h1 style={{ fontSize: fontSize.desktop.h1 }}>حساب کاربری</h1> |
|
|
|
<p style={{ fontSize: fontSize.desktop.p }}> |
|
|
|
<p style={{ fontSize: fontSize.desktop.p }}> |
|
|
@ -93,7 +114,7 @@ class Profile extends Component { |
|
|
|
<div className="mb-2"> |
|
|
|
<div className="mb-2"> |
|
|
|
<Input |
|
|
|
<Input |
|
|
|
name="lastName" |
|
|
|
name="lastName" |
|
|
|
label="نام و نام خانوادگی" |
|
|
|
label="نام خانوادگی" |
|
|
|
parent={this} |
|
|
|
parent={this} |
|
|
|
defaultValue={profile.lastName} |
|
|
|
defaultValue={profile.lastName} |
|
|
|
/> |
|
|
|
/> |
|
|
@ -107,27 +128,95 @@ class Profile extends Component { |
|
|
|
align="left" |
|
|
|
align="left" |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className="mb-2"> |
|
|
|
|
|
|
|
<Gender |
|
|
|
|
|
|
|
options={["دختر", "پسر"]} |
|
|
|
|
|
|
|
parent={this} |
|
|
|
|
|
|
|
name="gender" |
|
|
|
|
|
|
|
selectedOption={this.state.gender} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div className="mb-2"> |
|
|
|
|
|
|
|
<Input |
|
|
|
|
|
|
|
name="nationalId" |
|
|
|
|
|
|
|
label="کد ملی" |
|
|
|
|
|
|
|
parent={this} |
|
|
|
|
|
|
|
align="left" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div className="mb-2"> |
|
|
|
|
|
|
|
<Birthdate /> |
|
|
|
|
|
|
|
</div> |
|
|
|
{/* <div className="mb-2"> |
|
|
|
{/* <div className="mb-2"> |
|
|
|
<Input name="password" label="رمز عبور" parent={this} /> |
|
|
|
<Input name="password" label="رمز عبور" parent={this} /> |
|
|
|
</div> */} |
|
|
|
</div> */} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style={{ width: "48%" }}> |
|
|
|
<div style={{ width: "48%" }}> |
|
|
|
<div className="mb-2" style={{ minWidth: "100%" }}> |
|
|
|
<div className="mb-2" style={{ minWidth: "100%" }}> |
|
|
|
<Select |
|
|
|
<Gender |
|
|
|
parent={this} |
|
|
|
parent={this} |
|
|
|
options={["معلم", "دانش آموز"]} |
|
|
|
options={["معلم", "دانش آموز"]} |
|
|
|
name="userRoleId" |
|
|
|
name="userRoleId" |
|
|
|
label={"عنوان"} |
|
|
|
label={"عنوان"} |
|
|
|
|
|
|
|
selectedOption={this.state.userRoleId} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{this.state.userRoleId === "دانش آموز" ? ( |
|
|
|
{this.state.userRoleId === "دانش آموز" ? ( |
|
|
|
|
|
|
|
<div className="mb-2"> |
|
|
|
<Select |
|
|
|
<Select |
|
|
|
parent={this} |
|
|
|
parent={this} |
|
|
|
options={["دختر", "پسر"]} |
|
|
|
options={[ |
|
|
|
name="gender" |
|
|
|
"1", |
|
|
|
label={"جنسیت"} |
|
|
|
"2", |
|
|
|
|
|
|
|
"3", |
|
|
|
|
|
|
|
"4", |
|
|
|
|
|
|
|
"5", |
|
|
|
|
|
|
|
"6", |
|
|
|
|
|
|
|
"7", |
|
|
|
|
|
|
|
"8", |
|
|
|
|
|
|
|
"9", |
|
|
|
|
|
|
|
"10", |
|
|
|
|
|
|
|
"11", |
|
|
|
|
|
|
|
"12", |
|
|
|
|
|
|
|
]} |
|
|
|
|
|
|
|
name="gradeId" |
|
|
|
|
|
|
|
label={"پایه تحصیلی"} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
) : null} |
|
|
|
|
|
|
|
{this.state.userRoleId === "معلم" ? ( |
|
|
|
|
|
|
|
<div className="mb-2"> |
|
|
|
|
|
|
|
<MultipleSelector |
|
|
|
|
|
|
|
parent={this} |
|
|
|
|
|
|
|
options={[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]} |
|
|
|
|
|
|
|
name="gradeId" |
|
|
|
|
|
|
|
label={"پایه تحصیلی"} |
|
|
|
|
|
|
|
selectedOptions={this.state.gradeId} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
) : null} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{this.state.userRoleId === "دانش آموز" && |
|
|
|
|
|
|
|
this.state.gradeId > 9 ? ( |
|
|
|
|
|
|
|
<div className="mb-2"> |
|
|
|
|
|
|
|
<Select |
|
|
|
|
|
|
|
parent={this} |
|
|
|
|
|
|
|
options={[ |
|
|
|
|
|
|
|
"ریاضی", |
|
|
|
|
|
|
|
"تجربی", |
|
|
|
|
|
|
|
"انسانی", |
|
|
|
|
|
|
|
"فنی حرفهای", |
|
|
|
|
|
|
|
"کاردانش", |
|
|
|
|
|
|
|
"معارف", |
|
|
|
|
|
|
|
]} |
|
|
|
|
|
|
|
name="field" |
|
|
|
|
|
|
|
label={"رشته تحصیلی"} |
|
|
|
|
|
|
|
selectedOptions={this.state.gradeId} |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
</div> |
|
|
|
) : null} |
|
|
|
) : null} |
|
|
|
|
|
|
|
|
|
|
|
<div className="mb-2" style={{ minWidth: "100%" }}> |
|
|
|
<div className="mb-2" style={{ minWidth: "100%" }}> |
|
|
|
<Select |
|
|
|
<Select |
|
|
|
parent={this} |
|
|
|
parent={this} |
|
|
@ -144,6 +233,47 @@ class Profile extends Component { |
|
|
|
label={"شهرستان"} |
|
|
|
label={"شهرستان"} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div className="mb-2"> |
|
|
|
|
|
|
|
<Select |
|
|
|
|
|
|
|
parent={this} |
|
|
|
|
|
|
|
options={["chaharbagh", "mahalat"]} |
|
|
|
|
|
|
|
name="zoneId" |
|
|
|
|
|
|
|
label={"شهر/روستا"} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
{this.state.userRoleId === "دانش آموز" ? ( |
|
|
|
|
|
|
|
<div className="mb-2"> |
|
|
|
|
|
|
|
<Input |
|
|
|
|
|
|
|
parent={this} |
|
|
|
|
|
|
|
name="schoolId" |
|
|
|
|
|
|
|
label={"نام مدرسه"} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
) : null} |
|
|
|
|
|
|
|
{this.state.userRoleId === "معلم" ? ( |
|
|
|
|
|
|
|
<div className="mb-2"> |
|
|
|
|
|
|
|
<Input |
|
|
|
|
|
|
|
parent={this} |
|
|
|
|
|
|
|
name="schoolId" |
|
|
|
|
|
|
|
label={"محل تدریس"} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
) : null} |
|
|
|
|
|
|
|
<div className="mb-2"> |
|
|
|
|
|
|
|
<Input |
|
|
|
|
|
|
|
parent={this} |
|
|
|
|
|
|
|
name="postalCode" |
|
|
|
|
|
|
|
label={"کد پستی"} |
|
|
|
|
|
|
|
align="left" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div className="mb-2"> |
|
|
|
|
|
|
|
<TextArea |
|
|
|
|
|
|
|
parent={this} |
|
|
|
|
|
|
|
label={"آدرس محل سکونت"} |
|
|
|
|
|
|
|
name="address" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</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>ذخیره</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -155,24 +285,139 @@ class Profile extends Component { |
|
|
|
{window.innerWidth < 1000 ? ( |
|
|
|
{window.innerWidth < 1000 ? ( |
|
|
|
<div className="mobile-auth-profile d-flex flex-column"> |
|
|
|
<div className="mobile-auth-profile d-flex flex-column"> |
|
|
|
<img src={logo} alt="دانوین" /> |
|
|
|
<img src={logo} alt="دانوین" /> |
|
|
|
<h1>حساب کاربری</h1> |
|
|
|
<h1 style={{ fontSize: fontSize.mobile.h1 }}>حساب کاربری</h1> |
|
|
|
<p>لطفا مشحصات خود را به صورت کامل وارد نمایید</p> |
|
|
|
<p style={{ fontSize: fontSize.mobile.p }}> |
|
|
|
<Upload name="file" /> |
|
|
|
لطفا مشحصات خود را به صورت کامل وارد نمایید |
|
|
|
<Input name="name" label="نام و نام خانوادگی" /> |
|
|
|
</p> |
|
|
|
<Input name="username" label="نام کاربری" /> |
|
|
|
<Upload name="file" parent={this} /> |
|
|
|
<Input name="password" label="رمز عبور" /> |
|
|
|
<Input |
|
|
|
|
|
|
|
name="firstName" |
|
|
|
|
|
|
|
label="نام" |
|
|
|
|
|
|
|
parent={this} |
|
|
|
|
|
|
|
defaultValue={profile.firstName} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<Input |
|
|
|
|
|
|
|
name="lastName" |
|
|
|
|
|
|
|
label="نام خانوادگی" |
|
|
|
|
|
|
|
parent={this} |
|
|
|
|
|
|
|
defaultValue={profile.lastName} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<Input |
|
|
|
|
|
|
|
name="username" |
|
|
|
|
|
|
|
label="نام کاربری" |
|
|
|
|
|
|
|
parent={this} |
|
|
|
|
|
|
|
align="left" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<Gender |
|
|
|
|
|
|
|
options={["دختر", "پسر"]} |
|
|
|
|
|
|
|
parent={this} |
|
|
|
|
|
|
|
name="gender" |
|
|
|
|
|
|
|
selectedOption={this.state.gender} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<Input |
|
|
|
|
|
|
|
name="nationalId" |
|
|
|
|
|
|
|
label="کد ملی" |
|
|
|
|
|
|
|
parent={this} |
|
|
|
|
|
|
|
align="left" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<Birthdate /> |
|
|
|
|
|
|
|
<Gender |
|
|
|
|
|
|
|
parent={this} |
|
|
|
|
|
|
|
options={["معلم", "دانش آموز"]} |
|
|
|
|
|
|
|
name="userRoleId" |
|
|
|
|
|
|
|
selectedOption={this.state.userRoleId} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
{this.state.userRoleId === "دانش آموز" ? ( |
|
|
|
|
|
|
|
<Select |
|
|
|
|
|
|
|
parent={this} |
|
|
|
|
|
|
|
options={[ |
|
|
|
|
|
|
|
"1", |
|
|
|
|
|
|
|
"2", |
|
|
|
|
|
|
|
"3", |
|
|
|
|
|
|
|
"4", |
|
|
|
|
|
|
|
"5", |
|
|
|
|
|
|
|
"6", |
|
|
|
|
|
|
|
"7", |
|
|
|
|
|
|
|
"8", |
|
|
|
|
|
|
|
"9", |
|
|
|
|
|
|
|
"10", |
|
|
|
|
|
|
|
"11", |
|
|
|
|
|
|
|
"12", |
|
|
|
|
|
|
|
]} |
|
|
|
|
|
|
|
name="gradeId" |
|
|
|
|
|
|
|
label={"پایه تحصیلی"} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
) : null} |
|
|
|
|
|
|
|
{this.state.userRoleId === "معلم" ? ( |
|
|
|
|
|
|
|
<MultipleSelector |
|
|
|
|
|
|
|
parent={this} |
|
|
|
|
|
|
|
options={[ |
|
|
|
|
|
|
|
"1", |
|
|
|
|
|
|
|
"2", |
|
|
|
|
|
|
|
"3", |
|
|
|
|
|
|
|
"4", |
|
|
|
|
|
|
|
"5", |
|
|
|
|
|
|
|
"6", |
|
|
|
|
|
|
|
"7", |
|
|
|
|
|
|
|
"8", |
|
|
|
|
|
|
|
"9", |
|
|
|
|
|
|
|
"10", |
|
|
|
|
|
|
|
"11", |
|
|
|
|
|
|
|
"12", |
|
|
|
|
|
|
|
]} |
|
|
|
|
|
|
|
name="gradeId" |
|
|
|
|
|
|
|
label={"پایه تحصیلی"} |
|
|
|
|
|
|
|
selectedOptions={this.state.gradeId} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
) : null} |
|
|
|
|
|
|
|
{this.state.userRoleId === "دانش آموز" && |
|
|
|
|
|
|
|
this.state.gradeId.length > 0 ? ( |
|
|
|
|
|
|
|
<Select |
|
|
|
|
|
|
|
parent={this} |
|
|
|
|
|
|
|
options={[ |
|
|
|
|
|
|
|
"ریاضی", |
|
|
|
|
|
|
|
"تجربی", |
|
|
|
|
|
|
|
"انسانی", |
|
|
|
|
|
|
|
"فنی حرفهای", |
|
|
|
|
|
|
|
"کاردانش", |
|
|
|
|
|
|
|
"معارف", |
|
|
|
|
|
|
|
]} |
|
|
|
|
|
|
|
name="field" |
|
|
|
|
|
|
|
label={"رشته تحصیلی"} |
|
|
|
|
|
|
|
selectedOptions={this.state.gradeId} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
) : null} |
|
|
|
|
|
|
|
|
|
|
|
<Select |
|
|
|
<Select |
|
|
|
parent={this} |
|
|
|
parent={this} |
|
|
|
options={["karaj", "tehran"]} |
|
|
|
options={["karaj", "tehran"]} |
|
|
|
name="province" |
|
|
|
name="provinceId" |
|
|
|
label={"استان"} |
|
|
|
label={"استان"} |
|
|
|
/> |
|
|
|
/> |
|
|
|
<Select |
|
|
|
<Select |
|
|
|
parent={this} |
|
|
|
parent={this} |
|
|
|
options={["karaj", "tehran"]} |
|
|
|
options={["karaj", "tehran"]} |
|
|
|
name="city" |
|
|
|
name="cityId" |
|
|
|
label={"شهرستان"} |
|
|
|
label={"شهرستان"} |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
<Select |
|
|
|
|
|
|
|
parent={this} |
|
|
|
|
|
|
|
options={["chaharbagh", "mahalat"]} |
|
|
|
|
|
|
|
name="zoneId" |
|
|
|
|
|
|
|
label={"شهر/روستا"} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
{this.state.userRoleId === "دانش آموز" ? ( |
|
|
|
|
|
|
|
<Input parent={this} name="schoolId" label={"نام مدرسه"} /> |
|
|
|
|
|
|
|
) : null} |
|
|
|
|
|
|
|
{this.state.userRoleId === "معلم" ? ( |
|
|
|
|
|
|
|
<Input parent={this} name="schoolId" label={"محل تدریس"} /> |
|
|
|
|
|
|
|
) : null} |
|
|
|
|
|
|
|
<Input |
|
|
|
|
|
|
|
parent={this} |
|
|
|
|
|
|
|
name="postalCode" |
|
|
|
|
|
|
|
label={"کد پستی"} |
|
|
|
|
|
|
|
align="left" |
|
|
|
|
|
|
|
/> |
|
|
|
<TextArea parent={this} label={"آدرس محل سکونت"} name="address" /> |
|
|
|
<TextArea parent={this} label={"آدرس محل سکونت"} name="address" /> |
|
|
|
<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> |
|
|
|