<style lang="scss" scoped>
	.container{
		background:#F6F6F6;
		padding:28rpx 0;
		&>.u-button{
			margin:76rpx auto 0rpx;
			width:80%;
		}
	}
</style>
<template>
	<view class="container">
		<u-form class="card inline" :model="formData" ref="form" :rules="rules" labelWidth="auto">
			<d-form v-for="(v,k) in fields" :key="k" v-bind="v" :required="!!rules[k]" :field="k" @input="formData[k]=$event" @select="fields[k].value=$event"/>
		</u-form>
		<u-button shape="circle" color="#10C176">确认提交</u-button>
	</view>
</template>
<script>
import dForm from '@/components/form.vue'
	export default{
		components:{dForm},
		data(){
			return{
				fields:{
					name:{label:"仓库名称"},
					adder:{label:"仓库位置"},
					size:{label:"仓库容量(㎡)",placeholder:"请输入仓库容量"},
					type:{label:"仓库类型",type:"select",columns:[[{label:"标签1",id:1},{label:"标签2",id:2}]],keyName:"label",value:null},
					manager:{label:"基地管理员"},
					tel:{label:"管理员联系方式"},
					imgs:{label:"仓库图片",type:"upImg"},
				},
				formData:{
					name:"",
				},
				rules:{
					name:{required:true, message:"仓库名称必填！", trigger:["blur","change"]},
					adder:{required:true, message:"仓库位置必填！", trigger:["blur","change"]},
				},
			}
		},
		methods:{
			
		},
	}
</script>
