<!-- 数据看板-设备管控-超期服役排行 -->
<template>
	<view class="equipmentControl">
		<!-- 超期服役排行 -->
		<view class="table" v-if="pageType==1">
			<view class="table-border">
				<view class="table-th">
					<view class="table-th-li">
						<view>排行</view>
						<view>学院单位</view>
						<view>设备总数(台)</view>
						<view>超期服役数(台)</view>
					</view>
				</view>
				<view class="table-tb">
					<view class="table-tb-li" v-for="(item,index) in dataList" :key="index">
						<view>
							<text :class="index==0?'sortOne':(index==1?'sortTow':(index==2?'sortThree':'sortFive'))">{{index+1}}</text>
						</view>
						<view>{{item.data2}}</view>
						<view>{{item.data2}}</view>
						<view>{{item.data2}}</view>
					</view>
				</view>
			</view>
		</view>
		<!-- 设备使用寿命 -->
		<view class="table-tow" v-if="pageType==2">
			<view class="table-border">
				<view class="table-th">
					<view class="table-th-li">
						<view>学院单位</view>
						<view>5年内(台)</view>
						<view>10年内(台)</view>
						<view>12年内(台)</view>
						<view>20年内(台)</view>
					</view>
				</view>
				<view class="table-tb">
					<view class="table-tb-li" v-for="(item,index) in dataList" :key="index">
						<view>{{item.data1}}</view>
						<view>{{item.data2}}</view>
						<view>{{item.data2}}</view>
						<view>{{item.data2}}</view>
						<view>{{item.data2}}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		config
	} from '@/api/request/config.js'
	import {

	} from '@/pages_basics/api/index.js'
	export default {
		name: "equipmentControl",
		components: {

		},
		data() {
			return {
				pageType: 1,
				// 查询参数
				queryParams: {
					page: 1,
					pageSize: 10,
				},
				dataList: [{
						data1: '植物保护',
						data2: '499',
						data3: '47',
						data4: '220',
						data5: '137',
					},
					{
						data1: '资源环境',
						data2: '199',
						data3: '7',
						data4: '120',
						data5: '37',
					},
					{
						data1: '生命科学',
						data2: '299',
						data3: '71',
						data4: '10',
						data5: '37',
					},
					{
						data1: '资源环境',
						data2: '199',
						data3: '7',
						data4: '120',
						data5: '37',
					},
					{
						data1: '生命科学',
						data2: '299',
						data3: '71',
						data4: '10',
						data5: '37',
					},
				],
				total: 0,
			}
		},
		onLoad(option) {
			if (option.pageType) {
				this.pageType = option.pageType;
				if (this.pageType == 1) {
					uni.setNavigationBarTitle({
						title: '超期服役排行'
					})
				}else if(this.pageType == 2){
					uni.setNavigationBarTitle({
						title:'设备使用寿命统计'
					})
				}
			}
		},
		created() {

		},
		beforeMount() {

		},
		mounted() {},
		methods: {
			dateClick(index) {
				this.dateIndex = index;
			},
		},
	}
</script>

<style lang="stylus" scoped>
	.equipmentControl {
		height: 100%;
		width: 100%;
		background: #363744;
		box-sizing: border-box;

		.table {
			width: 750rpx;

			.table-border {
				overflow: auto;

				.table-th {
					width: 750rpx;
					height: 80rpx;
					background: rgba(162, 162, 162, 0.2);
					padding: 0 30rpx;
					box-sizing: border-box;

					.table-th-li {
						height: 80rpx;
						display: flex;
						justify-content: flex-start;

						>view {
							font-weight: 400;
							font-size: 30rpx;
							color: #FFFFFF;
							line-height: 80rpx;
							text-align: center;
							margin-right: 18rpx;
							width: 120rpx;
							overflow: hidden;
							text-overflow: ellipsis;
							white-space: nowrap;
						}

						>view:nth-of-type(1) {
							width: 90rpx;
							text-align: left;
						}

						>view:nth-of-type(2) {
							width: 168rpx;
						}

						>view:nth-of-type(3) {
							width: 190rpx;
						}

						>view:nth-of-type(4) {
							width: 300rpx;
						}
					}
				}

				.table-tb {
					width: 750rpx;
					border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
					background: #3E414F;
					padding: 0 30rpx;
					box-sizing: border-box;

					.table-tb-li {
						height: 80rpx;
						border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
						display: flex;
						justify-content: flex-start;

						>view {
							font-weight: 400;
							font-size: 28rpx;
							color: #FFFFFF;
							line-height: 80rpx;
							text-align: center;
							margin-right: 38rpx;
							width: 120rpx;
							overflow: hidden;
							text-overflow: ellipsis;
							white-space: nowrap;

						}

						>view:nth-of-type(1) {
							width: 90rpx;
							text-align: left;
						}

						>view:nth-of-type(2) {
							width: 168rpx;
						}

						>view:nth-of-type(3) {
							width: 190rpx;
						}

						>view:nth-of-type(4) {
							width: 300rpx;
						}

					}
				}
			}

		}
		.sortOne {
			display: inline-block;
			width: 40rpx;
			height: 40rpx;
			padding: 4rpx;
			box-sizing: border-box;
			background: rgba(255, 0, 0, 0.2);
			font-weight: 400;
			font-size: 28rpx;
			color: #FF0000;
			line-height: 40rpx;
			text-align: center;
			border-radius: 20rpx;
		}
		
		.sortTow {
			display: inline-block;
			width: 40rpx;
			height: 40rpx;
			padding: 4rpx;
			box-sizing: border-box;
			background: rgba(255, 153, 0, 0.2);
			font-weight: 400;
			font-size: 28rpx;
			color: #FF9900;
			line-height: 40rpx;
			text-align: center;
			border-radius: 20rpx;
		}
		
		.sortThree {
			display: inline-block;
			width: 40rpx;
			height: 40rpx;
			padding: 4rpx;
			box-sizing: border-box;
			background: rgba(255, 242, 0, 0.2);
			font-weight: 400;
			font-size: 28rpx;
			color: #FFF200;
			line-height: 40rpx;
			text-align: center;
			border-radius: 20rpx;
		}
		
		.sortFive {
			display: inline-block;
			width: 40rpx;
			height: 40rpx;
			padding: 4rpx;
			box-sizing: border-box;
			background: rgba(1, 131, 250, 0.2);
			font-weight: 400;
			font-size: 28rpx;
			color: #0183FA;
			line-height: 40rpx;
			text-align: center;
			border-radius: 20rpx;
		}
		.table-tow {
			width: 750rpx;

			.table-border {
				overflow: auto;

				.table-th {
					width: 860rpx;
					height: 80rpx;
					background: rgba(162, 162, 162, 0.2);
					padding: 0 30rpx;
					box-sizing: border-box;

					.table-th-li {
						height: 80rpx;
						display: flex;
						justify-content: flex-start;

						>view {
							font-weight: 400;
							font-size: 30rpx;
							color: #FFFFFF;
							line-height: 80rpx;
							text-align: center;
							margin-right: 18rpx;
							width: 140rpx;
							overflow: hidden;
							text-overflow: ellipsis;
							white-space: nowrap;
						}

						>view:nth-of-type(1) {
							width: 168rpx;
							text-align: left;
						}

					}
				}

				.table-tb {
					width: 860rpx;
					border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
					background: #3E414F;
					padding: 0 30rpx;
					box-sizing: border-box;

					.table-tb-li {
						height: 80rpx;
						border-bottom: 1rpx dashed rgba(216, 216, 216, 0.2);
						display: flex;
						justify-content: flex-start;

						>view {
							font-weight: 400;
							font-size: 28rpx;
							color: #FFFFFF;
							line-height: 80rpx;
							text-align: center;
							margin-right: 38rpx;
							width: 140rpx;
							overflow: hidden;
							text-overflow: ellipsis;
							white-space: nowrap;

						}

						>view:nth-of-type(1) {
							width: 168rpx;
							text-align: left;
						}

					}
				}
			}

		}
	}
</style>
