Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
Ifar-Xml-Edtor
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
Ifar-Xml-Edtor
Commits
e84a7c4c
Commit
e84a7c4c
authored
Jul 31, 2026
by
pangchong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 格式化代码
parent
846ea4b3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
9 deletions
+22
-9
src/views/editor/components/DocNodeRenderer/index.vue
+16
-7
src/views/editor/components/NodeTree/functionals/index.ts
+1
-1
src/views/editor/components/NodeTree/index.vue
+5
-1
No files found.
src/views/editor/components/DocNodeRenderer/index.vue
View file @
e84a7c4c
...
...
@@ -833,7 +833,10 @@
<span
class=
"text-xs font-bold text-color2 flex items-center space-x-2"
>
<n-icon><ImageOutline
/></n-icon>
<span>
工卡附图
</span>
<span
v-if=
"getGraphicKey(node)"
class=
"text-[11px] font-mono text-primary font-medium bg-primary/10 px-1.5 py-0.5 rounded border border-primary/20"
>
<span
v-if=
"getGraphicKey(node)"
class=
"text-[11px] font-mono text-primary font-medium bg-primary/10 px-1.5 py-0.5 rounded border border-primary/20"
>
KEY:
{{
getGraphicKey
(
node
)
}}
</span>
</span>
...
...
@@ -848,7 +851,9 @@
@
click
.
stop=
"editorStore.setSelectedNodeId(getReferencingNodes(node)[0].id, true)"
title=
"点击直接定位至引用当前插图的位置"
>
<template
#
icon
><n-icon><NavigateOutline
/></n-icon></
template
>
<template
#
icon
>
<n-icon><NavigateOutline
/></n-icon>
</
template
>
定位引用位置 (
<
{{ getReferencingNodes(node)[0].tagName }}
>
)
</CommonButton>
</template>
...
...
@@ -858,14 +863,14 @@
<n-popover
trigger=
"click"
placement=
"bottom-end"
>
<template
#
trigger
>
<CommonButton
size=
"tiny"
type=
"primary"
secondary
@
click
.
stop
>
<template
#
icon
><n-icon><LinkOutline
/></n-icon></
template
>
<template
#
icon
>
<n-icon><LinkOutline
/></n-icon>
</
template
>
定位引用位置 ({{ getReferencingNodes(node).length }}处)
</CommonButton>
</template>
<div
class=
"p-2 space-y-1 min-w-[240px] select-none"
@
click
.
stop
>
<div
class=
"text-[11px] font-bold text-color3 pb-1 border-b border-divider mb-1"
>
引用当前插图的节点列表:
</div>
<div
class=
"text-[11px] font-bold text-color3 pb-1 border-b border-divider mb-1"
>
引用当前插图的节点列表:
</div>
<div
v-for=
"refNode in getReferencingNodes(node)"
:key=
"refNode.id"
...
...
@@ -1486,7 +1491,11 @@ const getNodePreviewText = (node: XmlNode): string => {
const
getRefTargetId
=
(
node
:
XmlNode
):
string
|
null
=>
{
let
refId
=
node
.
attributes
?.
REFID
||
node
.
attributes
?.
STRUCTID
||
node
.
attributes
?.
GRAPHICKEY
||
node
.
attributes
?.
GNBR
if
(
!
refId
&&
node
.
textContent
)
{
refId
=
node
.
textContent
.
trim
().
replace
(
/^
\(?(?:
Ref:
\s
*|参考:
\s
*
)?
|
\)?
$/gi
,
''
).
replace
(
/
\[
Sh
\.\d
+
\]
/gi
,
''
).
trim
()
refId
=
node
.
textContent
.
trim
()
.
replace
(
/^
\(?(?:
Ref:
\s
*|参考:
\s
*
)?
|
\)?
$/gi
,
''
)
.
replace
(
/
\[
Sh
\.\d
+
\]
/gi
,
''
)
.
trim
()
}
if
(
refId
)
{
const
target
=
editorStore
.
findNodeByRef
(
refId
,
'GRAPHIC'
)
...
...
src/views/editor/components/NodeTree/functionals/index.ts
View file @
e84a7c4c
...
...
@@ -416,7 +416,7 @@ export function useNodeTree(
const
refTagStr
=
Array
.
from
(
referencingTags
).
join
(
'/'
)
const
refInfo
=
refCount
>
0
?
` [被
${
refTagStr
}
引用
${
refCount
}
次]`
:
''
attrSummary
=
key
?
`KEY:
${
key
}${
refInfo
}
`
:
(
refInfo
.
trim
()
||
'GRAPHIC'
)
attrSummary
=
key
?
`KEY:
${
key
}${
refInfo
}
`
:
refInfo
.
trim
()
||
'GRAPHIC'
subtitle
=
graphicTitle
||
getNodeTextPreview
(
node
,
false
)
fullSubtitle
=
graphicTitle
||
getNodeTextPreview
(
node
,
true
)
}
else
if
(
node
.
tagName
===
'GRPHCREF'
)
{
...
...
src/views/editor/components/NodeTree/index.vue
View file @
e84a7c4c
...
...
@@ -309,7 +309,11 @@ const getTreeItemRefNodes = (node: any): any[] => {
const
getTreeItemTargetId
=
(
node
:
any
):
string
|
null
=>
{
let
refId
=
node
.
attributes
?.
REFID
||
node
.
attributes
?.
STRUCTID
||
node
.
attributes
?.
GRAPHICKEY
||
node
.
attributes
?.
GNBR
if
(
!
refId
&&
node
.
textContent
)
{
refId
=
node
.
textContent
.
trim
().
replace
(
/^
\(?(?:
Ref:
\s
*|参考:
\s
*
)?
|
\)?
$/gi
,
''
).
replace
(
/
\[
Sh
\.\d
+
\]
/gi
,
''
).
trim
()
refId
=
node
.
textContent
.
trim
()
.
replace
(
/^
\(?(?:
Ref:
\s
*|参考:
\s
*
)?
|
\)?
$/gi
,
''
)
.
replace
(
/
\[
Sh
\.\d
+
\]
/gi
,
''
)
.
trim
()
}
if
(
refId
)
{
const
target
=
editorStore
.
findNodeByRef
(
refId
,
'GRAPHIC'
)
...
...
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