"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
require("../../../../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.js");
const httpEnum = require("../../../../../../../enums/httpEnum.js");
const index = require("./components/RequestGlobalConfig/index.vue2.js");
const index$1 = require("./components/RequestTargetConfig/index.vue2.js");
const runtimeCore_esmBundler = require("../../../../../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js");
const reactivity_esmBundler = require("../../../../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js");
const shared_esmBundler = require("../../../../../../../../node_modules/.pnpm/@vue_shared@3.3.4/node_modules/@vue/shared/dist/shared.esm-bundler.js");
const _hoisted_1 = { class: "go-pr-3" };
const _sfc_main = /* @__PURE__ */ runtimeCore_esmBundler.defineComponent({
  __name: "index",
  props: {
    modelShow: Boolean,
    targetData: Object,
    saveBtnText: String || null
  },
  emits: ["update:modelShow", "sendHandle"],
  setup(__props, { emit }) {
    const props = __props;
    const { chartConfig } = reactivity_esmBundler.toRefs(props.targetData);
    const { requestContentType } = reactivity_esmBundler.toRefs(props.targetData.request);
    const modelShowRef = reactivity_esmBundler.ref(false);
    const requestContentTypeObj = {
      [httpEnum.RequestContentTypeEnum.DEFAULT]: "普通请求",
      [httpEnum.RequestContentTypeEnum.SQL]: "SQL 请求"
    };
    runtimeCore_esmBundler.watch(
      () => props.modelShow,
      (newValue) => {
        modelShowRef.value = newValue;
      },
      {
        immediate: true
      }
    );
    const closeAndSendHandle = () => {
      emit("update:modelShow", false);
      emit("sendHandle");
    };
    return (_ctx, _cache) => {
      const _component_n_space = runtimeCore_esmBundler.resolveComponent("n-space");
      const _component_n_scrollbar = runtimeCore_esmBundler.resolveComponent("n-scrollbar");
      const _component_n_text = runtimeCore_esmBundler.resolveComponent("n-text");
      const _component_n_tag = runtimeCore_esmBundler.resolveComponent("n-tag");
      const _component_n_button = runtimeCore_esmBundler.resolveComponent("n-button");
      const _component_n_card = runtimeCore_esmBundler.resolveComponent("n-card");
      const _component_n_modal = runtimeCore_esmBundler.resolveComponent("n-modal");
      return runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createBlock(_component_n_modal, {
        class: "go-chart-data-request",
        show: modelShowRef.value,
        "onUpdate:show": _cache[0] || (_cache[0] = ($event) => modelShowRef.value = $event),
        "mask-closable": false,
        closeOnEsc: false
      }, {
        default: runtimeCore_esmBundler.withCtx(() => [
          runtimeCore_esmBundler.createVNode(_component_n_card, {
            bordered: false,
            role: "dialog",
            size: "small",
            "aria-modal": "true",
            style: { "width": "1000px", "height": "800px" }
          }, {
            header: runtimeCore_esmBundler.withCtx(() => []),
            "header-extra": runtimeCore_esmBundler.withCtx(() => []),
            action: runtimeCore_esmBundler.withCtx(() => [
              runtimeCore_esmBundler.createVNode(_component_n_space, { justify: "space-between" }, {
                default: runtimeCore_esmBundler.withCtx(() => [
                  runtimeCore_esmBundler.createElementVNode("div", null, [
                    runtimeCore_esmBundler.createVNode(_component_n_text, null, {
                      default: runtimeCore_esmBundler.withCtx(() => [
                        runtimeCore_esmBundler.createTextVNode("「 " + shared_esmBundler.toDisplayString(reactivity_esmBundler.unref(chartConfig).categoryName) + " 」", 1)
                      ]),
                      _: 1
                    }),
                    runtimeCore_esmBundler.createVNode(_component_n_text, null, {
                      default: runtimeCore_esmBundler.withCtx(() => [
                        runtimeCore_esmBundler.createTextVNode("—— ")
                      ]),
                      _: 1
                    }),
                    runtimeCore_esmBundler.createVNode(_component_n_tag, {
                      type: "primary",
                      bordered: false,
                      style: { "border-radius": "5px" }
                    }, {
                      default: runtimeCore_esmBundler.withCtx(() => [
                        runtimeCore_esmBundler.createTextVNode(shared_esmBundler.toDisplayString(requestContentTypeObj[reactivity_esmBundler.unref(requestContentType)]), 1)
                      ]),
                      _: 1
                    })
                  ]),
                  runtimeCore_esmBundler.createVNode(_component_n_button, {
                    type: "primary",
                    onClick: closeAndSendHandle
                  }, {
                    default: runtimeCore_esmBundler.withCtx(() => [
                      runtimeCore_esmBundler.createTextVNode(shared_esmBundler.toDisplayString(__props.saveBtnText || "保存 & 发送请求"), 1)
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              })
            ]),
            default: runtimeCore_esmBundler.withCtx(() => [
              runtimeCore_esmBundler.createVNode(_component_n_scrollbar, { style: { "max-height": "718px" } }, {
                default: runtimeCore_esmBundler.withCtx(() => [
                  runtimeCore_esmBundler.createElementVNode("div", _hoisted_1, [
                    runtimeCore_esmBundler.createVNode(_component_n_space, { vertical: "" }, {
                      default: runtimeCore_esmBundler.withCtx(() => {
                        var _a;
                        return [
                          runtimeCore_esmBundler.createVNode(reactivity_esmBundler.unref(index.default)),
                          runtimeCore_esmBundler.createVNode(reactivity_esmBundler.unref(index$1.default), {
                            "target-data-request": (_a = __props.targetData) == null ? void 0 : _a.request
                          }, null, 8, ["target-data-request"])
                        ];
                      }),
                      _: 1
                    })
                  ])
                ]),
                _: 1
              })
            ]),
            _: 1
          })
        ]),
        _: 1
      }, 8, ["show"]);
    };
  }
});
exports.default = _sfc_main;
