|
|
@@ -1,106 +1,105 @@
|
|
|
<template>
|
|
|
- <div class="board-table-container">
|
|
|
- <!-- Table 区域 -->
|
|
|
- <div class="table-section" v-if="tableConfig && tableData.length > 0">
|
|
|
- <div class="table__content">
|
|
|
- <!-- 表头 -->
|
|
|
- <div class="table__content_label" :class="`table__content_label_${tableConfig.type}`">
|
|
|
- <!-- 单选框列占位(固定宽度) -->
|
|
|
- <div
|
|
|
- v-if="showRadio"
|
|
|
- :style="{ width: radioColumnWidth }"
|
|
|
- class="label-t table__content__list_item_radio"
|
|
|
- >
|
|
|
- <!-- 表头单选框位置留空 -->
|
|
|
- </div>
|
|
|
- <!-- 数据列头 -->
|
|
|
- <div
|
|
|
- class="label-t"
|
|
|
- v-for="(item, index) in tableColumns"
|
|
|
- :key="`header-${index}`"
|
|
|
- :style="{ flexBasis: dataColumnFlexBasis }"
|
|
|
- >
|
|
|
- {{ item.name }}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <!-- 表格内容 -->
|
|
|
- <div class="table__content_list" :class="`table__content_list_${tableConfig.type}`">
|
|
|
- <div
|
|
|
- class="table__content_list_row"
|
|
|
- v-for="(row, rowIndex) in tableData"
|
|
|
- :key="`row-${rowIndex}`"
|
|
|
- :class="{ 'active-row': selectedRowIndex === rowIndex }"
|
|
|
- @click="handleRowClick(rowIndex)"
|
|
|
- >
|
|
|
- <!-- 第一列:单选框(固定宽度) -->
|
|
|
+ <div style="padding: 10px 0; overflow: hidden;">
|
|
|
+ <div class="board-table-container">
|
|
|
+ <!-- Table 区域 -->
|
|
|
+ <div class="table-section" v-if="tableConfig && tableData.length > 0">
|
|
|
+ <div class="table__content">
|
|
|
+ <!-- 表头 -->
|
|
|
+ <div class="table__content_label" :class="`table__content_label_${tableConfig.type}`">
|
|
|
+ <!-- 单选框列占位(固定宽度) -->
|
|
|
<div
|
|
|
v-if="showRadio"
|
|
|
:style="{ width: radioColumnWidth }"
|
|
|
- class="table__content__list_item_radio"
|
|
|
+ class="label-t table__content__list_item_radio"
|
|
|
+ >
|
|
|
+ <!-- 表头单选框位置留空 -->
|
|
|
+ </div>
|
|
|
+ <!-- 数据列头 -->
|
|
|
+ <div
|
|
|
+ class="label-t"
|
|
|
+ v-for="(item, index) in tableColumns"
|
|
|
+ :key="`header-${index}`"
|
|
|
+ :style="{ flexBasis: dataColumnFlexBasis }"
|
|
|
>
|
|
|
- <input
|
|
|
- type="radio"
|
|
|
- :name="radioGroupName"
|
|
|
- :checked="selectedRowIndex === rowIndex"
|
|
|
- @click.stop="handleRowClick(rowIndex)"
|
|
|
- />
|
|
|
+ {{ item.name }}
|
|
|
</div>
|
|
|
- <!-- 其他列(平分剩余空间) -->
|
|
|
+ </div>
|
|
|
+ <!-- 表格内容 -->
|
|
|
+ <div class="table__content_list" :class="`table__content_list_${tableConfig.type}`">
|
|
|
<div
|
|
|
- v-for="(col, colIndex) in tableColumns"
|
|
|
- :key="`cell-${rowIndex}-${colIndex}`"
|
|
|
- :style="{ flexBasis: dataColumnFlexBasis }"
|
|
|
- :class="`table__content__list_item_${tableConfig.type}`"
|
|
|
+ class="table__content_list_row"
|
|
|
+ v-for="(row, rowIndex) in tableData"
|
|
|
+ :key="`row-${rowIndex}`"
|
|
|
+ :class="{ 'active-row': selectedRowIndex === rowIndex }"
|
|
|
+ @click="handleRowClick(rowIndex)"
|
|
|
>
|
|
|
- <!-- <slot :name="col.prop" :scope="row">
|
|
|
- <span>{{ getter(row, col.prop) }}</span>
|
|
|
- </slot> -->
|
|
|
- <slot :name="col.prop" :scope="row">
|
|
|
- <component :is="renderCellComponent(row, col)" />
|
|
|
- </slot>
|
|
|
+ <!-- 第一列:单选框(固定宽度) -->
|
|
|
+ <div
|
|
|
+ v-if="showRadio"
|
|
|
+ :style="{ width: radioColumnWidth }"
|
|
|
+ class="table__content__list_item_radio"
|
|
|
+ >
|
|
|
+ <input
|
|
|
+ type="radio"
|
|
|
+ :name="radioGroupName"
|
|
|
+ :checked="selectedRowIndex === rowIndex"
|
|
|
+ @click.stop="handleRowClick(rowIndex)"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <!-- 其他列(平分剩余空间) -->
|
|
|
+ <div
|
|
|
+ v-for="(col, colIndex) in tableColumns"
|
|
|
+ :key="`cell-${rowIndex}-${colIndex}`"
|
|
|
+ :style="{ flexBasis: dataColumnFlexBasis }"
|
|
|
+ :class="`table__content__list_item_${tableConfig.type}`"
|
|
|
+ >
|
|
|
+ <!-- <slot :name="col.prop" :scope="row">
|
|
|
+ <span>{{ getter(row, col.prop) }}</span>
|
|
|
+ </slot> -->
|
|
|
+ <slot :name="col.prop" :scope="row">
|
|
|
+ <component :is="renderCellComponent(row, col)" />
|
|
|
+ </slot>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
- <!-- Board 区域 - 修改为单选切换模式 -->
|
|
|
- <div class="board-section">
|
|
|
- <!-- 1. Board 标题单选框组 -->
|
|
|
- <div class="board-selector" v-if="boardConfigList.length > 1">
|
|
|
- <label
|
|
|
- v-for="(cfg, index) in boardConfigList"
|
|
|
- :key="`selector-${index}`"
|
|
|
- class="board-radio-label"
|
|
|
- >
|
|
|
- <input
|
|
|
- type="radio"
|
|
|
- name="board-selector"
|
|
|
- :value="index"
|
|
|
- v-model="selectedBoardIndex"
|
|
|
- />
|
|
|
- <span>{{ cfg.title || `Board ${index + 1}` }}</span>
|
|
|
- </label>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- 如果只有一个 board,直接显示标题(可选,或者隐藏标题) -->
|
|
|
- <div class="board-title" v-else-if="boardConfigList.length === 1 && boardConfigList[0].title">
|
|
|
- <div class="board-title-text">{{ boardConfigList[0].title }}</div>
|
|
|
- </div>
|
|
|
+ <!-- Board 区域 - 修改为单选切换模式 -->
|
|
|
+ <div class="board-section">
|
|
|
+ <!-- 1. Board 标题单选框组 -->
|
|
|
+ <div class="board-tab-container" v-if="boardConfigList.length > 1">
|
|
|
+ <div
|
|
|
+ class="board-tab-item"
|
|
|
+ v-for="(cfg, index) in boardConfigList"
|
|
|
+ :key="`tab-${index}`"
|
|
|
+ :class="{ 'active': selectedBoardIndex === index }"
|
|
|
+ @click="selectedBoardIndex = index"
|
|
|
+ >
|
|
|
+ {{ cfg.title || `Board ${index + 1}` }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 如果只有一个 board,直接显示标题(可选,或者隐藏标题) -->
|
|
|
+ <div class="board-title" v-else-if="boardConfigList.length === 1 && boardConfigList[0].title">
|
|
|
+ <div class="board-title-text">{{ boardConfigList[0].title }}</div>
|
|
|
+ </div>
|
|
|
|
|
|
- <!-- 2. 单个 Board 内容展示区 -->
|
|
|
- <div class="board-list" v-if="currentBoardConfig">
|
|
|
- <MiniBoard
|
|
|
- v-for="(item, itemIndex) in getCurrentBoardItems()"
|
|
|
- :key="`board-item-${itemIndex}`"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- :layout="currentBoardConfig.layout || 'val-top'"
|
|
|
- :type="currentBoardConfig.type || 'D'"
|
|
|
- />
|
|
|
+ <!-- 2. 单个 Board 内容展示区 -->
|
|
|
+ <div class="board-list" v-if="currentBoardConfig">
|
|
|
+ <MiniBoard
|
|
|
+ v-for="(item, itemIndex) in getCurrentBoardItems()"
|
|
|
+ :key="`board-item-${itemIndex}`"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ :layout="currentBoardConfig.layout || 'val-top'"
|
|
|
+ :type="currentBoardConfig.type || 'D'"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
@@ -144,7 +143,7 @@
|
|
|
radioWidth?: number; // 单选框列宽度
|
|
|
}>(),
|
|
|
{
|
|
|
- showRadio: true,
|
|
|
+ showRadio: false,
|
|
|
defaultValue: '-',
|
|
|
radioWidth: 40, // 默认 40px
|
|
|
tableData: () => [],
|
|
|
@@ -314,40 +313,42 @@ const renderCellComponent = (row: any, col: TableColumn) => {
|
|
|
flex-direction: column;
|
|
|
box-sizing: border-box;
|
|
|
overflow:hidden;
|
|
|
+ border: 2px dashed #0070ff;
|
|
|
+ border-radius: 10px;
|
|
|
+ padding: 10px 5px;
|
|
|
}
|
|
|
|
|
|
.board-section {
|
|
|
height: 70%;
|
|
|
- min-height: 450px;
|
|
|
flex: none;
|
|
|
overflow: hidden;
|
|
|
- padding: 10px 0;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
|
|
|
- .board-selector {
|
|
|
+ .board-tab-container {
|
|
|
display: flex;
|
|
|
- flex-wrap: wrap;
|
|
|
- gap: 15px;
|
|
|
- padding: 0 10px;
|
|
|
- .board-radio-label {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- cursor: pointer;
|
|
|
- font-size: 14px;
|
|
|
- color: #333;
|
|
|
-
|
|
|
- input[type='radio'] {
|
|
|
- margin-right: 5px;
|
|
|
- cursor: pointer;
|
|
|
- }
|
|
|
+ background-color: #c1dbfd;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
|
|
|
- &:hover span {
|
|
|
- color: #103d82;
|
|
|
- }
|
|
|
+ .board-tab-item {
|
|
|
+ padding: 8px 12px;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #333;
|
|
|
+ cursor: pointer;
|
|
|
+ border: none;
|
|
|
+ background-color: transparent;
|
|
|
+ transition: all 0.2s ease;
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ background-color: #d0edff;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ .board-tab-item.active {
|
|
|
+ background-color: #a2c2fa;
|
|
|
+ color: black;
|
|
|
+ }
|
|
|
.board-title {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
@@ -389,6 +390,7 @@ const renderCellComponent = (row: any, col: TableColumn) => {
|
|
|
|
|
|
.table__content {
|
|
|
--image-content-label-A: url('/@/assets/images/sealedGoaf/configurable/table/table-label-A.png');
|
|
|
+ --image-content-list-active-A: url('/@/assets/images/sealedGoaf/configurable/table/table-list-active-A.png');
|
|
|
|
|
|
height: 100%;
|
|
|
box-sizing: border-box;
|
|
|
@@ -419,16 +421,24 @@ const renderCellComponent = (row: any, col: TableColumn) => {
|
|
|
overflow-y: auto;
|
|
|
.table__content_list_row {
|
|
|
width: 100%;
|
|
|
+ height: 40px;
|
|
|
+ min-height: 40px;
|
|
|
+ flex-shrink: 0;
|
|
|
display: flex;
|
|
|
justify-content: space-around;
|
|
|
align-items: center;
|
|
|
color: #fff;
|
|
|
- margin-bottom: 5px;
|
|
|
+ cursor: pointer;
|
|
|
span {
|
|
|
display: inline-block;
|
|
|
text-align: center;
|
|
|
}
|
|
|
}
|
|
|
+ .active-row {
|
|
|
+ background-image: var(--image-content-list-active-A);
|
|
|
+ background-size: 100% 100%;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.table__content_label_A {
|
|
|
@@ -538,7 +548,8 @@ const renderCellComponent = (row: any, col: TableColumn) => {
|
|
|
}
|
|
|
|
|
|
.table__content_label_D {
|
|
|
- background-image: var(--image-content-label-A);
|
|
|
+ background-color: #c1dbfd;
|
|
|
+ // background-image: var(--image-content-label-A);
|
|
|
background-size: 100% 100%;
|
|
|
background-repeat: no-repeat;
|
|
|
color: #000000;
|