import { defineComponent as u, reactive as d, onMounted as m, createVNode as o, resolveComponent as t } from "vue";
import { ElForm as n, ElFormItem as i, ElInput as s, ElMessage as p } from "element-plus";
import { Loader as f, request as c } from "@/utils";
import { E as b } from "./index-BpkhRblb.js";
import { C as y } from "./index--eNVchKN.js";
const E = /* @__PURE__ */ u({
  name: "KlDataSourceDetails",
  components: {
    EditorMonacoEditor: b,
    ElForm: n,
    ElFormItem: i,
    ElInput: s
  },
  props: {
    id: {
      type: String,
      default: ""
    }
  },
  setup(r) {
    let a, e = d({});
    return (() => {
      a && a.start(), c.get(`${API_URL.getDsDetailsById}/${r.id}`).then((l) => {
        a && a.done(), l.code == 0 ? e = Object.assign(e, l.data || {}) : p.error(l.msg);
      });
    })(), m(() => {
      a = new f({
        type: "overlay",
        option: {
          target: document.querySelector(".dialog-component"),
          text: "",
          customClass: ""
        }
      }), a.done();
    }), () => o("div", {
      class: "dialog-component"
    }, [o("section", {
      class: "dialog-component__body"
    }, [o(t("el-form"), {
      model: e,
      "label-width": 100,
      style: "padding: 10px 10px 10px 0"
    }, {
      default: () => [o(t("el-form-item"), {
        label: "服务名称"
      }, {
        default: () => [o(t("el-input"), {
          modelValue: e.serveName,
          "onUpdate:modelValue": (l) => e.serveName = l,
          readonly: !0
        }, null)]
      }), o(t("el-form-item"), {
        label: "所属分类"
      }, {
        default: () => [o(t("el-input"), {
          modelValue: e.label,
          "onUpdate:modelValue": (l) => e.label = l,
          readonly: !0
        }, null)]
      }), o(t("el-form-item"), {
        label: "描述"
      }, {
        default: () => [o(t("el-input"), {
          modelValue: e.describe,
          "onUpdate:modelValue": (l) => e.describe = l,
          readonly: !0,
          type: "textarea"
        }, null)]
      }), o(t("el-form-item"), {
        label: "服务主机"
      }, {
        default: () => [o(t("el-input"), {
          modelValue: e.shostPort,
          "onUpdate:modelValue": (l) => e.shostPort = l,
          readonly: !0
        }, null)]
      }), o(t("el-form-item"), {
        label: "接口地址"
      }, {
        default: () => [o(t("el-input"), {
          modelValue: e.iurl,
          "onUpdate:modelValue": (l) => e.iurl = l,
          readonly: !0
        }, null)]
      }), o(t("el-form-item"), {
        label: "请求方式"
      }, {
        default: () => [o(t("el-input"), {
          modelValue: e.irequest,
          "onUpdate:modelValue": (l) => e.irequest = l,
          readonly: !0
        }, null)]
      }), o(t("el-form-item"), {
        label: "Headers"
      }, {
        default: () => [o(t("editor-monaco-editor"), {
          modelValue: e.headerParam,
          "onUpdate:modelValue": (l) => e.headerParam = l,
          height: "100px",
          style: "border: 1px solid var(--editor-border-color)"
        }, null)]
      }), o(t("el-form-item"), {
        label: "请求参数"
      }, {
        default: () => [o(t("editor-monaco-editor"), {
          modelValue: e.inputParam,
          "onUpdate:modelValue": (l) => e.inputParam = l,
          height: "100px",
          style: "border: 1px solid var(--editor-border-color)"
        }, null)]
      }), o(t("el-form-item"), {
        class: y["lh-normal"],
        label: "响应内容 Response"
      }, {
        default: () => [o(t("editor-monaco-editor"), {
          modelValue: e.outputParam,
          "onUpdate:modelValue": (l) => e.outputParam = l,
          height: "140px",
          style: "border: 1px solid var(--editor-border-color)"
        }, null)]
      })]
    })])]);
  }
});
export {
  E as default
};
