diff --git a/Api/Ewide.Core/applicationconfig.json b/Api/Ewide.Core/applicationconfig.json index 1568099..0266d1e 100644 --- a/Api/Ewide.Core/applicationconfig.json +++ b/Api/Ewide.Core/applicationconfig.json @@ -93,6 +93,7 @@ "sysDictType:dropDowns", "sysFileInfo:upload", "sysFileInfo:download", + "sysFileInfo:detail", "sysFileInfo:preview", "sysUser:updateInfo", "sysUser:updatePwd", diff --git a/Web/src/pages/business/house/info/form/base/aspect.vue b/Web/src/pages/business/house/info/form/base/aspect.vue index 878c07e..90ae890 100644 --- a/Web/src/pages/business/house/info/form/base/aspect.vue +++ b/Web/src/pages/business/house/info/form/base/aspect.vue @@ -104,15 +104,25 @@ export default { if (record) { const fileList = !!record.houseInfo.facadePhoto ? record.houseInfo.facadePhoto.split(',') : []; for (let i = 0; i < fileList.length; i++) { - const file = await PreviewFile(fileList[i]); - const base64 = await BlobToBase64(file); - facadePhoto.push({ - uid: fileList[i], - response: fileList[i], // 用于和新上传的文件一同回传 - name: file.name, - url: base64, - status: 'done', - }); + try { + const file = await PreviewFile(fileList[i]); + const base64 = await BlobToBase64(file); + facadePhoto.push({ + uid: fileList[i], + response: fileList[i], // 用于和新上传的文件一同回传 + name: file.name, + url: base64, + status: 'done', + }); + } catch { + const { data: file } = await this.$api.sysFileInfoDetail({ id: fileList[i] }); + facadePhoto.push({ + uid: fileList[i], + response: '文件已丢失', + name: file.fileOriginName, + status: 'error', + }); + } } } defaultForm.houseInfo.facadePhoto = facadePhoto; diff --git a/Web/src/pages/business/house/info/form/base/attachments.vue b/Web/src/pages/business/house/info/form/base/attachments.vue index db16ab8..69162a5 100644 --- a/Web/src/pages/business/house/info/form/base/attachments.vue +++ b/Web/src/pages/business/house/info/form/base/attachments.vue @@ -173,15 +173,25 @@ export default { const fileList = !form.houseInfo[key] || form.houseInfo[key].length == 0 ? [] : form.houseInfo[key].split(','); for (let i = 0; i < fileList.length; i++) { - const file = await PreviewFile(fileList[i]); - const base64 = await BlobToBase64(file); - fileValue.push({ - uid: fileList[i], - response: fileList[i], // 用于和新上传的文件一同回传 - name: file.name, - url: base64, - status: 'done', - }); + try { + const file = await PreviewFile(fileList[i]); + const base64 = await BlobToBase64(file); + fileValue.push({ + uid: fileList[i], + response: fileList[i], // 用于和新上传的文件一同回传 + name: file.name, + url: base64, + status: 'done', + }); + } catch { + const { data: file } = await this.$api.sysFileInfoDetail({ id: fileList[i] }); + fileValue.push({ + uid: fileList[i], + response: '文件已丢失', + name: file.fileOriginName, + status: 'error', + }); + } } form.houseInfo[key] = fileValue; } diff --git a/web-react/public/seed/form-tabs/index.jsx b/web-react/public/seed/form-tabs/index.jsx index eb0a9c4..3cd7e70 100644 --- a/web-react/public/seed/form-tabs/index.jsx +++ b/web-react/public/seed/form-tabs/index.jsx @@ -16,6 +16,7 @@ export default class index extends Component { actived: '0', loading: true, record: null, + saveDisabled: true, saving: false, } @@ -42,6 +43,16 @@ export default class index extends Component { */ componentDidMount() {} + /** + * 接收到所有子组件已加载完成,并启用提交按钮 + */ + call(child, index) { + this.children[index] = child + if (this.children.filter(p => p).length === tabs.filter(p => p.show).length) { + this.setState({ saveDisabled: false }) + } + } + async onSubmit() { for (const child of this.children) { try { @@ -62,7 +73,7 @@ export default class index extends Component { } render() { - const { actived, loading, record, saving } = this.state + const { actived, loading, record, saveDisabled, saving } = this.state return (