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
fca0875e
Commit
fca0875e
authored
Jul 28, 2026
by
pangchong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style(editor): 优化条件判断表达式格式
- 将多行条件判断合并为单行,提高代码简洁度 - 删除多余的空白行,提升代码整洁性 - 格式化代码对齐,使变量赋值更紧凑
parent
733dcbc0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
12 deletions
+4
-12
src/store/editor/index.ts
+1
-7
src/views/editor/components/DocNodeRenderer/index.vue
+1
-4
src/views/editor/components/NodeTree/components/AddNodeModal/index.vue
+2
-1
No files found.
src/store/editor/index.ts
View file @
fca0875e
...
@@ -1444,12 +1444,7 @@ export const useEditorStore = defineStore('editor', {
...
@@ -1444,12 +1444,7 @@ export const useEditorStore = defineStore('editor', {
const isMatch = (n: XmlNode) => {
const isMatch = (n: XmlNode) => {
const attrs = n.attributes || {}
const attrs = n.attributes || {}
return (
return attrs.KEY === cleanRefId || attrs.ID === cleanRefId || attrs.GRAPHICKEY === cleanRefId || attrs.GNBR === cleanRefId
attrs.KEY === cleanRefId ||
attrs.ID === cleanRefId ||
attrs.GRAPHICKEY === cleanRefId ||
attrs.GNBR === cleanRefId
)
}
}
if (preferredTagName) {
if (preferredTagName) {
...
@@ -1477,4 +1472,3 @@ export const useEditorStore = defineStore('editor', {
...
@@ -1477,4 +1472,3 @@ export const useEditorStore = defineStore('editor', {
}
}
}
}
})
})
src/views/editor/components/DocNodeRenderer/index.vue
View file @
fca0875e
...
@@ -1446,10 +1446,7 @@ const {
...
@@ -1446,10 +1446,7 @@ const {
const
handleNodeClick
=
(
e
:
MouseEvent
)
=>
{
const
handleNodeClick
=
(
e
:
MouseEvent
)
=>
{
if
(
e
.
ctrlKey
||
e
.
metaKey
)
{
if
(
e
.
ctrlKey
||
e
.
metaKey
)
{
let
refId
=
let
refId
=
props
.
node
.
attributes
?.
REFID
||
props
.
node
.
attributes
?.
REFID
||
props
.
node
.
attributes
?.
STRUCTID
||
props
.
node
.
attributes
?.
GRAPHICKEY
||
props
.
node
.
attributes
?.
GNBR
props
.
node
.
attributes
?.
STRUCTID
||
props
.
node
.
attributes
?.
GRAPHICKEY
||
props
.
node
.
attributes
?.
GNBR
if
(
!
refId
&&
props
.
node
.
textContent
)
{
if
(
!
refId
&&
props
.
node
.
textContent
)
{
refId
=
props
.
node
.
textContent
.
trim
()
refId
=
props
.
node
.
textContent
.
trim
()
refId
=
refId
refId
=
refId
...
...
src/views/editor/components/NodeTree/components/AddNodeModal/index.vue
View file @
fca0875e
...
@@ -61,7 +61,8 @@ import { useAddNodeModal } from './functionals'
...
@@ -61,7 +61,8 @@ import { useAddNodeModal } from './functionals'
const
formRef
=
ref
<
FormInst
|
null
>
(
null
)
const
formRef
=
ref
<
FormInst
|
null
>
(
null
)
const
{
form
,
rules
,
saving
,
modalTitle
,
tagOptions
,
attributeDefs
,
graphicKeyOptions
,
showTextContentField
,
onTagChange
,
handleConfirm
}
=
useAddNodeModal
(
formRef
)
const
{
form
,
rules
,
saving
,
modalTitle
,
tagOptions
,
attributeDefs
,
graphicKeyOptions
,
showTextContentField
,
onTagChange
,
handleConfirm
}
=
useAddNodeModal
(
formRef
)
const
open
=
(
mode
:
'child'
|
'before'
|
'after'
|
'edit'
,
targetId
:
string
,
allowedTags
:
string
[])
=>
{
const
open
=
(
mode
:
'child'
|
'before'
|
'after'
|
'edit'
,
targetId
:
string
,
allowedTags
:
string
[])
=>
{
addNodeMode
.
value
=
mode
addNodeMode
.
value
=
mode
...
...
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