Commit 511aa96f by pangchong

feat: 对比数据渲染

parent c6cc39f5
......@@ -9,7 +9,7 @@
<CEP>
<EFFECT EFFRG="001999"></EFFECT>
<TITLEC>发动机QEC拆卸(V2500-A5系列)</TITLEC>
<TITLE>Remove the Engine's QEC(V2500-A5 series)</TITLE>
<TITLE>Remove the Engine's QEC(V2500-A series)</TITLE>
<TOPIC CK-LEVEL="C">
<TITLEC>飞机/发动机基本信息</TITLEC>
<TITLE>AIRCRAFT/ENGINE INFORMATION</TITLE>
......
......@@ -87,7 +87,6 @@ const message = useMessage()
const editorConfig = computed((): IEditorConfig => {
return Object.assign(
{
placeholder: '请输入内容...',
readOnly: ps.readonly,
customAlert: (s: string, t: string) => {
switch (t) {
......
......@@ -10,14 +10,14 @@
<div class="flex h-full">
<GlobalEditor
ref="compareLeftRef"
v-model="editorHtml"
v-model="compareLeftData"
editorId="compareLeft"
:editorConfig="{ readOnly: true }"
@handleScrollTop="handleScrollTopLeft"
/>
<GlobalEditor
ref="compareRightRef"
v-model="editorHtml"
v-model="compareRightData"
editorId="compareRight"
:editorConfig="{ readOnly: true }"
@handleScrollTop="handleScrollTopRight"
......@@ -27,8 +27,7 @@
</template>
<script setup lang="ts">
import { editorHtml } from '../constants'
import { showCompare, compareLeftRef, compareRightRef } from '../constants/compare'
import { showCompare, compareLeftRef, compareRightRef, compareLeftData, compareRightData } from '../constants/compare'
import { handleScrollTopLeft, handleScrollTopRight } from '../functions/compare'
</script>
<style lang="less" scoped></style>
export const showCompare = ref(false)
export const compareLeftRef = ref()
export const compareRightRef = ref()
export const compareLeftData = ref('')
export const compareRightData = ref('')
import { showLoading } from '../constants'
import { nodeSet } from '@/configs/node.config'
import { IDomEditor } from '@wangeditor/editor'
import { treeData, treeRef, treeSelectedKeys } from '../constants/tree'
import { dropdownConfig, editorRef, editorHtml } from '../constants'
import { getUUID } from '@/utils'
import { showCompare } from '../constants/compare'
import { compareLeftData, compareRightData, showCompare } from '../constants/compare'
import TextA from '@/assets/file/CES-QEC-V250-A.xml?raw'
import TextB from '@/assets/file/Trans-Convert.xml?raw'
import { nodeSet } from '@/configs/node.config'
export const handleCreated = (editor: IDomEditor) => {
editorRef.value = editor
......@@ -96,4 +98,9 @@ export const uploadXml = async () => {
//xml对比
export const compareXml = () => {
showCompare.value = true
const xmlProcessing = useXMLProcessing()
const res = xmlProcessing.dualCompareFromString(TextA, TextB, nodeSet)
console.log(res)
compareLeftData.value = res.xmlContentOld
compareRightData.value = res.xmlContentNew
}
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