update style

This commit is contained in:
Fine 2025-06-03 21:12:20 +08:00
parent ba9a787556
commit ceb8162f6b
2 changed files with 16 additions and 4 deletions

View File

@ -13,8 +13,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. --> limitations under the License. -->
<template> <template>
<el-table :data="data" class="mb-5" :row-style="{ backgroundColor: 'var(--layout-background)' }"> <el-table
<el-table-column v-for="item in metricsRows" :prop="item.value" :label="item.label" :key="item.value"> :data="data"
class="mb-5"
:row-style="{ backgroundColor: 'var(--layout-background)' }"
:cell-style="(data) => (data.columnIndex === 0 ? { backgroundColor: 'var(--el-table-header-bg-color)' } : {})"
>
<el-table-column
v-for="item in metricsRows"
:prop="item.value"
:label="item.label"
:key="item.value"
:width="item.width"
>
<template #default="scope"> <template #default="scope">
{{ scope.row && scope.row[item.value] ? (scope.row[item.value] < 0 ? "N/A" : scope.row[item.value]) : "N/A" }} {{ scope.row && scope.row[item.value] ? (scope.row[item.value] < 0 ? "N/A" : scope.row[item.value]) : "N/A" }}
</template> </template>
@ -22,11 +33,10 @@ limitations under the License. -->
</el-table> </el-table>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import type { Option } from "@/types/app";
/*global PropType, Indexable */ /*global PropType, Indexable */
defineProps({ defineProps({
metricsRows: { metricsRows: {
type: Array as PropType<Option[]>, type: Array as PropType<{ width?: number; value: string; label: string }[]>,
default: () => [], default: () => [],
}, },
data: { type: Array as PropType<Indexable[]>, default: () => [] }, data: { type: Array as PropType<Indexable[]>, default: () => [] },

View File

@ -56,6 +56,7 @@ export const MetricsTTLRow = [
{ {
label: "Type", label: "Type",
value: "type", value: "type",
width: 260,
}, },
{ {
label: "Day", label: "Day",
@ -75,6 +76,7 @@ export const RecordsTTLRow = [
{ {
label: "Type", label: "Type",
value: "type", value: "type",
width: 260,
}, },
{ {
label: "Normal", label: "Normal",