优化: 添加用户头像剪切图片

pull/52/MERGE
李强 2022-04-26 08:13:55 +08:00
parent add1f3a47b
commit b84a1d1aee
2 changed files with 4 additions and 19 deletions

View File

@ -92,21 +92,6 @@ export default {
view: { view: {
component: { props: { height: 100, width: 100 } } component: { props: { height: 100, width: 100 } }
}, },
// 提交时,处理数据
valueResolve (row, col) {
const value = row[col.key]
if (value != null) {
if (value.length >= 0) {
if (value instanceof Array) {
row[col.key] = value.toString()
} else {
row[col.key] = value[0]
}
} else {
row[col.key] = null
}
}
},
// 接收时,处理数据 // 接收时,处理数据
valueBuilder (row, col) { valueBuilder (row, col) {
const value = row[col.key] const value = row[col.key]

View File

@ -40,7 +40,7 @@ export const crudOptions = (vm) => {
text: '', text: '',
size: 'small', size: 'small',
type: 'warning', type: 'warning',
icon: 'el-icon-refresh-left', icon: 'el-icon-key',
show () { show () {
return vm.hasPermissions('ResetPwd') return vm.hasPermissions('ResetPwd')
}, },
@ -256,15 +256,15 @@ export const crudOptions = (vm) => {
{ {
title: '头像', title: '头像',
key: 'avatar', key: 'avatar',
type: 'avatar-uploader', type: 'avatar-cropper',
width: 100, width: 100,
align: 'left', align: 'left',
form: { form: {
component: { component: {
props: { props: {
elProps: { // 与el-uploader 配置一致 elProps: { // 与el-uploader 配置一致
multiple: true, multiple: false,
limit: 5 // 限制5个文件 limit: 1 // 限制5个文件
}, },
sizeLimit: 500 * 1024 // 不能超过限制 sizeLimit: 500 * 1024 // 不能超过限制
}, },