<template>
  <div class="copyright">
    <h3>
      <p class="el-icon-back" @click="showTable">返回</p>
      <b></b>
      <el-breadcrumb separator-class="el-icon-arrow-right">
        <el-breadcrumb-item
          ><span @click="showTable">企业证照信息</span></el-breadcrumb-item
        >
        <el-breadcrumb-item>著作权</el-breadcrumb-item>
      </el-breadcrumb>
    </h3>
    <table>
      <thead class="copyright-table-header">
        <tr>
          <td>序号</td>
          <td>作品名称</td>
          <td>登记号</td>
          <td>类型</td>
          <td>创作完成日期</td>
          <td>登记日期</td>
          <td>首次发布日期</td>
        </tr>
      </thead>
      <tbody class="copyright-table-body">
        <tr v-for="(item, index) in itemList" :key="index">
          <td>{{ "0" + (index + 1) }}</td>
          <td>{{ item.name }}</td>
          <td>{{ item.dengjihao }}</td>
          <td>{{ item.type }}</td>
          <td>{{ item.finishTime }}</td>
          <td>{{ item.registerTime }}</td>
          <td>{{ item.firstTime }}</td>
        </tr>
      </tbody>
    </table>
    <el-pagination
      background
      layout="prev, pager, next"
      :page-size="pageSize"
      :total="copyrightList.length"
      @current-change="handleCurrentChange"
    >
    </el-pagination>
  </div>
</template>

<script>
export default {
  data() {
    return {
      pageSize: 5,
      copyrightList: [
        {
          name: "达摩院青橙奖LOGO",
          dengjihao: "国作登字-2018-F-00675364",
          type: "0",
          finishTime: "2019-12-03",
          registerTime: "2019-12-03",
          firstTime: "2019-12-03"
        },
        {
          name: "达摩院青橙奖LOGO",
          dengjihao: "国作登字-2018-F-00675364",
          type: "0",
          finishTime: "2019-12-03",
          registerTime: "2019-12-03",
          firstTime: "2019-12-03"
        },
        {
          name: "达摩院青橙奖LOGO",
          dengjihao: "国作登字-2018-F-00675364",
          type: "0",
          finishTime: "2019-12-03",
          registerTime: "2019-12-03",
          firstTime: "2019-12-03"
        },
        {
          name: "达摩院青橙奖LOGO",
          dengjihao: "国作登字-2018-F-00675364",
          type: "0",
          finishTime: "2019-12-03",
          registerTime: "2019-12-03",
          firstTime: "2019-12-03"
        },
        {
          name: "达摩院青橙奖LOGO",
          dengjihao: "国作登字-2018-F-00675364",
          type: "0",
          finishTime: "2019-12-03",
          registerTime: "2019-12-03",
          firstTime: "2019-12-03"
        },
        {
          name: "达摩院青橙奖LOGO",
          dengjihao: "国作登字-2018-F-00675364",
          type: "0",
          finishTime: "2019-12-03",
          registerTime: "2019-12-03",
          firstTime: "2019-12-03"
        },
        {
          name: "达摩院青橙奖LOGO",
          dengjihao: "国作登字-2018-F-00675364",
          type: "0",
          finishTime: "2019-12-03",
          registerTime: "2019-12-03",
          firstTime: "2019-12-03"
        },
        {
          name: "达摩院青橙奖LOGO",
          dengjihao: "国作登字-2018-F-00675364",
          type: "0",
          finishTime: "2019-12-03",
          registerTime: "2019-12-03",
          firstTime: "2019-12-03"
        },
        {
          name: "达摩院青橙奖LOGO",
          dengjihao: "国作登字-2018-F-00675364",
          type: "0",
          finishTime: "2019-12-03",
          registerTime: "2019-12-03",
          firstTime: "2019-12-03"
        },
        {
          name: "达摩院青橙奖LOGO",
          dengjihao: "国作登字-2018-F-00675364",
          type: "0",
          finishTime: "2019-12-03",
          registerTime: "2019-12-03",
          firstTime: "2019-12-03"
        },
        {
          name: "达摩院青橙奖LOGO",
          dengjihao: "国作登字-2018-F-00675364",
          type: "0",
          finishTime: "2019-12-03",
          registerTime: "2019-12-03",
          firstTime: "2019-12-03"
        },
        {
          name: "达摩院青橙奖LOGO",
          dengjihao: "国作登字-2018-F-00675364",
          type: "0",
          finishTime: "2019-12-03",
          registerTime: "2019-12-03",
          firstTime: "2019-12-03"
        },
        {
          name: "达摩院青橙奖LOGO",
          dengjihao: "国作登字-2018-F-00675364",
          type: "0",
          finishTime: "2019-12-03",
          registerTime: "2019-12-03",
          firstTime: "2019-12-03"
        },
        {
          name: "达摩院青橙奖LOGO",
          dengjihao: "国作登字-2018-F-00675364",
          type: "0",
          finishTime: "2019-12-03",
          registerTime: "2019-12-03",
          firstTime: "2019-12-03"
        }
      ],
      itemList: []
    };
  },
  mounted() {
    this.handleCurrentChange(1);
  },
  methods: {
    handleCurrentChange(val) {
      this.itemList = this.copyrightList.slice(
        (val - 1) * this.pageSize,
        val * this.pageSize
      );
    },
    indexMethod(index) {
      return index * 2;
    },
    //翻转
    showTable() {
      this.$emit("unshowOne");
    }
  }
};
</script>

<style lang="scss">
.copyright {
  width: 100%;
  h3 {
    display: flex;
    align-items: center;
    margin-bottom: 17px;
    p {
      margin-right: 8px;
      font-size: 15px;
      cursor: pointer;
    }
    b {
      width: 2.5px;
      height: 14px;
      background: #1478f0;
      display: block;
      margin-right: 5px;
    }
    .el-breadcrumb {
      .el-breadcrumb__item:nth-child(1) {
        .el-breadcrumb__inner {
          font-size: 16px;
          font-family: PingFangSC-Medium, PingFang SC;
          font-weight: 500;
          color: rgba(51, 51, 51, 1);
          line-height: 22px;
        }
      }
      .el-breadcrumb__item:nth-child(2) {
        .el-breadcrumb__inner {
          font-size: 14px;
          font-family: PingFangSC-Regular, PingFang SC;
          font-weight: 400;
          color: rgba(20, 120, 240, 1);
          line-height: 22px;
        }
      }
    }
  }
  table {
    width: 100%;
    text-align: center;
    .copyright-table-header {
      width: 100%;
      tr {
        width: 100%;
        td {
          padding: 15px;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
          border: 1px solid #e4eef6;
          background: #f2f9fc;
        }
      }
    }
    .copyright-table-body {
      width: 100%;
      tr {
        width: 100%;
        td {
          padding: 15px;
          border: 1px solid #e4eef6;
          img {
            width: 60px;
            height: 34px;
            border: 2px solid #ccc;
            display: inline-block;
          }
        }
      }
    }
  }
  .el-pagination {
    display: flex;
    justify-content: center;
    margin: 19px 0;
  }
}
</style>
