china-mobile-international-custom-components 0.1.22 → 0.1.24
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.
- package/es/AddOrEditSupplierDialog.mjs +2 -2
- package/es/AgentDetail.mjs +5 -5
- package/es/ApplicationTypeTag.mjs +3 -3
- package/es/AuthSection.mjs +2 -2
- package/es/AutoShowTooltip.mjs +1 -1
- package/es/AvailableRangePreview.mjs +1 -1
- package/es/AvailableRangeSetting.mjs +5 -5
- package/es/CodeView.mjs +1 -1
- package/es/CommonTagsList.mjs +62 -62
- package/es/CreateMcpForm.mjs +6 -6
- package/es/CustomSidebar.mjs +1 -1
- package/es/CustomTitle.mjs +1 -1
- package/es/CustomToggle.mjs +11 -11
- package/es/DialogContainer.mjs +5 -5
- package/es/DocSyncSelect.mjs +2 -2
- package/es/FileDisplay.mjs +1 -1
- package/es/FilePreview.mjs +9 -9
- package/es/FileUploader.mjs +2 -2
- package/es/ImageComponent.mjs +5 -0
- package/es/Logo.mjs +2 -2
- package/es/McpFormDialog.mjs +1 -1
- package/es/McpParamsSet.mjs +4 -4
- package/es/MdEditor.mjs +3 -3
- package/es/PageContainer.mjs +2 -2
- package/es/ParameterTable.mjs +2 -2
- package/es/PublishRecord.mjs +6 -6
- package/es/RadioGroup.mjs +5 -5
- package/es/SourcePublish.mjs +6 -6
- package/es/Table.mjs +2 -2
- package/es/WorkFlowDialog.mjs +3 -3
- package/es/WorkflowComponent.mjs +1 -1
- package/es/assets/ImageComponent.css +0 -0
- package/es/assets/layout2.css +1 -1
- package/es/chunks/AddAgentDialog.BEDSZ4er.js +244 -0
- package/es/chunks/AddDialog.RuOrCghd.js +1969 -0
- package/es/chunks/BackBar.Ck5CV5ZM.js +629 -0
- package/es/chunks/CreatePluginDialog.DbQIt3Mz.js +775 -0
- package/es/chunks/CreateWorkflow.CIYJ3nGZ.js +268 -0
- package/es/chunks/ImageComponent.BgYVT3ZJ.js +74 -0
- package/es/chunks/ToolList.2k07ztsY.js +106 -0
- package/es/chunks/config.B_uTnClF.js +47 -0
- package/es/chunks/config.e_OOovlY.js +358 -0
- package/es/chunks/i18n.9cHOVn6X.js +4049 -0
- package/es/chunks/index.BGLAHzZm.js +398 -0
- package/es/chunks/index.CCNAKdQj.js +1279 -0
- package/es/chunks/index.CXIY0q5X.js +172 -0
- package/es/chunks/index.Cv9pn5nk.js +4 -0
- package/es/chunks/index.CyiNa6lr.js +256 -0
- package/es/chunks/index.JG8-HCzk.js +29609 -0
- package/es/chunks/layout.BAvYghmE.js +650 -0
- package/es/chunks/layout.BGxsktpj.js +650 -0
- package/es/chunks/layout.CrO2n3Dk.js +648 -0
- package/es/chunks/layout.Iob_aYQ7.js +26 -0
- package/es/chunks/layout.mwJCmdfw.js +648 -0
- package/es/chunks/view.BSjGhafy.js +824 -0
- package/es/index.mjs +66 -66
- package/lib/CommonTagsList.js +1 -1
- package/lib/CustomSidebar.js +1 -1
- package/lib/ImageComponent.js +1 -0
- package/lib/assets/ImageComponent.css +0 -0
- package/lib/assets/layout2.css +1 -1
- package/lib/chunks/ImageComponent.CdPLM_LX.js +1 -0
- package/lib/chunks/index.Cbkv4rXa.js +1 -0
- package/lib/chunks/layout.BPaMqsSV.js +1 -0
- package/lib/chunks/layout.CcvMc8-K.js +1 -0
- package/lib/chunks/layout.zlS8S4UN.js +1 -0
- package/lib/index.js +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,1969 @@
|
|
|
1
|
+
import { reactive as Le, openBlock as o, createElementBlock as p, Fragment as H, toDisplayString as d, unref as e, createCommentVNode as y, createVNode as u, withCtx as r, createTextVNode as j, createElementVNode as s, ref as K, computed as M, watch as de, onMounted as he, onUnmounted as et, resolveComponent as V, createBlock as v, withModifiers as le, useCssVars as tt, nextTick as Be, getCurrentScope as nt, onScopeDispose as at, getCurrentInstance as Ue, shallowRef as xe, toValue as Ve, normalizeStyle as _e, normalizeClass as q, resolveDynamicComponent as Te, Transition as lt, withDirectives as ze, vShow as ot, renderList as ie, onBeforeUnmount as it, resolveDirective as st, withKeys as Re } from "vue";
|
|
2
|
+
import { ElIcon as G, ElPopover as ce, ElInput as De, ElButton as U, ElMessage as ct, ElEmpty as Ee, ElDropdown as dt, ElDropdownMenu as rt, ElDropdownItem as Se, ElAutoResizer as ut, ElTreeV2 as pt } from "element-plus";
|
|
3
|
+
import { A as a, d as Ke, e as L, H as ke, u as mt, p as gt, f as Ae, h as Ne, i as we, j as _t, n as ht, k as $e, l as Oe, m as ft, o as vt, q as yt, O as Me, r as bt, s as kt, t as At, v as Nt } from "./index.JG8-HCzk.js";
|
|
4
|
+
import { useDialog as wt, DialogContainer as Ot } from "../DialogContainer.mjs";
|
|
5
|
+
import { u as ee } from "./i18n.9cHOVn6X.js";
|
|
6
|
+
import { AiboxTable as Ct } from "../Table.mjs";
|
|
7
|
+
import { AutoShowTooltip as Ge } from "../AutoShowTooltip.mjs";
|
|
8
|
+
import { useRouter as xt, useRoute as Fe } from "vue-router";
|
|
9
|
+
import { _ as te } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
10
|
+
import { ViewMcpDetail as Dt } from "color-message-aibox-vue";
|
|
11
|
+
import '../assets/AddDialog.css';const It = { key: 0 }, Tt = { class: "output-warp__name" }, Et = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "required"
|
|
14
|
+
}, Rt = { class: "output-warp__text" }, St = { class: "output-warp__type" }, $t = ["title"], ue = {
|
|
15
|
+
__name: "InputVariable",
|
|
16
|
+
props: {
|
|
17
|
+
data: {
|
|
18
|
+
type: Array,
|
|
19
|
+
default: () => []
|
|
20
|
+
},
|
|
21
|
+
showTitle: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: !0
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
setup(n) {
|
|
27
|
+
const { t: b } = ee(), m = Le({
|
|
28
|
+
columns: [
|
|
29
|
+
{
|
|
30
|
+
label: b("AGENT_ARRANGE.IV.COL.LABEL_1") || "参数名称",
|
|
31
|
+
prop: "name",
|
|
32
|
+
slot: "name",
|
|
33
|
+
width: "120px"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: b("AGENT_ARRANGE.IV.COL.LABEL_2") || "参数类型",
|
|
37
|
+
prop: "type",
|
|
38
|
+
slot: "type",
|
|
39
|
+
width: "100px"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
label: b("AGENT_ARRANGE.IV.COL.LABEL_3") || "参数描述",
|
|
43
|
+
prop: "description",
|
|
44
|
+
slot: "description"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
});
|
|
48
|
+
return (c, O) => (o(), p(H, null, [
|
|
49
|
+
n.showTitle ? (o(), p("p", It, d(e(b)("AGENT_ARRANGE.IV.INPUT_PARAMS")), 1)) : y("", !0),
|
|
50
|
+
u(e(Ct), {
|
|
51
|
+
class: "output-warp",
|
|
52
|
+
columns: m.columns,
|
|
53
|
+
data: n.data,
|
|
54
|
+
isSecondaryHeader: "",
|
|
55
|
+
onRowKey: (h) => h.uiid,
|
|
56
|
+
hasPage: !1,
|
|
57
|
+
total: m.total
|
|
58
|
+
}, {
|
|
59
|
+
name: r(({ row: h }) => [
|
|
60
|
+
s("div", Tt, [
|
|
61
|
+
h.required ? (o(), p("span", Et, "*")) : y("", !0),
|
|
62
|
+
s("span", Rt, [
|
|
63
|
+
u(e(Ge), {
|
|
64
|
+
content: h.extendName ? h.extendName : h.name
|
|
65
|
+
}, {
|
|
66
|
+
default: r(() => [
|
|
67
|
+
j(d(h.extendName ? h.extendName : h.name), 1)
|
|
68
|
+
]),
|
|
69
|
+
_: 2
|
|
70
|
+
}, 1032, ["content"])
|
|
71
|
+
])
|
|
72
|
+
])
|
|
73
|
+
]),
|
|
74
|
+
type: r(({ row: h }) => [
|
|
75
|
+
s("span", St, d(h.type), 1)
|
|
76
|
+
]),
|
|
77
|
+
description: r(({ row: h }) => [
|
|
78
|
+
h.description ? (o(), p("span", {
|
|
79
|
+
key: 0,
|
|
80
|
+
class: "output-warp__description",
|
|
81
|
+
title: h.description
|
|
82
|
+
}, [
|
|
83
|
+
u(e(Ge), {
|
|
84
|
+
content: h.description
|
|
85
|
+
}, {
|
|
86
|
+
default: r(() => [
|
|
87
|
+
j(d(h.description), 1)
|
|
88
|
+
]),
|
|
89
|
+
_: 2
|
|
90
|
+
}, 1032, ["content"])
|
|
91
|
+
], 8, $t)) : y("", !0)
|
|
92
|
+
]),
|
|
93
|
+
_: 1
|
|
94
|
+
}, 8, ["columns", "data", "onRowKey", "total"])
|
|
95
|
+
], 64));
|
|
96
|
+
}
|
|
97
|
+
}, Mt = {
|
|
98
|
+
key: 0,
|
|
99
|
+
class: "auth-status"
|
|
100
|
+
}, Gt = { class: "auth-status__info" }, jt = { class: "auth-text" }, Pt = { class: "auth-popover" }, Lt = { class: "auth-popover__title" }, Bt = { class: "title-text" }, Ut = { class: "auth-popover__input" }, Vt = {
|
|
101
|
+
key: 0,
|
|
102
|
+
class: "auth-error"
|
|
103
|
+
}, zt = { class: "auth-popover__btns" }, Kt = {
|
|
104
|
+
key: 0,
|
|
105
|
+
class: "title__tag"
|
|
106
|
+
}, Ft = {
|
|
107
|
+
__name: "AuthStatus",
|
|
108
|
+
props: {
|
|
109
|
+
// 数据对象,包含授权相关信息
|
|
110
|
+
data: {
|
|
111
|
+
type: Object,
|
|
112
|
+
required: !0,
|
|
113
|
+
default: () => ({})
|
|
114
|
+
},
|
|
115
|
+
type: {
|
|
116
|
+
type: String,
|
|
117
|
+
default: a.mcp,
|
|
118
|
+
validator: (n) => Object.values(a).includes(n)
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
emits: [
|
|
122
|
+
"update-success"
|
|
123
|
+
// 操作成功后的更新
|
|
124
|
+
],
|
|
125
|
+
setup(n, { emit: b }) {
|
|
126
|
+
const { t: m } = ee(), { updateMcpKey: c, createMcpKey: O, addPlugletKeyApi: h, editPlugletKeyApi: k } = Ke(), g = n, T = b, x = K(g.data.apiKey || ""), R = K(g.data.apiKey || ""), f = K(!1), B = K(""), t = K(!1), A = K(
|
|
127
|
+
`${g.type}-${g.data.bnid || g.data.keyBnid}-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`
|
|
128
|
+
), P = M(() => g.data.state != 2), z = M(() => {
|
|
129
|
+
if (g.type === a.mcp)
|
|
130
|
+
return g.data.state == 1;
|
|
131
|
+
const Y = {
|
|
132
|
+
[a.plugin]: "apiKey"
|
|
133
|
+
// [ARRANGE_STATIC_DATA_MAP.mcp]: 'keyBnid'
|
|
134
|
+
};
|
|
135
|
+
return !!g.data[Y[g.type]];
|
|
136
|
+
}), w = {
|
|
137
|
+
[a.plugin]: h,
|
|
138
|
+
[a.mcp]: O
|
|
139
|
+
}, N = {
|
|
140
|
+
[a.plugin]: k,
|
|
141
|
+
[a.mcp]: c
|
|
142
|
+
}, W = M(() => z.value ? N[g.type] : w[g.type]), C = () => {
|
|
143
|
+
B.value = "", L.emit(ke, A.value), t.value = !0;
|
|
144
|
+
}, S = () => {
|
|
145
|
+
x.value = R.value, t.value = !1;
|
|
146
|
+
}, I = async () => {
|
|
147
|
+
f.value = !0;
|
|
148
|
+
const Y = {
|
|
149
|
+
[a.plugin]: "plugletBnid",
|
|
150
|
+
[a.mcp]: "bnid"
|
|
151
|
+
};
|
|
152
|
+
await W.value(
|
|
153
|
+
{
|
|
154
|
+
apiKey: x.value,
|
|
155
|
+
[Y[g.type]]: g.data.keyBnid || g.data.bnid
|
|
156
|
+
},
|
|
157
|
+
g.data.bnid || g.data.keyBnid
|
|
158
|
+
).then((J) => {
|
|
159
|
+
J.code === 0 && (J.data ? (ct.success(J.mesg), S(), T("update-success")) : B.value = J.mesg);
|
|
160
|
+
}).finally(() => {
|
|
161
|
+
f.value = !1;
|
|
162
|
+
});
|
|
163
|
+
}, F = () => {
|
|
164
|
+
window.open(g.data.applyLink, "_blank");
|
|
165
|
+
}, Z = (Y) => {
|
|
166
|
+
Y !== A.value && (t.value = !1);
|
|
167
|
+
};
|
|
168
|
+
return de(
|
|
169
|
+
() => g.data,
|
|
170
|
+
(Y) => {
|
|
171
|
+
x.value = Y.apiKey, R.value = Y.apiKey;
|
|
172
|
+
}
|
|
173
|
+
), he(() => {
|
|
174
|
+
L.on(ke, Z);
|
|
175
|
+
}), et(() => {
|
|
176
|
+
L.off(ke, Z);
|
|
177
|
+
}), (Y, J) => {
|
|
178
|
+
const pe = V("IconOk2"), fe = V("IconWarn"), ve = V("IconGoto2"), ne = V("Government");
|
|
179
|
+
return P.value ? (o(), p("div", Mt, [
|
|
180
|
+
s("div", Gt, [
|
|
181
|
+
z.value ? (o(), v(e(G), {
|
|
182
|
+
key: 0,
|
|
183
|
+
color: "#27C637",
|
|
184
|
+
size: "16px"
|
|
185
|
+
}, {
|
|
186
|
+
default: r(() => [
|
|
187
|
+
u(pe)
|
|
188
|
+
]),
|
|
189
|
+
_: 1
|
|
190
|
+
})) : (o(), v(e(G), {
|
|
191
|
+
key: 1,
|
|
192
|
+
color: "#B8B8B8",
|
|
193
|
+
size: "12px"
|
|
194
|
+
}, {
|
|
195
|
+
default: r(() => [
|
|
196
|
+
u(fe)
|
|
197
|
+
]),
|
|
198
|
+
_: 1
|
|
199
|
+
})),
|
|
200
|
+
s("span", jt, d(z.value ? e(m)("AGENT_ARRANGE.AS.AUTHORIZED") : e(m)("AGENT_ARRANGE.AS.UNAUTHORIZED")), 1)
|
|
201
|
+
]),
|
|
202
|
+
u(e(ce), {
|
|
203
|
+
placement: "right",
|
|
204
|
+
trigger: "click",
|
|
205
|
+
visible: t.value,
|
|
206
|
+
width: 344,
|
|
207
|
+
"popper-class": "auth-status-popover"
|
|
208
|
+
}, {
|
|
209
|
+
reference: r(() => [
|
|
210
|
+
s("span", {
|
|
211
|
+
class: "auth-btn",
|
|
212
|
+
onClick: le(C, ["stop"])
|
|
213
|
+
}, d(z.value ? e(m)("AGENT_ARRANGE.AS.MODIFY_API_KEY") : e(m)("AGENT_ARRANGE.AS.GO_AUTHORIZE")), 1)
|
|
214
|
+
]),
|
|
215
|
+
default: r(() => [
|
|
216
|
+
s("div", Pt, [
|
|
217
|
+
s("div", Lt, [
|
|
218
|
+
s("div", Bt, d(e(m)("AGENT_ARRANGE.AS.INPUT_API_KEY")), 1),
|
|
219
|
+
n.data.applyLink ? (o(), p("div", {
|
|
220
|
+
key: 0,
|
|
221
|
+
class: "title-link",
|
|
222
|
+
onClick: F
|
|
223
|
+
}, [
|
|
224
|
+
j(d(e(m)("AGENT_ARRANGE.AS.HOW_TO_GET")) + " ", 1),
|
|
225
|
+
u(e(G), {
|
|
226
|
+
size: "10px",
|
|
227
|
+
color: "var(--el-color-primary)"
|
|
228
|
+
}, {
|
|
229
|
+
default: r(() => [
|
|
230
|
+
u(ve)
|
|
231
|
+
]),
|
|
232
|
+
_: 1
|
|
233
|
+
})
|
|
234
|
+
])) : y("", !0)
|
|
235
|
+
]),
|
|
236
|
+
s("div", Ut, [
|
|
237
|
+
u(e(De), {
|
|
238
|
+
class: "auth-input",
|
|
239
|
+
modelValue: x.value,
|
|
240
|
+
"onUpdate:modelValue": J[0] || (J[0] = (ae) => x.value = ae),
|
|
241
|
+
placeholder: e(m)("AGENT_ARRANGE.AS.API_KEY_TIP"),
|
|
242
|
+
maxlength: "500"
|
|
243
|
+
}, null, 8, ["modelValue", "placeholder"]),
|
|
244
|
+
B.value ? (o(), p("div", Vt, d(B.value), 1)) : y("", !0)
|
|
245
|
+
]),
|
|
246
|
+
s("div", zt, [
|
|
247
|
+
u(e(U), {
|
|
248
|
+
class: "btn-cancel",
|
|
249
|
+
link: "",
|
|
250
|
+
onClick: S
|
|
251
|
+
}, {
|
|
252
|
+
default: r(() => [
|
|
253
|
+
j(d(e(m)("COMMON_BUTTON.CANCEL_TEXT")), 1)
|
|
254
|
+
]),
|
|
255
|
+
_: 1
|
|
256
|
+
}),
|
|
257
|
+
u(e(U), {
|
|
258
|
+
class: "btn-confirm",
|
|
259
|
+
onClick: I,
|
|
260
|
+
type: "primary",
|
|
261
|
+
disabled: !x.value,
|
|
262
|
+
loading: f.value
|
|
263
|
+
}, {
|
|
264
|
+
default: r(() => [
|
|
265
|
+
j(d(e(m)("COMMON_BUTTON.CONFIRM_TEXT")), 1)
|
|
266
|
+
]),
|
|
267
|
+
_: 1
|
|
268
|
+
}, 8, ["disabled", "loading"])
|
|
269
|
+
])
|
|
270
|
+
])
|
|
271
|
+
]),
|
|
272
|
+
_: 1
|
|
273
|
+
}, 8, ["visible"]),
|
|
274
|
+
n.data.original === 1 ? (o(), p("div", Kt, [
|
|
275
|
+
u(e(G), { size: "16px" }, {
|
|
276
|
+
default: r(() => [
|
|
277
|
+
u(ne)
|
|
278
|
+
]),
|
|
279
|
+
_: 1
|
|
280
|
+
}),
|
|
281
|
+
s("span", null, d(e(m)("AGENT_ARRANGE.AS.OFFICIAL")), 1)
|
|
282
|
+
])) : y("", !0)
|
|
283
|
+
])) : y("", !0);
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
}, Ie = /* @__PURE__ */ te(Ft, [["__scopeId", "data-v-ba98e9cc"]]), qt = { class: "action-buttons" }, Ht = {
|
|
287
|
+
key: 0,
|
|
288
|
+
class: "action-btn-wrapper"
|
|
289
|
+
}, Wt = {
|
|
290
|
+
key: 1,
|
|
291
|
+
class: "action-btn-wrapper"
|
|
292
|
+
}, Zt = {
|
|
293
|
+
key: 2,
|
|
294
|
+
class: "action-badge"
|
|
295
|
+
}, Yt = {
|
|
296
|
+
__name: "ActionButtons",
|
|
297
|
+
props: {
|
|
298
|
+
data: {
|
|
299
|
+
type: Object,
|
|
300
|
+
required: !0
|
|
301
|
+
},
|
|
302
|
+
type: {
|
|
303
|
+
type: String,
|
|
304
|
+
required: !0
|
|
305
|
+
},
|
|
306
|
+
needAuth: {
|
|
307
|
+
type: Boolean,
|
|
308
|
+
default: !1
|
|
309
|
+
},
|
|
310
|
+
badge: {
|
|
311
|
+
type: Number,
|
|
312
|
+
default: 0
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
emits: ["add", "remove", "refresh"],
|
|
316
|
+
setup(n, { emit: b }) {
|
|
317
|
+
const { t: m } = ee(), c = n, O = b, h = M(() => c.data.addStatus || (c.badge > 0 ? 1 : 0)), k = () => {
|
|
318
|
+
O("add", c.data);
|
|
319
|
+
}, g = () => {
|
|
320
|
+
O("remove", c.data);
|
|
321
|
+
}, T = () => {
|
|
322
|
+
O("refresh");
|
|
323
|
+
};
|
|
324
|
+
return (x, R) => {
|
|
325
|
+
const f = V("Refresh");
|
|
326
|
+
return o(), p("div", qt, [
|
|
327
|
+
n.type === e(a).mcp ? (o(), p("div", Ht, [
|
|
328
|
+
h.value === 1 ? (o(), v(e(U), {
|
|
329
|
+
key: 0,
|
|
330
|
+
class: "action-btn",
|
|
331
|
+
type: "primary",
|
|
332
|
+
text: "",
|
|
333
|
+
disabled: ""
|
|
334
|
+
}, {
|
|
335
|
+
default: r(() => [
|
|
336
|
+
j(d(e(m)("COMMON_DATA.ADDED")), 1)
|
|
337
|
+
]),
|
|
338
|
+
_: 1
|
|
339
|
+
})) : (o(), v(e(U), {
|
|
340
|
+
key: 1,
|
|
341
|
+
class: "action-btn",
|
|
342
|
+
type: "primary",
|
|
343
|
+
text: "",
|
|
344
|
+
disabled: n.needAuth,
|
|
345
|
+
loading: n.data.addLoading,
|
|
346
|
+
onClick: le(k, ["stop"])
|
|
347
|
+
}, {
|
|
348
|
+
default: r(() => [
|
|
349
|
+
j(d(e(m)("COMMON_DATA.ADD")), 1)
|
|
350
|
+
]),
|
|
351
|
+
_: 1
|
|
352
|
+
}, 8, ["disabled", "loading"])),
|
|
353
|
+
h.value === 1 ? (o(), v(e(U), {
|
|
354
|
+
key: 2,
|
|
355
|
+
class: "action-btn delete-btn",
|
|
356
|
+
type: "danger",
|
|
357
|
+
text: "",
|
|
358
|
+
onClick: le(g, ["stop"])
|
|
359
|
+
}, {
|
|
360
|
+
default: r(() => [
|
|
361
|
+
j(d(e(m)("COMMON_DATA.DELETE")), 1)
|
|
362
|
+
]),
|
|
363
|
+
_: 1
|
|
364
|
+
})) : y("", !0),
|
|
365
|
+
!n.data.originalType && !n.data.mcpTool ? (o(), v(e(U), {
|
|
366
|
+
key: 3,
|
|
367
|
+
class: "action-btn refresh-btn",
|
|
368
|
+
text: "",
|
|
369
|
+
onClick: le(T, ["stop"])
|
|
370
|
+
}, {
|
|
371
|
+
default: r(() => [
|
|
372
|
+
u(e(G), null, {
|
|
373
|
+
default: r(() => [
|
|
374
|
+
u(f)
|
|
375
|
+
]),
|
|
376
|
+
_: 1
|
|
377
|
+
})
|
|
378
|
+
]),
|
|
379
|
+
_: 1
|
|
380
|
+
})) : y("", !0)
|
|
381
|
+
])) : (o(), p("div", Wt, [
|
|
382
|
+
h.value === 1 ? (o(), v(e(U), {
|
|
383
|
+
key: 0,
|
|
384
|
+
class: "action-btn",
|
|
385
|
+
type: "primary",
|
|
386
|
+
text: "",
|
|
387
|
+
disabled: ""
|
|
388
|
+
}, {
|
|
389
|
+
default: r(() => [
|
|
390
|
+
j(d(e(m)("COMMON_DATA.ADDED")), 1)
|
|
391
|
+
]),
|
|
392
|
+
_: 1
|
|
393
|
+
})) : n.needAuth ? (o(), v(e(U), {
|
|
394
|
+
key: 2,
|
|
395
|
+
class: "action-btn",
|
|
396
|
+
type: "primary",
|
|
397
|
+
text: "",
|
|
398
|
+
disabled: ""
|
|
399
|
+
}, {
|
|
400
|
+
default: r(() => [
|
|
401
|
+
j(d(e(m)("AGENT_ARRANGE.AS.UNAUTHORIZED")), 1)
|
|
402
|
+
]),
|
|
403
|
+
_: 1
|
|
404
|
+
})) : (o(), v(e(U), {
|
|
405
|
+
key: 1,
|
|
406
|
+
class: "action-btn",
|
|
407
|
+
type: "primary",
|
|
408
|
+
text: "",
|
|
409
|
+
loading: n.data.addLoading,
|
|
410
|
+
onClick: le(k, ["stop"])
|
|
411
|
+
}, {
|
|
412
|
+
default: r(() => [
|
|
413
|
+
j(d(e(m)("COMMON_DATA.ADD")), 1)
|
|
414
|
+
]),
|
|
415
|
+
_: 1
|
|
416
|
+
}, 8, ["loading"])),
|
|
417
|
+
h.value === 1 ? (o(), v(e(U), {
|
|
418
|
+
key: 3,
|
|
419
|
+
class: "action-btn delete-btn",
|
|
420
|
+
type: "danger",
|
|
421
|
+
text: "",
|
|
422
|
+
onClick: le(g, ["stop"])
|
|
423
|
+
}, {
|
|
424
|
+
default: r(() => [
|
|
425
|
+
j(d(e(m)("COMMON_DATA.DELETE")), 1)
|
|
426
|
+
]),
|
|
427
|
+
_: 1
|
|
428
|
+
})) : y("", !0)
|
|
429
|
+
])),
|
|
430
|
+
n.badge > 0 ? (o(), p("div", Zt, d(n.badge), 1)) : y("", !0)
|
|
431
|
+
]);
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
}, oe = /* @__PURE__ */ te(Yt, [["__scopeId", "data-v-eec99f87"]]), Jt = {
|
|
435
|
+
__name: "ExpandCollapse",
|
|
436
|
+
props: {
|
|
437
|
+
// 图标颜色
|
|
438
|
+
iconColor: {
|
|
439
|
+
type: String,
|
|
440
|
+
default: "#999999"
|
|
441
|
+
},
|
|
442
|
+
isExpanded: {
|
|
443
|
+
type: Boolean,
|
|
444
|
+
default: !1
|
|
445
|
+
},
|
|
446
|
+
pointer: {
|
|
447
|
+
type: [Boolean, Number],
|
|
448
|
+
default: !0
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
emits: [
|
|
452
|
+
"toggle"
|
|
453
|
+
// 切换展开状态
|
|
454
|
+
],
|
|
455
|
+
setup(n, { emit: b }) {
|
|
456
|
+
tt((h) => ({
|
|
457
|
+
v05ca9473: n.pointer ? "pointer" : "not-allowed"
|
|
458
|
+
}));
|
|
459
|
+
const m = n, c = b, O = () => {
|
|
460
|
+
c("toggle", m.data);
|
|
461
|
+
};
|
|
462
|
+
return (h, k) => {
|
|
463
|
+
const g = V("IconZuoCopyCopy"), T = V("IconZuoCopy");
|
|
464
|
+
return o(), p("div", {
|
|
465
|
+
onClick: O,
|
|
466
|
+
class: "expand-collapse"
|
|
467
|
+
}, [
|
|
468
|
+
u(e(G), { color: n.iconColor }, {
|
|
469
|
+
default: r(() => [
|
|
470
|
+
n.isExpanded ? (o(), v(g, { key: 0 })) : (o(), v(T, { key: 1 }))
|
|
471
|
+
]),
|
|
472
|
+
_: 1
|
|
473
|
+
}, 8, ["color"])
|
|
474
|
+
]);
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
}, je = /* @__PURE__ */ te(Jt, [["__scopeId", "data-v-5ba3ea2a"]]);
|
|
478
|
+
function Xt(n, b) {
|
|
479
|
+
return nt() ? (at(n, b), !0) : !1;
|
|
480
|
+
}
|
|
481
|
+
const Qt = typeof window < "u" && typeof document < "u";
|
|
482
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
483
|
+
function en(n) {
|
|
484
|
+
return Array.isArray(n) ? n : [n];
|
|
485
|
+
}
|
|
486
|
+
function tn(n) {
|
|
487
|
+
return Ue();
|
|
488
|
+
}
|
|
489
|
+
function nn(n, b = !0, m) {
|
|
490
|
+
tn() ? he(n, m) : b ? n() : Be(n);
|
|
491
|
+
}
|
|
492
|
+
const qe = Qt ? window : void 0;
|
|
493
|
+
function se(n) {
|
|
494
|
+
var b;
|
|
495
|
+
const m = Ve(n);
|
|
496
|
+
return (b = m?.$el) !== null && b !== void 0 ? b : m;
|
|
497
|
+
}
|
|
498
|
+
// @__NO_SIDE_EFFECTS__
|
|
499
|
+
function an() {
|
|
500
|
+
const n = xe(!1), b = Ue();
|
|
501
|
+
return b && he(() => {
|
|
502
|
+
n.value = !0;
|
|
503
|
+
}, b), n;
|
|
504
|
+
}
|
|
505
|
+
// @__NO_SIDE_EFFECTS__
|
|
506
|
+
function ln(n) {
|
|
507
|
+
const b = /* @__PURE__ */ an();
|
|
508
|
+
return M(() => (b.value, !!n()));
|
|
509
|
+
}
|
|
510
|
+
function on(n, b, m = {}) {
|
|
511
|
+
const { window: c = qe, ...O } = m;
|
|
512
|
+
let h;
|
|
513
|
+
const k = /* @__PURE__ */ ln(() => c && "ResizeObserver" in c), g = () => {
|
|
514
|
+
h && (h.disconnect(), h = void 0);
|
|
515
|
+
}, T = de(M(() => {
|
|
516
|
+
const R = Ve(n);
|
|
517
|
+
return Array.isArray(R) ? R.map((f) => se(f)) : [se(R)];
|
|
518
|
+
}), (R) => {
|
|
519
|
+
if (g(), k.value && c) {
|
|
520
|
+
h = new ResizeObserver(b);
|
|
521
|
+
for (const f of R) f && h.observe(f, O);
|
|
522
|
+
}
|
|
523
|
+
}, {
|
|
524
|
+
immediate: !0,
|
|
525
|
+
flush: "post"
|
|
526
|
+
}), x = () => {
|
|
527
|
+
g(), T();
|
|
528
|
+
};
|
|
529
|
+
return Xt(x), {
|
|
530
|
+
isSupported: k,
|
|
531
|
+
stop: x
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
function sn(n, b = {
|
|
535
|
+
width: 0,
|
|
536
|
+
height: 0
|
|
537
|
+
}, m = {}) {
|
|
538
|
+
const { window: c = qe, box: O = "content-box" } = m, h = M(() => {
|
|
539
|
+
var f;
|
|
540
|
+
return (f = se(n)) === null || f === void 0 || (f = f.namespaceURI) === null || f === void 0 ? void 0 : f.includes("svg");
|
|
541
|
+
}), k = xe(b.width), g = xe(b.height), { stop: T } = on(n, ([f]) => {
|
|
542
|
+
const B = O === "border-box" ? f.borderBoxSize : O === "content-box" ? f.contentBoxSize : f.devicePixelContentBoxSize;
|
|
543
|
+
if (c && h.value) {
|
|
544
|
+
const t = se(n);
|
|
545
|
+
if (t) {
|
|
546
|
+
const A = t.getBoundingClientRect();
|
|
547
|
+
k.value = A.width, g.value = A.height;
|
|
548
|
+
}
|
|
549
|
+
} else if (B) {
|
|
550
|
+
const t = en(B);
|
|
551
|
+
k.value = t.reduce((A, { inlineSize: P }) => A + P, 0), g.value = t.reduce((A, { blockSize: P }) => A + P, 0);
|
|
552
|
+
} else
|
|
553
|
+
k.value = f.contentRect.width, g.value = f.contentRect.height;
|
|
554
|
+
}, m);
|
|
555
|
+
nn(() => {
|
|
556
|
+
const f = se(n);
|
|
557
|
+
f && (k.value = "offsetWidth" in f ? f.offsetWidth : b.width, g.value = "offsetHeight" in f ? f.offsetHeight : b.height);
|
|
558
|
+
});
|
|
559
|
+
const x = de(() => se(n), (f) => {
|
|
560
|
+
k.value = f ? b.width : 0, g.value = f ? b.height : 0;
|
|
561
|
+
});
|
|
562
|
+
function R() {
|
|
563
|
+
T(), x();
|
|
564
|
+
}
|
|
565
|
+
return {
|
|
566
|
+
width: k,
|
|
567
|
+
height: g,
|
|
568
|
+
stop: R
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
const cn = {
|
|
572
|
+
key: 0,
|
|
573
|
+
class: "plugin-card__auth-status"
|
|
574
|
+
}, dn = {
|
|
575
|
+
key: 1,
|
|
576
|
+
class: "plugin-card__selected-length"
|
|
577
|
+
}, rn = ["title"], un = ["title"], pn = { class: "plugin-card__icon-container" }, mn = ["src"], gn = { class: "plugin-card__metadata-item" }, _n = {
|
|
578
|
+
key: 1,
|
|
579
|
+
class: "plugin-card__metadata-item-title"
|
|
580
|
+
}, hn = { class: "plugin-card__metadata-item-content" }, fn = {
|
|
581
|
+
key: 0,
|
|
582
|
+
class: "plugin-card__separator"
|
|
583
|
+
}, vn = {
|
|
584
|
+
key: 1,
|
|
585
|
+
class: "plugin-card__metadata-item"
|
|
586
|
+
}, yn = {
|
|
587
|
+
key: 0,
|
|
588
|
+
class: "plugin-card__metadata-item-title"
|
|
589
|
+
}, bn = { class: "plugin-card__metadata-item-content" }, kn = {
|
|
590
|
+
key: 2,
|
|
591
|
+
class: "plugin-card__separator"
|
|
592
|
+
}, An = { class: "plugin-card__metadata-item" }, Nn = {
|
|
593
|
+
key: 0,
|
|
594
|
+
class: "plugin-card__metadata-item-title"
|
|
595
|
+
}, wn = { class: "plugin-card__metadata-item-content" }, On = { class: "plugin-card__action-bar" }, Cn = {
|
|
596
|
+
__name: "PluginCard",
|
|
597
|
+
props: {
|
|
598
|
+
data: {
|
|
599
|
+
type: Object,
|
|
600
|
+
required: !0
|
|
601
|
+
},
|
|
602
|
+
currentIndex: {
|
|
603
|
+
type: String,
|
|
604
|
+
default: ""
|
|
605
|
+
},
|
|
606
|
+
activeId: {
|
|
607
|
+
type: String,
|
|
608
|
+
default: ""
|
|
609
|
+
},
|
|
610
|
+
pluginNodeNumObj: {
|
|
611
|
+
type: Object,
|
|
612
|
+
default: () => ({})
|
|
613
|
+
},
|
|
614
|
+
// 是否是可操作的卡片
|
|
615
|
+
isOperableCard: {
|
|
616
|
+
type: Boolean,
|
|
617
|
+
default: !0
|
|
618
|
+
},
|
|
619
|
+
agentNodeNumObj: {
|
|
620
|
+
type: Object,
|
|
621
|
+
default: () => ({})
|
|
622
|
+
},
|
|
623
|
+
workflowNodeNumObj: {
|
|
624
|
+
type: Object,
|
|
625
|
+
default: () => ({})
|
|
626
|
+
}
|
|
627
|
+
},
|
|
628
|
+
emits: ["select", "update-success", "view-detail", "add", "remove"],
|
|
629
|
+
setup(n, { emit: b }) {
|
|
630
|
+
const { t: m } = ee();
|
|
631
|
+
xt(), Fe();
|
|
632
|
+
const c = n, O = b, h = (w) => typeof w == "string" && (w.includes("http") || w.includes("https") || w.includes(".png") || w.includes(".jpg") || w.includes(".jpeg") || w.includes(".gif") || w.includes(".bmp") || w.includes(".webp")), k = M(() => {
|
|
633
|
+
if (![a.plugin, a.mcp].includes(c.currentIndex) || c.currentIndex === a.plugin && !c.data.needApiKey)
|
|
634
|
+
return !0;
|
|
635
|
+
const w = {
|
|
636
|
+
[a.plugin]: "apiKey",
|
|
637
|
+
[a.mcp]: "keyBnid"
|
|
638
|
+
};
|
|
639
|
+
return !!c.data[w[c.currentIndex]];
|
|
640
|
+
}), g = M(() => c.data.children?.filter((w) => w.addStatus == 1).length || 0), T = K(!1), x = M(() => c.data.bnid === c.activeId), R = M(() => {
|
|
641
|
+
if (!c.data.updatedAt) return "";
|
|
642
|
+
const w = new Date(c.data.updatedAt), N = w.getFullYear(), W = String(w.getMonth() + 1).padStart(2, "0"), C = String(w.getDate()).padStart(2, "0");
|
|
643
|
+
return `${N}.${W}.${C}`;
|
|
644
|
+
}), f = M(() => c.currentIndex === a.plugin ? c.data?.avatarUrl || c.data?.icon || "Plugin" : c.currentIndex === a.agent ? c.data?.avatarUrl || c.data?.icon || c.data?.type === 1 ? "Agent" : "WorkflowIcon3" : c.data?.icon || c.data?.avatarUrl || "Workflow"), B = () => {
|
|
645
|
+
const { origin: w } = location, N = "undefined/";
|
|
646
|
+
if (c.currentIndex === a.agent) {
|
|
647
|
+
const { type: W, bnid: C, workflowBnid: S } = c.data;
|
|
648
|
+
W === 1 ? window.open(`${w + N}agent-detail/${C}`) : W === 3 && (S && C ? window.open(`${w + N}chatflow/${S}/${C}`) : ElMessage.info(m("AGENT_ARRANGE.PC.NO_SUPPORT_MSG")));
|
|
649
|
+
} else c.currentIndex === a.workflow && window.open(`${w + N}workflow/${c.data.bnid}`);
|
|
650
|
+
}, t = (w, N) => {
|
|
651
|
+
O("add", w, N);
|
|
652
|
+
}, A = (w) => {
|
|
653
|
+
O("remove", w);
|
|
654
|
+
}, P = () => {
|
|
655
|
+
[a.workflow, a.agent].includes(c.currentIndex) && (T.value = !0);
|
|
656
|
+
}, z = () => {
|
|
657
|
+
T.value = !1;
|
|
658
|
+
};
|
|
659
|
+
return (w, N) => {
|
|
660
|
+
const W = V("CreateBy"), C = V("AiboxIcon"), S = V("IconPorn"), I = V("CreateTime");
|
|
661
|
+
return o(), p("div", {
|
|
662
|
+
class: q(["plugin-card", { active: x.value, "show-card-shadow": n.isOperableCard }]),
|
|
663
|
+
style: _e({ cursor: n.isOperableCard ? "pointer" : "default" }),
|
|
664
|
+
onClick: N[0] || (N[0] = (F) => w.$emit("select", n.data)),
|
|
665
|
+
onMouseenter: P,
|
|
666
|
+
onMouseleave: z
|
|
667
|
+
}, [
|
|
668
|
+
!k.value && [e(a).plugin].includes(n.currentIndex) && n.isOperableCard ? (o(), p("div", cn, d(e(m)("AGENT_ARRANGE.PC.AUTHORIZE")), 1)) : y("", !0),
|
|
669
|
+
g.value > 0 && [e(a).plugin, e(a).mcp].includes(n.currentIndex) && n.isOperableCard ? (o(), p("div", dn, d(g.value), 1)) : y("", !0),
|
|
670
|
+
s("div", {
|
|
671
|
+
class: q(["plugin-card__title", { unAuthorized: !k.value }]),
|
|
672
|
+
title: n.data.name
|
|
673
|
+
}, d(n.data.title || n.data.name), 11, rn),
|
|
674
|
+
s("div", {
|
|
675
|
+
class: q(["plugin-card__description", { unAuthorized: !k.value }]),
|
|
676
|
+
title: n.data.description
|
|
677
|
+
}, d(n.data.description || e(m)("AGENT_ARRANGE.PC.NO_DESC")), 11, un),
|
|
678
|
+
s("div", {
|
|
679
|
+
class: "plugin-card__icon-wrapper",
|
|
680
|
+
style: _e({ marginBottom: n.isOperableCard ? "0" : "20px" })
|
|
681
|
+
}, [
|
|
682
|
+
N[1] || (N[1] = s("div", { class: "plugin-card__icon-bg plugin-card__icon-bg--left" }, null, -1)),
|
|
683
|
+
N[2] || (N[2] = s("div", { class: "plugin-card__icon-bg plugin-card__icon-bg--right" }, null, -1)),
|
|
684
|
+
s("div", pn, [
|
|
685
|
+
h(f.value) ? (o(), p("img", {
|
|
686
|
+
key: 0,
|
|
687
|
+
src: f.value,
|
|
688
|
+
class: "plugin-card__avatar"
|
|
689
|
+
}, null, 8, mn)) : (o(), v(e(G), {
|
|
690
|
+
key: 1,
|
|
691
|
+
size: 72,
|
|
692
|
+
class: "plugin-card__avatar"
|
|
693
|
+
}, {
|
|
694
|
+
default: r(() => [
|
|
695
|
+
(o(), v(Te(f.value)))
|
|
696
|
+
]),
|
|
697
|
+
_: 1
|
|
698
|
+
}))
|
|
699
|
+
])
|
|
700
|
+
], 4),
|
|
701
|
+
s("div", {
|
|
702
|
+
class: q(["plugin-card__metadata", { isShowCard: !n.isOperableCard }])
|
|
703
|
+
}, [
|
|
704
|
+
s("div", gn, [
|
|
705
|
+
n.isOperableCard ? y("", !0) : (o(), v(e(G), {
|
|
706
|
+
key: 0,
|
|
707
|
+
size: 13
|
|
708
|
+
}, {
|
|
709
|
+
default: r(() => [
|
|
710
|
+
u(W)
|
|
711
|
+
]),
|
|
712
|
+
_: 1
|
|
713
|
+
})),
|
|
714
|
+
n.isOperableCard ? y("", !0) : (o(), p("span", _n, d(e(m)("AGENT_ARRANGE.PC.CREATOR")), 1)),
|
|
715
|
+
u(e(G), { size: 18 }, {
|
|
716
|
+
default: r(() => [
|
|
717
|
+
u(C)
|
|
718
|
+
]),
|
|
719
|
+
_: 1
|
|
720
|
+
}),
|
|
721
|
+
s("span", hn, d(e(m)("HOME_TIPS.SHORT_TITLE_LIST.TITLE_3")), 1)
|
|
722
|
+
]),
|
|
723
|
+
n.isOperableCard ? y("", !0) : (o(), p("span", fn, "|")),
|
|
724
|
+
[e(a).plugin, e(a).mcp].includes(n.currentIndex) ? (o(), p("div", vn, [
|
|
725
|
+
u(e(G), { size: 5 }, {
|
|
726
|
+
default: r(() => [
|
|
727
|
+
u(S)
|
|
728
|
+
]),
|
|
729
|
+
_: 1
|
|
730
|
+
}),
|
|
731
|
+
n.isOperableCard ? y("", !0) : (o(), p("span", yn, d(e(m)("AGENT_ARRANGE.PC.TOOL")), 1)),
|
|
732
|
+
s("span", bn, d(n.data.num || n.data.children?.length || 0) + "个", 1)
|
|
733
|
+
])) : y("", !0),
|
|
734
|
+
!n.isOperableCard && n.data.updatedAt ? (o(), p("span", kn, "|")) : y("", !0),
|
|
735
|
+
s("div", An, [
|
|
736
|
+
u(e(G), { size: 13 }, {
|
|
737
|
+
default: r(() => [
|
|
738
|
+
u(I)
|
|
739
|
+
]),
|
|
740
|
+
_: 1
|
|
741
|
+
}),
|
|
742
|
+
n.isOperableCard ? y("", !0) : (o(), p("span", Nn, d(e(m)("AGENT_ARRANGE.PC.UPDATE_TIME")), 1)),
|
|
743
|
+
s("span", wn, d(R.value || "2025.05.21"), 1)
|
|
744
|
+
])
|
|
745
|
+
], 2),
|
|
746
|
+
u(lt, { name: "action-bar" }, {
|
|
747
|
+
default: r(() => [
|
|
748
|
+
ze(s("div", On, [
|
|
749
|
+
u(e(U), {
|
|
750
|
+
type: "primary",
|
|
751
|
+
size: "small",
|
|
752
|
+
onClick: le(B, ["stop"])
|
|
753
|
+
}, {
|
|
754
|
+
default: r(() => [
|
|
755
|
+
j(d(e(m)("AGENT_ARRANGE.PC.VIEW_DETAIL")), 1)
|
|
756
|
+
]),
|
|
757
|
+
_: 1
|
|
758
|
+
}),
|
|
759
|
+
u(oe, {
|
|
760
|
+
data: n.data,
|
|
761
|
+
type: n.currentIndex,
|
|
762
|
+
badge: [e(a).agent].includes(n.currentIndex) ? n.agentNodeNumObj[n.data.bnid] : [e(a).workflow].includes(n.currentIndex) ? n.workflowNodeNumObj[n.data.bnid] : 0,
|
|
763
|
+
onAdd: t,
|
|
764
|
+
onRemove: A
|
|
765
|
+
}, null, 8, ["data", "type", "badge"])
|
|
766
|
+
], 512), [
|
|
767
|
+
[
|
|
768
|
+
ot,
|
|
769
|
+
[e(a).workflow, e(a).agent].includes(
|
|
770
|
+
n.currentIndex
|
|
771
|
+
) && T.value
|
|
772
|
+
]
|
|
773
|
+
])
|
|
774
|
+
]),
|
|
775
|
+
_: 1
|
|
776
|
+
})
|
|
777
|
+
], 38);
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
}, He = /* @__PURE__ */ te(Cn, [["__scopeId", "data-v-73cb924b"]]), xn = { class: "plugin-card-grid-wrapper" }, Dn = {
|
|
781
|
+
__name: "PluginCardGrid",
|
|
782
|
+
props: {
|
|
783
|
+
data: {
|
|
784
|
+
type: Array,
|
|
785
|
+
default: () => []
|
|
786
|
+
},
|
|
787
|
+
currentIndex: {
|
|
788
|
+
type: String,
|
|
789
|
+
default: ""
|
|
790
|
+
},
|
|
791
|
+
activeId: {
|
|
792
|
+
type: String,
|
|
793
|
+
default: ""
|
|
794
|
+
},
|
|
795
|
+
layout: {
|
|
796
|
+
type: String,
|
|
797
|
+
default: "grid",
|
|
798
|
+
// 'grid' | 'column'
|
|
799
|
+
validator: (n) => ["grid", "column"].includes(n)
|
|
800
|
+
},
|
|
801
|
+
agentNodeNumObj: {
|
|
802
|
+
type: Object,
|
|
803
|
+
default: () => ({})
|
|
804
|
+
},
|
|
805
|
+
workflowNodeNumObj: {
|
|
806
|
+
type: Object,
|
|
807
|
+
default: () => ({})
|
|
808
|
+
}
|
|
809
|
+
},
|
|
810
|
+
emits: ["select", "update-success", "add", "remove"],
|
|
811
|
+
setup(n, { emit: b }) {
|
|
812
|
+
const { t: m } = ee(), c = n, O = b, h = K(null), k = K(0), { width: g } = sn(h), T = M(() => c.layout === "column" ? "plugin-card-grid--column" : "plugin-card-grid--grid"), x = M(() => {
|
|
813
|
+
if (c.layout === "column") return 1;
|
|
814
|
+
const C = 300, S = 20;
|
|
815
|
+
return Math.max(1, Math.floor((g.value + S) / (C + S)));
|
|
816
|
+
}), R = M(() => {
|
|
817
|
+
if (!c.data.length) return [];
|
|
818
|
+
const C = x.value, S = [];
|
|
819
|
+
for (let I = 0; I < c.data.length; I += C)
|
|
820
|
+
S.push(c.data.slice(I, I + C));
|
|
821
|
+
return S;
|
|
822
|
+
}), f = K(230), B = M(() => {
|
|
823
|
+
const C = h.value;
|
|
824
|
+
if (!C) return { start: 0, end: 0 };
|
|
825
|
+
const S = C.clientHeight, I = Math.floor(k.value / f.value), F = Math.ceil(S / f.value), Z = 2;
|
|
826
|
+
return {
|
|
827
|
+
start: Math.max(0, I - Z),
|
|
828
|
+
end: Math.min(R.value.length, I + F + Z)
|
|
829
|
+
};
|
|
830
|
+
}), t = M(() => {
|
|
831
|
+
const { start: C, end: S } = B.value, I = [];
|
|
832
|
+
for (let F = C; F < S; F++)
|
|
833
|
+
I.push({
|
|
834
|
+
index: F,
|
|
835
|
+
data: R.value[F]
|
|
836
|
+
});
|
|
837
|
+
return I;
|
|
838
|
+
}), A = M(() => R.value.length * f.value), P = (C) => {
|
|
839
|
+
k.value = C.target.scrollTop;
|
|
840
|
+
};
|
|
841
|
+
de([() => c.layout, g], () => {
|
|
842
|
+
h.value && (h.value.scrollTop = 0, k.value = 0);
|
|
843
|
+
});
|
|
844
|
+
const z = (C) => {
|
|
845
|
+
O("select", C);
|
|
846
|
+
}, w = () => {
|
|
847
|
+
O("update-success");
|
|
848
|
+
}, N = (C, S) => {
|
|
849
|
+
O("add", C, S);
|
|
850
|
+
}, W = (C) => {
|
|
851
|
+
O("remove", C);
|
|
852
|
+
};
|
|
853
|
+
return (C, S) => (o(), p("div", xn, [
|
|
854
|
+
n.data.length ? (o(), p("div", {
|
|
855
|
+
key: 0,
|
|
856
|
+
ref_key: "containerRef",
|
|
857
|
+
ref: h,
|
|
858
|
+
class: q(["plugin-card-grid", T.value]),
|
|
859
|
+
onScroll: P
|
|
860
|
+
}, [
|
|
861
|
+
s("div", {
|
|
862
|
+
style: _e({ height: `${A.value}px` })
|
|
863
|
+
}, [
|
|
864
|
+
(o(!0), p(H, null, ie(t.value, (I, F) => (o(), p("div", {
|
|
865
|
+
key: F,
|
|
866
|
+
class: q(["virtual-row", T.value]),
|
|
867
|
+
style: _e({ transform: `translateY(${I.index * f.value}px)` })
|
|
868
|
+
}, [
|
|
869
|
+
(o(!0), p(H, null, ie(I.data, (Z) => (o(), v(He, {
|
|
870
|
+
key: Z.bnid,
|
|
871
|
+
data: Z,
|
|
872
|
+
"current-index": n.currentIndex,
|
|
873
|
+
"active-id": n.activeId,
|
|
874
|
+
agentNodeNumObj: n.agentNodeNumObj,
|
|
875
|
+
workflowNodeNumObj: n.workflowNodeNumObj,
|
|
876
|
+
onSelect: z,
|
|
877
|
+
onUpdateSuccess: w,
|
|
878
|
+
onAdd: N,
|
|
879
|
+
onRemove: W
|
|
880
|
+
}, null, 8, ["data", "current-index", "active-id", "agentNodeNumObj", "workflowNodeNumObj"]))), 128))
|
|
881
|
+
], 6))), 128))
|
|
882
|
+
], 4)
|
|
883
|
+
], 34)) : (o(), v(e(Ee), {
|
|
884
|
+
key: 1,
|
|
885
|
+
description: e(m)("COMMON_DATA.EMPTY"),
|
|
886
|
+
"image-size": 60,
|
|
887
|
+
class: "custom-empty"
|
|
888
|
+
}, null, 8, ["description"]))
|
|
889
|
+
]));
|
|
890
|
+
}
|
|
891
|
+
}, Pe = /* @__PURE__ */ te(Dn, [["__scopeId", "data-v-1a5fa8b2"]]), In = { class: "card-mode-container" }, Tn = {
|
|
892
|
+
key: 0,
|
|
893
|
+
class: "card-list-container"
|
|
894
|
+
}, En = {
|
|
895
|
+
key: 1,
|
|
896
|
+
class: "card-detail-container"
|
|
897
|
+
}, Rn = { class: "card-detail-header" }, Sn = { class: "card-detail-wrapper" }, $n = { class: "card-detail-left" }, Mn = { class: "plugin-tools-section" }, Gn = { class: "plugin-tools-section__title" }, jn = {
|
|
898
|
+
key: 0,
|
|
899
|
+
class: "plugin-tools-list"
|
|
900
|
+
}, Pn = { class: "plugin-tool-item__left" }, Ln = { class: "plugin-tool-item__name" }, Bn = ["title"], Un = ["title"], Vn = { class: "plugin-tool-item__right" }, zn = { class: "card-detail-right" }, Kn = { class: "plugin-list-sidebar" }, Fn = {
|
|
901
|
+
__name: "CardModeContainer",
|
|
902
|
+
props: {
|
|
903
|
+
data: {
|
|
904
|
+
type: Array,
|
|
905
|
+
default: () => []
|
|
906
|
+
},
|
|
907
|
+
currentIndex: {
|
|
908
|
+
type: String,
|
|
909
|
+
default: ""
|
|
910
|
+
},
|
|
911
|
+
pluginNodeNumObj: {
|
|
912
|
+
type: Object,
|
|
913
|
+
default: () => ({})
|
|
914
|
+
},
|
|
915
|
+
MCPNodeNumObj: {
|
|
916
|
+
type: Object,
|
|
917
|
+
default: () => ({})
|
|
918
|
+
},
|
|
919
|
+
agentNodeNumObj: {
|
|
920
|
+
type: Object,
|
|
921
|
+
default: () => ({})
|
|
922
|
+
},
|
|
923
|
+
workflowNodeNumObj: {
|
|
924
|
+
type: Object,
|
|
925
|
+
default: () => ({})
|
|
926
|
+
}
|
|
927
|
+
},
|
|
928
|
+
emits: ["add", "remove", "update-success", "update:show-card-detail"],
|
|
929
|
+
setup(n, { emit: b }) {
|
|
930
|
+
const { t: m } = ee(), c = n, O = b, h = K(!1), k = K(null), g = (A) => {
|
|
931
|
+
[a.plugin, a.mcp].includes(c.currentIndex) && (k.value = A, h.value = !0);
|
|
932
|
+
}, T = () => {
|
|
933
|
+
h.value = !1, k.value = null;
|
|
934
|
+
};
|
|
935
|
+
de(
|
|
936
|
+
() => h.value,
|
|
937
|
+
(A) => {
|
|
938
|
+
O("update:show-card-detail", A);
|
|
939
|
+
}
|
|
940
|
+
);
|
|
941
|
+
const x = (A) => {
|
|
942
|
+
k.value = A;
|
|
943
|
+
}, R = (A) => Array.isArray(A) ? A.map((P) => {
|
|
944
|
+
const z = R(P.children);
|
|
945
|
+
return P.extendDisplay || P["extend-display"] || z && z.length > 0 ? {
|
|
946
|
+
...P,
|
|
947
|
+
children: z
|
|
948
|
+
} : null;
|
|
949
|
+
}).filter(Boolean) : [], f = (A, P) => {
|
|
950
|
+
O("add", A, P);
|
|
951
|
+
}, B = (A) => {
|
|
952
|
+
O("remove", A);
|
|
953
|
+
}, t = () => {
|
|
954
|
+
O("update-success");
|
|
955
|
+
};
|
|
956
|
+
return (A, P) => {
|
|
957
|
+
const z = V("IconZuo"), w = V("Tip");
|
|
958
|
+
return o(), p("div", In, [
|
|
959
|
+
h.value ? (o(), p("div", En, [
|
|
960
|
+
s("div", Rn, [
|
|
961
|
+
u(e(U), {
|
|
962
|
+
type: "text",
|
|
963
|
+
class: "back-button",
|
|
964
|
+
onClick: T
|
|
965
|
+
}, {
|
|
966
|
+
default: r(() => [
|
|
967
|
+
u(e(G), { size: 16 }, {
|
|
968
|
+
default: r(() => [
|
|
969
|
+
u(z)
|
|
970
|
+
]),
|
|
971
|
+
_: 1
|
|
972
|
+
}),
|
|
973
|
+
s("span", null, d(k.value.name), 1)
|
|
974
|
+
]),
|
|
975
|
+
_: 1
|
|
976
|
+
})
|
|
977
|
+
]),
|
|
978
|
+
s("div", Sn, [
|
|
979
|
+
s("div", $n, [
|
|
980
|
+
u(He, {
|
|
981
|
+
data: k.value,
|
|
982
|
+
"current-index": n.currentIndex,
|
|
983
|
+
isOperableCard: !1
|
|
984
|
+
}, null, 8, ["data", "current-index"]),
|
|
985
|
+
s("div", Mn, [
|
|
986
|
+
s("div", Gn, [
|
|
987
|
+
j(d(e(m)("AGENT_ARRANGE.CMC.TOOL")) + " ", 1),
|
|
988
|
+
n.currentIndex === e(a).plugin && k.value.needApiKey ? (o(), v(Ie, {
|
|
989
|
+
key: 0,
|
|
990
|
+
data: k.value,
|
|
991
|
+
type: n.currentIndex,
|
|
992
|
+
onUpdateSuccess: t
|
|
993
|
+
}, null, 8, ["data", "type"])) : y("", !0)
|
|
994
|
+
]),
|
|
995
|
+
k.value.children && k.value.children.length ? (o(), p("div", jn, [
|
|
996
|
+
(o(!0), p(H, null, ie(k.value.children, (N) => (o(), p("div", {
|
|
997
|
+
key: N.bnid,
|
|
998
|
+
class: "plugin-tool-item"
|
|
999
|
+
}, [
|
|
1000
|
+
s("div", Pn, [
|
|
1001
|
+
s("div", Ln, [
|
|
1002
|
+
s("span", {
|
|
1003
|
+
title: N.interfaceName
|
|
1004
|
+
}, d(N.interfaceName), 9, Bn),
|
|
1005
|
+
N.paramsOuter && R(JSON.parse(N.paramsOuter)).length ? (o(), v(e(ce), {
|
|
1006
|
+
key: 0,
|
|
1007
|
+
placement: "right",
|
|
1008
|
+
width: N.paramsOuter ? 380 : 150,
|
|
1009
|
+
"popper-class": "add-dialog-popover",
|
|
1010
|
+
trigger: "hover"
|
|
1011
|
+
}, {
|
|
1012
|
+
reference: r(() => [
|
|
1013
|
+
u(e(G), {
|
|
1014
|
+
size: 13,
|
|
1015
|
+
style: { cursor: "pointer", "margin-left": "3px" }
|
|
1016
|
+
}, {
|
|
1017
|
+
default: r(() => [
|
|
1018
|
+
u(w, { color: "#999999" })
|
|
1019
|
+
]),
|
|
1020
|
+
_: 1
|
|
1021
|
+
})
|
|
1022
|
+
]),
|
|
1023
|
+
default: r(() => [
|
|
1024
|
+
u(ue, {
|
|
1025
|
+
data: R(JSON.parse(N.paramsOuter))
|
|
1026
|
+
}, null, 8, ["data"])
|
|
1027
|
+
]),
|
|
1028
|
+
_: 2
|
|
1029
|
+
}, 1032, ["width"])) : y("", !0)
|
|
1030
|
+
]),
|
|
1031
|
+
s("div", {
|
|
1032
|
+
class: "plugin-tool-item__description",
|
|
1033
|
+
title: N.description
|
|
1034
|
+
}, d(N.description || "-"), 9, Un)
|
|
1035
|
+
]),
|
|
1036
|
+
s("div", Vn, [
|
|
1037
|
+
n.currentIndex === e(a).plugin ? (o(), v(oe, {
|
|
1038
|
+
key: 0,
|
|
1039
|
+
data: N,
|
|
1040
|
+
type: n.currentIndex,
|
|
1041
|
+
"need-auth": !N.apiKey && N.needApiKey,
|
|
1042
|
+
badge: n.pluginNodeNumObj[N.bnid],
|
|
1043
|
+
onAdd: f,
|
|
1044
|
+
onRemove: B
|
|
1045
|
+
}, null, 8, ["data", "type", "need-auth", "badge"])) : y("", !0),
|
|
1046
|
+
n.currentIndex === e(a).mcp ? (o(), v(oe, {
|
|
1047
|
+
key: 1,
|
|
1048
|
+
data: N,
|
|
1049
|
+
type: n.currentIndex,
|
|
1050
|
+
"need-auth": !N.apiKey && N.state != 1,
|
|
1051
|
+
badge: n.MCPNodeNumObj[N.bnid],
|
|
1052
|
+
onAdd: f,
|
|
1053
|
+
onRemove: B
|
|
1054
|
+
}, null, 8, ["data", "type", "need-auth", "badge"])) : y("", !0)
|
|
1055
|
+
])
|
|
1056
|
+
]))), 128))
|
|
1057
|
+
])) : (o(), v(e(Ee), {
|
|
1058
|
+
key: 1,
|
|
1059
|
+
description: e(m)("AGENT_ARRANGE.CMC.NO_TOOL"),
|
|
1060
|
+
"image-size": 60,
|
|
1061
|
+
class: "custom-empty-small"
|
|
1062
|
+
}, null, 8, ["description"]))
|
|
1063
|
+
])
|
|
1064
|
+
]),
|
|
1065
|
+
s("div", zn, [
|
|
1066
|
+
s("div", Kn, [
|
|
1067
|
+
u(Pe, {
|
|
1068
|
+
data: n.data,
|
|
1069
|
+
"active-id": k.value.bnid,
|
|
1070
|
+
"current-index": n.currentIndex,
|
|
1071
|
+
layout: "column",
|
|
1072
|
+
onSelect: x
|
|
1073
|
+
}, null, 8, ["data", "active-id", "current-index"])
|
|
1074
|
+
])
|
|
1075
|
+
])
|
|
1076
|
+
])
|
|
1077
|
+
])) : (o(), p("div", Tn, [
|
|
1078
|
+
u(Pe, {
|
|
1079
|
+
data: n.data,
|
|
1080
|
+
"current-index": n.currentIndex,
|
|
1081
|
+
agentNodeNumObj: n.agentNodeNumObj,
|
|
1082
|
+
workflowNodeNumObj: n.workflowNodeNumObj,
|
|
1083
|
+
layout: "grid",
|
|
1084
|
+
onSelect: g,
|
|
1085
|
+
onUpdateSuccess: t,
|
|
1086
|
+
onAdd: f,
|
|
1087
|
+
onRemove: B
|
|
1088
|
+
}, null, 8, ["data", "current-index", "agentNodeNumObj", "workflowNodeNumObj"])
|
|
1089
|
+
]))
|
|
1090
|
+
]);
|
|
1091
|
+
};
|
|
1092
|
+
}
|
|
1093
|
+
}, qn = /* @__PURE__ */ te(Fn, [["__scopeId", "data-v-ce19f251"]]), Hn = { class: "view-toggle" }, Wn = { key: 1 }, Zn = {
|
|
1094
|
+
__name: "ViewToggle",
|
|
1095
|
+
props: {
|
|
1096
|
+
modelValue: {
|
|
1097
|
+
type: [String, Number],
|
|
1098
|
+
required: !0
|
|
1099
|
+
},
|
|
1100
|
+
options: {
|
|
1101
|
+
type: Array,
|
|
1102
|
+
required: !0
|
|
1103
|
+
}
|
|
1104
|
+
},
|
|
1105
|
+
emits: ["update:modelValue", "change"],
|
|
1106
|
+
setup(n, { emit: b }) {
|
|
1107
|
+
const m = n, c = b, O = (h) => {
|
|
1108
|
+
c("update:modelValue", h.key), c("change", h);
|
|
1109
|
+
};
|
|
1110
|
+
return he(() => {
|
|
1111
|
+
console.log(m.options);
|
|
1112
|
+
}), (h, k) => (o(), p("div", Hn, [
|
|
1113
|
+
(o(!0), p(H, null, ie(n.options, (g) => (o(), v(e(U), {
|
|
1114
|
+
key: g.key,
|
|
1115
|
+
class: q([{ active: n.modelValue === g.key }, "toggle-btn"]),
|
|
1116
|
+
onClick: (T) => O(g)
|
|
1117
|
+
}, {
|
|
1118
|
+
default: r(() => [
|
|
1119
|
+
g.icon ? (o(), v(e(G), {
|
|
1120
|
+
key: 0,
|
|
1121
|
+
size: 16
|
|
1122
|
+
}, {
|
|
1123
|
+
default: r(() => [
|
|
1124
|
+
(o(), v(Te(g.icon)))
|
|
1125
|
+
]),
|
|
1126
|
+
_: 2
|
|
1127
|
+
}, 1024)) : y("", !0),
|
|
1128
|
+
g.label ? (o(), p("span", Wn, d(g.label), 1)) : y("", !0)
|
|
1129
|
+
]),
|
|
1130
|
+
_: 2
|
|
1131
|
+
}, 1032, ["class", "onClick"]))), 128))
|
|
1132
|
+
]));
|
|
1133
|
+
}
|
|
1134
|
+
}, Ce = /* @__PURE__ */ te(Zn, [["__scopeId", "data-v-df86bef7"]]), Yn = { class: "plugin-input-variable" }, Jn = { class: "plugin-input-variable__title" }, Xn = { class: "plugin-input-variable__item-title" }, Qn = {
|
|
1135
|
+
__name: "PluginInputVariable",
|
|
1136
|
+
props: {
|
|
1137
|
+
data: {
|
|
1138
|
+
type: Object,
|
|
1139
|
+
default: () => {
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
},
|
|
1143
|
+
setup(n) {
|
|
1144
|
+
const { t: b } = ee(), m = n, c = M(() => m.data ? [
|
|
1145
|
+
{
|
|
1146
|
+
name: "path",
|
|
1147
|
+
list: m.data.path || []
|
|
1148
|
+
},
|
|
1149
|
+
{
|
|
1150
|
+
name: "query",
|
|
1151
|
+
list: m.data.query || []
|
|
1152
|
+
},
|
|
1153
|
+
{
|
|
1154
|
+
name: "header",
|
|
1155
|
+
list: m.data.header || []
|
|
1156
|
+
},
|
|
1157
|
+
{
|
|
1158
|
+
name: "body",
|
|
1159
|
+
list: m.data.body || []
|
|
1160
|
+
}
|
|
1161
|
+
].filter((h) => h.list.length > 0) : []);
|
|
1162
|
+
return (O, h) => {
|
|
1163
|
+
const k = V("IconTip");
|
|
1164
|
+
return c.value.length ? (o(), v(e(ce), {
|
|
1165
|
+
key: 0,
|
|
1166
|
+
placement: "right",
|
|
1167
|
+
width: 380,
|
|
1168
|
+
"popper-class": "add-dialog-popover",
|
|
1169
|
+
trigger: "hover"
|
|
1170
|
+
}, {
|
|
1171
|
+
reference: r(() => [
|
|
1172
|
+
u(e(G), {
|
|
1173
|
+
size: 13,
|
|
1174
|
+
color: "#999999",
|
|
1175
|
+
style: { cursor: "pointer", "margin-left": "3px" }
|
|
1176
|
+
}, {
|
|
1177
|
+
default: r(() => [
|
|
1178
|
+
u(k)
|
|
1179
|
+
]),
|
|
1180
|
+
_: 1
|
|
1181
|
+
})
|
|
1182
|
+
]),
|
|
1183
|
+
default: r(() => [
|
|
1184
|
+
s("div", Yn, [
|
|
1185
|
+
s("h4", Jn, d(e(b)("AGENT_ARRANGE.IV.INPUT_PARAMS")), 1),
|
|
1186
|
+
(o(!0), p(H, null, ie(c.value, (g) => (o(), p("div", {
|
|
1187
|
+
key: g.name,
|
|
1188
|
+
class: "plugin-input-variable__item"
|
|
1189
|
+
}, [
|
|
1190
|
+
s("h5", Xn, d(g.name), 1),
|
|
1191
|
+
u(ue, {
|
|
1192
|
+
data: g.list,
|
|
1193
|
+
showTitle: !1
|
|
1194
|
+
}, null, 8, ["data"])
|
|
1195
|
+
]))), 128))
|
|
1196
|
+
])
|
|
1197
|
+
]),
|
|
1198
|
+
_: 1
|
|
1199
|
+
})) : y("", !0);
|
|
1200
|
+
};
|
|
1201
|
+
}
|
|
1202
|
+
}, ea = /* @__PURE__ */ te(Qn, [["__scopeId", "data-v-6b59c90b"]]), ta = { class: "custom-add-dialog__content" }, na = {
|
|
1203
|
+
key: 0,
|
|
1204
|
+
class: "custom-add-dialog__left"
|
|
1205
|
+
}, aa = { class: "custom-add-dialog__left--title" }, la = { class: "custom-add-dialog__left--search" }, oa = ["onClick"], ia = ["onClick"], sa = {
|
|
1206
|
+
key: 0,
|
|
1207
|
+
class: "custom-add-dialog__right--title"
|
|
1208
|
+
}, ca = {
|
|
1209
|
+
key: 2,
|
|
1210
|
+
class: "custom-add-dialog__right__document"
|
|
1211
|
+
}, da = { class: "document__number" }, ra = { class: "custom-add-dialog__right__document--button" }, ua = { style: { flex: "1", height: "0" } }, pa = { class: "custom-add-dialog__right--icon overflow-hidden flex-1" }, ma = ["src"], ga = { class: "custom-add-dialog__right--text" }, _a = ["title"], ha = {
|
|
1212
|
+
key: 0,
|
|
1213
|
+
class: "custom-add-dialog__right--file"
|
|
1214
|
+
}, fa = ["title"], va = {
|
|
1215
|
+
key: 1,
|
|
1216
|
+
class: "custom-add-dialog__right--name plugin-style w-full overflow-hidden"
|
|
1217
|
+
}, ya = { class: "custom-add-dialog__right--icon overflow-hidden flex-1" }, ba = { class: "custom-add-dialog__right--text" }, ka = ["title"], Aa = ["title"], Na = ["onClick"], wa = { class: "custom-add-dialog__right--icon overflow-hidden flex-1" }, Oa = ["src"], Ca = { class: "custom-add-dialog__right--text" }, xa = ["title"], Da = {
|
|
1218
|
+
key: 0,
|
|
1219
|
+
class: "custom-add-dialog__right--file"
|
|
1220
|
+
}, Ia = {
|
|
1221
|
+
key: 1,
|
|
1222
|
+
class: "custom-add-dialog__right--file"
|
|
1223
|
+
}, Ta = ["title"], Ea = {
|
|
1224
|
+
key: 1,
|
|
1225
|
+
class: "custom-add-dialog__right--name plugin-style w-full overflow-hidden"
|
|
1226
|
+
}, Ra = { class: "custom-add-dialog__right--icon overflow-hidden flex-1" }, Sa = { class: "custom-add-dialog__right--text" }, $a = ["title"], Ma = ["title"], Ga = ["title"], Ha = {
|
|
1227
|
+
__name: "AddDialog",
|
|
1228
|
+
props: {
|
|
1229
|
+
addNumber: {
|
|
1230
|
+
type: Number,
|
|
1231
|
+
default: 0
|
|
1232
|
+
},
|
|
1233
|
+
addNumberData: {
|
|
1234
|
+
type: Number,
|
|
1235
|
+
default: 0
|
|
1236
|
+
},
|
|
1237
|
+
customClass: {
|
|
1238
|
+
type: String,
|
|
1239
|
+
default: ""
|
|
1240
|
+
},
|
|
1241
|
+
addDialogOptions: {
|
|
1242
|
+
type: Object,
|
|
1243
|
+
default: () => ({})
|
|
1244
|
+
},
|
|
1245
|
+
pluginNodeNumObj: {
|
|
1246
|
+
type: Object,
|
|
1247
|
+
default: () => ({})
|
|
1248
|
+
},
|
|
1249
|
+
agentNodeNumObj: {
|
|
1250
|
+
type: Object,
|
|
1251
|
+
default: () => ({})
|
|
1252
|
+
},
|
|
1253
|
+
MCPNodeNumObj: {
|
|
1254
|
+
type: Object,
|
|
1255
|
+
default: () => ({})
|
|
1256
|
+
},
|
|
1257
|
+
workflowNodeNumObj: {
|
|
1258
|
+
type: Object,
|
|
1259
|
+
default: () => ({})
|
|
1260
|
+
},
|
|
1261
|
+
workflowBnid: {
|
|
1262
|
+
type: String,
|
|
1263
|
+
default: ""
|
|
1264
|
+
}
|
|
1265
|
+
},
|
|
1266
|
+
emits: ["success", "create"],
|
|
1267
|
+
setup(n, { expose: b, emit: m }) {
|
|
1268
|
+
const { t: c } = ee(), { updateAgentSkillet: O, removeAgentSkillet: h } = Ke(), k = mt(), g = m, T = Fe(), x = n, { dialogRef: R, showDialog: f, hideDialog: B } = wt(), t = Le({
|
|
1269
|
+
addLoading: !1,
|
|
1270
|
+
loading: !1,
|
|
1271
|
+
activeSelect: 1,
|
|
1272
|
+
data: [],
|
|
1273
|
+
total: 0,
|
|
1274
|
+
pages: { ...gt, size: 1e6 },
|
|
1275
|
+
searchForm: {
|
|
1276
|
+
search: ""
|
|
1277
|
+
},
|
|
1278
|
+
currentIndex: null,
|
|
1279
|
+
currentData: {},
|
|
1280
|
+
viewMode: "list",
|
|
1281
|
+
// 'list' | 'card'
|
|
1282
|
+
showCardDetail: !1,
|
|
1283
|
+
// 卡片模式下是否显示详情页
|
|
1284
|
+
mcpSourceFilter: "all"
|
|
1285
|
+
// MCP市场筛选器,默认为"全部"
|
|
1286
|
+
});
|
|
1287
|
+
de(
|
|
1288
|
+
() => t.currentIndex,
|
|
1289
|
+
(l) => {
|
|
1290
|
+
[a.plugin, a.mcp].includes(l) && (t.activeSelect = 0);
|
|
1291
|
+
},
|
|
1292
|
+
{
|
|
1293
|
+
immediate: !0
|
|
1294
|
+
}
|
|
1295
|
+
);
|
|
1296
|
+
const A = K([]), P = {
|
|
1297
|
+
children: "children",
|
|
1298
|
+
hasChildren: "hasChildren",
|
|
1299
|
+
value: "bnid"
|
|
1300
|
+
}, z = (l) => {
|
|
1301
|
+
t.activeSelect = l, t.pages.page = 1, t.showCardDetail = !1, t.viewMode = "list", A.value = [], t.currentIndex === a.mcp && l === 0 && (t.mcpSourceFilter = "all"), I();
|
|
1302
|
+
}, w = async (l) => {
|
|
1303
|
+
t.currentIndex = l.key, t.currentData = $e(x.addDialogOptions)[l.key], t.pages.page = 1, A.value = [], t.showCardDetail = !1, t.viewMode = "list", l.key === a.mcp && (t.mcpSourceFilter = "all"), I();
|
|
1304
|
+
}, N = (l) => {
|
|
1305
|
+
t.mcpSourceFilter = l.key, t.pages.page = 1, t.showCardDetail = !1, t.viewMode = "list", A.value = [], I();
|
|
1306
|
+
}, W = [
|
|
1307
|
+
{
|
|
1308
|
+
icon: "IconList",
|
|
1309
|
+
key: "list"
|
|
1310
|
+
},
|
|
1311
|
+
{
|
|
1312
|
+
icon: "IconCard",
|
|
1313
|
+
key: "card"
|
|
1314
|
+
}
|
|
1315
|
+
], C = M(() => t.currentData.key === a.mcp && t.currentData.list?.[0]?.filters ? t.currentData.list[0].filters.map((l) => ({
|
|
1316
|
+
label: l.label,
|
|
1317
|
+
key: l.value
|
|
1318
|
+
})) : []), S = (l) => {
|
|
1319
|
+
t.viewMode = l.key, t.showCardDetail = !1, A.value = [], I();
|
|
1320
|
+
}, I = async () => {
|
|
1321
|
+
t.loading = !0;
|
|
1322
|
+
const l = {
|
|
1323
|
+
...t.searchForm,
|
|
1324
|
+
...t.currentData.params,
|
|
1325
|
+
...t.pages,
|
|
1326
|
+
agentBnid: T.params.bnid,
|
|
1327
|
+
workspaceBnid: k.selectedBusinessSpace || ""
|
|
1328
|
+
};
|
|
1329
|
+
if (t.currentIndex === a.workflow && t.activeSelect == 0 && (l.name = t.searchForm.search), t.currentIndex === a.mcp) {
|
|
1330
|
+
const E = t.currentData.list?.[t.activeSelect];
|
|
1331
|
+
E?.channel && (l.channel = E.channel), t.activeSelect === 0 ? l.original = t.mcpSourceFilter : E?.original && (l.original = "personal");
|
|
1332
|
+
}
|
|
1333
|
+
x.addDialogOptions.isInWorkflow && t.currentIndex === a.workflow && (l.workflowBnid = x.workflowBnid);
|
|
1334
|
+
let _ = {};
|
|
1335
|
+
t.activeSelect == 0 && t.currentData.marketFetchMethod ? _ = await t.currentData.marketFetchMethod({ ...l }).finally(() => {
|
|
1336
|
+
t.loading = !1;
|
|
1337
|
+
}) : _ = await t.currentData.fetchMethod({ ...l, range: t.activeSelect || 1 }).finally(() => {
|
|
1338
|
+
t.loading = !1;
|
|
1339
|
+
});
|
|
1340
|
+
const $ = _?.data || {}, X = $.data?.filter((E) => E.bnid !== Z.value).map((E) => {
|
|
1341
|
+
const Q = { addLoading: !1, ...E, level: 1 };
|
|
1342
|
+
return E?.mcpTools?.length && (Q.children = E.mcpTools.map((D) => ({
|
|
1343
|
+
...D,
|
|
1344
|
+
apiKey: E.apiKey,
|
|
1345
|
+
state: E.state,
|
|
1346
|
+
bnid: `${E.bnid}-${D.name}`,
|
|
1347
|
+
mcpBnid: E.bnid,
|
|
1348
|
+
mcpKey: E.keyBnid,
|
|
1349
|
+
mcpTool: D.name,
|
|
1350
|
+
nodeName: E.name,
|
|
1351
|
+
icon: E.icon,
|
|
1352
|
+
type: E.type
|
|
1353
|
+
}))), E?.pluglitList?.length && (Q.children = E.pluglitList.map((D) => ({
|
|
1354
|
+
...E,
|
|
1355
|
+
...D,
|
|
1356
|
+
pluglitType: Q.type
|
|
1357
|
+
})), Q.pluglitList = E.pluglitList.map((D) => ({
|
|
1358
|
+
...D,
|
|
1359
|
+
randomId: Math.random().toString(36).substring(2, 15),
|
|
1360
|
+
pluglitType: Q.type
|
|
1361
|
+
}))), Q;
|
|
1362
|
+
});
|
|
1363
|
+
A.value = X?.length ? [...X] : [], console.log("🚀 ~ getList ~ serviceData.value:", A.value), t.total = $.total || 0;
|
|
1364
|
+
}, F = () => {
|
|
1365
|
+
t.pages.page = 1, t.showCardDetail = !1, t.viewMode = "list", A.value = [], I();
|
|
1366
|
+
}, Z = K(null), Y = async (l, _) => {
|
|
1367
|
+
console.log(l, _, "key, bnid"), t.currentData = $e(x.addDialogOptions)[l], t.currentIndex = l, t.pages.page = 1, t.data = [], t.activeSelect = [a.plugin, a.mcp].includes(l) ? 0 : 1, A.value = [], t.showCardDetail = !1, t.viewMode = "list", Z.value = _, I(), f();
|
|
1368
|
+
}, J = () => {
|
|
1369
|
+
t.searchForm.search = "", t.viewMode = "list", t.showCardDetail = !1, B();
|
|
1370
|
+
}, pe = (l) => {
|
|
1371
|
+
g("create", l);
|
|
1372
|
+
}, fe = (l) => {
|
|
1373
|
+
g("create", l);
|
|
1374
|
+
}, ve = M(() => x.addNumberData ? x.addNumberData : t.currentIndex === a.plugin ? Object.values(x.pluginNodeNumObj).reduce((l, _) => l + _, 0) : t.currentIndex === a.agent ? Object.values(x.agentNodeNumObj).reduce((l, _) => l + _, 0) : t.currentIndex === a.mcp ? Object.values(x.MCPNodeNumObj).reduce((l, _) => l + _, 0) : t.currentIndex === a.workflow ? Object.values(x.workflowNodeNumObj).reduce((l, _) => l + _, 0) : 0), ne = async (l, _) => {
|
|
1375
|
+
if (x.addDialogOptions.isInWorkflow)
|
|
1376
|
+
t.currentIndex === a.plugin ? (L.on(we, () => {
|
|
1377
|
+
L.off(we);
|
|
1378
|
+
}), L.emit(bt, { data: l, e: _ })) : t.currentIndex === a.mcp ? (console.log("========mcp", l), L.on(Ae, () => {
|
|
1379
|
+
L.off(Ae);
|
|
1380
|
+
}), L.emit(kt, { data: l, e: _ })) : t.currentIndex === a.workflow ? (console.log("========workflow", l), L.emit(At, { data: l, e: _ })) : (L.on(Ne, () => {
|
|
1381
|
+
L.off(Ne);
|
|
1382
|
+
}), L.emit(Nt, { data: l, e: _ }));
|
|
1383
|
+
else {
|
|
1384
|
+
let $ = {
|
|
1385
|
+
bnid: T.params.bnid,
|
|
1386
|
+
skillet: l.bnid,
|
|
1387
|
+
type: l.type
|
|
1388
|
+
};
|
|
1389
|
+
l.mcpTool && ($.subSkillet = l.mcpTool, $.skillet = l.mcpBnid), l.addLoading = !0;
|
|
1390
|
+
const { code: X } = await O($).finally(() => {
|
|
1391
|
+
l.addLoading = !1;
|
|
1392
|
+
});
|
|
1393
|
+
X === 0 && (l.addStatus = 1, L.emit(Me));
|
|
1394
|
+
}
|
|
1395
|
+
}, ae = async (l) => {
|
|
1396
|
+
let _ = {
|
|
1397
|
+
bnid: T.params.bnid,
|
|
1398
|
+
skillet: l.bnid,
|
|
1399
|
+
type: l.type
|
|
1400
|
+
};
|
|
1401
|
+
l.mcpTool && (_.subSkillet = l.mcpTool, _.skillet = l.mcpBnid);
|
|
1402
|
+
const { code: $ } = await h(_);
|
|
1403
|
+
$ === 0 && (l.addStatus = 0, L.emit(Me));
|
|
1404
|
+
}, ye = (l) => Array.isArray(l) ? l.map((_) => {
|
|
1405
|
+
const $ = ye(_.children);
|
|
1406
|
+
return _.extendDisplay || _["extend-display"] || $ && $.length > 0 ? {
|
|
1407
|
+
..._,
|
|
1408
|
+
children: $
|
|
1409
|
+
} : null;
|
|
1410
|
+
}).filter(Boolean) : [], re = K(null), We = async (l) => {
|
|
1411
|
+
if (!l.mcpTools || !l.mcpTools.length || l.state != 1)
|
|
1412
|
+
return;
|
|
1413
|
+
const _ = l?.mcpTools?.[0];
|
|
1414
|
+
be(l, _);
|
|
1415
|
+
}, Ze = (l) => {
|
|
1416
|
+
if (l?.pluglitList?.length) {
|
|
1417
|
+
const _ = l?.pluglitList?.[0];
|
|
1418
|
+
be(l, _);
|
|
1419
|
+
}
|
|
1420
|
+
}, Ye = (l) => {
|
|
1421
|
+
if (l?.children?.length) {
|
|
1422
|
+
const _ = l?.mcpTools?.[0];
|
|
1423
|
+
be(l, _);
|
|
1424
|
+
}
|
|
1425
|
+
}, be = (l, _) => {
|
|
1426
|
+
const $ = re.value.getNode(l);
|
|
1427
|
+
l.showChildren ? re.value.collapseNode($) : (re.value.expandNode($), Be(() => {
|
|
1428
|
+
re.value.scrollToNode(_.randomId || null);
|
|
1429
|
+
})), l.showChildren = !l.showChildren;
|
|
1430
|
+
}, me = (l) => [a.workflow, a.mcp].includes(t.currentIndex) ? l?.icon || l?.avatarUrl || Oe?.[t.currentIndex] || "" : [a.agent].includes(t.currentIndex) ? l?.icon ? l?.icon : l.type == 1 ? Oe?.[t.currentIndex] : Oe.chatflow : [
|
|
1431
|
+
a.document,
|
|
1432
|
+
a.qa,
|
|
1433
|
+
a.all
|
|
1434
|
+
].includes(t.currentIndex) ? ft?.[l?.type] || "" : t.currentIndex === a.plugin ? l?.avatarUrl || l?.icon || vt : t.currentIndex == a.mcp ? l?.icon || l?.avatarUrl || l?.iconUrl || yt : l?.icon || l?.avatarUrl || l?.iconUrl || "", Je = (l) => {
|
|
1435
|
+
const { origin: _ } = location, $ = "undefined/", X = encodeURIComponent(T.fullPath);
|
|
1436
|
+
window.open(`${_ + $}mcp-detail/${l.bnid}?from=${X}`);
|
|
1437
|
+
}, Xe = (l) => {
|
|
1438
|
+
const { origin: _ } = location, $ = "undefined/", X = encodeURIComponent(T.fullPath);
|
|
1439
|
+
window.open(`${_ + $}store-mcp-detail/${l}?from=${X}`);
|
|
1440
|
+
}, Qe = (l) => {
|
|
1441
|
+
l.originalType == 1 ? Je(l) : Xe(l.bnid);
|
|
1442
|
+
};
|
|
1443
|
+
return it(() => {
|
|
1444
|
+
L.off(Ae), L.off(Ne), L.off(we), L.off(_t);
|
|
1445
|
+
}), b({
|
|
1446
|
+
updateView: Y,
|
|
1447
|
+
getList: I,
|
|
1448
|
+
handleViewModeChange: S,
|
|
1449
|
+
hideDialog: B
|
|
1450
|
+
}), (l, _) => {
|
|
1451
|
+
const $ = V("IconClose"), X = V("IconZuoCopy"), E = V("IconTip"), Q = st("loading");
|
|
1452
|
+
return o(), v(e(Ot), {
|
|
1453
|
+
ref_key: "dialogRef",
|
|
1454
|
+
ref: R,
|
|
1455
|
+
class: q(`custom-add-dialog ${n.customClass}`),
|
|
1456
|
+
onClosed: J,
|
|
1457
|
+
width: "1236"
|
|
1458
|
+
}, {
|
|
1459
|
+
default: r(() => [
|
|
1460
|
+
s("div", ta, [
|
|
1461
|
+
[
|
|
1462
|
+
e(a).workflow,
|
|
1463
|
+
e(a).plugin,
|
|
1464
|
+
e(a).mcp,
|
|
1465
|
+
e(a).agent
|
|
1466
|
+
].includes(t.currentData.key) ? (o(), p("div", na, [
|
|
1467
|
+
s("div", aa, [
|
|
1468
|
+
s("span", null, d(t.currentData.title), 1)
|
|
1469
|
+
]),
|
|
1470
|
+
s("div", la, [
|
|
1471
|
+
s("div", null, [
|
|
1472
|
+
u(e(De), {
|
|
1473
|
+
placeholder: e(c)("COMMON_DATA.PLACEHOLDER_INPUT"),
|
|
1474
|
+
modelValue: t.searchForm.search,
|
|
1475
|
+
"onUpdate:modelValue": _[0] || (_[0] = (D) => t.searchForm.search = D),
|
|
1476
|
+
style: { width: "100%" },
|
|
1477
|
+
class: "custom-search-input",
|
|
1478
|
+
onKeyup: Re(F, ["enter"]),
|
|
1479
|
+
"prefix-icon": "Seach"
|
|
1480
|
+
}, null, 8, ["placeholder", "modelValue"]),
|
|
1481
|
+
[
|
|
1482
|
+
e(a).workflow,
|
|
1483
|
+
e(a).plugin,
|
|
1484
|
+
e(a).agent
|
|
1485
|
+
].includes(t.currentData.key) ? (o(), v(e(U), {
|
|
1486
|
+
key: 0,
|
|
1487
|
+
type: "primary",
|
|
1488
|
+
style: { width: "100%", "margin-top": "24px" },
|
|
1489
|
+
onClick: _[1] || (_[1] = (D) => pe(t.currentData.key))
|
|
1490
|
+
}, {
|
|
1491
|
+
default: r(() => [
|
|
1492
|
+
j(d(t.currentData.otherTitle), 1)
|
|
1493
|
+
]),
|
|
1494
|
+
_: 1
|
|
1495
|
+
})) : y("", !0)
|
|
1496
|
+
])
|
|
1497
|
+
]),
|
|
1498
|
+
s("ul", null, [
|
|
1499
|
+
[
|
|
1500
|
+
e(a).workflow,
|
|
1501
|
+
e(a).plugin,
|
|
1502
|
+
e(a).mcp,
|
|
1503
|
+
e(a).agent
|
|
1504
|
+
].includes(t.currentData.key) ? (o(!0), p(H, { key: 0 }, ie(t.currentData.list, (D, i) => (o(), p("li", {
|
|
1505
|
+
class: q({ active: t.activeSelect === i }),
|
|
1506
|
+
key: i,
|
|
1507
|
+
onClick: (ge) => z(i)
|
|
1508
|
+
}, [
|
|
1509
|
+
u(e(G), {
|
|
1510
|
+
size: 20,
|
|
1511
|
+
style: { "margin-right": "8px" }
|
|
1512
|
+
}, {
|
|
1513
|
+
default: r(() => [
|
|
1514
|
+
(o(), v(Te(D.icon), {
|
|
1515
|
+
color: t.activeSelect === i ? "var(--el-color-primary)" : "#262626"
|
|
1516
|
+
}, null, 8, ["color"]))
|
|
1517
|
+
]),
|
|
1518
|
+
_: 2
|
|
1519
|
+
}, 1024),
|
|
1520
|
+
j(" " + d(D.title), 1)
|
|
1521
|
+
], 10, oa))), 128)) : (o(!0), p(H, { key: 1 }, ie(t.currentData.list, (D, i) => (o(), p("li", {
|
|
1522
|
+
class: q({ active: D.key === t.currentIndex }),
|
|
1523
|
+
key: i,
|
|
1524
|
+
onClick: (ge) => w(D)
|
|
1525
|
+
}, d(D.label), 11, ia))), 128))
|
|
1526
|
+
])
|
|
1527
|
+
])) : y("", !0),
|
|
1528
|
+
s("div", {
|
|
1529
|
+
class: q(["custom-add-dialog__right", {
|
|
1530
|
+
"custom-width-right": [
|
|
1531
|
+
e(a).document,
|
|
1532
|
+
e(a).qa,
|
|
1533
|
+
e(a).all
|
|
1534
|
+
].includes(t.currentData.key)
|
|
1535
|
+
}])
|
|
1536
|
+
}, [
|
|
1537
|
+
u(e(U), {
|
|
1538
|
+
class: "close-btn",
|
|
1539
|
+
onClick: J
|
|
1540
|
+
}, {
|
|
1541
|
+
default: r(() => [
|
|
1542
|
+
u(e(G), { size: 16 }, {
|
|
1543
|
+
default: r(() => [
|
|
1544
|
+
u($)
|
|
1545
|
+
]),
|
|
1546
|
+
_: 1
|
|
1547
|
+
})
|
|
1548
|
+
]),
|
|
1549
|
+
_: 1
|
|
1550
|
+
}),
|
|
1551
|
+
!t.showCardDetail && [
|
|
1552
|
+
e(a).mcp,
|
|
1553
|
+
e(a).plugin,
|
|
1554
|
+
e(a).workflow,
|
|
1555
|
+
e(a).agent
|
|
1556
|
+
].includes(t.currentData.key) ? (o(), p("div", sa, [
|
|
1557
|
+
u(Ce, {
|
|
1558
|
+
modelValue: t.viewMode,
|
|
1559
|
+
"onUpdate:modelValue": _[2] || (_[2] = (D) => t.viewMode = D),
|
|
1560
|
+
options: W,
|
|
1561
|
+
onChange: S
|
|
1562
|
+
}, null, 8, ["modelValue"])
|
|
1563
|
+
])) : y("", !0),
|
|
1564
|
+
t.currentData.key === e(a).mcp && t.activeSelect === 0 && C.value.length > 0 ? (o(), v(Ce, {
|
|
1565
|
+
key: 1,
|
|
1566
|
+
modelValue: t.mcpSourceFilter,
|
|
1567
|
+
"onUpdate:modelValue": _[3] || (_[3] = (D) => t.mcpSourceFilter = D),
|
|
1568
|
+
options: C.value,
|
|
1569
|
+
onChange: N
|
|
1570
|
+
}, null, 8, ["modelValue", "options"])) : y("", !0),
|
|
1571
|
+
[
|
|
1572
|
+
e(a).document,
|
|
1573
|
+
e(a).qa,
|
|
1574
|
+
e(a).all
|
|
1575
|
+
].includes(t.currentData.key) ? (o(), p("div", ca, [
|
|
1576
|
+
s("div", {
|
|
1577
|
+
class: q(["custom-add-dialog__right__document--title", { "is-knowledge-title": [e(a).document, e(a).qa, e(a).all].includes(t.currentData.key) }])
|
|
1578
|
+
}, [
|
|
1579
|
+
s("span", null, d(t.currentData.title), 1),
|
|
1580
|
+
s("span", da, d(e(c)("COMMON_DATA.ADDED")) + ": " + d(ve.value), 1)
|
|
1581
|
+
], 2),
|
|
1582
|
+
s("div", ra, [
|
|
1583
|
+
u(Ce, {
|
|
1584
|
+
modelValue: t.currentIndex,
|
|
1585
|
+
"onUpdate:modelValue": _[4] || (_[4] = (D) => t.currentIndex = D),
|
|
1586
|
+
options: t.currentData.tabList,
|
|
1587
|
+
onChange: w
|
|
1588
|
+
}, null, 8, ["modelValue", "options"]),
|
|
1589
|
+
u(e(De), {
|
|
1590
|
+
placeholder: e(c)("COMMON_DATA.PLACEHOLDER_INPUT"),
|
|
1591
|
+
modelValue: t.searchForm.search,
|
|
1592
|
+
"onUpdate:modelValue": _[5] || (_[5] = (D) => t.searchForm.search = D),
|
|
1593
|
+
onKeyup: Re(F, ["enter"]),
|
|
1594
|
+
"prefix-icon": "Seach"
|
|
1595
|
+
}, null, 8, ["placeholder", "modelValue"]),
|
|
1596
|
+
[
|
|
1597
|
+
e(a).workflow,
|
|
1598
|
+
e(a).plugin,
|
|
1599
|
+
e(a).agent
|
|
1600
|
+
].includes(t.currentData.key) ? (o(), v(e(U), {
|
|
1601
|
+
key: 0,
|
|
1602
|
+
type: "primary",
|
|
1603
|
+
onClick: _[6] || (_[6] = (D) => pe(t.currentData.key))
|
|
1604
|
+
}, {
|
|
1605
|
+
default: r(() => [
|
|
1606
|
+
j(d(t.currentData.otherTitle), 1)
|
|
1607
|
+
]),
|
|
1608
|
+
_: 1
|
|
1609
|
+
})) : y("", !0),
|
|
1610
|
+
[
|
|
1611
|
+
e(a).document,
|
|
1612
|
+
e(a).qa,
|
|
1613
|
+
e(a).all
|
|
1614
|
+
].includes(t.currentData.key) ? (o(), v(e(dt), {
|
|
1615
|
+
key: 1,
|
|
1616
|
+
onCommand: fe
|
|
1617
|
+
}, {
|
|
1618
|
+
dropdown: r(() => [
|
|
1619
|
+
u(e(rt), null, {
|
|
1620
|
+
default: r(() => [
|
|
1621
|
+
u(e(Se), { command: "document" }, {
|
|
1622
|
+
default: r(() => [
|
|
1623
|
+
j(d(e(c)("AGENT_ARRANGE.AD.CREATE_DOCUMENT")), 1)
|
|
1624
|
+
]),
|
|
1625
|
+
_: 1
|
|
1626
|
+
}),
|
|
1627
|
+
u(e(Se), { command: "qa" }, {
|
|
1628
|
+
default: r(() => [
|
|
1629
|
+
j(d(e(c)("AGENT_ARRANGE.AD.CREATE_QA")), 1)
|
|
1630
|
+
]),
|
|
1631
|
+
_: 1
|
|
1632
|
+
})
|
|
1633
|
+
]),
|
|
1634
|
+
_: 1
|
|
1635
|
+
})
|
|
1636
|
+
]),
|
|
1637
|
+
default: r(() => [
|
|
1638
|
+
u(e(U), { type: "primary" }, {
|
|
1639
|
+
default: r(() => [
|
|
1640
|
+
j(d(e(c)("AGENT_ARRANGE.AD.CREATE_ZSK")) + " ", 1),
|
|
1641
|
+
u(e(G), { class: "el-icon--right" }, {
|
|
1642
|
+
default: r(() => [
|
|
1643
|
+
u(X)
|
|
1644
|
+
]),
|
|
1645
|
+
_: 1
|
|
1646
|
+
})
|
|
1647
|
+
]),
|
|
1648
|
+
_: 1
|
|
1649
|
+
})
|
|
1650
|
+
]),
|
|
1651
|
+
_: 1
|
|
1652
|
+
})) : y("", !0)
|
|
1653
|
+
])
|
|
1654
|
+
])) : y("", !0),
|
|
1655
|
+
ze((o(), p("div", ua, [
|
|
1656
|
+
t.viewMode === "list" ? (o(), v(e(ut), { key: 0 }, {
|
|
1657
|
+
default: r(({ height: D }) => [
|
|
1658
|
+
A.value.length ? (o(), v(e(pt), {
|
|
1659
|
+
key: 0,
|
|
1660
|
+
data: A.value,
|
|
1661
|
+
props: P,
|
|
1662
|
+
height: D - 14,
|
|
1663
|
+
"item-size": 97,
|
|
1664
|
+
"expand-on-click-node": !1,
|
|
1665
|
+
class: q(["custom-add-dialog__right--content", {
|
|
1666
|
+
"is-knowledge": [
|
|
1667
|
+
e(a).document,
|
|
1668
|
+
e(a).qa,
|
|
1669
|
+
e(a).all
|
|
1670
|
+
].includes(t.currentData.key)
|
|
1671
|
+
}]),
|
|
1672
|
+
indent: 0,
|
|
1673
|
+
ref_key: "treeRef",
|
|
1674
|
+
ref: re
|
|
1675
|
+
}, {
|
|
1676
|
+
default: r(({ data: i }) => [
|
|
1677
|
+
[
|
|
1678
|
+
e(a).document,
|
|
1679
|
+
e(a).qa,
|
|
1680
|
+
e(a).all,
|
|
1681
|
+
e(a).workflow,
|
|
1682
|
+
e(a).agent
|
|
1683
|
+
].includes(t.currentData.key) ? (o(), p(H, { key: 0 }, [
|
|
1684
|
+
i.level ? (o(), p("div", {
|
|
1685
|
+
key: 0,
|
|
1686
|
+
class: q(["custom-add-dialog__right--name", "w-full", "overflow-hidden", { "is-knowledge-name": [e(a).document, e(a).qa, e(a).all].includes(t.currentData.key) }])
|
|
1687
|
+
}, [
|
|
1688
|
+
s("div", pa, [
|
|
1689
|
+
me(i) ? (o(), p("img", {
|
|
1690
|
+
key: 0,
|
|
1691
|
+
src: me(i),
|
|
1692
|
+
width: "42",
|
|
1693
|
+
height: "42",
|
|
1694
|
+
alt: ""
|
|
1695
|
+
}, null, 8, ma)) : y("", !0),
|
|
1696
|
+
s("div", null, [
|
|
1697
|
+
s("div", ga, [
|
|
1698
|
+
s("span", {
|
|
1699
|
+
class: "text-span ellipsis",
|
|
1700
|
+
title: i.name || i.title
|
|
1701
|
+
}, d(i.publishTile || i.name || i.title), 9, _a),
|
|
1702
|
+
[
|
|
1703
|
+
e(a).document,
|
|
1704
|
+
e(a).qa,
|
|
1705
|
+
e(a).all
|
|
1706
|
+
].includes(t.currentData.key) ? (o(), p("span", ha, d(e(ht)[i.type]) + ":" + d(i.size), 1)) : y("", !0),
|
|
1707
|
+
[e(a).workflow].includes(
|
|
1708
|
+
t.currentData.key
|
|
1709
|
+
) && i?.properties?.length ? (o(), v(e(ce), {
|
|
1710
|
+
key: 1,
|
|
1711
|
+
placement: "right",
|
|
1712
|
+
width: i?.properties?.length ? 360 : 150,
|
|
1713
|
+
"popper-class": "add-dialog-popover",
|
|
1714
|
+
trigger: "hover"
|
|
1715
|
+
}, {
|
|
1716
|
+
reference: r(() => [
|
|
1717
|
+
u(e(G), {
|
|
1718
|
+
size: "13px",
|
|
1719
|
+
color: "#999999",
|
|
1720
|
+
style: { cursor: "pointer", "margin-left": "3px" }
|
|
1721
|
+
}, {
|
|
1722
|
+
default: r(() => [
|
|
1723
|
+
u(E)
|
|
1724
|
+
]),
|
|
1725
|
+
_: 1
|
|
1726
|
+
})
|
|
1727
|
+
]),
|
|
1728
|
+
default: r(() => [
|
|
1729
|
+
u(ue, {
|
|
1730
|
+
data: i.properties
|
|
1731
|
+
}, null, 8, ["data"])
|
|
1732
|
+
]),
|
|
1733
|
+
_: 2
|
|
1734
|
+
}, 1032, ["width"])) : y("", !0)
|
|
1735
|
+
]),
|
|
1736
|
+
s("div", {
|
|
1737
|
+
class: "custom-add-dialog__right--desc text-description text-ellipsis",
|
|
1738
|
+
title: i.description
|
|
1739
|
+
}, d(i.description || "-"), 9, fa)
|
|
1740
|
+
])
|
|
1741
|
+
]),
|
|
1742
|
+
[e(a).mcp].includes(t.currentIndex) ? (o(), v(je, {
|
|
1743
|
+
key: 0,
|
|
1744
|
+
"is-expanded": i.showChildren,
|
|
1745
|
+
pointer: i?.mcpTools?.length && i.state == 1,
|
|
1746
|
+
onToggle: (ge) => We(i)
|
|
1747
|
+
}, null, 8, ["is-expanded", "pointer", "onToggle"])) : y("", !0),
|
|
1748
|
+
[e(a).workflow].includes(t.currentIndex) ? (o(), v(oe, {
|
|
1749
|
+
key: 1,
|
|
1750
|
+
data: i,
|
|
1751
|
+
type: t.currentIndex,
|
|
1752
|
+
badge: n.workflowNodeNumObj[i.bnid] || 0,
|
|
1753
|
+
onAdd: ne,
|
|
1754
|
+
onRemove: ae
|
|
1755
|
+
}, null, 8, ["data", "type", "badge"])) : (o(), v(oe, {
|
|
1756
|
+
key: 2,
|
|
1757
|
+
data: i,
|
|
1758
|
+
type: t.currentIndex,
|
|
1759
|
+
badge: [e(a).agent].includes(t.currentIndex) ? n.agentNodeNumObj[i.bnid] : 0,
|
|
1760
|
+
onAdd: ne,
|
|
1761
|
+
onRemove: ae
|
|
1762
|
+
}, null, 8, ["data", "type", "badge"]))
|
|
1763
|
+
], 2)) : (o(), p("div", va, [
|
|
1764
|
+
s("div", ya, [
|
|
1765
|
+
s("div", null, [
|
|
1766
|
+
s("div", ba, [
|
|
1767
|
+
s("span", {
|
|
1768
|
+
class: "text-span ellipsis",
|
|
1769
|
+
title: i.name
|
|
1770
|
+
}, d(i.name), 9, ka)
|
|
1771
|
+
]),
|
|
1772
|
+
s("div", {
|
|
1773
|
+
class: "custom-add-dialog__right--desc text-description text-ellipsis",
|
|
1774
|
+
style: { "margin-top": "5px" },
|
|
1775
|
+
title: i.description
|
|
1776
|
+
}, d(i.description), 9, Aa)
|
|
1777
|
+
])
|
|
1778
|
+
])
|
|
1779
|
+
]))
|
|
1780
|
+
], 64)) : y("", !0),
|
|
1781
|
+
[e(a).plugin, e(a).mcp].includes(
|
|
1782
|
+
t.currentData.key
|
|
1783
|
+
) ? (o(), p(H, { key: 1 }, [
|
|
1784
|
+
i.level ? (o(), p("div", {
|
|
1785
|
+
key: 0,
|
|
1786
|
+
class: "custom-add-dialog__right--name w-full overflow-hidden",
|
|
1787
|
+
onClick: (ge) => [e(a).plugin].includes(t.currentData.key) ? Ze(i) : Ye(i)
|
|
1788
|
+
}, [
|
|
1789
|
+
s("div", wa, [
|
|
1790
|
+
me(i) ? (o(), p("img", {
|
|
1791
|
+
key: 0,
|
|
1792
|
+
src: me(i),
|
|
1793
|
+
width: "42",
|
|
1794
|
+
height: "42",
|
|
1795
|
+
alt: ""
|
|
1796
|
+
}, null, 8, Oa)) : y("", !0),
|
|
1797
|
+
s("div", null, [
|
|
1798
|
+
s("div", Ca, [
|
|
1799
|
+
s("span", {
|
|
1800
|
+
class: "text-span ellipsis",
|
|
1801
|
+
title: i.name
|
|
1802
|
+
}, d(i.name), 9, xa),
|
|
1803
|
+
[e(a).mcp].includes(t.currentData.key) ? (o(), p("span", Da, d(e(c)("AGENT_ARRANGE.AD.TOOL")) + ":" + d(i.mcpTools && i.mcpTools.length && i.mcpTools.length + 1 || 0), 1)) : (o(), p("span", Ia, d(e(c)("AGENT_ARRANGE.AD.TOOL")) + ":" + d(i.num), 1)),
|
|
1804
|
+
[e(a).mcp].includes(t.currentIndex) && t.activeSelect == 0 ? (o(), p(H, { key: 2 }, [
|
|
1805
|
+
i?.originalType ? (o(), v(e(U), {
|
|
1806
|
+
key: 0,
|
|
1807
|
+
class: "go-detail-btn",
|
|
1808
|
+
type: "primary",
|
|
1809
|
+
size: "small",
|
|
1810
|
+
icon: e(Dt),
|
|
1811
|
+
link: "",
|
|
1812
|
+
onClick: (ge) => Qe(i)
|
|
1813
|
+
}, null, 8, ["icon", "onClick"])) : y("", !0),
|
|
1814
|
+
u(Ie, {
|
|
1815
|
+
data: i,
|
|
1816
|
+
type: e(a).mcp,
|
|
1817
|
+
onUpdateSuccess: I
|
|
1818
|
+
}, null, 8, ["data", "type"])
|
|
1819
|
+
], 64)) : i.needApiKey ? (o(), v(Ie, {
|
|
1820
|
+
key: 3,
|
|
1821
|
+
data: i,
|
|
1822
|
+
type: e(a).plugin,
|
|
1823
|
+
onUpdateSuccess: I
|
|
1824
|
+
}, null, 8, ["data", "type"])) : y("", !0)
|
|
1825
|
+
]),
|
|
1826
|
+
s("div", {
|
|
1827
|
+
class: "custom-add-dialog__right--desc text-description text-ellipsis",
|
|
1828
|
+
title: i.description
|
|
1829
|
+
}, d(i.description || "-"), 9, Ta)
|
|
1830
|
+
])
|
|
1831
|
+
]),
|
|
1832
|
+
u(je, {
|
|
1833
|
+
"is-expanded": i.showChildren,
|
|
1834
|
+
pointer: [e(a).mcp].includes(t.currentIndex) ? i?.mcpTools?.length : i?.pluglitList?.length
|
|
1835
|
+
}, null, 8, ["is-expanded", "pointer"])
|
|
1836
|
+
], 8, Na)) : (o(), p("div", Ea, [
|
|
1837
|
+
s("div", Ra, [
|
|
1838
|
+
s("div", null, [
|
|
1839
|
+
s("div", Sa, [
|
|
1840
|
+
[e(a).mcp].includes(t.currentData.key) ? (o(), p(H, { key: 0 }, [
|
|
1841
|
+
s("span", {
|
|
1842
|
+
class: "text-span ellipsis",
|
|
1843
|
+
title: i.name
|
|
1844
|
+
}, d(i.name), 9, $a),
|
|
1845
|
+
i.schema && i.schema.length ? (o(), v(e(ce), {
|
|
1846
|
+
key: 0,
|
|
1847
|
+
placement: "right",
|
|
1848
|
+
width: i.schema ? 380 : 150,
|
|
1849
|
+
"popper-class": "add-dialog-popover",
|
|
1850
|
+
trigger: "hover"
|
|
1851
|
+
}, {
|
|
1852
|
+
reference: r(() => [
|
|
1853
|
+
u(e(G), {
|
|
1854
|
+
size: 13,
|
|
1855
|
+
color: "#999999",
|
|
1856
|
+
style: { cursor: "pointer", "margin-left": "3px" }
|
|
1857
|
+
}, {
|
|
1858
|
+
default: r(() => [
|
|
1859
|
+
u(E)
|
|
1860
|
+
]),
|
|
1861
|
+
_: 1
|
|
1862
|
+
})
|
|
1863
|
+
]),
|
|
1864
|
+
default: r(() => [
|
|
1865
|
+
u(ue, {
|
|
1866
|
+
data: i.schema
|
|
1867
|
+
}, null, 8, ["data"])
|
|
1868
|
+
]),
|
|
1869
|
+
_: 2
|
|
1870
|
+
}, 1032, ["width"])) : y("", !0)
|
|
1871
|
+
], 64)) : (o(), p(H, { key: 1 }, [
|
|
1872
|
+
s("span", {
|
|
1873
|
+
class: "text-span ellipsis",
|
|
1874
|
+
title: i.interfaceName
|
|
1875
|
+
}, d(i.interfaceName), 9, Ma),
|
|
1876
|
+
i.paramsOuter && ye(JSON.parse(i.paramsOuter)).length ? (o(), v(e(ce), {
|
|
1877
|
+
key: 0,
|
|
1878
|
+
placement: "right",
|
|
1879
|
+
width: i.paramsOuter ? 380 : 150,
|
|
1880
|
+
"popper-class": "add-dialog-popover",
|
|
1881
|
+
trigger: "hover"
|
|
1882
|
+
}, {
|
|
1883
|
+
reference: r(() => [
|
|
1884
|
+
u(e(G), {
|
|
1885
|
+
size: 13,
|
|
1886
|
+
color: "#999999",
|
|
1887
|
+
style: { cursor: "pointer", "margin-left": "3px" }
|
|
1888
|
+
}, {
|
|
1889
|
+
default: r(() => [
|
|
1890
|
+
u(E)
|
|
1891
|
+
]),
|
|
1892
|
+
_: 1
|
|
1893
|
+
})
|
|
1894
|
+
]),
|
|
1895
|
+
default: r(() => [
|
|
1896
|
+
u(ue, {
|
|
1897
|
+
data: ye(JSON.parse(i.paramsOuter))
|
|
1898
|
+
}, null, 8, ["data"])
|
|
1899
|
+
]),
|
|
1900
|
+
_: 2
|
|
1901
|
+
}, 1032, ["width"])) : [e(a).plugin].includes(t.currentData.key) ? (o(), v(ea, {
|
|
1902
|
+
key: 1,
|
|
1903
|
+
data: i
|
|
1904
|
+
}, null, 8, ["data"])) : y("", !0)
|
|
1905
|
+
], 64))
|
|
1906
|
+
]),
|
|
1907
|
+
s("div", {
|
|
1908
|
+
class: "custom-add-dialog__right--desc text-description text-ellipsis",
|
|
1909
|
+
title: i.description
|
|
1910
|
+
}, d(i.description), 9, Ga)
|
|
1911
|
+
])
|
|
1912
|
+
]),
|
|
1913
|
+
[e(a).mcp].includes(t.currentData.key) ? (o(), v(oe, {
|
|
1914
|
+
key: 0,
|
|
1915
|
+
data: i,
|
|
1916
|
+
type: e(a).mcp,
|
|
1917
|
+
"need-auth": !i.apiKey && i.state == 0,
|
|
1918
|
+
badge: n.MCPNodeNumObj[i.bnid],
|
|
1919
|
+
onAdd: ne,
|
|
1920
|
+
onRemove: ae,
|
|
1921
|
+
onRefresh: I
|
|
1922
|
+
}, null, 8, ["data", "type", "need-auth", "badge"])) : (o(), v(oe, {
|
|
1923
|
+
key: 1,
|
|
1924
|
+
data: i,
|
|
1925
|
+
type: e(a).plugin,
|
|
1926
|
+
"need-auth": !i.apiKey && i.needApiKey,
|
|
1927
|
+
badge: n.pluginNodeNumObj[i.bnid],
|
|
1928
|
+
onAdd: ne,
|
|
1929
|
+
onRemove: ae
|
|
1930
|
+
}, null, 8, ["data", "type", "need-auth", "badge"]))
|
|
1931
|
+
]))
|
|
1932
|
+
], 64)) : y("", !0)
|
|
1933
|
+
]),
|
|
1934
|
+
_: 1
|
|
1935
|
+
}, 8, ["data", "height", "class"])) : (o(), v(e(Ee), {
|
|
1936
|
+
key: 1,
|
|
1937
|
+
description: e(c)("COMMON_DATA.EMPTY"),
|
|
1938
|
+
"image-size": 60,
|
|
1939
|
+
class: "custom-empty"
|
|
1940
|
+
}, null, 8, ["description"]))
|
|
1941
|
+
]),
|
|
1942
|
+
_: 1
|
|
1943
|
+
})) : (o(), v(qn, {
|
|
1944
|
+
key: 1,
|
|
1945
|
+
data: A.value,
|
|
1946
|
+
"current-index": t.currentIndex,
|
|
1947
|
+
pluginNodeNumObj: n.pluginNodeNumObj,
|
|
1948
|
+
MCPNodeNumObj: n.MCPNodeNumObj,
|
|
1949
|
+
agentNodeNumObj: n.agentNodeNumObj,
|
|
1950
|
+
workflowNodeNumObj: n.workflowNodeNumObj,
|
|
1951
|
+
onAdd: ne,
|
|
1952
|
+
onRemove: ae,
|
|
1953
|
+
onUpdateSuccess: I,
|
|
1954
|
+
"onUpdate:showCardDetail": _[7] || (_[7] = (D) => t.showCardDetail = D)
|
|
1955
|
+
}, null, 8, ["data", "current-index", "pluginNodeNumObj", "MCPNodeNumObj", "agentNodeNumObj", "workflowNodeNumObj"]))
|
|
1956
|
+
])), [
|
|
1957
|
+
[Q, t.loading]
|
|
1958
|
+
])
|
|
1959
|
+
], 2)
|
|
1960
|
+
])
|
|
1961
|
+
]),
|
|
1962
|
+
_: 1
|
|
1963
|
+
}, 8, ["class"]);
|
|
1964
|
+
};
|
|
1965
|
+
}
|
|
1966
|
+
};
|
|
1967
|
+
export {
|
|
1968
|
+
Ha as default
|
|
1969
|
+
};
|