<template>
  <div class="txtSize">
    <div class="title">
      <span>采购返单时长</span>
      <!-- <span style="width"></span> -->
      <div style="display: flex">
        <span style="width: 100px">
          <el-select v-model="region" size="mini">
            <el-option label="不限部门" value="1"></el-option>
            <el-option label="网络部" value="2"></el-option>
          </el-select>
        </span>
        <span style="width: 60px">
          <el-select v-model="region1" size="mini">
            <el-option label="日" value="1"></el-option>
            <el-option label="月" value="2"></el-option>
            <el-option label="年" value="3"></el-option>
          </el-select>
        </span>
        <span style="width: 140px">

          <el-date-picker
            style="width:100%"
            size="mini"
            :clearable="false"
            v-model="region2"
            :type="region1 == 1 ? 'date' : region1 == 2 ? 'month' : 'year'"
            placeholder="选择日期">
          </el-date-picker>
        </span>
      </div>
    </div>
    <div class="dv">
      <p style="font-size: 12px">平均时长（分钟）</p>
      <dv-decoration-9>10</dv-decoration-9>
    </div>
    <!-- <div id="bottomRight" style="width: auto; height: 400px"></div> -->
    <Echart
      :options="options"
      id="bottomRight"
      height="400px"
      width="100%"
    ></Echart>
  </div>
</template>

<script>
import Echart from "@/common/echart";

export default {
  components: {
    Echart,
  },
  props: {
    cdata: {
      type: Object,
      default: () => ({}),
    },
  },
  data() {
    return {
      region: "1",
      region1: "1",
      region2: "1",
      options: {
        label: {
        show: true,
        position: 'inside'
      },
  legend: {},
  tooltip: {},
  dataset: {
    source: [
      ['product', '返单商品数', '中标商品数'],
      ['1小时以内', 43.3, 85.8],
      ['1-2小时', 83.1, 73.4],
      ['2-4小时', 86.4, 65.2],
      ['4-24小时', 72.4, 53.9],
      ['24小时以上', 72.4, 53.9]
    ]
  },
  xAxis: { type: 'category' },
  yAxis: {},
  // Declare several bar series, each will be mapped
  // to a column of dataset.source by default.
  series: [{ type: 'bar' }, { type: 'bar' }]
},
    };
  },
  mounted() {
    // this.cinit();
  },
  methods: {
    cinit() {
      this.$echarts
        .init(document.getElementById("bottomRight"))
        .setOption(this.options);
    },
  },
};
</script>

<style lang="scss" scoped>
.txtSize {
  // font-size: 0px;
  position: relative;
}
.title {
  font-size: 18px;
  margin: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dv{
     width: 100px;
     height: 100px;
     position: absolute;
     z-index: 99;
     left: -86px;
   }
   .dv>p{
     text-align: center;
     padding-bottom: 5px;
   }
</style>