<template>
  <CollapseItem name="按钮设置" :expanded="true">
    <n-tag type="primary">若按钮内容配置无响应，请在预览页面查看效果</n-tag>
    <SettingItemBox :alone="true" name="按钮内容">
      <SettingItem name="按钮文字内容手动输入">
        <n-input v-model:value="optionData.dataset.value" type="text" size="small" />
      </SettingItem>
      <SettingItem name="按钮常用内容">
        <n-select v-model:value="optionData.dataset.value" :options="dataList" size="small" />
      </SettingItem>
    </SettingItemBox>
    <SettingItemBox name="样式设置">
      <SettingItem name="按钮常用颜色">
        <n-select v-model:value="optionData.dataStyle.color" :options="colorList" size="small" />
      </SettingItem>
      <SettingItem name="按钮字体大小">
        <n-input-number
          v-model:value="optionData.dataStyle.fontsize"
          type="text"
          :min="0"
          size="small"
        />
      </SettingItem>
      <SettingItem name="按钮字体颜色">
        <n-color-picker
          size="small"
          :modes="['hex']"
          v-model:value="optionData.dataStyle.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 dataList = [
    {
      value: '辅助决策',
      label: '辅助决策',
    },
    {
      value: '非火情',
      label: '非火情',
    },
    {
      value: '重复报警',
      label: '重复报警',
    },
  ];

  const colorList = [
    {
      value: 'red',
      label: '红色',
    },
    {
      value: 'green',
      label: '绿色',
    },
    {
      value: 'yellow',
      label: '黄色',
    },
  ];
</script>
