bonus-ui/src/views/screen/wsScreen/components/left/UnitEquipmentConfig.vue

164 lines
3.9 KiB
Vue
Raw Normal View History

2025-09-16 18:09:52 +08:00
<template>
2025-09-28 15:40:00 +08:00
<div class="scroll-container">
2025-11-24 18:27:40 +08:00
<!-- 表头 -->
<table class="table-head">
2025-09-16 18:09:52 +08:00
<thead>
<tr>
2025-11-24 18:27:40 +08:00
<th rowspan="2" style="width: 30px">序号</th>
<th rowspan="2" style="width: 110px">单位名称</th>
<th rowspan="2" style="width: 60px">装备价值亿元</th>
2025-09-16 18:09:52 +08:00
<th colspan="4">装备数量</th>
<th colspan="4">配置率</th>
</tr>
<tr>
<th>总数</th>
<th>线路</th>
<th>变电</th>
<th>电缆</th>
<th>总数</th>
<th>线路</th>
<th>变电</th>
<th>电缆</th>
</tr>
</thead>
2025-11-24 18:27:40 +08:00
</table>
2025-09-16 18:09:52 +08:00
2025-11-24 18:27:40 +08:00
<!-- 内容 -->
<table class="table-body">
2025-09-16 18:09:52 +08:00
<tbody>
<tr v-for="(row, index) in tableData" :key="index">
2025-11-24 18:27:40 +08:00
<td class="index-num" style="width: 30px">{{ index + 1 }}</td>
<td style="width: 110px; font-size: 14px">{{ row.deptName }}</td>
2025-11-25 11:17:46 +08:00
<td class="num-yellow" style="width: 60px">{{ row.totalValue ? (row.totalValue / 100000000).toFixed(4) : 0 }}</td>
2025-09-16 18:09:52 +08:00
2025-11-25 11:17:46 +08:00
<td class="num-yellow">{{ row.totalEquipmentQuantity }}</td>
2025-11-24 18:27:40 +08:00
<td class="index-num">{{ row.lineNum }}</td>
<td class="index-num">{{ row.substationNum }}</td>
<td class="index-num">{{ row.cableNum }}</td>
2025-09-16 18:09:52 +08:00
2025-11-25 11:17:46 +08:00
<td class="num-yellow">{{ row.configRate }}</td>
2025-11-24 18:27:40 +08:00
<td class="index-num">{{ row.valueA }}</td>
<td class="index-num">{{ row.valueB }}</td>
<td class="index-num">{{ row.valueC }}</td>
2025-09-16 18:09:52 +08:00
</tr>
</tbody>
</table>
</div>
</template>
<script>
import { getUnitEquipmentConfigurationApi } from '@/api/wsScreen/index'
export default {
data() {
return {
tableData: [],
}
},
created() {
this.getList()
},
methods: {
async getList() {
try {
const res = await getUnitEquipmentConfigurationApi()
console.log('🚀 ~ getList ~ res:', res)
if (!res.data) return
this.tableData = res.data || []
2025-11-24 18:27:40 +08:00
if (this.tableData.length > 3) this.tableData = this.tableData.slice(0, 3)
2025-09-16 18:09:52 +08:00
} catch (error) {
console.log('🚀 ~ getList ~ error:', error)
}
},
},
}
</script>
<style lang="scss" scoped>
2025-11-24 18:27:40 +08:00
.table-head {
width: 100%;
2025-09-16 18:09:52 +08:00
border-collapse: collapse;
2025-11-24 18:27:40 +08:00
}
.table-body {
width: 100%;
border-collapse: separate;
border-spacing: 0 5px;
}
.index-num {
/* width: 30px; */
font-size: 18px;
font-weight: 800;
background: linear-gradient(to bottom, #f0f5f8, #5eb6f0);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-family: 'DIN';
}
2025-11-25 11:17:46 +08:00
.num-yellow {
font-size: 18px;
font-weight: 800;
background: linear-gradient(180deg, #FFF 25.81%, #FDF277 77.42%);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
2025-11-24 18:27:40 +08:00
table {
2025-09-16 18:09:52 +08:00
width: 100%;
2025-11-23 15:06:49 +08:00
font-family: 'Alibaba-PuHuiTi-Regular';
2025-09-16 18:09:52 +08:00
font-size: 11px;
}
th,
td {
2025-11-24 18:27:40 +08:00
/* padding: 9px 3px; */
2025-09-16 18:09:52 +08:00
text-align: center;
2025-11-24 18:27:40 +08:00
/* white-space: nowrap; */
border: 0.5px solid #254e7c; // 边框颜色可根据背景调整
2025-09-16 18:09:52 +08:00
}
th {
/* background-color: #f5f5f5; */
font-weight: bold;
}
// 第一行背景
thead {
background-image: url('../../img/tableHeader.png');
background-size: 100% 100%;
2025-11-24 18:27:40 +08:00
height: 57px;
font-size: 12px;
color: #5A89BE;
2025-09-16 18:09:52 +08:00
}
tbody tr {
background-image: url('../../img/tableTr.png');
background-size: 100% 100%;
2025-11-24 18:27:40 +08:00
height: 44px;
2025-09-16 18:09:52 +08:00
}
/* 奇偶行颜色区分 */
tbody tr:nth-child(even) {
/* margin: 10px 0; */
}
tbody tr:hover {
background-image: url('../../img/table-hover.png');
cursor: pointer;
}
2025-09-28 15:40:00 +08:00
.scroll-container {
width: 100%;
height: 100%;
overflow: auto;
/* 隐藏滚动条轨迹 */
2025-11-24 18:27:40 +08:00
-ms-overflow-style: none; /* IE / Edge */
scrollbar-width: none; /* Firefox */
2025-09-28 15:40:00 +08:00
}
/* Chrome / Safari */
.scroll-container::-webkit-scrollbar {
2025-11-24 18:27:40 +08:00
width: 0; /* 或者直接隐藏 */
2025-09-28 15:40:00 +08:00
height: 0;
background: transparent; /* 背景透明 */
}
2025-09-16 18:09:52 +08:00
</style>