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

<script>
  import {detailByParentId} from "@/api/person/keypeople";
  export default {
    name:'keyPersonTags-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: "基本表id",
              prop: "parentId",
              hide: true,
              display: false,
              rules: [{
                required: false,
                message: "请输入基本表id",
                trigger: "blur"
              }]
            },
            {
              label:'姓名',
              prop:'name',
              search:true,
              editDisplay:false
            },
            {
              label: "重点人员类型",
              prop: "type",
              dicUrl: "/api/blade-system/dict-biz/dictionary?code=key-type",
              props: {
                label: "dictValue",
                value: "dictKey"
              },
              type: "select",
              multiple: true,
              dataType:'string',
              rules: [{
                required: true,
                message: "请选择重点人员类型",
                trigger: "blur"
              }]
            },
            {
              label: "是否需要援助",
              prop: "assistance",
              type: 'select',
              dataType: 'number',
              dicUrl: "/api/blade-system/dict-biz/dictionary?code=assistance",
              props: {
                label: "dictValue",
                value: "dictKey"
              },
              rules: [{
                required: false,
                message: "是否需要援助",
                trigger: "blur"
              }]
            },
            {
              label: "是否需要走访",
              prop: "visit",
              type: 'select',
              dataType: 'number',
              dicUrl: "/api/blade-system/dict-biz/dictionary?code=visit",
              props: {
                label: "dictValue",
                value: "dictKey"
              },
              rules: [{
                required: false,
                message: "是否需要走访",
                trigger: "blur"
              }]
            },
            {
              label: "访问人员",
              prop: "visitPerson",
              rules: [{
                required: true,
                message: "请输入访问人员",
                trigger: "blur"
              }]
            },
            {
              label: "备注",
              prop: "remark",
              type: 'textarea',
              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>
