<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>
    </SettingItemBox>

    <SettingItemBox name="视频设置">
      <SettingItem>
        <n-checkbox v-model:checked="optionData.dataStyle.videoLoop" size="small">
          循环播放
        </n-checkbox>
      </SettingItem>
      <SettingItem>
        <n-checkbox v-model:checked="optionData.dataStyle.videoMuted" size="small">
          静音
        </n-checkbox>
      </SettingItem>
      <SettingItem name="视频类型">
        <n-select v-model:value="optionData.dataStyle.videoFit" size="small" :options="fitList" />
      </SettingItem>
    </SettingItemBox>

    <SettingItemBox name="边框设置">
      <SettingItem name="边框颜色">
        <n-color-picker
          size="small"
          :modes="['hex']"
          v-model:value="optionData.dataStyle.borderColor"
        ></n-color-picker>
      </SettingItem>
      <SettingItem name="边框宽度">
        <n-input-number
          v-model:value="optionData.dataStyle.borderWidth"
          size="small"
          :min="0"
        ></n-input-number>
      </SettingItem>
      <SettingItem name="边框距离">
        <n-input-number
          v-model:value="optionData.dataStyle.padding"
          size="small"
          :min="0"
        ></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,
    },
  });

  // 适应类型
  const fitList = [
    {
      value: 'fill',
      label: 'fill',
    },
    {
      value: 'contain',
      label: 'contain',
    },
    {
      value: 'cover',
      label: 'cover',
    },
    {
      value: 'scale-down',
      label: 'scale-down',
    },
    {
      value: 'none',
      label: 'none',
    },
  ];
</script>
