This commit is contained in:
lcw
2025-09-03 14:43:40 +08:00
parent 1c6bbffc3b
commit 24c6a24a4f
6 changed files with 450 additions and 29 deletions

View File

@ -7,7 +7,8 @@
<Editor :style="`height: ${props.heightNumber}px; overflow-y: hidden`" v-model="textContent" :defaultConfig="editorConfig" :mode="mode" @onCreated="handleCreated" @onChange="handChange" />
</div>
<template #footer>
<!-- <el-button type="primary"></el-button> -->
<el-button type="primary" @click="SaveReport"></el-button>
<!-- <el-button type="primary" @click="downloadWithStyles">历史报告</el-button> -->
<el-button type="primary" @click="downloadWithStyles">下载</el-button>
<el-button type="primary" @click="close">取消</el-button>
</template>
@ -47,7 +48,7 @@ const mode = "default";
const toolbarConfig = {
excludeKeys: ["blockquote", "codeBlock"] //清除不必要的工具,引用和代码块
};
const emits = defineEmits(["update:textContent", "changeFn","update:modelValue"]);
const emits = defineEmits(["update:textContent", "changeFn","update:modelValue","SaveReport"]);
//编辑器配置
const editorConfig = {
withCredentials: true, //允许跨域
@ -122,6 +123,9 @@ const downloadWithStyles = () => {
saveAs(blob, 'styled-document.doc');
};
const SaveReport = () => {
emits("SaveReport",props.textContent)
}
</script>
<style lang="scss" scoped>