2025-07-29 23:05:58 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<view class="work-container">
|
|
|
|
|
|
<!-- 站点选择列表 -->
|
|
|
|
|
|
<uni-section title="站点选择" type="line" titleFontSize='16px' class="uni-pa-5">
|
|
|
|
|
|
<uni-data-select :clear="false" v-model="siteId" :localdata="siteList"
|
|
|
|
|
|
@change="selectedSite"></uni-data-select>
|
|
|
|
|
|
</uni-section>
|
|
|
|
|
|
<!-- 菜单 -->
|
|
|
|
|
|
<!-- <uni-section title="工作台" type="line" titleFontSize='16px'></uni-section> -->
|
|
|
|
|
|
<view class="grid-body">
|
|
|
|
|
|
<uni-grid :column="4" :showBorder="false" @change="toDetail">
|
|
|
|
|
|
<uni-grid-item v-for="(item,index) in gridList" :index="index" :key="index+'work'">
|
|
|
|
|
|
<view class="grid-item-box">
|
2025-08-07 15:19:49 +08:00
|
|
|
|
<view class="icon iconfont" :class="item.icon" size="30"></view>
|
2025-07-29 23:05:58 +08:00
|
|
|
|
<text class="text">{{item.text}}</text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</uni-grid-item>
|
|
|
|
|
|
|
|
|
|
|
|
</uni-grid>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import {
|
|
|
|
|
|
getAllSites
|
|
|
|
|
|
} from '@/api/ems/site.js'
|
|
|
|
|
|
export default {
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
siteList: [],
|
|
|
|
|
|
siteId: '', //选择的站点ID
|
|
|
|
|
|
gridList: [{
|
|
|
|
|
|
page: 'bmszl',
|
2025-08-07 15:19:49 +08:00
|
|
|
|
icon: 'icon-BMS',
|
2025-07-29 23:05:58 +08:00
|
|
|
|
text: 'BMS总览',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
page: 'bmsdcc',
|
2025-08-07 15:19:49 +08:00
|
|
|
|
icon: 'icon-a-dianchicunengliangkuai',
|
2025-07-29 23:05:58 +08:00
|
|
|
|
text: 'BMS电池簇',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
page: 'pcs',
|
2025-08-07 15:19:49 +08:00
|
|
|
|
icon: 'icon-PCS',
|
2025-07-29 23:05:58 +08:00
|
|
|
|
text: 'PCS',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
page: 'db',
|
2025-08-07 15:19:49 +08:00
|
|
|
|
icon: 'icon-dianbiao4',
|
2025-07-29 23:05:58 +08:00
|
|
|
|
text: '电表',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
page: 'dtdc',
|
2025-08-07 15:19:49 +08:00
|
|
|
|
icon: 'icon-dantidianchi',
|
2025-07-29 23:05:58 +08:00
|
|
|
|
text: '单体电池',
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
toDetail(e) {
|
|
|
|
|
|
const {
|
|
|
|
|
|
index
|
|
|
|
|
|
} = e.detail
|
|
|
|
|
|
this.$tab.navigateTo(`/pages/work/${this.gridList[index].page}/index?siteId=${this.siteId}`)
|
|
|
|
|
|
},
|
|
|
|
|
|
selectedSite(id) {
|
|
|
|
|
|
this.siteId = id
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
// 页面切换不会重新调用,如果希望每次切换页面都重新调接口,使用onShow
|
|
|
|
|
|
mounted() {
|
|
|
|
|
|
getAllSites().then(response => {
|
|
|
|
|
|
console.log('返回数据', response)
|
|
|
|
|
|
const data = response?.data || []
|
|
|
|
|
|
this.siteList = data.map(item => {
|
|
|
|
|
|
return {
|
|
|
|
|
|
text: item.siteName,
|
|
|
|
|
|
value: item.siteId,
|
|
|
|
|
|
id: item.id
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
// 设置默认展示的站点
|
|
|
|
|
|
data.length > 0 && (this.siteId = data[0].siteId)
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
/* #ifndef APP-NVUE */
|
|
|
|
|
|
page {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
|
min-height: 100%;
|
|
|
|
|
|
height: auto;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
view {
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
line-height: inherit;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* #endif */
|
|
|
|
|
|
|
|
|
|
|
|
.text {
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
font-size: 26rpx;
|
|
|
|
|
|
margin-top: 10rpx;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.grid-item-box {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
/* #ifndef APP-NVUE */
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
/* #endif */
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
padding: 15px 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.uni-margin-wrap {
|
|
|
|
|
|
width: 690rpx;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-08-07 15:19:49 +08:00
|
|
|
|
.icon {
|
|
|
|
|
|
font-size: 26px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-07-29 23:05:58 +08:00
|
|
|
|
|
|
|
|
|
|
@media screen and (min-width: 500px) {}
|
|
|
|
|
|
</style>
|