feat(editor): 精简医疗文书工具栏与悬浮菜单
This commit is contained in:
@@ -18,8 +18,24 @@ const emit = defineEmits<{
|
|||||||
const editorRef = shallowRef<IDomEditor>()
|
const editorRef = shallowRef<IDomEditor>()
|
||||||
const editorMode = 'default'
|
const editorMode = 'default'
|
||||||
|
|
||||||
|
// 医疗文书用不到的工具栏能力直接移除,避免科室误用。
|
||||||
|
// 注意菜单 key:分割线是 divider、表情是 emotion(不是 emoji)。
|
||||||
const toolbarConfig: Partial<IToolbarConfig> = {
|
const toolbarConfig: Partial<IToolbarConfig> = {
|
||||||
excludeKeys: ['group-video', 'fullScreen'],
|
excludeKeys: [
|
||||||
|
'blockquote',
|
||||||
|
'divider',
|
||||||
|
'codeBlock',
|
||||||
|
'insertLink',
|
||||||
|
'emotion',
|
||||||
|
'bgColor',
|
||||||
|
// todo 是 WangEditor 私有的待办列表,导出后能否还原可交互勾选取决于其
|
||||||
|
// elemToHtml/parseHtml 实现(未验证、易随版本变化)。签署勾选统一由
|
||||||
|
// SigningDocumentInteractive 识别的「勾选列表格」承载,保留 todo 只会让
|
||||||
|
// 科室误用它做勾选、导致签署时静默失效。
|
||||||
|
'todo',
|
||||||
|
'group-video',
|
||||||
|
'fullScreen',
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
const editorConfig: Partial<IEditorConfig> = {
|
const editorConfig: Partial<IEditorConfig> = {
|
||||||
@@ -37,6 +53,13 @@ const editorConfig: Partial<IEditorConfig> = {
|
|||||||
|
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
|
// 悬浮菜单独立于工具栏:excludeKeys 管不到它,这里单独去掉「链接」与「背景色」。
|
||||||
|
// hoverbarKeys 按元素类型浅合并,只覆盖 text,图片/表格等其他类型保持默认。
|
||||||
|
hoverbarKeys: {
|
||||||
|
text: {
|
||||||
|
menuKeys: ['headerSelect', 'bulletedList', '|', 'bold', 'through', 'color', 'clearStyle'],
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleCreated(editor: IDomEditor) {
|
function handleCreated(editor: IDomEditor) {
|
||||||
|
|||||||
Reference in New Issue
Block a user