<template>
  <CollapseItem name="数据设置" :expanded="true">
    <SettingItemBox name="展示样式">
      <SettingItem name="标题字体颜色">
        <n-color-picker
          size="small"
          :modes="['rgb']"
          v-model:value="optionData.dataStyle.titleColor"
        ></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-color-picker
          size="small"
          :modes="['rgb']"
          v-model:value="optionData.dataStyle.timeColor"
        ></n-color-picker>
      </SettingItem>
      <SettingItem name="时间字体大小">
        <n-input-number
          v-model:value="optionData.dataStyle.timeFontSize"
          :min="0"
          size="small"
          placeholder="时间字体大小"
        ></n-input-number>
      </SettingItem>
      <SettingItem name="类型字体颜色">
        <n-color-picker
          size="small"
          :modes="['rgb']"
          v-model:value="optionData.dataStyle.numColor"
        ></n-color-picker>
      </SettingItem>
      <SettingItem name="类型字体大小">
        <n-input-number
          v-model:value="optionData.dataStyle.numFontSize"
          :min="0"
          size="small"
          placeholder="类型字体大小"
        ></n-input-number>
      </SettingItem>
    </SettingItemBox>
    <SettingItemBox>
      <SettingItem name="间隔距离">
        <n-input-number
          v-model:value="optionData.dataStyle.marginbottom"
          :min="0"
          size="small"
          placeholder="间隔距离"
        ></n-input-number>
      </SettingItem>
      <SettingItem>
        <n-space>
          <n-switch v-model:value="optionData.dataStyle.sortOrder" size="small">
            <template #checked> 数量排序 </template>
            <template #unchecked> 时间排序 </template>
          </n-switch>
          <n-text>排序方式</n-text>
        </n-space>
      </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>
