ViewTabs.vue 1.43 KB
<template>
  <div class="tabs flex box">
    <div class="tab" v-for="item in tabs" :key="item.key">
      <div class="tab-title">{{ item.title }}</div>
      <div class="tab-text text-linear">{{dataList[item.key]}}</div>
    </div>
  </div>
</template>

<script type="text/ecmascript-6">
import * as echarts from 'echarts'
export default {
  name: 'ViewTabs',
  data() {
    return {
      dataList:{},
      tabs: [
        {
          title: '总门店数',
          key: 'totalNum'
        },
        {
          title: '当年新增',
          key: 'incrNum'
        },
        {
          title: '留存率',
          key: 'retention'
        },
        {
          title: '单店产值',
          key: 'outputValue'
        }
      ]
    }
  },
  created() {
    this.getEnterpriseOverview()
  },
  methods: {
    getEnterpriseOverview() {
      this.api.customer.getEnterpriseOverview().then(res => {
        console.log(res)
        if(res.code == 0){
          this.dataList = res.data.dataList[0]
        }
      })
    }
  }
}
</script>

<style scoped lang="scss">
.tabs {
  margin: 1.22vh 0 0.98vh 0;
  padding: 0 1.67vw;
  height: 6.95vh;
  width: 100%;
  box-sizing: border-box;
  justify-content: space-between;
  .tab {
    margin: 0.61vh 0;
    .tab-title {
      font-weight: 400;
      font-size: 12px;
      color: #e8e8e8;
    }
    .tab-text {
      font-weight: 700;
      font-size: 24px;
      line-height: 30px;
    }
  }
}
</style>