aibox-custom-component-packages 0.0.6 → 0.0.8
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 +836 -0
- package/es/ApplicationTypeTag.mjs +58 -0
- package/es/AuthSection.mjs +199 -0
- package/es/AutoShowTooltip.mjs +90 -0
- package/es/AvailableRangePreview.mjs +1 -1
- package/es/AvailableRangeSetting.mjs +16 -11
- package/es/CodeView.mjs +7 -0
- package/es/CommonTagsList.mjs +5 -5
- package/es/CreateMcpForm.mjs +385 -0
- package/es/CustomSidebar.mjs +717 -0
- package/es/CustomTitle.mjs +7 -0
- package/es/CustomToggle.mjs +224 -0
- package/es/DialogContainer.mjs +21 -21
- package/es/DocSyncSelect.mjs +2661 -0
- package/es/FileDisplay.mjs +4 -0
- package/es/FilePreview.mjs +179 -0
- package/es/FileUploader.mjs +263 -9
- package/es/Logo.mjs +72 -0
- package/es/McpFormDialog.mjs +8 -0
- package/es/McpParamsSet.mjs +630 -0
- package/es/MdEditor.mjs +201 -0
- package/es/PageContainer.mjs +582 -11
- package/es/ParameterTable.mjs +2290 -0
- package/es/PublishRecord.mjs +59 -58
- package/es/RadioGroup.mjs +119 -0
- package/es/SourcePublish.mjs +96 -94
- package/es/Table.mjs +2 -2
- package/es/assets/AddOrEditSupplierDialog.css +1 -0
- package/es/assets/AiboxTable.css +1 -0
- package/es/assets/ApplicationTypeTag.css +1 -0
- package/es/assets/AuthSection.css +1 -0
- package/es/assets/AutoShowTooltip.css +1 -0
- package/es/assets/CommonTagsList.css +1 -1
- package/es/assets/CreateMcpForm.css +1 -0
- package/es/assets/CustomSidebar.css +1 -0
- package/es/assets/CustomToggle.css +1 -0
- package/es/assets/DocSyncSelect.css +1 -0
- package/es/assets/FilePreview.css +1 -0
- package/es/assets/FileUploader.css +1 -0
- package/es/assets/Logo.css +1 -0
- package/es/assets/McpParamsSet.css +1 -0
- package/es/assets/MdEditor.css +1 -0
- package/es/assets/PageContainer.css +1 -0
- package/es/assets/ParameterTable.css +1 -0
- package/es/assets/PublishRecord.css +1 -1
- package/es/assets/RadioGroup.css +1 -0
- package/es/assets/SourcePublish.css +1 -1
- package/es/assets/index.css +1 -1
- package/es/assets/index2.css +1 -1
- package/es/assets/index3.css +1 -0
- package/es/assets/index4.css +1 -0
- package/es/assets/index5.css +1 -0
- package/es/assets/layout.css +1 -0
- package/es/assets/legacy.css +1 -0
- package/es/assets/usePreview.css +1 -0
- package/es/chunks/{BackBar.Cv1wxUcM.js → AiboxTable.CF4T_OCu.js} +123 -123
- package/es/chunks/{BackBar.DJV4JaUM.js → AiboxTable.DUGBBVXh.js} +123 -123
- package/es/chunks/{config.BU21Gda2.js → config.DPkdwjwD.js} +1 -1
- package/es/chunks/{config.BzCGum_W.js → config.Dklrsn-B.js} +1 -1
- package/es/chunks/{config.BPp4hMBq.js → config.RrNwuFkQ.js} +2 -2
- package/es/chunks/{config.DTMcCH58.js → config.gNZ_rT87.js} +2 -2
- package/es/chunks/{enums.CfSBDD6u.js → enums.Dvec-maC.js} +11 -32
- package/es/chunks/enums.WrpwbF4w.js +14 -0
- package/es/chunks/field-types.CPnMOjle.js +13 -0
- package/es/chunks/files.cduUqjHX.js +16 -0
- package/es/chunks/i18n.DDMVloiU.js +443 -0
- package/es/chunks/{i18n.DmqkiK-h.js → i18n.k9Q_HVMs.js} +25 -26
- package/es/chunks/index.BDd6hHiU.js +172 -0
- package/es/chunks/index.BT1khSY9.js +111 -0
- package/es/chunks/{index.DB0ayMv8.js → index.CDvh263l.js} +3 -3
- package/es/chunks/{index.aMb6IVQD.js → index.CF_YHLP5.js} +19 -19
- package/es/chunks/index.CSjjAi3w.js +396 -0
- package/es/chunks/index.CdEBk4F_.js +134 -0
- package/es/chunks/index.DdD1VsH1.js +396 -0
- package/es/chunks/index.Dx-mCS4E.js +1298 -0
- package/es/chunks/layout.BREUWPEJ.js +26 -0
- package/es/chunks/layout.CygCXa6s.js +26 -0
- package/es/chunks/{publish.BCb7nCo9.js → publish.DlD0o09n.js} +1 -1
- package/es/chunks/request.24c3shPx.js +5 -0
- package/es/chunks/usePreview.B5lboHeg.js +153 -0
- package/es/chunks/usePreview.BHvXwaNi.js +157 -0
- package/es/index.mjs +404 -307
- package/lib/AddOrEditSupplierDialog.js +1 -0
- package/lib/ApplicationTypeTag.js +1 -0
- package/lib/AuthSection.js +1 -0
- package/lib/AutoShowTooltip.js +1 -0
- package/lib/AvailableRangePreview.js +1 -1
- package/lib/AvailableRangeSetting.js +1 -1
- package/lib/CodeView.js +1 -0
- package/lib/CommonTagsList.js +1 -1
- package/lib/CreateMcpForm.js +1 -0
- package/lib/CustomSidebar.js +1 -0
- package/lib/CustomTitle.js +1 -0
- package/lib/CustomToggle.js +1 -0
- package/lib/DialogContainer.js +1 -1
- package/lib/DocSyncSelect.js +2 -0
- package/lib/FileDisplay.js +1 -0
- package/lib/FilePreview.js +1 -0
- package/lib/FileUploader.js +1 -1
- package/lib/Logo.js +1 -0
- package/lib/McpFormDialog.js +1 -0
- package/lib/McpParamsSet.js +1 -0
- package/lib/MdEditor.js +1 -0
- package/lib/PageContainer.js +1 -1
- package/lib/ParameterTable.js +1 -0
- package/lib/PublishRecord.js +4 -4
- package/lib/RadioGroup.js +1 -0
- package/lib/SourcePublish.js +1 -1
- package/lib/Table.js +1 -1
- package/lib/assets/AddOrEditSupplierDialog.css +1 -0
- package/lib/assets/AiboxTable.css +1 -0
- package/lib/assets/ApplicationTypeTag.css +1 -0
- package/lib/assets/AuthSection.css +1 -0
- package/lib/assets/AutoShowTooltip.css +1 -0
- package/lib/assets/CommonTagsList.css +1 -1
- package/lib/assets/CreateMcpForm.css +1 -0
- package/lib/assets/CustomSidebar.css +1 -0
- package/lib/assets/CustomToggle.css +1 -0
- package/lib/assets/DocSyncSelect.css +1 -0
- package/lib/assets/FilePreview.css +1 -0
- package/lib/assets/FileUploader.css +1 -0
- package/lib/assets/Logo.css +1 -0
- package/lib/assets/McpParamsSet.css +1 -0
- package/lib/assets/MdEditor.css +1 -0
- package/lib/assets/PageContainer.css +1 -0
- package/lib/assets/ParameterTable.css +1 -0
- package/lib/assets/PublishRecord.css +1 -1
- package/lib/assets/RadioGroup.css +1 -0
- package/lib/assets/SourcePublish.css +1 -1
- package/lib/assets/index.css +1 -1
- package/lib/assets/index2.css +1 -1
- package/lib/assets/index3.css +1 -0
- package/lib/assets/index4.css +1 -0
- package/lib/assets/index5.css +1 -0
- package/lib/assets/layout.css +1 -0
- package/lib/assets/legacy.css +1 -0
- package/lib/assets/usePreview.css +1 -0
- package/lib/chunks/AiboxTable.BnoHJ7xL.js +1 -0
- package/lib/chunks/AiboxTable.CJOPGJtU.js +1 -0
- package/lib/chunks/{config.B0XKkp1w.js → config.1oaIKLGn.js} +1 -1
- package/lib/chunks/{config.BCAuBVxV.js → config.BF7MO0O5.js} +1 -1
- package/lib/chunks/enums.DnuzPZCR.js +1 -0
- package/lib/chunks/enums.DpU2er5r.js +1 -0
- package/lib/chunks/field-types.Ch_2yDfg.js +1 -0
- package/lib/chunks/files.B3-8UC0v.js +1 -0
- package/lib/chunks/i18n.DgOp_D7R.js +1 -0
- package/lib/chunks/index.BNivYbtq.js +1 -0
- package/lib/chunks/{index.Bk-RwmaH.js → index.B_keI1Aq.js} +1 -1
- package/lib/chunks/{index.BsN4urmi.js → index.Bc71XWQn.js} +1 -1
- package/lib/chunks/index.C7aZx6RG.js +6 -0
- package/lib/chunks/index.CH7XdMru.js +1 -0
- package/lib/chunks/index.CJFk1R2u.js +59 -0
- package/lib/chunks/index.CaidDlAx.js +1 -0
- package/lib/chunks/index.DGWHQFdx.js +6 -0
- package/lib/chunks/layout.DbBSbLgm.js +1 -0
- package/lib/chunks/layout.sgE9JoNq.js +1 -0
- package/lib/chunks/publish.3TrK3fZf.js +1 -0
- package/lib/chunks/request.D8T4MgGX.js +1 -0
- package/lib/chunks/usePreview.2PZJSy5w.js +1 -0
- package/lib/chunks/usePreview.BojIDW7Z.js +1 -0
- package/lib/index.js +2 -4
- package/package.json +3 -3
- package/es/ExampleComponent.mjs +0 -35
- package/es/assets/BackBar.css +0 -1
- package/es/assets/ExampleComponent.css +0 -1
- package/es/chunks/BackBar.Bc2NIuzk.js +0 -645
- package/es/chunks/config.8htFF04x.js +0 -325
- package/es/chunks/config.CFWGjEdA.js +0 -49
- package/es/chunks/config.CfWAdyUH.js +0 -325
- package/es/chunks/i18n.Vhq-tZPw.js +0 -94
- package/es/chunks/i18n.ro9yz7rE.js +0 -94
- package/es/chunks/index.ml5i7aB5.js +0 -257
- package/es/chunks/index.s-YxIOfq.js +0 -301
- package/es/chunks/publish.D6friivo.js +0 -50
- package/es/chunks/publish.Dqzn7qEl.js +0 -50
- package/es/i18n.mjs +0 -17
- package/lib/ExampleComponent.js +0 -1
- package/lib/assets/BackBar.css +0 -1
- package/lib/assets/ExampleComponent.css +0 -1
- package/lib/chunks/BackBar.CZsNxoX1.js +0 -1
- package/lib/chunks/BackBar.s5_vN6jt.js +0 -1
- package/lib/chunks/config.Bs7sh3aP.js +0 -1
- package/lib/chunks/config.C1w4hgfw.js +0 -1
- package/lib/chunks/config.ClERt2RF.js +0 -1
- package/lib/chunks/enums.Dmq4PdUc.js +0 -1
- package/lib/chunks/i18n.CL5L6nx6.js +0 -1
- package/lib/chunks/i18n.aAXi5igh.js +0 -1
- package/lib/chunks/index.BNqTEn3K.js +0 -1
- package/lib/chunks/publish.Bw1acrSu.js +0 -1
- package/lib/chunks/publish.CA1uSVnm.js +0 -1
- package/lib/i18n.js +0 -1
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { w as L } from "./chunks/index.bCzIhWFw.js";
|
|
2
|
+
import { createElementBlock as t, openBlock as l, Fragment as m, createCommentVNode as r, unref as s, renderSlot as C, createBlock as o, withCtx as n, renderList as F, createElementVNode as p, resolveDynamicComponent as x, toDisplayString as S, createVNode as d, createTextVNode as T } from "vue";
|
|
3
|
+
import { ElRow as $, ElCol as D, ElIcon as c, ElButton as V } from "element-plus";
|
|
4
|
+
import { IconDelete as E, IconHide as b } from "color-message-aibox-vue";
|
|
5
|
+
import { U as v } from "./chunks/enums.WrpwbF4w.js";
|
|
6
|
+
import { u as z, i as P, a as N } from "./chunks/usePreview.BHvXwaNi.js";
|
|
7
|
+
import { j as re, f as de, l as ce, m as ue, k as pe, d as _e, c as fe, b as me, h as ve, e as we, g as ke } from "./chunks/usePreview.BHvXwaNi.js";
|
|
8
|
+
import { _ as A } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
|
|
9
|
+
import './assets/FilePreview.css';const H = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "panel-preview"
|
|
12
|
+
}, j = { class: "panel-preview__item" }, J = ["onClick"], M = ["src", "alt"], R = { class: "panel-preview__name ellipsis" }, W = { key: 0 }, Z = { key: 1 }, q = {
|
|
13
|
+
key: 1,
|
|
14
|
+
class: "upload-preview"
|
|
15
|
+
}, G = ["src", "alt"], K = { class: "preview-item__mask" }, O = {
|
|
16
|
+
__name: "index",
|
|
17
|
+
props: {
|
|
18
|
+
fileList: {
|
|
19
|
+
type: Array,
|
|
20
|
+
default: () => []
|
|
21
|
+
},
|
|
22
|
+
canEdit: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: !0
|
|
25
|
+
},
|
|
26
|
+
previewType: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: v.面板
|
|
29
|
+
},
|
|
30
|
+
isStream: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !1
|
|
33
|
+
},
|
|
34
|
+
isCustom: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: !1
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
emits: ["on-remove", "on-preview"],
|
|
40
|
+
setup(a, { emit: B }) {
|
|
41
|
+
const { downloadPrew: U, downloadStreamPrew: I } = z(), w = a, k = B, y = (i) => N(i);
|
|
42
|
+
function g(i) {
|
|
43
|
+
w.isCustom ? k("on-preview", i) : w.isStream ? I(i) : U(i);
|
|
44
|
+
}
|
|
45
|
+
function h(i, u) {
|
|
46
|
+
k("on-remove", i, u);
|
|
47
|
+
}
|
|
48
|
+
return (i, u) => (l(), t(m, null, [
|
|
49
|
+
a.previewType === s(v).面板 ? (l(), t("div", H, [
|
|
50
|
+
C(i.$slots, "PanelUploader", {}, void 0, !0),
|
|
51
|
+
a.fileList.length ? (l(), o(s($), {
|
|
52
|
+
key: 0,
|
|
53
|
+
gutter: 20,
|
|
54
|
+
class: "panel-preview__row"
|
|
55
|
+
}, {
|
|
56
|
+
default: n(() => [
|
|
57
|
+
(l(!0), t(m, null, F(a.fileList, (e, _) => (l(), o(s(D), {
|
|
58
|
+
span: 8,
|
|
59
|
+
key: e.bnid
|
|
60
|
+
}, {
|
|
61
|
+
default: n(() => [
|
|
62
|
+
p("div", j, [
|
|
63
|
+
p("div", {
|
|
64
|
+
class: "panel-preview__box",
|
|
65
|
+
onClick: (f) => g(e)
|
|
66
|
+
}, [
|
|
67
|
+
s(P)(e.suffix, e.url) ? (l(), t("img", {
|
|
68
|
+
key: 0,
|
|
69
|
+
src: e.url,
|
|
70
|
+
alt: e.name,
|
|
71
|
+
class: "panel-preview__img"
|
|
72
|
+
}, null, 8, M)) : (l(), o(s(c), {
|
|
73
|
+
key: 1,
|
|
74
|
+
size: "32px",
|
|
75
|
+
class: "panel-preview__img"
|
|
76
|
+
}, {
|
|
77
|
+
default: n(() => [
|
|
78
|
+
(l(), o(x(y(e))))
|
|
79
|
+
]),
|
|
80
|
+
_: 2
|
|
81
|
+
}, 1024)),
|
|
82
|
+
p("span", R, S(e.name), 1)
|
|
83
|
+
], 8, J),
|
|
84
|
+
e.isUploading ? (l(), t("div", W, [
|
|
85
|
+
d(s(V), {
|
|
86
|
+
text: "",
|
|
87
|
+
size: "small",
|
|
88
|
+
loading: ""
|
|
89
|
+
}, {
|
|
90
|
+
default: n(() => [...u[0] || (u[0] = [
|
|
91
|
+
T("上传中...", -1)
|
|
92
|
+
])]),
|
|
93
|
+
_: 1
|
|
94
|
+
})
|
|
95
|
+
])) : (l(), t("div", Z, [
|
|
96
|
+
a.canEdit ? (l(), o(s(c), {
|
|
97
|
+
key: 0,
|
|
98
|
+
size: "18",
|
|
99
|
+
style: { cursor: "pointer" },
|
|
100
|
+
onClick: (f) => h(_, e)
|
|
101
|
+
}, {
|
|
102
|
+
default: n(() => [
|
|
103
|
+
d(s(E))
|
|
104
|
+
]),
|
|
105
|
+
_: 1
|
|
106
|
+
}, 8, ["onClick"])) : r("", !0)
|
|
107
|
+
]))
|
|
108
|
+
])
|
|
109
|
+
]),
|
|
110
|
+
_: 2
|
|
111
|
+
}, 1024))), 128))
|
|
112
|
+
]),
|
|
113
|
+
_: 1
|
|
114
|
+
})) : r("", !0)
|
|
115
|
+
])) : r("", !0),
|
|
116
|
+
a.previewType === s(v).卡片 ? (l(), t("ul", q, [
|
|
117
|
+
(l(!0), t(m, null, F(a.fileList, (e, _) => (l(), t("li", {
|
|
118
|
+
class: "preview-item",
|
|
119
|
+
key: e.bnid
|
|
120
|
+
}, [
|
|
121
|
+
s(P)(e.suffix, e.url) ? (l(), t("img", {
|
|
122
|
+
key: 0,
|
|
123
|
+
src: e.url,
|
|
124
|
+
alt: e.name,
|
|
125
|
+
class: "preview-item__img"
|
|
126
|
+
}, null, 8, G)) : (l(), o(s(c), {
|
|
127
|
+
key: 1,
|
|
128
|
+
size: "32px",
|
|
129
|
+
class: "preview-item__img"
|
|
130
|
+
}, {
|
|
131
|
+
default: n(() => [
|
|
132
|
+
(l(), o(x(y(e))))
|
|
133
|
+
]),
|
|
134
|
+
_: 2
|
|
135
|
+
}, 1024)),
|
|
136
|
+
p("div", K, [
|
|
137
|
+
d(s(c), {
|
|
138
|
+
class: "preview-item__mask--view",
|
|
139
|
+
onClick: (f) => g(e)
|
|
140
|
+
}, {
|
|
141
|
+
default: n(() => [
|
|
142
|
+
d(s(b))
|
|
143
|
+
]),
|
|
144
|
+
_: 1
|
|
145
|
+
}, 8, ["onClick"]),
|
|
146
|
+
a.canEdit ? (l(), o(s(c), {
|
|
147
|
+
key: 0,
|
|
148
|
+
class: "preview-item__mask--delete",
|
|
149
|
+
onClick: (f) => h(_, e)
|
|
150
|
+
}, {
|
|
151
|
+
default: n(() => [
|
|
152
|
+
d(s(E))
|
|
153
|
+
]),
|
|
154
|
+
_: 1
|
|
155
|
+
}, 8, ["onClick"])) : r("", !0)
|
|
156
|
+
])
|
|
157
|
+
]))), 128)),
|
|
158
|
+
C(i.$slots, "CardUploader", {}, void 0, !0)
|
|
159
|
+
])) : r("", !0)
|
|
160
|
+
], 64));
|
|
161
|
+
}
|
|
162
|
+
}, Q = /* @__PURE__ */ A(O, [["__scopeId", "data-v-d6028d96"]]), ae = L(Q);
|
|
163
|
+
export {
|
|
164
|
+
ae as FilePreview,
|
|
165
|
+
ae as default,
|
|
166
|
+
re as isAudioFile,
|
|
167
|
+
de as isExcelFile,
|
|
168
|
+
ce as isHtmlFile,
|
|
169
|
+
P as isImageLink,
|
|
170
|
+
ue as isJsonFile,
|
|
171
|
+
pe as isMdFile,
|
|
172
|
+
_e as isPdfFile,
|
|
173
|
+
fe as isPptFile,
|
|
174
|
+
me as isText,
|
|
175
|
+
ve as isVideoFile,
|
|
176
|
+
we as isWordFile,
|
|
177
|
+
ke as isZipFile,
|
|
178
|
+
N as uploadUrl
|
|
179
|
+
};
|
package/es/FileUploader.mjs
CHANGED
|
@@ -1,11 +1,265 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { w as j } from "./chunks/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 l, 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 U } from "element-plus";
|
|
4
|
+
import { f as J } from "./chunks/files.cduUqjHX.js";
|
|
5
|
+
import { u as F } from "./chunks/i18n.k9Q_HVMs.js";
|
|
6
|
+
import { MySpace as Q, Space as ee, IconEdit2 as te, IconAdd as le, IconUpload2 as ae, File as oe } from "color-message-aibox-vue";
|
|
7
|
+
import { ICON_PATH_MAP as g, SOURCE_TYPE as C, APPLICATION_TYPE as L } from "color-star-custom-components";
|
|
8
|
+
import './assets/FileUploader.css';const v = {
|
|
9
|
+
卡片: "Card",
|
|
10
|
+
按钮: "Button",
|
|
11
|
+
面板: "Panel",
|
|
12
|
+
自定义: "Custom"
|
|
13
|
+
}, se = { class: "card-uploader__mask" }, ne = {
|
|
14
|
+
key: 4,
|
|
15
|
+
class: "pd-l-24 pd-r-24"
|
|
16
|
+
}, 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 = {
|
|
17
|
+
key: 0,
|
|
18
|
+
class: "panel-uploader__text--tip font-style"
|
|
19
|
+
}, me = { class: "panel-uploader__text--tip font-style" }, Oe = {
|
|
20
|
+
__name: "index",
|
|
21
|
+
props: {
|
|
22
|
+
uploadType: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: "Card"
|
|
25
|
+
},
|
|
26
|
+
acceptType: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: ""
|
|
29
|
+
},
|
|
30
|
+
multiple: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !1
|
|
33
|
+
},
|
|
34
|
+
limitCount: {
|
|
35
|
+
type: Number,
|
|
36
|
+
default: 1e3
|
|
37
|
+
},
|
|
38
|
+
limitSize: {
|
|
39
|
+
type: Number,
|
|
40
|
+
default: 8
|
|
41
|
+
},
|
|
42
|
+
warnTips: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: ""
|
|
45
|
+
},
|
|
46
|
+
warnTips2: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: ""
|
|
49
|
+
},
|
|
50
|
+
isMiio: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: !0
|
|
53
|
+
},
|
|
54
|
+
businessType: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: "common"
|
|
57
|
+
},
|
|
58
|
+
defaultUploadIcon: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: ""
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
emits: ["on-success"],
|
|
64
|
+
setup(e, { emit: t }) {
|
|
65
|
+
const { t: o } = F(), n = E(!1), a = E(null), { commonUpload: M } = J(), d = e, S = t, A = (s) => {
|
|
66
|
+
const u = /\.([^.]+)$/, c = s.match(u);
|
|
67
|
+
return c ? c[1] : null;
|
|
68
|
+
}, W = (s, u, c) => {
|
|
69
|
+
let P = !0;
|
|
70
|
+
const R = s.name && s.name.toLowerCase();
|
|
71
|
+
if (console.log(s.name, R, "fileName"), u && u.indexOf(A(R)) === -1) {
|
|
72
|
+
const w = o("COMPONENTS.UPLOAD_TYPE_TIP", { type: u });
|
|
73
|
+
U({
|
|
74
|
+
type: "warning",
|
|
75
|
+
message: w
|
|
76
|
+
}), P = !1;
|
|
77
|
+
}
|
|
78
|
+
if (s.size > 1024 * 1024 * c) {
|
|
79
|
+
const w = o("COMPONENTS.UPLOAD_SIZE_TIP", { size: c });
|
|
80
|
+
U.warning(w), P = !1;
|
|
81
|
+
}
|
|
82
|
+
return P;
|
|
83
|
+
}, b = {
|
|
84
|
+
space: ee,
|
|
85
|
+
"my-space": Q
|
|
86
|
+
}, k = {
|
|
87
|
+
plugin: g.application[C.PLUGIN],
|
|
88
|
+
agent: g.agent[L.autonomous],
|
|
89
|
+
dialogue: g.agent[L.dialogue],
|
|
90
|
+
model: g.application[C.MODEL],
|
|
91
|
+
workflow: g.application[C.WORKFLOW],
|
|
92
|
+
mcp: g.application[C.MCP]
|
|
93
|
+
}, B = h(() => ({
|
|
94
|
+
Card: "card-uploader",
|
|
95
|
+
Button: "button-uploader",
|
|
96
|
+
Panel: "panel-uploader"
|
|
97
|
+
})[d.uploadType]), x = h(() => d.defaultUploadIcon ? b[d.defaultUploadIcon] : ""), K = () => {
|
|
98
|
+
const s = o(
|
|
99
|
+
"COMPONENTS.UPLOAD_COUNT_TIP",
|
|
100
|
+
{ count: d.limitCount }
|
|
101
|
+
);
|
|
102
|
+
U({
|
|
103
|
+
type: "warning",
|
|
104
|
+
message: s
|
|
105
|
+
});
|
|
106
|
+
}, D = async (s) => {
|
|
107
|
+
if (W(s, d.acceptType, d.limitSize))
|
|
108
|
+
if (d.isMiio) {
|
|
109
|
+
n.value = !0;
|
|
110
|
+
const { data: c } = await M(
|
|
111
|
+
{
|
|
112
|
+
file: s.raw
|
|
113
|
+
},
|
|
114
|
+
d.businessType
|
|
115
|
+
).finally(() => {
|
|
116
|
+
n.value = !1;
|
|
117
|
+
});
|
|
118
|
+
console.log(c, "data"), S("on-success", c);
|
|
119
|
+
} else
|
|
120
|
+
S("on-success", s);
|
|
121
|
+
else
|
|
122
|
+
a.value.handleRemove(s);
|
|
123
|
+
};
|
|
124
|
+
return (s, u) => {
|
|
125
|
+
const c = z("loading");
|
|
126
|
+
return i(), _("div", {
|
|
127
|
+
class: I(["file-uploader", e.defaultUploadIcon]),
|
|
128
|
+
style: X({
|
|
129
|
+
border: !e.defaultUploadIcon && e.uploadType === "Card" ? "1px dashed var(--el-border-color)" : "none",
|
|
130
|
+
"border-radius": !e.defaultUploadIcon && e.uploadType === "Card" ? "8px" : "0",
|
|
131
|
+
"background-image": x.value ? `url('${x.value}')` : "none"
|
|
132
|
+
})
|
|
133
|
+
}, [
|
|
134
|
+
V((i(), r(l(H), {
|
|
135
|
+
ref_key: "uploader",
|
|
136
|
+
ref: a,
|
|
137
|
+
class: I(B.value),
|
|
138
|
+
action: "",
|
|
139
|
+
"auto-upload": !1,
|
|
140
|
+
limit: e.limitCount,
|
|
141
|
+
"show-file-list": !1,
|
|
142
|
+
accept: e.acceptType,
|
|
143
|
+
multiple: e.multiple,
|
|
144
|
+
drag: e.uploadType === l(v).面板,
|
|
145
|
+
"on-change": D,
|
|
146
|
+
"on-exceed": K
|
|
147
|
+
}, {
|
|
148
|
+
default: f(() => [
|
|
149
|
+
x.value ? (i(), r(l(y), {
|
|
150
|
+
key: 0,
|
|
151
|
+
size: "64",
|
|
152
|
+
class: "absolute"
|
|
153
|
+
}, {
|
|
154
|
+
default: f(() => [
|
|
155
|
+
(i(), r($(x.value)))
|
|
156
|
+
]),
|
|
157
|
+
_: 1
|
|
158
|
+
})) : (i(), _(Y, { key: 1 }, [
|
|
159
|
+
e.defaultUploadIcon ? (i(), r(l(Z), {
|
|
160
|
+
key: 0,
|
|
161
|
+
style: { width: "64px", height: "64px" },
|
|
162
|
+
src: k[e.defaultUploadIcon],
|
|
163
|
+
class: "absolute"
|
|
164
|
+
}, null, 8, ["src"])) : m("", !0)
|
|
165
|
+
], 64)),
|
|
166
|
+
p("div", se, [
|
|
167
|
+
T(l(y), {
|
|
168
|
+
color: "#fff",
|
|
169
|
+
size: "16px"
|
|
170
|
+
}, {
|
|
171
|
+
default: f(() => [
|
|
172
|
+
T(l(te))
|
|
173
|
+
]),
|
|
174
|
+
_: 1
|
|
175
|
+
})
|
|
176
|
+
]),
|
|
177
|
+
e.uploadType === l(v).卡片 ? (i(), r(l(y), {
|
|
178
|
+
key: 2,
|
|
179
|
+
class: "card-uploader__icon"
|
|
180
|
+
}, {
|
|
181
|
+
default: f(() => [
|
|
182
|
+
e.defaultUploadIcon ? m("", !0) : (i(), r(l(le), { key: 0 })),
|
|
183
|
+
N(s.$slots, "text-slot")
|
|
184
|
+
]),
|
|
185
|
+
_: 3
|
|
186
|
+
})) : m("", !0),
|
|
187
|
+
e.uploadType === l(v).按钮 ? (i(), r(l(q), {
|
|
188
|
+
key: 3,
|
|
189
|
+
type: "primary"
|
|
190
|
+
}, {
|
|
191
|
+
default: f(() => [
|
|
192
|
+
T(l(y), { style: { "margin-right": "5px" } }, {
|
|
193
|
+
default: f(() => [
|
|
194
|
+
T(l(ae))
|
|
195
|
+
]),
|
|
196
|
+
_: 1
|
|
197
|
+
}),
|
|
198
|
+
G(" " + O(l(o)("COMMON_BUTTON.UPLOAD_TEXT")), 1)
|
|
199
|
+
]),
|
|
200
|
+
_: 1
|
|
201
|
+
})) : m("", !0),
|
|
202
|
+
e.uploadType === l(v).面板 ? (i(), _("div", ne, [
|
|
203
|
+
T(l(y), { size: "48px" }, {
|
|
204
|
+
default: f(() => [
|
|
205
|
+
T(l(oe))
|
|
206
|
+
]),
|
|
207
|
+
_: 1
|
|
208
|
+
}),
|
|
209
|
+
p("div", ie, [
|
|
210
|
+
p("div", ce, [
|
|
211
|
+
p("span", de, O(l(o)("COMMON_BUTTON.CLICK_TEXT")), 1),
|
|
212
|
+
p("span", pe, O(l(o)("COMMON_BUTTON.OR_TEXT")), 1),
|
|
213
|
+
p("span", ue, O(l(o)("COMMON_BUTTON.DRAG_TEXT")), 1),
|
|
214
|
+
p("span", re, O(l(o)("COMMON_BUTTON.FILE_UPLOAD_TEXT")), 1)
|
|
215
|
+
]),
|
|
216
|
+
e.warnTips2 ? (i(), _("div", fe, O(e.warnTips2), 1)) : m("", !0),
|
|
217
|
+
p("div", me, O(e.warnTips), 1)
|
|
218
|
+
])
|
|
219
|
+
])) : m("", !0),
|
|
220
|
+
e.uploadType === l(v).自定义 ? N(s.$slots, "upload-box", { key: 5 }) : m("", !0)
|
|
221
|
+
]),
|
|
222
|
+
_: 3
|
|
223
|
+
}, 8, ["class", "limit", "accept", "multiple", "drag"])), [
|
|
224
|
+
[c, n.value]
|
|
225
|
+
])
|
|
226
|
+
], 6);
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
}, Me = (e) => {
|
|
230
|
+
const { t } = F();
|
|
231
|
+
let o = e.toLowerCase(), n = "", a = "";
|
|
232
|
+
const M = t("WORKFLOW_COM.TIP_TEXT_3");
|
|
233
|
+
return o.includes("file") ? (a = "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: a })) : o.includes("image") ? (a = "jpg、jpeg、png、webp", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: a })) : o.includes("doc") ? (a = "doc、docx", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: a })) : o.includes("ppt") ? (a = "ppt、pptx", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: a })) : o.includes("pdf") ? (a = "pdf", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: a })) : o.includes("txt") ? (a = "txt", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: a })) : o.includes("excel") ? (a = "xls、xlsx、csv", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: a })) : o.includes("audio") ? (a = "mp3、wav、aac、flac、ogg", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: a })) : o.includes("video") && (a = "mp4、mkv、webm、ts、avi、mov、flv、3gp、ogv", n = t("WORKFLOW_COM.SUPPORT_FORMATS", { formats: a })), n + M;
|
|
234
|
+
}, Pe = (e) => {
|
|
235
|
+
let t = e.toLowerCase();
|
|
236
|
+
if (t.includes("file"))
|
|
237
|
+
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";
|
|
238
|
+
if (t.includes("image"))
|
|
239
|
+
return ".jpg,.jpeg,.png,.webp";
|
|
240
|
+
if (t.includes("doc"))
|
|
241
|
+
return ".doc,.docx";
|
|
242
|
+
if (t.includes("ppt"))
|
|
243
|
+
return ".ppt,.pptx";
|
|
244
|
+
if (t.includes("pdf"))
|
|
245
|
+
return ".pdf";
|
|
246
|
+
if (t.includes("txt"))
|
|
247
|
+
return ".txt";
|
|
248
|
+
if (t.includes("excel"))
|
|
249
|
+
return ".xls,.xlsx,.csv";
|
|
250
|
+
if (t.includes("audio"))
|
|
251
|
+
return ".mp3,.wav,.aac,.flac,.ogg";
|
|
252
|
+
if (t.includes("video"))
|
|
253
|
+
return ".mp4,.mkv,.webm,.ts,.avi,.mov,.flv,.3gp,.ogv";
|
|
254
|
+
}, we = (e) => {
|
|
255
|
+
const t = e.match(/array(\w+)/);
|
|
256
|
+
return t && t[1] ? t[1].toLowerCase() : null;
|
|
257
|
+
}, Ue = j(Oe);
|
|
2
258
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
l as colorValue,
|
|
10
|
-
o as pages
|
|
259
|
+
Ue as FileUploader,
|
|
260
|
+
v as UploadTypesEnum,
|
|
261
|
+
Ue as default,
|
|
262
|
+
we as extractAndLowerCaseArrayType,
|
|
263
|
+
Pe as getAcceptType,
|
|
264
|
+
Me as getWarnTips
|
|
11
265
|
};
|