Newer
Older
testLinkTool / src / components / testLink / testLink.vue
dutingting on 30 Dec 2022 6 KB 搭建完成
<template>
  <div class="test-link">
    <div class="title">
      <div class="logo-text">
        <img class="logo" src="../../assets/img/logo.png" />
        <span>新疆互联网违法和不良信息举报中心</span>
      </div>
      <div class="subhead">—— 全平台链接测试工具</div>
    </div>
    <div class="main">
      <div class="text">平台链接测试支持:抖音、快手、西瓜、微视等主流短视频平台,微博、 小红书、贴吧、b站、公众号</div>
      <div class="button-area">
        <el-button type="primary">链接测试</el-button>
        <el-button type="primary">导入</el-button>
        <el-button type="primary">导出</el-button>
      </div>
    </div>

    <div class="table-area">
      <el-table
        v-loading="tableLoading"
        :data="tableData"
        :height="tableHeight"
        border
        stripe
        :show-overflow-tooltip="true"
        style="width: 100%"
        @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="55"></el-table-column>
        <el-table-column label="序号" width="55" align="center">
          <template slot-scope="scope">
            {{ (pageNum - 1) * pageSize + scope.$index + 1 }}
          </template>
        </el-table-column>
        <el-table-column
          align="center"
          v-for="item in tableHead"
          :key="item.id"
          :prop="item.id"
          :label="item.name"
        ></el-table-column>
      </el-table>
    </div>

    <PageNum
      :pageSize="pageSize"
      :pageNum="pageNum"
      :total="total"
      @changePageSize="changePageSize"
      @changePageNum="changePageNum"
    />
  </div>
</template>
<script>
import PageNum from '../page/pageNum.vue';
export default {
  name: 'TestLink',
  components: {
    PageNum
  },
  data() {
    return {
      tableData: [{
        type: '西瓜',
        address: '1111',
        time: '2021-12-12 12:12:00',
        usedTime: '80',
        status: '通过'
      },
      {
        type: '西瓜',
        address: '1111',
        time: '2021-12-12 12:12:00',
        usedTime: '80',
        status: '通过'
      },
      {
        type: '西瓜',
        address: '1111',
        time: '2021-12-12 12:12:00',
        usedTime: '80',
        status: '通过'
      },
      {
        type: '西瓜',
        address: '1111',
        time: '2021-12-12 12:12:00',
        usedTime: '80',
        status: '通过'
      },
      {
        type: '西瓜',
        address: '1111',
        time: '2021-12-12 12:12:00',
        usedTime: '80',
        status: '通过'
      },
      {
        type: '西瓜',
        address: '1111',
        time: '2021-12-12 12:12:00',
        usedTime: '80',
        status: '通过'
      },
      {
        type: '西瓜',
        address: '1111',
        time: '2021-12-12 12:12:00',
        usedTime: '80',
        status: '通过'
      },
      {
        type: '西瓜',
        address: '1111',
        time: '2021-12-12 12:12:00',
        usedTime: '80',
        status: '通过'
      },
      {
        type: '西瓜',
        address: '1111',
        time: '2021-12-12 12:12:00',
        usedTime: '80',
        status: '通过'
      },
      {
        type: '西瓜',
        address: '1111',
        time: '2021-12-12 12:12:00',
        usedTime: '80',
        status: '通过'
      },
      {
        type: '西瓜',
        address: '1111',
        time: '2021-12-12 12:12:00',
        usedTime: '80',
        status: '通过'
      },
      {
        type: '西瓜',
        address: '1111',
        time: '2021-12-12 12:12:00',
        usedTime: '80',
        status: '通过'
      },
      {
        type: '西瓜',
        address: '1111',
        time: '2021-12-12 12:12:00',
        usedTime: '80',
        status: '通过'
      }], //表格数据
      tableHead: [
        {
          id: 'type',
          name: '平台类型'
        },
        {
          id: 'address',
          name: '链接地址'
        },
        {
          id: 'time',
          name: '测试时间'
        },
        {
          id: 'usedTime',
          name: '测试耗时/ms'
        },
        {
          id: 'status',
          name: '测试状态'
        },
      ], //表头
      checkoutList: [],
      pageSize: 10, //一页多少条
      pageNum: 1, //第几页
      total: 50, //总条数
      tableLoading: false, //表格loading
      tableHeight: document.body.clientHeight - 220,   //表格固定高度
    }
  },
  methods: {
    //多选
    handleSelectionChange(val) {
      this.checkoutList = val;
      console.log(this.checkoutList);
    },
    changePageSize(val) {
      this.pageSize = val;
    },
    changePageNum(val) {
      this.changePageNum = val;
    }
  }
}
</script>
<style lang="scss" scoped>
  .test-link {
    width: 100%;
    height: 100%;
    padding-bottom: 20px;
    .title {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      width: 100%;
      height: 100px;
      background: url('../../assets/img/bg.png') no-repeat center;
      background-size: 100% 100%;
      padding: 0 20px;
      .logo-text {
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 32px;
        color: #fff;
        letter-spacing: 8px;
        font-weight: 600;
        .logo {
          height: 50px;
          height: 50px;
          margin-right: 20px;
        }
      }
      .subhead {
        width: 100%;
        text-align: right;
        font-size: 22px;
        color: #fff;
        margin-right: 80px;
      }
    }
    .main {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 20px 30px 0 20px;
      .text {
        margin-right: 60px;
        text-align: left;
        font-size: 13px;
      }
      .button-area {
        display: flex;
        flex-wrap: nowrap;
      }
    }
    .table-area {
      padding: 10px 20px;
    }
  }
</style>
<style lang="scss">
  .test-link {
    .el-button {
      background-color: #169bd5;
    }
    .el-table th.el-table__cell {
      background-color: rgba(0, 150, 224, .1);
      color: #444c59;
      font-weight: 600;
    }
    .el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell {
      // background-color: rgba(0, 150, 224, .1);
    }
    .el-checkbox__input.is-checked .el-checkbox__inner, .el-checkbox__input.is-indeterminate .el-checkbox__inner {
      background-color: #169bd5;
      border-color: #169bd5;
    }
    .el-table .cell {
      line-height: 16px;
    }
  }
</style>