<template>
  <div id="followStcokList">
    <el-row>
      <el-col :span="24">
        <el-table ref="debtTable" :data="debtTable" style="width: 100%" border>
          <el-table-column type="index" label="序号" width="50" align="center"> </el-table-column>
          <el-table-column property="stockmnew.title" label="项目名称" align="center"> </el-table-column>
          <el-table-column property="stockmnew.stock_money" label="融资金额（万元）" align="center"> </el-table-column>
          <el-table-column property="stockmnew.persion_name" label="联系人姓名" align="center"> </el-table-column>
          <el-table-column property="stockmnew.persion_phone" label="联系人电话" align="center"> </el-table-column>
          <el-table-column fixed="right" label="操作" align="center">
            <template slot-scope="scope">
              <el-button
                @click="$router.push({ path: '/follow/followStockDetail', query: { id: scope.row.stockmnew._id } })"
                type="text"
                icon="el-icon-search"
                title="查看详情"
              ></el-button>
              <el-button @click.prevent="deleteRow(scope.row._id)" type="text" icon="el-icon-star-on" title="取消关注"></el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-row class="page">
          <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="currentPage"
            :page-size="10"
            layout="total, prev, pager, next, jumper"
            :total="total"
          >
          </el-pagination>
        </el-row>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: 'followStcokList',
  props: {
    debtTable: null,
    total: null,
  },
  components: {},
  data: () => ({
    currentPage: 1,
  }),
  created() {},
  computed: {},
  methods: {
    deleteRow(id) {
      this.$emit('deleteRow', id);
    },
    clickRest(id) {
      this.$emit('clickRest', id);
    },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      this.$emit('pagechange', { skip: val });
    },
  },
};
</script>

<style lang="less" scoped>
.page {
  text-align: center;
  padding: 15px 0;
}
</style>
