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

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: {
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) {
const value = row[col.key]

View File

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