<template>
  <div class="module-content">
    <h4>成员</h4>
    <ul class="data-list">
      <li>
        <p>总动态数</p>
        <h5>100</h5>
      </li>
      <li>
        <p>今日新增动态书</p>
        <h5>500</h5>
      </li>
    </ul>
    <div class="chart-header">
      <h5>内容趋势</h5>
      <el-form :inline="true" size="mini" :model="formInline" class="my-form">
        <el-form-item label="">
          <el-select v-model="value" placeholder="请选择">
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="">
          <el-date-picker
            v-model="value1"
            type="daterange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="">
          <el-button type="primary" @click="onSubmit">搜索</el-button>
          <el-button>导出</el-button>
        </el-form-item>
      </el-form>
    </div>
    <LineChart :option="echartOption"></LineChart>
  </div>
</template>
<script>
import LineChart from "./LineChart";
export default {
  components: { LineChart },
  data() {
    return {
      options: [
        {
          value: "1",
          label: "日"
        },
        {
          value: "2",
          label: "月"
        },
        {
          value: "3",
          label: "年"
        }
      ],
      echartOption: {
        tooltip: {
          trigger: "axis"
        },
        legend: {
          data: ["Email", "Union Ads"]
        },
        grid: {
          top: "40px",
          left: "20px",
          right: "20px",
          bottom: "3%",
          containLabel: true
        },
        toolbox: {
          feature: {
            saveAsImage: {}
          }
        },
        xAxis: {
          type: "category",
          boundaryGap: false,
          data: ["Mon", "Tue"]
        },
        yAxis: {
          type: "value"
        },
        series: [
          {
            name: "Email",
            type: "line",
            stack: "Total",
            data: [120, 132, 101, 134, 90, 230, 210]
          }
        ]
      }
    };
  }
};
</script>
<style lang="scss" scoped>
.my-form {
  ::v-deep .el-form-item--mini.el-form-item {
    margin-bottom: 0;
  }
}
.module-content {
  margin-bottom: 20px;
  h4 {
    margin: 0;
    font-size: 18px;
  }
}
.data-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 20px;
  li {
    width: 250px;
    margin-right: 20px;
    background: rgba(0, 0, 0, 0.1);
    padding: 10px;
    p {
      margin: 0;
      font-size: 16px;
      line-height: 30px;
    }
    h5 {
      margin: 0;
      padding: 0;
      font-size: 24px;
      line-height: 40px;
    }
  }
}
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  h5 {
    font-size: 14px;
    color: #666;
    margin: 0;
  }
}
</style>
