From 404cb4c7a6c8ef6c8ad53893e92b623e4e5e6ed3 Mon Sep 17 00:00:00 2001
From: konbai <1527468660@qq.com>
Date: 星期日, 16 一月 2022 01:06:51 +0800
Subject: [PATCH] fix 重命名通用 数据权限 服务接口类名称,与其他服务接口风格统一
---
ruoyi-ui/src/components/ImageUpload/index.vue | 27 +++++++++++++++++----------
1 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/ruoyi-ui/src/components/ImageUpload/index.vue b/ruoyi-ui/src/components/ImageUpload/index.vue
index e074b38..fcf010d 100644
--- a/ruoyi-ui/src/components/ImageUpload/index.vue
+++ b/ruoyi-ui/src/components/ImageUpload/index.vue
@@ -18,7 +18,7 @@
>
<i class="el-icon-plus"></i>
</el-upload>
-
+
<!-- 涓婁紶鎻愮ず -->
<div class="el-upload__tip" slot="tip" v-if="showTip">
璇蜂笂浼�
@@ -113,14 +113,21 @@
// 鍒犻櫎鍥剧墖
handleRemove(file, fileList) {
const findex = this.fileList.map(f => f.name).indexOf(file.name);
- this.fileList.splice(findex, 1);
- this.$emit("input", this.listToString(this.fileList));
+ if(findex > -1) {
+ this.fileList.splice(findex, 1);
+ this.$emit("input", this.listToString(this.fileList));
+ }
},
// 涓婁紶鎴愬姛鍥炶皟
handleUploadSuccess(res) {
- this.fileList.push({ name: res.data.fileName, url: res.data.url });
- this.$emit("input", this.listToString(this.fileList));
- this.loading.close();
+ if (res.code == 200) {
+ this.fileList.push({ name: res.data.fileName, url: res.data.url });
+ this.$emit("input", this.listToString(this.fileList));
+ this.loading.close();
+ } else {
+ this.$message.error(res.msg);
+ this.loading.close();
+ }
},
// 涓婁紶鍓峫oading鍔犺浇
handleBeforeUpload(file) {
@@ -130,7 +137,7 @@
if (file.name.lastIndexOf(".") > -1) {
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
}
- isImg = this.fileType.some(type => {
+ isImg = this.fileType.some((type) => {
if (file.type.indexOf(type) > -1) return true;
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
return false;
@@ -163,7 +170,7 @@
this.$message.error(`涓婁紶鏂囦欢鏁伴噺涓嶈兘瓒呰繃 ${this.limit} 涓�!`);
},
// 涓婁紶澶辫触
- handleUploadError() {
+ handleUploadError(res) {
this.$message({
type: "error",
message: "涓婁紶澶辫触",
@@ -199,8 +206,8 @@
}
::v-deep .el-list-enter, .el-list-leave-active {
- opacity: 0;
- transform: translateY(0);
+ opacity: 0;
+ transform: translateY(0);
}
</style>
--
Gitblit v1.9.3