拓扑图配置

This commit is contained in:
仲么了
2024-01-17 14:22:34 +08:00
parent 0068eace86
commit 694b5b181d
15 changed files with 395 additions and 79 deletions

View File

@@ -1,17 +1,17 @@
<template>
<div style='border: 1px solid #ccc'>
<div style='border: 1px solid #e4e4e4;height: 100%'>
<Toolbar
style='border-bottom: 1px solid #ccc'
style='border-bottom: 1px solid #e4e4e4'
:editor='editorRef'
:defaultConfig='toolbarConfig'
mode='default'
/>
<Editor
style='height: 500px; overflow-y: hidden;'
v-model='valueHtml'
v-bind='$attrs'
:defaultConfig='editorConfig'
mode='default'
@onCreated='handleCreated'
style='height: calc(100% - 42px); '
/>
</div>
</template>
@@ -33,8 +33,32 @@ onMounted(() => {
}, 1500)
})
const toolbarConfig = {}
const editorConfig = { placeholder: '请输入内容...' }
const toolbarConfig = {
excludeKeys: ['fullScreen', 'emotion']
}
let sever = '/cs-harmonic-boot/csconfiguration/uploadImage'
// 本地加api
if (process.env.NODE_ENV === 'development') {
sever = '/api' + sever
}
const editorConfig = {
placeholder: '请输入内容...',
MENU_CONF: {
uploadImage: {
server: sever,
fieldName: 'file',
compress: true,
uploadFileName: 'file',
withCredentials: true,
headers: {},
timeout: 0,
customInsert: (insertImg, result, editor) => {
const url = result.data.url
insertImg(url)
}
}
}
}
// 组件销毁时,也及时销毁编辑器
onBeforeUnmount(() => {