import "../../../../../../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
import { useDesignStore } from "../../../../../../../../../store/modules/designStore/designStore.mjs";
import SettingItem from "../../../../../../../../../components/Pages/ChartItemSetting/SettingItem.vue2.mjs";
import SettingItemBox from "../../../../../../../../../components/Pages/ChartItemSetting/SettingItemBox.vue.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 "../../../../../../../../../settings/designSetting.mjs";
import "../../../../../../../../../components/GoLoading/index.mjs";
import "../../../../../../../../../components/GoSkeleton/index.vue.mjs";
import { icon } from "../../../../../../../../../plugins/icon.mjs";
import "../../../../../../../../../store/modules/chartEditStore/chartEditStore.mjs";
import "../../../../../../../../../components/Pages/ChartItemSetting/StylesSetting.vue.mjs";
import { useTargetData } from "../../../../../hooks/useTargetData.hook.mjs";
import { selectTimeOptions } from "../../../../index.d.mjs";
import _sfc_main$1 from "../RequestGlobalHeaderTable/index.vue.mjs";
import { defineComponent, computed, resolveComponent, openBlock, createBlock, withCtx, createVNode, createTextVNode, withDirectives, createElementBlock } from "../../../../../../../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
import { useCssVars, vShow } from "../../../../../../../../../../node_modules/.pnpm/@vue_runtime-dom@3.3.4/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.mjs";
import { toRefs, ref, unref, isRef } from "../../../../../../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  setup(__props) {
    useCssVars((_ctx) => ({
      "17e515f4": themeColor.value
    }));
    const { PencilIcon, ChevronDownOutlineIcon, ChevronUpOutlineIcon } = icon.ionicons5;
    const { chartEditStore } = useTargetData();
    const { requestOriginUrl, requestInterval, requestIntervalUnit } = toRefs(chartEditStore.getRequestGlobalConfig);
    const editDisabled = ref(true);
    const designStore = useDesignStore();
    const showTable = ref(false);
    const themeColor = computed(() => {
      return designStore.getAppTheme;
    });
    return (_ctx, _cache) => {
      const _component_n_tag = resolveComponent("n-tag");
      const _component_n_input = resolveComponent("n-input");
      const _component_n_input_number = resolveComponent("n-input-number");
      const _component_n_select = resolveComponent("n-select");
      const _component_n_input_group = resolveComponent("n-input-group");
      const _component_n_icon = resolveComponent("n-icon");
      const _component_n_button = resolveComponent("n-button");
      const _component_n_collapse_transition = resolveComponent("n-collapse-transition");
      const _component_n_tooltip = resolveComponent("n-tooltip");
      const _component_n_card = resolveComponent("n-card");
      return openBlock(), createBlock(_component_n_card, { class: "n-card-shallow" }, {
        default: withCtx(() => [
          createVNode(_component_n_tag, {
            type: "info",
            bordered: false,
            style: { "border-radius": "5px" }
          }, {
            default: withCtx(() => [
              createTextVNode(" 全局公共配置 ")
            ]),
            _: 1
          }),
          createVNode(unref(SettingItemBox), {
            name: "服务",
            itemRightStyle: {
              gridTemplateColumns: "5fr 2fr 1fr"
            }
          }, {
            default: withCtx(() => [
              createVNode(unref(SettingItem), { name: "前置 URL" }, {
                default: withCtx(() => [
                  createVNode(_component_n_input, {
                    value: unref(requestOriginUrl),
                    "onUpdate:value": _cache[0] || (_cache[0] = ($event) => isRef(requestOriginUrl) ? requestOriginUrl.value = $event : null),
                    valueModifiers: { trim: true },
                    disabled: editDisabled.value,
                    placeholder: "例：http://127.0.0.1/"
                  }, null, 8, ["value", "disabled"])
                ]),
                _: 1
              }),
              createVNode(unref(SettingItem), { name: "更新间隔，为 0 只会初始化" }, {
                default: withCtx(() => [
                  createVNode(_component_n_input_group, null, {
                    default: withCtx(() => [
                      createVNode(_component_n_input_number, {
                        class: "select-time-number",
                        value: unref(requestInterval),
                        "onUpdate:value": _cache[1] || (_cache[1] = ($event) => isRef(requestInterval) ? requestInterval.value = $event : null),
                        valueModifiers: { trim: true },
                        min: "0",
                        "show-button": false,
                        disabled: editDisabled.value,
                        placeholder: "请输入数字"
                      }, null, 8, ["value", "disabled"]),
                      createVNode(_component_n_select, {
                        class: "select-time-options",
                        value: unref(requestIntervalUnit),
                        "onUpdate:value": _cache[2] || (_cache[2] = ($event) => isRef(requestIntervalUnit) ? requestIntervalUnit.value = $event : null),
                        options: unref(selectTimeOptions),
                        disabled: editDisabled.value
                      }, null, 8, ["value", "options", "disabled"])
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              }),
              withDirectives(createVNode(_component_n_button, {
                type: "primary",
                ghost: "",
                onClick: _cache[3] || (_cache[3] = ($event) => editDisabled.value = false)
              }, {
                icon: withCtx(() => [
                  createVNode(_component_n_icon, null, {
                    default: withCtx(() => [
                      createVNode(unref(PencilIcon))
                    ]),
                    _: 1
                  })
                ]),
                default: withCtx(() => [
                  createTextVNode(" 编辑配置 ")
                ]),
                _: 1
              }, 512), [
                [vShow, editDisabled.value]
              ])
            ]),
            _: 1
          }),
          createVNode(_component_n_collapse_transition, { show: showTable.value }, {
            default: withCtx(() => [
              createVNode(unref(_sfc_main$1), { editDisabled: editDisabled.value }, null, 8, ["editDisabled"])
            ]),
            _: 1
          }, 8, ["show"]),
          showTable.value ? (openBlock(), createElementBlock("div", {
            key: 0,
            class: "go-flex-center go-mt-3 down",
            onClick: _cache[4] || (_cache[4] = ($event) => showTable.value = false)
          }, [
            createVNode(_component_n_icon, { size: "32" }, {
              default: withCtx(() => [
                createVNode(unref(ChevronUpOutlineIcon))
              ]),
              _: 1
            })
          ])) : (openBlock(), createElementBlock("div", {
            key: 1,
            class: "go-flex-center go-mt-3 down",
            onClick: _cache[5] || (_cache[5] = ($event) => showTable.value = true)
          }, [
            createVNode(_component_n_tooltip, {
              trigger: "hover",
              placement: "top",
              "keep-alive-on-hover": false
            }, {
              trigger: withCtx(() => [
                createVNode(_component_n_icon, { size: "32" }, {
                  default: withCtx(() => [
                    createVNode(unref(ChevronDownOutlineIcon))
                  ]),
                  _: 1
                })
              ]),
              default: withCtx(() => [
                createTextVNode(" 展开 ")
              ]),
              _: 1
            })
          ]))
        ]),
        _: 1
      });
    };
  }
});
export {
  _sfc_main as default
};
