parent
ccd7b52542
commit
8e53971923
4 changed files with 284 additions and 164 deletions
@ -1,82 +1,89 @@ |
||||
export default { |
||||
tabs: true, |
||||
tabsActive: 1, |
||||
column: [{ label: "头像", prop: "avatar",display:false}], |
||||
group: [ |
||||
{ |
||||
label: "个人信息", |
||||
prop: "info", |
||||
column: [ |
||||
{ |
||||
label: "头像", |
||||
type: "upload", |
||||
listType: "picture-img", |
||||
// import website from "../../config/website";
|
||||
import { Message } from 'element-ui'; |
||||
export const userInfoOption = { |
||||
column: [{ |
||||
label: '头像', |
||||
prop: 'avatar', |
||||
type: 'upload', |
||||
listType: 'picture-img', |
||||
propsHttp: { |
||||
res: "data", |
||||
url: "link", |
||||
res: 'data', |
||||
url: 'link', |
||||
}, |
||||
canvasOption: { |
||||
text: " ", |
||||
ratio: 0.1, |
||||
}, |
||||
action: "/api/blade-resource/oss/endpoint/put-file", |
||||
tip: "只能上传jpg/png用户头像,且不超过500kb", |
||||
fileType: 'img',//img/video/audio,
|
||||
accept: 'image/png, image/jpeg', |
||||
action: '/api/blade-resource/oss/endpoint/put-file', |
||||
tip: '只能上传jpg/png用户头像,且不超过500kb', |
||||
span: 12, |
||||
row: true, |
||||
prop: "avatar", |
||||
}, |
||||
{ |
||||
label: "姓名", |
||||
uploadBefore: (file, done, loading) => { |
||||
if (['image/png', 'image/jpeg'].indexOf(file.type) == -1) { |
||||
Message({ |
||||
message: '只能上传jpg/png用户头像', |
||||
type: 'error' |
||||
}); |
||||
loading(); |
||||
} |
||||
else { |
||||
done(); |
||||
} |
||||
} |
||||
}, { |
||||
label: '用户名', |
||||
span: 12, |
||||
row: true, |
||||
prop: "realName", |
||||
}, |
||||
{ |
||||
label: "用户名", |
||||
prop: 'realName' |
||||
}, { |
||||
label: '手机号', |
||||
span: 12, |
||||
row: true, |
||||
prop: "name", |
||||
}, |
||||
{ |
||||
label: "手机号", |
||||
prop: 'phone', |
||||
}, { |
||||
label: '邮箱', |
||||
prop: 'email', |
||||
span: 12, |
||||
row: true, |
||||
prop: "phone", |
||||
}, |
||||
{ |
||||
label: "邮箱", |
||||
prop: "email", |
||||
}] |
||||
} |
||||
export const userPwdOption = { |
||||
column: [{ |
||||
label: '原密码', |
||||
span: 12, |
||||
row: true, |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
label: "修改密码", |
||||
prop: "password", |
||||
column: [ |
||||
{ |
||||
label: "原密码", |
||||
type: 'password', |
||||
prop: 'oldPassword', |
||||
rules: [{ |
||||
required: true, |
||||
message: "请输入原密码", |
||||
trigger: "blur" |
||||
}] |
||||
}, { |
||||
label: '新密码', |
||||
span: 12, |
||||
row: true, |
||||
type: "password", |
||||
prop: "oldPassword", |
||||
}, |
||||
{ |
||||
label: "新密码", |
||||
span: 12, |
||||
row: true, |
||||
type: "password", |
||||
prop: "newPassword", |
||||
}, |
||||
{ |
||||
label: "确认密码", |
||||
type: 'password', |
||||
prop: 'newPassword', |
||||
rules: [{ |
||||
required: true, |
||||
message: "请输入新密码", |
||||
trigger: "blur" |
||||
}] |
||||
}, { |
||||
label: '确认密码', |
||||
span: 12, |
||||
row: true, |
||||
type: "password", |
||||
prop: "newPassword1", |
||||
}, |
||||
], |
||||
}, |
||||
], |
||||
type: 'password', |
||||
prop: 'newPassword1', |
||||
rules: [{ validator: validatePass2, trigger: 'blur' }] |
||||
}] |
||||
} |
||||
|
||||
const validatePass2 = (rule, value, callback) => { |
||||
if (value === '') { |
||||
callback(new Error('请再次输入密码')); |
||||
} else if (value !== this.obj.password) { |
||||
callback(new Error('两次输入密码不一致!')); |
||||
} else { |
||||
callback(); |
||||
} |
||||
}; |
||||
Loading…
Reference in new issue