修改上传按钮禁用逻辑

This commit is contained in:
zhujiyan
2024-07-24 14:51:51 +08:00
parent 992e5bb5aa
commit 313a5b7ae2

View File

@@ -9,11 +9,17 @@
@click="handleUpload" @click="handleUpload"
:loading="loading" :loading="loading"
size="small" size="small"
:disabled="disableHandleUpload" :disabled="offLineFileList.length == 0 || disableHandleUpload"
> >
开始上传 开始上传
</el-button> </el-button>
<el-button type="primary" @click="removeAllFile" size="small" :loading="loading" :disabled="offLineFileList.length == 0"> <el-button
type="primary"
@click="removeAllFile"
size="small"
:loading="loading"
:disabled="offLineFileList.length == 0"
>
清空文件 清空文件
</el-button> </el-button>
</div> </div>
@@ -101,13 +107,12 @@ const submitUpload = e => {
offLineFileList.value.map((item: any) => { offLineFileList.value.map((item: any) => {
item.status = 0 item.status = 0
}) })
}
disableHandleUpload.value = false disableHandleUpload.value = false
} }
}
//清空文件 //清空文件
const removeAllFile = () => { const removeAllFile = () => {
offLineFileList.value = [] offLineFileList.value = []
disableHandleUpload.value = true
} }
//移除文件 //移除文件
const removeFile = async (file: any) => { const removeFile = async (file: any) => {
@@ -138,6 +143,7 @@ const handleUpload = () => {
}) })
// 操作数据后更新视图 // 操作数据后更新视图
updateKey.value += 1 updateKey.value += 1
disableHandleUpload.value = true
// return; // return;
uploadOffLineDataFile(subForm).then(res => { uploadOffLineDataFile(subForm).then(res => {
if (res.code == 'A0000') { if (res.code == 'A0000') {