<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.listMarginTop"
          :min="0"
          size="small"
          placeholder="间隔距离"
        />
      </SettingItem>
      <SettingItem name="上方距离">
        <n-input-number
          v-model:value="optionData.dataStyle.marginTop"
          :min="0"
          size="small"
          placeholder="上方距离"
        />
      </SettingItem>
      <SettingItem name="左侧距离">
        <n-input-number
          v-model:value="optionData.dataStyle.marginLeft"
          :min="0"
          size="small"
          placeholder="左侧距离"
        />
      </SettingItem>
      <SettingItem name="单项高度">
        <n-input-number
          v-model:value="optionData.dataStyle.titleHeight"
          :min="0"
          size="small"
          placeholder="单项高度"
        />
      </SettingItem>
    </SettingItemBox>

    <SettingItemBox name="标题设置">
      <SettingItem name="标题点颜色">
        <n-color-picker
          size="small"
          :modes="['rgb']"
          v-model:value="optionData.dataStyle.dotColor"
        ></n-color-picker>
      </SettingItem>
      <SettingItem name="标题点大小">
        <n-input-number
          v-model:value="optionData.dataStyle.dotSize"
          :min="0"
          size="small"
          placeholder="标题点大小"
        />
      </SettingItem>
      <SettingItem name="标题点与标题之间的距离">
        <n-input-number
          v-model:value="optionData.dataStyle.dotMarginLeft"
          :min="0"
          size="small"
          placeholder="标题点与标题之间的距离"
        />
      </SettingItem>
      <SettingItem name="标题和文本之间的距离">
        <n-input-number
          v-model:value="optionData.dataStyle.dotMarginRight"
          :min="0"
          size="small"
          placeholder="标题和文本之间的距离"
        />
      </SettingItem>
      <SettingItem name="标题最小宽度">
        <n-input-number
          v-model:value="optionData.dataStyle.titleWidth"
          :min="0"
          size="small"
          placeholder="标题宽度"
        />
      </SettingItem>
      <SettingItem name="标题字体颜色">
        <n-color-picker
          size="small"
          :modes="['hex']"
          v-model:value="optionData.dataStyle.titleFontcolor"
        ></n-color-picker>
      </SettingItem>
      <SettingItem name="标题字体大小">
        <n-input-number v-model:value="optionData.dataStyle.titleFontsize" :min="0" size="small" />
      </SettingItem>
    </SettingItemBox>

    <SettingItemBox name="内容设置">
      <SettingItem name="内容宽度">
        <n-input-number
          v-model:value="optionData.dataStyle.contentWidth"
          :min="0"
          size="small"
          placeholder="内容宽度"
        />
      </SettingItem>
      <SettingItem name="内容字体颜色">
        <n-color-picker
          size="small"
          :modes="['hex']"
          v-model:value="optionData.dataStyle.contentFontcolor"
        ></n-color-picker>
      </SettingItem>
      <SettingItem name="内容字体大小">
        <n-input-number
          v-model:value="optionData.dataStyle.contentFontsize"
          :min="0"
          size="small"
        />
      </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>
