<template>
  <basic-container>
    <avue-form :option="option"
               v-model="form">
    </avue-form>
  </basic-container>
</template>

<script>
  import {detailByParentId} from "@/api/person/household";
  export default {
    name:'householdTags-detail',
    props:{
      basicData:{type:Object}
    },
    data() {
      return {
        form: {},
        option: {
          height:'auto',
          calcHeight: 30,
          labelWidth: 120,
          tip: false,
          emptyBtn:false,
          submitBtn:false,
          disabled:true,
          column: [
            {
              label: "",
              prop: "parentId",
              hide: true,
              display: false,
              rules: [{
                required: true,
                message: "请输入",
                trigger: "blur"
              }]
            },
            {
              label: "住户名字",
              prop: "name",
              search: true,
              rules: [{
                required: true,
                message: "请输入住户名字",
                trigger: "blur"
              }]
            },
            {
              label: "证件号码",
              prop: "idCard",
              rules: [{
                required: true,
                message: "请输入证件号码",
                trigger: "blur"
              }]
            },
            {
              label: "添加类型",
              prop: "createType",
              type: 'select',
              dicUrl: "/api/blade-system/dict-biz/dictionary?code=create-type",
              props: {
                label: "dictValue",
                value: "dictKey"
              },
              rules: [{
                required: true,
                message: "请选择添加类型",
                trigger: "blur"
              }]
            },
            {
              label: "住户类型",
              prop: "type",
              type: 'select',
              dicUrl: "/api/blade-system/dict-biz/dictionary?code=household-type",
              props: {
                label: "dictValue",
                value: "dictKey"
              },
              rules: [{
                required: true,
                message: "请选择住户类型",
                trigger: "blur"
              }]
            },
            {
              label: "社区名称",
              prop: "agencyName",
              rules: [{
                required: false,
                message: "请输入社区名称",
                trigger: "blur"
              }]
            },
            {
              label: "社区Id",
              prop: "agencyId",
              hide: true,
              display: false,
              rules: [{
                required: true,
                message: "请输入社区Id",
                trigger: "blur"
              }]
            },
            {
              label: "小区名称",
              prop: "residentialName",
              rules: [{
                required: false,
                message: "请输入小区名称",
                trigger: "blur"
              }]
            },
            {
              label: "小区Id",
              prop: "residentialId",
              display: false,
              hide: true,
              rules: [{
                required: true,
                message: "请输入小区Id",
                trigger: "blur"
              }]
            },
            {
              label: "楼栋名称",
              prop: "buildingName",
              rules: [{
                required: false,
                message: "请输入楼栋名称",
                trigger: "blur"
              }]
            },
            {
              label: "楼栋Id",
              prop: "buildingId",
              display: false,
              hide: true,
              rules: [{
                required: true,
                message: "请输入楼栋Id",
                trigger: "blur"
              }]
            },
            {
              label: "单元名称",
              prop: "unitName",
              rules: [{
                required: false,
                message: "请输入单元名称",
                trigger: "blur"
              }]
            },
            {
              label: "单元Id",
              prop: "unitId",
              display: false,
              hide: true,
              rules: [{
                required: true,
                message: "请输入单元Id",
                trigger: "blur"
              }]
            },
            {
              label: "楼层名称",
              prop: "floorName",
              rules: [{
                required: false,
                message: "请输入楼层名称",
                trigger: "blur"
              }]
            },
            {
              label: "楼层Id",
              prop: "floorId",
              display: false,
              hide: true,
              rules: [{
                required: false,
                message: "请输入楼层Id",
                trigger: "blur"
              }]
            },
            {
              label: "房间名称",
              prop: "roomName",
              rules: [{
                required: false,
                message: "请输入房间名称",
                trigger: "blur"
              }]
            },
            {
              label: "房间Id",
              prop: "roomId",
              display: false,
              hide: true,
              rules: [{
                required: true,
                message: "请输入房间Id",
                trigger: "blur"
              }]
            },
          ]
        },
      };
    },
    mounted() {
      this.loadData();
    },
    methods: {
      loadData(){
        detailByParentId(this.basicData.id).then(res => {
          this.form = res.data.data;
        });
      },
    }
  };
</script>

<style>
</style>
