From fb66f0c1054cd3a21ddea76b3dbf7fcbb8bdb536 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=90=95=E9=87=91=E6=B3=BD?= <1098696801@qq.com>
Date: Sun, 15 May 2022 18:07:30 +0800
Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E4=BB=B6=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/components/magic/basic/mb-icon.vue | 7 +++---
.../src/components/magic/data/mb-tree.vue | 2 +-
.../components/magic/form/mb-upload-file.vue | 24 +++++++++++++++----
.../components/magic/form/mb-upload-image.vue | 22 +++++++++++++----
.../src/components/magic/template/mb-list.vue | 5 +++-
.../src/views/examples/test-mb-form.vue | 11 ++++++++-
.../src/views/examples/upload-file.vue | 9 ++++---
.../src/views/system/menu/menu-list.vue | 4 ++--
.../src/views/system/office/office-list.vue | 2 +-
.../org/ssssssss/magicboot/model/Global.java | 2 +-
magic-boot/src/main/resources/application.yml | 12 ++--------
11 files changed, 67 insertions(+), 33 deletions(-)
diff --git a/magic-boot-ui/src/components/magic/basic/mb-icon.vue b/magic-boot-ui/src/components/magic/basic/mb-icon.vue
index 541125b..064946e 100644
--- a/magic-boot-ui/src/components/magic/basic/mb-icon.vue
+++ b/magic-boot-ui/src/components/magic/basic/mb-icon.vue
@@ -10,18 +10,17 @@ const props = defineProps({
type: String,
default: 'mb-icon'
},
- icon: String,
- size: String,
+ icon: String
});
const symbolId = computed(() => props.icon&&props.icon.startsWith('#') ? props.icon : `#${props.prefix}-${props.icon}`)
const className = computed(() => props.icon&&props.icon.startsWith('#') ? props.icon.substring(1) : `${props.prefix}-${props.icon}`)
\ No newline at end of file
+
diff --git a/magic-boot-ui/src/components/magic/data/mb-tree.vue b/magic-boot-ui/src/components/magic/data/mb-tree.vue
index 67657e5..77a28be 100644
--- a/magic-boot-ui/src/components/magic/data/mb-tree.vue
+++ b/magic-boot-ui/src/components/magic/data/mb-tree.vue
@@ -29,7 +29,7 @@ import { watch, ref, reactive, defineExpose, nextTick, getCurrentInstance, onBef
const { proxy } = getCurrentInstance()
-const emit = defineEmits(['update:modelValue', 'check-change', 'node-click', 'mounted'])
+const emit = defineEmits(['update:modelValue', 'check-change', 'node-click'])
const props = defineProps({
url: {
diff --git a/magic-boot-ui/src/components/magic/form/mb-upload-file.vue b/magic-boot-ui/src/components/magic/form/mb-upload-file.vue
index b03595a..3e2d038 100644
--- a/magic-boot-ui/src/components/magic/form/mb-upload-file.vue
+++ b/magic-boot-ui/src/components/magic/form/mb-upload-file.vue
@@ -85,6 +85,10 @@ export default {
showRemoveTip: {
type: Boolean,
default: () => true
+ },
+ join: {
+ type: Boolean,
+ default: true
}
},
data() {
@@ -172,8 +176,13 @@ export default {
}
})
if (this.multiple) {
- this.$emit('update:modelValue', this.urls)
- this.$emit('change', this.urls)
+ if(this.join){
+ this.$emit('update:modelValue', this.urls.join(','))
+ this.$emit('change', this.urls.join(','))
+ }else{
+ this.$emit('update:modelValue', this.urls)
+ this.$emit('change', this.urls)
+ }
} else {
document.getElementById(this.uploadDomId).getElementsByClassName('el-upload__input')[0].removeAttribute('disabled')
this.$emit('update:modelValue', '')
@@ -196,10 +205,15 @@ export default {
handleAvatarSuccess(res, file, fileList) {
this.uploadLoading = false
if (res.data) {
+ this.urls.push(res.data.url)
if (this.multiple) {
- this.urls.push(res.data.url)
- this.$emit('update:modelValue', this.urls)
- this.$emit('change', this.urls)
+ if(this.join){
+ this.$emit('update:modelValue', this.urls.join(','))
+ this.$emit('change', this.urls.join(','))
+ }else{
+ this.$emit('update:modelValue', this.urls)
+ this.$emit('change', this.urls)
+ }
} else {
document.getElementById(this.uploadDomId).getElementsByClassName('el-upload__input')[0].setAttribute('disabled', '')
this.$emit('update:modelValue', res.data.url)
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 12b83ad..567d73a 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
@@ -133,6 +133,10 @@ export default {
tipColor: {
type: String,
default: ''
+ },
+ join: {
+ type: Boolean,
+ default: true
}
},
data() {
@@ -200,8 +204,13 @@ export default {
})
this.$delete('/system/file/delete', { url: encodeURI(url) })
if (this.multiple) {
- this.$emit('update:modelValue', this.urls)
- this.$emit('change', this.urls)
+ if(this.join){
+ this.$emit('update:modelValue', this.urls.join(','))
+ this.$emit('change', this.urls.join(','))
+ }else{
+ this.$emit('update:modelValue', this.urls)
+ this.$emit('change', this.urls)
+ }
} else {
this.$emit('update:modelValue', '')
this.$emit('change', '')
@@ -221,8 +230,13 @@ export default {
this.urls.push(res.data.url)
// console.log(this.urls)
if (this.multiple) {
- this.$emit('update:modelValue', this.urls)
- this.$emit('change', this.urls)
+ if(this.join){
+ this.$emit('update:modelValue', this.urls.join(','))
+ this.$emit('change', this.urls.join(','))
+ }else{
+ this.$emit('update:modelValue', this.urls)
+ this.$emit('change', this.urls)
+ }
} else {
this.$emit('update:modelValue', res.data.url)
this.$emit('change', res.data.url)
diff --git a/magic-boot-ui/src/components/magic/template/mb-list.vue b/magic-boot-ui/src/components/magic/template/mb-list.vue
index 29024d5..1340b7f 100644
--- a/magic-boot-ui/src/components/magic/template/mb-list.vue
+++ b/magic-boot-ui/src/components/magic/template/mb-list.vue
@@ -8,7 +8,10 @@