<!--地块审核-->
<template>
  <div class="content-div">
    <a-card class="info-submit" :bordered="false">
        <a-radio-group v-model="defaultValue" button-style="solid" @change="changeContent">
          <a-radio-button v-for="(item, index) in menus" :key="item.action" :value="item.value" :name="item.value">
            {{ item.describe }}
          </a-radio-button>
        </a-radio-group>
    </a-card>
    <a-card :bordered="false">
      <!--省属企业地块待审核-->
      <company-land-audit v-show="'ssqydkdsh' == defaultValue"></company-land-audit>
      <!--省直单位地块待审核-->
      <depart-land-audit v-show="'szdwdkdsh' == defaultValue"></depart-land-audit>
      <!--省属企业地块已审核-->
      <company-land-approved v-show="'ssqydkysh' == defaultValue" :year-list="yearList"></company-land-approved>
      <!--省直单位地块已审核-->
      <depart-land-approved v-show="'szdwdkysh' == defaultValue" :year-list="yearList" ></depart-land-approved>

    </a-card>
  </div>
</template>


<script>
import companyLandAudit from '../qcsb/QcSsgqzysytdqkList1.vue'
import departLandAudit from '../sydwqcsb/QcSsgqzysytdqkList1.vue'
import companyLandApproved from '../qcsb/QcSsgqzysytdqkList2.vue'
import departLandApproved from '../sydwqcsb/QcSsgqzysytdqkList2.vue'
import {getyear} from '@/api/api'

export default {
  name: 'landAudit',
  components: {
    companyLandAudit,
    departLandAudit,
    companyLandApproved,
    departLandApproved,

  },
  data() {
    return {
      defaultValue: '',
      menus: [],
      yearList: [],
    }
  },
  created() {
    this.menus = this.$store.state.menu.menuList['dksh'];
    let menuIndex = this.$route.query.index != undefined ? (this.menus.length > this.$route.query.index ? this.$route.query.index : 0) : 0;
    console.log("landAudit...menuIndex", menuIndex);
    this.defaultValue = this.menus.length > 0 ? this.menus[menuIndex].value : '';
    this.getYear();
  },
  methods: {
    changeContent(key) {
      console.log(key);
    },
    getYear() {
      getyear().then((res) => {
        if (res.success) {
          this.yearList = res.result;
          console.table(this.yearList);
        }
      })
    }

  }

}
</script>

<style scoped>
.content-div {
  height: 100%;
}
.ant-card:not(:last-child) {
  margin-bottom: 10px;
}
.ant-card:last-child {
  height: calc(100% - 70px);
  overflow-y: auto;
}
</style>
<style lang="less" scoped>
.info-submit {
  & ::v-deep > .ant-card-body {
    padding: 14px 24px;
  }
  &::v-deep .ant-radio-button-wrapper {
    //border: 1px solid ;
    border-radius: 4px;
    padding-left: 25px;
    padding-right: 25px;
    //border-left: 1px;
    border: 1px solid @primary-color;
    margin-left: 15px;
    color: @primary-color;
  }
  & /deep/ .ant-radio-button-wrapper:not(:first-child)::before {
    width: 0px;
  }
  & .ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) {
    color: #fff;
  }
}
.content-div {
  &::v-deep .ant-card:last-child .ant-card-body {
    padding: 10px 24px 0;
  }

}

</style>