<template>
  <CollapseItem name="默认方法设置" :expanded="true">
    <n-space>
      <n-switch v-model:value="optionData.dataStyle.defaultCloseModal" size="small" />
      <n-text>默认点击隐藏火情详情弹窗及其所在分组的内容</n-text>
    </n-space>
  </CollapseItem>
  <CollapseItem name="按钮设置" :expanded="true">
    <SettingItemBox name="内容设置">
      <SettingItem name="按钮颜色">
        <n-color-picker
          size="small"
          :modes="['hex']"
          v-model:value="optionData.dataStyle.color"
        ></n-color-picker>
      </SettingItem>
      <SettingItem>
        <n-button size="small" @click="optionData.dataStyle.color = dataStyleClone.color">
          恢复默认
        </n-button>
      </SettingItem>
      <SettingItem name="X的颜色">
        <n-color-picker
          size="small"
          :modes="['hex']"
          v-model:value="optionData.dataStyle.fontColor"
        ></n-color-picker>
      </SettingItem>
      <SettingItem>
        <n-button size="small" @click="optionData.dataStyle.fontColor = dataStyleClone.fontColor">
          恢复默认
        </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,
    },
  });

  const dataStyleClone = {
    color: '#005516',
    fontColor: '#FFFFFF',
  };
</script>
