Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vue3_onlineEditor
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pangchong
vue3_onlineEditor
Commits
069fecb9
Commit
069fecb9
authored
Apr 02, 2025
by
pangchong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 修改对比问题
parent
0864d8c4
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
25 deletions
+48
-25
src/assets/file/Trans-Convert.xml
+10
-10
src/configs/render-elem.ts
+18
-1
src/views/editor/components/Compare.vue
+2
-2
src/views/editor/constants/compare.ts
+1
-0
src/views/editor/constants/index.ts
+0
-11
src/views/editor/functions/compare.ts
+17
-1
No files found.
src/assets/file/Trans-Convert.xml
View file @
069fecb9
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<!--Arbortext, Inc., 1988-2013, v.4002-->
<!--Arbortext, Inc., 1988-2013, v.4002-->
<!DOCTYPE JOBCARD PUBLIC "-//CEA-TEXT//DTD JOBCARD-VER1//EN" "JOBCARD.dtd" [
<!DOCTYPE JOBCARD PUBLIC "-//CEA-TEXT//DTD JOBCARD-VER1//EN" "JOBCARD.dtd" [
<!ENTITY nbsp " ">
<!ENTITY nbsp " ">
<!ENTITY rsquo "’">
<!ENTITY rsquo "’">
]>
]>
<JOBCARD>
<JOBCARD>
<EOTK-HEADER></EOTK-HEADER>
<EOTK-HEADER></EOTK-HEADER>
...
@@ -17,15 +17,15 @@
...
@@ -17,15 +17,15 @@
<TITLE>
AIRCRAFT/ENGINE INFORMATION
</TITLE>
<TITLE>
AIRCRAFT/ENGINE INFORMATION
</TITLE>
<STEP
CK-LEVEL=
"C"
>
<STEP
CK-LEVEL=
"C"
>
<EFFECT
EFFRG=
"001999"
></EFFECT>
<EFFECT
EFFRG=
"001999"
></EFFECT>
<!-- <RECORD-LINE>--
>
<RECORD-LINE
>
<!-- <PARAC>发动机序号</PARAC>--
>
<PARAC>
发动机序号
</PARAC
>
<!-- <PARA>Engine SN</PARA>--
>
<PARA>
Engine SN
</PARA
>
<!-- <RECORD></RECORD>--
>
<RECORD></RECORD
>
<!-- </RECORD-LINE>--
>
</RECORD-LINE
>
<!-- <NOTE>--
>
<NOTE
>
<!-- <PARAC>开始工作前请记录。</PARAC>--
>
<PARAC>
开始工作前请记录。
</PARAC
>
<!-- <PARA>Please record before starting work.</PARA>--
>
<PARA>
Please record before starting work.
</PARA
>
<!-- </NOTE>--
>
</NOTE
>
<SIGNOFF/>
<SIGNOFF/>
</STEP>
</STEP>
</TOPIC>
</TOPIC>
...
...
src/configs/render-elem.ts
View file @
069fecb9
import
{
h
,
VNode
}
from
'snabbdom'
import
{
h
,
VNode
}
from
'snabbdom'
import
{
IDomEditor
,
IModuleConf
,
SlateElement
}
from
'@wangeditor/editor'
import
{
IDomEditor
,
IModuleConf
,
SlateElement
}
from
'@wangeditor/editor'
import
{
nodeSet
}
from
'@/configs/node.config'
import
{
nodeSet
}
from
'@/configs/node.config'
import
{
handleMouseEnter
,
handleMouseLeave
}
from
'@/views/editor/functions/compare'
import
{
debounce
}
from
'lodash'
const
renderElem
=
(
type
:
string
,
style
=
{
display
:
'block'
})
=>
{
const
renderElem
=
(
type
:
string
,
style
=
{
display
:
'block'
})
=>
{
return
(
elem
:
SlateElement
,
children
:
VNode
[]
|
null
,
editor
:
IDomEditor
):
VNode
=>
{
return
(
elem
:
SlateElement
,
children
:
VNode
[]
|
null
,
editor
:
IDomEditor
):
VNode
=>
{
...
@@ -9,7 +11,22 @@ const renderElem = (type: string, style = { display: 'block' }) => {
...
@@ -9,7 +11,22 @@ const renderElem = (type: string, style = { display: 'block' }) => {
// @ts-ignore
// @ts-ignore
textIndent
:
Number
(
elem
.
dataIndent
)
*
5
+
'px'
textIndent
:
Number
(
elem
.
dataIndent
)
*
5
+
'px'
})
})
return
h
(
type
,
{
style
,
attrs
:
{
'data-key'
:
dataKey
}
},
children
)
return
h
(
type
,
{
style
,
attrs
:
{
'data-key'
:
dataKey
},
on
:
{
mouseenter
(
event
:
Event
)
{
handleMouseEnter
(
event
)
},
mouseleave
()
{
handleMouseLeave
()
}
}
},
children
)
}
}
}
}
const
createRenderConfig
=
(
types
:
string
|
string
[])
=>
{
const
createRenderConfig
=
(
types
:
string
|
string
[])
=>
{
...
...
src/views/editor/components/Compare.vue
View file @
069fecb9
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
preset=
"card"
preset=
"card"
:showFooter=
"false"
:showFooter=
"false"
>
>
<div
class=
"flex h-full"
>
<div
class=
"flex h-full"
ref=
"compareContainerRef"
>
<GlobalEditor
<GlobalEditor
ref=
"compareLeftRef"
ref=
"compareLeftRef"
v-model=
"compareLeftData"
v-model=
"compareLeftData"
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
</
template
>
</
template
>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
showCompare
,
compareLeftRef
,
compareRightRef
,
compareLeftData
,
compareRightData
}
from
'../constants/compare'
import
{
showCompare
,
compareLeftRef
,
compareRightRef
,
compareLeftData
,
compareRightData
,
compareContainerRef
}
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
>
src/views/editor/constants/compare.ts
View file @
069fecb9
...
@@ -3,3 +3,4 @@ export const compareLeftRef = ref()
...
@@ -3,3 +3,4 @@ export const compareLeftRef = ref()
export
const
compareRightRef
=
ref
()
export
const
compareRightRef
=
ref
()
export
const
compareLeftData
=
ref
(
''
)
export
const
compareLeftData
=
ref
(
''
)
export
const
compareRightData
=
ref
(
''
)
export
const
compareRightData
=
ref
(
''
)
export
const
compareContainerRef
=
ref
()
src/views/editor/constants/index.ts
View file @
069fecb9
import
{
NewTreeModification
,
OldTreeModification
,
TreeRenderResult
}
from
'@/lib/XMLProcessor/src/typing'
import
{
ArrowLeft24Filled
,
ArrowRight24Filled
,
Book20Filled
,
TableInsertColumn24Filled
}
from
'@vicons/fluent'
import
{
ArrowLeft24Filled
,
ArrowRight24Filled
,
Book20Filled
,
TableInsertColumn24Filled
}
from
'@vicons/fluent'
import
{
IDomEditor
}
from
'@wangeditor/editor'
import
{
IDomEditor
}
from
'@wangeditor/editor'
export
interface
compareResult
{
dataForNew
:
NewTreeModification
dataForOld
:
OldTreeModification
domOld
:
Document
domNew
:
Document
treeOld
:
TreeRenderResult
[]
treeNew
:
TreeRenderResult
[]
xmlContentOld
:
string
xmlContentNew
:
string
}
export
const
showLoading
=
ref
(
false
)
export
const
showLoading
=
ref
(
false
)
//编辑器相关配置
//编辑器相关配置
export
const
editorRef
=
shallowRef
<
IDomEditor
>
()
export
const
editorRef
=
shallowRef
<
IDomEditor
>
()
...
...
src/views/editor/functions/compare.ts
View file @
069fecb9
import
{
NewTreeModification
,
OldTreeModification
,
TreeRenderResult
}
from
'@/lib/XMLProcessor/src/typing'
import
{
NewTreeModification
,
OldTreeModification
,
TreeRenderResult
}
from
'@/lib/XMLProcessor/src/typing'
import
{
compareLeftRef
,
compareRightRef
}
from
'../constants/compare'
import
{
compareContainerRef
,
compareLeftRef
,
compareRightRef
}
from
'../constants/compare'
import
{
debounce
}
from
'lodash'
export
const
handleMouseEnter
=
debounce
((
event
:
any
)
=>
{
const
width
=
compareContainerRef
.
value
?.
clientWidth
const
x
=
event
.
clientX
const
y
=
event
.
clientY
const
element1
=
document
.
elementFromPoint
(
x
,
y
)
const
element2
=
document
.
elementFromPoint
(
width
-
x
,
y
)
element1
?.
classList
.
add
(
'bg-progressRailColor'
)
element2
?.
classList
.
add
(
'bg-progressRailColor'
)
},
200
)
export
const
handleMouseLeave
=
()
=>
{
const
elements
=
document
.
querySelectorAll
(
'.bg-progressRailColor'
)
elements
.
forEach
((
element
)
=>
{
element
.
classList
.
remove
(
'bg-progressRailColor'
)
})
}
export
const
handleScrollTopLeft
=
(
event
:
Event
)
=>
{
export
const
handleScrollTopLeft
=
(
event
:
Event
)
=>
{
const
scrollTop
=
(
event
.
target
as
HTMLInputElement
).
scrollTop
const
scrollTop
=
(
event
.
target
as
HTMLInputElement
).
scrollTop
compareRightRef
.
value
?.
handleScrollTop
(
scrollTop
)
compareRightRef
.
value
?.
handleScrollTop
(
scrollTop
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment