<template>
  <div class="equity-freezed">
    <cy-comm-table
      ref="commTable"
      :columns="columns"
      :data="tableData"
    />
  </div>
</template>

<script>
export default {
  props: {
    type: {
      type: String,
      default: ''
    },
    detailsData: {
      type: Array,
      default: () => []
    }
  },
  inject: {
    disabled: {
      form: 'disabled',
      default: false
    }
  },
  data() {
    return {
      tableData: []
    }
  },
  computed: {
    columns() {
      return [
        {
          label: '序号',
          index: true
        },
        {
          label: '执行通知文书号',
          prop: 'docNo',
          showTooltip: true
        },
        {
          label: '被执行人',
          showTooltip: true,
          prop: 'beExecuted'
        },
        {
          label: '冻结股权标的企业',
          prop: 'freezeCompany',
          showTooltip: true
        },
        {
          label: '股权数额',
          prop: 'equityAmount',
          showTooltip: true
        },
        {
          label: '执行法院',
          prop: 'executeCourt',
          showTooltip: true
        },
        {
          label: '类型/状态',
          prop: 'status'
        },
        {
          label: '冻结开始日期',
          prop: 'freezeStartDate'
        },
        {
          label: '冻结结束日期',
          prop: 'freezeEndDate'
        },
        {
          label: '是否股权冻结',
          prop: 'privateLending',
          ruleRequired: this.type === 'projectOwner',
          render: (h, row) => {
            return <el-select
              disabled={this.disabled}
              v-model={row.equityFreeze}
              placeholder='请选择股权冻结'>
              <el-option label='是' value={1}></el-option>
              <el-option label='否' value={0}></el-option>
            </el-select>
          }
        },
        {
          label: '股权冻结（调整）',
          prop: 'inDate',
          show: this.type !== 'projectOwner',
          render: (h, row) => {
            return <span> </span>
          }
        }
      ]
    }
  },
  watch: {
    detailsData: {
      handler(newV) {
        this.tableData = JSON.parse(JSON.stringify(newV))
      },
      deep: true
    }
  }
}
</script>

  <style lang="scss" scoped>
  .equity-freezed {

  }
  </style>
