<template>
  <div class="app-container detail-container">
    <head-form
      title=""
      :form-data="formData"
      :query-params="queryParams"
      :total="tableDataTotal"
    />
    <el-tabs v-model="activeName" @tab-click="handleClick" class="detail-tab">
      <el-tab-pane label="股东信息" name="first"></el-tab-pane>
      <el-tab-pane label="历史股东" name="second"></el-tab-pane>
    </el-tabs>

    <tables
      :tableLoading="tableLoading"
      :tableData="tableData"
      :forData="forData"
      :tableDataTotal="tableDataTotal"
      :queryParams="queryParams"
      @handle-current-change="handleCurrentChange"
    >
      <template slot="inReason" slot-scope="scope">
        <router-link to="" tag="a" class="a-link">{{scope.row.inReason}}</router-link>
        <div class="tags" v-if="scope.row.tag">
          <span class="tag style1">{{scope.row.tag}}</span>
          <span class="tag style1">{{scope.row.tag}}</span>
        </div>
      </template>
    </tables>
  </div>
</template>

<script>
import mixin from '../mixins/mixin'
export default {
  name: 'Holderinfo',
  props: ['companyId'],
  mixins: [mixin],
  data() {
    return {
      activeName: 'first',
      queryParams: {
        cid: 6034,
        pageNum: 1,
        pageSize: 10
      },
      forData: [
        {label: '发起人/股东', prop: 'inReason', slot: true},
        {label: '持股比例', prop: 'inDate'},
        {label: '认缴出资（万）', prop: 'department'},
        {label: '实缴出资额', prop: 'department'},
        {label: '认缴出资额', prop: 'department'},
        {label: '参股日期', prop: 'department', width: '150'}
      ],
      formData: [],
      //列表
      tableLoading:false,
      tableData:[],
      pageIndex:1,
      pageSize:10,
      tableDataTotal:0,
    }
  },
  created() {
    this.handleData()
  },
  methods: {
    handleClick(){
      this.handleData()
    },
    async handleData() {
      this.tableData = [
        {id:1, inReason:'达萨法达萨法', inDate:'000',tag:'aaa'},
        {id:2, inReason:'达萨法达萨法', inDate:'111'},
        {id:3, inReason:'达萨法达萨法', inDate:'222'},
        {id:4, inReason:'达萨法达萨法', inDate:'333'}
      ] //测试
    },
    handleQuery(params) {
      console.log(params)
    }
  }
}
</script>

<style lang="scss" scoped>
.detail-container{
  margin: 0;
  padding: 16px;
  background: #FFFFFF;
  border-radius: 4px;
  .detail-tab{
    margin: -34px 0 0 -16px;
    ::v-deep .el-tabs__nav-wrap::after{
      display: none;
    }
    ::v-deep .el-tabs__item{
      font-size: 16px;
      height: 30px;
      line-height: 30px;
      padding: 0 16px;
      &.is-active{
        font-weight: bold;
      }
    }
  }
  .tags{
    .tag{
      display: inline-block;
      border-radius: 2px;
      padding: 1px 7px;
      margin: 4px 8px 0 0;
      &.style1{
        background: #E4F3FD;
        color: #41A1FD;
      }
    }
  }
}
</style>
