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

<script>
export default {
  props: {
    disabled: {
      type: Boolean,
      default: false
    },
    detailsInfo: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      tableData: [
        { userName: this.detailsInfo.scope, scopeCompliance: this.detailsInfo.scopeCompliance }
      ],
      columns: [
        {
          label: '经营范围',
          prop: 'userName'
        },
        {
          label: '是否达标',
          ruleRequired: true,
          render: (h, row) => {
            return (<el-select v-model={row.scopeCompliance} disabled={this.disabled} placeholder='请选择是否达标'>
              <el-option label='是' value={1}></el-option>
              <el-option label='否' value={0}></el-option>
            </el-select>)
          },
          width: 200
        }
      ]
    }
  },
  watch: {
    detailsInfo() {
      this.tableData[0].userName = this.detailsInfo.scope
      this.tableData[0].scopeCompliance = this.detailsInfo.scopeCompliance
    }
  },
  methods: {
    getParams() {
      return this.tableData[0].scopeCompliance
    }
  }
}
</script>

<style lang="scss" scoped>
.audit-content {

}
</style>
