<template>
	<view class="body">
			<view class="back">
				<u-navbar back-text="" title="" :custom-back="customBack" ></u-navbar>
			</view>
		<view class="texthead">
			{{listdata.city}}职业健康信息中心注册进度表
		</view>
		<view class="texthead">
			({{listdata.year}} 年 {{listdata.month}} 月 {{listdata.day}} 日{{listdata.time}}点数量)
		</view>
		<uni-table border stripe emptyText="暂无更多数据" class="harmdata">

			<uni-tr style="background-color: #5B9BD5;color:rebeccapurple;">
				<uni-th align="center" class="colordata">企业所在区县</uni-th>
				<uni-th align="center" class="colordata">企业注册数量</uni-th>
				<uni-th align="center" class="colordata">当日新增注册企业</uni-th>
				<uni-th align="center" class="colordata">甲类</uni-th>
				<uni-th align="center" class="colordata">乙类</uni-th>
				<uni-th align="center" class="colordata">丙类</uni-th>
				<uni-th align="center" class="colordata">当日新增完成企业</uni-th>
				<uni-th align="center" class="colordata">完成分类分级企业数量</uni-th>
			</uni-tr>
			<uni-tr v-for="(item,index) in list" :key='index'>
				<uni-td align="center" style="background-color: #5B9BD5;color:#000000;">{{item.areaName}}</uni-td>
				<uni-td align="center" class="blacklist">{{item.num}}</uni-td>
				<uni-td align="center" class="redlist">{{item.zhuceNum}}</uni-td>
				<uni-td align="center" class="blacklist">{{item.jcount}}</uni-td>
				<uni-td align="center" class="blacklist">{{item.ycount}}</uni-td>
				<uni-td align="center" class="blacklist">{{item.bcount}}</uni-td>
				<uni-td align="center" style="color:red;">{{item.djnumToday}}</uni-td>
				<uni-td align="center">{{item.djnumSum}}</uni-td>
			</uni-tr>
			<uni-tr style="color:#000000;background-color: #5B9BD5">
				<uni-th align="center" width="80" style="color:#000000;">合计</uni-th>
				<uni-td align="center" class="redlist">{{listdata.num}}</uni-td>
				<uni-td align="center" class="redlist">{{listdata.zhuceNum}}</uni-td>
				<uni-td align="center" class="redlist">{{listdata.jCount}}</uni-td>
				<uni-td align="center" class="redlist">{{listdata.yCount}}</uni-td>
				<uni-td align="center" class="redlist">{{listdata.bCount}}</uni-td>
				<uni-td align="center" class="redlist">{{listdata.dJNumTodday}}</uni-td>
				<uni-td align="center" class="redlist">{{listdata.dJNumSum}}</uni-td>
			</uni-tr>
		</uni-table>
	</view>
</template>

<script>
	import {
		flfjhzStatisticsApp
	} from '@/api/statistics/statistics.js'
	export default {
		data() {
			return {
				list: [],
				listdata: [],
			}
		},
		mounted() {
			// plus.screen.lockOrientation( 'landscape-secondary');
			// #ifdef APP-PLUS
			plus.screen.lockOrientation('landscape-primary');
			// #endif
		},
		onUnload() {
			// #ifdef APP-PLUS
			plus.screen.lockOrientation('portrait-primary'); //锁死屏幕方向为竖屏
			// #endif
		},
		onShow() {
			this.infolist();
		},
		methods: {
			onBackPress() {
			  // console.log('返回')
			 uni.switchTab({
			 	//保留当前页面，跳转到应用内的某个页面
			 	url: '/pages/homepage/index'
			 })
			  return true;  // 阻止返回 不阻止就不写或者用uni.navigateBack({ delta: 1 })返回
			},

			customBack(){
				uni.switchTab({
					//保留当前页面，跳转到应用内的某个页面
					url: '/pages/Classification/Classification'
				})
				 console.log('rightClick');
			},
			infolist() {
				flfjhzStatisticsApp().then(res => {
					this.list = res.data.data
					this.listdata = res.data
					// console.log(res)
				})
			}
		}
	}
</script>

<style lang="scss">
	@function tovmin($rpx) {
		//$rpx为需要转换的字号
		@return #{$rpx * 100 / 750}vmin;
	}
	
	::v-deep .u-iconfont::before{
		font-size: tovmin(50);

		// background-color: red;
	}
	.back{
	font-size: tovmin(5) !important;
	}
	
	::v-deep .uni-table {
		min-width: 100% !important;
	}

	.texthead {
		font-weight: 700; 
		font-size: tovmin(32);
		text-align: center;
	}

	.colordata {
		color: #fff !important;

	}

	.redlist {
		color: red !important;

	}

	.blacklist {
		color: #000 !important;


	}

	.body {
		background-color: #5B9BD5;
		color: #fff;
	}
</style>
