This commit is contained in:
北海一刀 2021-11-11 15:04:08 +08:00
commit 241eb68801
4 changed files with 91 additions and 97 deletions

View File

@ -86,7 +86,7 @@ import classNames from 'classnames'
} }
// 焦点事件,伸展宽度 // 焦点事件,伸展宽度
focusFn(e){ focusFn(e){
if(this.props.placeholder.length>7){ if(this.props.placeholder.length>10){
this.setState({'focus':0}); this.setState({'focus':0});
} }

View File

@ -3,7 +3,7 @@
.iptfillself{ .iptfillself{
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 30px; // margin-bottom: 24px!important;
.label{ .label{
margin-right: 58px; margin-right: 58px;
.warning{ .warning{

View File

@ -63,14 +63,14 @@ function Adduser(){
{ {
return { return {
name: 'error', name: 'error',
message: '输入电话', message: '输入电话',
}; };
} }
else if(values.password == "") else if(values.password == "")
{ {
return { return {
name: 'error', name: 'error',
message: '清输入电话', message: '请输入密码',
}; };
} }
} }
@ -153,15 +153,7 @@ function Adduser(){
style={{marginLeft:'10px'}} style={{marginLeft:'10px'}}
onSubmit={onSubmit} onSubmit={onSubmit}
> >
<FormImageUploadField
name="imageUpload"
label="头像上传"
props={{
maxAmount: 1,
maxSize: 1024 * 1024 * 2,
}}
validators={[Validators.minLength(1, '请上传头像')]}
/>

View File

@ -41,95 +41,97 @@ export default class station extends React.Component{
// } // }
} }
editFn(e,placeholder){ editFn(e,placeholder){
// let cssname=null; let cssname=null;
// let stationame=[]; let stationame=[];
// if(placeholder=='公司'){ if(placeholder=='公司'){
// cssname='companyBtn'; cssname='companyBtn';
// stationame=this.state.company stationame=this.state.company
// }else if(placeholder=='部门'){ }else if(placeholder=='部门'){
// cssname='departmentBtn'; cssname='departmentBtn';
// stationame=this.state.department stationame=this.state.department
// }else if(placeholder=='岗位'){ }else if(placeholder=='岗位'){
// cssname='postBtn'; cssname='postBtn';
// stationame=this.state.post stationame=this.state.post
// } }
// if(e.parentNode.parentNode.children[0].value){ if(e.parentNode.parentNode.children[0].value){
// if( e.innerHTML=="保存"){ if( e.innerHTML=="保存"){
// if(this.hasVal(stationame,e.parentNode.parentNode.children[0].value)>-1){ if(this.hasVal(cssname,e.parentNode.parentNode.children[0].value)>-1){
// Notify.clear() Notify.clear()
// Notify.warn(`${placeholder}已存在,请重新增加`); Notify.warn(`${placeholder}重复,请重新增加`);
// }else{ }else{
// e.parentNode.firstChild.innerHTML='删除'; e.parentNode.firstChild.innerHTML='删除';
// e.parentNode.parentNode.children[0].disabled="disabled"; e.parentNode.parentNode.children[0].disabled="disabled";
// e.parentNode.parentNode.className=cssname+" newitem"; e.parentNode.parentNode.className=cssname+" newitem";
// Notify.clear() Notify.clear()
// Notify.success('保存成功'); Notify.success('保存成功');
// e.innerHTML="编辑";
// if(placeholder=='公司'){
// this.setState({'companyBtn':true}); this.setState({company:[]})
// }else if(placeholder=='部门'){ e.innerHTML="编辑";
// this.setState({'departmentBtn':true}); if(placeholder=='公司'){
// }else if(placeholder=='岗位'){ this.setState({'companyBtn':true});
// this.setState({'postBtn':true}); }else if(placeholder=='部门'){
// } this.setState({'departmentBtn':true});
// } }else if(placeholder=='岗位'){
// }else{ this.setState({'postBtn':true});
// e.parentNode.parentNode.children[0].disabled=""; }
// e.parentNode.parentNode.children[0].focus(); }
// e.parentNode.parentNode.className="newitem focusactive"; }else{
// e.innerHTML="保存"; e.parentNode.parentNode.children[0].disabled="";
// if(placeholder=='公司'){ e.parentNode.parentNode.children[0].focus();
// this.setState({'companyBtn':false}); e.parentNode.parentNode.className="newitem focusactive";
// }else if(placeholder=='部门'){ e.innerHTML="保存";
// this.setState({'departmentBtn':false}); if(placeholder=='公司'){
// }else if(placeholder=='岗位'){ this.setState({'companyBtn':false});
// this.setState({'postBtn':false}); }else if(placeholder=='部门'){
// } this.setState({'departmentBtn':false});
// } }else if(placeholder=='岗位'){
// }else{ this.setState({'postBtn':false});
// Notify.clear() }
// Notify.error(`请填入${placeholder}名称`); }
// e.parentNode.parentNode.children[0].focus(); }else{
// } Notify.clear()
Notify.error(`请填入${placeholder}名称`);
e.parentNode.parentNode.children[0].focus();
}
} }
hasVal(obj,parmas){ hasVal(obj,parmas){
let site=_.findIndex(obj,(o)=> {return o.name == parmas}); let site=_.findIndex(obj,(o)=> {return o.name == parmas});
return site; return site;
} }
sureFn(e,placeholder){ sureFn(e,rp,placeholder){
// if(e.target.value&&e.keyCode==13){ if(e.target.value&&e.keyCode==13){
// let cssname=null; let cssname=null;
// let stationame=[]; let stationame=[];
// if(placeholder=='公司'){ if(placeholder=='公司'){
// cssname='companyBtn'; cssname='companyBtn';
// stationame=this.state.company stationame=this.state.company;
// }else if(placeholder=='部门'){ }else if(placeholder=='部门'){
// cssname='departmentBtn'; cssname='departmentBtn';
// stationame=this.state.department stationame=this.state.department;
// }else if(placeholder=='岗位'){ }else if(placeholder=='岗位'){
// cssname='postBtn'; cssname='postBtn';
// stationame=this.state.post stationame=this.state.post;
// } }
// if(this.hasVal(stationame,e.target.value)>-1){ if(this.hasVal(this.state.company,e.target.value)>-1){
// Notify.clear() Notify.clear()
// Notify.warn(`${placeholder}已存在,请重新增加`); Notify.warn(`${placeholder}重复,请重新增加`);
// }else{ }else{
// this.parentNode.children[1].firstChild.innerHTML='删除'; rp.parentNode.children[1].firstChild.innerHTML='删除';
// this.disabled="disabled"; rp.disabled="disabled";
// this.parentNode.className=cssname+" newitem"; rp.parentNode.className=cssname+" newitem";
// Notify.clear() Notify.clear()
// Notify.success('保存成功'); Notify.success('保存成功');
// rp.parentNode.children[1].lastChild.innerHTML="编辑"; rp.parentNode.children[1].lastChild.innerHTML="编辑";
if(placeholder=='公司'){
// if(placeholder=='公司'){ this.setState({'companyBtn':true});
// this.setState({'companyBtn':true}); }else if(placeholder=='部门'){
// }else if(placeholder=='部门'){ this.setState({'departmentBtn':true});
// this.setState({'departmentBtn':true}); }else if(placeholder=='岗位'){
// }else if(placeholder=='岗位'){ this.setState({'postBtn':true});
// this.setState({'postBtn':true}); }
// } }
// } }
// }
} }
chooseFn(e,disbtn){ chooseFn(e,disbtn){
// let netList=document.querySelectorAll('.'+disbtn); // let netList=document.querySelectorAll('.'+disbtn);