<template>
	<view class="home">
		<view class="device-info">
			<i class="iconfont icon-shebei"></i>设备信息
		</view>
		<view class="info-area">
			<u--form
				labelPosition="left"
				:model="model1"
				:rules="rules"
				ref="form1"
				:labelWidth="100"
				labelAlign="center"
			>
				<u-form-item
					label="设备名称"
					prop="deviceName"
					borderBottom
					ref="item1"
				>
					{{model1.deviceName}}
				</u-form-item>
				<u-form-item
					label="设备编码"
					prop="deviceNumber"
					borderBottom
					ref="item2"
				>
					{{model1.deviceNumber}}
				</u-form-item>
			</u--form>
		</view>
		<view class="type-head">
			<i class="iconfont icon-dingwei"></i>请填写故障现象
		</view>
		<view class="type-area">
			<u--textarea 
			border="none" 
			v-model="fault" 
			placeholder="请输入故障现象" 
			autoHeight
			maxlength="-1"></u--textarea>
		</view>
		<view class="btn-area">
			<u-button color="#000" size="small">保存</u-button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				model1: {
					deviceName: '',
					deviceNumber: '',
				},
				rules: {
					'deviceName': {
						type: 'string',
						required: true,
						message: '请填写姓名',
						trigger: ['blur', 'change']
					},
					'deviceNumber': {
						type: 'string',
						max: 1,
						required: true,
						message: '请选择男或女',
						trigger: ['blur', 'change']
					},
				},
				fault:""
			};
		},
		onLoad(option) {
			console.log(option.id)
		}
	}
</script>

<style lang="scss">
page{
	background-color: #eae9e9;
}
.home{
	// padding: 20rpx 0;
}
.device-info,.type-head{
	display: flex;
	align-items: center;
	padding:20rpx;
	.iconfont{
		font-size: 40rpx;
		margin-right: 10rpx;
	}
}
.info-area,.type-area{
	background-color: #fff;
}
.type-area{
	padding: 0 20rpx;
}
.btn-area{
	padding: 20rpx 20rpx 20rpx 500rpx;
}
</style>
