Commit 5535a7b3 authored by 张子雨's avatar 张子雨

feat: 修改图片删除问题

parent f8ea63e3
...@@ -129,7 +129,15 @@ export async function getInfo() { ...@@ -129,7 +129,15 @@ export async function getInfo() {
// 删除图片 // 删除图片
function delImg(keyName, e) { function delImg(keyName, e) {
this.setState(state => { this.setState(state => {
state.businessInfo[keyName].splice(e.uid, 1); if (keyName === 'categoryQualificateImage') {
state.businessInfo.categoryQualificateImage.forEach((item, index) => {
if (item.uid === e.uid) {
state.businessInfo.categoryQualificateImage.splice(index, 1);
}
});
} else {
state.businessInfo[keyName].splice(e.uid, 1);
}
return { return {
businessInfo: state.businessInfo, businessInfo: state.businessInfo,
}; };
...@@ -171,6 +179,7 @@ export function uploadPropsFn( ...@@ -171,6 +179,7 @@ export function uploadPropsFn(
}; };
imgList.push(attachment); imgList.push(attachment);
if (imgList.length <= limit) { if (imgList.length <= limit) {
console.log(imgList);
state.businessInfo[keyName] = imgList; state.businessInfo[keyName] = imgList;
} else { } else {
notification.error({ message: `最多只能上传${limit}个文件!` }); notification.error({ message: `最多只能上传${limit}个文件!` });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment