<template>
	<view class="page-body">
		<page-header :name="'副斜井绞车'" :bg="'#1560e0'" :showLeft="true" @goBack="goBack()"></page-header>
		<view class="scroll-wrap">
			<view class="basic-info-wrap">
				<view class="info-wrap">
					<view v-for="(item,index) in list" class="data-item-wrap">
						<view class="title">{{ item.name }}</view>
						<view class="data">{{ item.params }}</view>
					</view>
				</view>
				<view class="radius-wrap"></view>
			</view>
			<view class="detail-info-wrap">
				<page-card v-for="(item, index) in itemList" :key="index" style="margin-bottom: 30rpx;" :notShow="true"
					:name="item.name">
					<template v-slot:content>
						<simple-table :tableHead="tableHead" :list="item.params"></simple-table>
					</template>
				</page-card>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
					name: '提升高度',
					params: '25m'
				}, {
					name: '提升速度',
					params: '18m/s'
				}, {
					name: '制动油压',
					params: '0.07Mpa'
				}, {
					name: '电枢电流',
					params: '22.86A'
				}, {
					name: '励磁电流',
					params: '22.45A'
				}, {
					name: '润滑油压',
					params: '0.11Mpa'
				}, {
					name: '电机温度1',
					params: '82.5℃'
				}, {
					name: '电机温度2',
					params: '85.3℃'
				}],
				tableHead: ['名称', '深指', '行控'], // 表名
				itemList: [{
					name: '提升',
					params: [{
						name: '过卷',
						params: [{
							status: 1
						}, {
							status: 1
						}]
					}, {
						name: '停车',
						params: [{
							status: 1
						}, {
							status: 1
						}]
					}, {
						name: '校正',
						params: [{
							status: 1
						}, {
							status: 1
						}]
					}, {
						name: '减速',
						params: [{
							status: 1
						}, {
							status: 0
						}]
					}]
				}, {
					name: '下放',
					params: [{
						name: '过卷',
						params: [{
							status: 1
						}, {
							status: 1
						}]
					}, {
						name: '停车',
						params: [{
							status: 1
						}, {
							status: 1
						}]
					}, {
						name: '校正',
						params: [{
							status: 0
						}, {
							status: 1
						}]
					}, {
						name: '减速',
						params: [{
							status: 1
						}, {
							status: 1
						}]
					}]
				}]
			}
		},
		onLoad() {
			this.getData()
		},
		methods: {
			goBack() { // 返回上一頁面
				uni.navigateBack()
			},
			async getData() {
				let res = await this.$http({
					url: `/qsy/dcs/transform/fxjjc`,
					method: 'POST'
				})
				this.list = res.data.data.list
				this.itemList = res.data.data.itemList
			}
		}
	}
</script>

<style scoped lang="scss">
	.page-body {
		.scroll-wrap {
			height: calc(100vh - 85rpx);
			overflow: scroll;

			.basic-info-wrap {
				position: relative;
				height: auto;
				padding: 50rpx 49rpx 80rpx;
				background: url(../../../static/page_bg.png);
				background-size: 110%;

				.info-wrap {
					display: flex;
					flex-wrap: wrap;

					.data-item-wrap {
						width: 33.33%;
						padding: 9rpx 0;
						min-height: 81rpx;
						text-align: center;
						margin-top: 48rpx;
						border-right: 1px solid #FFFFFF;

						.title {
							font-size: 22rpx;
							color: #FFFFFF;
							margin-bottom: 14rpx;
						}

						.data {
							font-weight: 700;
							font-size: 32rpx;
							color: #FFF600;
						}
					}

					.data-item-wrap:nth-child(-n+3) {
						margin-top: 0;
					}

					.data-item-wrap:nth-child(3n) {
						border: none;
					}
				}

				.img-wrap {
					padding: 38rpx 0 57rpx;
					text-align: center;

					image {
						width: 350rpx;
						height: 194rpx;
					}
				}

				.radius-wrap {
					position: absolute;
					left: 0;
					bottom: 0;
					width: 100vw;
					height: 30rpx;
					background-color: #fff;
					border-radius: 35rpx 35rpx 0 0;
				}
			}

			.detail-info-wrap {
				padding: 40rpx 35rpx;

				.detail-wrap {
					display: flex;
					flex-wrap: wrap;
					padding: 35rpx 55rpx 18rpx 55rpx;
					color: #8D8D8D;

					.item {
						display: flex;
						font-size: 26rpx;
						justify-content: space-between;
						width: calc(50% - 61rpx);
						margin-bottom: 50rpx;

						.params {
							color: #00BD00;
						}

						.status-wrap {
							width: 100%;

							/deep/ .tip-wrap {
								width: 100%;
								justify-content: space-between;
							}
						}
					}

					.item:nth-child(2n) {
						margin-left: 120rpx;
					}
				}

				.params-wrap {
					display: flex;
					flex-wrap: wrap;
					font-size: 26rpx;
					padding: 35rpx 55rpx;

					.item {
						width: calc(50% - 32rpx);
						display: flex;
						justify-content: space-between;
						margin-top: 50rpx;

						view:first-child {
							color: #8D8D8D;
						}
					}

					.item:nth-child(2n) {
						margin-left: 62rpx;
					}

					.item:nth-child(-n+2) {
						margin-top: 0;
					}
				}
			}
		}
	}
</style>