联调案例库

修改干扰源用户台账流程
This commit is contained in:
GGJ
2024-09-12 16:15:14 +08:00
parent 33d7304c54
commit 2b22943a1e
4 changed files with 88 additions and 62 deletions

View File

@@ -1,21 +1,21 @@
<template>
<div style='border: 1px solid #e4e4e4;height: 100%'>
<div style="border: 1px solid #e4e4e4; height: 100%">
<Toolbar
style='border-bottom: 1px solid #e4e4e4;border-top: 1px solid #e4e4e4'
:editor='editorRef'
:defaultConfig='toolbarConfig'
mode='default'
style="border-bottom: 1px solid #e4e4e4; border-top: 1px solid #e4e4e4"
:editor="editorRef"
:defaultConfig="toolbarConfig"
mode="default"
/>
<Editor
v-bind='$attrs'
:defaultConfig='editorConfig'
mode='default'
@onCreated='handleCreated'
style='height: calc(100% - 42px); '
v-bind="$attrs"
:defaultConfig="editorConfig"
mode="default"
@onCreated="handleCreated"
style="height: calc(100% - 42px)"
/>
</div>
</template>
<script lang='ts' setup>
<script lang="ts" setup>
import '@wangeditor/editor/dist/css/style.css' // 引入 css
import { onBeforeUnmount, ref, shallowRef, onMounted } from 'vue'
@@ -36,11 +36,12 @@ onMounted(() => {
const toolbarConfig = {
excludeKeys: ['fullScreen', 'emotion']
}
let sever = '/cs-harmonic-boot/csconfiguration/uploadImage'
let sever = '/system-boot/file/upload'
// 本地加api
if (process.env.NODE_ENV === 'development') {
sever = '/api' + sever
}
type InsertFnType = (url: string, alt: string, href: string) => void
const editorConfig = {
placeholder: '请输入内容...',
MENU_CONF: {
@@ -51,10 +52,11 @@ const editorConfig = {
uploadFileName: 'file',
withCredentials: true,
headers: {},
meta: { path: '/supervision/' },
timeout: 0,
customInsert: (insertImg, result, editor) => {
const url = result.data.url
insertImg(url)
customInsert(res: any, insertFn: InsertFnType) {
console.log('🚀 ~ customInsert ~ res:', res)
insertFn(res.data.url, 'image', res.data.url)
}
}
}
@@ -67,8 +69,7 @@ onBeforeUnmount(() => {
editor.destroy()
})
const handleCreated = (editor) => {
const handleCreated = editor => {
editorRef.value = editor // 记录 editor 实例,重要!
}
</script>
</script>