From b74724084e79d851615cb5df4ec54e74c7da0316 Mon Sep 17 00:00:00 2001
From: Jason <5340635+wen-jason@user.noreply.gitee.com>
Date: Thu, 29 Sep 2022 10:16:59 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AF=8C=E6=96=87=E6=9C=AC=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
admin/src/components/editor/index.vue | 32 ++++++++++++++++++---------
1 file changed, 21 insertions(+), 11 deletions(-)
diff --git a/admin/src/components/editor/index.vue b/admin/src/components/editor/index.vue
index 831bbcd3..badcd467 100644
--- a/admin/src/components/editor/index.vue
+++ b/admin/src/components/editor/index.vue
@@ -15,9 +15,10 @@
/>
@@ -42,9 +43,7 @@ const props = withDefaults(
mode: 'default',
height: '100%',
width: 'auto',
- toolbarConfig: () => ({
- excludeKeys: ['fullScreen']
- })
+ toolbarConfig: () => ({})
}
)
@@ -55,16 +54,24 @@ const emit = defineEmits<{
// 编辑器实例,必须用 shallowRef
const editorRef = shallowRef()
const materialPickerRef = shallowRef>()
+const fileType = ref('')
-let insertImageFn: any
+let insertFn: any
const editorConfig: Partial = {
MENU_CONF: {
uploadImage: {
- customBrowseAndUpload(insertFn: any) {
- console.log(insertFn)
+ customBrowseAndUpload(insert: any) {
+ fileType.value = 'image'
materialPickerRef.value?.showPopup(-1)
- insertImageFn = insertFn
+ insertFn = insert
+ }
+ },
+ uploadVideo: {
+ customBrowseAndUpload(insert: any) {
+ fileType.value = 'video'
+ materialPickerRef.value?.showPopup(-1)
+ insertFn = insert
}
}
}
@@ -83,9 +90,9 @@ const valueHtml = computed({
}
})
-const imageSelectChange = (image: string[]) => {
- image.forEach((url) => {
- insertImageFn(url)
+const selectChange = (fileUrl: string[]) => {
+ fileUrl.forEach((url) => {
+ insertFn(url)
})
}
@@ -102,6 +109,9 @@ const handleCreated = (editor: any) => {