<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.marginTop"
          :min="0"
          size="small"
          placeholder="上方距离"
        />
      </SettingItem>
      <SettingItem name="左右距离">
        <n-input-number
          v-model:value="optionData.dataStyle.marginLeft"
          :min="0"
          size="small"
          placeholder="左右距离"
        />
      </SettingItem>
    </SettingItemBox>
    <SettingItemBox name="样式设置">
      <SettingItem name="图片宽度">
        <n-input-number
          v-model:value="optionData.dataStyle.imageWidth"
          :min="0"
          size="small"
          placeholder="图片宽度"
        />
      </SettingItem>
      <SettingItem name="图片高度">
        <n-input-number
          v-model:value="optionData.dataStyle.imageHeight"
          :min="0"
          size="small"
          placeholder="图片高度"
        />
      </SettingItem>

      <!-- 小程序 -->
      <SettingItem name="小程序数字字体大小">
        <n-color-picker
          size="small"
          :modes="['rgb']"
          v-model:value="optionData.dataStyle.xcxNumberFontColor"
        ></n-color-picker>
      </SettingItem>
      <SettingItem name="小程序数字字体大小">
        <n-input-number
          v-model:value="optionData.dataStyle.xcxNumberFontSize"
          :min="0"
          size="small"
          placeholder="小程序数字字体大小"
        />
      </SettingItem>
      <SettingItem name="小程序标题字体颜色">
        <n-color-picker
          size="small"
          :modes="['rgb']"
          v-model:value="optionData.dataStyle.xcxTitleFontColor"
        ></n-color-picker>
      </SettingItem>
      <SettingItem name="小程序标题字体大小">
        <n-input-number
          v-model:value="optionData.dataStyle.xcxTitleFontSize"
          :min="0"
          size="small"
          placeholder="小程序标题字体大小"
        />
      </SettingItem>

      <SettingItem name="APP数字字体颜色">
        <n-color-picker
          size="small"
          :modes="['rgb']"
          v-model:value="optionData.dataStyle.appNumberFontColor"
        ></n-color-picker>
      </SettingItem>
      <SettingItem name="APP数字字体颜色">
        <n-input-number
          v-model:value="optionData.dataStyle.appNumberFontSize"
          :min="0"
          size="small"
          placeholder="APP数字字体颜色"
        />
      </SettingItem>
      <SettingItem name="APP标题字体颜色">
        <n-color-picker
          size="small"
          :modes="['rgb']"
          v-model:value="optionData.dataStyle.appTitleFontColor"
        ></n-color-picker>
      </SettingItem>
      <SettingItem name="APP标题字体大小">
        <n-input-number
          v-model:value="optionData.dataStyle.appTitleFontSize"
          :min="0"
          size="small"
          placeholder="APP标题字体大小"
        />
      </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>
