<template>
  <div id="index">
    <el-col :span="24" class="debt">
      <el-col :span="24" class="top">
        <topInfo :topTitle="topTitle" :display="display"></topInfo>
      </el-col>
      <!-- <el-col :span="24" class="search">
        <searchInfo></searchInfo>
      </el-col> -->
      <el-col :span="24" class="main">
        <newsInfo :debtTable="debtTable" :total="total" @select="select" @handleClick="handleClick" @handleCurrentChange="handleCurrentChange"></newsInfo>
      </el-col>
    </el-col>
  </div>
</template>

<script>
import topInfo from '@/layout/common/topInfo.vue';
import newsInfo from '@/layout/companyup/newsInfo.vue';
import { createNamespacedHelpers } from 'vuex';
const { mapActions: companyup } = createNamespacedHelpers('companyup');

export default {
  name: 'index',
  props: {},
  components: {
    topInfo, //头部导航
    // searchInfo, //搜素
    newsInfo, //其他用户列表
  },
  data: () => ({
    topTitle: '企业修改信息审核',
    display: 'block',
    debtTable: [],
    total: 0,
  }),
  created() {
    this.select();
  },
  computed: {},
  methods: {
    ...companyup({ companyupQuery: 'query' }),
    async select({ skip = 0, limit = 10, ...info } = {}) {
      const res = await this.companyupQuery({ skip, limit, ...info });
      if (this.$checkRes(res)) {
        this.$set(this, `debtTable`, res.data);
        this.$set(this, `total`, res.total);
      }
    },
    async handleCurrentChange({ skip, limit, currentPage }) {
      this.$set(this, `skip`, skip);
      this.select({ skip, limit, ...info });
    },
    // 修改
    handleClick(newid) {
      this.$router.push({ path: '/companyup/detail', query: { id: newid } });
    },
  },
};
</script>

<style lang="less" scoped>
.top {
  height: 50px;
  margin: 0 0 10px 0;
}
.main {
  height: 765px;
  background: #ffffff;
  padding: 0 30px 0 30px;
}
.search {
  width: 97%;
  height: 35px;
  margin: 20px;
}
.list {
  padding: 0 20px;
}
</style>
