重构
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="work-container">
|
||||
<site-switch-header :site-id="siteId" :site-type-options="siteTypeOptions" :site-address="baseInfo.siteAddress"
|
||||
:running-time="baseInfo.runningTime" @change="selectedSite" />
|
||||
:running-time="baseInfo.runningTime" :site-count="siteCount" @change="selectedSite" />
|
||||
<!-- 静态信息 -->
|
||||
<view class="base-info">
|
||||
<uni-group mode="card" class="install-data">
|
||||
@ -21,19 +21,20 @@
|
||||
</uni-grid>
|
||||
</uni-group>
|
||||
<!-- 工作台 -->
|
||||
<uni-section title="工作台" type="line" class="sections-list">
|
||||
<view class="grid-body">
|
||||
<uni-grid :column="4" :showBorder="false" @change="toDetail">
|
||||
<uni-grid-item v-for="(item,index) in siteGirdList" :index="index" :key="index+'work'">
|
||||
<view class="grid-item-box work-box">
|
||||
<view class="icon iconfont" :class="item.icon" size="30"></view>
|
||||
<text class="text">{{item.text}}</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
</uni-grid>
|
||||
</view>
|
||||
</uni-section>
|
||||
<!-- 一周充放曲线 uchart的组件最好放在同级-->
|
||||
<uni-section title="工作台" type="line" class="sections-list">
|
||||
<view class="grid-body">
|
||||
<uni-grid :column="4" :showBorder="false" @change="toDetail">
|
||||
<uni-grid-item v-for="(item,index) in siteGirdList" :index="index" :key="index+'work'">
|
||||
<view class="grid-item-box work-box">
|
||||
<image v-if="item.image" :src="item.image" class="icon icon-image" mode="aspectFit" />
|
||||
<view v-else class="icon iconfont" :class="item.icon" size="30"></view>
|
||||
<text class="text">{{item.text}}</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
</uni-grid>
|
||||
</view>
|
||||
</uni-section>
|
||||
<!-- 一周充放曲线 uchart的组件最好放在同级-->
|
||||
<uni-section title="一周充放曲线" type="line" class="sections-list">
|
||||
<date-range-select ref="weekChartDateRangeSelect" @updateDate="updateWeekChartDate" />
|
||||
<view style="width:100%;height: 250px;">
|
||||
@ -53,7 +54,7 @@
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script>
|
||||
import {
|
||||
mapGetters
|
||||
} from 'vuex'
|
||||
@ -90,9 +91,9 @@
|
||||
data() {
|
||||
return {
|
||||
// 图表数据
|
||||
weekChartTimeRange: [],
|
||||
activeChartTimeRange: [],
|
||||
weekChartData: {},
|
||||
weekChartTimeRange: [],
|
||||
activeChartTimeRange: [],
|
||||
weekChartData: {},
|
||||
activeChartData: {},
|
||||
curveDisplayData: [],
|
||||
curveDisplayLoadingPromise: null,
|
||||
@ -186,15 +187,27 @@
|
||||
page: 'dtdc',
|
||||
icon: 'icon-dantidianchi',
|
||||
text: '单体电池',
|
||||
categoryName: 'BATTERY'
|
||||
}
|
||||
]
|
||||
}
|
||||
categoryName: 'BATTERY'
|
||||
},
|
||||
{
|
||||
page: 'report',
|
||||
icon: 'icon-service',
|
||||
image: '/static/images/work/report.svg',
|
||||
text: '报表',
|
||||
categoryName: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['belongSite', 'currentSiteId']),
|
||||
siteCount() {
|
||||
return (this.siteTypeOptions || []).reduce((count, typeItem) => {
|
||||
return count + ((typeItem.children || []).length)
|
||||
}, 0)
|
||||
},
|
||||
siteGirdList() {
|
||||
return this.gridList.filter(i => this.deviceCategoryOptions.includes(i.categoryName))
|
||||
return this.gridList.filter(i => !i.categoryName || this.deviceCategoryOptions.includes(i.categoryName))
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -464,8 +477,8 @@
|
||||
onLoad() {
|
||||
this.$nextTick(() => {
|
||||
this.getSiteList()
|
||||
this.$refs.weekChartDateRangeSelect.init()
|
||||
this.$refs.activeChartDateRangeSelect.init(true)
|
||||
this.$refs.weekChartDateRangeSelect.init()
|
||||
this.$refs.activeChartDateRangeSelect.init(true)
|
||||
})
|
||||
},
|
||||
// 页面滚动 设置pageScrollTop chart显示需要
|
||||
@ -564,23 +577,28 @@
|
||||
// }
|
||||
}
|
||||
|
||||
.work-box {
|
||||
|
||||
.icon {
|
||||
font-size: 52rpx;
|
||||
color: #547ef4;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 26rpx;
|
||||
.work-box {
|
||||
|
||||
.icon {
|
||||
font-size: 52rpx;
|
||||
color: #547ef4;
|
||||
}
|
||||
|
||||
.icon-image {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 26rpx;
|
||||
padding-top: 10rpx;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.base-lists {
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
|
||||
.base-lists {
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
padding: 10rpx 20rpx;
|
||||
|
||||
Reference in New Issue
Block a user