Commit 80360b09 by pangchong

style(SignoffRenderer): 优化模板中的换行与格式

- 调整 SignoffRenderer.vue 中 badge 显示的模板格式,换行提升可读性
- 优化条件表达式换行,提升代码可读性
- 统一箭头函数参数格式,增加代码风格一致性
- 调整 config 配置文件中的三元表达式换行,规范代码风格
- 删除无用 import 语句,简化代码
- 移除 EditorToolbar 常量文件多余空行,清理代码
parent fa73e172
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
<!-- 签名/状态栏 --> <!-- 签名/状态栏 -->
<td class="px-2 border border-black text-center w-32 font-mono"> <td class="px-2 border border-black text-center w-32 font-mono">
<span v-if="col.isNA" style="color: red" class="font-bold">N/A</span> <span v-if="col.isNA" style="color: red" class="font-bold">N/A</span>
<span v-else-if="col.badge" class="font-bold text-sm bg-gray-100 px-2 py-0.5 rounded border border-gray-300">{{ col.badge }}</span> <span v-else-if="col.badge" class="font-bold text-sm bg-gray-100 px-2 py-0.5 rounded border border-gray-300">
{{ col.badge }}
</span>
<span v-else>{{ col.value }}</span> <span v-else>{{ col.value }}</span>
</td> </td>
</template> </template>
...@@ -124,7 +126,12 @@ const columns = computed(() => { ...@@ -124,7 +126,12 @@ const columns = computed(() => {
list.push({ list.push({
label, label,
subLabel, subLabel,
value: isNA && levelVal.toUpperCase().includes('N/A') ? '' : (props.node.attributes.insp ? `${props.node.attributes.insp} ${props.node.attributes.inspName || ''}` : ''), value:
isNA && levelVal.toUpperCase().includes('N/A')
? ''
: props.node.attributes.insp
? `${props.node.attributes.insp} ${props.node.attributes.inspName || ''}`
: '',
time: props.node.attributes.SUP_DIS_STIME || props.node.attributes.disStime || '', time: props.node.attributes.SUP_DIS_STIME || props.node.attributes.disStime || '',
isNA: isNA isNA: isNA
}) })
...@@ -135,6 +142,6 @@ const columns = computed(() => { ...@@ -135,6 +142,6 @@ const columns = computed(() => {
// 判断是否存在任何签字时间 // 判断是否存在任何签字时间
const hasTime = computed(() => { const hasTime = computed(() => {
return columns.value.some(col => col.time) return columns.value.some((col) => col.time)
}) })
</script> </script>
...@@ -2,12 +2,11 @@ ...@@ -2,12 +2,11 @@
const customConfigs = import.meta.glob<any>('../**/config/index.ts', { eager: true }) const customConfigs = import.meta.glob<any>('../**/config/index.ts', { eager: true })
const customCode = import.meta.env.VITE_CUSTOM_CODE const customCode = import.meta.env.VITE_CUSTOM_CODE
const customPath = customCode ? `../${customCode}/config/index.ts` : '' const customPath = customCode ? `../${customCode}/config/index.ts` : ''
const customConfig = customPath ? (customConfigs[customPath]?.default || customConfigs[customPath]) : null const customConfig = customPath ? customConfigs[customPath]?.default || customConfigs[customPath] : null
/** /**
* 列表只有一个子项时是否显示序号。 * 列表只有一个子项时是否显示序号。
* 默认是要显示的 (true)。各环境可以通过在其目录下的 config/index.ts 中重新定义此属性覆盖默认值。 * 默认是要显示的 (true)。各环境可以通过在其目录下的 config/index.ts 中重新定义此属性覆盖默认值。
*/ */
export const SHOW_SINGLE_CHILD_INDEX = customConfig && typeof customConfig.SHOW_SINGLE_CHILD_INDEX !== 'undefined' export const SHOW_SINGLE_CHILD_INDEX =
? customConfig.SHOW_SINGLE_CHILD_INDEX customConfig && typeof customConfig.SHOW_SINGLE_CHILD_INDEX !== 'undefined' ? customConfig.SHOW_SINGLE_CHILD_INDEX : true
: true
...@@ -5,7 +5,6 @@ import { ALERT_AND_EFF_TAGS, ALERT_BLOCK_TAGS, COMPOSITE_CONTAINER_MAP, INLINE_E ...@@ -5,7 +5,6 @@ import { ALERT_AND_EFF_TAGS, ALERT_BLOCK_TAGS, COMPOSITE_CONTAINER_MAP, INLINE_E
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { SHOW_SINGLE_CHILD_INDEX } from '@/configs' import { SHOW_SINGLE_CHILD_INDEX } from '@/configs'
// 警示块级节点集合(WARNING / CAUTION / NOTE),用于注入 insideAlert 上下文 // 警示块级节点集合(WARNING / CAUTION / NOTE),用于注入 insideAlert 上下文
const ALERT_ROOT_TAGS = new Set(ALERT_BLOCK_TAGS) const ALERT_ROOT_TAGS = new Set(ALERT_BLOCK_TAGS)
const INLINE_ELEMENTS_SET = new Set(INLINE_ELEMENTS) const INLINE_ELEMENTS_SET = new Set(INLINE_ELEMENTS)
......
...@@ -13,4 +13,3 @@ export const GREEN_BUTTONS: any[] = [ ...@@ -13,4 +13,3 @@ export const GREEN_BUTTONS: any[] = [
{ label: '插入选项组', tag: 'SELECTION', icon: ListOutline }, { label: '插入选项组', tag: 'SELECTION', icon: ListOutline },
{ label: '插入下划线', tag: 'RECORD-LINE', icon: RemoveOutline } { label: '插入下划线', tag: 'RECORD-LINE', icon: RemoveOutline }
] ]
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