Commit f221646c authored by 张子雨's avatar 张子雨

Merge branch 'feat/constructionOne' into feature/20230327_public_takeaway

* feat/constructionOne:
  feat: 优化
  feat: 修改图片删除问题
parents e294bd8b b6432a74
...@@ -53,7 +53,7 @@ export async function getInfo() { ...@@ -53,7 +53,7 @@ export async function getInfo() {
res.customList = res.facilities.customList || []; res.customList = res.facilities.customList || [];
res.selfList = res.facilities.selfList || []; res.selfList = res.facilities.selfList || [];
} }
res.signDateType = [res.signDateType] || []; res.signDateType = res.signDateType ? [res.signDateType] : [];
res.accountOpenPermitImage = res.accountOpenPermitImage res.accountOpenPermitImage = res.accountOpenPermitImage
? [{ uid: 0, url: res.accountOpenPermitImage }] ? [{ uid: 0, url: res.accountOpenPermitImage }]
: []; : [];
...@@ -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 => {
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); 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