Commit 07a1e8c3 by pangchong

style(ai-assistant): 优化MERGED节点关键词数组格式及表格渲染样式

- 将MERGED相关关键词数组改为单行格式,提升代码可读性
- 统一调整DocNodeRenderer组件中带MERGED属性节点的表格样式写法
- 优化表格内容换行和缩进,使模板结构更清晰
- 规范条件表达式缩进和换行,增强代码整洁度
parent 13c42f53
......@@ -614,21 +614,7 @@ export const FAQ_DATABASE: FaqItem[] = [
category: 'tree',
categoryName: '节点树与大纲',
title: '如何快速标记或取消节点的合并(MERGED)黄底高亮?',
keywords: [
'merged',
'合并',
'黄底',
'黄色背景',
'标记合并',
'取消合并',
'快捷标记',
'高亮合并',
'hb',
'hebing',
'hd',
'huangdi',
'bjhb'
],
keywords: ['merged', '合并', '黄底', '黄色背景', '标记合并', '取消合并', '快捷标记', '高亮合并', 'hb', 'hebing', 'hd', 'huangdi', 'bjhb'],
synonyms: ['怎么给节点加黄底', 'MERGED属性怎么改', '为什么有黄色背景', '如何去掉黄色标记', '标记合并在哪里', '怎么标记MERGED'],
answer: '在工卡中,带有 MERGED="TRUE" 属性的节点会在编辑器中自动呈现黄色高亮背景。系统提供了一键式极速切换操作:',
steps: [
......
......@@ -705,14 +705,22 @@
:style="node.attributes?.MERGED === 'TRUE' ? 'background-color: yellow; color: #000000;' : ''"
>
<thead>
<tr
class="font-bold h-8"
:class="node.attributes?.MERGED === 'TRUE' ? 'bg-black/10 text-black' : 'bg-fill-2 text-color1'"
>
<th class="border px-2 text-center w-1/4" :class="node.attributes?.MERGED === 'TRUE' ? 'border-black' : 'border-divider'">面板 PANEL</th>
<th class="border px-2 text-center w-5/12" :class="node.attributes?.MERGED === 'TRUE' ? 'border-black' : 'border-divider'">说明 DESIGNATION</th>
<th class="border px-2 text-center w-1/6" :class="node.attributes?.MERGED === 'TRUE' ? 'border-black' : 'border-divider'">功能号 FIN</th>
<th class="border px-2 text-center w-1/6" :class="node.attributes?.MERGED === 'TRUE' ? 'border-black' : 'border-divider'">位置 LOCATION</th>
<tr class="font-bold h-8" :class="node.attributes?.MERGED === 'TRUE' ? 'bg-black/10 text-black' : 'bg-fill-2 text-color1'">
<th class="border px-2 text-center w-1/4" :class="node.attributes?.MERGED === 'TRUE' ? 'border-black' : 'border-divider'">
面板 PANEL
</th>
<th
class="border px-2 text-center w-5/12"
:class="node.attributes?.MERGED === 'TRUE' ? 'border-black' : 'border-divider'"
>
说明 DESIGNATION
</th>
<th class="border px-2 text-center w-1/6" :class="node.attributes?.MERGED === 'TRUE' ? 'border-black' : 'border-divider'">
功能号 FIN
</th>
<th class="border px-2 text-center w-1/6" :class="node.attributes?.MERGED === 'TRUE' ? 'border-black' : 'border-divider'">
位置 LOCATION
</th>
</tr>
</thead>
<tbody>
......@@ -720,9 +728,17 @@
<!-- 如果 CBSUBLST 下有除了 CBDATA 以外的子节点,比如说明文本,可以单独渲染一行 -->
<tr
v-if="hasNonCbDataChildren(subList)"
:class="node.attributes?.MERGED === 'TRUE' || subList.attributes?.MERGED === 'TRUE' ? 'bg-black/5 text-black' : 'bg-fill-1 text-color2'"
:class="
node.attributes?.MERGED === 'TRUE' || subList.attributes?.MERGED === 'TRUE'
? 'bg-black/5 text-black'
: 'bg-fill-1 text-color2'
"
>
<td colspan="4" class="border px-2 py-1 font-semibold" :class="node.attributes?.MERGED === 'TRUE' ? 'border-black' : 'border-divider'">
<td
colspan="4"
class="border px-2 py-1 font-semibold"
:class="node.attributes?.MERGED === 'TRUE' ? 'border-black' : 'border-divider'"
>
<DocNodeRenderer v-for="child in getNonCbDataChildren(subList)" :key="child.id" :node="child" :parent="subList" />
</td>
</tr>
......@@ -733,7 +749,11 @@
v-if="cbData.children.some((c) => c.tagName === 'EFFECT')"
:class="node.attributes?.MERGED === 'TRUE' ? 'bg-black/5' : 'bg-fill-1'"
>
<td colspan="4" class="border px-2 py-0.5 text-danger font-bold text-[10px]" :class="node.attributes?.MERGED === 'TRUE' ? 'border-black' : 'border-divider'">
<td
colspan="4"
class="border px-2 py-0.5 text-danger font-bold text-[10px]"
:class="node.attributes?.MERGED === 'TRUE' ? 'border-black' : 'border-divider'"
>
<DocNodeRenderer
v-for="eff in cbData.children.filter((c) => c.tagName === 'EFFECT')"
:key="eff.id"
......@@ -752,9 +772,7 @@
: cbData.attributes?.MERGED === 'TRUE' || subList.attributes?.MERGED === 'TRUE'
? 'hover:bg-black/10'
: 'hover:bg-fill-3',
cbData.attributes?.MERGED === 'TRUE' || subList.attributes?.MERGED === 'TRUE'
? 'merged-cbdata'
: '',
cbData.attributes?.MERGED === 'TRUE' || subList.attributes?.MERGED === 'TRUE' ? 'merged-cbdata' : '',
editorStore.selectedNodeId === cbData.id ||
cbData.children.some(
(c) => c.id === editorStore.selectedNodeId && COMPOSITE_CONTAINER_MAP['CBDATA']?.includes(c.tagName)
......@@ -765,7 +783,8 @@
: ''
]"
:style="
node.attributes?.MERGED !== 'TRUE' && (cbData.attributes?.MERGED === 'TRUE' || subList.attributes?.MERGED === 'TRUE')
node.attributes?.MERGED !== 'TRUE' &&
(cbData.attributes?.MERGED === 'TRUE' || subList.attributes?.MERGED === 'TRUE')
? 'background-color: yellow; color: #000000;'
: ''
"
......@@ -780,7 +799,11 @@
{
'text-center font-mono': colTag === 'PAN' || colTag === 'CB' || colTag === 'CBLOC',
'font-bold': colTag === 'CB',
'text-color1': colTag === 'CB' && node.attributes?.MERGED !== 'TRUE' && cbData.attributes?.MERGED !== 'TRUE' && subList.attributes?.MERGED !== 'TRUE'
'text-color1':
colTag === 'CB' &&
node.attributes?.MERGED !== 'TRUE' &&
cbData.attributes?.MERGED !== 'TRUE' &&
subList.attributes?.MERGED !== 'TRUE'
}
]"
>
......
......@@ -520,4 +520,3 @@ export function useSelectionToolbar() {
handleToggleMerged
}
}
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