Commit 71a3429e authored by tyyin lan's avatar tyyin lan

fix: 编辑器指令编辑插入内容失去格式

parent a5cf8520
...@@ -149,7 +149,11 @@ function handleInsertContent() { ...@@ -149,7 +149,11 @@ function handleInsertContent() {
if (editor) { if (editor) {
editor.selection.collapse() editor.selection.collapse()
editor.execCommand('mceInsertNewLine') editor.execCommand('mceInsertNewLine')
editor.execCommand('InsertHTML', false, editResponseContent.value) editor.execCommand(
'InsertHTML',
false,
contentOptimizationEditMRRef.value?.getRenderTextContent() || editResponseContent.value,
)
editor.execCommand('mceInsertNewLine') editor.execCommand('mceInsertNewLine')
contentEditStatus.value = 'Normal' contentEditStatus.value = 'Normal'
...@@ -286,7 +290,7 @@ function toneSelectMenuRenderOption({ node, option }: { node: VNode; option: Dro ...@@ -286,7 +290,7 @@ function toneSelectMenuRenderOption({ node, option }: { node: VNode; option: Dro
</div> </div>
<Transition> <Transition>
<div v-show="editResponseLoading" class="flex select-none items-center justify-between"> <div v-show="editResponseLoading" class="flex select-none items-center justify-between pr-[10px]">
<span> <span>
<template v-if="!editResponseContent">生成中...</template> <template v-if="!editResponseContent">生成中...</template>
</span> </span>
...@@ -298,7 +302,7 @@ function toneSelectMenuRenderOption({ node, option }: { node: VNode; option: Dro ...@@ -298,7 +302,7 @@ function toneSelectMenuRenderOption({ node, option }: { node: VNode; option: Dro
</Transition> </Transition>
<Transition> <Transition>
<div v-show="isShowReplaceToolbar" class="mt-[9px]"> <div v-show="isShowReplaceToolbar" class="mt-[9px] pr-[10px]">
<n-button type="primary" size="small" @click="handleReplaceContent" <n-button type="primary" size="small" @click="handleReplaceContent"
>替换 >替换
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment