<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.imageWidth"
          :min="0"
          size="small"
          placeholder="图标宽度"
        />
      </SettingItem>
      <!-- <SettingItem name="图标高度">
        <n-input-number
          v-model:value="optionData.dataStyle.imageHeight"
          :min="0"
          size="small"
          placeholder="图标高度"
        />
      </SettingItem> -->
      <SettingItem name="图标距离右侧的距离">
        <n-input-number
          v-model:value="optionData.dataStyle.right"
          :min="0"
          size="small"
          placeholder="高度"
        />
      </SettingItem>
      <SettingItem name="图标距离底部的距离">
        <n-input-number
          v-model:value="optionData.dataStyle.bottom"
          :min="0"
          size="small"
          placeholder="宽度"
        />
      </SettingItem>
      <SettingItem name="图标颜色（小）">
        <n-color-picker
          size="small"
          :modes="['rgb']"
          v-model:value="optionData.dataStyle.smallColor1"
        ></n-color-picker>
      </SettingItem>
      <SettingItem>
        <n-button
          size="small"
          @click="optionData.dataStyle.smallColor1 = optionData.dataStyleClone.smallColor1"
        >
          恢复默认
        </n-button>
      </SettingItem>
      <SettingItem name="图标颜色（小）">
        <n-color-picker
          size="small"
          :modes="['rgb']"
          v-model:value="optionData.dataStyle.smallColor2"
        ></n-color-picker>
      </SettingItem>
      <SettingItem>
        <n-button
          size="small"
          @click="optionData.dataStyle.smallColor2 = optionData.dataStyleClone.smallColor2"
        >
          恢复默认
        </n-button>
      </SettingItem>
      <SettingItem name="图标颜色（大）">
        <n-color-picker
          size="small"
          :modes="['rgb']"
          v-model:value="optionData.dataStyle.largeColor1"
        ></n-color-picker>
      </SettingItem>
      <SettingItem>
        <n-button
          size="small"
          @click="optionData.dataStyle.largeColor1 = optionData.dataStyleClone.largeColor1"
        >
          恢复默认
        </n-button>
      </SettingItem>
      <SettingItem name="图标颜色（大）">
        <n-color-picker
          size="small"
          :modes="['rgb']"
          v-model:value="optionData.dataStyle.largeColor2"
        ></n-color-picker>
      </SettingItem>
      <SettingItem>
        <n-button
          size="small"
          @click="optionData.dataStyle.largeColor2 = optionData.dataStyleClone.largeColor2"
        >
          恢复默认
        </n-button>
      </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,
    },
  });
</script>
