Merge branch 'dev_aliyun' into develop

dev_forum
daiao 5 years ago
commit 41cc9440d4

@ -187,15 +187,32 @@ class ApplicationController < ActionController::Base
# 系统全局认证 # 系统全局认证
def check_auth def check_auth
if current_user.certification != 1 && current_user.apply_actions.exists?(container_type: 'TrialAuthorization', status: 0)
tip_exception(408, "您的试用申请正在审核中,请耐心等待")
elsif current_user.certification != 1
day_cer = UserDayCertification.find_by(user_id: current_user.id) day_cer = UserDayCertification.find_by(user_id: current_user.id)
tip_exception(407, "系统未授权") unless (Time.now.to_i - day_cer.try(:created_at).to_i) < 86400 # 如果注册超过24小时则需要完善资料及授权
elsif !current_user.profile_completed? if (Time.now.to_i - day_cer.try(:created_at).to_i) > 86400
if !current_user.profile_completed?
info_url = '/account/profile' info_url = '/account/profile'
tip_exception(402, info_url) tip_exception(402, info_url)
elsif current_user.certification != 1
if current_user.apply_actions.exists?(container_type: 'TrialAuthorization', status: 0)
tip_exception(408, "您的试用申请正在审核中,请耐心等待")
end end
tip_exception(407, "系统未授权")
end
end
# if current_user.certification != 1 && current_user.apply_actions.exists?(container_type: 'TrialAuthorization', status: 0)
# tip_exception(408, "您的试用申请正在审核中,请耐心等待")
# elsif (Time.now.to_i - day_cer.try(:created_at).to_i) < 86400
# if !current_user.profile_completed?
# info_url = '/account/profile'
# tip_exception(402, info_url)
# elsif current_user.certification != 1
# day_cer = UserDayCertification.find_by(user_id: current_user.id)
# tip_exception(407, "系统未授权") unless (Time.now.to_i - day_cer.try(:created_at).to_i) < 86400
# end
# end
end end
def start_user_session(user) def start_user_session(user)

@ -13,10 +13,11 @@ import '@icedesign/base/dist/ICEDesignBase.css';
import '@icedesign/base/index.scss'; import '@icedesign/base/index.scss';
import LoginDialog from './modules/login/LoginDialog' import LoginDialog from './modules/login/LoginDialog';
import Notcompletedysl from './modules/user/Notcompletedysl' import Notcompletedysl from './modules/user/Notcompletedysl';
import Trialapplicationysl from './modules/login/Trialapplicationysl' import Trialapplicationysl from './modules/login/Trialapplicationysl';
import Trialapplicationreview from './modules/user/Trialapplicationreview' import Trialapplicationreview from './modules/user/Trialapplicationreview';
import Addcourses from "./modules/courses/coursesPublic/Addcourses";
import Trialapplication from './modules/login/Trialapplication' import Trialapplication from './modules/login/Trialapplication'
import NotFoundPage from './NotFoundPage' import NotFoundPage from './NotFoundPage'
@ -41,6 +42,7 @@ import {initAxiosInterceptors} from './AppConfig'
// tpi需要这个来加载css // tpi需要这个来加载css
import {TPMIndexHOC} from './modules/tpm/TPMIndexHOC'; import {TPMIndexHOC} from './modules/tpm/TPMIndexHOC';
const theme = createMuiTheme({ const theme = createMuiTheme({
palette: { palette: {
primary: { primary: {
@ -259,7 +261,7 @@ class App extends Component {
render() { render() {
// let {isRenders} = this.state;
return ( return (
<LocaleProvider locale={zhCN}> <LocaleProvider locale={zhCN}>
@ -270,6 +272,7 @@ class App extends Component {
<Notcompletedysl {...this.props} {...this.state}></Notcompletedysl> <Notcompletedysl {...this.props} {...this.state}></Notcompletedysl>
<Trialapplicationysl {...this.props} {...this.state}></Trialapplicationysl> <Trialapplicationysl {...this.props} {...this.state}></Trialapplicationysl>
<Trialapplicationreview {...this.props} {...this.state}></Trialapplicationreview> <Trialapplicationreview {...this.props} {...this.state}></Trialapplicationreview>
<Addcourses {...this.props} {...this.state}/>
{/*{*/} {/*{*/}
{/* isRender === true?*/} {/* isRender === true?*/}
{/* <LoginDialog></LoginDialog> : ""*/} {/* <LoginDialog></LoginDialog> : ""*/}

@ -19,7 +19,7 @@ function locationurl(list){
// TODO 开发期多个身份切换 // TODO 开发期多个身份切换
const debugType =window.location.search.indexOf('debug=t') != -1 ? 'teacher' : const debugType =window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin' window.location.search.indexOf('debug=s') != -1 ? 'mfp2guqj3' : 'admin'
window._debugType = debugType; window._debugType = debugType;
export function initAxiosInterceptors(props) { export function initAxiosInterceptors(props) {

@ -28,6 +28,20 @@ class Addcourses extends Component{
} }
componentDidMount() { componentDidMount() {
axios.interceptors.response.use((response) => {
if (response != undefined)
if (response && response.data.status === 409) {
this.setState({
Addcoursestypes: true
})
}
return response;
}, (error) => {
//TODO 这里如果样式变了会出现css不加载的情况
});
let {Addcoursestype}=this.props; let {Addcoursestype}=this.props;
this.setState({ this.setState({
@ -75,6 +89,7 @@ class Addcourses extends Component{
}) })
}else{ }else{
this.setState({ this.setState({
professor:null,
assistant_professor:null, assistant_professor:null,
Checkboxteacherchecked:e.target.checked, Checkboxteacherchecked:e.target.checked,
Checkboxteachingtype:false Checkboxteachingtype:false
@ -102,7 +117,7 @@ class Addcourses extends Component{
hidetojoinclass=()=>{ hidetojoinclass=()=>{
this.props.hideAddcoursestype(); let {Addcoursestype}=this.props;
// console.log(this.props) // console.log(this.props)
this.setState({ this.setState({
invite_code:undefined, invite_code:undefined,
@ -114,13 +129,19 @@ class Addcourses extends Component{
Checkboxteachingtype:false, Checkboxteachingtype:false,
professor:null, professor:null,
assistant_professor:null, assistant_professor:null,
student:null student:null,
Addcoursestypes:false
}) })
if(Addcoursestype===true){
this.props.hideAddcoursestype();
}
} }
submitasyn=(course_id)=>{ submitasyn=(course_id)=>{
let{professor}=this.state; let{professor,Addcoursestype}=this.state;
if(professor===1){ if(professor===1){
this.setState({ this.setState({
loadtype:true, loadtype:true,
@ -129,13 +150,17 @@ class Addcourses extends Component{
modalSave:(course_id)=>this.submitasyns(course_id), modalSave:(course_id)=>this.submitasyns(course_id),
Addcoursestype:false Addcoursestype:false
}) })
if(Addcoursestype===true){
this.props.hideAddcoursestype(); this.props.hideAddcoursestype();
}
}else{ }else{
// let{course_id}=this.state; // let{course_id}=this.state;
this.setState({ this.setState({
Addcoursestype:false Addcoursestype:false
}) })
if(Addcoursestype===true){
this.props.hideAddcoursestype(); this.props.hideAddcoursestype();
}
window.location.href ="/courses/"+course_id+"/students"; window.location.href ="/courses/"+course_id+"/students";
} }
@ -145,6 +170,7 @@ class Addcourses extends Component{
} }
submittojoinclass=()=>{ submittojoinclass=()=>{
let{Addcoursestype}=this.state;
this.setState({ this.setState({
isSpin:true isSpin:true
}) })
@ -191,7 +217,9 @@ class Addcourses extends Component{
message:"提示", message:"提示",
description:response.data.message description:response.data.message
}); });
if(Addcoursestype===true){
this.props.hideAddcoursestype(); this.props.hideAddcoursestype();
}
// this.props.showNotification(response.data.message); // this.props.showNotification(response.data.message);
@ -204,7 +232,9 @@ class Addcourses extends Component{
this.setState({ this.setState({
Addcoursestype:false Addcoursestype:false
}) })
if(Addcoursestype===true){
this.props.hideAddcoursestype(); this.props.hideAddcoursestype();
}
// this.setState({ // this.setState({
@ -285,7 +315,8 @@ class Addcourses extends Component{
loadtype, loadtype,
modalsType, modalsType,
modalsTopval, modalsTopval,
modalSave modalSave,
Addcoursestypes
}=this.state; }=this.state;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />; const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
return( return(
@ -301,7 +332,7 @@ class Addcourses extends Component{
keyboard={false} keyboard={false}
className={"HomeworkModal"} className={"HomeworkModal"}
title="加入课堂" title="加入课堂"
visible={Addcoursestype} visible={Addcoursestype===undefined||Addcoursestype===false?Addcoursestypes:Addcoursestype}
closable={false} closable={false}
footer={null} footer={null}
destroyOnClose={true} destroyOnClose={true}
@ -314,7 +345,7 @@ class Addcourses extends Component{
<label className="panel-form-label fl">课堂邀请码</label> <label className="panel-form-label fl">课堂邀请码</label>
<Input type="text" className="input-60-40 fl mt5" name="invite_code" <Input type="text" className="input-60-40 fl mt5" name="invite_code"
placeholder="请输入5位课堂邀请码或6位分班邀请码" placeholder="请输入5位课堂邀请码或6位分班邀请码"
style={{ height: '30px'}} style={{width:'275px'}}
value={invite_code} onInput={this.inputjoinclassvalue}/> value={invite_code} onInput={this.inputjoinclassvalue}/>
</li> </li>

@ -91,7 +91,7 @@ class PathModal extends Component{
this.setState({ this.setState({
type:types, type:types,
page:1, page:1,
newshixunmodallist:undefined newshixunmodallist:[]
}) })
this.funshixunpathlist(Searchvalue,types,true,1) this.funshixunpathlist(Searchvalue,types,true,1)
} }
@ -103,10 +103,11 @@ class PathModal extends Component{
}) })
} }
SenttotheSearch=(value)=>{ SenttotheSearch=(value)=>{
let{type}=this.state;
this.setState({ this.setState({
page:1, page:1,
newshixunmodallist:[]
}) })
let{type}=this.state;
this.funshixunpathlist(value,type,true,1) this.funshixunpathlist(value,type,true,1)
} }
@ -269,7 +270,7 @@ class PathModal extends Component{
`} `}
</style> </style>
<div className="over210 pl20 pr20" { newshixunmodallist&&newshixunmodallist.length===0?"":<div className="over210 pl20 pr20"
onScroll={this.contentViewScrolledit} onScroll={this.contentViewScrolledit}
style={{"Height":"204px"}}> style={{"Height":"204px"}}>
<Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit}> <Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit}>
@ -298,7 +299,7 @@ class PathModal extends Component{
}) })
} }
</Checkbox.Group> </Checkbox.Group>
</div> </div>}
{ this.state.patheditarrytype===true?<span className={"color-red"}>{this.state.patheditarryvalue}</span>:""} { this.state.patheditarrytype===true?<span className={"color-red"}>{this.state.patheditarryvalue}</span>:""}
<div className="mt20 marginauto clearfix edu-txt-center"> <div className="mt20 marginauto clearfix edu-txt-center">
<a className="pop_close task-btn mr30 margin-tp26" onClick={this.hidecouseShixunModal}>取消</a> <a className="pop_close task-btn mr30 margin-tp26" onClick={this.hidecouseShixunModal}>取消</a>

@ -290,11 +290,13 @@ class CoursesNew extends Component {
search:value search:value
}).then((result)=>{ }).then((result)=>{
// console.log(result.data) // console.log(result.data)
if (result.data.message===undefined) {
this.setState({ this.setState({
searchlist:result.data.course_lists, searchlist: result.data.course_lists,
// course:value, // course:value,
fetching:false fetching: false
}) })
}
// this.props.form.setFieldsValue({ // this.props.form.setFieldsValue({
// course:value // course:value
// }) // })
@ -343,13 +345,15 @@ class CoursesNew extends Component {
search: value search: value
} }
}).then((result)=>{ }).then((result)=>{
if (result.data.message===undefined) {
this.setState({ this.setState({
searchlistscholl:result.data.school_names, searchlistscholl: result.data.school_names,
scholl:value scholl: value
}) })
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
scholl:value scholl: value
}) })
}
}).catch((error)=>{ }).catch((error)=>{
console.log(error) console.log(error)
}) })

@ -1137,7 +1137,7 @@ class ShixunHomework extends Component{
`}</style> `}</style>
{/*onChange={this.onCheckBoxChange} value={checkBoxValues}*/} {/*onChange={this.onCheckBoxChange} value={checkBoxValues}*/}
{datas===undefined?"": <Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={this.state.checkBoxValues}> {datas===undefined?"": <Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={this.state.checkBoxValues}>
{ datas.homeworks.map((item, index) => { { datas.homeworks && datas.homeworks.map((item, index) => {
// console.log("ShixunhomeWorkItem") // console.log("ShixunhomeWorkItem")
// console.log("++++++++++++++++++++++++++++++++++++++++++") // console.log("++++++++++++++++++++++++++++++++++++++++++")
// console.log(JSON.stringify(this.props)) // console.log(JSON.stringify(this.props))

@ -397,6 +397,7 @@ class LoginDialog extends Component {
disableEscapeKeyDown={true} disableEscapeKeyDown={true}
onClose={() => this.handleDialogClose()} onClose={() => this.handleDialogClose()}
> >
{isRender===true?
<div className={dialogBox}> <div className={dialogBox}>
<div id="closeIcon" onClick={()=>{this.handleDialogClose()}}> <div id="closeIcon" onClick={()=>{this.handleDialogClose()}}>
<i className="iconfont icon-shanchudiao"></i> <i className="iconfont icon-shanchudiao"></i>
@ -489,7 +490,7 @@ class LoginDialog extends Component {
</div> </div>
</div> </div>
:""}
</Dialog> </Dialog>
); );

@ -59,7 +59,8 @@ class DetailCardsEditAndAdd extends Component{
AddShixunBox = () =>{ AddShixunBox = () =>{
this.setState({ this.setState({
selectShixun:true, selectShixun:true,
patheditarry:[] patheditarry:[],
page:1
}) })
this.changeTag(0,""); this.changeTag(0,"");
} }
@ -68,6 +69,7 @@ class DetailCardsEditAndAdd extends Component{
cloasShixunBox =()=>{ cloasShixunBox =()=>{
this.setState({ this.setState({
selectShixun:false, selectShixun:false,
page:1,
patheditarry:[] patheditarry:[]
}) })
} }
@ -103,7 +105,8 @@ class DetailCardsEditAndAdd extends Component{
shixuns_listedit:newshixuns_listedit, shixuns_listedit:newshixuns_listedit,
shixuns_listeditlist:list, shixuns_listeditlist:list,
patheditarry:[], patheditarry:[],
selectShixun:false selectShixun:false,
page:1,
}) })
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -139,18 +142,23 @@ class DetailCardsEditAndAdd extends Component{
//打开选择实训弹框初始化tag标签和列表 //打开选择实训弹框初始化tag标签和列表
changeTag=(id,search)=>{ changeTag=(id,search)=>{
this.setState({ this.setState({
hometypepvisible:true ChooseShixunListshixun_list:[],
page:1,
hometypepvisible:true,
}) })
let pathId=this.props.pathid; let pathId=this.props.pathid;
let {page}=this.state;
let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+page let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+1
if(search!="" && search!=undefined){ if(search!="" && search!=undefined){
url+="&search="+search; url+="&search="+search;
} }
if(id!=0){ if(id!=0){
url+="&type="+id; url+="&type="+id;
} }
axios.get(url).then((result)=>{ axios.get(url).then((result)=>{
if(result.status===200){ if(result.status===200){
this.setState({ this.setState({
@ -287,10 +295,10 @@ class DetailCardsEditAndAdd extends Component{
contentViewScrolladd=(e)=>{ contentViewScrolladd=(e)=>{
//滑动到底判断 //滑动到底判断
if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){
// console.log("到达底部"); // console.log("到达底部");
debugger
this.setState({ this.setState({
hometypepvisible:true hometypepvisible:true
}) })
@ -324,6 +332,8 @@ class DetailCardsEditAndAdd extends Component{
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
}) })
} }
} }
@ -481,7 +491,7 @@ class DetailCardsEditAndAdd extends Component{
` `
} }
</style> </style>
<div className="over180 pl20 pr20" {ChooseShixunListshixun_list && ChooseShixunListshixun_list.length===0?"": <div className="over180 pl20 pr20"
onScroll={this.contentViewScrolladd} onScroll={this.contentViewScrolladd}
> >
<Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit}> <Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit}>
@ -508,7 +518,7 @@ class DetailCardsEditAndAdd extends Component{
}) })
} }
</Checkbox.Group> </Checkbox.Group>
</div> </div>}
<div className="mt20 marginauto clearfix edu-txt-center"> <div className="mt20 marginauto clearfix edu-txt-center">
<a className="pop_close task-btn mr30 margin-tp26" onClick={this.cloasShixunBox}>取消</a> <a className="pop_close task-btn mr30 margin-tp26" onClick={this.cloasShixunBox}>取消</a>
<a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.clickShixunchoose}>确定</a> <a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.clickShixunchoose}>确定</a>

@ -139,7 +139,9 @@ class PathDetailIndex extends Component{
let pathid=this.props.match.params.pathId; let pathid=this.props.match.params.pathId;
let url="/paths/"+pathid+".json"; let url="/paths/"+pathid+".json";
axios.get(url).then((result)=>{ axios.get(url).then((result)=>{
if (result.data.status == 407) {
return;
}
if(result.data.allow_visit===true){ if(result.data.allow_visit===true){
this.setState({ this.setState({
detailInfoList:result.data, detailInfoList:result.data,
@ -162,6 +164,9 @@ class PathDetailIndex extends Component{
let pathid=this.props.match.params.pathId; let pathid=this.props.match.params.pathId;
let url="/paths/"+pathid+".json"; let url="/paths/"+pathid+".json";
axios.get(url).then((result)=>{ axios.get(url).then((result)=>{
if (result.data.status == 407) {
return;
}
if(result.data.allow_visit===true){ if(result.data.allow_visit===true){
this.setState({ this.setState({
detailInfoList:result.data, detailInfoList:result.data,

@ -534,10 +534,10 @@ submittojoinclass=(value)=>{
<div className="newHeader" id="nHeader" > <div className="newHeader" id="nHeader" >
{/*<LoginDialog*/} {isRender===true?<LoginDialog
{/*{...this.state}*/} {...this.state}
{/*{...this.props}*/} {...this.props}
{/*/>*/} />:""}
<div className="educontent clearfix"> <div className="educontent clearfix">
{/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/} {/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/}
@ -737,14 +737,14 @@ submittojoinclass=(value)=>{
<ul> <ul>
<li className="clearfix mb10"> <li className="clearfix mb10">
<label className="panel-form-label fl">项目邀请码</label> <label className="panel-form-label fl">项目邀请码</label>
<Input type="text" className="input-60-40 fl" name="invite_code" <Input type="text" className="input-60-40 fl mt5" name="invite_code"
style={{width: '275px'}} style={{width: '275px'}}
placeholder="请输入5位课堂邀请码或6位分班邀请码" value={tojoinclasstitle} onInput={this.inputjoinclassvalue}/> placeholder="请输入5位项目邀请码或6位分班邀请码" value={tojoinclasstitle} onInput={this.inputjoinclassvalue}/>
</li> </li>
<p id="none_invite_code_notice" <p id="none_invite_code_notice"
className="color-orange none f12" className="color-orange none f12"
style={{marginLeft: '90px',display:code_notice===true?'block':"none"}}>请输入5位课堂邀请码或6位分班邀请码</p> style={{marginLeft: '90px',display:code_notice===true?'block':"none"}}>请输入5位项目邀请码或6位分班邀请码</p>
<li className="clearfix "> <li className="clearfix ">

@ -302,11 +302,12 @@ export function TPMIndexHOC(WrappedComponent) {
<div> <div>
<SiderBar Headertop={Headertop}/> <SiderBar Headertop={Headertop}/>
{/* 注释掉了1440 影响到了手机屏幕的展示 */}
<style>{ <style>{
` `
.newContainers{ .newContainers{
width: 100%; width: 100%;
min-width: 1440px; /*min-width: 1440px;*/
max-width: unset; max-width: unset;
} }
// .-task-sidebar{ // .-task-sidebar{

@ -392,10 +392,12 @@ export default class TPMsettings extends Component {
let departmentsUrl = `/shixuns/departments.json`; let departmentsUrl = `/shixuns/departments.json`;
axios.get(departmentsUrl).then((response) => { axios.get(departmentsUrl).then((response) => {
if (response.status === 200) { if (response.status === 200) {
if (response.data.message === undefined) {
this.setState({ this.setState({
departmentslist: response.data.shools_name departmentslist: response.data.shools_name
}); });
} }
}
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });

@ -251,10 +251,12 @@ class Newshixuns extends Component {
let departmentsUrl = `/shixuns/departments.json`; let departmentsUrl = `/shixuns/departments.json`;
axios.get(departmentsUrl).then((response) => { axios.get(departmentsUrl).then((response) => {
if (response.status === 200) { if (response.status === 200) {
if (response.data.message===undefined) {
this.setState({ this.setState({
departmentslist: response.data.shools_name departmentslist: response.data.shools_name
}); });
} }
}
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
@ -496,7 +498,9 @@ class Newshixuns extends Component {
function fake() { function fake() {
let departmentsUrl = `/shixuns/departments.json?q=` + currentValue; let departmentsUrl = `/shixuns/departments.json?q=` + currentValue;
axios.get(departmentsUrl).then((response) => { axios.get(departmentsUrl).then((response) => {
if (response.data.message===undefined) {
callback(response.data.shools_name); callback(response.data.shools_name);
}
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });

@ -273,7 +273,7 @@ class InterestpageMax extends Component {
{gouxuans4&&gouxuans4.map((item,key)=>{ {gouxuans4&&gouxuans4.map((item,key)=>{
return( return(
<div className={item.id<5?"ysldivhomediv12":"ysldivhomediv22"} onClick={()=>this.Clickteacher2(item.id)}> <div className={item.id<5?"ysldivhomediv12":"ysldivhomediv22"} onClick={()=>this.Clickteacher2(item.id)}>
{item.bool===true?<img src={gouxuan} className="yslgouxuanimg2"/>:<div className="yslgouxuanimg22"></div>} {item.bool===true?<img src={gouxuan} className="yslgouxuanimg22x"/>:<div className="yslgouxuanimg22x"></div>}
<img className="div1img2" src={item.url}/> <img className="div1img2" src={item.url}/>
<span className="textall2">{item.name}</span> <span className="textall2">{item.name}</span>
</div> </div>

@ -37,7 +37,7 @@ class AccountBasic extends Component {
} }
componentDidUpdate =(prevProps)=>{ componentDidUpdate =(prevProps)=>{
if(this.props.basicInfo && prevProps.basicInfo == undefined){ if(this.props.basicInfo && (prevProps.basicInfo == undefined || prevProps.basicInfo.id != this.props.basicInfo.id)){
this.setValue(this.props.basicInfo); this.setValue(this.props.basicInfo);
this.getSchoolList(this.props.basicInfo); this.getSchoolList(this.props.basicInfo);
} }
@ -201,9 +201,9 @@ class AccountBasic extends Component {
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
org2:e org2:e
}) })
let arr = this.state.departments.filter(function(item){ let arr = this.state.departments && this.state.departments.filter ? this.state.departments.filter(function(item){
return item.name.indexOf(e) > -1 return item.name.indexOf(e) > -1
}) }) : []
this.setState({ this.setState({
filterDepartments:arr, filterDepartments:arr,
departmentsName:e departmentsName:e
@ -213,9 +213,9 @@ class AccountBasic extends Component {
// 选择部门、学院 // 选择部门、学院
changeDepartment=(e)=>{ changeDepartment=(e)=>{
let arr=this.state.departments.filter(function(item){ let arr= this.state.departments && this.state.departments.filter ? this.state.departments.filter(function(item){
return item.name == e; return item.name == e;
}); }) : [];
this.setState({ this.setState({
departmentsName:e, departmentsName:e,
department_id:arr[0].id department_id:arr[0].id

@ -168,14 +168,21 @@
margin-left: 26px; margin-left: 26px;
} }
.yslgouxuanimg22{ .div1img2xx{
width: 20px;
margin-left: 26px;
}
.yslgouxuanimg22x{
width: 20px; width: 20px;
height: 20px; height: 20px;
margin-left: 75px; margin-left: 75px;
} }
.yslgouxuanimg2{ .yslgouxuanimg2x{
height: 20px; height: 20px;
width: 20px;
margin-left: 75px;
} }
.yslbutondls{ .yslbutondls{

Loading…
Cancel
Save