From c3bb4d2a6181e27b58cca56def0f392d6df7d7a1 Mon Sep 17 00:00:00 2001 From: zhujie <693337446@qq.com> Date: 星期五, 26 十一月 2021 13:01:00 +0800 Subject: [PATCH] add 新增导入支持开启Validator数据验证,支持开启导入异常行继续读取,支持返回导入回执 --- ruoyi-ui/src/components/FileUpload/index.vue | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ruoyi-ui/src/components/FileUpload/index.vue b/ruoyi-ui/src/components/FileUpload/index.vue index 244ac28..a5971f2 100644 --- a/ruoyi-ui/src/components/FileUpload/index.vue +++ b/ruoyi-ui/src/components/FileUpload/index.vue @@ -146,9 +146,14 @@ }, // 涓婁紶鎴愬姛鍥炶皟 handleUploadSuccess(res, file) { - this.$message.success("涓婁紶鎴愬姛"); - this.fileList.push({ name: res.data.fileName, url: res.data.fileName }); - this.$emit("input", this.listToString(this.fileList)); + if (res.code === 200) { + this.$message.success("涓婁紶鎴愬姛"); + this.fileList.push({ name: res.data.fileName, url: res.data.url }); + this.$emit("input", this.listToString(this.fileList)); + } else { + this.$message.error(res.msg); + this.loading.close(); + } }, // 鍒犻櫎鏂囦欢 handleDelete(index) { @@ -170,9 +175,9 @@ for (let i in list) { strs += list[i].url + separator; } - return strs != '' ? strs.substr(0, strs.length - 1) : ''; - } - } + return strs != "" ? strs.substr(0, strs.length - 1) : ""; + }, + }, }; </script> -- Gitblit v1.9.3