DigitalLink.vue 2.6 KB
<template>
  <div class="link-box">
    <box-title title="数字化链接"></box-title>
    <div class="link-box-content">
      <StatisticsBox :list="digitalLinkList"></StatisticsBox>
      <div class="down-content">
        <PullDownSelect :selectList="selectList" @selectVal="selectVal"></PullDownSelect>
        <BarChart ref="linkChartRef" domId="linkChart" :dataList.sync="dataList" :colorList="colorList" :tooltipFormatterObj="tooltips"></BarChart>
      </div>
    </div>
  </div>
</template>

<script>
import PullDownSelect from './PullDownSelect.vue'
import BarChart from './BarChart.vue'
export default {
  name: 'DigitalLink',
  components: {
    PullDownSelect,
    BarChart
  },
  data() {
    return {
      digitalLinkList: [
        {
          name: '成品激活设备总数',
          valueName: 'count',
          value: '0',
          unit: '¥',
          unitType: 'left',
          bottomType: 'ratio',
          ratioLeftLabel: '周同比',
          ratioLeftValueName: 'outputvalueTb',
          ratioLeftValue: '0',
          ratioRightLabel: '日环比',
          ratioRightValueName: 'outputvalueHb',
          ratioRightValue: '0'
        },
        {
          name: '半成品激活设备总数',
          valueName: 'countvalue',
          value: '0',
          unit: '¥',
          unitType: 'left',
          bottomType: 'ratio',
          ratioLeftLabel: '周同比',
          ratioLeftValueName: 'outputvalueTb',
          ratioLeftValue: '0',
          ratioRightLabel: '日环比',
          ratioRightValueName: 'outputvalueHb',
          ratioRightValue: '0'
        }
      ],
      selectList: [
        {
          name: '成品设备激活趋势',
          val: 'num'
        },
        {
          name: '半成品发货趋势',
          val: 'merNum'
        }
      ],
      dataList: [
        {
          statMonth: '2021',
          actiNum: 400
        },
        {
          statMonth: '2022',
          actiNum: 400
        },
        {
          statMonth: '2023',
          actiNum: 400
        }
      ],
      colorList: ['#22D8FF', '#223FA9', '#061422'],
      tooltips: {
        label: '场次',
        attrName: 'actiNum'
      }
    }
  },

  mounted() {
    this.$refs.linkChartRef.drawBar()
  },

  methods: {
    selectVal(val) {}
  }
}
</script>

<style lang="scss" scoped>
.link-box {
  width: 23.33vw;
  height: 40vh;
  box-shadow: inset 0 0 20px 0 #3d57ff69;
  &-content {
    padding: 1.56vh 0.83vw;
    .down-content {
      margin-top: 1.78vh;
      height: 21.5vh;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
    }
  }
}
</style>