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

<script>
  import {detailByParentId} from "@/api/person/disabler";
  export default {
    name:'disablerTags-detail',
    props:{
      basicData:{type:Object}
    },
    data() {
      return {
        form: {},
        option: {
          height:'auto',
          calcHeight: 30,
          labelWidth: 120,
          tip: false,
          emptyBtn:false,
          submitBtn:false,
          disabled:true,
          group:[
            {
              icon:'el-icon-info',
              label: '基础信息',
              prop: 'group',
              column:[
                {
                  label: "基本表Id",
                  prop: "parentId",
                  display: false,
                  editDisabled:false,
                  rules: [{
                    required: false,
                    message: "请输入基本表Id",
                    trigger: "blur"
                  }]
                },
                {
                  label:'姓名',
                  prop:'name',
                },
                {
                  label: "居住情况",
                  prop: "livingConditions",
                  type: 'select',
                  multiple: true,
                  dataType:'string',
                  dicUrl: "/api/blade-system/dict-biz/dictionary?code=living-conditions",
                  props: {
                    label: "dictValue",
                    value: "dictKey"
                  },
                  rules: [{
                    required: false,
                    message: "请选择居住情况",
                    trigger: "blur"
                  }]
                },
                {
                  label: "监护人",
                  prop: "guardian",
                  rules: [{
                    required: false,
                    message: "请输入监护人",
                    trigger: "blur"
                  }]
                },
                {
                  label: "监护人电话",
                  prop: "guardianPhone",
                  rules: [{
                    required: false,
                    message: "请输入监护人电话",
                    trigger: "blur"
                  }]
                },
                // {
                //   label: "所属社区",
                //   prop: "agencyId",
                //   slot: true,
                //   search: true,
                //   cascaderItem: ['residentialId'],
                //   type: "select",
                //   remote: true,
                //   dicUrl: "/api/cyzh-community/agency/list",
                //   dicFormatter:(res)=>{
                //     return res.data.records;//返回字典的层级结构
                //   },
                //   props: {
                //     label: "name",
                //     value: "id"
                //   },
                //   rules: [{
                //     required: true,
                //     message: "请选择所属社区",
                //     trigger: "blur"
                //   }]
                // },
                // {
                //   label: "所属小区",
                //   prop: "residentialId",
                //   slot: true,
                //   type: "select",
                //   search: true,
                //   cascaderItem: ['buildingId'],
                //   dicUrl: "/api/cyzh-community/residential/list?agencyId={{key}}",
                //   dicFormatter:(res)=>{
                //     return res.data.records;//返回字典的层级结构
                //   },
                //   // dicFlag: false,
                //   filterable: true,
                //   props: {
                //     label: "name",
                //     value: "id"
                //   },
                //   rules: [{
                //     required: true,
                //     message: "请选择所属小区",
                //     trigger: "blur"
                //   }]
                // },
                // {
                //   label: "所属楼栋",
                //   prop: "buildingId",
                //   slot: true,
                //   type: "select",
                //   search: true,
                //   cascaderItem: ['unitId'],
                //   dicUrl: `/api/cyzh-community/building/list?residentialId={{key}}`,
                //   dicFormatter:(res)=>{
                //     return res.data.records;//返回字典的层级结构
                //   },
                //   // dicFlag: false,
                //   filterable: true,
                //   props: {
                //     label: "name",
                //     value: "id"
                //   },
                //   rules: [{
                //     required: true,
                //     message: "请输入楼栋Id",
                //     trigger: "blur"
                //   }]
                // },
                // {
                //   label: "所属单元",
                //   prop: "unitId",
                //   slot: true,
                //   type: "select",
                //   search: true,
                //   cascaderItem: ['floorId'],
                //   dicUrl: "/api/cyzh-community/unit/list?buildingId={{key}}",
                //   dicFormatter:(res)=>{
                //     return res.data.records;//返回字典的层级结构
                //   },
                //   // dicFlag: false,
                //   filterable: true,
                //   props: {
                //     label: "name",
                //     value: "id"
                //   },
                //   rules: [{
                //     required: true,
                //     message: "请输入单元Id",
                //     trigger: "blur"
                //   }]
                // },
                // {
                //   label: "所属楼层",
                //   prop: "floorId",
                //   slot: true,
                //   type: "select",
                //   search: true,
                //   cascaderItem: ['roomId'],
                //   dicUrl: "/api/cyzh-community/floor/list?unitId={{key}}",
                //   dicFormatter:(res)=>{
                //     return res.data.records;//返回字典的层级结构
                //   },
                //   // dicFlag: false,
                //   filterable: true,
                //   props: {
                //     label: "name",
                //     value: "id"
                //   },
                //   rules: [{
                //     required: true,
                //     message: "请输入楼层Id",
                //     trigger: "blur"
                //   }]
                // },
                // {
                //   label: "所属房间",
                //   prop: "roomId",
                //   slot: true,
                //   type: "select",
                //   search: true,
                //   dicUrl: "/api/cyzh-community/room/list?floorId={{key}}",
                //   dicFormatter:(res)=>{
                //     return res.data.records;//返回字典的层级结构
                //   },
                //   // dicFlag: false,
                //   filterable: true,
                //   props: {
                //     label: "name",
                //     value: "id"
                //   },
                //   rules: [{
                //     required: true,
                //     message: "请输入房间Id",
                //     trigger: "blur"
                //   }]
                // },
                {
                  label: "收入来源",
                  prop: "incomeSource",
                  type: 'select',
                  multiple: true,
                  dataType:'string',
                  dicUrl: "/api/blade-system/dict-biz/dictionary?code=income-source",
                  props: {
                    label: "dictValue",
                    value: "dictKey"
                  },
                  rules: [{
                    required: false,
                    message: "请选择收入来源",
                    trigger: "blur"
                  }]
                },

                {
                  label: "探访计划",
                  prop: "visitPlan",
                  rules: [{
                    required: false,
                    message: "请输入探访计划",
                    trigger: "blur"
                  }]
                },
                {
                  label: "备注",
                  prop: "remark",
                  rules: [{
                    required: false,
                    message: "请输入备注",
                    trigger: "blur"
                  }]
                },
              ]
            },{
              icon:'el-icon-s-cooperation',
              label: '医疗需求',
              prop: 'group',
              column: [
                {
                  label: "医疗保障",
                  prop: "healthCare",
                  type: 'select',
                  multiple: true,
                  dataType:'string',
                  dicUrl: "/api/blade-system/dict-biz/dictionary?code=health-care",
                  props: {
                    label: "dictValue",
                    value: "dictKey"
                  },
                  rules: [{
                    required: false,
                    message: "",
                    trigger: "blur"
                  }]
                },
                {
                  label: "行为能力",
                  prop: "ability",
                  type: 'select',
                  dataType:'number',
                  dicUrl: "/api/blade-system/dict-biz/dictionary?code=ability",
                  props: {
                    label: "dictValue",
                    value: "dictKey"
                  },
                  rules: [{
                    required: false,
                    message: "请选择行为能力",
                    trigger: "blur"
                  }]
                },
                {
                  label: "康复需求",
                  prop: "convalescence",
                  rules: [{
                    required: false,
                    message: "请输入康复需求",
                    trigger: "blur"
                  }]
                },
                {
                  label: "辅助器具",
                  prop: "assistiveDevices",
                  rules: [{
                    required: false,
                    message: "请输入辅助器具",
                    trigger: "blur"
                  }]
                },
              ]
            },{
              icon:'el-icon-s-opportunity',
              label: '社会能力',
              prop: 'group',
              column: [
                {
                  label: "生活爱好",
                  prop: "hobby",
                  rules: [{
                    required: false,
                    message: "请输入生活爱好",
                    trigger: "blur"
                  }]
                },
                {
                  label: "生活嗜好",
                  prop: "addiction",
                  rules: [{
                    required: false,
                    message: "请输入生活嗜好",
                    trigger: "blur"
                  }]
                },
                {
                  label: "社交能力",
                  prop: "socialSkills",
                  type: 'select',
                  dataType:'number',
                  dicUrl: "/api/blade-system/dict-biz/dictionary?code=social-skills",
                  props: {
                    label: "dictValue",
                    value: "dictKey"
                  },
                  rules: [{
                    required: false,
                    message: "请选择社交能力",
                    trigger: "blur"
                  }]
                },
                {
                  label: "就业意向",
                  prop: "employmentNeeds",
                  rules: [{
                    required: false,
                    message: "请输入就业意向",
                    trigger: "blur"
                  }]
                },
              ]
            }
          ],
        },
      };
    },
    mounted() {
      this.loadData();
    },
    methods: {
      loadData(){
        detailByParentId(this.basicData.id).then(res => {
          this.form = res.data.data;
        });
      },
    }
  };
</script>

<style>
</style>
