|
|
|
|
@ -25,7 +25,7 @@
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="specification"
|
|
|
|
|
label="规格"
|
|
|
|
|
width="120"
|
|
|
|
|
width="80"
|
|
|
|
|
fixed="left"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
@ -35,11 +35,14 @@
|
|
|
|
|
:key="column.key"
|
|
|
|
|
:label="column.label"
|
|
|
|
|
:prop="column.prop"
|
|
|
|
|
min-width="150"
|
|
|
|
|
min-width="100"
|
|
|
|
|
>
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
{{ scope.row[column.prop] || '-' }}
|
|
|
|
|
</template>
|
|
|
|
|
<template #header>
|
|
|
|
|
<div v-html="column.label"></div> <!-- 使用 v-html 渲染 HTML 标签,确保 <br> 生效 -->
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
<!-- 总计列 -->
|
|
|
|
|
@ -79,10 +82,14 @@ const dynamicColumns = computed(() => {
|
|
|
|
|
}))].sort(); // 可选:若需自定义排序,调整这里
|
|
|
|
|
|
|
|
|
|
return combinations.map(comb => {
|
|
|
|
|
// 将组合拆分为 model 和 wire_disc
|
|
|
|
|
const hasWireDisc = comb.includes('::');
|
|
|
|
|
const [model, wire_disc] = hasWireDisc ? comb.split('::') : [comb, ''];
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
key: comb,
|
|
|
|
|
prop: comb,
|
|
|
|
|
label: comb.replace('::', '-') // 显示时可替换回 '-' 以保持原样
|
|
|
|
|
label: `${model}<br>${wire_disc}` // 使用HTML换行符,实现两行显示
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
@ -230,6 +237,8 @@ onMounted(() => {
|
|
|
|
|
color: #606266;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
text-align: center; /* 可选:居中对齐列头 */
|
|
|
|
|
padding: 8px 0; /* 调整列头内间距,以适应两行显示 */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
:deep(.el-table td) {
|
|
|
|
|
|