<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>
        <n-button
          size="small"
          @click="optionData.dataStyle.backgroud = optionData.dataStyleClone.backgroud"
        >
          恢复默认
        </n-button>
      </SettingItem>
      <SettingItem name="左上、右下角的装饰颜色1">
        <n-color-picker
          size="small"
          :modes="['rgb']"
          v-model:value="optionData.dataStyle.lineColor1"
        ></n-color-picker>
      </SettingItem>
      <SettingItem>
        <n-button
          size="small"
          @click="optionData.dataStyle.lineColor1 = optionData.dataStyleClone.lineColor1"
        >
          恢复默认
        </n-button>
      </SettingItem>
      <SettingItem name="左上、右下角的装饰颜色2">
        <n-color-picker
          size="small"
          :modes="['rgb']"
          v-model:value="optionData.dataStyle.lineColor2"
        ></n-color-picker>
      </SettingItem>
      <SettingItem>
        <n-button
          size="small"
          @click="optionData.dataStyle.lineColor2 = optionData.dataStyleClone.lineColor2"
        >
          恢复默认
        </n-button>
      </SettingItem>
      <SettingItem name="左上、右下角的装饰颜色3">
        <n-color-picker
          size="small"
          :modes="['rgb']"
          v-model:value="optionData.dataStyle.lineColor3"
        ></n-color-picker>
      </SettingItem>
      <SettingItem>
        <n-button
          size="small"
          @click="optionData.dataStyle.lineColor3 = optionData.dataStyleClone.lineColor3"
        >
          恢复默认
        </n-button>
      </SettingItem>
      <SettingItem name="外侧边框线颜色">
        <n-color-picker
          size="small"
          :modes="['rgb']"
          v-model:value="optionData.dataStyle.pathLineColor1"
        ></n-color-picker>
      </SettingItem>
      <SettingItem>
        <n-button
          size="small"
          @click="optionData.dataStyle.pathLineColor1 = optionData.dataStyleClone.pathLineColor1"
        >
          恢复默认
        </n-button>
      </SettingItem>
      <SettingItem name="内侧边框线颜色">
        <n-color-picker
          size="small"
          :modes="['rgb']"
          v-model:value="optionData.dataStyle.pathLineColor2"
        ></n-color-picker>
      </SettingItem>
      <SettingItem>
        <n-button
          size="small"
          @click="optionData.dataStyle.pathLineColor2 = optionData.dataStyleClone.pathLineColor2"
        >
          恢复默认
        </n-button>
      </SettingItem>
      <SettingItem name="顶部矩形块颜色">
        <n-color-picker
          size="small"
          :modes="['rgb']"
          v-model:value="optionData.dataStyle.topPolygonColor"
        ></n-color-picker>
      </SettingItem>
      <SettingItem>
        <n-button
          size="small"
          @click="optionData.dataStyle.topPolygonColor = optionData.dataStyleClone.topPolygonColor"
        >
          恢复默认
        </n-button>
      </SettingItem>
      <SettingItem name="顶部椭圆形块颜色">
        <n-color-picker
          size="small"
          :modes="['rgb']"
          v-model:value="optionData.dataStyle.topEllipseColor"
        ></n-color-picker>
      </SettingItem>
      <SettingItem>
        <n-button
          size="small"
          @click="optionData.dataStyle.topEllipseColor = optionData.dataStyleClone.topEllipseColor"
        >
          恢复默认
        </n-button>
      </SettingItem>
      <SettingItem name="底部矩形块颜色">
        <n-color-picker
          size="small"
          :modes="['rgb']"
          v-model:value="optionData.dataStyle.bottomUseColor"
        ></n-color-picker>
      </SettingItem>
      <SettingItem>
        <n-button
          size="small"
          @click="optionData.dataStyle.bottomUseColor = optionData.dataStyleClone.bottomUseColor"
        >
          恢复默认
        </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>
