aibox-custom-component-packages 0.0.6 → 0.0.7

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 (153) hide show
  1. package/es/AddOrEditSupplierDialog.mjs +786 -0
  2. package/es/ApplicationTypeTag.mjs +58 -0
  3. package/es/AuthSection.mjs +199 -0
  4. package/es/AutoShowTooltip.mjs +90 -0
  5. package/es/AvailableRangePreview.mjs +1 -1
  6. package/es/AvailableRangeSetting.mjs +11 -10
  7. package/es/CodeView.mjs +7 -0
  8. package/es/CommonTagsList.mjs +4 -4
  9. package/es/CreateMcpForm.mjs +384 -0
  10. package/es/CustomSidebar.mjs +712 -0
  11. package/es/CustomTitle.mjs +7 -0
  12. package/es/CustomToggle.mjs +170 -0
  13. package/es/DialogContainer.mjs +21 -21
  14. package/es/FileDisplay.mjs +6 -0
  15. package/es/FilePreview.mjs +179 -0
  16. package/es/FileUploader.mjs +266 -9
  17. package/es/McpFormDialog.mjs +8 -0
  18. package/es/McpParamsSet.mjs +630 -0
  19. package/es/MdEditor.mjs +201 -0
  20. package/es/PageContainer.mjs +360 -11
  21. package/es/ParameterTable.mjs +2288 -0
  22. package/es/PublishRecord.mjs +6 -6
  23. package/es/RadioGroup.mjs +119 -0
  24. package/es/SourcePublish.mjs +6 -6
  25. package/es/Table.mjs +2 -2
  26. package/es/assets/AddOrEditSupplierDialog.css +1 -0
  27. package/es/assets/AiboxTable.css +1 -0
  28. package/es/assets/ApplicationTypeTag.css +1 -0
  29. package/es/assets/AuthSection.css +1 -0
  30. package/es/assets/AutoShowTooltip.css +1 -0
  31. package/es/assets/CreateMcpForm.css +1 -0
  32. package/es/assets/CustomSidebar.css +1 -0
  33. package/es/assets/CustomToggle.css +1 -0
  34. package/es/assets/FilePreview.css +1 -0
  35. package/es/assets/FileUploader.css +1 -0
  36. package/es/assets/McpParamsSet.css +1 -0
  37. package/es/assets/MdEditor.css +1 -0
  38. package/es/assets/PageContainer.css +1 -0
  39. package/es/assets/ParameterTable.css +1 -0
  40. package/es/assets/RadioGroup.css +1 -0
  41. package/es/assets/index.css +1 -1
  42. package/es/assets/index2.css +1 -1
  43. package/es/assets/index3.css +1 -0
  44. package/es/assets/index4.css +1 -0
  45. package/es/assets/index5.css +1 -0
  46. package/es/assets/index6.css +1 -0
  47. package/es/assets/layout.css +1 -0
  48. package/es/assets/usePreview.css +1 -0
  49. package/es/chunks/AiboxTable.DUGBBVXh.js +645 -0
  50. package/es/chunks/BackBar.B5Er8ZdJ.js +645 -0
  51. package/es/chunks/config.DPkdwjwD.js +49 -0
  52. package/es/chunks/config.Dklrsn-B.js +49 -0
  53. package/es/chunks/config.DqhQdkz7.js +325 -0
  54. package/es/chunks/config.RrNwuFkQ.js +325 -0
  55. package/es/chunks/config.gNZ_rT87.js +325 -0
  56. package/es/chunks/enums.DuBbLcd-.js +83 -0
  57. package/es/chunks/enums.Dvec-maC.js +62 -0
  58. package/es/chunks/field-types.CPnMOjle.js +13 -0
  59. package/es/chunks/files.cduUqjHX.js +16 -0
  60. package/es/chunks/i18n.DDMVloiU.js +443 -0
  61. package/es/chunks/i18n.k9Q_HVMs.js +443 -0
  62. package/es/chunks/index.BSA3IKSF.js +111 -0
  63. package/es/chunks/index.BT1khSY9.js +111 -0
  64. package/es/chunks/index.CDvh263l.js +257 -0
  65. package/es/chunks/index.CLyfh6p1.js +257 -0
  66. package/es/chunks/index.CSjjAi3w.js +396 -0
  67. package/es/chunks/index.CdEBk4F_.js +134 -0
  68. package/es/chunks/index.CgbxJCEU.js +265 -0
  69. package/es/chunks/index.CuDwuRO7.js +265 -0
  70. package/es/chunks/index.DWR4lc30.js +203 -0
  71. package/es/chunks/index.GuEzdh6b.js +257 -0
  72. package/es/chunks/index.uOZzvHrF.js +135 -0
  73. package/es/chunks/layout.BREUWPEJ.js +26 -0
  74. package/es/chunks/publish.DlD0o09n.js +50 -0
  75. package/es/chunks/request.24c3shPx.js +5 -0
  76. package/es/chunks/usePreview.B5lboHeg.js +153 -0
  77. package/es/chunks/usePreview.C36fNlVd.js +153 -0
  78. package/es/index.mjs +325 -312
  79. package/index.css +1 -1
  80. package/lib/AddOrEditSupplierDialog.js +1 -0
  81. package/lib/ApplicationTypeTag.js +1 -0
  82. package/lib/AuthSection.js +1 -0
  83. package/lib/AutoShowTooltip.js +1 -0
  84. package/lib/AvailableRangePreview.js +1 -1
  85. package/lib/AvailableRangeSetting.js +1 -1
  86. package/lib/CodeView.js +1 -0
  87. package/lib/CommonTagsList.js +1 -1
  88. package/lib/CreateMcpForm.js +1 -0
  89. package/lib/CustomSidebar.js +1 -0
  90. package/lib/CustomTitle.js +1 -0
  91. package/lib/CustomToggle.js +1 -0
  92. package/lib/DialogContainer.js +1 -1
  93. package/lib/FileDisplay.js +1 -0
  94. package/lib/FilePreview.js +1 -0
  95. package/lib/FileUploader.js +1 -1
  96. package/lib/McpFormDialog.js +1 -0
  97. package/lib/McpParamsSet.js +1 -0
  98. package/lib/MdEditor.js +1 -0
  99. package/lib/PageContainer.js +1 -1
  100. package/lib/ParameterTable.js +1 -0
  101. package/lib/PublishRecord.js +4 -4
  102. package/lib/RadioGroup.js +1 -0
  103. package/lib/SourcePublish.js +1 -1
  104. package/lib/Table.js +1 -1
  105. package/lib/assets/AddOrEditSupplierDialog.css +1 -0
  106. package/lib/assets/AiboxTable.css +1 -0
  107. package/lib/assets/ApplicationTypeTag.css +1 -0
  108. package/lib/assets/AuthSection.css +1 -0
  109. package/lib/assets/AutoShowTooltip.css +1 -0
  110. package/lib/assets/CreateMcpForm.css +1 -0
  111. package/lib/assets/CustomSidebar.css +1 -0
  112. package/lib/assets/CustomToggle.css +1 -0
  113. package/lib/assets/FilePreview.css +1 -0
  114. package/lib/assets/FileUploader.css +1 -0
  115. package/lib/assets/McpParamsSet.css +1 -0
  116. package/lib/assets/MdEditor.css +1 -0
  117. package/lib/assets/PageContainer.css +1 -0
  118. package/lib/assets/ParameterTable.css +1 -0
  119. package/lib/assets/RadioGroup.css +1 -0
  120. package/lib/assets/index.css +1 -1
  121. package/lib/assets/index2.css +1 -1
  122. package/lib/assets/index3.css +1 -0
  123. package/lib/assets/index4.css +1 -0
  124. package/lib/assets/index5.css +1 -0
  125. package/lib/assets/index6.css +1 -0
  126. package/lib/assets/layout.css +1 -0
  127. package/lib/assets/usePreview.css +1 -0
  128. package/lib/chunks/AiboxTable.BnoHJ7xL.js +1 -0
  129. package/lib/chunks/BackBar.C8Xrc6qW.js +1 -0
  130. package/lib/chunks/config.1oaIKLGn.js +1 -0
  131. package/lib/chunks/config.BF7MO0O5.js +1 -0
  132. package/lib/chunks/enums.DnuzPZCR.js +1 -0
  133. package/lib/chunks/field-types.Ch_2yDfg.js +1 -0
  134. package/lib/chunks/files.B3-8UC0v.js +1 -0
  135. package/lib/chunks/i18n.DgOp_D7R.js +1 -0
  136. package/lib/chunks/index.BZcSlgOO.js +1 -0
  137. package/lib/chunks/index.Bc71XWQn.js +1 -0
  138. package/lib/chunks/index.CH7XdMru.js +1 -0
  139. package/lib/chunks/index.CaidDlAx.js +1 -0
  140. package/lib/chunks/index.D7wBInWr.js +1 -0
  141. package/lib/chunks/index.DGWHQFdx.js +6 -0
  142. package/lib/chunks/index.DME62Yfo.js +1 -0
  143. package/lib/chunks/index.DWohILMv.js +1 -0
  144. package/lib/chunks/index.LK2ulXTE.js +1 -0
  145. package/lib/chunks/index.qDAoOzk9.js +1 -0
  146. package/lib/chunks/index.s8vGOJKG.js +1 -0
  147. package/lib/chunks/layout.sgE9JoNq.js +1 -0
  148. package/lib/chunks/publish.3TrK3fZf.js +1 -0
  149. package/lib/chunks/request.D8T4MgGX.js +1 -0
  150. package/lib/chunks/usePreview.2PZJSy5w.js +1 -0
  151. package/lib/chunks/usePreview.E5SeS2uw.js +1 -0
  152. package/lib/index.js +1 -4
  153. package/package.json +2 -2
@@ -0,0 +1,265 @@
1
+ import { w as j } from "./index.bCzIhWFw.js";
2
+ import { ref as E, computed as h, resolveDirective as z, createElementBlock as _, openBlock as i, normalizeStyle as X, normalizeClass as I, withDirectives as V, createBlock as r, unref as a, withCtx as f, createElementVNode as p, createCommentVNode as m, renderSlot as N, resolveDynamicComponent as $, Fragment as Y, createVNode as T, createTextVNode as G, toDisplayString as O } from "vue";
3
+ import { ElUpload as H, ElIcon as y, ElImage as Z, ElButton as q, ElMessage as w } from "element-plus";
4
+ import { f as J } from "./files.cduUqjHX.js";
5
+ import { u as L } from "./i18n.DDMVloiU.js";
6
+ import { MySpace as Q, Space as ee, IconEdit2 as te, IconAdd as ae, IconUpload2 as le, File as oe } from "color-message-aibox-vue";
7
+ import { ICON_PATH_MAP as g, SOURCE_TYPE as C, APPLICATION_TYPE as F } from "color-star-custom-components";
8
+ import "./enums.DuBbLcd-.js";
9
+ import '../assets/index4.css';const v = {
10
+ 卡片: "Card",
11
+ 按钮: "Button",
12
+ 面板: "Panel",
13
+ 自定义: "Custom"
14
+ }, se = { class: "card-uploader__mask" }, ne = {
15
+ key: 4,
16
+ class: "pd-l-24 pd-r-24"
17
+ }, ie = { class: "panel-uploader__text" }, ce = { class: "panel-uploader__text--tip" }, de = { class: "text-3271fe" }, pe = { class: "text-262626" }, ue = { class: "text-3271fe" }, re = { class: "text-262626" }, fe = {
18
+ key: 0,
19
+ class: "panel-uploader__text--tip font-style"
20
+ }, me = { class: "panel-uploader__text--tip font-style" }, Oe = {
21
+ __name: "index",
22
+ props: {
23
+ uploadType: {
24
+ type: String,
25
+ default: "Card"
26
+ },
27
+ acceptType: {
28
+ type: String,
29
+ default: ""
30
+ },
31
+ multiple: {
32
+ type: Boolean,
33
+ default: !1
34
+ },
35
+ limitCount: {
36
+ type: Number,
37
+ default: 1e3
38
+ },
39
+ limitSize: {
40
+ type: Number,
41
+ default: 8
42
+ },
43
+ warnTips: {
44
+ type: String,
45
+ default: ""
46
+ },
47
+ warnTips2: {
48
+ type: String,
49
+ default: ""
50
+ },
51
+ isMiio: {
52
+ type: Boolean,
53
+ default: !0
54
+ },
55
+ businessType: {
56
+ type: String,
57
+ default: "common"
58
+ },
59
+ defaultUploadIcon: {
60
+ type: String,
61
+ default: ""
62
+ }
63
+ },
64
+ emits: ["on-success"],
65
+ setup(e, { emit: t }) {
66
+ const { t: o } = L(), n = E(!1), l = E(null), { commonUpload: M } = J(), d = e, S = t, A = (s) => {
67
+ const u = /\.([^.]+)$/, c = s.match(u);
68
+ return c ? c[1] : null;
69
+ }, W = (s, u, c) => {
70
+ let P = !0;
71
+ const R = s.name && s.name.toLowerCase();
72
+ if (console.log(s.name, R, "fileName"), u && u.indexOf(A(R)) === -1) {
73
+ const U = o("COMPONENTS.UPLOAD_TYPE_TIP", { type: u });
74
+ w({
75
+ type: "warning",
76
+ message: U
77
+ }), P = !1;
78
+ }
79
+ if (s.size > 1024 * 1024 * c) {
80
+ const U = o("COMPONENTS.UPLOAD_SIZE_TIP", { size: c });
81
+ w.warning(U), P = !1;
82
+ }
83
+ return P;
84
+ }, b = {
85
+ space: ee,
86
+ "my-space": Q
87
+ }, k = {
88
+ plugin: g.application[C.PLUGIN],
89
+ agent: g.agent[F.autonomous],
90
+ dialogue: g.agent[F.dialogue],
91
+ model: g.application[C.MODEL],
92
+ workflow: g.application[C.WORKFLOW],
93
+ mcp: g.application[C.MCP]
94
+ }, B = h(() => ({
95
+ Card: "card-uploader",
96
+ Button: "button-uploader",
97
+ Panel: "panel-uploader"
98
+ })[d.uploadType]), x = h(() => d.defaultUploadIcon ? b[d.defaultUploadIcon] : ""), K = () => {
99
+ const s = o(
100
+ "COMPONENTS.UPLOAD_COUNT_TIP",
101
+ { count: d.limitCount }
102
+ );
103
+ w({
104
+ type: "warning",
105
+ message: s
106
+ });
107
+ }, D = async (s) => {
108
+ if (W(s, d.acceptType, d.limitSize))
109
+ if (d.isMiio) {
110
+ n.value = !0;
111
+ const { data: c } = await M(
112
+ {
113
+ file: s.raw
114
+ },
115
+ d.businessType
116
+ ).finally(() => {
117
+ n.value = !1;
118
+ });
119
+ console.log(c, "data"), S("on-success", c);
120
+ } else
121
+ S("on-success", s);
122
+ else
123
+ l.value.handleRemove(s);
124
+ };
125
+ return (s, u) => {
126
+ const c = z("loading");
127
+ return i(), _("div", {
128
+ class: I(["file-uploader", e.defaultUploadIcon]),
129
+ style: X({
130
+ border: !e.defaultUploadIcon && e.uploadType === "Card" ? "1px dashed var(--el-border-color)" : "none",
131
+ "border-radius": !e.defaultUploadIcon && e.uploadType === "Card" ? "8px" : "0",
132
+ "background-image": x.value ? `url('${x.value}')` : "none"
133
+ })
134
+ }, [
135
+ V((i(), r(a(H), {
136
+ ref_key: "uploader",
137
+ ref: l,
138
+ class: I(B.value),
139
+ action: "",
140
+ "auto-upload": !1,
141
+ limit: e.limitCount,
142
+ "show-file-list": !1,
143
+ accept: e.acceptType,
144
+ multiple: e.multiple,
145
+ drag: e.uploadType === a(v).面板,
146
+ "on-change": D,
147
+ "on-exceed": K
148
+ }, {
149
+ default: f(() => [
150
+ x.value ? (i(), r(a(y), {
151
+ key: 0,
152
+ size: "64",
153
+ class: "absolute"
154
+ }, {
155
+ default: f(() => [
156
+ (i(), r($(x.value)))
157
+ ]),
158
+ _: 1
159
+ })) : (i(), _(Y, { key: 1 }, [
160
+ e.defaultUploadIcon ? (i(), r(a(Z), {
161
+ key: 0,
162
+ style: { width: "64px", height: "64px" },
163
+ src: k[e.defaultUploadIcon],
164
+ class: "absolute"
165
+ }, null, 8, ["src"])) : m("", !0)
166
+ ], 64)),
167
+ p("div", se, [
168
+ T(a(y), {
169
+ color: "#fff",
170
+ size: "16px"
171
+ }, {
172
+ default: f(() => [
173
+ T(a(te))
174
+ ]),
175
+ _: 1
176
+ })
177
+ ]),
178
+ e.uploadType === a(v).卡片 ? (i(), r(a(y), {
179
+ key: 2,
180
+ class: "card-uploader__icon"
181
+ }, {
182
+ default: f(() => [
183
+ e.defaultUploadIcon ? m("", !0) : (i(), r(a(ae), { key: 0 })),
184
+ N(s.$slots, "text-slot")
185
+ ]),
186
+ _: 3
187
+ })) : m("", !0),
188
+ e.uploadType === a(v).按钮 ? (i(), r(a(q), {
189
+ key: 3,
190
+ type: "primary"
191
+ }, {
192
+ default: f(() => [
193
+ T(a(y), { style: { "margin-right": "5px" } }, {
194
+ default: f(() => [
195
+ T(a(le))
196
+ ]),
197
+ _: 1
198
+ }),
199
+ G(" " + O(a(o)("COMMON_BUTTON.UPLOAD_TEXT")), 1)
200
+ ]),
201
+ _: 1
202
+ })) : m("", !0),
203
+ e.uploadType === a(v).面板 ? (i(), _("div", ne, [
204
+ T(a(y), { size: "48px" }, {
205
+ default: f(() => [
206
+ T(a(oe))
207
+ ]),
208
+ _: 1
209
+ }),
210
+ p("div", ie, [
211
+ p("div", ce, [
212
+ p("span", de, O(a(o)("COMMON_BUTTON.CLICK_TEXT")), 1),
213
+ p("span", pe, O(a(o)("COMMON_BUTTON.OR_TEXT")), 1),
214
+ p("span", ue, O(a(o)("COMMON_BUTTON.DRAG_TEXT")), 1),
215
+ p("span", re, O(a(o)("COMMON_BUTTON.FILE_UPLOAD_TEXT")), 1)
216
+ ]),
217
+ e.warnTips2 ? (i(), _("div", fe, O(e.warnTips2), 1)) : m("", !0),
218
+ p("div", me, O(e.warnTips), 1)
219
+ ])
220
+ ])) : m("", !0),
221
+ e.uploadType === a(v).自定义 ? N(s.$slots, "upload-box", { key: 5 }) : m("", !0)
222
+ ]),
223
+ _: 3
224
+ }, 8, ["class", "limit", "accept", "multiple", "drag"])), [
225
+ [c, n.value]
226
+ ])
227
+ ], 6);
228
+ };
229
+ }
230
+ }, Pe = (e) => {
231
+ const { t } = L();
232
+ let o = e.toLowerCase(), n = "", l = "";
233
+ const M = t("WORKFLOW_COM.TIP_TEXT_3");
234
+ return o.includes("file") ? (l = "jpg、jpeg、png、webp、doc、docx、ppt、pptx、pdf、txt、xls、xlsx、csv、mp4、mkv、webm、ts、avi、mov、flv、3gp、ogv、mp3、wav、aac、flac、ogg", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })) : o.includes("image") ? (l = "jpg、jpeg、png、webp", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })) : o.includes("doc") ? (l = "doc、docx", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })) : o.includes("ppt") ? (l = "ppt、pptx", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })) : o.includes("pdf") ? (l = "pdf", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })) : o.includes("txt") ? (l = "txt", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })) : o.includes("excel") ? (l = "xls、xlsx、csv", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })) : o.includes("audio") ? (l = "mp3、wav、aac、flac、ogg", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })) : o.includes("video") && (l = "mp4、mkv、webm、ts、avi、mov、flv、3gp、ogv", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })), n + M;
235
+ }, Ue = (e) => {
236
+ let t = e.toLowerCase();
237
+ if (t.includes("file"))
238
+ return ".jpg,.jpeg,.png,.webp,.doc,.docx,.ppt,.pptx,.pdf,.txt,.xls,.xlsx,.csv,.mp4,.mkv,.webm,.ts,.avi,.mov,.flv,.3gp,.ogv,.mp3,.wav,.aac,.flac,.ogg";
239
+ if (t.includes("image"))
240
+ return ".jpg,.jpeg,.png,.webp";
241
+ if (t.includes("doc"))
242
+ return ".doc,.docx";
243
+ if (t.includes("ppt"))
244
+ return ".ppt,.pptx";
245
+ if (t.includes("pdf"))
246
+ return ".pdf";
247
+ if (t.includes("txt"))
248
+ return ".txt";
249
+ if (t.includes("excel"))
250
+ return ".xls,.xlsx,.csv";
251
+ if (t.includes("audio"))
252
+ return ".mp3,.wav,.aac,.flac,.ogg";
253
+ if (t.includes("video"))
254
+ return ".mp4,.mkv,.webm,.ts,.avi,.mov,.flv,.3gp,.ogv";
255
+ }, we = (e) => {
256
+ const t = e.match(/array(\\w+)/);
257
+ return t && t[1] ? t[1].toLowerCase() : null;
258
+ }, Se = j(Oe);
259
+ export {
260
+ Se as F,
261
+ v as U,
262
+ Pe as a,
263
+ we as e,
264
+ Ue as g
265
+ };
@@ -0,0 +1,265 @@
1
+ import { w as j } from "./index.bCzIhWFw.js";
2
+ import { ref as E, computed as h, resolveDirective as z, createElementBlock as _, openBlock as i, normalizeStyle as X, normalizeClass as I, withDirectives as V, createBlock as r, unref as a, withCtx as f, createElementVNode as p, createCommentVNode as m, renderSlot as N, resolveDynamicComponent as $, Fragment as Y, createVNode as T, createTextVNode as G, toDisplayString as O } from "vue";
3
+ import { ElUpload as H, ElIcon as y, ElImage as Z, ElButton as q, ElMessage as w } from "element-plus";
4
+ import { f as J } from "./files.cduUqjHX.js";
5
+ import { u as L } from "./i18n.DDMVloiU.js";
6
+ import { MySpace as Q, Space as ee, IconEdit2 as te, IconAdd as ae, IconUpload2 as le, File as oe } from "color-message-aibox-vue";
7
+ import { ICON_PATH_MAP as g, SOURCE_TYPE as C, APPLICATION_TYPE as F } from "color-star-custom-components";
8
+ import "./enums.Dvec-maC.js";
9
+ import '../assets/index4.css';const v = {
10
+ 卡片: "Card",
11
+ 按钮: "Button",
12
+ 面板: "Panel",
13
+ 自定义: "Custom"
14
+ }, se = { class: "card-uploader__mask" }, ne = {
15
+ key: 4,
16
+ class: "pd-l-24 pd-r-24"
17
+ }, ie = { class: "panel-uploader__text" }, ce = { class: "panel-uploader__text--tip" }, de = { class: "text-3271fe" }, pe = { class: "text-262626" }, ue = { class: "text-3271fe" }, re = { class: "text-262626" }, fe = {
18
+ key: 0,
19
+ class: "panel-uploader__text--tip font-style"
20
+ }, me = { class: "panel-uploader__text--tip font-style" }, Oe = {
21
+ __name: "index",
22
+ props: {
23
+ uploadType: {
24
+ type: String,
25
+ default: "Card"
26
+ },
27
+ acceptType: {
28
+ type: String,
29
+ default: ""
30
+ },
31
+ multiple: {
32
+ type: Boolean,
33
+ default: !1
34
+ },
35
+ limitCount: {
36
+ type: Number,
37
+ default: 1e3
38
+ },
39
+ limitSize: {
40
+ type: Number,
41
+ default: 8
42
+ },
43
+ warnTips: {
44
+ type: String,
45
+ default: ""
46
+ },
47
+ warnTips2: {
48
+ type: String,
49
+ default: ""
50
+ },
51
+ isMiio: {
52
+ type: Boolean,
53
+ default: !0
54
+ },
55
+ businessType: {
56
+ type: String,
57
+ default: "common"
58
+ },
59
+ defaultUploadIcon: {
60
+ type: String,
61
+ default: ""
62
+ }
63
+ },
64
+ emits: ["on-success"],
65
+ setup(e, { emit: t }) {
66
+ const { t: o } = L(), n = E(!1), l = E(null), { commonUpload: M } = J(), d = e, S = t, A = (s) => {
67
+ const u = /\.([^.]+)$/, c = s.match(u);
68
+ return c ? c[1] : null;
69
+ }, W = (s, u, c) => {
70
+ let P = !0;
71
+ const R = s.name && s.name.toLowerCase();
72
+ if (console.log(s.name, R, "fileName"), u && u.indexOf(A(R)) === -1) {
73
+ const U = o("COMPONENTS.UPLOAD_TYPE_TIP", { type: u });
74
+ w({
75
+ type: "warning",
76
+ message: U
77
+ }), P = !1;
78
+ }
79
+ if (s.size > 1024 * 1024 * c) {
80
+ const U = o("COMPONENTS.UPLOAD_SIZE_TIP", { size: c });
81
+ w.warning(U), P = !1;
82
+ }
83
+ return P;
84
+ }, b = {
85
+ space: ee,
86
+ "my-space": Q
87
+ }, k = {
88
+ plugin: g.application[C.PLUGIN],
89
+ agent: g.agent[F.autonomous],
90
+ dialogue: g.agent[F.dialogue],
91
+ model: g.application[C.MODEL],
92
+ workflow: g.application[C.WORKFLOW],
93
+ mcp: g.application[C.MCP]
94
+ }, B = h(() => ({
95
+ Card: "card-uploader",
96
+ Button: "button-uploader",
97
+ Panel: "panel-uploader"
98
+ })[d.uploadType]), x = h(() => d.defaultUploadIcon ? b[d.defaultUploadIcon] : ""), K = () => {
99
+ const s = o(
100
+ "COMPONENTS.UPLOAD_COUNT_TIP",
101
+ { count: d.limitCount }
102
+ );
103
+ w({
104
+ type: "warning",
105
+ message: s
106
+ });
107
+ }, D = async (s) => {
108
+ if (W(s, d.acceptType, d.limitSize))
109
+ if (d.isMiio) {
110
+ n.value = !0;
111
+ const { data: c } = await M(
112
+ {
113
+ file: s.raw
114
+ },
115
+ d.businessType
116
+ ).finally(() => {
117
+ n.value = !1;
118
+ });
119
+ console.log(c, "data"), S("on-success", c);
120
+ } else
121
+ S("on-success", s);
122
+ else
123
+ l.value.handleRemove(s);
124
+ };
125
+ return (s, u) => {
126
+ const c = z("loading");
127
+ return i(), _("div", {
128
+ class: I(["file-uploader", e.defaultUploadIcon]),
129
+ style: X({
130
+ border: !e.defaultUploadIcon && e.uploadType === "Card" ? "1px dashed var(--el-border-color)" : "none",
131
+ "border-radius": !e.defaultUploadIcon && e.uploadType === "Card" ? "8px" : "0",
132
+ "background-image": x.value ? `url('${x.value}')` : "none"
133
+ })
134
+ }, [
135
+ V((i(), r(a(H), {
136
+ ref_key: "uploader",
137
+ ref: l,
138
+ class: I(B.value),
139
+ action: "",
140
+ "auto-upload": !1,
141
+ limit: e.limitCount,
142
+ "show-file-list": !1,
143
+ accept: e.acceptType,
144
+ multiple: e.multiple,
145
+ drag: e.uploadType === a(v).面板,
146
+ "on-change": D,
147
+ "on-exceed": K
148
+ }, {
149
+ default: f(() => [
150
+ x.value ? (i(), r(a(y), {
151
+ key: 0,
152
+ size: "64",
153
+ class: "absolute"
154
+ }, {
155
+ default: f(() => [
156
+ (i(), r($(x.value)))
157
+ ]),
158
+ _: 1
159
+ })) : (i(), _(Y, { key: 1 }, [
160
+ e.defaultUploadIcon ? (i(), r(a(Z), {
161
+ key: 0,
162
+ style: { width: "64px", height: "64px" },
163
+ src: k[e.defaultUploadIcon],
164
+ class: "absolute"
165
+ }, null, 8, ["src"])) : m("", !0)
166
+ ], 64)),
167
+ p("div", se, [
168
+ T(a(y), {
169
+ color: "#fff",
170
+ size: "16px"
171
+ }, {
172
+ default: f(() => [
173
+ T(a(te))
174
+ ]),
175
+ _: 1
176
+ })
177
+ ]),
178
+ e.uploadType === a(v).卡片 ? (i(), r(a(y), {
179
+ key: 2,
180
+ class: "card-uploader__icon"
181
+ }, {
182
+ default: f(() => [
183
+ e.defaultUploadIcon ? m("", !0) : (i(), r(a(ae), { key: 0 })),
184
+ N(s.$slots, "text-slot")
185
+ ]),
186
+ _: 3
187
+ })) : m("", !0),
188
+ e.uploadType === a(v).按钮 ? (i(), r(a(q), {
189
+ key: 3,
190
+ type: "primary"
191
+ }, {
192
+ default: f(() => [
193
+ T(a(y), { style: { "margin-right": "5px" } }, {
194
+ default: f(() => [
195
+ T(a(le))
196
+ ]),
197
+ _: 1
198
+ }),
199
+ G(" " + O(a(o)("COMMON_BUTTON.UPLOAD_TEXT")), 1)
200
+ ]),
201
+ _: 1
202
+ })) : m("", !0),
203
+ e.uploadType === a(v).面板 ? (i(), _("div", ne, [
204
+ T(a(y), { size: "48px" }, {
205
+ default: f(() => [
206
+ T(a(oe))
207
+ ]),
208
+ _: 1
209
+ }),
210
+ p("div", ie, [
211
+ p("div", ce, [
212
+ p("span", de, O(a(o)("COMMON_BUTTON.CLICK_TEXT")), 1),
213
+ p("span", pe, O(a(o)("COMMON_BUTTON.OR_TEXT")), 1),
214
+ p("span", ue, O(a(o)("COMMON_BUTTON.DRAG_TEXT")), 1),
215
+ p("span", re, O(a(o)("COMMON_BUTTON.FILE_UPLOAD_TEXT")), 1)
216
+ ]),
217
+ e.warnTips2 ? (i(), _("div", fe, O(e.warnTips2), 1)) : m("", !0),
218
+ p("div", me, O(e.warnTips), 1)
219
+ ])
220
+ ])) : m("", !0),
221
+ e.uploadType === a(v).自定义 ? N(s.$slots, "upload-box", { key: 5 }) : m("", !0)
222
+ ]),
223
+ _: 3
224
+ }, 8, ["class", "limit", "accept", "multiple", "drag"])), [
225
+ [c, n.value]
226
+ ])
227
+ ], 6);
228
+ };
229
+ }
230
+ }, Pe = (e) => {
231
+ const { t } = L();
232
+ let o = e.toLowerCase(), n = "", l = "";
233
+ const M = t("WORKFLOW_COM.TIP_TEXT_3");
234
+ return o.includes("file") ? (l = "jpg、jpeg、png、webp、doc、docx、ppt、pptx、pdf、txt、xls、xlsx、csv、mp4、mkv、webm、ts、avi、mov、flv、3gp、ogv、mp3、wav、aac、flac、ogg", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })) : o.includes("image") ? (l = "jpg、jpeg、png、webp", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })) : o.includes("doc") ? (l = "doc、docx", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })) : o.includes("ppt") ? (l = "ppt、pptx", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })) : o.includes("pdf") ? (l = "pdf", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })) : o.includes("txt") ? (l = "txt", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })) : o.includes("excel") ? (l = "xls、xlsx、csv", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })) : o.includes("audio") ? (l = "mp3、wav、aac、flac、ogg", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })) : o.includes("video") && (l = "mp4、mkv、webm、ts、avi、mov、flv、3gp、ogv", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: l })), n + M;
235
+ }, Ue = (e) => {
236
+ let t = e.toLowerCase();
237
+ if (t.includes("file"))
238
+ return ".jpg,.jpeg,.png,.webp,.doc,.docx,.ppt,.pptx,.pdf,.txt,.xls,.xlsx,.csv,.mp4,.mkv,.webm,.ts,.avi,.mov,.flv,.3gp,.ogv,.mp3,.wav,.aac,.flac,.ogg";
239
+ if (t.includes("image"))
240
+ return ".jpg,.jpeg,.png,.webp";
241
+ if (t.includes("doc"))
242
+ return ".doc,.docx";
243
+ if (t.includes("ppt"))
244
+ return ".ppt,.pptx";
245
+ if (t.includes("pdf"))
246
+ return ".pdf";
247
+ if (t.includes("txt"))
248
+ return ".txt";
249
+ if (t.includes("excel"))
250
+ return ".xls,.xlsx,.csv";
251
+ if (t.includes("audio"))
252
+ return ".mp3,.wav,.aac,.flac,.ogg";
253
+ if (t.includes("video"))
254
+ return ".mp4,.mkv,.webm,.ts,.avi,.mov,.flv,.3gp,.ogv";
255
+ }, we = (e) => {
256
+ const t = e.match(/array(\\w+)/);
257
+ return t && t[1] ? t[1].toLowerCase() : null;
258
+ }, Se = j(Oe);
259
+ export {
260
+ Se as F,
261
+ v as U,
262
+ Pe as a,
263
+ we as e,
264
+ Ue as g
265
+ };