<template>
  <CollapseItem name="数据设置" :expanded="true">
    <SettingItem :alone="false" name="监控画面默认展示">
      <n-radio-group v-model:value="optionData.dataStyle.nowType" name="radiogroup">
        <n-radio value="1"> 监控画面X1 </n-radio>
        <n-radio value="4"> 监控画面X4 </n-radio>
        <n-radio value="9"> 监控画面X9 </n-radio>
      </n-radio-group>
    </SettingItem>

    <SettingItemBox :alone="false" name="视频样式设置">
      <SettingItem name="视频关闭按钮颜色">
        <n-color-picker
          size="small"
          :modes="['hex']"
          v-model:value="optionData.dataStyle.closeVideoIconColor"
        ></n-color-picker>
      </SettingItem>
      <SettingItem name="视频关闭按钮大小">
        <n-input-number
          v-model:value="optionData.dataStyle.closeVideoIconWidthAndHeight"
          :min="0"
          size="small"
          placeholder="视频关闭按钮大小"
        ></n-input-number>
      </SettingItem>
      <SettingItem name="视频标题字体颜色">
        <n-color-picker
          size="small"
          :modes="['hex']"
          v-model:value="optionData.dataStyle.videoTitleFontColor"
        ></n-color-picker>
      </SettingItem>
      <SettingItem name="视频标题字体大小">
        <n-input-number
          v-model:value="optionData.dataStyle.videoTitleFontSize"
          :min="0"
          size="small"
          placeholder="视频标题字体大小"
        ></n-input-number>
      </SettingItem>
    </SettingItemBox>

    <SettingItemBox :alone="false" 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>
  </CollapseItem>

  <CollapseItem name="整体设置" :expanded="true">
    <SettingItemBox :alone="false" name="弹窗标题栏设置">
      <SettingItem name="弹窗标题字体颜色">
        <n-color-picker
          size="small"
          :modes="['hex']"
          v-model:value="optionData.dataStyle.generalTitleFontColor"
        ></n-color-picker>
      </SettingItem>
      <SettingItem name="弹窗标题阴影颜色">
        <n-color-picker
          size="small"
          :modes="['hex']"
          v-model:value="optionData.dataStyle.generalTitleFontShadow"
        ></n-color-picker>
      </SettingItem>
      <SettingItem name="弹窗标题字体大小">
        <n-input-number
          v-model:value="optionData.dataStyle.generalTitleFontSize"
          :min="0"
          size="small"
          placeholder="弹窗标题字体大小"
        ></n-input-number>
      </SettingItem>
      <SettingItem></SettingItem>

      <SettingItem name="弹窗切换按钮字体颜色">
        <n-color-picker
          size="small"
          :modes="['hex']"
          v-model:value="optionData.dataStyle.typeButtonFontColor"
        ></n-color-picker>
      </SettingItem>
      <SettingItem name="弹窗切换按钮字体大小">
        <n-input-number
          v-model:value="optionData.dataStyle.typeButtonFontSize"
          :min="0"
          size="small"
          placeholder="弹窗切换按钮字体大小"
        ></n-input-number>
      </SettingItem>
      <SettingItem name="弹窗切换按钮大小">
        <n-input-number
          v-model:value="optionData.dataStyle.typeButtonWidth"
          :min="0"
          size="small"
          placeholder="弹窗切换按钮大小"
        ></n-input-number>
      </SettingItem>
      <SettingItem></SettingItem>

      <SettingItem name="弹窗关闭按钮大小">
        <n-input-number
          v-model:value="optionData.dataStyle.closeButtonWidth"
          :min="0"
          size="small"
          placeholder="弹窗关闭按钮大小"
        ></n-input-number>
      </SettingItem>
    </SettingItemBox>

    <SettingItemBox :alone="false" name="展示主体整体设置">
      <SettingItem name="标题栏与展示主体之间的距离">
        <n-input-number
          v-model:value="optionData.dataStyle.mainBodyMarginTop"
          :min="0"
          size="small"
          placeholder="标题栏与展示主体之间的距离"
        ></n-input-number>
      </SettingItem>
      <SettingItem name="展示主体左侧间隔距离">
        <n-input-number
          v-model:value="optionData.dataStyle.mainLeftMarginLeft1"
          :min="0"
          size="small"
          placeholder="展示主体左侧间隔距离"
        ></n-input-number>
      </SettingItem>
      <SettingItem name="展示主体之间的间隔距离">
        <n-input-number
          v-model:value="optionData.dataStyle.mainLeftMarginLeft2"
          :min="0"
          size="small"
          placeholder="展示主体之间的间隔距离"
        ></n-input-number>
      </SettingItem>
      <SettingItem name="展示主体右侧间隔距离">
        <n-input-number
          v-model:value="optionData.dataStyle.mainLeftMarginLeft3"
          :min="0"
          size="small"
          placeholder="展示主体右侧间隔距离"
        ></n-input-number>
      </SettingItem>
    </SettingItemBox>
  </CollapseItem>

  <CollapseItem name="左侧列表设置" :expanded="true">
    <SettingItemBox :alone="false" name="左侧列表设置1">
      <SettingItem name="左侧图案大小">
        <n-input-number
          v-model:value="optionData.dataStyle.leftTitleIcon1_WidthAndHeight"
          :min="0"
          size="small"
          placeholder="左侧图案大小"
        ></n-input-number>
      </SettingItem>
      <SettingItem></SettingItem>

      <SettingItem name="标题字体颜色">
        <n-color-picker
          size="small"
          :modes="['hex']"
          v-model:value="optionData.dataStyle.leftTitle_FontColor"
        ></n-color-picker>
      </SettingItem>
      <SettingItem name="标题阴影颜色">
        <n-color-picker
          size="small"
          :modes="['hex']"
          v-model:value="optionData.dataStyle.leftTitle_FontShadow"
        ></n-color-picker>
      </SettingItem>
      <SettingItem name="标题字体大小">
        <n-input-number
          v-model:value="optionData.dataStyle.leftTitle_FontSize"
          :min="0"
          size="small"
          placeholder="标题字体大小"
        ></n-input-number>
      </SettingItem>
      <SettingItem></SettingItem>

      <SettingItem name="右侧图案大小">
        <n-input-number
          v-model:value="optionData.dataStyle.leftTitleIcon2_Width"
          :min="0"
          size="small"
          placeholder="右侧图案大小"
        ></n-input-number>
      </SettingItem>
      <SettingItem></SettingItem>

      <SettingItem name="查询上边间隔距离">
        <n-input-number
          v-model:value="optionData.dataStyle.leftSearchMarginTop"
          :min="0"
          size="small"
          placeholder="查询上边间隔距离"
        ></n-input-number>
      </SettingItem>
      <SettingItem name="查询左侧间隔距离">
        <n-input-number
          v-model:value="optionData.dataStyle.leftSearchMarginLeft"
          :min="0"
          size="small"
          placeholder="查询左侧间隔距离"
        ></n-input-number>
      </SettingItem>
    </SettingItemBox>
    <SettingItemBox :alone="false" name="左侧列表设置2">
      <SettingItem name="列表上边间隔距离">
        <n-input-number
          v-model:value="optionData.dataStyle.leftListMarginTop"
          :min="0"
          size="small"
          placeholder="列表上边间隔距离"
        ></n-input-number>
      </SettingItem>
      <SettingItem name="列表左侧间隔距离">
        <n-input-number
          v-model:value="optionData.dataStyle.leftListMarginLeft"
          :min="0"
          size="small"
          placeholder="列表左侧间隔距离"
        ></n-input-number>
      </SettingItem>

      <SettingItem name="列表整体高度">
        <n-input-number
          v-model:value="optionData.dataStyle.leftListHeight"
          :min="0"
          size="small"
          placeholder="列表整体高度"
        ></n-input-number>
      </SettingItem>
      <SettingItem name="列表个体高度">
        <n-input-number
          v-model:value="optionData.dataStyle.leftListAloneHeight"
          :min="0"
          size="small"
          placeholder="列表个体高度"
        ></n-input-number>
      </SettingItem>

      <SettingItem name="列表整体宽度">
        <n-input-number
          v-model:value="optionData.dataStyle.leftListWidth"
          :min="0"
          size="small"
          placeholder="列表整体宽度"
        ></n-input-number>
      </SettingItem>
      <SettingItem name="列表个体图案宽度">
        <n-input-number
          v-model:value="optionData.dataStyle.leftListWidth_Icon"
          :min="0"
          size="small"
          placeholder="列表个体图案宽度"
        ></n-input-number>
      </SettingItem>
      <SettingItem name="列表个体文本宽度">
        <n-input-number
          v-model:value="optionData.dataStyle.leftListWidth_Title"
          :min="0"
          size="small"
          placeholder="列表个体文本宽度"
        ></n-input-number>
      </SettingItem>

      <SettingItem name="列表个体图案大小">
        <n-input-number
          v-model:value="optionData.dataStyle.leftDivVideoListIconWidth"
          :min="0"
          size="small"
          placeholder="列表个体文本大小"
        ></n-input-number>
      </SettingItem>
      <SettingItem name="列表个体文本背景颜色">
        <n-color-picker
          size="small"
          :modes="['hex']"
          v-model:value="optionData.dataStyle.leftListFontBackgroud"
        ></n-color-picker>
      </SettingItem>
      <SettingItem name="列表个体文本颜色">
        <n-color-picker
          size="small"
          :modes="['hex']"
          v-model:value="optionData.dataStyle.leftListFontColor"
        ></n-color-picker>
      </SettingItem>
      <SettingItem name="列表个体文本大小">
        <n-input-number
          v-model:value="optionData.dataStyle.leftListFontSize"
          :min="0"
          size="small"
          placeholder="列表个体文本大小"
        ></n-input-number>
      </SettingItem>
    </SettingItemBox>
  </CollapseItem>
</template>

<script setup lang="ts">
  import { PropType, watch, ref, reactive } 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>
