Blame view

admin-web-master/src/views/active/component/dataTable.vue 2.27 KB
3f535f30   杨鑫   '初始'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
  <template>
    <el-card class="activityData">
      <div slot="header" class="clearfix">
        <span class="title">商家数据明细</span>
        <el-button style="background-color: #3F9B6A;color: #fff" @click="send">导出</el-button>
      </div>
      <div class="text">
        <!--  表格 -->
        <div class="content_table">
          <div class="table">
            <el-table
              :data="tableData"
             :header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}"
            >
              >
              <el-table-column prop="shopName" label="店铺名称" />
              <el-table-column prop="shopCode" label="店铺编码" />
              <el-table-column prop="products" label="参与商品数(件)" />
              <el-table-column prop="persons" label="访客数(人)" />
              <el-table-column prop="orders" label="订单数(笔)" />
              <el-table-column prop="customers" label="成交客户数(笔)" />
              <el-table-column prop="price" label="客单价(元)" />
              <el-table-column prop="total" label="成交总额(元)" />
            </el-table>
            <div class="fenye">
              <el-pagination
                :current-page="page"
                :page-sizes="[10, 20, 50, 100]"
                :page-size="10"
                layout="total, sizes, prev, pager, next, jumper"
                :total="total"
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
              />
            </div>
          </div>
        </div>
      </div>
    </el-card>
  </template>
  
  <script>
  export default {
    props: {
      tableData: {
        type: Array,
        default: () => []
      },
      total: {
        type: Number,
        default: 0
      }
    },
    data () {
      return {
        page: 1
      }
    },
    methods: {
      handleCurrentChange (e) {
        this.$emit('handleCurrentChange', e)
      },
      handleSizeChange (e) {
        this.$emit('handleSizeChange', e)
      },
      send () { this.$emit('export') }
    }
  }
  </script>
  
  <style lang="scss" scoped>
  .activityData{
    width: 100%;
    .clearfix {
      line-height: 40px;
      .title{
        font-size: 20px;
      }
      button {
        width: 120px;
        height: 40px;
        background: #3a68f2;
        border-radius: 4px;
        float: right;
        padding: 3px 0;
      }
    }
  }
  </style>