china-mobile-international-custom-components 0.0.54 → 0.0.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,192 @@
1
+ import { w as x } from "./chunks/index.bCzIhWFw.js";
2
+ import { mergeModels as C, useModel as D, ref as w, watch as P, resolveComponent as d, createElementBlock as O, openBlock as i, createVNode as n, createBlock as M, createCommentVNode as T, unref as l, createElementVNode as _, createTextVNode as f, toDisplayString as V, withCtx as h, normalizeClass as y, withDirectives as I, vShow as U } from "vue";
3
+ import { RadioGroup as c } from "./RadioGroup.mjs";
4
+ import { u as R } from "./chunks/i18n.Bd7hh14j.js";
5
+ import { _ as q } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
6
+ import './assets/AuthSection.css';const z = { class: "auth-section" }, F = {
7
+ key: 2,
8
+ class: "auth-input-field"
9
+ }, G = { class: "field-label" }, Q = {
10
+ key: 3,
11
+ class: "auth-input-field"
12
+ }, j = { class: "field-label" }, J = {
13
+ __name: "AuthSection",
14
+ props: /* @__PURE__ */ C({
15
+ layout: {
16
+ type: String,
17
+ default: "horizontal"
18
+ }
19
+ }, {
20
+ featData: {
21
+ default: () => ({
22
+ auth: {}
23
+ })
24
+ },
25
+ featDataModifiers: {}
26
+ }),
27
+ emits: /* @__PURE__ */ C(["auth-validation-errors", "resetDebugStatus"], ["update:featData"]),
28
+ setup(s, { expose: k, emit: S }) {
29
+ const { t: a } = R(), e = D(s, "featData"), v = S, p = () => {
30
+ v("resetDebugStatus");
31
+ }, B = [
32
+ { value: "none", label: a("COMMON_AUTHSECTION.LABEL_NO_AUTH") },
33
+ { value: "apiKey", label: a("COMMON_AUTHSECTION.LABEL_API_KEY") }
34
+ ], H = [
35
+ { value: "bearer", label: a("COMMON_AUTHSECTION.LABEL_BEARER") },
36
+ { value: "custom", label: a("COMMON_AUTHSECTION.LABEL_CUSTOM") }
37
+ ], K = [
38
+ { value: "header", label: a("COMMON_AUTHSECTION.LABEL_KEY_LOCATION_HEADER") },
39
+ { value: "query", label: a("COMMON_AUTHSECTION.LABEL_KEY_LOCATION_QUERY") }
40
+ ], b = (r) => {
41
+ p(), u.value = {}, r === "apiKey" ? e.value.auth = {
42
+ authType: "apiKey",
43
+ keyType: "custom",
44
+ paramLocation: "header",
45
+ paramName: "",
46
+ paramValue: "",
47
+ token: ""
48
+ } : e.value.auth = {
49
+ authType: "none"
50
+ };
51
+ }, g = (r) => {
52
+ p(), u.value = {}, r === "bearer" ? (e.value.auth.paramName = "", e.value.auth.paramValue = "") : r === "custom" && (e.value.auth.token = "");
53
+ }, Y = (r) => {
54
+ console.log(r, "value"), p(), u.value = {}, r === "query" && (e.value.auth.token = "", e.value.auth.keyType = "custom");
55
+ }, u = w({}), m = () => (p(), u.value = {}, e.value.auth.authType === "apiKey" && (e.value.auth.keyType === "custom" && (e.value.auth.paramName || (u.value.paramName = !0)), e.value.auth.keyType === "custom" && (e.value.auth.paramValue || (u.value.paramValue = !0)), e.value.auth.keyType === "bearer" && (e.value.auth.token || (u.value.token = !0))), u.value);
56
+ return P(
57
+ () => u.value,
58
+ () => {
59
+ v("auth-validation-errors", u.value);
60
+ }
61
+ ), k({
62
+ validateField: m
63
+ }), (r, t) => {
64
+ const A = d("IconTip"), N = d("el-icon"), L = d("el-tooltip"), E = d("el-input");
65
+ return i(), O("div", z, [
66
+ n(l(c), {
67
+ modelValue: e.value.auth.authType,
68
+ "onUpdate:modelValue": t[0] || (t[0] = (o) => e.value.auth.authType = o),
69
+ options: B,
70
+ label: l(a)("COMMON_AUTHSECTION.LABEL_AUTH_TYPE"),
71
+ required: !0,
72
+ className: "auth-radio-group",
73
+ layout: s.layout,
74
+ onChange: b
75
+ }, null, 8, ["modelValue", "label", "layout"]),
76
+ e.value.auth.authType === "apiKey" ? (i(), M(l(c), {
77
+ key: 0,
78
+ modelValue: e.value.auth.paramLocation,
79
+ "onUpdate:modelValue": t[1] || (t[1] = (o) => e.value.auth.paramLocation = o),
80
+ options: K,
81
+ label: l(a)("COMMON_AUTHSECTION.LABEL_KEY_LOCATION"),
82
+ "tip-text": l(a)("COMMON_AUTHSECTION.LABEL_KEY_LOCATION_TIP"),
83
+ required: !0,
84
+ className: "location-radio-group",
85
+ layout: s.layout,
86
+ onChange: Y
87
+ }, null, 8, ["modelValue", "label", "tip-text", "layout"])) : T("", !0),
88
+ e.value.auth.authType === "apiKey" && e.value.auth.paramLocation === "header" ? (i(), M(l(c), {
89
+ key: 1,
90
+ modelValue: e.value.auth.keyType,
91
+ "onUpdate:modelValue": t[2] || (t[2] = (o) => e.value.auth.keyType = o),
92
+ options: H,
93
+ label: l(a)("COMMON_AUTHSECTION.LABEL_KEY_TYPE"),
94
+ "tip-text": l(a)("COMMON_AUTHSECTION.LABEL_KEY_TYPE_TIP"),
95
+ required: !0,
96
+ className: "key-radio-group",
97
+ layout: s.layout,
98
+ onChange: g
99
+ }, null, 8, ["modelValue", "label", "tip-text", "layout"])) : T("", !0),
100
+ e.value.auth.authType === "apiKey" && e.value.auth.keyType === "custom" ? (i(), O("div", F, [
101
+ _("div", G, [
102
+ t[6] || (t[6] = _("span", { class: "required" }, "*", -1)),
103
+ f(" " + V(l(a)("COMMON_AUTHSECTION.LABEL_KEY_NAME")) + " ", 1),
104
+ n(L, {
105
+ content: l(a)("COMMON_AUTHSECTION.LABEL_KEY_NAME_TIP"),
106
+ placement: "top"
107
+ }, {
108
+ default: h(() => [
109
+ n(N, {
110
+ style: { "margin-left": "4px" },
111
+ size: "14px",
112
+ color: "#999"
113
+ }, {
114
+ default: h(() => [
115
+ n(A)
116
+ ]),
117
+ _: 1
118
+ })
119
+ ]),
120
+ _: 1
121
+ }, 8, ["content"])
122
+ ]),
123
+ n(E, {
124
+ modelValue: e.value.auth.paramName,
125
+ "onUpdate:modelValue": t[3] || (t[3] = (o) => e.value.auth.paramName = o),
126
+ placeholder: l(a)("COMMON_AUTHSECTION.LABEL_KEY_NAME_PLACEHOLDER"),
127
+ maxlength: "64",
128
+ "show-word-limit": "",
129
+ class: y(["key-input", {
130
+ "error-input": u.value.paramName
131
+ }]),
132
+ onBlur: m
133
+ }, null, 8, ["modelValue", "placeholder", "class"])
134
+ ])) : T("", !0),
135
+ e.value.auth.authType === "apiKey" ? (i(), O("div", Q, [
136
+ _("div", j, [
137
+ t[7] || (t[7] = _("span", { class: "required" }, "*", -1)),
138
+ f(" " + V(l(a)("COMMON_AUTHSECTION.LABEL_KEY_VALUE")) + " ", 1),
139
+ n(L, {
140
+ content: l(a)("COMMON_AUTHSECTION.LABEL_KEY_VALUE_TIP"),
141
+ placement: "top"
142
+ }, {
143
+ default: h(() => [
144
+ n(N, {
145
+ style: { "margin-left": "4px" },
146
+ size: "14px",
147
+ color: "#999"
148
+ }, {
149
+ default: h(() => [
150
+ n(A)
151
+ ]),
152
+ _: 1
153
+ })
154
+ ]),
155
+ _: 1
156
+ }, 8, ["content"])
157
+ ]),
158
+ I(n(E, {
159
+ modelValue: e.value.auth.paramValue,
160
+ "onUpdate:modelValue": t[4] || (t[4] = (o) => e.value.auth.paramValue = o),
161
+ placeholder: l(a)("COMMON_AUTHSECTION.LABEL_KEY_VALUE_PLACEHOLDER"),
162
+ maxlength: "20000",
163
+ "show-word-limit": "",
164
+ class: y(["key-input", {
165
+ "error-input": u.value.paramValue
166
+ }]),
167
+ onBlur: m
168
+ }, null, 8, ["modelValue", "placeholder", "class"]), [
169
+ [U, e.value.auth.keyType === "custom"]
170
+ ]),
171
+ I(n(E, {
172
+ modelValue: e.value.auth.token,
173
+ "onUpdate:modelValue": t[5] || (t[5] = (o) => e.value.auth.token = o),
174
+ placeholder: l(a)("COMMON_AUTHSECTION.LABEL_KEY_VALUE_PLACEHOLDER"),
175
+ maxlength: "20000",
176
+ "show-word-limit": "",
177
+ class: y(["key-input", {
178
+ "error-input": u.value.token
179
+ }]),
180
+ onBlur: m
181
+ }, null, 8, ["modelValue", "placeholder", "class"]), [
182
+ [U, e.value.auth.keyType === "bearer"]
183
+ ])
184
+ ])) : T("", !0)
185
+ ]);
186
+ };
187
+ }
188
+ }, W = /* @__PURE__ */ q(J, [["__scopeId", "data-v-236741b6"]]), te = x(W);
189
+ export {
190
+ te as AuthSection,
191
+ te as default
192
+ };
@@ -1,9 +1,9 @@
1
1
  import { w as D } from "./chunks/index.bCzIhWFw.js";
2
- import { computed as c, createBlock as p, openBlock as t, unref as s, withCtx as h, createElementVNode as m, createCommentVNode as _, resolveDynamicComponent as x, toDisplayString as i, createElementBlock as l, withModifiers as M, Fragment as v, renderList as g, createVNode as b, normalizeStyle as B, createTextVNode as k } from "vue";
2
+ import { computed as c, createBlock as p, openBlock as t, unref as s, withCtx as h, createElementVNode as m, createCommentVNode as _, resolveDynamicComponent as x, toDisplayString as u, createElementBlock as l, withModifiers as M, Fragment as v, renderList as T, createVNode as b, normalizeStyle as B, createTextVNode as k } from "vue";
3
3
  import { ElTag as w, ElIcon as U, ElPopover as z } from "element-plus";
4
4
  import { u as G } from "./chunks/i18n.Bd7hh14j.js";
5
- import { I as H, e as O, d as E, c as V, P as A, R as L, C as R, f as F } from "./chunks/config.DcoKERMt.js";
6
- import { P as T, A as $ } from "./chunks/index.5lH4UH_M.js";
5
+ import { I as H, e as O, d as E, c as V, P as A, R as L, C as R, f as F } from "./chunks/config.CgrPt4Zx.js";
6
+ import { P as N, A as $ } from "./chunks/index.5lH4UH_M.js";
7
7
  import { _ as j } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
8
8
  import './assets/CommonTagsList.css';const K = { class: "status-tag-content flex items-center" }, W = { class: "status-text fz-12" }, Y = {
9
9
  __name: "StatusTag",
@@ -26,20 +26,20 @@ import './assets/CommonTagsList.css';const K = { class: "status-tag-content flex
26
26
  }
27
27
  },
28
28
  setup(r) {
29
- const S = r, a = c(() => S.inActive === H.UNPUBLISHED ? T.UNPUBLISHED : S.channelStatus), N = c(() => O[a.value]), y = c(() => E[a.value]), d = c(() => V[a.value]), I = c(() => A[a.value]);
30
- return (u, e) => (t(), p(s(w), { type: N.value }, {
29
+ const S = r, a = c(() => S.inActive === H.UNPUBLISHED ? N.UNPUBLISHED : S.channelStatus), C = c(() => O[a.value]), y = c(() => E[a.value]), d = c(() => V[a.value]), g = c(() => A[a.value]);
30
+ return (i, e) => (t(), p(s(w), { type: C.value }, {
31
31
  default: h(() => [
32
32
  m("div", K, [
33
33
  r.showIcon && d.value ? (t(), p(s(U), {
34
34
  key: 0,
35
- color: I.value
35
+ color: g.value
36
36
  }, {
37
37
  default: h(() => [
38
38
  (t(), p(x(d.value)))
39
39
  ]),
40
40
  _: 1
41
41
  }, 8, ["color"])) : _("", !0),
42
- m("span", W, i(r.statusText || y.value), 1)
42
+ m("span", W, u(r.statusText || y.value), 1)
43
43
  ])
44
44
  ]),
45
45
  _: 1
@@ -77,35 +77,35 @@ import './assets/CommonTagsList.css';const K = { class: "status-tag-content flex
77
77
  }
78
78
  },
79
79
  setup(r) {
80
- const { t: S } = G(), a = r, N = c(() => a.publishChannelList || []), y = c(() => {
80
+ const { t: S } = G(), a = r, C = c(() => a.publishChannelList || []), y = c(() => {
81
81
  if (!a.publishChannelList?.length) return [];
82
- const u = a.publishChannelList.reduce((e, o) => {
83
- const f = o.inActive === H.UNPUBLISHED ? T.UNPUBLISHED : o.channelStatus;
82
+ const i = a.publishChannelList.reduce((e, o) => {
83
+ const f = o.inActive === H.UNPUBLISHED ? N.UNPUBLISHED : o.channelStatus;
84
84
  return e[f] || (e[f] = []), e[f].push(o), e;
85
85
  }, {});
86
- return Object.entries(u).map(([e, o]) => ({
86
+ return Object.entries(i).map(([e, o]) => ({
87
87
  status: parseInt(e),
88
88
  channels: o
89
89
  })).sort((e, o) => o.status - e.status);
90
90
  }), d = c(() => {
91
91
  if (!a.publishChannelList?.length) return [];
92
- const u = S("COMMON_TAGS_LIST.UNKNOWN_CHANNEL");
92
+ const i = S("COMMON_TAGS_LIST.UNKNOWN_CHANNEL");
93
93
  return a.publishChannelList.filter((e) => e.visibleScope && e.visibleScope.length > 0).map((e) => ({
94
- channelName: L[e.channelType]?.name(a.sourceType) || u,
94
+ channelName: L[e.channelType]?.name(a.sourceType) || i,
95
95
  channelType: e.channelType,
96
96
  visibleScope: e.visibleScope,
97
97
  allVisible: e.allVisible
98
98
  }));
99
- }), I = (u) => {
100
- const e = F[u];
99
+ }), g = (i) => {
100
+ const e = F[i];
101
101
  return R[e];
102
102
  };
103
- return (u, e) => (t(), l("div", {
103
+ return (i, e) => (t(), l("div", {
104
104
  class: "commont-status-box",
105
105
  onClick: e[0] || (e[0] = M(() => {
106
106
  }, ["stop"]))
107
107
  }, [
108
- (t(!0), l(v, null, g(N.value, (o, f) => (t(), p(s(z), {
108
+ (t(!0), l(v, null, T(C.value, (o, f) => (t(), p(s(z), {
109
109
  key: f,
110
110
  placement: "bottom",
111
111
  trigger: "click",
@@ -122,7 +122,7 @@ import './assets/CommonTagsList.css';const K = { class: "status-tag-content flex
122
122
  ]),
123
123
  default: h(() => [
124
124
  m("div", q, [
125
- (t(!0), l(v, null, g(y.value, (n, C) => (t(), l(v, {
125
+ (t(!0), l(v, null, T(y.value, (n, I) => (t(), l(v, {
126
126
  key: n.status
127
127
  }, [
128
128
  n.channels.length > 0 ? (t(), l("div", J, [
@@ -138,35 +138,36 @@ import './assets/CommonTagsList.css';const K = { class: "status-tag-content flex
138
138
  m("div", {
139
139
  class: "content-item-name fz-14 mg-l-4",
140
140
  style: B({ color: s(A)[n.status] })
141
- }, i(s(E)[n.status]) + "(" + i(n.channels.length) + ") ", 5)
141
+ }, u(s(E)[n.status]) + "(" + u(n.channels.length) + ") ", 5)
142
142
  ]),
143
143
  m("div", Z, [
144
- (t(!0), l(v, null, g(n.channels, (P) => (t(), l("div", {
144
+ (t(!0), l(v, null, T(n.channels, (P) => (t(), l("div", {
145
145
  class: "b-item-box mg-r-8 radius-4 fz-12 pd-t-4 pd-b-4 pd-l-8 pd-r-8 mg-b-8 text-1f2329 bg-f5f6f7",
146
146
  key: P.channelType
147
- }, i(s(L)?.[P.channelType]?.name(
147
+ }, u(s(L)?.[P.channelType]?.name(
148
148
  r.sourceType
149
149
  )), 1))), 128))
150
150
  ])
151
151
  ])) : _("", !0),
152
- C < y.value.length - 1 ? (t(), l("div", ee)) : _("", !0)
152
+ I < y.value.length - 1 ? (t(), l("div", ee)) : _("", !0)
153
153
  ], 64))), 128)),
154
154
  d.value.length > 0 ? (t(), l("div", te, [
155
- (t(!0), l(v, null, g(d.value, (n, C) => (t(), l("div", {
155
+ (t(!0), l(v, null, T(d.value, (n, I) => (t(), l("div", {
156
156
  key: n.channelType,
157
157
  class: "channel-visible-range"
158
158
  }, [
159
159
  m("div", se, [
160
160
  b(s(U), {
161
161
  class: "mg-r-2",
162
- size: "14"
162
+ size: "14",
163
+ color: g(n.channelType)?.iconColor
163
164
  }, {
164
165
  default: h(() => [
165
- (t(), p(x(I(n.channelType)?.icon)))
166
+ (t(), p(x(g(n.channelType)?.icon)))
166
167
  ]),
167
168
  _: 2
168
- }, 1024),
169
- k(" " + i(n.channelName) + " " + i(s(S)("COMMON_TAGS_LIST.AVAILABLE_SCOPE")), 1)
169
+ }, 1032, ["color"]),
170
+ k(" " + u(n.channelName) + " " + u(s(S)("COMMON_TAGS_LIST.AVAILABLE_SCOPE")), 1)
170
171
  ]),
171
172
  b(s($), {
172
173
  "all-visible": n.allVisible,
@@ -174,7 +175,7 @@ import './assets/CommonTagsList.css';const K = { class: "status-tag-content flex
174
175
  "tree-list": [],
175
176
  readonly: !0
176
177
  }, null, 8, ["all-visible", "model-value"]),
177
- C < d.value.length - 1 ? (t(), l("div", ne)) : _("", !0)
178
+ I < d.value.length - 1 ? (t(), l("div", ne)) : _("", !0)
178
179
  ]))), 128))
179
180
  ])) : _("", !0)
180
181
  ])
@@ -183,10 +184,10 @@ import './assets/CommonTagsList.css';const K = { class: "status-tag-content flex
183
184
  }, 1024))), 128)),
184
185
  r.publishChannelList?.length ? _("", !0) : (t(), p(s(w), {
185
186
  key: 0,
186
- type: s(O)[s(T).UNPUBLISHED]
187
+ type: s(O)[s(N).UNPUBLISHED]
187
188
  }, {
188
189
  default: h(() => [
189
- k(i(s(E)[s(T).UNPUBLISHED]), 1)
190
+ k(u(s(E)[s(N).UNPUBLISHED]), 1)
190
191
  ]),
191
192
  _: 1
192
193
  }, 8, ["type"]))
@@ -0,0 +1,321 @@
1
+ import { w as V } from "./chunks/index.bCzIhWFw.js";
2
+ import { ref as E, reactive as h, resolveComponent as m, createBlock as I, openBlock as f, withCtx as i, createVNode as r, createCommentVNode as L, createElementVNode as R, unref as n, toDisplayString as d, createTextVNode as y } from "vue";
3
+ import { ElMessage as T } from "element-plus";
4
+ import { o as B } from "./chunks/usePreview.BMkgYO7E.js";
5
+ import { AuthSection as k } from "./AuthSection.mjs";
6
+ import { RadioGroup as Y } from "./RadioGroup.mjs";
7
+ import { u as S } from "./chunks/i18n.Bd7hh14j.js";
8
+ import { FilePreview as w } from "./AddOrEditSupplierDialog.mjs";
9
+ import { FileUploader as x } from "./FileUploader.mjs";
10
+ import { _ as K } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
11
+ import './assets/CreateMcpForm.css';const Q = { class: "label-with-icon" }, H = { class: "label-with-icon" }, q = { class: "auth-section-wrapper" }, z = {
12
+ __name: "CreateMcpForm",
13
+ setup(X, { expose: O }) {
14
+ const { t: o } = S(), { previewImage: F } = B(), M = E(null), A = E(null), l = h({
15
+ icon: "",
16
+ iconUrl: "",
17
+ name: "",
18
+ description: "",
19
+ communicationType: "HTTP",
20
+ // 默认值改为与 options 中的 value 匹配
21
+ address: "",
22
+ applyLink: ""
23
+ }), b = E([
24
+ { label: "SSE", value: "SSE" },
25
+ { label: "Streamable HTTP", value: "HTTP" }
26
+ ]), a = h({
27
+ auth: {
28
+ authType: "none",
29
+ keyType: "custom",
30
+ paramLocation: "header",
31
+ paramName: "",
32
+ paramValue: "",
33
+ token: ""
34
+ }
35
+ }), U = E({
36
+ name: [
37
+ {
38
+ required: !0,
39
+ message: o("LIBRARY_CREATEMCPFORM.MCP_NAME_PLACEHOLDER"),
40
+ trigger: "blur"
41
+ },
42
+ {
43
+ max: 20,
44
+ message: o("LIBRARY_CREATEMCPFORM.MCP_NAME_MAX"),
45
+ trigger: "blur"
46
+ }
47
+ ],
48
+ description: [
49
+ {
50
+ required: !0,
51
+ message: o("LIBRARY_CREATEMCPFORM.MCP_DESCRIPTION_REQUIRED"),
52
+ trigger: "blur"
53
+ },
54
+ {
55
+ max: 200,
56
+ message: o("LIBRARY_CREATEMCPFORM.MCP_DESCRIPTION_MAX"),
57
+ trigger: "blur"
58
+ }
59
+ ],
60
+ address: [
61
+ {
62
+ type: "url",
63
+ required: !0,
64
+ message: o("LIBRARY_CREATEMCPFORM.SERVICE_URL_INVALID"),
65
+ trigger: ["blur", "change"]
66
+ }
67
+ ],
68
+ communicationType: [
69
+ {
70
+ required: !0,
71
+ message: o("LIBRARY_CREATEMCPFORM.TRANSFER_METHOD_REQUIRED"),
72
+ trigger: "change"
73
+ }
74
+ ],
75
+ applyLink: [
76
+ {
77
+ type: "url",
78
+ message: o("LIBRARY_CREATEMCPFORM.DOCUMENTATION_URL_INVALID"),
79
+ trigger: ["blur", "change"]
80
+ }
81
+ ]
82
+ }), c = E([]), N = (e) => {
83
+ l.iconUrl = e.url, l.icon = e.bnid, c.value = [e];
84
+ }, g = () => {
85
+ l.iconUrl = "", l.icon = "", c.value = [];
86
+ }, v = (e) => {
87
+ F(e.url);
88
+ };
89
+ return O({ validate: async (e) => {
90
+ if (!M.value) return !1;
91
+ if (A.value?.validateField) {
92
+ const t = A.value.validateField();
93
+ if (Object.keys(t).length > 0)
94
+ return t.paramName ? T.error(o("LIBRARY_CREATEMCPFORM.PARAMETER_NAME_REQUIRED") || "请输入密钥参数名") : t.paramValue ? T.error(o("LIBRARY_CREATEMCPFORM.INPUT_API_KEY_REQUIRED") || "请输入密钥值") : t.token ? T.error(o("LIBRARY_CREATEMCPFORM.INPUT_API_KEY_REQUIRED") || "请输入密钥值") : T.error(o("LIBRARY_CREATEMCPFORM.MCP_AUTH_REQUIRED") || "请完善鉴权信息"), e?.(new Error(o("LIBRARY_CREATEMCPFORM.MCP_AUTH_REQUIRED") || "请完善鉴权信息")), !1;
95
+ }
96
+ return M.value.validate(e);
97
+ }, getFormData: () => ({
98
+ name: l.name,
99
+ icon: l.icon,
100
+ // iconUrl: ruleForm.iconUrl,
101
+ description: l.description,
102
+ address: l.address,
103
+ communicationType: l.communicationType,
104
+ // 鉴权相关字段
105
+ authType: a.auth.authType === "none" ? 0 : 1,
106
+ // none->0, apiKey->1
107
+ authLocation: a.auth.paramLocation === "header" ? 0 : 1,
108
+ // header->0, query->1
109
+ apiKeyName: a.auth.keyType === "bearer" ? "Authorization" : a.auth.paramName || "",
110
+ apiKeyValue: a.auth.keyType === "bearer" ? a.auth.token ? `Bearer ${a.auth.token}` : "" : a.auth.paramValue || "",
111
+ // 可选字段
112
+ applyLink: l.applyLink || "",
113
+ headerPrefixType: 1,
114
+ overview: ""
115
+ }), setFormData: (e) => {
116
+ if (!e) return;
117
+ Object.assign(l, {
118
+ name: e.name || "",
119
+ description: e.description || "",
120
+ icon: e.icon || "",
121
+ iconUrl: e.iconUrl || "",
122
+ communicationType: e.communicationType || "SSE",
123
+ address: e.address || "",
124
+ applyLink: e.applyLink || ""
125
+ });
126
+ const t = e.authType === 1 || e.authType === "1";
127
+ if (a.auth.authType = t ? "apiKey" : "none", a.auth.paramLocation = e.authLocation === 0 || e.authLocation === "0" ? "header" : "query", t) {
128
+ const _ = !e.apiKeyName || e.apiKeyName === "Authorization";
129
+ if (a.auth.keyType = _ ? "bearer" : "custom", _) {
130
+ a.auth.paramName = "", a.auth.paramValue = "";
131
+ const u = e.apiKeyValue || "";
132
+ a.auth.token = u.startsWith("Bearer ") ? u.substring(7) : u;
133
+ } else
134
+ a.auth.paramName = e.apiKeyName || "", a.auth.paramValue = e.apiKeyValue || "", a.auth.token = "";
135
+ } else
136
+ a.auth.keyType = "custom", a.auth.paramName = "", a.auth.paramValue = "", a.auth.token = "";
137
+ e.icon && e.icon !== "0" && e.iconUrl && (c.value = [{ bnid: e.icon, url: e.iconUrl }]);
138
+ } }), (e, t) => {
139
+ const _ = m("IconTip"), u = m("el-icon"), P = m("el-tooltip"), p = m("el-form-item"), C = m("el-input"), D = m("el-form");
140
+ return f(), I(D, {
141
+ ref_key: "ruleFormRef",
142
+ ref: M,
143
+ model: l,
144
+ rules: U.value,
145
+ "label-width": "auto",
146
+ "label-position": "top",
147
+ class: "scrollable-form"
148
+ }, {
149
+ default: i(() => [
150
+ r(p, {
151
+ class: "scrollable-form__item",
152
+ label: n(o)("LIBRARY_CREATEMCPFORM.MCP_ICON"),
153
+ prop: "icon"
154
+ }, {
155
+ label: i(() => [
156
+ R("div", Q, [
157
+ R("span", null, d(n(o)("LIBRARY_CREATEMCPFORM.MCP_ICON")), 1),
158
+ r(P, { placement: "top" }, {
159
+ content: i(() => [
160
+ y(d(n(o)("LIBRARY_CREATEMCPFORM.MCP_ICON_TIP")), 1),
161
+ t[6] || (t[6] = R("br", null, null, -1)),
162
+ y(" " + d(n(o)("LIBRARY_CREATEMCPFORM.MCP_ICON_SIZE_TIP")), 1)
163
+ ]),
164
+ default: i(() => [
165
+ r(u, {
166
+ size: "14px",
167
+ color: "#999"
168
+ }, {
169
+ default: i(() => [
170
+ r(_)
171
+ ]),
172
+ _: 1
173
+ })
174
+ ]),
175
+ _: 1
176
+ })
177
+ ])
178
+ ]),
179
+ default: i(() => [
180
+ r(n(w), {
181
+ fileList: c.value,
182
+ previewType: "Card",
183
+ isCustom: !0,
184
+ onOnRemove: g,
185
+ onOnPreview: v
186
+ }, {
187
+ CardUploader: i(() => [
188
+ c.value.length === 0 ? (f(), I(n(x), {
189
+ key: 0,
190
+ "upload-type": "Card",
191
+ onOnSuccess: N,
192
+ limitSize: 5,
193
+ acceptType: ".jpg,.png",
194
+ businessType: "mcp",
195
+ defaultUploadIcon: "mcp"
196
+ })) : L("", !0)
197
+ ]),
198
+ _: 1
199
+ }, 8, ["fileList"])
200
+ ]),
201
+ _: 1
202
+ }, 8, ["label"]),
203
+ r(p, {
204
+ class: "scrollable-form__item",
205
+ label: n(o)("LIBRARY_CREATEMCPFORM.MCP_NAME"),
206
+ prop: "name"
207
+ }, {
208
+ default: i(() => [
209
+ r(C, {
210
+ modelValue: l.name,
211
+ "onUpdate:modelValue": t[0] || (t[0] = (s) => l.name = s),
212
+ placeholder: n(o)("LIBRARY_CREATEMCPFORM.MCP_NAME_REQUIRED"),
213
+ maxlength: "20",
214
+ "show-word-limit": ""
215
+ }, null, 8, ["modelValue", "placeholder"])
216
+ ]),
217
+ _: 1
218
+ }, 8, ["label"]),
219
+ r(p, {
220
+ class: "scrollable-form__item",
221
+ label: n(o)("LIBRARY_CREATEMCPFORM.MCP_DESCRIPTION"),
222
+ prop: "description"
223
+ }, {
224
+ default: i(() => [
225
+ r(C, {
226
+ modelValue: l.description,
227
+ "onUpdate:modelValue": t[1] || (t[1] = (s) => l.description = s),
228
+ type: "textarea",
229
+ rows: 3,
230
+ placeholder: n(o)("LIBRARY_CREATEMCPFORM.MCP_DESCRIPTION_REQUIRED"),
231
+ maxlength: "200",
232
+ "show-word-limit": ""
233
+ }, null, 8, ["modelValue", "placeholder"])
234
+ ]),
235
+ _: 1
236
+ }, 8, ["label"]),
237
+ r(p, {
238
+ class: "scrollable-form__item",
239
+ label: n(o)("LIBRARY_CREATEMCPFORM.TRANSFER_METHOD"),
240
+ prop: "communicationType"
241
+ }, {
242
+ default: i(() => [
243
+ r(n(Y), {
244
+ modelValue: l.communicationType,
245
+ "onUpdate:modelValue": t[2] || (t[2] = (s) => l.communicationType = s),
246
+ options: b.value,
247
+ layout: "vertical",
248
+ "class-name": "scrollable-form__item-radio"
249
+ }, null, 8, ["modelValue", "options"])
250
+ ]),
251
+ _: 1
252
+ }, 8, ["label"]),
253
+ r(p, {
254
+ class: "scrollable-form__item",
255
+ label: n(o)("LIBRARY_CREATEMCPFORM.SERVICE_URL"),
256
+ prop: "address"
257
+ }, {
258
+ default: i(() => [
259
+ r(C, {
260
+ modelValue: l.address,
261
+ "onUpdate:modelValue": t[3] || (t[3] = (s) => l.address = s),
262
+ placeholder: n(o)("LIBRARY_CREATEMCPFORM.SERVICE_URL_REQUIRED")
263
+ }, null, 8, ["modelValue", "placeholder"])
264
+ ]),
265
+ _: 1
266
+ }, 8, ["label"]),
267
+ a.auth.authType === "apiKey" ? (f(), I(p, {
268
+ key: 0,
269
+ class: "scrollable-form__item",
270
+ prop: "applyLink"
271
+ }, {
272
+ label: i(() => [
273
+ R("div", H, [
274
+ R("span", null, d(n(o)("LIBRARY_CREATEMCPFORM.DOCUMENTATION_URL")), 1),
275
+ r(P, { placement: "top" }, {
276
+ content: i(() => [
277
+ y(d(n(o)("LIBRARY_CREATEMCPFORM.DOCUMENTATION_URL_TIP")), 1)
278
+ ]),
279
+ default: i(() => [
280
+ r(u, {
281
+ size: "14px",
282
+ color: "#999"
283
+ }, {
284
+ default: i(() => [
285
+ r(_)
286
+ ]),
287
+ _: 1
288
+ })
289
+ ]),
290
+ _: 1
291
+ })
292
+ ])
293
+ ]),
294
+ default: i(() => [
295
+ r(C, {
296
+ modelValue: l.applyLink,
297
+ "onUpdate:modelValue": t[4] || (t[4] = (s) => l.applyLink = s),
298
+ placeholder: n(o)("LIBRARY_CREATEMCPFORM.DOCUMENTATION_URL_REQUIRED")
299
+ }, null, 8, ["modelValue", "placeholder"])
300
+ ]),
301
+ _: 1
302
+ })) : L("", !0),
303
+ R("div", q, [
304
+ r(n(k), {
305
+ ref_key: "authSectionRef",
306
+ ref: A,
307
+ featData: a,
308
+ "onUpdate:featData": t[5] || (t[5] = (s) => a = s),
309
+ layout: "vertical"
310
+ }, null, 8, ["featData"])
311
+ ])
312
+ ]),
313
+ _: 1
314
+ }, 8, ["model", "rules"]);
315
+ };
316
+ }
317
+ }, j = /* @__PURE__ */ K(z, [["__scopeId", "data-v-12ffddd4"]]), se = V(j);
318
+ export {
319
+ se as CreateMcpForm,
320
+ se as default
321
+ };