import "../../../../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
import RequestGlobalConfig from "./components/RequestGlobalConfig/index.vue2.mjs";
import RequestTargetConfig from "./components/RequestTargetConfig/index.vue2.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 { goDialog } from "../../../../../../../utils/plugin.mjs";
import "../../../../../../../components/GoLoading/index.mjs";
import { defineComponent, watch, resolveComponent, openBlock, createBlock, withCtx, createVNode, createTextVNode, createElementBlock, 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 { ref, unref } from "../../../../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
const _hoisted_1 = { class: "go-pr-3" };
const _hoisted_2 = { key: 1 };
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "pondIndex",
  props: {
    modelShow: Boolean,
    targetDataRequest: Object
  },
  emits: ["update:modelShow", "editSaveHandle"],
  setup(__props, { emit }) {
    const props = __props;
    ref();
    const inputInstRef = ref();
    const modelShowRef = ref(false);
    watch(() => props.modelShow, (newValue) => {
      modelShowRef.value = newValue;
    });
    const closeHandle = () => {
      emit("update:modelShow", false);
    };
    const closeAndSendHandle = () => {
      var _a, _b;
      if (!((_a = props.targetDataRequest) == null ? void 0 : _a.dataPondName)) {
        window.$message.warning("请在左下角输入名称！");
        (_b = inputInstRef.value) == null ? void 0 : _b.focus();
        return;
      }
      goDialog({
        message: "保存内容将同步修改所有使用此接口的组件, 是否继续?",
        isMaskClosable: true,
        transformOrigin: "center",
        onPositiveCallback: () => {
          emit("update:modelShow", false);
          emit("editSaveHandle", props.targetDataRequest);
        }
      });
    };
    return (_ctx, _cache) => {
      const _component_n_space = resolveComponent("n-space");
      const _component_n_scrollbar = resolveComponent("n-scrollbar");
      const _component_n_tag = resolveComponent("n-tag");
      const _component_n_input = resolveComponent("n-input");
      const _component_n_button = resolveComponent("n-button");
      const _component_n_card = resolveComponent("n-card");
      const _component_n_modal = resolveComponent("n-modal");
      return openBlock(), createBlock(_component_n_modal, {
        class: "go-chart-data-request",
        show: modelShowRef.value,
        "onUpdate:show": _cache[1] || (_cache[1] = ($event) => modelShowRef.value = $event),
        "mask-closable": false,
        closeOnEsc: false
      }, {
        default: withCtx(() => [
          createVNode(_component_n_card, {
            bordered: false,
            role: "dialog",
            size: "small",
            "aria-modal": "true",
            style: { "width": "1000px", "height": "800px" }
          }, {
            header: withCtx(() => []),
            "header-extra": withCtx(() => []),
            action: withCtx(() => [
              createVNode(_component_n_space, { justify: "space-between" }, {
                default: withCtx(() => [
                  __props.targetDataRequest ? (openBlock(), createBlock(_component_n_space, { key: 0 }, {
                    default: withCtx(() => [
                      createVNode(_component_n_tag, {
                        bordered: false,
                        type: "primary"
                      }, {
                        default: withCtx(() => [
                          createTextVNode("名称：")
                        ]),
                        _: 1
                      }),
                      createVNode(_component_n_input, {
                        value: __props.targetDataRequest.dataPondName,
                        "onUpdate:value": _cache[0] || (_cache[0] = ($event) => __props.targetDataRequest.dataPondName = $event),
                        ref_key: "inputInstRef",
                        ref: inputInstRef,
                        type: "text",
                        size: "small",
                        autofocus: true,
                        clearable: true,
                        minlength: 1,
                        maxlength: 16,
                        placeholder: "请输入名称"
                      }, null, 8, ["value"])
                    ]),
                    _: 1
                  })) : (openBlock(), createElementBlock("span", _hoisted_2)),
                  createVNode(_component_n_space, null, {
                    default: withCtx(() => [
                      createVNode(_component_n_button, { onClick: closeHandle }, {
                        default: withCtx(() => [
                          createTextVNode("取消")
                        ]),
                        _: 1
                      }),
                      createVNode(_component_n_button, {
                        type: "primary",
                        onClick: closeAndSendHandle
                      }, {
                        default: withCtx(() => [
                          createTextVNode("保存")
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              })
            ]),
            default: withCtx(() => [
              createVNode(_component_n_scrollbar, { style: { "max-height": "718px" } }, {
                default: withCtx(() => [
                  createBaseVNode("div", _hoisted_1, [
                    createVNode(_component_n_space, { vertical: "" }, {
                      default: withCtx(() => {
                        var _a;
                        return [
                          createVNode(unref(RequestGlobalConfig)),
                          createVNode(unref(RequestTargetConfig), {
                            "target-data-request": (_a = __props.targetDataRequest) == null ? void 0 : _a.dataPondRequestConfig
                          }, null, 8, ["target-data-request"])
                        ];
                      }),
                      _: 1
                    })
                  ])
                ]),
                _: 1
              })
            ]),
            _: 1
          })
        ]),
        _: 1
      }, 8, ["show"]);
    };
  }
});
export {
  _sfc_main as default
};
