<!-- 数据看板-资源预约 -->
<template>
	<view class="resourceReservation">
		<view class="chart">
			<view class="chart-t">
				<viwe class="chart-t-l">
					<text>资源总数：</text>
					<text>965</text>
				</viwe>
				<viwe class="chart-tab">
					<view class="chart-tab-li" :class="chartTabIndex==index?'tab-A':'tab-B'"
						v-for="(item,index) in chartTabList" :key="index" @click="chartTabClick(index)">{{item}}</view>
				</viwe>
			</view>
			<view class="chart-b">
				<view class="chart-b-t">
					<view class="chart-b-t-li">
						<qiun-data-charts type="arcbar" :opts="opts" :chartData="chartData" />
					</view>
					<view class="chart-b-t-li">
						<qiun-data-charts type="arcbar" :opts="opts2" :chartData="chartData2" />
					</view>
					<view class="chart-b-t-li">
						<qiun-data-charts type="arcbar" :opts="opts3" :chartData="chartData3" />
					</view>
				</view>
				<view class="chart-b-b">
					<view class="chart-b-li">
						<view>总数：200 </view>
						<view>预约数：50</view>
					</view>
					<view class="chart-b-li">
						<view>总数：100 </view>
						<view>预约数：60</view>
					</view>
					<view class="chart-b-li">
						<view>总数：230 </view>
						<view>预约数：60</view>
					</view>
				</view>
			</view>
		</view>
		<view class="small-title">
			<view class="small-title-l">安全隐患统计</view>
		</view>
		<view class="small-title-tow">
			<view class="small-title-tow-l">安全检查校级巡查计划标题标题标题标题标题</view>
			<img class="small-title-tow-r" src="@/pages/images/dataBoard/icon_06.png">
		</view>
		<view class="chart-tow">
			<view class="chart-tow-b">
				<qiun-data-charts type="radar" :opts="optsTow" :echartsH5="true" :chartData="chartDataTow" />
			</view>
		</view>
	</view>
</template>

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

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

		},
		data() {
			return {
				opts: {
					color: ["#fff",],
					padding: undefined,
					title: {
						name: "温室",
						fontSize: 15,
						color: "#fff"
					},
					subtitle: {
						name: "89%",
						fontSize: 15,
						color: "#FF5201"
					},
					extra: {
						arcbar: {
							type: "default",
							width: 6,
							backgroundColor: "#E9E9E9",
							startAngle: 0,
							endAngle: 1.5,
							gap: 2,
						}
					}
				},
				chartData: {},
				opts2: {
					color: ["#fff",],
					padding: undefined,
					title: {
						name: "温室",
						fontSize: 15,
						color: "#fff"
					},
					subtitle: {
						name: "89%",
						fontSize: 15,
						color: "#04A44C"
					},
					extra: {
						arcbar: {
							type: "default",
							width: 6,
							backgroundColor: "#E9E9E9",
							startAngle: 0,
							endAngle: 1.5,
							gap: 2,
						}
					}
				},
				chartData2: {},
				opts3: {
					color: ["#fff",],
					padding: undefined,
					title: {
						name: "温室",
						fontSize: 15,
						color: "#fff"
					},
					subtitle: {
						name: "89%",
						fontSize: 15,
						color: "#0283FA"
					},
					extra: {
						arcbar: {
							type: "default",
							width: 6,
							backgroundColor: "#E9E9E9",
							startAngle: 0,
							endAngle: 1.5,
							gap: 2,
						}
					}
				},
				chartData3: {},
				optsTow: {
					color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
						"#ea7ccc"
					],
					padding: [5, 5, 5, 5],
					dataLabel: false,
					enableScroll: false,
					legend: {
						show: false,
						position: "right",
						lineHeight: 25
					},
					extra: {
						radar: {
							gridType: "radar",
							gridColor: "#CCCCCC",
							gridCount: 3,
							opacity: 0.2,
							max: 200,
							labelShow: true,
							border: true,
							labelColor:'#fff',
						}
					}
				},
				chartDataTow: {},
				chartTabList: ['日', '月', '年'],
				chartTabIndex: 0,
				chartTabListTow: ['按资费', '按机时', '按样品'],
				chartTabIndexTow: 0,
				// 查询参数
				queryParams: {
					page: 1,
					pageSize: 10,
				},
				dataList: [{
						data1: '学院学院简称',
						data2: '666',
					},
					{
						data1: '学院学院简称',
						data2: '666',
					},
					{
						data1: '学院学院简称',
						data2: '666',
					},
					{
						data1: '学院学院简称',
						data2: '666',
					},
				],
				total: 0,
			}
		},
		created() {

		},
		beforeMount() {

		},
		mounted() {
			this.getServerData();
			this.getServerData2();
			this.getServerData3();
			this.getServerDataTow();
		},
		methods: {
			getServerData() {
				//模拟从服务器获取数据时的延时
				setTimeout(() => {
					//模拟服务器返回数据，如果数据格式和标准格式不同，需自行按下面的格式拼接
					let res = {
						series: [{
							name: "温室",
							color: "#FF5201",
							data: 0.8
						}]
					};
					this.chartData = JSON.parse(JSON.stringify(res));
				}, 500);
			},
			getServerData2() {
				//模拟从服务器获取数据时的延时
				setTimeout(() => {
					//模拟服务器返回数据，如果数据格式和标准格式不同，需自行按下面的格式拼接
					let res = {
						series: [{
							name: "自然室",
							color: "#04A44C",
							data: 0.8
						}]
					};
					this.chartData2 = JSON.parse(JSON.stringify(res));
				}, 500);
			},
			getServerData3() {
				//模拟从服务器获取数据时的延时
				setTimeout(() => {
					//模拟服务器返回数据，如果数据格式和标准格式不同，需自行按下面的格式拼接
					let res = {
						series: [{
							name: "冷库",
							color: "#0283FA",
							data: 0.8
						}]
					};
					this.chartData3 = JSON.parse(JSON.stringify(res));
				}, 500);
			},
			getServerDataTow() {
				//模拟从服务器获取数据时的延时
				setTimeout(() => {
					//模拟服务器返回数据，如果数据格式和标准格式不同，需自行按下面的格式拼接
					let res = {
						categories: ["测定仪", "色谱仪", "分析仪", "光度计", "离子色谱仪"],
						series: [{
								name: "成交量1",
								data: [90, 110, 165, 195, 187]
							},
							{
								name: "成交量2",
								data: [190, 210, 105, 35, 27]
							}
						]
					};
					this.chartDataTow = JSON.parse(JSON.stringify(res));
				}, 500);
			},
			chartTabClick(index) {
				this.chartTabIndex = index;
			},
			chartTabClickTow(index) {
				this.chartTabIndexTow = index;
			},
		},
	}
</script>

<style lang="stylus" scoped>
	.resourceReservation {
		height: 100%;
		width: 100%;
		background: #363744;
		padding: 20rpx 0rpx 0;
		box-sizing: border-box;


		.chart {
			width: 690rpx;
			height: 380rpx;
			background: #3E414F;
			border-radius: 20rpx 20rpx 20rpx 20rpx;
			overflow: hidden;
			margin: 0 30rpx;

			.chart-t {
				display: flex;
				justify-content: space-between;
				align-items: center;
				height: 50rpx;
				margin-top: 30rpx;
				padding: 0 24rpx 0 42rpx;
				box-sizing: border-box;

				.chart-t-l {
					>text {
						font-weight: 400;
						font-size: 30rpx;
						color: #FFFFFF;
						line-height: 42rpx;
					}

					>text:nth-of-type(1) {
						color: #FFFFFF;
					}

					>text:nth-of-type(2) {
						color: #0183FA;
					}
				}

				.chart-tab {
					width: 120rpx;
					height: 50rpx;
					border-radius: 10rpx;
					overflow: hidden;
					border: 1rpx solid #52545F;
					display: flex;
					justify-content: flex-start;

					.chart-tab-li {
						width: 60rpx;
						font-weight: 400;
						font-size: 28rpx;
						color: #999999;
						line-height: 50rpx;
						text-align: center;
					}

					.chart-tab-li:nth-of-type(1) {
						border-right: 1rpx solid #52545F;
					}

					.chart-tab-li:nth-of-type(2) {
						border-right: 1rpx solid #52545F;
					}

					.tab-A {
						color: #FFFFFF;
						background: #0183FA;
					}

					.tab-B {
						color: #999999;
						background: none;
					}

				}
			}

			.chart-b {
				width: 690rpx;
				height: 300rpx;
				padding: 0 30rpx;
				box-sizing: border-box;

				.chart-b-t {
					display: flex;
					justify-content: flex-start;
					width: 690rpx;

					.chart-b-t-li {
						width: 210rpx;
						height: 210rpx;
					}
				}

				.chart-b-b {
					display: flex;
					justify-content: flex-start;

					.chart-b-li {
						flex: 1;

						>view {
							font-weight: 400;
							font-size: 28rpx;
							color: #FFFFFF;
							line-height: 39rpx;
							text-align: center;
						}
					}
				}

			}
		}


		.small-title {
			width: 690rpx;
			height: 50rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin: 24rpx 30rpx;

			.small-title-l {
				font-weight: 400;
				font-size: 32rpx;
				color: #FFFFFF;
				line-height: 45rpx;
			}

			.chart-tab-tow {
				width: 300rpx;
				height: 50rpx;
				border-radius: 25rpx;
				overflow: hidden;
				border: 1rpx solid #52545F;
				display: flex;
				justify-content: flex-start;

				.chart-tab-li {
					width: 100rpx;
					font-weight: 400;
					font-size: 28rpx;
					color: #999999;
					line-height: 50rpx;
					text-align: center;
				}

				.chart-tab-li:nth-of-type(1) {
					border-right: 1rpx solid #52545F;
				}

				.chart-tab-li:nth-of-type(2) {
					border-right: 1rpx solid #52545F;
				}

				.tab-A {
					color: #FFFFFF;
					background: #0183FA;
				}

				.tab-B {
					color: #999999;
					background: none;
				}

			}
		}


		.small-title-tow {
			width: 750rpx;
			height: 80rpx;
			background: #3E414F;
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 0 20rpx 0 30rpx;
			box-sizing: border-box;
			margin-top: 2rpx;

			.small-title-tow-l {
				flex: 1;
				font-weight: 400;
				font-size: 30rpx;
				color: #FFFFFF;
				line-height: 42rpx;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
			}

			.small-title-tow-r {
				width: 14rpx;
				height: 8rpx;
			}

		}

		.chart-tow {
			width: 690rpx;
			height: 480rpx;
			background: #3E414F;
			border-radius: 20rpx 20rpx 20rpx 30rpx;
			margin: 26rpx 30rpx 0;

			.chart-tow-b {
				width: 690rpx;
				height: 480rpx;
			}
		}
	}
</style>
