<template>
  <div class="new-bar-option">
    <div class="setting-title" @click="show = !show">
      <div>组件设置</div>
      <e class="el-icon-arrow-right" v-show="!show"></e>
      <e class="el-icon-arrow-down" v-show="show"></e>
    </div>
    <el-form size="mini" label-width="35%" v-show="show">
      <el-form-item label="图表大小">
        <el-input-number v-model="option.pieArea"></el-input-number>
      </el-form-item>
      <el-form-item label="使用环形图">
        <el-switch v-model="option.pieIsRing"></el-switch>
      </el-form-item>
      <el-form-item label="环形半径" v-if="option.pieIsRing">
        <el-input-number v-model="option.pieRingRadius"></el-input-number>
      </el-form-item>
      <el-form-item label="南丁格尔图">
        <el-switch v-model="option.roseType"></el-switch>
      </el-form-item>
      <el-form-item label="圆角设置">
        <el-input-number v-model="option.borderRadius"></el-input-number>
      </el-form-item>
      <el-form-item label="显示标签">
        <el-switch v-model="option.isLabel"></el-switch>
      </el-form-item>
      <template v-if="option.isLabel">
        <el-form-item label="标签文字颜色">
          <avue-input-color v-model="option.labelFontColor"></avue-input-color>
        </el-form-item>
        <el-form-item label="标签位置">
          <el-select v-model="option.labelPosition" placeholder="请选择">
            <el-option  key="outside" label="外部" value="outside"></el-option>
            <el-option  key="inside" label="內部" value="inside"></el-option>
            <el-option  key="center" label="中心" value="center"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="显示标签">
          <el-checkbox v-model="option.isWeidu">维度</el-checkbox>
          <el-checkbox v-model="option.isZhibiao">指标</el-checkbox>
          <el-checkbox v-model="option.isBfb">百分比</el-checkbox>
        </el-form-item>
        <el-form-item v-if="option.isZhibiao" label="指标小数位">
          <el-input-number v-model="option.zbxsw"></el-input-number>
        </el-form-item>
        <el-form-item v-if="option.isBfb" label="百分比小数位">
          <el-input-number v-model="option.bfb"></el-input-number>
        </el-form-item>
      </template>
    </el-form>
    <div class="setting-title" @click="pieLabelLineShow = !pieLabelLineShow">
      <div>引导线设置</div>
      <e class="el-icon-arrow-right" v-show="!pieLabelLineShow"></e>
      <e class="el-icon-arrow-down" v-show="pieLabelLineShow"></e>
    </div>
    <el-form size="mini" label-width="35%" v-show="pieLabelLineShow">
      <el-form-item label="是否显示">
        <el-switch v-model="option.pieLabelLineShow"></el-switch>
      </el-form-item>
      <el-form-item label="是否平滑显示">
        <el-switch v-model="option.pieLabelLineSmooth"></el-switch>
      </el-form-item>
      <el-form-item label="第一段线长度">
        <el-input-number v-model="option.pieLabelLineLength"></el-input-number>
      </el-form-item>
      <el-form-item label="第二段线长度">
        <el-input-number v-model="option.pieLabelLineLength2"></el-input-number>
      </el-form-item>
    </el-form>

    <div class="style-ylabel">
      <div class="setting-title" @click="piegridshow = !piegridshow">
        <div>图表属性</div>
        <e class="el-icon-arrow-right" v-show="!piegridshow"></e>
        <e class="el-icon-arrow-down" v-show="piegridshow"></e>
      </div>
      <el-form size="mini" label-width="30%" v-show="piegridshow">
        <el-form-item label="左边距">
          <el-input-number v-model="option.pieGridLeft"></el-input-number>
        </el-form-item>
        <el-form-item label="上边距">
          <el-input-number v-model="option.pieGridRight"></el-input-number>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>
<script>
import {labelPosition} from "../dict";
export default {
  name: "new-pie-option",
  props: ["option"],
  data() {
    return {
      labelPosition,
      show: true,
      pieLabelLineShow: false,
      piegridshow: false,
    };
  },
};
</script>
<style lang="scss">
.new-bar-option {
}
</style>
