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

285 lines
7.9 KiB
Vue
Raw Normal View History

2025-09-16 18:09:52 +08:00
<template>
2025-10-29 16:31:30 +08:00
<div>
<div class="left-warp">
<div class="top-box">
<div class="title-tip">
<div>装备总览</div>
<div class="more" @click="handleEquipOverview">更多 ></div>
</div>
<div class="equip-box">
<div style="display: flex; flex-direction: column; align-items: center">
<div class="equip-item-1">装备总数</div>
<div class="equip-item-2" @click="openSystemEquip">{{ equipData.total }} <span class="unit"></span></div>
</div>
<div style="display: flex; flex-direction: column; align-items: center">
<div class="equip-item-3">总价值</div>
<div class="equip-item-4" @click="openTotalPrice"
>{{ (equipData.totalPrice / 100000000).toFixed(4) }} <span class="unit">亿元</span></div
>
</div>
</div>
2025-09-16 18:09:52 +08:00
</div>
<div class="item-box">
<el-row :gutter="20">
<el-col :span="8" :offset="0">
2025-10-29 18:00:00 +08:00
<EquipItem title="线路装备" :state="state1" :pieValues="list1" @openDialog="openEquipItemMore(2)" />
2025-09-16 18:09:52 +08:00
</el-col>
<el-col :span="8" :offset="0">
2025-10-29 18:00:00 +08:00
<EquipItem title="变电装备" :state="state2" :pieValues="list2" @openDialog="openEquipItemMore(1)" />
2025-09-16 18:09:52 +08:00
</el-col>
<el-col :span="8" :offset="0">
2025-10-29 18:00:00 +08:00
<EquipItem title="电缆装备" :state="state3" :pieValues="list3" @openDialog="openEquipItemMore(3)" />
2025-09-16 18:09:52 +08:00
</el-col>
</el-row>
</div>
<div class="bottom-box">
2025-11-20 13:38:35 +08:00
<div class="bottom-left">
<div class="title-tip">
<div class="tip-title">单位装备配置</div>
<div class="more" @click="openEquipConfig">更多 ></div>
</div>
<div class="bottom-list">
<UnitEquipmentConfig />
</div>
</div>
</div>
<div class="bottom-box">
<div class="bottom-right">
<div class="title-tip">
<div class="tip-title">装备状态</div>
<div class="more" @click="openStatusMore">更多 ></div>
</div>
<div class="equip-status">
<EquipStatus />
</div>
<div class="bottom-explain">
<div>备注说明再用装备包含于共享装备</div>
</div>
</div>
2025-09-16 18:09:52 +08:00
</div>
</div>
2025-11-20 13:38:35 +08:00
<!-- 全量装备 -->
<AllEquip ref="allEquip" />
<!-- 单位装备配置 -->
<UnitEquipConfig ref="unitEquipConfig" />
<!-- 装备状态 -->
<EquipStatusMore ref="equipStatusMore" />
2025-09-19 18:01:05 +08:00
<TotalPriceMore ref="totalPriceMore" />
<EquipItemMore ref="equipItemMore" />
<SystemEquip ref="systemEquip" />
2025-09-22 17:47:37 +08:00
<RemarkMore ref="remarkMore" />
2025-09-16 18:09:52 +08:00
</div>
</template>
<script>
import EquipItem from './EquipItem.vue'
import UnitEquipmentConfig from './UnitEquipmentConfig.vue'
import EquipStatus from './EquipStatus.vue'
import AllEquip from './AllEquip.vue'
import UnitEquipConfig from './UnitEquipConfig.vue'
import EquipStatusMore from './EquipStatusMore.vue'
2025-09-19 18:01:05 +08:00
import TotalPriceMore from './TotalPriceMore.vue'
import EquipItemMore from './EquipItemMore.vue'
import SystemEquip from './SystemEquip.vue'
2025-09-22 17:47:37 +08:00
import RemarkMore from './RemarkMore'
2025-09-16 18:09:52 +08:00
import { getTotalEquipmentApi, getEquipmentClassificationApi } from '@/api/wsScreen'
export default {
2025-09-19 18:01:05 +08:00
components: {
EquipItem,
UnitEquipmentConfig,
EquipStatus,
AllEquip,
UnitEquipConfig,
EquipStatusMore,
EquipItemMore,
TotalPriceMore,
SystemEquip,
2025-09-22 17:47:37 +08:00
RemarkMore,
2025-09-19 18:01:05 +08:00
},
2025-09-16 18:09:52 +08:00
data() {
return {
// 装备总览
equipData: {
total: 0, // 装备总数
totalPrice: 0, // 总价值
},
state1: {},
state2: {},
state3: {},
list1: [],
list2: [],
list3: [],
}
},
created() {
this.getInfo()
this.getEquipList()
},
methods: {
async getInfo() {
try {
const res = await getTotalEquipmentApi()
console.log('🚀 ~ getInfo ~ res:', res)
this.equipData.total = res.data.totalEquipmentQuantity || 0
2025-09-19 18:01:05 +08:00
this.equipData.totalPrice = res.data.totalValue
2025-09-16 18:09:52 +08:00
} catch (error) {
console.log('🚀 ~ getInfo ~ error:', error)
}
},
async getEquipList() {
try {
const { data } = await getEquipmentClassificationApi()
console.log('🚀 ~ getEquipList ~ data:', data)
2025-09-25 19:14:29 +08:00
if (!data || data.length === 0) return
2025-10-29 16:31:30 +08:00
data.forEach((item) => {
2025-09-25 19:14:29 +08:00
if (item.targetType == 'line') {
this.state1.num = item.num || 0
this.state1.price = item.price || 0
this.list1[0] = item.five
this.list1[1] = item.fiveOrTen
this.list1[2] = item.ten
} else if (item.targetType == 'cable') {
this.state2.num = item.num || 0
this.state2.price = item.price || 0
this.list2[0] = item.five
this.list2[1] = item.fiveOrTen
this.list2[2] = item.ten
} else if (item.targetType == 'substation') {
this.state3.num = item.num || 0
this.state3.price = item.price || 0
this.list3[0] = item.five
this.list3[1] = item.fiveOrTen
this.list3[2] = item.ten
}
})
2025-09-16 18:09:52 +08:00
} catch (error) {
console.log('🚀 ~ getEquipList ~ error:', error)
}
},
handleEquipOverview() {
this.$refs.allEquip.openDialog()
},
openEquipConfig() {
this.$refs.unitEquipConfig.openDialog()
},
openStatusMore() {
this.$refs.equipStatusMore.openDialog()
},
2025-09-19 18:01:05 +08:00
openTotalPrice() {
this.$refs.totalPriceMore.openDialog()
},
openSystemEquip() {
this.$refs.systemEquip.openDialog()
},
2025-10-16 16:37:41 +08:00
openEquipItemMore(type) {
this.$refs.equipItemMore.openDialog(type)
2025-09-19 18:01:05 +08:00
},
2025-09-22 17:47:37 +08:00
openRemarkMore() {
this.$refs.remarkMore.openDialog()
},
2025-09-16 18:09:52 +08:00
},
}
</script>
<style lang="scss" scoped>
.left-warp {
2025-11-20 13:38:35 +08:00
height: calc(100vh - 100px);
2025-10-29 16:31:30 +08:00
display: flex;
flex-direction: column;
justify-content: space-between;
2025-09-16 18:09:52 +08:00
.title-tip {
display: flex;
justify-content: space-between;
2025-10-29 16:31:30 +08:00
/* padding-top: 8px; */
2025-09-16 18:09:52 +08:00
padding-left: 40px;
font-family: DS-TITLE;
background: linear-gradient(to bottom, #f0f5f8, #5eb6f0);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
.more {
margin-right: 20px;
color: #5fbbdb;
cursor: pointer;
font-weight: 600;
font-family: '';
}
}
.top-box {
2025-10-29 16:31:30 +08:00
/* height: 350px; */
2025-11-20 13:38:35 +08:00
height: 18%;
2025-09-16 18:09:52 +08:00
background-image: url('../../img/equipmentOverview.png');
background-size: 100% 100%;
.equip-box {
2025-10-29 16:31:30 +08:00
padding-left: 20px;
2025-11-20 13:38:35 +08:00
/* margin-top: 20px; */
/* margin-bottom: 13px; */
height: 100px;
2025-09-16 18:09:52 +08:00
background-image: url('../../img/equipmentOverviewData.png');
background-size: 100% 100%;
2025-10-29 16:31:30 +08:00
/* position: relative; */
display: flex;
justify-content: space-around;
align-items: center;
2025-09-16 18:09:52 +08:00
.unit {
font-size: 15px;
color: #ccc;
}
.equip-item-1 {
2025-10-29 16:31:30 +08:00
margin-bottom: 15px;
2025-09-16 18:09:52 +08:00
}
.equip-item-2 {
color: #fefbdc;
font-size: 28px;
font-weight: 800;
2025-09-19 18:01:05 +08:00
cursor: pointer;
2025-09-16 18:09:52 +08:00
}
.equip-item-3 {
2025-10-29 16:31:30 +08:00
margin-bottom: 15px;
2025-09-16 18:09:52 +08:00
}
.equip-item-4 {
color: #fefbdc;
font-size: 28px;
font-weight: 800;
2025-09-19 18:01:05 +08:00
cursor: pointer;
2025-09-16 18:09:52 +08:00
}
}
2025-10-29 16:31:30 +08:00
}
.item-box {
padding: 0 20px;
2025-09-16 18:09:52 +08:00
}
.bottom-box {
.bottom-explain {
2025-10-29 16:31:30 +08:00
margin-top: 15px;
2025-09-16 18:09:52 +08:00
color: #97aad6;
font-size: 12px;
display: flex;
2025-11-20 13:38:35 +08:00
justify-content: center;
2025-09-22 17:47:37 +08:00
cursor: pointer;
2025-09-16 18:09:52 +08:00
}
.bottom-tip {
}
.bottom-left {
2025-11-20 13:38:35 +08:00
height: 210px;
2025-09-16 18:09:52 +08:00
background-image: url('../../img/unit-equip.png');
2025-11-20 13:38:35 +08:00
background-size: 100% 100%;
2025-09-16 18:09:52 +08:00
.bottom-list {
2025-11-20 13:38:35 +08:00
margin: 5px 0 10px;
height: 165px;
2025-09-16 18:09:52 +08:00
overflow: auto;
}
}
.bottom-right {
2025-10-29 16:31:30 +08:00
/* height: 250px; */
2025-09-16 18:09:52 +08:00
background-image: url('../../img/equip-status.png');
2025-11-20 13:38:35 +08:00
background-size: 100% 100%;
2025-09-16 18:09:52 +08:00
}
}
}
</style>