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
64fc94cb
Commit
64fc94cb
authored
Apr 28, 2025
by
pangchong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 样式调整
parent
82547a76
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
13 deletions
+22
-13
src/assets/css/element.less
+5
-2
src/views/editor/components/Compare.vue
+3
-0
src/views/editor/functions/compare.ts
+3
-2
src/views/editor/functions/index.ts
+11
-9
No files found.
src/assets/css/element.less
View file @
64fc94cb
...
...
@@ -36,10 +36,13 @@ row {
html-thead entry {
font-weight: bold;
}
tgroup {
border: 1px solid var(--border-color);
}
entry {
flex: 0.5;
border: 1px solid var(--border-color);
border-right: 1px solid var(--border-color);
border
-bottom
: 1px solid var(--border-color);
}
pan {
display: inline-block !important;
...
...
src/views/editor/components/Compare.vue
View file @
64fc94cb
...
...
@@ -52,12 +52,15 @@ import {
compareRightContent
}
from
'../constants/compare'
import
{
clearLeftXml
,
clearRightXml
,
handleScrollTopLeft
,
handleScrollTopRight
,
uploadLeftXml
,
uploadRightXml
}
from
'../functions/compare'
import
{
handleNativeHtml
}
from
'../functions'
watchEffect
(()
=>
{
if
(
compareLeftContent
.
value
&&
compareRightContent
.
value
)
{
const
xmlProcessing
=
useXMLProcessing
()
const
res
=
xmlProcessing
.
dualCompareFromString
(
compareLeftContent
.
value
,
compareRightContent
.
value
,
nodeSet
,
contentHoldNode
)
Object
.
assign
(
compareData
,
res
)
compareData
.
treeOld
=
handleNativeHtml
(
compareData
.
treeOld
)
compareData
.
treeNew
=
handleNativeHtml
(
compareData
.
treeNew
)
}
})
</
script
>
...
...
src/views/editor/functions/compare.ts
View file @
64fc94cb
...
...
@@ -9,6 +9,7 @@ import {
compareRightRef
,
showCompare
}
from
'../constants/compare'
import
{
handleNativeHtml
}
from
'.'
export
const
handleClickDom
=
(
event
:
any
)
=>
{
if
(
!
showCompare
.
value
)
return
...
...
@@ -43,7 +44,7 @@ export const uploadLeftXml = async () => {
const
xmlProcessing
=
useXMLProcessing
()
const
res
=
await
xmlProcessing
.
processFile
(
file
,
nodeSet
,
contentHoldNode
)
compareLeftContent
.
value
=
res
.
xmlContent
compareData
.
treeOld
=
res
.
xmlContent
compareData
.
treeOld
=
handleNativeHtml
(
res
.
xmlContent
)
}
input
.
remove
()
})
...
...
@@ -61,7 +62,7 @@ export const uploadRightXml = async () => {
const
xmlProcessing
=
useXMLProcessing
()
const
res
=
await
xmlProcessing
.
processFile
(
file
,
nodeSet
,
contentHoldNode
)
compareRightContent
.
value
=
res
.
xmlContent
compareData
.
treeNew
=
res
.
xmlContent
compareData
.
treeNew
=
handleNativeHtml
(
res
.
xmlContent
)
}
input
.
remove
()
})
...
...
src/views/editor/functions/index.ts
View file @
64fc94cb
...
...
@@ -115,16 +115,8 @@ export const uploadXml = async () => {
showLoading
.
value
=
true
const
res
=
await
xmlProcessing
.
processFile
(
file
,
nodeSet
,
contentHoldNode
)
// console.log(res.treeData[0].node.attributes)
let
xmlContent
=
res
.
xmlContent
//处理原生html标签
xmlContent
=
xmlContent
.
replace
(
/<TABLE
(?!\s
*
\/
>
)([^
>
]
*
)
>/g
,
'<HTML-TABLE data-w-e-type="HTML-TABLE" $1>'
)
xmlContent
=
xmlContent
.
replace
(
/<
\/
TABLE>/g
,
'</HTML-TABLE>'
)
xmlContent
=
xmlContent
.
replace
(
/<THEAD
(?!\s
*
\/
>
)([^
>
]
*
)
>/g
,
'<HTML-THEAD data-w-e-type="HTML-THEAD" $1>'
)
xmlContent
=
xmlContent
.
replace
(
/<
\/
THEAD>/g
,
'</HTML-THEAD>'
)
xmlContent
=
xmlContent
.
replace
(
/<TBODY
(?!\s
*
\/
>
)([^
>
]
*
)
>/g
,
'<HTML-TBODY data-w-e-type="HTML-TBODY" $1>'
)
xmlContent
=
xmlContent
.
replace
(
/<
\/
TBODY>/g
,
'</HTML-TBODY>'
)
showLoading
.
value
=
false
editorHtml
.
value
=
xmlContent
editorHtml
.
value
=
handleNativeHtml
(
res
.
xmlContent
)
}
input
.
remove
()
})
...
...
@@ -137,3 +129,13 @@ export const compareXml = () => {
compareLeftContent
.
value
=
''
compareRightContent
.
value
=
''
}
//处理原生html标签
export
const
handleNativeHtml
=
(
html
:
string
)
=>
{
html
=
html
.
replace
(
/<TABLE
(?!\s
*
\/
>
)([^
>
]
*
)
>/g
,
'<HTML-TABLE data-w-e-type="HTML-TABLE" $1>'
)
html
=
html
.
replace
(
/<
\/
TABLE>/g
,
'</HTML-TABLE>'
)
html
=
html
.
replace
(
/<THEAD
(?!\s
*
\/
>
)([^
>
]
*
)
>/g
,
'<HTML-THEAD data-w-e-type="HTML-THEAD" $1>'
)
html
=
html
.
replace
(
/<
\/
THEAD>/g
,
'</HTML-THEAD>'
)
html
=
html
.
replace
(
/<TBODY
(?!\s
*
\/
>
)([^
>
]
*
)
>/g
,
'<HTML-TBODY data-w-e-type="HTML-TBODY" $1>'
)
html
=
html
.
replace
(
/<
\/
TBODY>/g
,
'</HTML-TBODY>'
)
return
html
}
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