Commit fca0875e by pangchong

style(editor): 优化条件判断表达式格式

- 将多行条件判断合并为单行,提高代码简洁度
- 删除多余的空白行,提升代码整洁性
- 格式化代码对齐,使变量赋值更紧凑
parent 733dcbc0
......@@ -1444,12 +1444,7 @@ export const useEditorStore = defineStore('editor', {
const isMatch = (n: XmlNode) => {
const attrs = n.attributes || {}
return (
attrs.KEY === cleanRefId ||
attrs.ID === cleanRefId ||
attrs.GRAPHICKEY === cleanRefId ||
attrs.GNBR === cleanRefId
)
return attrs.KEY === cleanRefId || attrs.ID === cleanRefId || attrs.GRAPHICKEY === cleanRefId || attrs.GNBR === cleanRefId
}
if (preferredTagName) {
......@@ -1477,4 +1472,3 @@ export const useEditorStore = defineStore('editor', {
}
}
})
......@@ -1446,10 +1446,7 @@ const {
const handleNodeClick = (e: MouseEvent) => {
if (e.ctrlKey || e.metaKey) {
let refId =
props.node.attributes?.REFID ||
props.node.attributes?.STRUCTID ||
props.node.attributes?.GRAPHICKEY ||
props.node.attributes?.GNBR
props.node.attributes?.REFID || props.node.attributes?.STRUCTID || props.node.attributes?.GRAPHICKEY || props.node.attributes?.GNBR
if (!refId && props.node.textContent) {
refId = props.node.textContent.trim()
refId = refId
......
......@@ -61,7 +61,8 @@ import { useAddNodeModal } from './functionals'
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[]) => {
addNodeMode.value = mode
......
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