<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="bottomLeft" style="width: auto; height: 400px"></div> -->
    <Echart
      :options="options"
      id="bottomLeft"
      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",
        },
        xAxis: {
          type: "category",
          data: ["1小时以内", "1-2小时", "2-4小时", "4-24小时", "24小时以上"],
        },
        yAxis: {
          type: "value",
        },
        series: [
          {
            data: [200, 172, 150, 80, 70],
            type: "bar",
          },
        ],
      },
    };
  },
  mounted() {
    // this.cinit();
  },
  methods: {
    cinit() {
      this.$echarts
        .init(document.getElementById("bottomLeft"))
        .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;
}
#topCenter {
  width: 100%;
  height: 350px;
}
.dv {
  width: 100px;
  height: 100px;
  position: absolute;
  right: -86px;
  z-index: 99;
}
.dv > p {
  text-align: center;
  padding-bottom: 5px;
}
</style>