Commit b9291493 by pangchong

style(DocNodeRenderer): 优化模板标签及函数参数格式

- 合并 Vue 模板中部分 span 标签的多行属性为单行,提升代码简洁度
- 规范部分组件样式属性写法,保持一致的代码风格
- 调整 useDocNodeRenderer 函数参数定义格式,增强代码可读性
- 保持组件内部逻辑未变,仅涉及格式与风格优化
parent 240756ce
......@@ -9,7 +9,13 @@ import { SHOW_SINGLE_CHILD_INDEX } from '@/configs'
const ALERT_ROOT_TAGS = new Set(ALERT_BLOCK_TAGS)
const INLINE_ELEMENTS_SET = new Set(INLINE_ELEMENTS)
export function useDocNodeRenderer(props: { node: XmlNode; parent?: XmlNode | null; isInline?: boolean; insideRefBlock?: boolean; diffMode?: boolean }) {
export function useDocNodeRenderer(props: {
node: XmlNode
parent?: XmlNode | null
isInline?: boolean
insideRefBlock?: boolean
diffMode?: boolean
}) {
const editorStore = useEditorStore()
const { locale } = useI18n()
......
......@@ -562,11 +562,7 @@
<!-- 9. EIN (功能号) 特殊处理 -->
<template v-else-if="node.tagName === 'EIN'">
<span
class="font-mono cursor-pointer underline inline-flex items-baseline"
style="color: blue"
@click.stop="selectNode(node.id)"
>
<span class="font-mono cursor-pointer underline inline-flex items-baseline" style="color: blue" @click.stop="selectNode(node.id)">
<span class="mr-1 select-none">FIN</span>
<span
contenteditable="true"
......@@ -641,10 +637,7 @@
<!-- 13. TED / CON (工具/消耗品数据组合) 统一配置化渲染 -->
<template v-else-if="node.tagName === 'TED' || node.tagName === 'CON'">
<span
class="text-color1 cursor-pointer select-none inline-flex items-center space-x-1"
@click.stop="selectNode(node.id)"
>
<span class="text-color1 cursor-pointer select-none inline-flex items-center space-x-1" @click.stop="selectNode(node.id)">
<template v-for="childTag in COMPOSITE_CONTAINER_MAP[node.tagName]" :key="childTag">
<template v-if="node.children.find((c) => c.tagName === childTag)">
<span v-if="childTag.endsWith('NBR')" class="text-color3 select-none mx-0.5">
......@@ -659,10 +652,7 @@
<!-- 13.5 EXPD (消耗品数据组合) 统一配置化渲染 -->
<template v-else-if="node.tagName === 'EXPD'">
<span
class="text-color1 cursor-pointer select-none inline-flex items-center space-x-1"
@click.stop="selectNode(node.id)"
>
<span class="text-color1 cursor-pointer select-none inline-flex items-center space-x-1" @click.stop="selectNode(node.id)">
<template v-if="node.children && node.children.length > 0">
<template v-for="childTag in COMPOSITE_CONTAINER_MAP[node.tagName]" :key="childTag">
<template v-if="node.children.find((c) => c.tagName === childTag)">
......
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