<template>
  <CollapseItem name="按钮设置" :expanded="true">
    <SettingItemBox :alone="true" name="按钮内容">
      <SettingItem :alone="true">
        <n-input v-model:value="optionData.buttonName" type="text" size="small" />
      </SettingItem>
    </SettingItemBox>
    <SettingItemBox name="内容设置">
      <!-- <SettingItem name="按钮颜色">
        <n-color-picker
          size="small"
          :modes="['hex']"
          v-model:value="optionData.buttonStyle.color"
        ></n-color-picker>
      </SettingItem> -->
      <SettingItem name="按钮常用颜色">
        <n-select v-model:value="optionData.buttonStyle.color" :options="colorList" size="small" />
      </SettingItem>
      <SettingItem name="按钮字体大小">
        <n-input-number
          v-model:value="optionData.buttonStyle.fontsize"
          type="text"
          :min="0"
          size="small"
        />
      </SettingItem>
      <SettingItem name="按钮字体颜色">
        <n-color-picker
          size="small"
          :modes="['hex']"
          v-model:value="optionData.buttonStyle.fontcolor"
        ></n-color-picker>
      </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 colorList = [
    {
      value: 'red',
      label: '红色',
    },
    {
      value: 'green',
      label: '绿色',
    },
    {
      value: 'yellow',
      label: '黄色',
    },
  ];
</script>
