<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="main">
        <newsInfo :debtTable="debtTable" :total="total" @select="select" @handleClick="handleClick" ></newsInfo>
      </el-col>
    </el-col>
  </div>
</template>

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

export default {
  name: 'index',
  props: {},
  components: {
    topInfo, //头部导航
    newsInfo, //列表
  },
  data: () => ({
    topTitle: '企业信息查看',
    display: 'block',
    debtTable: [],
    total: 0,
  }),
  created() {
    this.select();
  },
  computed: {},
  methods: {
    ...companyidentify({ companyidentifyQuery: 'query' }),
    async select({ skip = 0, limit = 10, ...info } = {}) {
      const res = await this.companyidentifyQuery({ skip, limit,status:'1', ...info });
      if (this.$checkRes(res)) {
        this.$set(this, `debtTable`, res.data);
        this.$set(this, `total`, res.total);
      }
    },
    handleClick(newid) {
      this.$router.push({ path: '/companyidentify/detail', query: { id: newid } });
    },
  },
};
</script>

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