<template>
	<view class="content_main">
		<uni-forms :modelValue="infodata" v-if="batteryInfoActive == 0">
			<uni-forms-item label="换电编号:" name="name" label-align="right" label-width="120px">
				<uni-easyinput type="text" v-model="infodata.swapId || '-'" placeholder="请输入" disabled />
			</uni-forms-item>
			<uni-forms-item label="车牌号:" name="name" label-align="right" label-width="120px">
				<uni-easyinput type="text" v-model="infodata.vehiclePlate || '-'" placeholder="请输入" disabled />
			</uni-forms-item>
			<uni-forms-item label="换电结果:" name="name" label-align="right" label-width="120px">
				<uni-easyinput type="text" v-model="infodata.swapState || '-'" placeholder="请输入" disabled />
			</uni-forms-item>
			<uni-forms-item label="换电开始时间:" name="name" label-align="right" label-width="120px">
				<uni-easyinput type="text" v-model="infodata.swapBeginTime || '-'" placeholder="请输入" disabled />
			</uni-forms-item>
			<uni-forms-item label="安装满电时长:" name="name" label-align="right" label-width="120px">
				<uni-easyinput type="text" v-model="infodata.fullDuration || '-'" placeholder="请输入" disabled />
			</uni-forms-item>
			<uni-forms-item label="换电时长:" name="name" label-align="right" label-width="120px">
				<uni-easyinput type="text" v-model="infodata.swapDuration || '-'" placeholder="请输入" disabled />
			</uni-forms-item>
			<uni-forms-item label="满电电池SN:" name="name" label-align="right" label-width="120px">
				<uni-easyinput type="text" v-model="infodata.swapSn|| '-'" placeholder="请输入" disabled />
			</uni-forms-item>
			<uni-forms-item label="满电电池SOC:" name="name" label-align="right" label-width="120px">
				<uni-easyinput type="text" v-model="infodata.swapSoc|| '-'" placeholder="请输入" disabled />
			</uni-forms-item>
			<uni-forms-item label="满电电池SOH:" name="name" label-align="right" label-width="120px">
				<uni-easyinput type="text" v-model="infodata.swapSoh || '-'" placeholder="请输入" disabled />
			</uni-forms-item>
			<uni-forms-item label="亏电电池SN:" name="name" label-align="right" label-width="120px">
				<uni-easyinput type="text" v-model="infodata.vehicleSn || '-'" placeholder="请输入" disabled />
			</uni-forms-item>
			<uni-forms-item label="亏电电池SOC:" name="name" label-align="right" label-width="120px">
				<uni-easyinput type="text" v-model="infodata.vehicleSoc || '-'" placeholder="请输入" disabled />
			</uni-forms-item>
			<uni-forms-item label="亏电电池SOH:" name="name" label-align="right" label-width="120px">
				<uni-easyinput type="text" v-model="infodata.vehicleSoh || '-'" placeholder="请输入" disabled />
			</uni-forms-item>

		</uni-forms>
		<uni-forms :modelValue="infodata" v-if="batteryInfoActive == 1">
			<uni-forms-item label="车牌号:" name="name" label-align="right" label-width="120px">
				<uni-easyinput type="text" v-model="infodata.vehiclePlate || '-'" placeholder="请输入" disabled />
			</uni-forms-item>
			<uni-forms-item label="车辆识别码:" name="name" label-align="right" label-width="120px">
				<uni-easyinput type="text" v-model="infodata.vehicleVin || '-'" placeholder="请输入" disabled />
			</uni-forms-item>
		</uni-forms>
		<uni-forms :modelValue="infodata" v-if="batteryInfoActive == 2">
			<uni-forms-item label="预选电池仓位:" name="name" label-align="right" label-width="120px">
				<uni-easyinput type="text" v-model="infodata.preselectionCode || '-'" placeholder="请输入" disabled />
			</uni-forms-item>
			<uni-forms-item label="预选满电电池SN:" name="name" label-align="right" label-width="120px">
				<uni-easyinput type="text" v-model="infodata.preselectionSn || '-'" placeholder="请输入" disabled />
			</uni-forms-item>
			<uni-forms-item label="预选满电电池SOC:" name="name" label-align="right" label-width="120px">
				<uni-easyinput type="text" v-model="infodata.preselectionSoc || '-'" placeholder="请输入" disabled />
			</uni-forms-item>
			<uni-forms-item label="预选满电电池SOH:" name="name" label-align="right" label-width="120px">
				<uni-easyinput type="text" v-model="infodata.preselectionSoh || '-'" placeholder="请输入" disabled />
			</uni-forms-item>
		</uni-forms>
		<uni-forms :modelValue="infodata" v-if="batteryInfoActive == 3">
			<uni-forms-item label="同步状态:" name="name" label-align="right" label-width="120px">
				<uni-easyinput type="text" v-model="infodata.state || '-'" placeholder="请输入" disabled />
			</uni-forms-item>
			<uni-forms-item label="同步时间:" name="name" label-align="right" label-width="120px">
				<uni-easyinput type="text" v-model="infodata.uploadTime || '-'" placeholder="请输入" disabled />
			</uni-forms-item>
		</uni-forms>
	</view>
</template>

<script>
	export default {
		name: 'changeDrawer',
		props: ['infodata', 'batteryInfoActive'],
		data() {
			return {}
		},
	
		created() {
			if (this.infodata.state == 0) {
				this.infodata.state = '待上传'
			} else if (this.infodata.state == 1) {
				this.infodata.state ='上传成功'
			} else if (this.infodata.state == 2) {
				this.infodata.state ='上传失败'
			} else {
				this.infodata.state = null
			}
		}
	}
</script>
<style lang="scss" scoped>
	::v-deep .uni-forms-item__content {
		background: rgba(255, 255, 255, 0);
		border-radius: 2px 2px 2px 2px;
		border: 1px solid #263042;

		.uni-easyinput__content {
			background: none !important;
			border: none !important;
			color: #fff;
		}

	}

	::v-deep .uni-forms-item {
		width: auto !important;
	}

	.content_main {
		height: 665px;
		overflow: auto;
	}
</style>
