<template>
  <div v-if="record">
    <Caption v-bind="{title: 'User information', type: 'has-text-primary', size: 18}"></Caption>
    <div class="columns is-multiline mx-0 mt-3">
      <div class="column is-3">
    <div class="field">
  <label class="label">User name<b class="ml-1 has-text-danger">*</b></label>
  <div class="control">
    {{ record.username }}
  </div>
</div>
  </div>
    <div class="column is-3">
    <div class="field">
  <label class="label">Full name<b class="ml-1 has-text-danger">*</b></label>
  <div class="control">
    {{record.fullname}}
  </div>
</div>
</div>
<!-- <div class="column is-3">
    <div class="field">
  <label class="label">Phone<b class="ml-1 has-text-danger">*</b></label>
  <div class="control">
    {{ record.phone }}
  </div>
</div>
  </div> -->
  <div class="column is-3">
      <div class="field">
  <label class="label">Create time<b class="ml-1 has-text-danger">*</b></label>
  <div class="control">
    {{$dayjs(record.create_time).format('DD/MM/YYYY')}}
  </div>
</div>
    </div>
  </div>
  </div>
</template>
<script>
import { useStore } from '~/stores/index'
export default {
  setup() {
    const store = useStore()
    return {store}
  },
  data() {
    return {
      errors: {},
      record: undefined,
    }
  },
  async created() {
    if(!this.store.login) return
    this.record = await this.$getdata('user', undefined, 
    {filter: {id: this.store.login.id}, values: 'id,username,fullname,type,type__name,create_time'}, true)
  }
}
</script>