import "../../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
import "../../../../../../node_modules/.pnpm/vue3-lazyload@0.2.5-beta_a6dezdz3je235ci4e3tu4rayna/node_modules/vue3-lazyload/dist/vue3-lazyload.esm.mjs";
import "../../../../../../node_modules/.pnpm/screenfull@6.0.2/node_modules/screenfull/index.mjs";
import "../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.mjs";
import "../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.mjs";
import "../../../../../../node_modules/.pnpm/html2canvas@1.4.1/node_modules/html2canvas/dist/html2canvas.esm.mjs";
import "../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseClone.mjs";
import "../../../../../../node_modules/.pnpm/crypto-js@4.1.1/node_modules/crypto-js/index.mjs";
import "../../../../../enums/pageEnum.mjs";
import "../../../../../router/index.mjs";
import "../../../../../store/modules/designStore/designStore.mjs";
import "../../../../../settings/designSetting.mjs";
import "../../../../../components/GoLoading/index.mjs";
import "../../../../../components/GoSkeleton/index.vue.mjs";
import { icon } from "../../../../../plugins/icon.mjs";
import SettingItem from "../../../../../components/Pages/ChartItemSetting/SettingItem.vue2.mjs";
import SettingItemBox from "../../../../../components/Pages/ChartItemSetting/SettingItemBox.vue.mjs";
import _sfc_main$1 from "../../../../../components/Pages/ChartItemSetting/CollapseItem.vue.mjs";
import "../../../../../store/modules/chartEditStore/chartEditStore.mjs";
import "../../../../../components/Pages/ChartItemSetting/StylesSetting.vue.mjs";
import { ComponentInteractEventEnum, DefaultTypeEnum, DifferUnitEnum, DifferUnitObject } from "./interact.mjs";
import dayjs from "../../../../../../node_modules/.pnpm/dayjs@1.11.9/node_modules/dayjs/dayjs.min.mjs";
import { defineComponent, computed, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, createBlock, createCommentVNode, createTextVNode, Fragment, createElementVNode as createBaseVNode } from "../../../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
import { unref } from "../../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
import { toDisplayString } from "../../../../../../node_modules/.pnpm/@vue_shared@3.3.4/node_modules/@vue/shared/dist/shared.esm-bundler.mjs";
const _hoisted_1 = /* @__PURE__ */ createBaseVNode("span", null, "打开页面时浏览器操作系统的系统时间+偏移量(单位)", -1);
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "config",
  props: {
    optionData: {
      type: Object,
      required: true
    }
  },
  setup(__props) {
    const props = __props;
    const { HelpOutlineIcon } = icon.ionicons5;
    const panelOptions = [
      {
        label: "下拉展示",
        value: 0
      },
      {
        label: "面板展示",
        value: 1
      }
    ];
    const datePickerTypeOptions = [
      {
        label: "日期",
        value: ComponentInteractEventEnum.DATE
      },
      {
        label: "日期时间",
        value: ComponentInteractEventEnum.DATE_TIME
      },
      {
        label: "日期范围",
        value: ComponentInteractEventEnum.DATE_RANGE
      },
      {
        label: "月份",
        value: ComponentInteractEventEnum.MONTH
      },
      {
        label: "月份范围",
        value: ComponentInteractEventEnum.MONTH_RANGE
      },
      {
        label: "年份",
        value: ComponentInteractEventEnum.YEAR
      },
      {
        label: "年份范围",
        value: ComponentInteractEventEnum.YEAR_RANGE
      },
      {
        label: "季度",
        value: ComponentInteractEventEnum.QUARTER
      },
      {
        label: "季度范围",
        value: ComponentInteractEventEnum.QUARTER_RANGE
      }
    ];
    const defaultTypeOptions = [
      {
        label: "静态",
        value: DefaultTypeEnum.STATIC
      },
      {
        label: "动态",
        value: DefaultTypeEnum.DYNAMIC
      },
      {
        label: "无",
        value: DefaultTypeEnum.NONE
      }
    ];
    const differUnitOptions = [
      // ManipulateType
      {
        value: DifferUnitEnum.DAY,
        label: DifferUnitObject[DifferUnitEnum.DAY]
      },
      {
        value: DifferUnitEnum.WEEK,
        label: DifferUnitObject[DifferUnitEnum.WEEK]
      },
      {
        value: DifferUnitEnum.MONTH,
        label: DifferUnitObject[DifferUnitEnum.MONTH]
      },
      {
        value: DifferUnitEnum.QUARTER,
        label: DifferUnitObject[DifferUnitEnum.QUARTER]
      },
      {
        value: DifferUnitEnum.YEAR,
        label: DifferUnitObject[DifferUnitEnum.YEAR]
      },
      {
        value: DifferUnitEnum.HOUR,
        label: DifferUnitObject[DifferUnitEnum.HOUR]
      },
      {
        value: DifferUnitEnum.MINUTE,
        label: DifferUnitObject[DifferUnitEnum.MINUTE]
      },
      {
        value: DifferUnitEnum.SECOND,
        label: DifferUnitObject[DifferUnitEnum.SECOND]
      },
      {
        value: DifferUnitEnum.MILLISECOND,
        label: DifferUnitObject[DifferUnitEnum.MILLISECOND]
      }
    ];
    const isRange = computed(() => {
      return props.optionData.componentInteractEventKey.endsWith("range");
    });
    const differValueName = computed(() => {
      return isRange.value ? "开始值动态偏移量" : "动态偏移量";
    });
    const differUnitName = computed(() => {
      return isRange.value ? "开始值偏移单位" : "偏移单位";
    });
    const datePickerTypeUpdate = () => {
      props.optionData.dataset = isRange.value ? [dayjs().valueOf(), dayjs().valueOf()] : dayjs().valueOf();
    };
    const defaultTypeUpdate = (v) => {
      if (v === DefaultTypeEnum.STATIC) {
        datePickerTypeUpdate();
      } else {
        props.optionData.dataset = null;
      }
    };
    return (_ctx, _cache) => {
      const _component_n_select = resolveComponent("n-select");
      const _component_n_date_picker = resolveComponent("n-date-picker");
      const _component_n_text = resolveComponent("n-text");
      const _component_n_icon = resolveComponent("n-icon");
      const _component_n_tooltip = resolveComponent("n-tooltip");
      const _component_n_input_number = resolveComponent("n-input-number");
      return openBlock(), createElementBlock(Fragment, null, [
        createVNode(unref(_sfc_main$1), {
          name: "展示方式",
          expanded: true
        }, {
          default: withCtx(() => [
            createVNode(unref(SettingItemBox), { name: "选择方式" }, {
              default: withCtx(() => [
                createVNode(_component_n_select, {
                  value: __props.optionData.isPanel,
                  "onUpdate:value": _cache[0] || (_cache[0] = ($event) => __props.optionData.isPanel = $event),
                  size: "small",
                  options: panelOptions
                }, null, 8, ["value"])
              ]),
              _: 1
            })
          ]),
          _: 1
        }),
        createVNode(unref(_sfc_main$1), {
          name: "时间配置",
          expanded: true
        }, {
          default: withCtx(() => [
            createVNode(unref(SettingItemBox), { name: "基础" }, {
              default: withCtx(() => [
                createVNode(unref(SettingItem), { name: "类型" }, {
                  default: withCtx(() => [
                    createVNode(_component_n_select, {
                      value: __props.optionData.componentInteractEventKey,
                      "onUpdate:value": [
                        _cache[1] || (_cache[1] = ($event) => __props.optionData.componentInteractEventKey = $event),
                        datePickerTypeUpdate
                      ],
                      size: "small",
                      options: datePickerTypeOptions
                    }, null, 8, ["value"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }),
            createVNode(unref(SettingItemBox), { name: "默认值" }, {
              default: withCtx(() => [
                createVNode(unref(SettingItem), { name: "类型" }, {
                  default: withCtx(() => [
                    createVNode(_component_n_select, {
                      value: __props.optionData.defaultType,
                      "onUpdate:value": [
                        _cache[2] || (_cache[2] = ($event) => __props.optionData.defaultType = $event),
                        defaultTypeUpdate
                      ],
                      size: "small",
                      options: defaultTypeOptions
                    }, null, 8, ["value"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }),
            __props.optionData.defaultType === unref(DefaultTypeEnum).STATIC ? (openBlock(), createBlock(unref(SettingItemBox), {
              key: 0,
              alone: true
            }, {
              default: withCtx(() => [
                createVNode(unref(SettingItem), { name: "静态默认值" }, {
                  default: withCtx(() => [
                    createVNode(_component_n_date_picker, {
                      size: "small",
                      clearable: "",
                      value: __props.optionData.dataset,
                      "onUpdate:value": _cache[3] || (_cache[3] = ($event) => __props.optionData.dataset = $event),
                      type: __props.optionData.componentInteractEventKey
                    }, null, 8, ["value", "type"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })) : createCommentVNode("", true),
            __props.optionData.defaultType === unref(DefaultTypeEnum).DYNAMIC ? (openBlock(), createBlock(unref(SettingItemBox), { key: 1 }, {
              name: withCtx(() => [
                createVNode(_component_n_text),
                createVNode(_component_n_tooltip, { trigger: "hover" }, {
                  trigger: withCtx(() => [
                    createVNode(_component_n_icon, {
                      size: "21",
                      depth: 3
                    }, {
                      default: withCtx(() => [
                        createVNode(unref(HelpOutlineIcon))
                      ]),
                      _: 1
                    })
                  ]),
                  default: withCtx(() => [
                    _hoisted_1
                  ]),
                  _: 1
                })
              ]),
              default: withCtx(() => [
                createVNode(unref(SettingItem), { name: differValueName.value }, {
                  default: withCtx(() => [
                    createVNode(_component_n_input_number, {
                      value: __props.optionData.differValue[0],
                      "onUpdate:value": _cache[4] || (_cache[4] = ($event) => __props.optionData.differValue[0] = $event),
                      class: "input-num-width",
                      size: "small"
                    }, {
                      suffix: withCtx(() => [
                        createTextVNode(toDisplayString(unref(DifferUnitObject)[__props.optionData.differUnit[0]]), 1)
                      ]),
                      _: 1
                    }, 8, ["value"])
                  ]),
                  _: 1
                }, 8, ["name"]),
                createVNode(unref(SettingItem), { name: differUnitName.value }, {
                  default: withCtx(() => [
                    createVNode(_component_n_select, {
                      value: __props.optionData.differUnit[0],
                      "onUpdate:value": _cache[5] || (_cache[5] = ($event) => __props.optionData.differUnit[0] = $event),
                      size: "small",
                      options: differUnitOptions
                    }, null, 8, ["value"])
                  ]),
                  _: 1
                }, 8, ["name"]),
                isRange.value ? (openBlock(), createBlock(unref(SettingItem), {
                  key: 0,
                  name: "结束值动态偏移量"
                }, {
                  default: withCtx(() => [
                    createVNode(_component_n_input_number, {
                      value: __props.optionData.differValue[1],
                      "onUpdate:value": _cache[6] || (_cache[6] = ($event) => __props.optionData.differValue[1] = $event),
                      class: "input-num-width",
                      size: "small"
                    }, {
                      suffix: withCtx(() => [
                        createTextVNode(toDisplayString(unref(DifferUnitObject)[__props.optionData.differUnit[1]]), 1)
                      ]),
                      _: 1
                    }, 8, ["value"])
                  ]),
                  _: 1
                })) : createCommentVNode("", true),
                isRange.value ? (openBlock(), createBlock(unref(SettingItem), {
                  key: 1,
                  name: "结束值偏移单位"
                }, {
                  default: withCtx(() => [
                    createVNode(_component_n_select, {
                      value: __props.optionData.differUnit[1],
                      "onUpdate:value": _cache[7] || (_cache[7] = ($event) => __props.optionData.differUnit[1] = $event),
                      size: "small",
                      options: differUnitOptions
                    }, null, 8, ["value"])
                  ]),
                  _: 1
                })) : createCommentVNode("", true)
              ]),
              _: 1
            })) : createCommentVNode("", true)
          ]),
          _: 1
        })
      ], 64);
    };
  }
});
export {
  _sfc_main as default
};
