china-mobile-international-custom-components 0.0.47 → 0.0.49

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.
Files changed (65) hide show
  1. package/es/AddOrEditSupplierDialog.mjs +24 -0
  2. package/es/ApplicationTypeTag.mjs +1 -1
  3. package/es/AvailableRangePreview.mjs +1 -1
  4. package/es/AvailableRangeSetting.mjs +2 -2
  5. package/es/CommonTagsList.mjs +3 -3
  6. package/es/DialogContainer.mjs +21 -21
  7. package/es/FileUploader.mjs +121 -123
  8. package/es/ParameterTable.mjs +1 -1
  9. package/es/SourcePublish.mjs +6 -6
  10. package/es/Table.mjs +2 -2
  11. package/es/assets/AddOrEditSupplierDialog.css +1 -0
  12. package/es/assets/index3.css +1 -1
  13. package/es/chunks/{BackBar.DwhmSL-a.js → BackBar.DnDtQBAg.js} +96 -96
  14. package/es/chunks/{BackBar.9Pp2SYB-.js → BackBar.eaUb1JvV.js} +1 -1
  15. package/es/chunks/{config.DVEvXGIL.js → config.CvOtShOj.js} +2 -2
  16. package/es/chunks/config.DkSRacA9.js +435 -0
  17. package/es/chunks/{i18n.DMVLcyDY.js → i18n.Bd7hh14j.js} +2 -2
  18. package/es/chunks/index.B_T3qY7U.js +1008 -0
  19. package/es/chunks/{index.CZTB65ge.js → index.CHlFhI6c.js} +1 -1
  20. package/es/chunks/index.DHcry2-T.js +1010 -0
  21. package/es/chunks/index.JtDVXCay.js +1008 -0
  22. package/es/chunks/index.o4gC5-Xq.js +1011 -0
  23. package/es/chunks/index.qAljoMis.js +976 -0
  24. package/es/index.mjs +227 -188
  25. package/lib/AddOrEditSupplierDialog.js +1 -0
  26. package/lib/ApplicationTypeTag.js +1 -1
  27. package/lib/AvailableRangePreview.js +1 -1
  28. package/lib/AvailableRangeSetting.js +1 -1
  29. package/lib/CommonTagsList.js +1 -1
  30. package/lib/DialogContainer.js +1 -1
  31. package/lib/FileUploader.js +1 -1
  32. package/lib/ParameterTable.js +1 -1
  33. package/lib/SourcePublish.js +1 -1
  34. package/lib/Table.js +1 -1
  35. package/lib/assets/AddOrEditSupplierDialog.css +1 -0
  36. package/lib/assets/index3.css +1 -1
  37. package/lib/chunks/{BackBar.DFDSVp2a.js → BackBar.CaaASGvb.js} +1 -1
  38. package/lib/chunks/BackBar.DhaZZIoV.js +1 -0
  39. package/lib/chunks/{config.Dwnp4fRZ.js → config.CqfpM51B.js} +1 -1
  40. package/lib/chunks/{i18n.Bzvn6t8H.js → i18n.D3L1FBDI.js} +2 -2
  41. package/lib/chunks/index.BhoAcBeE.js +1 -0
  42. package/lib/chunks/index.CE91RC0G.js +1 -0
  43. package/lib/chunks/index.Cv1roodm.js +1 -0
  44. package/lib/chunks/{index.DO3h_zf2.js → index.D-pFPuUr.js} +1 -1
  45. package/lib/chunks/index.D32cNfAI.js +1 -0
  46. package/lib/chunks/index.DusP0A6s.js +1 -0
  47. package/lib/index.js +1 -1
  48. package/package.json +4 -2
  49. package/es/chunks/i18n.BNeBD4gR.js +0 -4028
  50. package/es/chunks/i18n.DUrvNBQz.js +0 -4028
  51. package/es/chunks/index.BcLVH95_.js +0 -4058
  52. package/es/chunks/index.CSPp4g5C.js +0 -303
  53. package/es/chunks/index.ClqvUq64.js +0 -302
  54. package/es/chunks/index.Dh5IGfxO.js +0 -290
  55. package/es/chunks/index.Doax01RQ.js +0 -254
  56. package/es/chunks/layout.C0EtkrZg.js +0 -639
  57. package/lib/chunks/BackBar.CYThcqhK.js +0 -1
  58. package/lib/chunks/i18n.D-d0yyXi.js +0 -6
  59. package/lib/chunks/i18n.Giy85Rng.js +0 -6
  60. package/lib/chunks/index.6X8xsqRJ.js +0 -1
  61. package/lib/chunks/index.Bk55us0s.js +0 -1
  62. package/lib/chunks/index.CP9rhXZ5.js +0 -1
  63. package/lib/chunks/index.CSLWrMRE.js +0 -1
  64. package/lib/chunks/index.CV29Us4A.js +0 -6
  65. package/lib/chunks/layout.BO1q-dAZ.js +0 -1
@@ -0,0 +1,976 @@
1
+ import { w as Le } from "./index.bCzIhWFw.js";
2
+ import { createElementBlock as O, openBlock as u, Fragment as P, createCommentVNode as h, unref as e, renderSlot as ce, createVNode as n, withCtx as i, renderList as Y, createBlock as T, createElementVNode as M, resolveDynamicComponent as de, toDisplayString as R, createTextVNode as S, normalizeClass as ge, computed as Ee, ref as f, onMounted as ve, reactive as Re } from "vue";
3
+ import { u as ue } from "./i18n.Bd7hh14j.js";
4
+ import { g as z } from "./request.24c3shPx.js";
5
+ import { ElRow as De, ElCol as Ae, ElIcon as N, ElButton as V, ElMessage as G, ElForm as Ce, ElFormItem as b, ElInput as B, ElSelect as Ie, ElOption as Te } from "element-plus";
6
+ import { IconDelete as _e, IconHide as we, IconWarn as ye, IconGoto3 as pe, Workflow as Ne } from "color-message-aibox-vue";
7
+ import { UploadTypesEnum as re, FileUploader as he } from "../FileUploader.mjs";
8
+ import "viewerjs/dist/viewer.css";
9
+ import { api as ie } from "v-viewer";
10
+ import { commonFileDelete as xe, commonDownloadInterior as be, commonDownloadForeign as Pe } from "@/apis/files";
11
+ import { downloadBlobFile as Oe } from "@/utils/downloadBlobFile";
12
+ import { _ as Z } from "./_plugin-vue_export-helper.CHgC5LLL.js";
13
+ import { useDialog as me, DialogContainer as Me } from "../DialogContainer.mjs";
14
+ import { useRouter as ke } from "vue-router";
15
+ import '../assets/index3.css';const fe = () => {
16
+ const { $request: l, $env: d } = z();
17
+ return {
18
+ deleteKey: (p) => l({
19
+ url: `${d.VITE_APP_AIBOX_BASE_URL}/api/v1/model/key/${p}`,
20
+ method: "delete"
21
+ }),
22
+ deleteOwnerModel: (p) => l({
23
+ url: `${d.VITE_APP_AIBOX_BASE_URL}/api/v1/model/${p}`,
24
+ method: "delete"
25
+ }),
26
+ addModel: (p) => l({
27
+ url: `${d.VITE_APP_AIBOX_BASE_URL}/api/v1/model`,
28
+ method: "post",
29
+ data: p
30
+ }),
31
+ updateModel: (p, g) => l({
32
+ url: `${d.VITE_APP_AIBOX_BASE_URL}/api/v1/model/${p}`,
33
+ method: "put",
34
+ data: g
35
+ })
36
+ };
37
+ }, Ue = (l) => /(txt|yaml)/i.test(l), Be = (l) => /ppt|pptx/i.test(l), Se = (l) => /pdf/i.test(l);
38
+ function $e(l) {
39
+ return /(docx|doc|msword)/i.test(l);
40
+ }
41
+ function Ve(l) {
42
+ return /(xlsx|xls|sheet|csv)/i.test(l);
43
+ }
44
+ function Ye(l) {
45
+ return /(zip|rar|7z)$/i.test(l);
46
+ }
47
+ const X = (l) => /(jpe?g|png|bmp|gif|webp|svg|ico)(\?.*)?$/i.test(l), Fe = (l) => /(mp4|avi|rmvb|rm|wmv|flv|3gp|mkv|mov)(\?.*)?$/i.test(l), Ke = (l) => /(mp3|wav|wma|aac|flac)(\?.*)?$/i.test(l), He = (l) => /(md|markdown)/i.test(l), Ge = (l) => /(html|htm|xhtml|xml)/i.test(l), Xe = (l) => /(json)/i.test(l), ze = (l) => {
48
+ if (Se(l.suffix))
49
+ return "Pdf1";
50
+ if ($e(l.suffix))
51
+ return "Doc";
52
+ if (Ve(l.suffix))
53
+ return "Excel1";
54
+ if (Fe(l.suffix))
55
+ return "Video";
56
+ if (Ke(l.suffix))
57
+ return "Music";
58
+ if (Be(l.suffix))
59
+ return "Ppt1";
60
+ if (He(l.suffix))
61
+ return "Md";
62
+ if (Ge(l.suffix))
63
+ return "Html";
64
+ if (Ue(l.suffix))
65
+ return "Txt1";
66
+ if (Xe(l.suffix))
67
+ return "Other";
68
+ if (Ye(l.suffix))
69
+ return "Other";
70
+ }, qe = () => ({
71
+ downloadPrew: async (_) => {
72
+ const { data: m } = await Pe({ "file-ids": [_.bnid] });
73
+ m && (X(_.suffix) || X(m[0].suffix) ? (m && m.length, ie({
74
+ images: [m[0].url],
75
+ options: {
76
+ zIndex: 3e3
77
+ }
78
+ })) : window.open(m[0].url, "_blank"));
79
+ },
80
+ downloadStreamPrew: async (_) => {
81
+ const m = await be({ "file-ids": [_.bnid] });
82
+ if (m)
83
+ if (X(_.suffix)) {
84
+ const p = Oe(m, _.name, "image");
85
+ m && ie({
86
+ images: [p],
87
+ options: {
88
+ zIndex: 3e3
89
+ }
90
+ });
91
+ } else
92
+ Oe(m, _.name);
93
+ },
94
+ previewImage: (_) => {
95
+ ie({
96
+ images: [_],
97
+ options: {
98
+ zIndex: 3e3
99
+ }
100
+ });
101
+ },
102
+ deleteFile: async (_) => {
103
+ await xe({ "file-ids": [_.bnid] });
104
+ }
105
+ }), We = {
106
+ key: 0,
107
+ class: "panel-preview"
108
+ }, je = { class: "panel-preview__item" }, Qe = ["onClick"], Je = ["src", "alt"], Ze = { class: "panel-preview__name ellipsis" }, el = { key: 0 }, ll = { key: 1 }, tl = {
109
+ key: 1,
110
+ class: "upload-preview"
111
+ }, ol = ["src", "alt"], sl = { class: "preview-item__mask" }, al = {
112
+ __name: "FilePreview",
113
+ props: {
114
+ fileList: {
115
+ type: Array,
116
+ default: () => []
117
+ },
118
+ canEdit: {
119
+ type: Boolean,
120
+ default: !0
121
+ },
122
+ previewType: {
123
+ type: String,
124
+ default: re.面板
125
+ },
126
+ isStream: {
127
+ type: Boolean,
128
+ default: !1
129
+ },
130
+ isCustom: {
131
+ type: Boolean,
132
+ default: !1
133
+ }
134
+ },
135
+ emits: ["on-remove", "on-preview"],
136
+ setup(l, { emit: d }) {
137
+ const { downloadPrew: L, downloadStreamPrew: o } = qe(), { t: _ } = ue(), m = l, p = d, g = (c) => ze(c);
138
+ function $(c) {
139
+ m.isCustom ? p("on-preview", c) : m.isStream ? o(c) : L(c);
140
+ }
141
+ function D(c, A) {
142
+ p("on-remove", c, A);
143
+ }
144
+ return (c, A) => (u(), O(P, null, [
145
+ l.previewType === e(re).面板 ? (u(), O("div", We, [
146
+ ce(c.$slots, "PanelUploader", {}, void 0, !0),
147
+ n(e(De), {
148
+ gutter: 20,
149
+ class: "panel-preview__row"
150
+ }, {
151
+ default: i(() => [
152
+ (u(!0), O(P, null, Y(l.fileList, (E, C) => (u(), T(e(Ae), {
153
+ span: 8,
154
+ key: E.bnid
155
+ }, {
156
+ default: i(() => [
157
+ M("div", je, [
158
+ M("div", {
159
+ class: "panel-preview__box",
160
+ onClick: (x) => $(E)
161
+ }, [
162
+ e(X)(E.suffix) ? (u(), O("img", {
163
+ key: 0,
164
+ src: E.url,
165
+ alt: E.name,
166
+ class: "panel-preview__img"
167
+ }, null, 8, Je)) : (u(), T(e(N), {
168
+ key: 1,
169
+ size: "32px",
170
+ class: "panel-preview__img"
171
+ }, {
172
+ default: i(() => [
173
+ (u(), T(de(g(E))))
174
+ ]),
175
+ _: 2
176
+ }, 1024)),
177
+ M("span", Ze, R(E.name), 1)
178
+ ], 8, Qe),
179
+ E.isUploading ? (u(), O("div", el, [
180
+ n(e(V), {
181
+ text: "",
182
+ size: "small",
183
+ loading: ""
184
+ }, {
185
+ default: i(() => [
186
+ S(R(e(_)("COMPONENTS.UPLOADING")) + "...", 1)
187
+ ]),
188
+ _: 1
189
+ })
190
+ ])) : (u(), O("div", ll, [
191
+ l.canEdit ? (u(), T(e(N), {
192
+ key: 0,
193
+ size: "18",
194
+ style: { cursor: "pointer" },
195
+ onClick: (x) => D(C, E)
196
+ }, {
197
+ default: i(() => [
198
+ n(e(_e))
199
+ ]),
200
+ _: 1
201
+ }, 8, ["onClick"])) : h("", !0)
202
+ ]))
203
+ ])
204
+ ]),
205
+ _: 2
206
+ }, 1024))), 128))
207
+ ]),
208
+ _: 1
209
+ })
210
+ ])) : h("", !0),
211
+ l.previewType === e(re).卡片 ? (u(), O("ul", tl, [
212
+ (u(!0), O(P, null, Y(l.fileList, (E, C) => (u(), O("li", {
213
+ class: "preview-item",
214
+ key: E.bnid
215
+ }, [
216
+ e(X)(E.suffix) ? (u(), O("img", {
217
+ key: 0,
218
+ src: E.url,
219
+ alt: E.name,
220
+ class: "preview-item__img"
221
+ }, null, 8, ol)) : (u(), T(e(N), {
222
+ key: 1,
223
+ size: "32px",
224
+ class: "preview-item__img"
225
+ }, {
226
+ default: i(() => [
227
+ (u(), T(de(g(E))))
228
+ ]),
229
+ _: 2
230
+ }, 1024)),
231
+ M("div", sl, [
232
+ n(e(N), {
233
+ class: "preview-item__mask--view",
234
+ onClick: (x) => $(E)
235
+ }, {
236
+ default: i(() => [
237
+ n(e(we))
238
+ ]),
239
+ _: 1
240
+ }, 8, ["onClick"]),
241
+ l.canEdit ? (u(), T(e(N), {
242
+ key: 0,
243
+ class: "preview-item__mask--delete",
244
+ onClick: (x) => D(C, E)
245
+ }, {
246
+ default: i(() => [
247
+ n(e(_e))
248
+ ]),
249
+ _: 1
250
+ }, 8, ["onClick"])) : h("", !0)
251
+ ])
252
+ ]))), 128)),
253
+ ce(c.$slots, "CardUploader", {}, void 0, !0)
254
+ ])) : h("", !0)
255
+ ], 64));
256
+ }
257
+ }, nl = /* @__PURE__ */ Z(al, [["__scopeId", "data-v-b86944c6"]]), rl = () => {
258
+ const { $request: l, $env: d } = z();
259
+ return {
260
+ getSystemReference: (o) => l({
261
+ url: `${d.VITE_APP_AIBOX_BASE_URL}/api/v1/system/reference`,
262
+ method: "get",
263
+ params: o
264
+ })
265
+ };
266
+ }, il = () => {
267
+ const { $request: l, $env: d } = z();
268
+ return {
269
+ deleteKnowledgeBase: (o) => l({
270
+ url: `${d.VITE_APP_AIBOX_BASE_URL}/api/v1/library/${o}`,
271
+ method: "delete"
272
+ })
273
+ };
274
+ }, dl = () => {
275
+ const { $request: l, $env: d } = z();
276
+ return {
277
+ del: (o) => l({
278
+ url: `${d.VITE_APP_AIBOX_BASE_URL}/api/v1/workflow/${o}`,
279
+ method: "delete"
280
+ })
281
+ };
282
+ }, ul = () => {
283
+ const { $request: l, $env: d } = z();
284
+ return {
285
+ deleteId: (_) => l({
286
+ url: `${d.VITE_APP_AIBOX_BASE_URL}/api/v1/plugin/${_}`,
287
+ method: "delete"
288
+ }),
289
+ deleteTools: (_) => l({
290
+ url: `${d.VITE_APP_AIBOX_BASE_URL}/api/v1/plugin/tools/${_}`,
291
+ method: "delete"
292
+ })
293
+ };
294
+ }, cl = { class: "ai-box-tabs overflow-hidden" }, _l = ["onClick"], pl = {
295
+ __name: "AiboxTabs",
296
+ props: {
297
+ modelValue: {
298
+ type: [String, Number],
299
+ default: () => ""
300
+ },
301
+ tabList: {
302
+ type: Array,
303
+ default: () => []
304
+ }
305
+ },
306
+ emits: ["update:modelValue", "change"],
307
+ setup(l, { emit: d }) {
308
+ const L = d, o = (_) => {
309
+ L("update:modelValue", _.value), L("change", _.value);
310
+ };
311
+ return (_, m) => (u(), O("div", cl, [
312
+ M("ul", null, [
313
+ (u(!0), O(P, null, Y(l.tabList, (p) => (u(), O("li", {
314
+ key: p.value,
315
+ onClick: (g) => o(p),
316
+ class: ge(l.modelValue === p.value ? "current" : "")
317
+ }, R(p.label), 11, _l))), 128))
318
+ ])
319
+ ]));
320
+ }
321
+ }, Ol = /* @__PURE__ */ Z(pl, [["__scopeId", "data-v-f526f5ca"]]), El = { class: "delete-title" }, ml = { class: "custom-message-box" }, Ml = {
322
+ class: "custom-message-box__title",
323
+ style: { "line-height": "24px" }
324
+ }, fl = { style: { color: "red" } }, Ll = {
325
+ key: 0,
326
+ class: "custom-message-box__tip"
327
+ }, gl = {
328
+ key: 0,
329
+ class: "delete-tabs"
330
+ }, vl = {
331
+ key: 0,
332
+ class: "resource-list"
333
+ }, Rl = ["onClick"], Dl = { class: "item-title" }, Al = {
334
+ key: 1,
335
+ class: "resource-list"
336
+ }, Cl = ["onClick"], Il = { class: "item-title" }, Tl = { class: "dialog-footer" }, wl = {
337
+ __name: "DeleteResourceDialog",
338
+ props: {
339
+ title: {
340
+ type: String,
341
+ default: ""
342
+ },
343
+ deleteType: {
344
+ type: String,
345
+ default: ""
346
+ }
347
+ },
348
+ emits: ["success"],
349
+ setup(l, { expose: d, emit: L }) {
350
+ const { getSystemReference: o } = rl(), { deleteKnowledgeBase: _ } = il(), { del: m } = dl(), { deleteId: p, deleteTools: g } = ul(), { deleteKey: $, deleteOwnerModel: D } = fe(), { t: c } = ue(), A = ke(), { dialogRef: E, showDialog: C, hideDialog: x } = me(), q = l, F = L, r = Ee(() => {
351
+ const t = [];
352
+ return w.value.length && t.push({
353
+ // label: `${t('PLUGINLIST.APPLICATION_REFERENCED') || '已发布应用引用'}(${applyList.value.length})`,
354
+ label: c("COMPONENTS_OUTER_SPHERE.APPLICATION_REFERENCE", {
355
+ num: w.value.length
356
+ }),
357
+ value: "1"
358
+ }), y.value.length && t.push({
359
+ // label: `${t('PLUGINLIST.APPLICATION_REFERENCED_INFO') || '已发布工作流引用'}(${workflowList.value.length})`,
360
+ label: c("COMPONENTS_OUTER_SPHERE.WORKFLOW_REFERENCE", {
361
+ num: y.value.length
362
+ }),
363
+ value: "2"
364
+ }), t;
365
+ }), k = f("1"), v = f(""), w = f([]), y = f([]), ee = (t) => {
366
+ const a = {
367
+ model: {
368
+ code: 1,
369
+ desc: c("COMMON_TAG.APPLICATION"),
370
+ deleteFn: async () => await D(v.value)
371
+ },
372
+ knowledge: {
373
+ code: 2,
374
+ desc: c("COMMON_TAG.KNOWLEDGE_BASE"),
375
+ deleteFn: async () => await _(v.value)
376
+ },
377
+ workflow: {
378
+ code: 4,
379
+ desc: c("COMMON_TAG.WORKFLOW"),
380
+ deleteFn: async () => await m(v.value)
381
+ },
382
+ plugin: {
383
+ code: 6,
384
+ desc: c("COMMON_TAG.PLUGIN"),
385
+ deleteFn: async () => await p(v.value)
386
+ },
387
+ pluglit: {
388
+ code: 6,
389
+ desc: c("COMMON_TAG.TOOL"),
390
+ deleteFn: async () => await g(v.value)
391
+ },
392
+ modelKey: {
393
+ code: 7,
394
+ desc: c("COMMON_TAG.MODEL_KEY"),
395
+ deleteFn: async () => await $(v.value)
396
+ }
397
+ };
398
+ return console.log(t, "value"), a[t];
399
+ }, le = async () => {
400
+ let t = v.value;
401
+ q.deleteType == "plugin" && (t = j.value);
402
+ const a = {
403
+ bnid: t,
404
+ size: 999,
405
+ page: 1,
406
+ "business-type": W
407
+ }, { code: s, data: I } = await o(a);
408
+ s === 0 && ((I.data || []).forEach((J) => {
409
+ J.name == "workflow" && (y.value = J.data), J.name == "agent" && (w.value = J.data);
410
+ }), w.value.length || (k.value = "2"));
411
+ }, U = f("");
412
+ let W = "", K = null;
413
+ ve(() => {
414
+ const t = ee(q.deleteType);
415
+ U.value = t.desc || "", W = t.code || "", K = t.deleteFn || null;
416
+ });
417
+ const j = f(""), te = (t, a = "") => {
418
+ v.value = t, j.value = a, C(), le();
419
+ }, oe = async () => {
420
+ if (!K) return;
421
+ const t = await K();
422
+ t && t.code == 0 ? (G({
423
+ // message: `${t('COMMON_BUTTON.DELETE_TEXT') || '删除'}${deleteTypeStr.value}${t('MESSAGE_REMIND.SUCCESS_TEXT') || '成功'}`,
424
+ message: c("COMPONENTS_OUTER_SPHERE.DELETE_DATA_SUCCESS", {
425
+ name: U.value
426
+ }),
427
+ type: "success"
428
+ }), F("success"), H()) : G({
429
+ // message: `${t('COMMON_BUTTON.DELETE_TEXT' || '删除')}${deleteTypeStr.value}${t('MESSAGE_REMIND.FAIL_TEXT') || '失败'}`,
430
+ message: c("COMPONENTS_OUTER_SPHERE.DELETE_DATA_FAILED", {
431
+ name: U.value
432
+ }),
433
+ type: "error"
434
+ });
435
+ }, se = (t) => {
436
+ A.push({ name: "AgentDetail", params: { bnid: t.skillet } });
437
+ }, Q = (t) => {
438
+ A.push({ name: "Workflow", params: { workflowBnid: t.skillet } });
439
+ }, ae = () => {
440
+ }, H = () => {
441
+ x(), v.value = "", w.value = [], y.value = [];
442
+ };
443
+ return d({ showDeleteDialog: te, hideDeleteDialog: H }), (t, a) => (u(), T(e(Me), {
444
+ title: l.title || e(c)("COMPONENTS_OUTER_SPHERE.CONFIRM_DELETE", { deleteTypeStr: U.value }),
445
+ width: "520px",
446
+ ref_key: "dialogRef",
447
+ ref: E
448
+ }, {
449
+ footer: i(() => [
450
+ M("div", Tl, [
451
+ n(e(V), { onClick: H }, {
452
+ default: i(() => [
453
+ S(R(e(c)("COMMON_BUTTON.CANCEL_TEXT")), 1)
454
+ ]),
455
+ _: 1
456
+ }),
457
+ n(e(V), {
458
+ type: "danger",
459
+ onClick: oe
460
+ }, {
461
+ default: i(() => [
462
+ S(R(e(c)("COMMON_BUTTON.CONFIRM_AFFIRM")), 1)
463
+ ]),
464
+ _: 1
465
+ })
466
+ ])
467
+ ]),
468
+ default: i(() => [
469
+ M("div", El, [
470
+ n(e(N), { class: "warning-icon" }, {
471
+ default: i(() => [
472
+ n(e(ye))
473
+ ]),
474
+ _: 1
475
+ }),
476
+ M("div", ml, [
477
+ M("div", Ml, [
478
+ S(R(e(c)("COMPONENTS_OUTER_SPHERE.HISTORY_REFERENCE", { deleteTypeStr: U.value })) + " ", 1),
479
+ M("span", fl, R(e(c)("PLUGINLIST.CAUTION")), 1)
480
+ ]),
481
+ w.value.length || y.value.length ? (u(), O("div", Ll, R(e(c)("PLUGINLIST.CAUTION_INFO")), 1)) : h("", !0),
482
+ a[1] || (a[1] = M("div", null, null, -1))
483
+ ])
484
+ ]),
485
+ w.value.length || y.value.length ? (u(), O("div", gl, [
486
+ n(Ol, {
487
+ modelValue: k.value,
488
+ "onUpdate:modelValue": a[0] || (a[0] = (s) => k.value = s),
489
+ tabList: r.value,
490
+ onChange: ae
491
+ }, null, 8, ["modelValue", "tabList"]),
492
+ k.value == "1" ? (u(), O("div", vl, [
493
+ (u(!0), O(P, null, Y(w.value, (s) => (u(), O("div", {
494
+ class: "resource-item",
495
+ key: s.resource,
496
+ onClick: (I) => se(s)
497
+ }, [
498
+ a[2] || (a[2] = M("div", { class: "flow-name__icon-placeholder" }, null, -1)),
499
+ M("div", Dl, R(s.name), 1),
500
+ n(e(N), null, {
501
+ default: i(() => [
502
+ n(e(pe))
503
+ ]),
504
+ _: 1
505
+ })
506
+ ], 8, Rl))), 128))
507
+ ])) : h("", !0),
508
+ k.value == "2" ? (u(), O("div", Al, [
509
+ (u(!0), O(P, null, Y(y.value, (s) => (u(), O("div", {
510
+ class: "resource-item",
511
+ key: s.resource,
512
+ onClick: (I) => Q(s)
513
+ }, [
514
+ n(e(N), { size: "32px" }, {
515
+ default: i(() => [
516
+ n(e(Ne))
517
+ ]),
518
+ _: 1
519
+ }),
520
+ M("div", Il, R(s.name), 1),
521
+ n(e(N), null, {
522
+ default: i(() => [
523
+ n(e(pe))
524
+ ]),
525
+ _: 1
526
+ })
527
+ ], 8, Cl))), 128))
528
+ ])) : h("", !0)
529
+ ])) : h("", !0)
530
+ ]),
531
+ _: 1
532
+ }, 8, ["title"]));
533
+ }
534
+ }, yl = /* @__PURE__ */ Z(wl, [["__scopeId", "data-v-71205bec"]]), Nl = { class: "dialog-footer" }, hl = {
535
+ __name: "AddOrEditSupplierDialog",
536
+ emits: ["submit", "success"],
537
+ setup(l, { expose: d, emit: L }) {
538
+ const { t: o } = ue(), { addModel: _, updateModel: m } = fe(), p = f(null), g = f([]), $ = f(!1), D = f(!1), { dialogRef: c, hideDialog: A, resetDialog: E } = me(D), C = f(!1), x = f(""), q = Ee(() => C.value ? o("COMMON_MODEL_LIBRARY.EDIT_MODEL") : o("COMMON_MODEL_LIBRARY.ADD_MODEL")), F = f(""), r = Re({
539
+ name: "",
540
+ code: "",
541
+ type: "",
542
+ description: "",
543
+ // supplier: '',
544
+ apiKey: "",
545
+ apiUrl: "",
546
+ bnid: null,
547
+ maxTokens: 2e6,
548
+ contextLength: 2e6,
549
+ icon: "0",
550
+ avatarUrl: ""
551
+ }), k = [
552
+ {
553
+ label: o("COMMON_MODEL_LIBRARY.MODEL_TYPE_LARGE_LANGUAGE_MODEL"),
554
+ value: "llm"
555
+ },
556
+ {
557
+ label: o("COMMON_MODEL_LIBRARY.MODEL_TYPE_MULTIMODAL_MODEL"),
558
+ value: "multimodal"
559
+ },
560
+ {
561
+ label: o("COMMON_MODEL_LIBRARY.MODEL_TYPE_EMBEDDING_MODEL"),
562
+ value: "embedding"
563
+ },
564
+ { label: o("COMMON_MODEL_LIBRARY.MODEL_TYPE_RERANK_MODEL"), value: "rerank" }
565
+ ], v = f(!r.bnid), w = {
566
+ name: [
567
+ {
568
+ required: !0,
569
+ message: o("COMMON_MODEL_LIBRARY.MODEL_NAME_REQUIRED"),
570
+ trigger: "blur"
571
+ },
572
+ {
573
+ max: 64,
574
+ message: o("COMMON_MODEL_LIBRARY.MODEL_NAME_MAX_LENGTH"),
575
+ trigger: "blur"
576
+ },
577
+ {
578
+ validator: (t, a, s) => {
579
+ a && /\s/.test(a) ? s(new Error(o("COMMON_MODEL_LIBRARY.MODEL_NAME_NO_SPACE"))) : s();
580
+ },
581
+ trigger: "blur"
582
+ }
583
+ ],
584
+ code: [
585
+ {
586
+ required: !0,
587
+ message: o("COMMON_MODEL_LIBRARY.MODEL_CODE_REQUIRED"),
588
+ trigger: "blur"
589
+ },
590
+ {
591
+ max: 64,
592
+ message: o("COMMON_MODEL_LIBRARY.MODEL_CODE_MAX_LENGTH"),
593
+ trigger: "blur"
594
+ },
595
+ {
596
+ validator: (t, a, s) => {
597
+ a && /\s/.test(a) ? s(new Error(o("COMMON_MODEL_LIBRARY.MODEL_CODE_NO_SPACE"))) : s();
598
+ },
599
+ trigger: "blur"
600
+ }
601
+ ],
602
+ type: [
603
+ {
604
+ required: !0,
605
+ message: o("COMMON_MODEL_LIBRARY.MODEL_TYPE_PLACEHOLDER"),
606
+ trigger: "change"
607
+ }
608
+ ],
609
+ // description: [{ required: true, message: '请输入供应商描述', trigger: 'blur' }],
610
+ maxTokens: [
611
+ {
612
+ required: !0,
613
+ message: o("COMMON_MODEL_LIBRARY.MAX_TOKENS_PLACEHOLDER"),
614
+ trigger: "blur"
615
+ }
616
+ ],
617
+ contextLength: [
618
+ {
619
+ required: !0,
620
+ message: o("COMMON_MODEL_LIBRARY.CONTEXT_LENGTH_PLACEHOLDER"),
621
+ trigger: "blur"
622
+ }
623
+ ],
624
+ apiKey: [
625
+ {
626
+ required: !0,
627
+ message: o("COMMON_MODEL_LIBRARY.API_KEY_REQUIRED"),
628
+ trigger: "blur"
629
+ }
630
+ ],
631
+ apiUrl: [
632
+ {
633
+ required: !0,
634
+ message: o("COMMON_MODEL_LIBRARY.API_URL_REQUIRED"),
635
+ trigger: "blur"
636
+ },
637
+ {
638
+ validator: (t, a, s) => {
639
+ if (!a) {
640
+ s();
641
+ return;
642
+ }
643
+ try {
644
+ const I = new URL(a);
645
+ if (I.protocol !== "http:" && I.protocol !== "https:") {
646
+ s(new Error(o("COMMON_MODEL_LIBRARY.API_URL_INVALID")));
647
+ return;
648
+ }
649
+ s();
650
+ } catch {
651
+ s(new Error(o("COMMON_MODEL_LIBRARY.API_URL_INVALID_DESC")));
652
+ }
653
+ },
654
+ trigger: "blur"
655
+ }
656
+ ]
657
+ }, y = L, ee = (t = null) => {
658
+ console.log("data:", t), Object.assign(r, {
659
+ name: "",
660
+ code: "",
661
+ type: "",
662
+ description: "",
663
+ maxTokens: 2e6,
664
+ contextLength: 2e6,
665
+ supplier: "",
666
+ apiKey: "",
667
+ apiUrl: "",
668
+ bnid: null,
669
+ avatarUrl: "",
670
+ icon: "0"
671
+ }), x.value = t?.rowData?.bnid || "", t?.rowData ? (console.log("rowData:", t.rowData), t.rowData.apiKey || ($.value = !0), Object.assign(r, t.rowData), F.value = t.rowData.apiUrl || "") : F.value = "", g.value = [], t ? (r.supplier = t.supplier || "", C.value = t.isEditDialog ?? !1, t.rowData?.icon && t.rowData.icon !== "0" && t.rowData?.avatarUrl && (g.value = [
672
+ {
673
+ bnid: t.rowData.icon,
674
+ url: t.rowData.avatarUrl
675
+ }
676
+ ])) : C.value = !1, c.value?.showDialog();
677
+ }, le = (t) => {
678
+ t > 2e9 ? r.maxTokens = 2e9 : r.maxTokens = t;
679
+ }, U = (t) => {
680
+ t > 2e9 ? r.contextLength = 2e9 : r.contextLength = t;
681
+ }, W = async () => {
682
+ p.value && await p.value.validate(async (t) => {
683
+ if (t) {
684
+ D.value = !0;
685
+ const a = 2e9;
686
+ let s = Number(r.maxTokens), I = Number(r.contextLength);
687
+ s = Math.min(s, a), I = Math.min(I, a);
688
+ const ne = {
689
+ name: r.name,
690
+ code: r.code,
691
+ icon: r.icon,
692
+ type: r.type,
693
+ description: r.description,
694
+ maxTokens: s,
695
+ contextLength: I,
696
+ apiKey: r.apiKey,
697
+ apiUrl: r.apiUrl
698
+ };
699
+ C.value ? await j(ne) : K(ne);
700
+ } else
701
+ G.error(o("COMMON_MODEL_LIBRARY.REQUIRED"));
702
+ });
703
+ }, K = async (t) => {
704
+ try {
705
+ console.log(t), (await _(t)).code === 0 && (G.success(o("COMMON_MODEL_LIBRARY.CREATE_MODEL_SUCCESS")), A(), y("submit"));
706
+ } finally {
707
+ D.value = !1;
708
+ }
709
+ }, j = async (t) => {
710
+ console.log("更新模型formData:", t);
711
+ try {
712
+ (await m(x.value, t)).code === 0 && (G.success(o("COMMON_MODEL_LIBRARY.UPDATE_MODEL_SUCCESS")), A());
713
+ } finally {
714
+ D.value = !1;
715
+ }
716
+ }, te = () => {
717
+ v.value = !v.value;
718
+ }, oe = (t) => {
719
+ r.avatarUrl = t.url, r.icon = t.bnid, g.value = [t];
720
+ }, se = () => {
721
+ r.icon = "0", g.value = [];
722
+ }, Q = f(null), ae = () => {
723
+ Q.value.showDeleteDialog(x.value);
724
+ }, H = () => {
725
+ A(), y("success");
726
+ };
727
+ return d({
728
+ showDialog: ee,
729
+ hideDialog: A
730
+ }), (t, a) => (u(), O(P, null, [
731
+ n(e(Me), {
732
+ class: "custom-model-dialog",
733
+ ref_key: "dialogRef",
734
+ ref: c,
735
+ title: q.value,
736
+ width: "520px",
737
+ onClosed: e(E)
738
+ }, {
739
+ footer: i(() => [
740
+ M("div", Nl, [
741
+ C.value ? (u(), T(e(V), {
742
+ key: 0,
743
+ style: { float: "left" },
744
+ type: "danger",
745
+ onClick: ae
746
+ }, {
747
+ default: i(() => [
748
+ S(R(e(o)("COMMON_BUTTON.DELETE_TEXT")), 1)
749
+ ]),
750
+ _: 1
751
+ })) : h("", !0),
752
+ n(e(V), { onClick: e(A) }, {
753
+ default: i(() => [
754
+ S(R(e(o)("COMMON_BUTTON.CANCEL_TEXT")), 1)
755
+ ]),
756
+ _: 1
757
+ }, 8, ["onClick"]),
758
+ n(e(V), {
759
+ type: "primary",
760
+ loading: D.value,
761
+ onClick: W,
762
+ disabled: D.value
763
+ }, {
764
+ default: i(() => [
765
+ S(R(D.value ? e(o)("COMMON_MODEL_LIBRARY.VALIDATION_LOADING") : e(o)("COMMON_BUTTON.CONFIRM_TEXT")), 1)
766
+ ]),
767
+ _: 1
768
+ }, 8, ["loading", "disabled"])
769
+ ])
770
+ ]),
771
+ default: i(() => [
772
+ n(e(Ce), {
773
+ ref_key: "formRef",
774
+ ref: p,
775
+ model: r,
776
+ rules: w,
777
+ "label-width": "auto",
778
+ class: "vertical-form"
779
+ }, {
780
+ default: i(() => [
781
+ n(e(b), {
782
+ label: e(o)("COMMON_MODEL_LIBRARY.MODEL_NAME"),
783
+ prop: "name"
784
+ }, {
785
+ default: i(() => [
786
+ n(e(B), {
787
+ modelValue: r.name,
788
+ "onUpdate:modelValue": a[0] || (a[0] = (s) => r.name = s),
789
+ placeholder: e(o)("COMMON_MODEL_LIBRARY.MODEL_NAME_PLACEHOLDER"),
790
+ maxlength: 64
791
+ }, null, 8, ["modelValue", "placeholder"])
792
+ ]),
793
+ _: 1
794
+ }, 8, ["label"]),
795
+ n(e(b), {
796
+ label: e(o)("COMMON_MODEL_LIBRARY.MODEL_CODE"),
797
+ prop: "code"
798
+ }, {
799
+ default: i(() => [
800
+ n(e(B), {
801
+ modelValue: r.code,
802
+ "onUpdate:modelValue": a[1] || (a[1] = (s) => r.code = s),
803
+ placeholder: e(o)("COMMON_MODEL_LIBRARY.MODEL_CODE_PLACEHOLDER"),
804
+ maxlength: 64
805
+ }, null, 8, ["modelValue", "placeholder"])
806
+ ]),
807
+ _: 1
808
+ }, 8, ["label"]),
809
+ n(e(b), {
810
+ label: e(o)("COMMON_MODEL_LIBRARY.MODEL_AVATAR_URL"),
811
+ prop: "avatarUrl"
812
+ }, {
813
+ default: i(() => [
814
+ n(nl, {
815
+ fileList: g.value,
816
+ previewType: "Card",
817
+ onOnRemove: se
818
+ }, {
819
+ CardUploader: i(() => [
820
+ g.value.length === 0 ? (u(), T(e(he), {
821
+ key: 0,
822
+ limitSize: 5,
823
+ acceptType: ".jpg,.png",
824
+ defaultUploadIcon: "model",
825
+ onOnSuccess: oe,
826
+ businessType: "model"
827
+ })) : h("", !0)
828
+ ]),
829
+ _: 1
830
+ }, 8, ["fileList"])
831
+ ]),
832
+ _: 1
833
+ }, 8, ["label"]),
834
+ n(e(b), {
835
+ label: e(o)("COMMON_MODEL_LIBRARY.MODEL_TYPE"),
836
+ prop: "type"
837
+ }, {
838
+ default: i(() => [
839
+ n(e(Ie), {
840
+ modelValue: r.type,
841
+ "onUpdate:modelValue": a[2] || (a[2] = (s) => r.type = s),
842
+ placeholder: e(o)("COMMON_MODEL_LIBRARY.MODEL_TYPE_PLACEHOLDER"),
843
+ style: { width: "100%" }
844
+ }, {
845
+ default: i(() => [
846
+ (u(), O(P, null, Y(k, (s) => n(e(Te), {
847
+ key: s.value,
848
+ label: s.label,
849
+ value: s.value
850
+ }, null, 8, ["label", "value"])), 64))
851
+ ]),
852
+ _: 1
853
+ }, 8, ["modelValue", "placeholder"])
854
+ ]),
855
+ _: 1
856
+ }, 8, ["label"]),
857
+ n(e(b), {
858
+ label: e(o)("COMMON_MODEL_LIBRARY.MODEL_DESCRIPTION"),
859
+ prop: "description"
860
+ }, {
861
+ default: i(() => [
862
+ n(e(B), {
863
+ modelValue: r.description,
864
+ "onUpdate:modelValue": a[3] || (a[3] = (s) => r.description = s),
865
+ type: "textarea",
866
+ placeholder: e(o)("COMMON_MODEL_LIBRARY.MODEL_DESCRIPTION_PLACEHOLDER"),
867
+ maxlength: 200,
868
+ "show-word-limit": ""
869
+ }, null, 8, ["modelValue", "placeholder"])
870
+ ]),
871
+ _: 1
872
+ }, 8, ["label"]),
873
+ n(e(b), {
874
+ label: e(o)("COMMON_MODEL_LIBRARY.MAX_TOKENS"),
875
+ prop: "maxTokens"
876
+ }, {
877
+ default: i(() => [
878
+ n(e(B), {
879
+ modelValue: r.maxTokens,
880
+ "onUpdate:modelValue": a[4] || (a[4] = (s) => r.maxTokens = s),
881
+ placeholder: e(o)("COMMON_MODEL_LIBRARY.MAX_TOKENS_PLACEHOLDER"),
882
+ onInput: le
883
+ }, null, 8, ["modelValue", "placeholder"])
884
+ ]),
885
+ _: 1
886
+ }, 8, ["label"]),
887
+ n(e(b), {
888
+ label: e(o)("COMMON_MODEL_LIBRARY.CONTEXT_LENGTH"),
889
+ prop: "contextLength"
890
+ }, {
891
+ default: i(() => [
892
+ n(e(B), {
893
+ modelValue: r.contextLength,
894
+ "onUpdate:modelValue": a[5] || (a[5] = (s) => r.contextLength = s),
895
+ placeholder: e(o)("COMMON_MODEL_LIBRARY.CONTEXT_LENGTH_PLACEHOLDER"),
896
+ onInput: U
897
+ }, null, 8, ["modelValue", "placeholder"])
898
+ ]),
899
+ _: 1
900
+ }, 8, ["label"]),
901
+ n(e(b), {
902
+ label: e(o)("COMMON_MODEL_LIBRARY.API_KEY"),
903
+ prop: "apiKey"
904
+ }, {
905
+ default: i(() => [
906
+ n(e(B), {
907
+ modelValue: r.apiKey,
908
+ "onUpdate:modelValue": a[6] || (a[6] = (s) => r.apiKey = s),
909
+ placeholder: e(o)("COMMON_MODEL_LIBRARY.API_KEY_PLACEHOLDER"),
910
+ type: v.value ? "text" : "password"
911
+ }, {
912
+ suffix: i(() => [
913
+ n(e(N), {
914
+ class: "cursor-pointer",
915
+ onClick: te
916
+ }, {
917
+ default: i(() => [
918
+ (u(), T(de(v.value ? "IconLook" : "IconHide")))
919
+ ]),
920
+ _: 1
921
+ })
922
+ ]),
923
+ _: 1
924
+ }, 8, ["modelValue", "placeholder", "type"])
925
+ ]),
926
+ _: 1
927
+ }, 8, ["label"]),
928
+ n(e(b), {
929
+ label: e(o)("COMMON_MODEL_LIBRARY.API_URL"),
930
+ prop: "apiUrl"
931
+ }, {
932
+ default: i(() => [
933
+ n(e(B), {
934
+ modelValue: r.apiUrl,
935
+ "onUpdate:modelValue": a[7] || (a[7] = (s) => r.apiUrl = s),
936
+ placeholder: e(o)("COMMON_MODEL_LIBRARY.API_URL_PLACEHOLDER"),
937
+ disabled: !!F.value
938
+ }, null, 8, ["modelValue", "placeholder", "disabled"])
939
+ ]),
940
+ _: 1
941
+ }, 8, ["label"])
942
+ ]),
943
+ _: 1
944
+ }, 8, ["model"])
945
+ ]),
946
+ _: 1
947
+ }, 8, ["title", "onClosed"]),
948
+ n(yl, {
949
+ ref_key: "deleteResourceDialog",
950
+ ref: Q,
951
+ deleteType: "model",
952
+ onSuccess: H
953
+ }, null, 512)
954
+ ], 64));
955
+ }
956
+ }, xl = /* @__PURE__ */ Z(hl, [["__scopeId", "data-v-36a3918c"]]), zl = Le(xl);
957
+ export {
958
+ zl as A,
959
+ yl as D,
960
+ nl as F,
961
+ Ol as a,
962
+ Ve as b,
963
+ Ge as c,
964
+ X as d,
965
+ Xe as e,
966
+ He as f,
967
+ Se as g,
968
+ Be as h,
969
+ Ke as i,
970
+ Ue as j,
971
+ Fe as k,
972
+ $e as l,
973
+ Ye as m,
974
+ qe as n,
975
+ ze as u
976
+ };