
<template>
  <VaForm ref="myForm">
    <div class="label">
      <VaTimeInput  v-model="form.addrIn" label='上班打卡时间' class='input'/>
    </div>
    <div class="label">
      <VaTimeInput  v-model="form.addrQuit" label='下班打卡时间'  class='input'/>
    </div>
  </VaForm>
</template>

<script>
  let defaultForm = {
    addrIn: '',
    addrQuit: '',
  }
  export default {
    name: 'timeForm',
    methods: {
      setData(data) {
        Object.keys(this.form).forEach((x) => {
          this.form[x] = data[x]? new Date(parseInt(data[x])):''
        })
      },
      getData(){
        return {
          addrIn: this.form.addrIn.getTime() %  86400000,
          addrQuit: this.form.addrQuit.getTime() %  86400000
        }
      },
    },
    data() {
      return {
        form: {
          ...defaultForm,
        },
      }
    },
  }
</script>

<style scoped>
  .label {
    margin-top: 20px;
    /*display: flex;*/
  }
  .input{
    width: 100%;
  }
</style>

