Commit 511aa96f by pangchong

feat: 对比数据渲染

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