给预警等级做颜色区分

This commit is contained in:
龙运模 2025-04-09 20:38:11 +08:00
parent 2d8e2c3c2b
commit a9705465b5
2 changed files with 16 additions and 1 deletions

View File

@ -26,6 +26,12 @@
<template #region_name="scope">
<span v-if="scope.row.region_info">{{scope.row.region_info.region_name}}</span>
</template>
<template #risk_level="scope">
<span :class="{'success':scope.row.risk_level===1,'warning':scope.row.risk_level===2,'danger':scope.row.risk_level===3}">{{scope.row['risk_level']}}</span>
</template>
<template #risk_description="scope">
<span :class="{'success':scope.row.risk_level===1,'warning':scope.row.risk_level===2,'danger':scope.row.risk_level===3}">{{scope.row['risk_description']}}</span>
</template>
<el-table-column label="操作" fixed="right" align="center" width="150">
<template #default="scope">
<el-dropdown>
@ -286,5 +292,13 @@ export default {
</script>
<style lang="scss" scoped>
.danger{
color: var(--el-color-danger);
}
.warning{
color: var(--el-color-warning);
}
.success{
color: var(--el-color-success);
}
</style>

View File

@ -19,6 +19,7 @@
</div>
</el-header>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" stripe border :size="size" :hideDo="true" :hidePagination="true" @selection-change="selectionChange">
<el-table-column type="selection" align="center" width="40"></el-table-column>
<el-table-column width="200" label="备件类别" prop="spare_parts_category"></el-table-column>
<el-table-column width="200" label="故障率" prop="failure_rate"></el-table-column>
<el-table-column width="200" label="配置人" prop="creator_name"></el-table-column>