bonus-ui/src/views/screen/gwScreen/components/right/UsageRateSituationList.vue

205 lines
4.5 KiB
Vue
Raw Normal View History

2025-11-19 18:08:59 +08:00
<template>
<div class="table-style">
<div class="title-tip">
2025-12-02 10:46:12 +08:00
<div class="small_title">各网省装备在用率情况</div>
<div class="more" @click="openDialog">更多 ></div>
2025-11-19 18:08:59 +08:00
</div>
<div class="table-list scroll-container">
<table cellspacing="0" cellpadding="8" style="width: 100%; border-collapse: collapse; text-align: center">
<!-- 双层表头 -->
<thead>
<!-- 第一行跨列合并 -->
<tr>
<th>排名</th>
<th>单位名称</th>
<th>在用率</th>
<th>周转率</th>
</tr>
</thead>
<!-- 表体使用 v-for 渲染数据 -->
<tbody>
<tr v-for="(row, index) in tableData" :key="index">
2025-12-02 10:46:12 +08:00
<td class="num index-num" style="width: 50px">{{ index + 1 }}</td>
2025-11-19 18:08:59 +08:00
<td style="width: 200px">{{ row.name }}</td>
2025-12-02 10:46:12 +08:00
<td class="num">{{ row.proportion }} %</td>
<td>
<span class="num">{{ row.turnoverRate }}</span> <span style="font-size: 14px">/</span></td
>
2025-11-19 18:08:59 +08:00
</tr>
</tbody>
</table>
</div>
</div>
</template>
<script>
import { getDeptEquipmentApi } from '@/api/wsScreen'
export default {
data() {
return {
2025-11-20 10:08:35 +08:00
tableData: [
{
name: '安徽省',
proportion: '61.55',
turnoverRate: '2.55',
},
{
name: '山西',
proportion: '48.25',
turnoverRate: '2.34',
},
{
name: '河北',
proportion: '42.36',
turnoverRate: '2.23',
},
{
name: '江苏',
proportion: '39.56',
turnoverRate: '1,91',
},
{
name: '山东',
proportion: '36.05',
turnoverRate: '1.81',
},
],
2025-11-19 18:08:59 +08:00
}
},
created() {
2025-11-20 10:08:35 +08:00
// this.getList()
2025-11-19 18:08:59 +08:00
},
methods: {
async getList() {
try {
const res = await getDeptEquipmentApi()
console.log('🚀 ~ 各单位装备在用率情况 ~ res:', res)
this.tableData = res.data || []
} catch (error) {
console.log('🚀 ~ 各单位装备在用率情况 ~ error:', error)
}
},
openDialog() {
this.$emit('openDialog')
},
},
}
</script>
<style lang="scss" scoped>
.table-style {
height: 350px;
}
2025-12-02 10:46:12 +08:00
.num {
font-size: 20px;
font-weight: 800;
font-family: 'DIN';
}
.index-num {
background: linear-gradient(180deg, #fff 19.35%, #5dcbfe 77.42%);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
2025-11-19 18:08:59 +08:00
.title-tip {
display: flex;
justify-content: space-between;
padding-top: 10px;
padding-left: 45px;
font-family: DS-TITLE;
background: linear-gradient(to bottom, #f0f5f8, #5eb6f0);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
.more {
margin-right: 20px;
2025-12-02 10:46:12 +08:00
color: #5b99ad;
cursor: pointer;
font-weight: 400;
font-family: '';
font-size: 12px;
/* 清除背景渐变相关属性 */
background: none;
background-clip: unset;
-webkit-background-clip: unset;
-webkit-text-fill-color: #5b99ad;
2025-11-19 18:08:59 +08:00
}
2025-12-02 10:46:12 +08:00
.small_title {
margin-left: 10px;
font-size: 20px;
font-weight: 500;
background: linear-gradient(180deg, #FFF 19.35%, #5DCBFE 77.42%);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
2025-11-19 18:08:59 +08:00
}
.table-list {
margin-top: 20px;
height: 280px;
overflow: auto;
}
table {
border-collapse: collapse;
width: 100%;
2025-11-23 15:06:49 +08:00
font-family: 'Alibaba-PuHuiTi-Regular';
2025-11-19 18:08:59 +08:00
font-size: 11px;
}
th,
td {
padding: 10px;
text-align: center;
white-space: nowrap;
2025-12-02 10:46:12 +08:00
// border: 1px solid rgba(255, 255, 255, 0.3); // 边框颜色可根据背景调整
2025-11-19 18:08:59 +08:00
}
th {
/* background-color: #f5f5f5; */
font-weight: bold;
}
// 第一行背景
thead {
background-image: url('../../img/tableHeader.png');
background-size: 100% 100%;
2025-12-02 10:46:12 +08:00
color: #7BBBF8;
2025-11-19 18:08:59 +08:00
}
tbody tr {
background-image: url('../../img/tableTr.png');
background-size: 100% 100%;
}
/* 奇偶行颜色区分 */
tbody tr:nth-child(even) {
/* margin: 10px 0; */
}
tbody tr:hover {
background-image: url('../../img/table-hover.png');
cursor: pointer;
}
.scroll-container {
width: 100%;
overflow: auto;
/* 隐藏滚动条轨迹 */
2025-12-02 10:46:12 +08:00
-ms-overflow-style: none; /* IE / Edge */
scrollbar-width: none; /* Firefox */
2025-11-19 18:08:59 +08:00
}
/* Chrome / Safari */
.scroll-container::-webkit-scrollbar {
2025-12-02 10:46:12 +08:00
width: 0; /* 或者直接隐藏 */
2025-11-19 18:08:59 +08:00
height: 0;
background: transparent; /* 背景透明 */
}
</style>