From 20e29bbb079030970c74dc32c445390045a8e952 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=90=95=E9=87=91=E6=B3=BD?= <1098696801@qq.com>
Date: Fri, 5 Aug 2022 19:13:27 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BB=84=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/magic/data/mb-table-column.vue | 5 +-
.../src/components/magic/form/mb-select.vue | 2 +-
.../src/components/magic/form/mb-switch.vue | 48 +++++++++++--------
.../components/magic/form/mb-upload-image.vue | 13 ++++-
4 files changed, 42 insertions(+), 26 deletions(-)
diff --git a/magic-boot-ui/src/components/magic/data/mb-table-column.vue b/magic-boot-ui/src/components/magic/data/mb-table-column.vue
index 07ec02c..a0cc3f0 100644
--- a/magic-boot-ui/src/components/magic/data/mb-table-column.vue
+++ b/magic-boot-ui/src/components/magic/data/mb-table-column.vue
@@ -19,8 +19,8 @@
@@ -40,6 +40,7 @@
下载
diff --git a/magic-boot-ui/src/components/magic/form/mb-select.vue b/magic-boot-ui/src/components/magic/form/mb-select.vue
index 0d3973c..93d8d40 100644
--- a/magic-boot-ui/src/components/magic/form/mb-select.vue
+++ b/magic-boot-ui/src/components/magic/form/mb-select.vue
@@ -108,7 +108,7 @@ function setValue(value){
if(props.multiple && props.join){
selectValue.value = value ? value.split(',') : []
}else{
- selectValue.value = value ? value.toString() : ''
+ selectValue.value = value || value === 0 ? value.toString() : ''
}
}
diff --git a/magic-boot-ui/src/components/magic/form/mb-switch.vue b/magic-boot-ui/src/components/magic/form/mb-switch.vue
index 4bf79c6..df1a7ab 100644
--- a/magic-boot-ui/src/components/magic/form/mb-switch.vue
+++ b/magic-boot-ui/src/components/magic/form/mb-switch.vue
@@ -1,31 +1,37 @@
diff --git a/magic-boot-ui/src/components/magic/form/mb-upload-image.vue b/magic-boot-ui/src/components/magic/form/mb-upload-image.vue
index 3c74580..3c94f16 100644
--- a/magic-boot-ui/src/components/magic/form/mb-upload-image.vue
+++ b/magic-boot-ui/src/components/magic/form/mb-upload-image.vue
@@ -43,9 +43,12 @@
:show-file-list="false"
:multiple="multiple"
:limit="limit"
- :on-success="handleAvatarSuccess"
+ :on-success="onSuccess"
+ :on-error="onError"
+ :before-upload="beforeUpload"
:on-exceed="onExceed"
:file-list="fileList"
+ :disabled="isUploading"
>
@@ -238,7 +241,13 @@ export default {
handleDownload(file) {
console.log(file)
},
- handleAvatarSuccess(res, file, fileList) {
+ beforeUpload(){
+ this.isUploading = true
+ },
+ onError(){
+ this.isUploading = true
+ },
+ onSuccess(res, file, fileList) {
console.log(res)
this.fileList = fileList
if (res.data) {