From a7e16d582d64691a8178de5b6d710acaf0e65a8c Mon Sep 17 00:00:00 2001
From: 若依 <yzz_ivy@163.com>
Date: 星期五, 20 五月 2022 15:56:27 +0800
Subject: [PATCH] !488 修复操作日志列表查询业务类型时的bug Merge pull request !488 from 也曾为你、像超人/N/A
---
ruoyi-ui/src/components/ImageUpload/index.vue | 36 ++++++++++++++++++------------------
1 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/ruoyi-ui/src/components/ImageUpload/index.vue b/ruoyi-ui/src/components/ImageUpload/index.vue
index 978576f..71172c1 100644
--- a/ruoyi-ui/src/components/ImageUpload/index.vue
+++ b/ruoyi-ui/src/components/ImageUpload/index.vue
@@ -1,6 +1,7 @@
<template>
<div class="component-upload-image">
<el-upload
+ multiple
:action="uploadImgUrl"
list-type="picture-card"
:on-success="handleUploadSuccess"
@@ -70,6 +71,8 @@
},
data() {
return {
+ number: 0,
+ uploadList: [],
dialogImageUrl: "",
dialogVisible: false,
hideUpload: false,
@@ -124,9 +127,14 @@
},
// 涓婁紶鎴愬姛鍥炶皟
handleUploadSuccess(res) {
- this.fileList.push({ name: res.fileName, url: res.fileName });
- this.$emit("input", this.listToString(this.fileList));
- this.loading.close();
+ this.uploadList.push({ name: res.fileName, url: res.fileName });
+ if (this.uploadList.length === this.number) {
+ this.fileList = this.fileList.concat(this.uploadList);
+ this.uploadList = [];
+ this.number = 0;
+ this.$emit("input", this.listToString(this.fileList));
+ this.$modal.closeLoading();
+ }
},
// 涓婁紶鍓峫oading鍔犺浇
handleBeforeUpload(file) {
@@ -146,35 +154,27 @@
}
if (!isImg) {
- this.$message.error(
- `鏂囦欢鏍煎紡涓嶆纭�, 璇蜂笂浼�${this.fileType.join("/")}鍥剧墖鏍煎紡鏂囦欢!`
- );
+ this.$modal.msgError(`鏂囦欢鏍煎紡涓嶆纭�, 璇蜂笂浼�${this.fileType.join("/")}鍥剧墖鏍煎紡鏂囦欢!`);
return false;
}
if (this.fileSize) {
const isLt = file.size / 1024 / 1024 < this.fileSize;
if (!isLt) {
- this.$message.error(`涓婁紶澶村儚鍥剧墖澶у皬涓嶈兘瓒呰繃 ${this.fileSize} MB!`);
+ this.$modal.msgError(`涓婁紶澶村儚鍥剧墖澶у皬涓嶈兘瓒呰繃 ${this.fileSize} MB!`);
return false;
}
}
- this.loading = this.$loading({
- lock: true,
- text: "涓婁紶涓�",
- background: "rgba(0, 0, 0, 0.7)",
- });
+ this.$modal.loading("姝e湪涓婁紶鍥剧墖锛岃绋嶅��...");
+ this.number++;
},
// 鏂囦欢涓暟瓒呭嚭
handleExceed() {
- this.$message.error(`涓婁紶鏂囦欢鏁伴噺涓嶈兘瓒呰繃 ${this.limit} 涓�!`);
+ this.$modal.msgError(`涓婁紶鏂囦欢鏁伴噺涓嶈兘瓒呰繃 ${this.limit} 涓�!`);
},
// 涓婁紶澶辫触
handleUploadError() {
- this.$message({
- type: "error",
- message: "涓婁紶澶辫触",
- });
- this.loading.close();
+ this.$modal.msgError("涓婁紶鍥剧墖澶辫触锛岃閲嶈瘯");
+ this.$modal.closeLoading();
},
// 棰勮
handlePictureCardPreview(file) {
--
Gitblit v1.9.3