<template>
	<view class="eqLog">
		<view class="eqNo">
			<view class="noInfo">
				<view class="left">
					<text>设备编号：{{info.imei}}</text>
					<text>录音说明：{{info.recordExplain}}</text>
				</view>
				<view class="right">
					<text>{{state(info.recording)}}</text>
				</view>
			</view>
		</view>
		<view class="eqMain">
			<view class="recordingStart">
				<view>录音开启用时：<text :style="{color: info.recording==1?'red':'#333'}">{{info.startActionTime || ''}}</text>min
				</view>
				<view>待上传文件：<text :style="{color: info.fileCount==0?'#333':'red'}">{{info.fileCount}}</text>个</view>
			</view>
			<view class="recording">
				<view class="recordingBox">
					<text style="font-size:36rpx">录音开启</text>
					<text>指派人：</text>
					<text>{{info.owenrName}}</text>
					<text>指派时间：</text>
					<text>{{info.assignTime}}</text>
					<text>录音开始时间：</text>
					<text style="font-weight: bold;font-size: 28rpx;">
						<text :style="{color: info.recording==1?'red':'#333'}">
							{{info.recordStartTime}}
						</text>
					</text>
				</view>
				<view class="recordingBox">
					<text style="font-size:36rpx">录音关闭</text>
					<text>结束人：</text>
					<text>{{info.userName}}</text>
					<text>结束时间：</text>
					<text>{{info.assignEndTime}}</text>
					<text>录音结束时间：</text>
					<text style="font-weight: bold;font-size: 28rpx;">
						<text :style="{color: info.recording==1?'red':'#333'}">
							{{info.recordEndTime}}
						</text>
					</text>
				</view>
			</view>
			<view class="offlineRec">
				<text style="font-size:36rpx">离线记录</text>
				<view class="recMain">
					<block v-for="(item,index) in info.offLineList" :key="index">
						<text>{{index+1}}. {{item}}</text>
					</block>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info: {}
			}
		},
		computed: {
			state() {
				return (e => {
					switch (e) {
						case 0:
							return "接待中";
						case 1:
							return "部分录音";
						default:
							return "完整录音";
					}
				})
			}
		},
		onLoad(options) {
			console.log(options.id)
			this.$u.get("/equipment/equipmentLog", {
				id: options.id
			}).then(res => {
				// console.log(res)
				this.info = res
			})
		},
		methods: {

		}
	}
</script>

<style lang="scss">
	.eqLog {
		width: 100%;
		height: 100%;
		position: fixed;
		background: #F5F5F5;

		.eqNo {
			background: #2671E2;
			padding: 20rpx;

			.noInfo {
				height: 110rpx;
				background: #FFFFFF;
				border-radius: 10rpx;
				padding: 10rpx;
				display: flex;
				justify-content: space-between;

				.left {
					display: flex;
					flex-direction: column;
					justify-content: space-between;
				}
			}
		}

		.eqMain {
			padding: 0 20rpx;

			.recordingStart {
				background: #FFFFFF;
				display: flex;
				width: 100%;
				border: 1rpx solid #000000;
				padding: 20rpx 12rpx;
				margin-top: 20rpx;
				border-radius: 8rpx;
				align-items: center;

				view {
					width: 50%;
					font-size: 30rpx;
				}
			}

			.recording {
				margin-top: 30rpx;
				display: flex;
				justify-content: space-between;

				.recordingBox {
					background: #FFFFFF;
					display: flex;
					flex-direction: column;
					width: 48%;
					border: 1rpx solid #000000;
					padding: 0 10rpx;
					border-radius: 8rpx;

					text {
						margin: 10rpx 0;
					}
				}
			}

			.offlineRec {
				background: #FFFFFF;
				padding: 20rpx;
				border: 1rpx solid #000000;
				border-radius: 8rpx;
				margin-top: 30rpx;

				.recMain {
					display: flex;
					flex-direction: column;

					text {
						margin: 14rpx 0;
					}
				}
			}
		}
	}
</style>
