You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

56 lines
1.2 KiB

<style lang="scss" scoped>
uni-page-body{
min-height:100%;
background:#F6F6F6;
}
</style>
<template>
<view class="content">
<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"
@selectDate="selectDate"/>
</u-form>
</view>
</template>
<script>
import dForm from '@/components/form.vue'
export default{
components:{dForm},
data(){
return{
fields:{
name:{label:"基地名称"},
code:{label:"地块编号"},
massifName:{label:"地块名称"},
area:{label:"地块面积(亩)"},
sjArea:{label:"实际面积"},
imgs:{label:"地块图片",type:"upImg"},
date:{label:"使用日期",type:"dateRange",value:[]},
jw:{label:"经/纬度"},
adder:{label:"详细地址",type:"textarea"},
},
formData:{
name:"",
date:[],
},
rules:{
date:{required:true, message:"日期必填!", trigger:"blue"}
},
}
},
methods:{
selectDate(e){
console.log(e,'-----e---------')
switch(e.type){
case "start":this.fields.date.value[0]=e.value;break;
case 'end':this.fields.date.value[1]=e.value;break;
}
}
},
}
</script>