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.
- package/es/AddOrEditSupplierDialog.mjs +786 -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 +11 -10
- package/es/CodeView.mjs +7 -0
- package/es/CommonTagsList.mjs +4 -4
- package/es/CreateMcpForm.mjs +384 -0
- package/es/CustomSidebar.mjs +712 -0
- package/es/CustomTitle.mjs +7 -0
- package/es/CustomToggle.mjs +170 -0
- package/es/DialogContainer.mjs +21 -21
- package/es/FileDisplay.mjs +6 -0
- package/es/FilePreview.mjs +179 -0
- package/es/FileUploader.mjs +266 -9
- package/es/McpFormDialog.mjs +8 -0
- package/es/McpParamsSet.mjs +630 -0
- package/es/MdEditor.mjs +201 -0
- package/es/PageContainer.mjs +360 -11
- package/es/ParameterTable.mjs +2288 -0
- package/es/PublishRecord.mjs +6 -6
- package/es/RadioGroup.mjs +119 -0
- package/es/SourcePublish.mjs +6 -6
- 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/CreateMcpForm.css +1 -0
- package/es/assets/CustomSidebar.css +1 -0
- package/es/assets/CustomToggle.css +1 -0
- package/es/assets/FilePreview.css +1 -0
- package/es/assets/FileUploader.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/RadioGroup.css +1 -0
- 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/index6.css +1 -0
- package/es/assets/layout.css +1 -0
- package/es/assets/usePreview.css +1 -0
- package/es/chunks/AiboxTable.DUGBBVXh.js +645 -0
- package/es/chunks/BackBar.B5Er8ZdJ.js +645 -0
- package/es/chunks/config.DPkdwjwD.js +49 -0
- package/es/chunks/config.Dklrsn-B.js +49 -0
- package/es/chunks/config.DqhQdkz7.js +325 -0
- package/es/chunks/config.RrNwuFkQ.js +325 -0
- package/es/chunks/config.gNZ_rT87.js +325 -0
- package/es/chunks/enums.DuBbLcd-.js +83 -0
- package/es/chunks/enums.Dvec-maC.js +62 -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.k9Q_HVMs.js +443 -0
- package/es/chunks/index.BSA3IKSF.js +111 -0
- package/es/chunks/index.BT1khSY9.js +111 -0
- package/es/chunks/index.CDvh263l.js +257 -0
- package/es/chunks/index.CLyfh6p1.js +257 -0
- package/es/chunks/index.CSjjAi3w.js +396 -0
- package/es/chunks/index.CdEBk4F_.js +134 -0
- package/es/chunks/index.CgbxJCEU.js +265 -0
- package/es/chunks/index.CuDwuRO7.js +265 -0
- package/es/chunks/index.DWR4lc30.js +203 -0
- package/es/chunks/index.GuEzdh6b.js +257 -0
- package/es/chunks/index.uOZzvHrF.js +135 -0
- package/es/chunks/layout.BREUWPEJ.js +26 -0
- package/es/chunks/publish.DlD0o09n.js +50 -0
- package/es/chunks/request.24c3shPx.js +5 -0
- package/es/chunks/usePreview.B5lboHeg.js +153 -0
- package/es/chunks/usePreview.C36fNlVd.js +153 -0
- package/es/index.mjs +325 -312
- package/index.css +1 -1
- 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/FileDisplay.js +1 -0
- package/lib/FilePreview.js +1 -0
- package/lib/FileUploader.js +1 -1
- 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/CreateMcpForm.css +1 -0
- package/lib/assets/CustomSidebar.css +1 -0
- package/lib/assets/CustomToggle.css +1 -0
- package/lib/assets/FilePreview.css +1 -0
- package/lib/assets/FileUploader.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/RadioGroup.css +1 -0
- 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/index6.css +1 -0
- package/lib/assets/layout.css +1 -0
- package/lib/assets/usePreview.css +1 -0
- package/lib/chunks/AiboxTable.BnoHJ7xL.js +1 -0
- package/lib/chunks/BackBar.C8Xrc6qW.js +1 -0
- package/lib/chunks/config.1oaIKLGn.js +1 -0
- package/lib/chunks/config.BF7MO0O5.js +1 -0
- package/lib/chunks/enums.DnuzPZCR.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.BZcSlgOO.js +1 -0
- package/lib/chunks/index.Bc71XWQn.js +1 -0
- package/lib/chunks/index.CH7XdMru.js +1 -0
- package/lib/chunks/index.CaidDlAx.js +1 -0
- package/lib/chunks/index.D7wBInWr.js +1 -0
- package/lib/chunks/index.DGWHQFdx.js +6 -0
- package/lib/chunks/index.DME62Yfo.js +1 -0
- package/lib/chunks/index.DWohILMv.js +1 -0
- package/lib/chunks/index.LK2ulXTE.js +1 -0
- package/lib/chunks/index.qDAoOzk9.js +1 -0
- package/lib/chunks/index.s8vGOJKG.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.E5SeS2uw.js +1 -0
- package/lib/index.js +1 -4
- package/package.json +2 -2
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { w as R } from "./chunks/index.bCzIhWFw.js";
|
|
2
|
+
import { ref as W, computed as c, onMounted as Z, nextTick as b, createElementBlock as d, openBlock as a, normalizeClass as w, createElementVNode as V, createBlock as T, createCommentVNode as k, Fragment as j, renderList as D, normalizeStyle as G, createTextVNode as H, toDisplayString as S, unref as g, withCtx as v, createVNode as M } from "vue";
|
|
3
|
+
import { useRoute as J } from "vue-router";
|
|
4
|
+
import { ElDropdown as P, ElIcon as Q, ElDropdownMenu as U, ElDropdownItem as X } from "element-plus";
|
|
5
|
+
import { IconZuoCopy as Y } from "color-message-aibox-vue";
|
|
6
|
+
import { emitsMap as i } from "color-star-custom-methods";
|
|
7
|
+
import { _ as ee } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
|
|
8
|
+
import './assets/CustomToggle.css';const te = (y) => `${y}-custom-toggle`, oe = ["id", "data-option-value", "onClick"], le = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "order-number fz-12 text-center mg-r-10 pd-l-8 pd-r-8"
|
|
11
|
+
}, ne = {
|
|
12
|
+
key: 1,
|
|
13
|
+
class: "divider"
|
|
14
|
+
}, se = { class: "toggle-item toggle-action flex items-center justify-center weight-500" }, re = { class: "dropdown-label" }, ae = /* @__PURE__ */ Object.assign({
|
|
15
|
+
name: "CustomToggle"
|
|
16
|
+
}, {
|
|
17
|
+
__name: "layout",
|
|
18
|
+
props: {
|
|
19
|
+
// 选项列表
|
|
20
|
+
options: {
|
|
21
|
+
type: Array,
|
|
22
|
+
default: () => []
|
|
23
|
+
},
|
|
24
|
+
// 当前选中的值 (v-model)
|
|
25
|
+
modelValue: {
|
|
26
|
+
type: [String, Number, Object],
|
|
27
|
+
default: null
|
|
28
|
+
},
|
|
29
|
+
// 最大显示数量,超过此数量会显示收起/展开,如果不传则显示全部
|
|
30
|
+
maxVisible: {
|
|
31
|
+
type: Number,
|
|
32
|
+
default: void 0
|
|
33
|
+
},
|
|
34
|
+
// 字段映射配置 (如果是对象的话)
|
|
35
|
+
fieldMapping: {
|
|
36
|
+
type: Object,
|
|
37
|
+
default: () => ({
|
|
38
|
+
value: "value",
|
|
39
|
+
label: "label"
|
|
40
|
+
})
|
|
41
|
+
},
|
|
42
|
+
// 是否显示顺序数字
|
|
43
|
+
showOrderNumber: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: !1
|
|
46
|
+
},
|
|
47
|
+
// 样式风格
|
|
48
|
+
// 1: 默认(带底边框的 tab 风格)
|
|
49
|
+
// 2: 无底色,选中浅灰,圆角(参考 AiboxTabs style-1)
|
|
50
|
+
styleType: {
|
|
51
|
+
type: [Number, String],
|
|
52
|
+
default: 1
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
emits: [i.updateModelValue, i.change],
|
|
56
|
+
setup(y, { emit: $ }) {
|
|
57
|
+
const o = y, u = $, x = W(null), B = J(), I = c(() => te(B.name)), z = () => {
|
|
58
|
+
try {
|
|
59
|
+
const e = sessionStorage.getItem(I.value);
|
|
60
|
+
if (e && o.options.length > 0 && o.options.some(
|
|
61
|
+
(t, n) => s(t, n) === e
|
|
62
|
+
))
|
|
63
|
+
return e;
|
|
64
|
+
} catch {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
return null;
|
|
68
|
+
}, O = (e) => {
|
|
69
|
+
sessionStorage.setItem(I.value, e);
|
|
70
|
+
};
|
|
71
|
+
let h = [];
|
|
72
|
+
const p = c(() => o.maxVisible !== void 0 ? o.maxVisible : o.options.length), C = c(() => {
|
|
73
|
+
const e = new Set(
|
|
74
|
+
m.value.map((l, t) => s(l))
|
|
75
|
+
);
|
|
76
|
+
return o.options.filter((l, t) => !e.has(s(l)));
|
|
77
|
+
}), N = c(() => C.value.length > 0), m = c(() => {
|
|
78
|
+
if (!o.modelValue || o.options.length <= p.value) {
|
|
79
|
+
const r = o.options.slice(0, p.value);
|
|
80
|
+
return h = r, r;
|
|
81
|
+
}
|
|
82
|
+
const e = o.options.findIndex((r, ue) => f(r));
|
|
83
|
+
if (e === -1) {
|
|
84
|
+
const r = o.options.slice(0, p.value);
|
|
85
|
+
return h = r, r;
|
|
86
|
+
}
|
|
87
|
+
const l = Math.max(0, e - p.value + 1), t = l + p.value, n = o.options.slice(l, t);
|
|
88
|
+
return n.length === 0 ? h : (h = n, n);
|
|
89
|
+
}), A = c(() => {
|
|
90
|
+
const e = m.value.length + (N.value ? 1 : 0);
|
|
91
|
+
return e > 0 ? `${100 / e}%` : "auto";
|
|
92
|
+
}), s = (e, l) => typeof e == "object" ? e[o.fieldMapping.value] : e, E = (e) => typeof e == "object" ? e[o.fieldMapping.label] : e, F = (e, l) => l + 1, f = (e, l) => s(e) === o.modelValue, K = (e, l) => o.styleType == 1 && l < m.value.length - 1, L = async (e, l) => {
|
|
93
|
+
const t = s(e);
|
|
94
|
+
u(i.updateModelValue, t), u(i.change, t), O(t), await b(), _();
|
|
95
|
+
}, q = async (e) => {
|
|
96
|
+
u(i.updateModelValue, e), u(i.change, e), O(e), await b(), _();
|
|
97
|
+
}, _ = () => {
|
|
98
|
+
if (!x.value) return;
|
|
99
|
+
const e = x.value.querySelector(".toggle-item.active");
|
|
100
|
+
e && e.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "center" });
|
|
101
|
+
};
|
|
102
|
+
return Z(async () => {
|
|
103
|
+
const e = z();
|
|
104
|
+
e && (u(i.updateModelValue, e), u(i.change, e)), await b(), _();
|
|
105
|
+
}), (e, l) => (a(), d("div", {
|
|
106
|
+
class: w(["toggle-container flex w-full relative", `toggle-style-${y.styleType}`])
|
|
107
|
+
}, [
|
|
108
|
+
V("div", {
|
|
109
|
+
ref_key: "optionsContainer",
|
|
110
|
+
ref: x,
|
|
111
|
+
class: "visible-options flex-1 overflow-x-auto overflow-y-hidden relative flex"
|
|
112
|
+
}, [
|
|
113
|
+
(a(!0), d(j, null, D(m.value, (t, n) => (a(), d("div", {
|
|
114
|
+
key: s(t),
|
|
115
|
+
id: `toggle-option-${s(t)}`,
|
|
116
|
+
"data-option-value": s(t),
|
|
117
|
+
class: w(["toggle-item pointer text-center flex items-center justify-center ellipsis-1 relative pointer", {
|
|
118
|
+
active: f(t),
|
|
119
|
+
"first-active": f(t) && n === 0,
|
|
120
|
+
"last-active": f(t) && n === m.value.length - 1
|
|
121
|
+
}]),
|
|
122
|
+
style: G({ width: A.value }),
|
|
123
|
+
onClick: (r) => L(t)
|
|
124
|
+
}, [
|
|
125
|
+
o.showOrderNumber ? (a(), d("div", le, S(F(t, n)), 1)) : k("", !0),
|
|
126
|
+
H(" " + S(E(t)) + " ", 1),
|
|
127
|
+
K(t, n) ? (a(), d("span", ne, "|")) : k("", !0)
|
|
128
|
+
], 14, oe))), 128))
|
|
129
|
+
], 512),
|
|
130
|
+
N.value ? (a(), T(g(P), {
|
|
131
|
+
key: 0,
|
|
132
|
+
trigger: "click",
|
|
133
|
+
onCommand: q
|
|
134
|
+
}, {
|
|
135
|
+
dropdown: v(() => [
|
|
136
|
+
M(g(U), null, {
|
|
137
|
+
default: v(() => [
|
|
138
|
+
(a(!0), d(j, null, D(C.value, (t, n) => (a(), T(g(X), {
|
|
139
|
+
key: s(t),
|
|
140
|
+
command: s(t),
|
|
141
|
+
class: w({ "is-active": f(t) })
|
|
142
|
+
}, {
|
|
143
|
+
default: v(() => [
|
|
144
|
+
V("span", re, S(E(t)), 1)
|
|
145
|
+
]),
|
|
146
|
+
_: 2
|
|
147
|
+
}, 1032, ["command", "class"]))), 128))
|
|
148
|
+
]),
|
|
149
|
+
_: 1
|
|
150
|
+
})
|
|
151
|
+
]),
|
|
152
|
+
default: v(() => [
|
|
153
|
+
V("div", se, [
|
|
154
|
+
M(g(Q), null, {
|
|
155
|
+
default: v(() => [
|
|
156
|
+
M(g(Y))
|
|
157
|
+
]),
|
|
158
|
+
_: 1
|
|
159
|
+
})
|
|
160
|
+
])
|
|
161
|
+
]),
|
|
162
|
+
_: 1
|
|
163
|
+
})) : k("", !0)
|
|
164
|
+
], 2));
|
|
165
|
+
}
|
|
166
|
+
}), ie = /* @__PURE__ */ ee(ae, [["__scopeId", "data-v-ce6ff91d"]]), ye = R(ie);
|
|
167
|
+
export {
|
|
168
|
+
ye as CustomToggle,
|
|
169
|
+
ye as default
|
|
170
|
+
};
|
package/es/DialogContainer.mjs
CHANGED
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
import { w as C } from "./chunks/index.bCzIhWFw.js";
|
|
2
|
-
import { ref as n, computed as b, onBeforeUnmount as B, createBlock as k, createCommentVNode as V, openBlock as O, unref as S, normalizeClass as x, withCtx as u, createElementVNode as T, renderSlot as i
|
|
2
|
+
import { ref as n, nextTick as r, computed as b, onBeforeUnmount as B, createBlock as k, createCommentVNode as V, openBlock as O, unref as S, normalizeClass as x, withCtx as u, createElementVNode as T, renderSlot as i } from "vue";
|
|
3
3
|
import { ElDialog as $ } from "element-plus";
|
|
4
|
-
import './assets/DialogContainer.css';const
|
|
4
|
+
import './assets/DialogContainer.css';const z = (e = n(!1)) => {
|
|
5
|
+
const o = n(null), s = n(null);
|
|
6
|
+
return {
|
|
7
|
+
dialogRef: o,
|
|
8
|
+
//弹窗的ref必须为dialogRef
|
|
9
|
+
formRef: s,
|
|
10
|
+
//弹窗里面含有form表单的话,ref必须为formRef
|
|
11
|
+
showDialog: () => {
|
|
12
|
+
o.value.showDialog();
|
|
13
|
+
},
|
|
14
|
+
hideDialog: () => {
|
|
15
|
+
e.value = !1, o.value.hideDialog();
|
|
16
|
+
},
|
|
17
|
+
resetDialog: () => {
|
|
18
|
+
e.value = !1, s.value && r(() => {
|
|
19
|
+
s.value.resetFields();
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}, E = { class: "dialog-body" }, N = {
|
|
5
24
|
__name: "DialogContainer",
|
|
6
25
|
props: {
|
|
7
26
|
// 弹框宽度
|
|
@@ -109,25 +128,6 @@ import './assets/DialogContainer.css';const E = { class: "dialog-body" }, N = {
|
|
|
109
128
|
_: 3
|
|
110
129
|
}, 8, ["modelValue", "width", "title", "modal", "show-close", "destroy-on-close", "class", "draggable", "fullscreen"])) : V("", !0);
|
|
111
130
|
}
|
|
112
|
-
}, z = (e = n(!1)) => {
|
|
113
|
-
const o = n(null), s = n(null);
|
|
114
|
-
return {
|
|
115
|
-
dialogRef: o,
|
|
116
|
-
//弹窗的ref必须为dialogRef
|
|
117
|
-
formRef: s,
|
|
118
|
-
//弹窗里面含有form表单的话,ref必须为formRef
|
|
119
|
-
showDialog: () => {
|
|
120
|
-
o.value.showDialog();
|
|
121
|
-
},
|
|
122
|
-
hideDialog: () => {
|
|
123
|
-
e.value = !1, o.value.hideDialog();
|
|
124
|
-
},
|
|
125
|
-
resetDialog: () => {
|
|
126
|
-
e.value = !1, s.value && r(() => {
|
|
127
|
-
s.value.resetFields();
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
131
|
}, F = C(N);
|
|
132
132
|
export {
|
|
133
133
|
F as DialogContainer,
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { w as I } 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 L, createVNode as d, createTextVNode as S } from "vue";
|
|
3
|
+
import { ElRow as T, ElCol as $, ElIcon as c, ElButton as D } from "element-plus";
|
|
4
|
+
import { IconDelete as E, IconHide as V } from "color-message-aibox-vue";
|
|
5
|
+
import { U as v } from "./chunks/enums.Dvec-maC.js";
|
|
6
|
+
import { n as z, c as P, u as N } from "./chunks/usePreview.B5lboHeg.js";
|
|
7
|
+
import { i as re, a as de, b as ce, e as ue, f as pe, g as _e, h as fe, j as me, k as ve, l as we, m as ke } from "./chunks/usePreview.B5lboHeg.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: b } = z(), w = a, k = B, y = (i) => N(i);
|
|
42
|
+
function g(i) {
|
|
43
|
+
w.isCustom ? k("on-preview", i) : w.isStream ? b(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(T), {
|
|
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($), {
|
|
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, L(e.name), 1)
|
|
83
|
+
], 8, J),
|
|
84
|
+
e.isUploading ? (l(), t("div", W, [
|
|
85
|
+
d(s(D), {
|
|
86
|
+
text: "",
|
|
87
|
+
size: "small",
|
|
88
|
+
loading: ""
|
|
89
|
+
}, {
|
|
90
|
+
default: n(() => [...u[0] || (u[0] = [
|
|
91
|
+
S("上传中...", -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(V))
|
|
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-83d1cbbd"]]), ae = I(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,268 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { w as j } from "./chunks/index.bCzIhWFw.js";
|
|
2
|
+
import { ref as R, computed as h, resolveDirective as z, createElementBlock as _, openBlock as i, normalizeStyle as V, normalizeClass as I, withDirectives as X, createBlock as r, unref as a, withCtx as m, createElementVNode as p, createCommentVNode as f, renderSlot as A, 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 "./chunks/files.cduUqjHX.js";
|
|
5
|
+
import { U as v } from "./chunks/enums.Dvec-maC.js";
|
|
6
|
+
import { A as he, a as Ie, b as Ae, F as Ne, c as Fe, p as Le } from "./chunks/enums.Dvec-maC.js";
|
|
7
|
+
import { u as F } from "./chunks/i18n.DDMVloiU.js";
|
|
8
|
+
import { MySpace as Q, Space as ee, IconEdit2 as te, IconAdd as ae, IconUpload2 as le, File as oe } from "color-message-aibox-vue";
|
|
9
|
+
import { ICON_PATH_MAP as g, SOURCE_TYPE as C, APPLICATION_TYPE as N } from "color-star-custom-components";
|
|
10
|
+
import './assets/FileUploader.css';const se = { class: "card-uploader__mask" }, ne = {
|
|
11
|
+
key: 4,
|
|
12
|
+
class: "pd-l-24 pd-r-24"
|
|
13
|
+
}, 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" }, me = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "panel-uploader__text--tip font-style"
|
|
16
|
+
}, fe = { class: "panel-uploader__text--tip font-style" }, Oe = {
|
|
17
|
+
__name: "index",
|
|
18
|
+
props: {
|
|
19
|
+
uploadType: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: "Card"
|
|
22
|
+
},
|
|
23
|
+
acceptType: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: ""
|
|
26
|
+
},
|
|
27
|
+
multiple: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: !1
|
|
30
|
+
},
|
|
31
|
+
limitCount: {
|
|
32
|
+
type: Number,
|
|
33
|
+
default: 1e3
|
|
34
|
+
},
|
|
35
|
+
limitSize: {
|
|
36
|
+
type: Number,
|
|
37
|
+
default: 8
|
|
38
|
+
},
|
|
39
|
+
warnTips: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: ""
|
|
42
|
+
},
|
|
43
|
+
warnTips2: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: ""
|
|
46
|
+
},
|
|
47
|
+
isMiio: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: !0
|
|
50
|
+
},
|
|
51
|
+
businessType: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: "common"
|
|
54
|
+
},
|
|
55
|
+
defaultUploadIcon: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: ""
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
emits: ["on-success"],
|
|
61
|
+
setup(e, { emit: t }) {
|
|
62
|
+
const { t: o } = F(), n = R(!1), l = R(null), { commonUpload: M } = J(), d = e, S = t, L = (s) => {
|
|
63
|
+
const u = /\.([^.]+)$/, c = s.match(u);
|
|
64
|
+
return c ? c[1] : null;
|
|
65
|
+
}, W = (s, u, c) => {
|
|
66
|
+
let P = !0;
|
|
67
|
+
const E = s.name && s.name.toLowerCase();
|
|
68
|
+
if (console.log(s.name, E, "fileName"), u && u.indexOf(L(E)) === -1) {
|
|
69
|
+
const U = o("COMPONENTS.UPLOAD_TYPE_TIP", { type: u });
|
|
70
|
+
w({
|
|
71
|
+
type: "warning",
|
|
72
|
+
message: U
|
|
73
|
+
}), P = !1;
|
|
74
|
+
}
|
|
75
|
+
if (s.size > 1024 * 1024 * c) {
|
|
76
|
+
const U = o("COMPONENTS.UPLOAD_SIZE_TIP", { size: c });
|
|
77
|
+
w.warning(U), P = !1;
|
|
78
|
+
}
|
|
79
|
+
return P;
|
|
80
|
+
}, b = {
|
|
81
|
+
space: ee,
|
|
82
|
+
"my-space": Q
|
|
83
|
+
}, k = {
|
|
84
|
+
plugin: g.application[C.PLUGIN],
|
|
85
|
+
agent: g.agent[N.autonomous],
|
|
86
|
+
dialogue: g.agent[N.dialogue],
|
|
87
|
+
model: g.application[C.MODEL],
|
|
88
|
+
workflow: g.application[C.WORKFLOW],
|
|
89
|
+
mcp: g.application[C.MCP]
|
|
90
|
+
}, B = h(() => ({
|
|
91
|
+
Card: "card-uploader",
|
|
92
|
+
Button: "button-uploader",
|
|
93
|
+
Panel: "panel-uploader"
|
|
94
|
+
})[d.uploadType]), x = h(() => d.defaultUploadIcon ? b[d.defaultUploadIcon] : ""), K = () => {
|
|
95
|
+
const s = o(
|
|
96
|
+
"COMPONENTS.UPLOAD_COUNT_TIP",
|
|
97
|
+
{ count: d.limitCount }
|
|
98
|
+
);
|
|
99
|
+
w({
|
|
100
|
+
type: "warning",
|
|
101
|
+
message: s
|
|
102
|
+
});
|
|
103
|
+
}, D = async (s) => {
|
|
104
|
+
if (W(s, d.acceptType, d.limitSize))
|
|
105
|
+
if (d.isMiio) {
|
|
106
|
+
n.value = !0;
|
|
107
|
+
const { data: c } = await M(
|
|
108
|
+
{
|
|
109
|
+
file: s.raw
|
|
110
|
+
},
|
|
111
|
+
d.businessType
|
|
112
|
+
).finally(() => {
|
|
113
|
+
n.value = !1;
|
|
114
|
+
});
|
|
115
|
+
console.log(c, "data"), S("on-success", c);
|
|
116
|
+
} else
|
|
117
|
+
S("on-success", s);
|
|
118
|
+
else
|
|
119
|
+
l.value.handleRemove(s);
|
|
120
|
+
};
|
|
121
|
+
return (s, u) => {
|
|
122
|
+
const c = z("loading");
|
|
123
|
+
return i(), _("div", {
|
|
124
|
+
class: I(["file-uploader", e.defaultUploadIcon]),
|
|
125
|
+
style: V({
|
|
126
|
+
border: !e.defaultUploadIcon && e.uploadType === "Card" ? "1px dashed var(--el-border-color)" : "none",
|
|
127
|
+
"border-radius": !e.defaultUploadIcon && e.uploadType === "Card" ? "8px" : "0",
|
|
128
|
+
"background-image": x.value ? `url('${x.value}')` : "none"
|
|
129
|
+
})
|
|
130
|
+
}, [
|
|
131
|
+
X((i(), r(a(H), {
|
|
132
|
+
ref_key: "uploader",
|
|
133
|
+
ref: l,
|
|
134
|
+
class: I(B.value),
|
|
135
|
+
action: "",
|
|
136
|
+
"auto-upload": !1,
|
|
137
|
+
limit: e.limitCount,
|
|
138
|
+
"show-file-list": !1,
|
|
139
|
+
accept: e.acceptType,
|
|
140
|
+
multiple: e.multiple,
|
|
141
|
+
drag: e.uploadType === a(v).面板,
|
|
142
|
+
"on-change": D,
|
|
143
|
+
"on-exceed": K
|
|
144
|
+
}, {
|
|
145
|
+
default: m(() => [
|
|
146
|
+
x.value ? (i(), r(a(y), {
|
|
147
|
+
key: 0,
|
|
148
|
+
size: "64",
|
|
149
|
+
class: "absolute"
|
|
150
|
+
}, {
|
|
151
|
+
default: m(() => [
|
|
152
|
+
(i(), r($(x.value)))
|
|
153
|
+
]),
|
|
154
|
+
_: 1
|
|
155
|
+
})) : (i(), _(Y, { key: 1 }, [
|
|
156
|
+
e.defaultUploadIcon ? (i(), r(a(Z), {
|
|
157
|
+
key: 0,
|
|
158
|
+
style: { width: "64px", height: "64px" },
|
|
159
|
+
src: k[e.defaultUploadIcon],
|
|
160
|
+
class: "absolute"
|
|
161
|
+
}, null, 8, ["src"])) : f("", !0)
|
|
162
|
+
], 64)),
|
|
163
|
+
p("div", se, [
|
|
164
|
+
T(a(y), {
|
|
165
|
+
color: "#fff",
|
|
166
|
+
size: "16px"
|
|
167
|
+
}, {
|
|
168
|
+
default: m(() => [
|
|
169
|
+
T(a(te))
|
|
170
|
+
]),
|
|
171
|
+
_: 1
|
|
172
|
+
})
|
|
173
|
+
]),
|
|
174
|
+
e.uploadType === a(v).卡片 ? (i(), r(a(y), {
|
|
175
|
+
key: 2,
|
|
176
|
+
class: "card-uploader__icon"
|
|
177
|
+
}, {
|
|
178
|
+
default: m(() => [
|
|
179
|
+
e.defaultUploadIcon ? f("", !0) : (i(), r(a(ae), { key: 0 })),
|
|
180
|
+
A(s.$slots, "text-slot")
|
|
181
|
+
]),
|
|
182
|
+
_: 3
|
|
183
|
+
})) : f("", !0),
|
|
184
|
+
e.uploadType === a(v).按钮 ? (i(), r(a(q), {
|
|
185
|
+
key: 3,
|
|
186
|
+
type: "primary"
|
|
187
|
+
}, {
|
|
188
|
+
default: m(() => [
|
|
189
|
+
T(a(y), { style: { "margin-right": "5px" } }, {
|
|
190
|
+
default: m(() => [
|
|
191
|
+
T(a(le))
|
|
192
|
+
]),
|
|
193
|
+
_: 1
|
|
194
|
+
}),
|
|
195
|
+
G(" " + O(a(o)("COMMON_BUTTON.UPLOAD_TEXT")), 1)
|
|
196
|
+
]),
|
|
197
|
+
_: 1
|
|
198
|
+
})) : f("", !0),
|
|
199
|
+
e.uploadType === a(v).面板 ? (i(), _("div", ne, [
|
|
200
|
+
T(a(y), { size: "48px" }, {
|
|
201
|
+
default: m(() => [
|
|
202
|
+
T(a(oe))
|
|
203
|
+
]),
|
|
204
|
+
_: 1
|
|
205
|
+
}),
|
|
206
|
+
p("div", ie, [
|
|
207
|
+
p("div", ce, [
|
|
208
|
+
p("span", de, O(a(o)("COMMON_BUTTON.CLICK_TEXT")), 1),
|
|
209
|
+
p("span", pe, O(a(o)("COMMON_BUTTON.OR_TEXT")), 1),
|
|
210
|
+
p("span", ue, O(a(o)("COMMON_BUTTON.DRAG_TEXT")), 1),
|
|
211
|
+
p("span", re, O(a(o)("COMMON_BUTTON.FILE_UPLOAD_TEXT")), 1)
|
|
212
|
+
]),
|
|
213
|
+
e.warnTips2 ? (i(), _("div", me, O(e.warnTips2), 1)) : f("", !0),
|
|
214
|
+
p("div", fe, O(e.warnTips), 1)
|
|
215
|
+
])
|
|
216
|
+
])) : f("", !0),
|
|
217
|
+
e.uploadType === a(v).自定义 ? A(s.$slots, "upload-box", { key: 5 }) : f("", !0)
|
|
218
|
+
]),
|
|
219
|
+
_: 3
|
|
220
|
+
}, 8, ["class", "limit", "accept", "multiple", "drag"])), [
|
|
221
|
+
[c, n.value]
|
|
222
|
+
])
|
|
223
|
+
], 6);
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
}, Pe = (e) => {
|
|
227
|
+
const { t } = F();
|
|
228
|
+
let o = e.toLowerCase(), n = "", l = "";
|
|
229
|
+
const M = t("WORKFLOW_COM.TIP_TEXT_3");
|
|
230
|
+
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;
|
|
231
|
+
}, Ue = (e) => {
|
|
232
|
+
let t = e.toLowerCase();
|
|
233
|
+
if (t.includes("file"))
|
|
234
|
+
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";
|
|
235
|
+
if (t.includes("image"))
|
|
236
|
+
return ".jpg,.jpeg,.png,.webp";
|
|
237
|
+
if (t.includes("doc"))
|
|
238
|
+
return ".doc,.docx";
|
|
239
|
+
if (t.includes("ppt"))
|
|
240
|
+
return ".ppt,.pptx";
|
|
241
|
+
if (t.includes("pdf"))
|
|
242
|
+
return ".pdf";
|
|
243
|
+
if (t.includes("txt"))
|
|
244
|
+
return ".txt";
|
|
245
|
+
if (t.includes("excel"))
|
|
246
|
+
return ".xls,.xlsx,.csv";
|
|
247
|
+
if (t.includes("audio"))
|
|
248
|
+
return ".mp3,.wav,.aac,.flac,.ogg";
|
|
249
|
+
if (t.includes("video"))
|
|
250
|
+
return ".mp4,.mkv,.webm,.ts,.avi,.mov,.flv,.3gp,.ogv";
|
|
251
|
+
}, we = (e) => {
|
|
252
|
+
const t = e.match(/array(\\w+)/);
|
|
253
|
+
return t && t[1] ? t[1].toLowerCase() : null;
|
|
254
|
+
}, Se = j(Oe);
|
|
2
255
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
256
|
+
he as AgentChannelEnum,
|
|
257
|
+
Ie as AgentLabelValueEnum,
|
|
258
|
+
Ae as AgentTypeEnum,
|
|
259
|
+
Se as FileUploader,
|
|
260
|
+
Ne as FormItemTypesEnum,
|
|
261
|
+
v as UploadTypesEnum,
|
|
262
|
+
Fe as colorValue,
|
|
263
|
+
Se as default,
|
|
264
|
+
we as extractAndLowerCaseArrayType,
|
|
265
|
+
Ue as getAcceptType,
|
|
266
|
+
Pe as getWarnTips,
|
|
267
|
+
Le as pages
|
|
11
268
|
};
|