<template>
  <div class="custom-analyse-tabs-line">
    <el-form :model="form" label-width="60px" label-position="left" class="line-form">
      <el-form-item label="开启">
        <el-switch v-model="form.setting.config.line.enable"></el-switch>
      </el-form-item>
      <el-form-item label="名称">
        <el-input v-model="form.setting.config.line.name"></el-input>
      </el-form-item>
      <el-form-item label="运算">
        <el-select v-model="form.setting.config.line.operator" style="width: 100%;" clearable>
          <el-option label="平均值" :value="0"></el-option>
          <el-option label="占比" :value="1"></el-option>
          <el-option label="总和" :value="2"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="第一项" v-if="form.setting.config.line.operator === 1">
        <el-select v-model="form.setting.config.line.first" style="width: 100%;" clearable placeholder="请选择第一项">
          <el-option v-for="(item, index) in selected.y" :label="item" :value="item"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="第二项" v-if="form.setting.config.line.operator === 1">
        <el-select v-model="form.setting.config.line.second" style="width: 100%;" clearable placeholder="请选择第二项">
          <el-option label="总和" value="0"></el-option>
          <el-option v-for="(item, index) in selected.y" :label="item" :value="item"></el-option>
        </el-select>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import mixins from "./mixins";
export default {
  mixins: [mixins],
  mounted() {
  }
}
</script>

<style lang="scss">
.custom-analyse-tabs-line {
  padding: 10px;
  .line-form {
    .el-form-item {
      margin-top: 15px !important;
    }
  }
}
</style>