<template>
  <CollapseItem name="数据设置" :expanded="true">
    <SettingItemBox name="主题设置">
      <SettingItem name="背景颜色">
        <n-color-picker
          size="small"
          :modes="['rgb']"
          v-model:value="optionData.dataStyle.backgroud"
        ></n-color-picker>
      </SettingItem>
      <SettingItem name="上方边距">
        <n-input-number
          v-model:value="optionData.dataStyle.margintop"
          min="0"
          type="text"
          size="small"
        />
      </SettingItem>
      <SettingItem name="左侧边距">
        <n-input-number
          v-model:value="optionData.dataStyle.marginleft"
          min="0"
          type="text"
          size="small"
        />
      </SettingItem>
      <SettingItem name="间隔距离">
        <n-input-number v-model:value="optionData.dataStyle.gap" min="0" type="text" size="small" />
      </SettingItem>
    </SettingItemBox>

    <SettingItemBox name="字体设置">
      <SettingItem name="数量字体颜色">
        <n-color-picker
          size="small"
          :modes="['rgb']"
          v-model:value="optionData.dataStyle.numberFontColor"
        ></n-color-picker>
      </SettingItem>
      <SettingItem name="数量字体大小">
        <n-input-number
          v-model:value="optionData.dataStyle.numberFontSize"
          :min="0"
          size="small"
          placeholder="数量字体大小"
        ></n-input-number>
      </SettingItem>
      <SettingItem name="标题字体颜色">
        <n-color-picker
          size="small"
          :modes="['rgb']"
          v-model:value="optionData.dataStyle.titleFontColor"
        ></n-color-picker>
      </SettingItem>
      <SettingItem name="标题字体大小">
        <n-input-number
          v-model:value="optionData.dataStyle.titleFontSize"
          :min="0"
          size="small"
          placeholder="标题字体大小"
        ></n-input-number>
      </SettingItem>
      <SettingItem name="个体宽度">
        <n-input-number
          v-model:value="optionData.dataStyle.width"
          min="0"
          type="text"
          size="small"
        />
      </SettingItem>
    </SettingItemBox>
  </CollapseItem>
</template>

<script setup lang="ts">
  import { PropType, watch, ref } from 'vue';
  import { option } from './config';
  import { cloneDeep } from 'lodash-es';
  import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting';

  const props = defineProps({
    optionData: {
      type: Object as PropType<typeof option>,
      required: true,
    },
  });

  // 适应类型
  const fitList = [
    {
      value: 'fill',
      label: 'fill',
    },
    {
      value: 'contain',
      label: 'contain',
    },
    {
      value: 'cover',
      label: 'cover',
    },
    {
      value: 'scale-down',
      label: 'scale-down',
    },
    {
      value: 'none',
      label: 'none',
    },
  ];

  const dataStyleClone = {
    borderColor: '#008000',
    titleColorStop1: '#1F6B55',
    titleColorStop2: '#0A392A',
    titleRightrColor: '#00611A',
    iconColorStop1: '#73F095',
    iconColorStop2: '#BBFDB5',
    iconStrokeColor: '#00611A',
    iconFillColor: '#0A251E',
    iconBottomColor: '#0E4030',
  };
</script>
