<template>
  <CollapseItem name="数据设置" :expanded="true">
    <SettingItemBox name="边距样式">
      <SettingItem name="上边距离">
        <n-input-number
          v-model:value="optionData.dataStyle.margintop"
          :min="0"
          size="small"
          placeholder="上边距离"
        ></n-input-number>
      </SettingItem>
      <SettingItem name="下边距离">
        <n-input-number
          v-model:value="optionData.dataStyle.marginbottom"
          :min="0"
          size="small"
          placeholder="下边距离"
        ></n-input-number>
      </SettingItem>
      <SettingItem name="左侧距离">
        <n-input-number
          v-model:value="optionData.dataStyle.marginleft"
          :min="0"
          size="small"
          placeholder="左侧距离"
        ></n-input-number>
      </SettingItem>
      <SettingItem name="右侧距离">
        <n-input-number
          v-model:value="optionData.dataStyle.marginright"
          :min="0"
          size="small"
          placeholder="右侧距离"
        ></n-input-number>
      </SettingItem>
    </SettingItemBox>
    <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.typeColor"
        ></n-color-picker>
      </SettingItem>
      <SettingItem name="类型字体大小">
        <n-input-number
          v-model:value="optionData.dataStyle.typeFontSize"
          :min="0"
          size="small"
          placeholder="类型字体大小"
        ></n-input-number>
      </SettingItem>
      <SettingItem name="位置字体颜色">
        <n-color-picker
          size="small"
          :modes="['rgb']"
          v-model:value="optionData.dataStyle.positionColor"
        ></n-color-picker>
      </SettingItem>
      <SettingItem name="位置字体大小">
        <n-input-number
          v-model:value="optionData.dataStyle.positionFontSize"
          :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-input-number
          v-model:value="optionData.dataStyle.listMarginbottom"
          :min="0"
          size="small"
          placeholder="间隔距离"
        ></n-input-number>
      </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>
