fix(web-admin): restore fold icon in production and toggle archive planNo.

Remove Tailwind inline from el-icon so production CSS no longer collapses the header fold control, and expose 计划编号 in the plan-archive column picker.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
wuzilongandCursor committed 2026-11-14 21:10:15 +08:00
1 parent a4d213231c
commit 8bffb1cbf5
3 files changed
+51 -6

No files matched your search

@@ -0,0 +1,36 @@
/**
* #26 回归:
* 1) ArtSvgIcon 的 el-icon 不得带 Tailwind `inline`(生产 CSS 会覆盖 display)
* 2) 运输归档列展示含 planNo,且表格列受 isColumnVisible 控制
*/
import test from 'node:test'
import assert from 'node:assert/strict'
import { readFileSync } from 'node:fs'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { parse } from '@vue/compiler-sfc'
const root = join(dirname(fileURLToPath(import.meta.url)), '..')
test('ArtSvgIcon: el-icon branch must not use Tailwind inline class', () => {
const src = readFileSync(join(root, 'src/components/core/base/art-svg-icon/index.vue'), 'utf8')
const { descriptor } = parse(src)
const template = descriptor.template?.content || ''
assert.match(template, /<el-icon\b[^>]*class="[^"]*art-svg-icon/)
assert.doesNotMatch(
template,
/<el-icon\b[^>]*class="[^"]*\binline\b/,
'el-icon must not include Tailwind inline (breaks display:inline-flex in prod CSS order)'
)
})
test('plan-archive: planNo is in column defs and table visibility gate', () => {
const src = readFileSync(join(root, 'src/views/pl/plan-archive/index.vue'), 'utf8')
assert.match(src, /prop:\s*'planNo',\s*label:\s*'计划编号'/)
assert.match(src, /pl-plan-archive-list-columns-v17/)
assert.match(
src,
/v-if="isColumnVisible\('planNo'\)"[\s\S]*?prop="planNo"/,
'planNo table column must be gated by isColumnVisible'
)
})
@@ -1,6 +1,8 @@
<!-- 图标组件:支持 Element Plus 图标(无 : 前缀)与 Iconify 图标(含 : 前缀) -->
<template>
<el-icon v-if="epIcon" v-bind="iconAttrs" class="art-svg-icon inline">
<!-- el-icon 勿加 Tailwind `inline`:生产 CSS 中 `.inline{display:inline}` 会覆盖
`.el-icon{display:inline-flex}`,导致 Fold 等图标在打包后不可见 -->
<el-icon v-if="epIcon" v-bind="iconAttrs" class="art-svg-icon">
<component :is="epIcon" />
</el-icon>
<Icon v-else-if="icon" :icon="icon" v-bind="iconAttrs" class="art-svg-icon inline" />
+12 -5
View File
@@ -86,7 +86,13 @@
header-align="center"
:index="getDisplayRowIndex"
/>
<el-table-column prop="planNo" label="计划编号" min-width="180" show-overflow-tooltip>
<el-table-column
v-if="isColumnVisible('planNo')"
prop="planNo"
label="计划编号"
min-width="180"
show-overflow-tooltip
>
<template #header>
<div class="col-header-with-filter">
<span class="col-header-with-filter__label">计划编号</span>
@@ -1075,6 +1081,7 @@ const planList = ref<Plan[]>([])
const PRICE_COLUMN_PROPS = new Set(['unitPrice', 'amount'])
const allListColumnDefs = [
{ prop: 'planNo', label: '计划编号' },
{ prop: 'planDate', label: '计划日期' },
{ prop: 'deliveryTimes', label: '送货时间' },
{ prop: 'archiveStatus', label: '归档状态' },
@@ -1116,7 +1123,7 @@ const {
isIndeterminate,
isColumnVisible,
resetToDefault
} = usePersistedListColumns('pl-plan-archive-list-columns-v16', allListColumnDefs)
} = usePersistedListColumns('pl-plan-archive-list-columns-v17', allListColumnDefs)
const {
filters,
@@ -1165,7 +1172,7 @@ function enumOptionsFor(prop: string) {
}
const visibleFilterProps = computed(() => {
const props: string[] = ['planNo']
const props: string[] = []
for (const def of listColumnDefs.value) {
if (isColumnVisible(def.prop)) props.push(def.prop)
}
@@ -1475,10 +1482,10 @@ const planArchiveExportColumns = computed(() => {
const field = PLAN_ARCHIVE_EXPORT_COLUMN_FIELD_MAP[col] || col
if (!cols.includes(field)) cols.push(field)
}
if (!cols.includes('planNo')) cols.unshift('planNo')
if (isColumnVisible('planNo') && !cols.includes('planNo')) cols.unshift('planNo')
const planNoIdx = cols.indexOf('planNo')
if (!cols.includes('stopSegment')) {
cols.splice(planNoIdx + 1, 0, 'stopSegment')
cols.splice((planNoIdx >= 0 ? planNoIdx : -1) + 1, 0, 'stopSegment')
}
if (!cols.includes('rowNo')) cols.unshift('rowNo')
const modelIdx = cols.indexOf('model')