This commit is contained in:
liuye
2022-01-11 16:24:43 +08:00
parent 2cbcf2198c
commit 1b8d5a4ddb
2 changed files with 88 additions and 12 deletions

View File

@@ -5,31 +5,31 @@
<div class="content-info">
<div class="title">
<h2>实时数据统计</h2>
<div>截止2021-01-19</div>
<div>截止{{toadyText}}</div>
</div>
<div class="tab-content">
<div class="tab-item">
<h2 class="color-5AAD6A">30446</h2>
<h2 class="color-5AAD6A">{{totalInfo.back1}}</h2>
<p>返乡人数</p>
</div>
<div class="tab-item">
<h2 class="color-4185F5">304</h2>
<h2 class="color-4185F5">{{totalInfo.back2}}</h2>
<p>今日新增返乡</p>
</div>
<div class="tab-item">
<h2 class="color-CD413A">3</h2>
<h2 class="color-CD413A">{{totalInfo.back3}}</h2>
<p>今日返乡异常</p>
</div>
<div class="tab-item">
<h2 class="color-5AAD6A">30446</h2>
<h2 class="color-5AAD6A">{{totalInfo.report1}}</h2>
<p>健康上报人数</p>
</div>
<div class="tab-item">
<h2 class="color-4185F5">46</h2>
<h2 class="color-4185F5">{{totalInfo.report2}}</h2>
<p>今日上报人数</p>
</div>
<div class="tab-item">
<h2 class="color-CD413A">0</h2>
<h2 class="color-CD413A">{{totalInfo.report3}}</h2>
<p>今日上报异常</p>
</div>
</div>
@@ -41,7 +41,7 @@
</div>
<div class="echart-content">
<div class="title">返乡数据统计</div>
<div class="echart"></div>
<div class="echart" id="statistic"></div>
<div class="type-text"><span class="tips bg-32C5FF"></span>新增返乡人数 <span class="tips bg-FFAA44"></span>新增异常人数</div>
</div>
</div>
@@ -49,18 +49,95 @@
<script>
import { mapState } from 'vuex'
import echarts from 'echarts'
export default {
name: 'AppEpidemicSituation',
appName: '疫情防控',
data() {
return {}
return {
toadyText: '',
totalInfo: {},
echartData: null
}
},
computed: { ...mapState(['user']) },
onShow() {
document.title = '疫情防控'
},
onLoad() {
var date = new Date();
this.toadyText = date.getFullYear() + '-' + date.getMonth()+1 + '-' + date.getDate()
this.getTotal()
},
methods: {
getTotal() {
this.$http.post(`/app/appepidemicbackhomerecord/statisticForQW`).then((res) => {
if (res.code == 0) {
this.totalInfo = res.data.map
var xData = [], yDataBack = [], yDataError = []
for(let key in res.data.fiveTotal){
xData.push(key)
yDataBack.push(res.data.fiveTotal[key])
}
for(let key in res.data.fiveUnusual){
yDataError.push(res.data.fiveUnusual[key])
}
this.chartInit(xData, yDataBack, yDataError)
}
})
},
chartInit(xData, yDataBack, yDataError) {
console.log(xData)
this.echartData = echarts.init(document.getElementById('statistic'))
var option = {
grid: {
left: '6%',
right: '8%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'category',
boundaryGap: false,
data: xData
},
yAxis: {
type: 'value'
},
series: [
{
type: 'line',
data: yDataBack,
lineStyle: {
normal: {
color: '#32c5ff'
}
},
itemStyle : {
normal : {
color:'#32c5ff',
}
}
},
{
type: 'line',
data: yDataError,
lineStyle: {
normal: {
color: '#ffaa44'
}
},
itemStyle : {
normal : {
color:'#ffaa44',
}
}
},
]
};
this.echartData.setOption(option)
},
toHealth(){
uni.navigateTo({
url:`./Health`

View File

@@ -102,8 +102,7 @@
</div>
</div>
<div class="line-bg" style="padding-bottom: 56px;"></div>
<div class="footer" @click="toError">异常情况处理</div>
<!-- v-if="info.status != 1" -->
<div class="footer" @click="toError" v-if="info.status != 1">异常情况处理</div>
</div>
</template>