blocHome.vue 3.95 KB
<template>
  <div class="bloc-container">
    <div class="top_wrapper">
      <div class="left_box_wrap"></div>
      <div class="right_wrap">
        <div class="right_top_wrap">
          <div class="r_t_box"></div>
          <div class="r_t_box"></div>
          <div class="r_t_box r_t_box_max"></div>
        </div>
        <div class="right_bottom_wrap"></div>
      </div>
    </div>
    <div class="bottom_wrapper">
      <div class="table_title flex_scb">
        <span class="h12_title">门店直播产值详情</span>
        <span class="export_span">
          导出
          <i class="el-icon-d-arrow-right"></i>
        </span>
      </div>
      <div class="tbale_wrap">
        <el-table :data="tableData" height="350" style="100%" highlight-current-row>
          <el-table-column prop="merchantName" label="门店名称" width="300px" align="center"></el-table-column>
          <el-table-column prop="count" label="参与场次" width="100px" align="center"></el-table-column>
          <el-table-column prop="total" label="总产值" width="500px">
            <template slot-scope="scope">
              <div class="echat_wrap">
                <div class="h19_title xtext">¥{{ scope.row.total }}</div>
                <div class="progress_wrap">
                  <div :style="{ width: (100 * scope.row.total) / custSortMax + '%' }" class="summary-progress-barin"></div>
                </div>
              </div>
            </template>
          </el-table-column>
          <el-table-column label="平均单场产值" align="center">
            <template slot-scope="scope">
              <div class="h19_title">¥{{ scope.row.perProduct }}</div>
            </template>
          </el-table-column>
        </el-table>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      tableData: [],
      custSortMax: 0
    }
  },
  mounted() {
    // 模拟数据
    this.custSortMax = 0

    for (let i = 0; i < 10; i++) {
      let obj = {
        merchantName: '门店' + i,
        count: i + 10,
        total: Math.round(Math.random() * 10000),
        perProduct: Math.round(Math.random() * 6000)
      }
      this.tableData.push(obj)
    }
    this.tableData.forEach(item => {
      if (item.total >= this.custSortMax) {
        this.custSortMax = item.total
      }
    })
  }
}
</script>
<style lang="scss" scoped>
.bloc-container {
  margin-top: 17px;
}
.top_wrapper {
  display: flex;
  justify-content: space-between;
  box-sizing: border-box;
  padding: 20px 10px 20px 20px;
  background: #ffffff;
  box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
  .left_box_wrap {
    width: 300px;
    height: 350px;
    border-radius: 2px;
    border: 1px solid #eae9ee;
  }
  .right_wrap {
    width: calc(100% - 310px);
    .right_top_wrap {
      display: flex;
      justify-content: space-between;
      .r_t_box {
        // width: 240px;
        width: calc(30% - 5px);
        height: 160px;
        background: #ffffff;
        border-radius: 2px;
        border: 1px solid #eae9ee;
      }
      .r_t_box_max {
        width: calc(40% - 10px);
      }
    }
    .right_bottom_wrap {
      margin-top: 10px;
      height: 180px;
      background: #ffffff;
      border-radius: 2px;
      border: 1px solid #eae9ee;
    }
  }
}
.bottom_wrapper {
  margin-top: 10px;
  height: 398px;
  background: #ffffff;
  box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
  box-sizing: border-box;
  padding: 15px;
  .table_title {
    padding: 0 0 10px 0;
    .export_span {
      font-size: 14px;
      font-weight: 500;
      color: #5850ff;
      cursor: pointer;
      > i {
        color: #5850ff;
        margin-left: 5px;
      }
    }
  }
  .tbale_wrap {
    .echat_wrap {
      display: flex;
      align-items: center;
      .xtext {
        width: 20%;
      }
      .progress_wrap {
        width: 65%;
        margin-left: 10px;
      }
      .summary-progress-barin {
        height: 15px;
        background-color: #5850ff;
      }
    }
  }
}
</style>