@farris/ui-vue 1.7.2-beta.1 → 1.7.2-beta.2
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/components/avatar/index.esm.js +155 -148
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +1 -1
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +226 -224
- package/components/calendar/index.umd.cjs +3 -3
- package/components/collection-property-editor/index.esm.js +225 -223
- package/components/collection-property-editor/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +76 -71
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/comment/index.esm.js +169 -167
- package/components/comment/index.umd.cjs +6 -6
- package/components/component/index.esm.js +3691 -3043
- package/components/component/index.umd.cjs +2 -2
- package/components/condition/index.esm.js +2015 -1352
- package/components/condition/index.umd.cjs +2 -2
- package/components/data-grid/index.esm.js +407 -430
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +3082 -3196
- package/components/data-view/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +3364 -2713
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/drawer/index.esm.js +66 -64
- package/components/drawer/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +1176 -524
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +182 -180
- package/components/dynamic-resolver/index.umd.cjs +2 -2
- package/components/dynamic-view/index.esm.js +531 -455
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +2352 -1700
- package/components/events-editor/index.umd.cjs +3 -3
- package/components/expression-editor/index.esm.js +8 -3
- package/components/expression-editor/index.umd.cjs +2 -2
- package/components/filter-bar/index.esm.js +422 -413
- package/components/filter-bar/index.umd.cjs +2 -2
- package/components/filter-condition-editor/index.esm.js +8 -3
- package/components/filter-condition-editor/index.umd.cjs +1 -1
- package/components/image/index.esm.js +363 -354
- package/components/image/index.umd.cjs +2 -2
- package/components/language-textbox/index.esm.js +189 -187
- package/components/language-textbox/index.umd.cjs +2 -2
- package/components/list-view/index.esm.js +388 -389
- package/components/list-view/index.umd.cjs +5 -5
- package/components/mapping-editor/index.esm.js +1465 -1488
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +180 -173
- package/components/number-range/index.umd.cjs +1 -1
- package/components/order/index.esm.js +815 -811
- package/components/order/index.umd.cjs +5 -5
- package/components/property-panel/index.esm.js +429 -420
- package/components/property-panel/index.umd.cjs +3 -3
- package/components/query-solution/index.esm.js +4746 -4085
- package/components/query-solution/index.umd.cjs +7 -7
- package/components/schema-selector/index.esm.js +1401 -1402
- package/components/schema-selector/index.umd.cjs +5 -5
- package/components/section/index.esm.js +102 -100
- package/components/section/index.umd.cjs +2 -2
- package/components/sort-condition-editor/index.esm.js +8 -3
- package/components/sort-condition-editor/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +537 -538
- package/components/transfer/index.umd.cjs +5 -5
- package/components/tree-grid/index.esm.js +280 -283
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +200 -202
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +533 -519
- package/components/uploader/index.umd.cjs +2 -2
- package/designer/data-grid/index.esm.js +3806 -3905
- package/designer/data-grid/index.umd.cjs +9 -9
- package/designer/drawer/index.esm.js +188 -186
- package/designer/drawer/index.umd.cjs +2 -2
- package/designer/dynamic-form/index.esm.js +1562 -1073
- package/designer/dynamic-form/index.umd.cjs +2 -2
- package/designer/farris-designer.all.esm.js +9793 -8613
- package/designer/farris-designer.all.umd.cjs +8 -8
- package/designer/list-view/index.esm.js +564 -564
- package/designer/list-view/index.umd.cjs +6 -6
- package/designer/radio-group/index.esm.js +236 -229
- package/designer/radio-group/index.umd.cjs +1 -1
- package/designer/response-layout-editor/index.esm.js +178 -171
- package/designer/response-layout-editor/index.umd.cjs +1 -1
- package/designer/tabs/index.esm.js +3154 -2508
- package/designer/tabs/index.umd.cjs +2 -2
- package/designer/time-picker/index.esm.js +193 -186
- package/designer/time-picker/index.umd.cjs +1 -1
- package/designer/tree-grid/index.esm.js +444 -447
- package/designer/tree-grid/index.umd.cjs +1 -1
- package/farris.all.esm.js +60126 -59649
- package/farris.all.umd.cjs +30 -30
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/components.d.ts +1 -1
- package/types/condition/src/composition/condition-value/dropdown-value.d.ts +4 -0
- package/types/data-grid/index.d.ts +2 -5
- package/types/data-grid/src/data-grid.component.d.ts +1 -2
- package/types/data-view/components/row/hierarchy-row.component.d.ts +2 -2
- package/types/data-view/composition/appearance/use-cell-position.d.ts +1 -1
- package/types/data-view/composition/types.d.ts +0 -4
- package/types/data-view/composition/visualization/use-virtual-scroll.d.ts +2 -2
- package/types/data-view/composition/visualization/use-visual-data-bound.d.ts +2 -3
- package/types/data-view/composition/visualization/use-visual-data-row.d.ts +1 -2
- package/types/designer-canvas/src/composition/dg-control.d.ts +24 -0
- package/types/dynamic-form/designer.d.ts +0 -1
- package/types/dynamic-form/index.d.ts +4 -3
- package/types/dynamic-form/src/designer/dynamic-form.design.component.d.ts +8 -0
- package/types/dynamic-form/src/designer/response-form.design.props.d.ts +14 -0
- package/types/dynamic-form/src/designer/use-dynamic-form-rules.d.ts +2 -0
- package/types/dynamic-form/src/dynamic-form.component.d.ts +8 -0
- package/types/dynamic-form/src/response-form.props.d.ts +13 -1
- package/types/dynamic-form/src/schema/response-form-schema-resolver.d.ts +1 -0
- package/types/dynamic-form/src/types.d.ts +1 -0
- package/types/dynamic-resolver/src/types.d.ts +1 -0
- package/types/dynamic-view/index.d.ts +43 -3
- package/types/dynamic-view/src/components/maps.d.ts +6 -6
- package/types/dynamic-view/src/composition/index.d.ts +5 -0
- package/types/dynamic-view/src/composition/use-utils.d.ts +12 -0
- package/types/dynamic-view/src/dynamic-view.component.d.ts +6 -6
- package/types/language-textbox/index.d.ts +3 -3
- package/types/language-textbox/src/components/language-contents.component.d.ts +1 -1
- package/types/language-textbox/src/language-textbox.component.d.ts +1 -1
- package/types/lookup/src/components/favorite/lookup-favorite.component.d.ts +1 -1
- package/types/lookup/src/components/popup-container.component.d.ts +3 -3
- package/types/property-panel/src/property-panel.component.d.ts +3 -3
- package/types/tree-grid/src/components/data/data-area.component.d.ts +2 -2
- package/types/tree-grid/src/tree-grid.props.d.ts +0 -1
- package/types/tree-view/src/components/data/tree-area.component.d.ts +1 -1
- package/types/tree-view/src/tree-view.props.d.ts +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
var
|
|
2
|
-
var Ue = (t, e, n) => e in t ?
|
|
3
|
-
var
|
|
4
|
-
import { defineComponent as K, toRefs as fe, createVNode as l, Fragment as
|
|
5
|
-
import { resolveAppearance as
|
|
6
|
-
import { useDateFormat as
|
|
1
|
+
var Ie = Object.defineProperty;
|
|
2
|
+
var Ue = (t, e, n) => e in t ? Ie(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var j = (t, e, n) => Ue(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { defineComponent as K, toRefs as fe, createVNode as l, Fragment as G, createTextVNode as F, ref as B, watch as q, inject as J, getCurrentInstance as ze, onMounted as ve, onUnmounted as me, computed as O, reactive as je, createApp as Le, Transition as qe, mergeProps as $e, provide as Ve, resolveComponent as Q, onBeforeMount as _e } from "vue";
|
|
5
|
+
import { resolveAppearance as Qe, createPropsResolver as Ke } from "../dynamic-resolver/index.esm.js";
|
|
6
|
+
import { useDateFormat as We, withInstall as Ye } from "../common/index.esm.js";
|
|
7
7
|
import { LocaleService as ce } from "../locale/index.esm.js";
|
|
8
|
-
import { useDesignerComponent as
|
|
9
|
-
const
|
|
8
|
+
import { useDesignerComponent as Xe } from "../designer-canvas/index.esm.js";
|
|
9
|
+
const Ge = {
|
|
10
10
|
// 是否被选中
|
|
11
11
|
checked: { type: Boolean, default: !1 },
|
|
12
12
|
// 进度条状态 默认'normal'
|
|
13
13
|
id: { type: String, default: "" },
|
|
14
14
|
// 禁用
|
|
15
15
|
disabled: { type: Boolean, default: !1 }
|
|
16
|
-
},
|
|
16
|
+
}, Je = {
|
|
17
17
|
// 是否显示进度条信息
|
|
18
18
|
showInfo: { type: Boolean, default: !0 },
|
|
19
19
|
// 进度条状态 默认'normal'
|
|
@@ -21,7 +21,7 @@ const Xe = {
|
|
|
21
21
|
// 已完成的分段百分比
|
|
22
22
|
percent: { type: Number, default: 0 },
|
|
23
23
|
maxWidth: { type: Number, default: 0 }
|
|
24
|
-
},
|
|
24
|
+
}, Ze = {
|
|
25
25
|
/**
|
|
26
26
|
* 按钮文本
|
|
27
27
|
*/
|
|
@@ -54,18 +54,18 @@ const Xe = {
|
|
|
54
54
|
* 附件服务器端服务注入的Token
|
|
55
55
|
*/
|
|
56
56
|
uploadServerToken: { type: String, default: "" }
|
|
57
|
-
},
|
|
57
|
+
}, et = /* @__PURE__ */ K({
|
|
58
58
|
name: "FUploadProgress",
|
|
59
|
-
props:
|
|
59
|
+
props: Je,
|
|
60
60
|
setup(t, e) {
|
|
61
61
|
const {
|
|
62
62
|
showInfo: n,
|
|
63
|
-
status:
|
|
63
|
+
status: i,
|
|
64
64
|
maxWidth: a,
|
|
65
|
-
percent:
|
|
65
|
+
percent: s
|
|
66
66
|
} = fe(t);
|
|
67
67
|
return () => l("div", {
|
|
68
|
-
class: ["f-progress upload-progress", "upload-progress-status-" +
|
|
68
|
+
class: ["f-progress upload-progress", "upload-progress-status-" + i.value, "f-progress-status-" + i.value, "upload-progress-line", n.value ? "upload-progress-show-info" : ""]
|
|
69
69
|
}, [l("div", {
|
|
70
70
|
class: "upload-progress-outer",
|
|
71
71
|
style: {
|
|
@@ -76,29 +76,29 @@ const Xe = {
|
|
|
76
76
|
}, [l("div", {
|
|
77
77
|
class: "upload-progress-bg f-progress-bg",
|
|
78
78
|
style: {
|
|
79
|
-
width:
|
|
79
|
+
width: s.value + "%"
|
|
80
80
|
}
|
|
81
81
|
}, null)])]), n.value ? l("span", {
|
|
82
82
|
class: "upload-progress-text"
|
|
83
|
-
}, [
|
|
84
|
-
class: ["upload-progress-text-icon f-icon", "f-icon-" +
|
|
85
|
-
}, null) : l(
|
|
83
|
+
}, [i.value === "error" || i.value === "success" ? l("span", {
|
|
84
|
+
class: ["upload-progress-text-icon f-icon", "f-icon-" + i.value]
|
|
85
|
+
}, null) : l(G, null, [s.value, F("%")])]) : ""]);
|
|
86
86
|
}
|
|
87
87
|
}), Te = /* @__PURE__ */ K({
|
|
88
88
|
name: "FPreviewCheckbox",
|
|
89
|
-
props:
|
|
89
|
+
props: Ge,
|
|
90
90
|
emits: ["checkedChange"],
|
|
91
91
|
setup(t, e) {
|
|
92
92
|
const {
|
|
93
93
|
disabled: n
|
|
94
|
-
} = fe(t),
|
|
95
|
-
|
|
96
|
-
checked:
|
|
94
|
+
} = fe(t), i = B(t.checked), a = (s) => {
|
|
95
|
+
s.stopPropagation(), n.value || (i.value = !i.value, e.emit("checkedChange", {
|
|
96
|
+
checked: i.value,
|
|
97
97
|
id: t.id
|
|
98
98
|
}));
|
|
99
99
|
};
|
|
100
|
-
return
|
|
101
|
-
|
|
100
|
+
return q(() => t.checked, (s) => {
|
|
101
|
+
i.value = s;
|
|
102
102
|
}), () => l("div", {
|
|
103
103
|
class: "preview-checkbox d-inline-flex align-middle"
|
|
104
104
|
}, [l("div", {
|
|
@@ -108,50 +108,54 @@ const Xe = {
|
|
|
108
108
|
class: "custom-control-input",
|
|
109
109
|
type: "checkbox",
|
|
110
110
|
disabled: n.value,
|
|
111
|
-
checked:
|
|
111
|
+
checked: i.value
|
|
112
112
|
}, null), l("label", {
|
|
113
113
|
class: "custom-control-label",
|
|
114
|
-
onClick: (
|
|
115
|
-
onMousedown: (
|
|
114
|
+
onClick: (s) => a(s),
|
|
115
|
+
onMousedown: (s) => s.stopPropagation()
|
|
116
116
|
}, null)])]);
|
|
117
117
|
}
|
|
118
118
|
}), Ee = /* @__PURE__ */ K({
|
|
119
119
|
name: "FFileSelect",
|
|
120
|
-
props:
|
|
120
|
+
props: Ze,
|
|
121
121
|
emits: ["change", "stateChange"],
|
|
122
122
|
setup(t, e) {
|
|
123
|
-
const n =
|
|
123
|
+
const n = J("uploaderService");
|
|
124
124
|
n.setUploadContext(e);
|
|
125
|
-
const
|
|
126
|
-
let
|
|
125
|
+
const i = ze(), a = B("*");
|
|
126
|
+
let s;
|
|
127
127
|
const d = () => {
|
|
128
|
-
|
|
128
|
+
s.files && (e.emit("change", s.files), n.handleFiles(s.files), s.value = null);
|
|
129
129
|
};
|
|
130
130
|
function u() {
|
|
131
|
-
|
|
131
|
+
s.value = null, n.reset();
|
|
132
132
|
}
|
|
133
|
-
|
|
133
|
+
q(() => t.disabled, () => {
|
|
134
134
|
u();
|
|
135
|
-
}),
|
|
135
|
+
}), q(() => t.uploadedCount, (f) => {
|
|
136
136
|
n.setOptions({
|
|
137
137
|
uploadedCount: f
|
|
138
138
|
});
|
|
139
|
-
}),
|
|
139
|
+
}), q(() => t.extendConfig, (f) => {
|
|
140
140
|
n.setExtendServerConfig(f);
|
|
141
|
+
}), q(() => t.options, (f) => {
|
|
142
|
+
n.setOptions(f);
|
|
143
|
+
}, {
|
|
144
|
+
deep: !0
|
|
141
145
|
});
|
|
142
146
|
function v(f) {
|
|
143
|
-
f && f.stopPropagation(),
|
|
147
|
+
f && f.stopPropagation(), s.click();
|
|
144
148
|
}
|
|
145
|
-
function
|
|
149
|
+
function x(f) {
|
|
146
150
|
n.handleUploadEvent(f);
|
|
147
151
|
}
|
|
148
152
|
return ve(() => {
|
|
149
153
|
var f, T;
|
|
150
|
-
|
|
154
|
+
s = (f = i == null ? void 0 : i.proxy) == null ? void 0 : f.$refs.uploadInput, u(), n.setOptions(t.options), n.setExtendServerConfig(t.extendConfig), a.value = (((T = t.options) == null ? void 0 : T.allowedContentTypes) || ["*"]).join(",");
|
|
151
155
|
}), me(() => {
|
|
152
156
|
}), e.expose({
|
|
153
|
-
handleUploadEvent:
|
|
154
|
-
}), () => l(
|
|
157
|
+
handleUploadEvent: x
|
|
158
|
+
}), () => l(G, null, [l("input", {
|
|
155
159
|
ref: "uploadInput",
|
|
156
160
|
type: "file",
|
|
157
161
|
class: "ffileupload--browser",
|
|
@@ -170,7 +174,7 @@ const Xe = {
|
|
|
170
174
|
style: "top: 2px;position: relative;"
|
|
171
175
|
}, null), t.selectText])]);
|
|
172
176
|
}
|
|
173
|
-
}),
|
|
177
|
+
}), tt = "https://json-schema.org/draft/2020-12/schema", lt = "https://farris-design.gitee.io/uploader.schema.json", nt = "uploader", it = "A Farris Component", st = "object", at = {
|
|
174
178
|
id: {
|
|
175
179
|
description: "The unique identifier for uploader",
|
|
176
180
|
type: "string"
|
|
@@ -222,24 +226,24 @@ const Xe = {
|
|
|
222
226
|
type: "boolean",
|
|
223
227
|
default: !0
|
|
224
228
|
}
|
|
225
|
-
},
|
|
229
|
+
}, ot = [
|
|
226
230
|
"id",
|
|
227
231
|
"type"
|
|
228
|
-
],
|
|
229
|
-
$schema:
|
|
230
|
-
$id:
|
|
231
|
-
title:
|
|
232
|
-
description:
|
|
233
|
-
type:
|
|
234
|
-
properties:
|
|
235
|
-
required:
|
|
236
|
-
},
|
|
237
|
-
["appearance",
|
|
232
|
+
], rt = {
|
|
233
|
+
$schema: tt,
|
|
234
|
+
$id: lt,
|
|
235
|
+
title: nt,
|
|
236
|
+
description: it,
|
|
237
|
+
type: st,
|
|
238
|
+
properties: at,
|
|
239
|
+
required: ot
|
|
240
|
+
}, ut = /* @__PURE__ */ new Map([
|
|
241
|
+
["appearance", Qe]
|
|
238
242
|
]);
|
|
239
|
-
function
|
|
243
|
+
function dt(t, e, n) {
|
|
240
244
|
return e;
|
|
241
245
|
}
|
|
242
|
-
const
|
|
246
|
+
const ct = "uploader", pt = "A Farris Component", ft = "object", vt = {
|
|
243
247
|
basic: {
|
|
244
248
|
description: "Basic Infomation",
|
|
245
249
|
title: "基本信息",
|
|
@@ -444,11 +448,11 @@ const dt = "uploader", ct = "A Farris Component", pt = "object", ft = {
|
|
|
444
448
|
}
|
|
445
449
|
}
|
|
446
450
|
}
|
|
447
|
-
},
|
|
448
|
-
title:
|
|
449
|
-
description:
|
|
450
|
-
type:
|
|
451
|
-
categories:
|
|
451
|
+
}, mt = {
|
|
452
|
+
title: ct,
|
|
453
|
+
description: pt,
|
|
454
|
+
type: ft,
|
|
455
|
+
categories: vt
|
|
452
456
|
}, he = {
|
|
453
457
|
/** 内容区域填充 */
|
|
454
458
|
contentFill: { type: Boolean, default: !1 },
|
|
@@ -513,44 +517,44 @@ const dt = "uploader", ct = "A Farris Component", pt = "object", ft = {
|
|
|
513
517
|
* 提示服务注入的Token
|
|
514
518
|
*/
|
|
515
519
|
notifyServiceToken: { type: String, default: "" }
|
|
516
|
-
}, Be =
|
|
517
|
-
var
|
|
518
|
-
class
|
|
520
|
+
}, Be = Ke(he, rt, ut, dt, mt);
|
|
521
|
+
var L = /* @__PURE__ */ ((t) => (t[t.Queue = 0] = "Queue", t[t.Uploading = 1] = "Uploading", t[t.Done = 2] = "Done", t[t.Cancelled = 3] = "Cancelled", t[t.Remove = 4] = "Remove", t[t.Error = 5] = "Error", t))(L || {});
|
|
522
|
+
class ht {
|
|
519
523
|
constructor(e = {}, n = {}) {
|
|
520
524
|
/**
|
|
521
525
|
* 上传配置
|
|
522
526
|
*/
|
|
523
|
-
|
|
527
|
+
j(this, "uploadConfig");
|
|
524
528
|
/**
|
|
525
529
|
* 删除配置
|
|
526
530
|
*/
|
|
527
|
-
|
|
528
|
-
const
|
|
529
|
-
this.uploadConfig = Object.assign({},
|
|
531
|
+
j(this, "removeConfig");
|
|
532
|
+
const i = { type: "config", url: "", timeout: 0, headers: null, data: {} };
|
|
533
|
+
this.uploadConfig = Object.assign({}, i, e), this.removeConfig = Object.assign({}, i, n);
|
|
530
534
|
}
|
|
531
535
|
}
|
|
532
536
|
function ge(t, e) {
|
|
533
|
-
const { formatTo: n } =
|
|
537
|
+
const { formatTo: n } = We();
|
|
534
538
|
return n(t, e);
|
|
535
539
|
}
|
|
536
540
|
function be(t, e) {
|
|
537
541
|
if (!e)
|
|
538
542
|
return "";
|
|
539
543
|
let n = "";
|
|
540
|
-
return t.indexOf(".") === -1 && e.hasOwnProperty(t) ? n = e[t] : n = t.split(".").reduce((
|
|
544
|
+
return t.indexOf(".") === -1 && e.hasOwnProperty(t) ? n = e[t] : n = t.split(".").reduce((i, a) => i ? i[a] : null, e), n;
|
|
541
545
|
}
|
|
542
|
-
function
|
|
546
|
+
function gt(t) {
|
|
543
547
|
return (e, n) => {
|
|
544
548
|
if (!e.hasOwnProperty(t) || e[t] === void 0 || e[t] === null)
|
|
545
549
|
return 1;
|
|
546
550
|
if (!n.hasOwnProperty(t) || n[t] === void 0 || n[t] === null)
|
|
547
551
|
return -1;
|
|
548
552
|
if (t !== "createTime") {
|
|
549
|
-
let
|
|
550
|
-
return t.indexOf(".") > -1 ? (
|
|
553
|
+
let s = "", d = "";
|
|
554
|
+
return t.indexOf(".") > -1 ? (s = be(t, e), d = be(t, n)) : (s = e[t], d = n[t]), s > d ? 1 : -1;
|
|
551
555
|
}
|
|
552
|
-
const
|
|
553
|
-
return
|
|
556
|
+
const i = new Date(e[t]), a = new Date(n[t]);
|
|
557
|
+
return i.getTime() > a.getTime() ? -1 : 1;
|
|
554
558
|
};
|
|
555
559
|
}
|
|
556
560
|
function He(t) {
|
|
@@ -559,22 +563,22 @@ function He(t) {
|
|
|
559
563
|
function De(t) {
|
|
560
564
|
return t !== "0 Byte";
|
|
561
565
|
}
|
|
562
|
-
function
|
|
566
|
+
function se(t) {
|
|
563
567
|
if (t === 0)
|
|
564
568
|
return "0 Byte";
|
|
565
|
-
const e = 1024, n = ["Bytes", "KB", "MB", "GB", "TB", "PB"],
|
|
566
|
-
return parseFloat((t / e **
|
|
569
|
+
const e = 1024, n = ["Bytes", "KB", "MB", "GB", "TB", "PB"], i = Math.floor(Math.log(t) / Math.log(e));
|
|
570
|
+
return parseFloat((t / e ** i).toFixed(2)) + " " + n[i];
|
|
567
571
|
}
|
|
568
572
|
function Ae(t, e) {
|
|
569
|
-
return t && (t.hasOwnProperty("allowedContentTypes") && (e.allowedContentTypes = t.allowedContentTypes || ["*"], e.allowedContentTypes = e.allowedContentTypes && e.allowedContentTypes.length > 0 ? e.allowedContentTypes : ["*"]), t.hasOwnProperty("maxUploads") && (e.maxUploads = t.maxUploads || 0), t.hasOwnProperty("maxFileSize") && (e.maxFileSize =
|
|
573
|
+
return t && (t.hasOwnProperty("allowedContentTypes") && (e.allowedContentTypes = t.allowedContentTypes || ["*"], e.allowedContentTypes = e.allowedContentTypes && e.allowedContentTypes.length > 0 ? e.allowedContentTypes : ["*"]), t.hasOwnProperty("maxUploads") && (e.maxUploads = t.maxUploads || 0), t.hasOwnProperty("maxFileSize") && (e.maxFileSize = se(1024 * 1024 * (parseInt(String(t.maxFileSize), 10) || 1)))), e;
|
|
570
574
|
}
|
|
571
575
|
function xe(t) {
|
|
572
576
|
let e = "ffilepreview--filetype";
|
|
573
577
|
if (!t)
|
|
574
578
|
return e + "-any";
|
|
575
579
|
const n = t.lastIndexOf(".");
|
|
576
|
-
let
|
|
577
|
-
switch (n > -1 && (
|
|
580
|
+
let i = "";
|
|
581
|
+
switch (n > -1 && (i = t.substring(n + 1).toLocaleLowerCase()), i) {
|
|
578
582
|
case "pdf":
|
|
579
583
|
e += "-pdf";
|
|
580
584
|
break;
|
|
@@ -620,7 +624,7 @@ function Ce(t) {
|
|
|
620
624
|
if (t.type === "done")
|
|
621
625
|
return 100;
|
|
622
626
|
if (t.file && t.file.progress) {
|
|
623
|
-
if (t.file.progress.status ===
|
|
627
|
+
if (t.file.progress.status === L.Uploading) {
|
|
624
628
|
const n = ((e = t.file.progress.data) == null ? void 0 : e.percentage) || 5;
|
|
625
629
|
return n > 5 ? n : 5;
|
|
626
630
|
}
|
|
@@ -628,25 +632,25 @@ function Ce(t) {
|
|
|
628
632
|
}
|
|
629
633
|
return 5;
|
|
630
634
|
}
|
|
631
|
-
function
|
|
635
|
+
function wt(t) {
|
|
632
636
|
let e = t;
|
|
633
|
-
return t ? (typeof t == "string" && (e = parseInt(t, 10)),
|
|
637
|
+
return t ? (typeof t == "string" && (e = parseInt(t, 10)), se(e)) : "0 Byte";
|
|
634
638
|
}
|
|
635
|
-
const
|
|
639
|
+
const yt = () => Math.random().toString(36).substring(7);
|
|
636
640
|
function Fe(t, e) {
|
|
637
641
|
return {
|
|
638
642
|
fileIndex: e,
|
|
639
|
-
id:
|
|
643
|
+
id: yt(),
|
|
640
644
|
name: t.name,
|
|
641
645
|
size: t.size,
|
|
642
646
|
type: t.type,
|
|
643
647
|
form: new FormData(),
|
|
644
648
|
progress: {
|
|
645
|
-
status:
|
|
649
|
+
status: L.Queue,
|
|
646
650
|
data: {
|
|
647
651
|
percentage: 0,
|
|
648
652
|
speed: 0,
|
|
649
|
-
speedHuman: `${
|
|
653
|
+
speedHuman: `${se(0)}/s`,
|
|
650
654
|
startTime: null,
|
|
651
655
|
endTime: null,
|
|
652
656
|
eta: null,
|
|
@@ -660,31 +664,31 @@ function Fe(t, e) {
|
|
|
660
664
|
function Se(t) {
|
|
661
665
|
const e = [];
|
|
662
666
|
return t.forEach((n) => {
|
|
663
|
-
const
|
|
664
|
-
for (const a in
|
|
665
|
-
const
|
|
666
|
-
n.hasOwnProperty(
|
|
667
|
+
const i = { id: "", name: "", size: 0, type: "", extend: null, extendHeaders: null, createTime: "" };
|
|
668
|
+
for (const a in i) {
|
|
669
|
+
const s = a.replace("extend", "response").replace("createTime", "lastModifiedDate");
|
|
670
|
+
n.hasOwnProperty(s) && (s === "lastModifiedDate" ? i[a] = ge(n[s], "yyyy-MM-dd HH:mm:ss") : i[a] = n[s]);
|
|
667
671
|
}
|
|
668
|
-
e.push(
|
|
672
|
+
e.push(i);
|
|
669
673
|
}), e;
|
|
670
674
|
}
|
|
671
|
-
function
|
|
675
|
+
function bt(t, e) {
|
|
672
676
|
return t ? e <= t * 1024 * 1024 : !0;
|
|
673
677
|
}
|
|
674
|
-
function
|
|
678
|
+
function xt(t) {
|
|
675
679
|
return t.find((e) => e === "*") !== void 0;
|
|
676
680
|
}
|
|
677
|
-
function
|
|
678
|
-
if (!t || t.length === 0 ||
|
|
681
|
+
function Ct(t, e) {
|
|
682
|
+
if (!t || t.length === 0 || xt(t))
|
|
679
683
|
return !0;
|
|
680
684
|
if (e.lastIndexOf(".") < 0)
|
|
681
685
|
return !1;
|
|
682
686
|
const n = e.substr(e.lastIndexOf("."));
|
|
683
687
|
return t.findIndex(
|
|
684
|
-
(
|
|
688
|
+
(i) => i.toLowerCase() === n.toLowerCase()
|
|
685
689
|
) > -1;
|
|
686
690
|
}
|
|
687
|
-
function
|
|
691
|
+
function Ft(t) {
|
|
688
692
|
if (t)
|
|
689
693
|
return t.split(`
|
|
690
694
|
`).map((e) => e.split(/: */, 2)).filter((e) => e[0]).reduce((e, n) => (e[n[0]] = n[1], e), {});
|
|
@@ -692,79 +696,79 @@ function Ct(t) {
|
|
|
692
696
|
function ke(t) {
|
|
693
697
|
return new Date(t * 1e3).toISOString().substr(11, 8);
|
|
694
698
|
}
|
|
695
|
-
class
|
|
696
|
-
upload(e, n,
|
|
697
|
-
const
|
|
699
|
+
class St extends ht {
|
|
700
|
+
upload(e, n, i, a) {
|
|
701
|
+
const s = e[0];
|
|
698
702
|
return new Promise((d, u) => {
|
|
699
|
-
var
|
|
700
|
-
const v = n.url ||
|
|
701
|
-
let E = ((
|
|
702
|
-
|
|
703
|
+
var M, y;
|
|
704
|
+
const v = n.url || i.url || "", x = n.method || "POST", f = n.data || {}, T = n.headers || {}, g = new XMLHttpRequest(), D = (/* @__PURE__ */ new Date()).getTime();
|
|
705
|
+
let E = ((M = s.progress) == null ? void 0 : M.data) && s.progress.data.startTime || D, H = 0, w = null;
|
|
706
|
+
g.upload.addEventListener("progress", (b) => {
|
|
703
707
|
var A;
|
|
704
708
|
if (b.lengthComputable) {
|
|
705
|
-
const k = Math.round(b.loaded * 100 / b.total),
|
|
706
|
-
H = Math.round(b.loaded /
|
|
707
|
-
status:
|
|
709
|
+
const k = Math.round(b.loaded * 100 / b.total), z = (/* @__PURE__ */ new Date()).getTime() - D;
|
|
710
|
+
H = Math.round(b.loaded / z * 1e3), E = ((A = s.progress) == null ? void 0 : A.data) && s.progress.data.startTime || (/* @__PURE__ */ new Date()).getTime(), w = Math.ceil((b.total - b.loaded) / H), s.progress = {
|
|
711
|
+
status: L.Uploading,
|
|
708
712
|
data: {
|
|
709
713
|
percentage: k,
|
|
710
714
|
speed: H,
|
|
711
|
-
speedHuman: `${
|
|
715
|
+
speedHuman: `${se(H)}/s`,
|
|
712
716
|
startTime: E,
|
|
713
717
|
endTime: null,
|
|
714
|
-
eta:
|
|
715
|
-
etaHuman: ke(
|
|
718
|
+
eta: w,
|
|
719
|
+
etaHuman: ke(w)
|
|
716
720
|
}
|
|
717
|
-
}, a({ type: "uploading", files: [
|
|
721
|
+
}, a({ type: "uploading", files: [s] });
|
|
718
722
|
}
|
|
719
|
-
}, !1),
|
|
723
|
+
}, !1), g.upload.addEventListener("error", (b) => {
|
|
720
724
|
u(b);
|
|
721
|
-
}),
|
|
722
|
-
if (
|
|
723
|
-
const b = Math.round(
|
|
724
|
-
|
|
725
|
-
status:
|
|
725
|
+
}), g.onreadystatechange = () => {
|
|
726
|
+
if (g.readyState === XMLHttpRequest.DONE) {
|
|
727
|
+
const b = Math.round(s.size / ((/* @__PURE__ */ new Date()).getTime() - E) * 1e3);
|
|
728
|
+
s.progress = {
|
|
729
|
+
status: L.Done,
|
|
726
730
|
data: {
|
|
727
731
|
percentage: 100,
|
|
728
732
|
speed: b,
|
|
729
|
-
speedHuman: `${
|
|
733
|
+
speedHuman: `${se(b)}/s`,
|
|
730
734
|
startTime: E,
|
|
731
735
|
endTime: (/* @__PURE__ */ new Date()).getTime(),
|
|
732
|
-
eta:
|
|
733
|
-
etaHuman: ke(
|
|
736
|
+
eta: w,
|
|
737
|
+
etaHuman: ke(w || 0)
|
|
734
738
|
}
|
|
735
|
-
},
|
|
739
|
+
}, s.responseStatus = g.status;
|
|
736
740
|
try {
|
|
737
|
-
|
|
741
|
+
s.response = JSON.parse(g.response);
|
|
738
742
|
} catch {
|
|
739
|
-
|
|
743
|
+
s.response = g.response;
|
|
740
744
|
}
|
|
741
|
-
|
|
745
|
+
s.responseHeaders = Ft(g.getAllResponseHeaders()), d({ type: "done", files: [s] });
|
|
742
746
|
}
|
|
743
|
-
},
|
|
747
|
+
}, g.open(x, v, !0), g.withCredentials = !!n.withCredentials;
|
|
744
748
|
try {
|
|
745
|
-
const b =
|
|
746
|
-
Object.keys(T).forEach((k) =>
|
|
749
|
+
const b = s.nativeFile;
|
|
750
|
+
Object.keys(T).forEach((k) => g.setRequestHeader(k, T[k]));
|
|
747
751
|
let A;
|
|
748
752
|
n.includeWebKitFormBoundary !== !1 ? (Object.keys(f).forEach((k) => {
|
|
749
|
-
var
|
|
750
|
-
return (
|
|
751
|
-
}), (y =
|
|
753
|
+
var z;
|
|
754
|
+
return (z = s.form) == null ? void 0 : z.append(k, f[k]);
|
|
755
|
+
}), (y = s.form) == null || y.append(n.fieldName || "file", b, b.name), A = s.form) : A = b, g.send(A);
|
|
752
756
|
} catch (b) {
|
|
753
757
|
u(b);
|
|
754
758
|
}
|
|
755
759
|
return () => {
|
|
756
|
-
|
|
760
|
+
g.abort();
|
|
757
761
|
};
|
|
758
762
|
});
|
|
759
763
|
}
|
|
760
764
|
// 删除附件
|
|
761
|
-
remove(e, n,
|
|
762
|
-
return new Promise((
|
|
763
|
-
|
|
765
|
+
remove(e, n, i, a) {
|
|
766
|
+
return new Promise((s, d) => {
|
|
767
|
+
s({ type: "removed", files: e });
|
|
764
768
|
});
|
|
765
769
|
}
|
|
766
770
|
}
|
|
767
|
-
const
|
|
771
|
+
const kt = {
|
|
768
772
|
showCloseButton: { type: Boolean, default: !0 },
|
|
769
773
|
position: { type: String, default: "top-center" },
|
|
770
774
|
timeout: { type: Number, default: 3e3 },
|
|
@@ -777,50 +781,50 @@ const St = {
|
|
|
777
781
|
animate: { type: String, default: "fadeIn" },
|
|
778
782
|
options: { type: Object },
|
|
779
783
|
safeHtml: { type: Boolean, default: !0 }
|
|
780
|
-
},
|
|
784
|
+
}, Tt = {
|
|
781
785
|
showCloseButton: { type: Boolean, default: !0 },
|
|
782
786
|
animate: { type: String, default: "fadeIn" },
|
|
783
787
|
options: { type: Object }
|
|
784
788
|
}, pe = /* @__PURE__ */ K({
|
|
785
789
|
name: "Toast",
|
|
786
|
-
props:
|
|
790
|
+
props: Tt,
|
|
787
791
|
emits: ["close", "click"],
|
|
788
792
|
setup: (t, e) => {
|
|
789
|
-
const n = B(t.animate),
|
|
793
|
+
const n = B(t.animate), i = "fadeOut", a = O(() => t.options), s = B(!1), d = O(() => a.value.title && a.value.message), u = O(() => !a.value.title && a.value.message), v = O(() => {
|
|
790
794
|
const y = {
|
|
791
|
-
animated:
|
|
795
|
+
animated: s.value,
|
|
792
796
|
toast: !0,
|
|
793
797
|
"toast--only-content": !d.value
|
|
794
798
|
};
|
|
795
|
-
return y[t.animate] = !1, y[
|
|
796
|
-
}),
|
|
799
|
+
return y[t.animate] = !1, y[i] = s.value, y["toasty-type-" + a.value.type] = !0, a.value.theme && (y[a.value.theme] = !0), y;
|
|
800
|
+
}), x = O(() => {
|
|
797
801
|
const A = `f-icon-${a.value && a.value.type ? a.value.type.replace("toasty-type-", "") : "default"}`, k = {
|
|
798
802
|
"f-icon": !0
|
|
799
803
|
};
|
|
800
804
|
return k[A] = !0, k;
|
|
801
|
-
}), f =
|
|
805
|
+
}), f = O(() => a.value.title || a.value.message), T = O(() => t.showCloseButton), g = O(() => !!a.value.buttons || !!e.slots.default), D = O(() => ce.getLocale() === "en" ? {
|
|
802
806
|
wordBreak: "keep-all",
|
|
803
807
|
overflowWrap: "break-word"
|
|
804
808
|
} : {});
|
|
805
809
|
function E(y) {
|
|
806
|
-
y.stopPropagation(), y.preventDefault(),
|
|
810
|
+
y.stopPropagation(), y.preventDefault(), s.value = !1, setTimeout(() => {
|
|
807
811
|
e.emit("close", a.value);
|
|
808
812
|
}, 200);
|
|
809
813
|
}
|
|
810
814
|
function H(y, b) {
|
|
811
815
|
}
|
|
812
|
-
function
|
|
816
|
+
function w(y) {
|
|
813
817
|
return `f-preten-link ${y.customClass ? y.customClass : ""}`;
|
|
814
818
|
}
|
|
815
|
-
|
|
819
|
+
q(n, () => {
|
|
816
820
|
n.value;
|
|
817
821
|
});
|
|
818
|
-
const
|
|
822
|
+
const M = () => {
|
|
819
823
|
var y;
|
|
820
|
-
return l(
|
|
824
|
+
return l(G, null, [l("div", {
|
|
821
825
|
class: "after-toast-msg text-right"
|
|
822
826
|
}, [!e.slots.default && ((y = a.value.buttons) == null ? void 0 : y.map((b) => l("span", {
|
|
823
|
-
class:
|
|
827
|
+
class: w(b),
|
|
824
828
|
onClick: (A) => void 0
|
|
825
829
|
}, [b.text]))), e.slots.default && e.slots.default()])]);
|
|
826
830
|
};
|
|
@@ -838,17 +842,17 @@ const St = {
|
|
|
838
842
|
}, [!d.value && l("div", {
|
|
839
843
|
class: "float-left modal-tips-iconwrap"
|
|
840
844
|
}, [l("span", {
|
|
841
|
-
class:
|
|
845
|
+
class: x.value
|
|
842
846
|
}, null)]), l("div", {
|
|
843
847
|
class: "modal-tips-content"
|
|
844
|
-
}, [d.value && l(
|
|
848
|
+
}, [d.value && l(G, null, [l("h5", {
|
|
845
849
|
class: "toast-title modal-tips-title",
|
|
846
850
|
innerHTML: a.value.title
|
|
847
851
|
}, null), l("p", {
|
|
848
852
|
class: "toast-msg",
|
|
849
853
|
innerHTML: a.value.message,
|
|
850
854
|
style: D.value
|
|
851
|
-
}, null),
|
|
855
|
+
}, null), g.value && M()]), u.value && (a.value.buttons ? l("div", {
|
|
852
856
|
class: "toast-title-btns-wrapper d-flex"
|
|
853
857
|
}, [l("h5", {
|
|
854
858
|
class: "toast-title modal-tips-title only-toast-msg",
|
|
@@ -856,7 +860,7 @@ const St = {
|
|
|
856
860
|
innerHTML: a.value.message
|
|
857
861
|
}, null), l("div", {
|
|
858
862
|
class: "after-toast-title text-right ml-auto"
|
|
859
|
-
}, [
|
|
863
|
+
}, [M()])]) : l("h5", {
|
|
860
864
|
class: "toast-title modal-tips-title only-toast-msg",
|
|
861
865
|
style: D.value,
|
|
862
866
|
innerHTML: a.value.message
|
|
@@ -864,27 +868,27 @@ const St = {
|
|
|
864
868
|
}
|
|
865
869
|
}), re = /* @__PURE__ */ K({
|
|
866
870
|
name: "Notify",
|
|
867
|
-
props:
|
|
871
|
+
props: kt,
|
|
868
872
|
emits: ["close", "empty"],
|
|
869
873
|
setup(t, e) {
|
|
870
|
-
const n =
|
|
874
|
+
const n = O(() => ({
|
|
871
875
|
"farris-notify": !0
|
|
872
|
-
})),
|
|
876
|
+
})), i = {
|
|
873
877
|
left: 12,
|
|
874
878
|
right: 12,
|
|
875
879
|
top: 20,
|
|
876
880
|
bottom: 12
|
|
877
|
-
}, a = B(),
|
|
878
|
-
const
|
|
881
|
+
}, a = B(), s = B(t.options), d = B(t.showCloseButton), u = O(() => t.position || "bottom-right"), v = O(() => t.timeout != null ? t.timeout : 3e3), x = O(() => {
|
|
882
|
+
const g = t.bottom ? t.bottom : i.bottom, D = t.top ? t.top : i.top, E = {
|
|
879
883
|
transition: "all 0.2s ease",
|
|
880
|
-
left: u.value.indexOf("left") > -1 ? `${t.left ? t.left :
|
|
881
|
-
right: u.value.indexOf("right") > -1 ? `${t.right ? t.right :
|
|
884
|
+
left: u.value.indexOf("left") > -1 ? `${t.left ? t.left : i.left}px` : "",
|
|
885
|
+
right: u.value.indexOf("right") > -1 ? `${t.right ? t.right : i.right}px` : "",
|
|
882
886
|
top: u.value.indexOf("top") > -1 ? `${D}px` : "",
|
|
883
|
-
bottom: u.value.indexOf("bottom") > -1 ? `${
|
|
887
|
+
bottom: u.value.indexOf("bottom") > -1 ? `${g}px` : ""
|
|
884
888
|
};
|
|
885
889
|
return u.value.indexOf("center") > -1 && (E.left = "50%", E.marginLeft = "calc(-24rem / 2)", u.value === "center-center" && (E.top = "50%", E.transform = "translate(-50%, -50%)")), E;
|
|
886
890
|
});
|
|
887
|
-
function f(
|
|
891
|
+
function f(g) {
|
|
888
892
|
e.emit("close");
|
|
889
893
|
}
|
|
890
894
|
v.value && setTimeout(() => {
|
|
@@ -894,25 +898,25 @@ const St = {
|
|
|
894
898
|
container: a,
|
|
895
899
|
notifyPosition: u
|
|
896
900
|
});
|
|
897
|
-
function T(
|
|
901
|
+
function T(g, D) {
|
|
898
902
|
f();
|
|
899
903
|
}
|
|
900
904
|
return () => l("div", {
|
|
901
905
|
class: n.value,
|
|
902
|
-
style:
|
|
906
|
+
style: x.value,
|
|
903
907
|
ref: a
|
|
904
908
|
}, [l(pe, {
|
|
905
|
-
options:
|
|
909
|
+
options: s.value,
|
|
906
910
|
showCloseButton: d.value,
|
|
907
911
|
animate: t.animate,
|
|
908
|
-
onClose: (
|
|
912
|
+
onClose: (g) => T(g, s.value)
|
|
909
913
|
}, null)]);
|
|
910
914
|
}
|
|
911
915
|
});
|
|
912
916
|
class Me {
|
|
913
917
|
constructor() {
|
|
914
|
-
|
|
915
|
-
|
|
918
|
+
j(this, "notifyRefs", []);
|
|
919
|
+
j(this, "globalConfig", je({}));
|
|
916
920
|
}
|
|
917
921
|
escapeAllHtml(e) {
|
|
918
922
|
if (typeof e != "string" || !e)
|
|
@@ -928,11 +932,11 @@ class Me {
|
|
|
928
932
|
safeHtml: !0
|
|
929
933
|
}, this.globalConfig, {
|
|
930
934
|
...e
|
|
931
|
-
}),
|
|
932
|
-
|
|
933
|
-
const d =
|
|
935
|
+
}), s = document.createElement("div");
|
|
936
|
+
s.style.display = "contents";
|
|
937
|
+
const d = Le({
|
|
934
938
|
setup() {
|
|
935
|
-
var
|
|
939
|
+
var x;
|
|
936
940
|
const u = B();
|
|
937
941
|
function v() {
|
|
938
942
|
u.value.container.style.transform = "scale(0)", setTimeout(() => {
|
|
@@ -942,20 +946,20 @@ class Me {
|
|
|
942
946
|
if (a.position.indexOf("top") > -1) {
|
|
943
947
|
const f = n.getNotifyInstances(a.position), T = f[f.length - 1];
|
|
944
948
|
if (T) {
|
|
945
|
-
const
|
|
946
|
-
a.top =
|
|
949
|
+
const g = T.value.container.getBoundingClientRect();
|
|
950
|
+
a.top = g.bottom;
|
|
947
951
|
}
|
|
948
952
|
}
|
|
949
|
-
return a.safeHtml && ((
|
|
950
|
-
document.body.removeChild(
|
|
953
|
+
return a.safeHtml && ((x = a.options) != null && x.message) && (a.options.message = n.escapeAllHtml(a.options.message)), me(() => {
|
|
954
|
+
document.body.removeChild(s);
|
|
951
955
|
}), ve(() => {
|
|
952
956
|
n.updateNotifyPositionForCreate(a, u);
|
|
953
|
-
}), () => l(
|
|
957
|
+
}), () => l(qe, {
|
|
954
958
|
mode: "out-in",
|
|
955
959
|
name: "fade",
|
|
956
960
|
appear: !0
|
|
957
961
|
}, {
|
|
958
|
-
default: () => [l(re,
|
|
962
|
+
default: () => [l(re, $e({
|
|
959
963
|
ref: u
|
|
960
964
|
}, a, {
|
|
961
965
|
onClose: v
|
|
@@ -963,45 +967,45 @@ class Me {
|
|
|
963
967
|
});
|
|
964
968
|
}
|
|
965
969
|
});
|
|
966
|
-
return d.provide("NotifyService", this), document.body.appendChild(
|
|
970
|
+
return d.provide("NotifyService", this), document.body.appendChild(s), d.use(ce.i18n), d.mount(s), d;
|
|
967
971
|
}
|
|
968
972
|
getNotifyInstances(e) {
|
|
969
973
|
return this.notifyRefs.filter((n) => n.value.notifyPosition === e);
|
|
970
974
|
}
|
|
971
975
|
updateNotifyPositionForCreate(e, n) {
|
|
972
976
|
if (this.notifyRefs && this.notifyRefs.length) {
|
|
973
|
-
const
|
|
977
|
+
const i = window.innerHeight;
|
|
974
978
|
e.position.indexOf("bottom") > -1 && this.getNotifyInstances(e.position).forEach((a) => {
|
|
975
|
-
const
|
|
976
|
-
a.value.container.style.bottom =
|
|
979
|
+
const s = a.value.container.getBoundingClientRect();
|
|
980
|
+
a.value.container.style.bottom = s.height + i - s.bottom + "px";
|
|
977
981
|
});
|
|
978
982
|
}
|
|
979
983
|
this.notifyRefs = [...this.notifyRefs, n];
|
|
980
984
|
}
|
|
981
985
|
updateNotifyPositionForClose(e, n) {
|
|
982
|
-
const
|
|
986
|
+
const i = this.notifyRefs.indexOf(n);
|
|
983
987
|
if (e.position.indexOf("top") > -1) {
|
|
984
|
-
const a = this.getNotifyInstances(e.position),
|
|
985
|
-
a.slice(
|
|
988
|
+
const a = this.getNotifyInstances(e.position), s = a.indexOf(n);
|
|
989
|
+
a.slice(s + 1).forEach((d) => {
|
|
986
990
|
d.value.container.style.top = d.value.container.offsetTop - d.value.container.offsetHeight + "px";
|
|
987
991
|
});
|
|
988
992
|
}
|
|
989
|
-
|
|
993
|
+
i > -1 && this.notifyRefs.splice(i, 1);
|
|
990
994
|
}
|
|
991
995
|
show(e) {
|
|
992
996
|
return this.createNotifyInstance(e);
|
|
993
997
|
}
|
|
994
998
|
buildNotifyProps(e, n) {
|
|
995
|
-
let
|
|
996
|
-
typeof n == "string" ?
|
|
997
|
-
const
|
|
999
|
+
let i = "", a = "", s, d, u;
|
|
1000
|
+
typeof n == "string" ? i = n : n && (i = n.message || "", a = n.title || "", d = n.position || null, u = n.showCloseButton != null ? n.showCloseButton : null, s = n.timeout != null ? n.timeout : null);
|
|
1001
|
+
const x = {
|
|
998
1002
|
options: {
|
|
999
1003
|
type: e,
|
|
1000
|
-
message:
|
|
1004
|
+
message: i,
|
|
1001
1005
|
title: a
|
|
1002
1006
|
}
|
|
1003
1007
|
};
|
|
1004
|
-
return d != null && (
|
|
1008
|
+
return d != null && (x.position = d), u != null && (x.showCloseButton = u), s != null && (x.timeout = s), x;
|
|
1005
1009
|
}
|
|
1006
1010
|
info(e) {
|
|
1007
1011
|
const n = this.buildNotifyProps("info", e);
|
|
@@ -1028,162 +1032,162 @@ class Me {
|
|
|
1028
1032
|
}), this.notifyRefs.length = 0;
|
|
1029
1033
|
}
|
|
1030
1034
|
}
|
|
1031
|
-
const
|
|
1035
|
+
const Et = Symbol("NOTIFY_SERVICE_TOKEN");
|
|
1032
1036
|
re.install = (t) => {
|
|
1033
1037
|
t.component(re.name, re), t.component(pe.name, pe);
|
|
1034
1038
|
const e = new Me();
|
|
1035
|
-
t.provide(
|
|
1039
|
+
t.provide(Et, e), t.provide("FNotifyService", e);
|
|
1036
1040
|
};
|
|
1037
|
-
const
|
|
1041
|
+
const Bt = (t = "") => {
|
|
1038
1042
|
let e;
|
|
1039
|
-
return t &&
|
|
1040
|
-
},
|
|
1043
|
+
return t && J(t, null) && (e = J(t)), e || (e = new Me()), e;
|
|
1044
|
+
}, Ht = (t = "") => {
|
|
1041
1045
|
let e;
|
|
1042
|
-
if (t &&
|
|
1043
|
-
const n =
|
|
1046
|
+
if (t && J(t, null)) {
|
|
1047
|
+
const n = J(t);
|
|
1044
1048
|
n && n() && (e = n());
|
|
1045
1049
|
}
|
|
1046
|
-
return e || (e = new
|
|
1050
|
+
return e || (e = new St()), e;
|
|
1047
1051
|
}, Pe = {
|
|
1048
|
-
getNotify:
|
|
1049
|
-
getServerAPI:
|
|
1052
|
+
getNotify: Bt,
|
|
1053
|
+
getServerAPI: Ht
|
|
1050
1054
|
};
|
|
1051
|
-
function
|
|
1052
|
-
const
|
|
1053
|
-
disabled:
|
|
1055
|
+
function Oe(t, e, n) {
|
|
1056
|
+
const i = Pe.getNotify(t.notifyServiceToken), a = B(t.fileInfos), {
|
|
1057
|
+
disabled: s,
|
|
1054
1058
|
uploadVisible: d,
|
|
1055
1059
|
uploadDisabled: u,
|
|
1056
1060
|
previewVisible: v,
|
|
1057
|
-
orderField:
|
|
1061
|
+
orderField: x,
|
|
1058
1062
|
previewEnableMulti: f,
|
|
1059
1063
|
downloadButtonDisable: T,
|
|
1060
|
-
previewColumns:
|
|
1064
|
+
previewColumns: g,
|
|
1061
1065
|
uploadEnableMulti: D,
|
|
1062
1066
|
previewButtonDisable: E
|
|
1063
|
-
} = fe(t), H = B(!1),
|
|
1067
|
+
} = fe(t), H = B(!1), w = B([]), M = O(() => w.value.length), y = B([]), b = B("");
|
|
1064
1068
|
function A(o) {
|
|
1065
|
-
(!o.length ||
|
|
1066
|
-
const
|
|
1067
|
-
return
|
|
1069
|
+
(!o.length || w.value.length !== o.length) && (H.value = !1);
|
|
1070
|
+
const h = [...o.map((C) => (C.hasOwnProperty("size") || (C.size = void 0), C.hasOwnProperty("createTime") || (C.createTime = void 0), f.value && (C.checked = !!w.value.find((R) => R.id === C.id) || H.value), C))];
|
|
1071
|
+
return h.sort(gt(x.value)), f.value && (w.value = [...h].filter((C) => C.checked)), h;
|
|
1068
1072
|
}
|
|
1069
1073
|
const k = B(A(a.value));
|
|
1070
|
-
|
|
1074
|
+
q(() => t.fileInfos, (o) => {
|
|
1071
1075
|
k.value = A(o);
|
|
1072
1076
|
});
|
|
1073
|
-
const
|
|
1077
|
+
const z = (o, c) => {
|
|
1074
1078
|
o.stopImmediatePropagation(), e.emit("fileDownloadEvent", { fileInfos: [c], name: "" });
|
|
1075
|
-
},
|
|
1079
|
+
}, Z = (o, c) => {
|
|
1076
1080
|
o.stopImmediatePropagation(), !E.value && e.emit("filePreviewEvent", c);
|
|
1077
|
-
},
|
|
1078
|
-
c.checked && (
|
|
1079
|
-
},
|
|
1080
|
-
if (o.stopImmediatePropagation(),
|
|
1081
|
+
}, ee = (o, c, h) => {
|
|
1082
|
+
c.checked && (w.value = w.value.filter((C) => C.id !== c.id)), e.emit("fileRemoveEvent", c), h.handleUploadEvent({ type: "remove", file: c });
|
|
1083
|
+
}, te = (o, c = "preview") => o.formatter ? !0 : c === "preview" ? ["state", "name", "action", "size", "createTime"].findIndex((C) => C === o.field) > -1 : c === "upload" ? ["state", "name", "size"].findIndex((C) => C === o.field) > -1 : !1, W = (o) => !(o.field === "state" && (u.value || !d.value)), Y = (o) => o.lastIndexOf(".") > 0 ? o.substring(0, o.lastIndexOf(".")) : "", le = (o) => {
|
|
1084
|
+
if (o.stopImmediatePropagation(), M.value > 1) {
|
|
1081
1085
|
let c = "";
|
|
1082
|
-
c =
|
|
1083
|
-
fileInfos:
|
|
1086
|
+
c = Y(w.value[0].name), e.emit("fileDownloadEvent", {
|
|
1087
|
+
fileInfos: w.value,
|
|
1084
1088
|
name: c
|
|
1085
1089
|
});
|
|
1086
1090
|
}
|
|
1087
|
-
},
|
|
1088
|
-
o.stopImmediatePropagation(), e.emit("fileRemoveEvent",
|
|
1089
|
-
},
|
|
1091
|
+
}, $ = (o) => {
|
|
1092
|
+
o.stopImmediatePropagation(), e.emit("fileRemoveEvent", w.value);
|
|
1093
|
+
}, ne = (o) => {
|
|
1090
1094
|
const c = k.value;
|
|
1091
|
-
o.checked ? (c.forEach((
|
|
1092
|
-
|
|
1093
|
-
}),
|
|
1094
|
-
|
|
1095
|
-
}), H.value = !1), e.emit("previewMultiSelectedEvent",
|
|
1096
|
-
},
|
|
1095
|
+
o.checked ? (c.forEach((h) => {
|
|
1096
|
+
h.checked = !0;
|
|
1097
|
+
}), w.value = [...k.value], H.value = !0) : (w.value = [], c.forEach((h) => {
|
|
1098
|
+
h.checked = !1;
|
|
1099
|
+
}), H.value = !1), e.emit("previewMultiSelectedEvent", w.value);
|
|
1100
|
+
}, V = (o, c) => {
|
|
1097
1101
|
o && (o.stopImmediatePropagation(), o.stopPropagation()), (!b.value || c.id !== b.value) && (b.value = c.id, e.emit("selectedEvent", c));
|
|
1098
|
-
},
|
|
1099
|
-
const c =
|
|
1100
|
-
|
|
1101
|
-
},
|
|
1102
|
+
}, m = (o) => {
|
|
1103
|
+
const c = w.value.findIndex((R) => R.id === o.id), h = c > -1, C = k.value.find((R) => R.id === o.id);
|
|
1104
|
+
C && (C.checked = o.checked), o.checked && !h && C && w.value.push(C), !o.checked && h && w.value.splice(c, 1), k.value.length > 0 && (w.value.length === k.value.length ? H.value = !0 : H.value = !1), V(null, C), e.emit("previewMultiSelectedEvent", w.value);
|
|
1105
|
+
}, N = (o) => {
|
|
1102
1106
|
var c;
|
|
1103
1107
|
(c = n == null ? void 0 : n.value) == null || c.handleUploadEvent(o);
|
|
1104
|
-
},
|
|
1105
|
-
|
|
1106
|
-
},
|
|
1107
|
-
let
|
|
1108
|
-
o.files && o.files.length > 0 ?
|
|
1109
|
-
const
|
|
1108
|
+
}, ie = (o) => {
|
|
1109
|
+
N({ type: "upload", file: o });
|
|
1110
|
+
}, U = (o, c) => {
|
|
1111
|
+
let h = [];
|
|
1112
|
+
o.files && o.files.length > 0 ? h = o.files : typeof o.file < "u" && (h = [o.file]), c = c || o.type, h.map((C) => {
|
|
1113
|
+
const R = y.value.findIndex((_) => {
|
|
1110
1114
|
var oe;
|
|
1111
|
-
return typeof
|
|
1115
|
+
return typeof C < "u" && ((oe = _ == null ? void 0 : _.file) == null ? void 0 : oe.id) === C.id;
|
|
1112
1116
|
});
|
|
1113
|
-
|
|
1117
|
+
R > -1 && (y.value[R] = { type: c, file: C });
|
|
1114
1118
|
});
|
|
1115
|
-
},
|
|
1119
|
+
}, X = (o) => {
|
|
1116
1120
|
if (o.files) {
|
|
1117
|
-
const c = o.files.map((
|
|
1118
|
-
y.value = y.value.filter((
|
|
1119
|
-
var
|
|
1120
|
-
return
|
|
1121
|
-
}) > -1)),
|
|
1121
|
+
const c = o.files.map((h) => h.id);
|
|
1122
|
+
y.value = y.value.filter((h) => !(c.findIndex((R) => {
|
|
1123
|
+
var _;
|
|
1124
|
+
return R === ((_ = h == null ? void 0 : h.file) == null ? void 0 : _.id);
|
|
1125
|
+
}) > -1)), N({
|
|
1122
1126
|
type: "hide",
|
|
1123
1127
|
id: c.join(",")
|
|
1124
1128
|
});
|
|
1125
1129
|
}
|
|
1126
|
-
},
|
|
1130
|
+
}, ae = (o) => {
|
|
1127
1131
|
let c = "warning";
|
|
1128
1132
|
(o.type === "cancelled" || o.type === "removed") && (c = "success");
|
|
1129
|
-
const
|
|
1130
|
-
|
|
1131
|
-
options: { type: c, message:
|
|
1133
|
+
const h = o.hasOwnProperty("message") ? o.message : "";
|
|
1134
|
+
i.show({
|
|
1135
|
+
options: { type: c, message: h },
|
|
1132
1136
|
position: "top-center"
|
|
1133
1137
|
});
|
|
1134
|
-
},
|
|
1138
|
+
}, de = (o) => {
|
|
1135
1139
|
if (o.type === "addedToQueue" && typeof o.file < "u")
|
|
1136
|
-
y.value.push({ type: o.type, file: o.file }),
|
|
1140
|
+
y.value.push({ type: o.type, file: o.file }), ie(o.file);
|
|
1137
1141
|
else if (o.type === "start")
|
|
1138
|
-
|
|
1142
|
+
U(o, "start");
|
|
1139
1143
|
else if (o.type === "done") {
|
|
1140
|
-
|
|
1141
|
-
const c = (o.files || []).map((
|
|
1144
|
+
U(o, "done");
|
|
1145
|
+
const c = (o.files || []).map((h) => ({
|
|
1142
1146
|
checked: !1,
|
|
1143
|
-
id:
|
|
1144
|
-
name:
|
|
1145
|
-
size:
|
|
1147
|
+
id: h.id,
|
|
1148
|
+
name: h.name,
|
|
1149
|
+
size: h.size,
|
|
1146
1150
|
createTime: ge(/* @__PURE__ */ new Date(), "yyyy-MM-dd HH:mm:ss")
|
|
1147
1151
|
}));
|
|
1148
|
-
a.value = [...c, ...k.value],
|
|
1152
|
+
a.value = [...c, ...k.value], X(o), e.emit("fUploadDoneEvent", Se(o.files || [])), e.emit("uploadDoneEvent", Se(o.files || []));
|
|
1149
1153
|
} else if (o.type === "cancelled" || o.type === "removed" || o.type === "error") {
|
|
1150
|
-
const c = a.value.filter((
|
|
1151
|
-
a.value = [...c],
|
|
1152
|
-
} else o.type === "rejected" && typeof o.file < "u" &&
|
|
1154
|
+
const c = a.value.filter((h) => o.files && o.files.findIndex((C) => h.id === C.id) < 0);
|
|
1155
|
+
a.value = [...c], ae(o);
|
|
1156
|
+
} else o.type === "rejected" && typeof o.file < "u" && ae(o);
|
|
1153
1157
|
};
|
|
1154
1158
|
return me(() => {
|
|
1155
1159
|
}), {
|
|
1156
|
-
disabled:
|
|
1160
|
+
disabled: s,
|
|
1157
1161
|
uploadVisible: d,
|
|
1158
1162
|
uploadDisabled: u,
|
|
1159
1163
|
downloadButtonDisable: T,
|
|
1160
1164
|
previewVisible: v,
|
|
1161
|
-
previewColumns:
|
|
1165
|
+
previewColumns: g,
|
|
1162
1166
|
uploadFiles: y,
|
|
1163
1167
|
innerFileInfos: k,
|
|
1164
1168
|
previewEnableMulti: f,
|
|
1165
|
-
previewMultiSelectedLength:
|
|
1169
|
+
previewMultiSelectedLength: M,
|
|
1166
1170
|
previewSelectAllBtnChecked: H,
|
|
1167
1171
|
uploadEnableMulti: D,
|
|
1168
1172
|
previewCurrentId: b,
|
|
1169
|
-
multiFileRemoveHandler:
|
|
1170
|
-
previewMultiSelectChangeHandler:
|
|
1171
|
-
fileMultiDownloadHandler:
|
|
1172
|
-
selectOrCancelAllHandler:
|
|
1173
|
-
hasColumnHtmlFunc:
|
|
1174
|
-
showPreviewStateColumn:
|
|
1175
|
-
rowSelectedHandler:
|
|
1176
|
-
fileDownloadHandler:
|
|
1177
|
-
filePreviewHandler:
|
|
1178
|
-
fileRemoveHandler:
|
|
1179
|
-
handleStateChange:
|
|
1173
|
+
multiFileRemoveHandler: $,
|
|
1174
|
+
previewMultiSelectChangeHandler: m,
|
|
1175
|
+
fileMultiDownloadHandler: le,
|
|
1176
|
+
selectOrCancelAllHandler: ne,
|
|
1177
|
+
hasColumnHtmlFunc: te,
|
|
1178
|
+
showPreviewStateColumn: W,
|
|
1179
|
+
rowSelectedHandler: V,
|
|
1180
|
+
fileDownloadHandler: z,
|
|
1181
|
+
filePreviewHandler: Z,
|
|
1182
|
+
fileRemoveHandler: ee,
|
|
1183
|
+
handleStateChange: de
|
|
1180
1184
|
};
|
|
1181
1185
|
}
|
|
1182
|
-
class
|
|
1186
|
+
class Dt {
|
|
1183
1187
|
constructor(e, n) {
|
|
1184
1188
|
// 记录在上传的附件数组
|
|
1185
|
-
|
|
1186
|
-
|
|
1189
|
+
j(this, "queue");
|
|
1190
|
+
j(this, "uploadOpts", {
|
|
1187
1191
|
// 默认不限制,0代表不限制 Number.POSITIVE_INFINITY
|
|
1188
1192
|
allowedContentTypes: ["*"],
|
|
1189
1193
|
maxUploads: 0,
|
|
@@ -1195,9 +1199,9 @@ class Ht {
|
|
|
1195
1199
|
/**
|
|
1196
1200
|
* 服务器端扩展
|
|
1197
1201
|
*/
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1202
|
+
j(this, "extendServerConfig", null);
|
|
1203
|
+
j(this, "uploadServerSer");
|
|
1204
|
+
j(this, "uploadContext", null);
|
|
1201
1205
|
this.stateChangeRecord = e, this.serverToken = n, this.queue = [], this.uploadServerSer = Pe.getServerAPI(this.serverToken);
|
|
1202
1206
|
}
|
|
1203
1207
|
setUploadContext(e) {
|
|
@@ -1207,21 +1211,21 @@ class Ht {
|
|
|
1207
1211
|
* 处理从服务器端返回的结果
|
|
1208
1212
|
*/
|
|
1209
1213
|
handleResultFromServer(e) {
|
|
1210
|
-
var n,
|
|
1214
|
+
var n, i;
|
|
1211
1215
|
switch (e.type) {
|
|
1212
1216
|
case "removed":
|
|
1213
1217
|
this.queue = this.queue.filter(
|
|
1214
1218
|
(a) => {
|
|
1215
|
-
var
|
|
1216
|
-
return ((
|
|
1219
|
+
var s;
|
|
1220
|
+
return ((s = a.progress) == null ? void 0 : s.status) !== L.Remove;
|
|
1217
1221
|
}
|
|
1218
1222
|
), e.hasOwnProperty("message") || (e.message = "被删除"), this.stateChangeRecord.value = e;
|
|
1219
1223
|
break;
|
|
1220
1224
|
case "error":
|
|
1221
|
-
this.queue = this.queue.filter((a) => e.files && e.files.findIndex((
|
|
1225
|
+
this.queue = this.queue.filter((a) => e.files && e.files.findIndex((s) => a.id === s.id) < 0), (n = this.uploadContext) == null || n.emit("stateChange", e);
|
|
1222
1226
|
break;
|
|
1223
1227
|
default:
|
|
1224
|
-
(
|
|
1228
|
+
(i = this.uploadContext) == null || i.emit("stateChange", e);
|
|
1225
1229
|
}
|
|
1226
1230
|
}
|
|
1227
1231
|
setOptions(e) {
|
|
@@ -1232,23 +1236,23 @@ class Ht {
|
|
|
1232
1236
|
* @param incomingFiles
|
|
1233
1237
|
*/
|
|
1234
1238
|
handleFiles(e) {
|
|
1235
|
-
var
|
|
1239
|
+
var i;
|
|
1236
1240
|
const n = Array.from(e).reduce(
|
|
1237
|
-
(a,
|
|
1238
|
-
var
|
|
1241
|
+
(a, s, d) => {
|
|
1242
|
+
var x;
|
|
1239
1243
|
const u = a.length + this.queue.length + 1, v = this.rejectedReason(
|
|
1240
|
-
|
|
1244
|
+
s.name,
|
|
1241
1245
|
u,
|
|
1242
|
-
|
|
1246
|
+
s.size
|
|
1243
1247
|
);
|
|
1244
1248
|
if (v.allowed)
|
|
1245
|
-
a = a.concat(
|
|
1249
|
+
a = a.concat(s);
|
|
1246
1250
|
else {
|
|
1247
1251
|
const f = Fe(
|
|
1248
|
-
|
|
1252
|
+
s,
|
|
1249
1253
|
d
|
|
1250
1254
|
);
|
|
1251
|
-
(
|
|
1255
|
+
(x = this.uploadContext) == null || x.emit("stateChange", {
|
|
1252
1256
|
type: "rejected",
|
|
1253
1257
|
file: f,
|
|
1254
1258
|
message: v.message
|
|
@@ -1258,11 +1262,11 @@ class Ht {
|
|
|
1258
1262
|
},
|
|
1259
1263
|
[]
|
|
1260
1264
|
);
|
|
1261
|
-
[].map.call(n, (a,
|
|
1265
|
+
[].map.call(n, (a, s) => {
|
|
1262
1266
|
var u;
|
|
1263
|
-
const d = Fe(a,
|
|
1267
|
+
const d = Fe(a, s);
|
|
1264
1268
|
this.queue.push(d), (u = this.uploadContext) == null || u.emit("stateChange", { type: "addedToQueue", file: d });
|
|
1265
|
-
}), (
|
|
1269
|
+
}), (i = this.uploadContext) == null || i.emit("stateChange", { type: "allAddedToQueue" });
|
|
1266
1270
|
}
|
|
1267
1271
|
/**
|
|
1268
1272
|
* 获取上传被拒绝的理由
|
|
@@ -1271,11 +1275,11 @@ class Ht {
|
|
|
1271
1275
|
* @param size
|
|
1272
1276
|
* @returns
|
|
1273
1277
|
*/
|
|
1274
|
-
rejectedReason(e, n,
|
|
1275
|
-
let a = !1,
|
|
1276
|
-
return this.queue.findIndex((u) => u.name === e) > -1 ?
|
|
1278
|
+
rejectedReason(e, n, i) {
|
|
1279
|
+
let a = !1, s = "";
|
|
1280
|
+
return this.queue.findIndex((u) => u.name === e) > -1 ? s = "上传失败:已存在同名文件" : this.uploadOpts.allowedContentTypes && !Ct(this.uploadOpts.allowedContentTypes, e) ? s = `上传失败:只允许上传${this.uploadOpts.allowedContentTypes.join(",")}类型的文档` : this.exceedMaxUpload(n) ? s = `上传失败:文件总个数超出${this.uploadOpts.maxUploads}限制` : bt(this.uploadOpts.maxFileSize, i) ? i === 0 ? s = "上传失败:不允许文件为空" : a = !0 : s = `上传失败:单个文件大小超出${this.uploadOpts.maxFileSize}MB的限制`, {
|
|
1277
1281
|
allowed: a,
|
|
1278
|
-
message:
|
|
1282
|
+
message: s
|
|
1279
1283
|
};
|
|
1280
1284
|
}
|
|
1281
1285
|
/**
|
|
@@ -1294,7 +1298,7 @@ class Ht {
|
|
|
1294
1298
|
* @param input
|
|
1295
1299
|
*/
|
|
1296
1300
|
handleUploadEvent(e) {
|
|
1297
|
-
var n,
|
|
1301
|
+
var n, i;
|
|
1298
1302
|
switch (e.type) {
|
|
1299
1303
|
case "upload":
|
|
1300
1304
|
const a = this.queue.findIndex(
|
|
@@ -1308,15 +1312,15 @@ class Ht {
|
|
|
1308
1312
|
case "remove":
|
|
1309
1313
|
if (!((n = e == null ? void 0 : e.file) != null && n.id))
|
|
1310
1314
|
return;
|
|
1311
|
-
const
|
|
1315
|
+
const s = this.queue.findIndex(
|
|
1312
1316
|
(u) => {
|
|
1313
1317
|
var v;
|
|
1314
1318
|
return u.id === ((v = e == null ? void 0 : e.file) == null ? void 0 : v.id);
|
|
1315
1319
|
}
|
|
1316
1320
|
);
|
|
1317
|
-
if (
|
|
1318
|
-
const { progress: u } = this.queue[
|
|
1319
|
-
u && (u.status =
|
|
1321
|
+
if (s !== -1 && this.queue[s] && this.queue[s].progress) {
|
|
1322
|
+
const { progress: u } = this.queue[s];
|
|
1323
|
+
u && (u.status = L.Remove);
|
|
1320
1324
|
}
|
|
1321
1325
|
this.serverMethod({ files: [e.file], event: e });
|
|
1322
1326
|
break;
|
|
@@ -1324,20 +1328,20 @@ class Ht {
|
|
|
1324
1328
|
const d = this.queue.filter(
|
|
1325
1329
|
(u) => {
|
|
1326
1330
|
var v;
|
|
1327
|
-
return ((v = u == null ? void 0 : u.progress) == null ? void 0 : v.status) ===
|
|
1331
|
+
return ((v = u == null ? void 0 : u.progress) == null ? void 0 : v.status) === L.Queue;
|
|
1328
1332
|
}
|
|
1329
1333
|
);
|
|
1330
|
-
d.length && ((
|
|
1334
|
+
d.length && ((i = this.uploadContext) == null || i.emit("stateChange", {
|
|
1331
1335
|
type: "cancelled",
|
|
1332
1336
|
files: d,
|
|
1333
1337
|
message: "删除附件成功"
|
|
1334
1338
|
}), this.queue = this.queue.filter(
|
|
1335
1339
|
(u) => {
|
|
1336
1340
|
var v;
|
|
1337
|
-
return ((v = u == null ? void 0 : u.progress) == null ? void 0 : v.status) !==
|
|
1341
|
+
return ((v = u == null ? void 0 : u.progress) == null ? void 0 : v.status) !== L.Queue;
|
|
1338
1342
|
}
|
|
1339
1343
|
)), this.queue.length && (e.type = "remove", this.queue.forEach((u) => {
|
|
1340
|
-
u.progress && (u.progress.status =
|
|
1344
|
+
u.progress && (u.progress.status = L.Remove);
|
|
1341
1345
|
}), this.serverMethod({ files: this.queue, event: e }));
|
|
1342
1346
|
break;
|
|
1343
1347
|
}
|
|
@@ -1358,19 +1362,19 @@ class Ht {
|
|
|
1358
1362
|
let n;
|
|
1359
1363
|
switch (e.event.type) {
|
|
1360
1364
|
case "upload":
|
|
1361
|
-
n = this.upload(e.files, e.event, (
|
|
1365
|
+
n = this.upload(e.files, e.event, (i) => this.handleResultFromServer(i));
|
|
1362
1366
|
break;
|
|
1363
1367
|
case "removeAll":
|
|
1364
1368
|
case "remove":
|
|
1365
|
-
n = this.remove(e.files, e.event, (
|
|
1369
|
+
n = this.remove(e.files, e.event, (i) => this.handleResultFromServer(i));
|
|
1366
1370
|
break;
|
|
1367
1371
|
default:
|
|
1368
1372
|
n = null;
|
|
1369
1373
|
}
|
|
1370
|
-
n && n.then((
|
|
1371
|
-
this.handleResultFromServer(
|
|
1372
|
-
}).catch((
|
|
1373
|
-
this.handleResultFromServer(
|
|
1374
|
+
n && n.then((i) => {
|
|
1375
|
+
this.handleResultFromServer(i);
|
|
1376
|
+
}).catch((i) => {
|
|
1377
|
+
this.handleResultFromServer(i);
|
|
1374
1378
|
});
|
|
1375
1379
|
}
|
|
1376
1380
|
/**
|
|
@@ -1379,9 +1383,9 @@ class Ht {
|
|
|
1379
1383
|
* @param event
|
|
1380
1384
|
* @returns
|
|
1381
1385
|
*/
|
|
1382
|
-
upload(e, n,
|
|
1386
|
+
upload(e, n, i) {
|
|
1383
1387
|
var a;
|
|
1384
|
-
return (a = this.uploadContext) == null || a.emit("stateChange", { type: "start", files: e }), this.uploadServerSer.upload(e, n, this.extendServerConfig,
|
|
1388
|
+
return (a = this.uploadContext) == null || a.emit("stateChange", { type: "start", files: e }), this.uploadServerSer.upload(e, n, this.extendServerConfig, i);
|
|
1385
1389
|
}
|
|
1386
1390
|
/**
|
|
1387
1391
|
* 删除附件
|
|
@@ -1389,8 +1393,8 @@ class Ht {
|
|
|
1389
1393
|
* @param event
|
|
1390
1394
|
* @returns
|
|
1391
1395
|
*/
|
|
1392
|
-
remove(e, n,
|
|
1393
|
-
return this.uploadServerSer.remove(e, n, this.extendServerConfig,
|
|
1396
|
+
remove(e, n, i) {
|
|
1397
|
+
return this.uploadServerSer.remove(e, n, this.extendServerConfig, i);
|
|
1394
1398
|
}
|
|
1395
1399
|
/**
|
|
1396
1400
|
* 重置
|
|
@@ -1408,75 +1412,85 @@ class Ht {
|
|
|
1408
1412
|
const ue = /* @__PURE__ */ K({
|
|
1409
1413
|
name: "FUploader",
|
|
1410
1414
|
components: {
|
|
1411
|
-
"f-upload-progress":
|
|
1415
|
+
"f-upload-progress": et,
|
|
1412
1416
|
"f-preview-checkbox": Te,
|
|
1413
1417
|
"f-file-select": Ee
|
|
1414
1418
|
},
|
|
1415
1419
|
props: he,
|
|
1416
1420
|
emits: ["filePreviewEvent", "fileDownloadEvent", "previewMultiSelectedEvent", "selectedEvent", "fileRemoveEvent", "fileRemovedEvent", "fUploadDoneEvent", "uploadDoneEvent"],
|
|
1417
1421
|
setup(t, e) {
|
|
1418
|
-
const n = B(),
|
|
1419
|
-
|
|
1420
|
-
const a = B(t.customInfo)
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1422
|
+
const n = B(), i = new Dt(n, t.uploadServerToken);
|
|
1423
|
+
Ve("uploaderService", i);
|
|
1424
|
+
const a = B(t.customInfo);
|
|
1425
|
+
function s() {
|
|
1426
|
+
return Ae(t.uploadOptions, {
|
|
1427
|
+
// 允许上传的文件类型
|
|
1428
|
+
allowedContentTypes: ["*"],
|
|
1429
|
+
// 默认不限制附件上传个数
|
|
1430
|
+
maxUploads: 0,
|
|
1431
|
+
// 单位KB,默认是12M
|
|
1432
|
+
maxFileSize: "12MB"
|
|
1433
|
+
});
|
|
1434
|
+
}
|
|
1435
|
+
const d = B(s()), u = B(null);
|
|
1436
|
+
q(() => t.uploadOptions, () => {
|
|
1437
|
+
d.value = s();
|
|
1438
|
+
}, {
|
|
1439
|
+
deep: !0
|
|
1440
|
+
});
|
|
1441
|
+
const {
|
|
1442
|
+
disabled: v,
|
|
1443
|
+
uploadVisible: x,
|
|
1444
|
+
uploadDisabled: f,
|
|
1445
|
+
downloadButtonDisable: T,
|
|
1446
|
+
previewVisible: g,
|
|
1447
|
+
previewColumns: D,
|
|
1448
|
+
uploadFiles: E,
|
|
1449
|
+
innerFileInfos: H,
|
|
1450
|
+
previewEnableMulti: w,
|
|
1451
|
+
previewMultiSelectedLength: M,
|
|
1452
|
+
previewSelectAllBtnChecked: y,
|
|
1453
|
+
uploadEnableMulti: b,
|
|
1454
|
+
previewCurrentId: A,
|
|
1455
|
+
multiFileRemoveHandler: k,
|
|
1456
|
+
previewMultiSelectChangeHandler: z,
|
|
1457
|
+
fileMultiDownloadHandler: Z,
|
|
1444
1458
|
selectOrCancelAllHandler: ee,
|
|
1445
1459
|
rowSelectedHandler: te,
|
|
1446
1460
|
hasColumnHtmlFunc: W,
|
|
1447
1461
|
showPreviewStateColumn: Y,
|
|
1448
1462
|
fileDownloadHandler: le,
|
|
1449
|
-
filePreviewHandler:
|
|
1450
|
-
fileRemoveHandler:
|
|
1451
|
-
handleStateChange:
|
|
1452
|
-
} =
|
|
1453
|
-
|
|
1454
|
-
switch (
|
|
1463
|
+
filePreviewHandler: $,
|
|
1464
|
+
fileRemoveHandler: ne,
|
|
1465
|
+
handleStateChange: V
|
|
1466
|
+
} = Oe(t, e, u);
|
|
1467
|
+
q(n, (r) => {
|
|
1468
|
+
switch (V(r), r.type) {
|
|
1455
1469
|
case "removed":
|
|
1456
1470
|
e.emit("fileRemovedEvent", r.files[0]);
|
|
1457
1471
|
break;
|
|
1458
1472
|
}
|
|
1459
1473
|
});
|
|
1460
|
-
const
|
|
1461
|
-
function
|
|
1474
|
+
const m = O(() => H.value.length > 0);
|
|
1475
|
+
function N() {
|
|
1462
1476
|
var r;
|
|
1463
|
-
return He(
|
|
1477
|
+
return He(d.value.allowedContentTypes || []) ? l("li", null, [l("span", null, [F("支持类型:")]), l("span", {
|
|
1464
1478
|
class: "support-info--item-detail",
|
|
1465
1479
|
style: "margin-right:4px;"
|
|
1466
|
-
}, [(r =
|
|
1480
|
+
}, [(r = d.value.allowedContentTypes) == null ? void 0 : r.join(""), F(",")])]) : "";
|
|
1467
1481
|
}
|
|
1468
|
-
function
|
|
1469
|
-
return De(
|
|
1482
|
+
function ie() {
|
|
1483
|
+
return De(d.value.maxFileSize || "") ? l("li", null, [l("span", null, [F("单个文件限制:")]), l("span", {
|
|
1470
1484
|
class: "support-info--item-detail"
|
|
1471
|
-
}, [
|
|
1485
|
+
}, [d.value.maxFileSize, F(", ")])]) : "";
|
|
1472
1486
|
}
|
|
1473
|
-
function
|
|
1474
|
-
return (
|
|
1487
|
+
function U() {
|
|
1488
|
+
return (d.value.maxUploads || 0) > 0 && l("li", null, [l("span", null, [F("文件总数限制:")]), l("span", {
|
|
1475
1489
|
class: "support-info--item-detail"
|
|
1476
|
-
}, [
|
|
1490
|
+
}, [d.value.maxUploads, F("个")])]);
|
|
1477
1491
|
}
|
|
1478
|
-
function
|
|
1479
|
-
return
|
|
1492
|
+
function X() {
|
|
1493
|
+
return x.value && !f.value && !v.value ? l("div", {
|
|
1480
1494
|
class: "ffileupload--support-info"
|
|
1481
1495
|
}, [a.value ? l("ul", {
|
|
1482
1496
|
class: "support-info--wrapper"
|
|
@@ -1485,10 +1499,10 @@ const ue = /* @__PURE__ */ K({
|
|
|
1485
1499
|
innerHTML: a.value
|
|
1486
1500
|
}, null)])]) : l("ul", {
|
|
1487
1501
|
class: "support-info--wrapper"
|
|
1488
|
-
}, [
|
|
1502
|
+
}, [N(), ie(), U()])]) : null;
|
|
1489
1503
|
}
|
|
1490
|
-
function
|
|
1491
|
-
var p, S,
|
|
1504
|
+
function ae(r) {
|
|
1505
|
+
var p, S, I;
|
|
1492
1506
|
return l("div", {
|
|
1493
1507
|
class: "uploadAndpreview--title-container"
|
|
1494
1508
|
}, [l("div", {
|
|
@@ -1500,13 +1514,13 @@ const ue = /* @__PURE__ */ K({
|
|
|
1500
1514
|
}, [l("a", {
|
|
1501
1515
|
class: "item-content--title",
|
|
1502
1516
|
title: (S = r.file) == null ? void 0 : S.name
|
|
1503
|
-
}, [((
|
|
1517
|
+
}, [((I = r.file) == null ? void 0 : I.name) || "无名称"]), l(Q("f-upload-progress"), {
|
|
1504
1518
|
status: r.type === "done" ? "success" : "active",
|
|
1505
1519
|
percent: Ce(r),
|
|
1506
1520
|
maxWidth: 300
|
|
1507
1521
|
}, null)])]);
|
|
1508
1522
|
}
|
|
1509
|
-
function
|
|
1523
|
+
function de(r) {
|
|
1510
1524
|
return l("div", {
|
|
1511
1525
|
class: "uploadAndpreview--title-container"
|
|
1512
1526
|
}, [l("div", {
|
|
@@ -1518,41 +1532,41 @@ const ue = /* @__PURE__ */ K({
|
|
|
1518
1532
|
}, [l("a", {
|
|
1519
1533
|
class: ["item-content--title", "previewButtonDisable.value?'no-preview':''"],
|
|
1520
1534
|
title: r.name,
|
|
1521
|
-
onClick: (p) =>
|
|
1535
|
+
onClick: (p) => $(p, r)
|
|
1522
1536
|
}, [r.name])])]);
|
|
1523
1537
|
}
|
|
1524
|
-
function
|
|
1538
|
+
function o(r, p, S) {
|
|
1525
1539
|
return l("div", {
|
|
1526
1540
|
class: "uploadAndpreview--filesize-container"
|
|
1527
|
-
}, [r === "preview" && S ? l("span", null, [
|
|
1541
|
+
}, [r === "preview" && S ? l("span", null, [wt(S.size)]) : null, r === "upload" && p ? l("span", null, [Ce(p)]) : null]);
|
|
1528
1542
|
}
|
|
1529
|
-
function
|
|
1543
|
+
function c(r, p) {
|
|
1530
1544
|
return p && p.type === "error" ? l("div", {
|
|
1531
1545
|
class: "uploadAndpreview--state-container"
|
|
1532
1546
|
}, [l("p", {
|
|
1533
1547
|
class: "upload-state--uploaded"
|
|
1534
1548
|
}, [l("i", {
|
|
1535
1549
|
class: "f-icon f-icon-message_warning text-danger"
|
|
1536
|
-
}, null), l("span", null, [
|
|
1550
|
+
}, null), l("span", null, [F("存在异常")])])]) : l("div", {
|
|
1537
1551
|
class: "uploadAndpreview--state-container"
|
|
1538
1552
|
}, [r === "upload" ? p && p.type !== "done" ? l("p", {
|
|
1539
1553
|
class: "upload-state--uploading"
|
|
1540
1554
|
}, [l("i", {
|
|
1541
1555
|
class: "f-icon f-icon-clock text-warning"
|
|
1542
|
-
}, null), l("span", null, [
|
|
1556
|
+
}, null), l("span", null, [F("正在上传...")])]) : l("p", {
|
|
1543
1557
|
class: "upload-state--uploaded"
|
|
1544
1558
|
}, [l("i", {
|
|
1545
1559
|
class: "f-icon f-icon-success text-success"
|
|
1546
|
-
}, null), l("span", null, [
|
|
1560
|
+
}, null), l("span", null, [F("上传成功")])]) : r === "preview" ? l("p", {
|
|
1547
1561
|
class: "upload-state--uploaded"
|
|
1548
1562
|
}, [l("i", {
|
|
1549
1563
|
class: "f-icon f-icon-success text-success"
|
|
1550
|
-
}, null), l("span", null, [
|
|
1564
|
+
}, null), l("span", null, [F("已上传")])]) : ""]);
|
|
1551
1565
|
}
|
|
1552
|
-
function
|
|
1566
|
+
function h(r) {
|
|
1553
1567
|
return l("div", {
|
|
1554
1568
|
class: "uploadAndpreview--action-container"
|
|
1555
|
-
}, [
|
|
1569
|
+
}, [T.value ? "" : l("button", {
|
|
1556
1570
|
class: "btn preview-btn",
|
|
1557
1571
|
title: "下载",
|
|
1558
1572
|
onClick: (p) => le(p, r)
|
|
@@ -1561,173 +1575,173 @@ const ue = /* @__PURE__ */ K({
|
|
|
1561
1575
|
}, null)]), t.previewButtonDisable ? "" : l("button", {
|
|
1562
1576
|
class: "btn preview-btn",
|
|
1563
1577
|
title: "预览",
|
|
1564
|
-
onClick: (p) =>
|
|
1578
|
+
onClick: (p) => $(p, r)
|
|
1565
1579
|
}, [l("span", {
|
|
1566
1580
|
class: "f-icon f-icon-enclosure_browse"
|
|
1567
1581
|
}, null)]), t.deleteButtonDisable ? "" : l("button", {
|
|
1568
1582
|
class: "btn preview-btn",
|
|
1569
1583
|
title: "删除",
|
|
1570
|
-
onClick: (p) =>
|
|
1584
|
+
onClick: (p) => ne(p, r, i)
|
|
1571
1585
|
}, [l("span", {
|
|
1572
1586
|
class: "f-icon f-icon-enclosure_delete",
|
|
1573
1587
|
style: "top: -1px"
|
|
1574
1588
|
}, null)])]);
|
|
1575
1589
|
}
|
|
1576
|
-
function
|
|
1590
|
+
function C(r) {
|
|
1577
1591
|
return l("div", {
|
|
1578
1592
|
class: "uploadAndpreview--date-container"
|
|
1579
1593
|
}, [r.createTime || ""]);
|
|
1580
1594
|
}
|
|
1581
|
-
function
|
|
1582
|
-
let
|
|
1583
|
-
if (r = r || "preview",
|
|
1584
|
-
return
|
|
1595
|
+
function R(r, p, S, I) {
|
|
1596
|
+
let P;
|
|
1597
|
+
if (r = r || "preview", I.formatter)
|
|
1598
|
+
return P = I.formatter(S[I.field] || "", r, r === "preview" ? S : p, I), P;
|
|
1585
1599
|
if (r === "preview" && S)
|
|
1586
|
-
switch (
|
|
1600
|
+
switch (I.field) {
|
|
1587
1601
|
case "state":
|
|
1588
|
-
|
|
1602
|
+
P = c("preview", null);
|
|
1589
1603
|
break;
|
|
1590
1604
|
case "name":
|
|
1591
|
-
|
|
1605
|
+
P = de(S);
|
|
1592
1606
|
break;
|
|
1593
1607
|
case "action":
|
|
1594
|
-
|
|
1608
|
+
P = h(S);
|
|
1595
1609
|
break;
|
|
1596
1610
|
case "size":
|
|
1597
|
-
|
|
1611
|
+
P = o(r, p, S);
|
|
1598
1612
|
break;
|
|
1599
1613
|
case "createTime":
|
|
1600
|
-
|
|
1614
|
+
P = C(S);
|
|
1601
1615
|
break;
|
|
1602
1616
|
default:
|
|
1603
|
-
|
|
1617
|
+
P = `<div>${S[I.field] || ""} </div>`;
|
|
1604
1618
|
}
|
|
1605
1619
|
if (r === "upload" && p)
|
|
1606
|
-
switch (
|
|
1620
|
+
switch (I.field) {
|
|
1607
1621
|
case "state":
|
|
1608
|
-
|
|
1622
|
+
P = c("upload", p);
|
|
1609
1623
|
break;
|
|
1610
1624
|
case "name":
|
|
1611
|
-
|
|
1625
|
+
P = ae(p);
|
|
1612
1626
|
break;
|
|
1613
1627
|
case "size":
|
|
1614
|
-
|
|
1628
|
+
P = o(r, p, S);
|
|
1615
1629
|
break;
|
|
1616
1630
|
default:
|
|
1617
|
-
|
|
1631
|
+
P = "";
|
|
1618
1632
|
}
|
|
1619
|
-
return
|
|
1633
|
+
return P;
|
|
1620
1634
|
}
|
|
1621
|
-
function
|
|
1622
|
-
return
|
|
1635
|
+
function _() {
|
|
1636
|
+
return x.value ? l("div", {
|
|
1623
1637
|
class: "header--left-container"
|
|
1624
|
-
}, [l(
|
|
1625
|
-
ref:
|
|
1626
|
-
disabled:
|
|
1638
|
+
}, [l(Q("f-file-select"), {
|
|
1639
|
+
ref: u,
|
|
1640
|
+
disabled: f.value,
|
|
1627
1641
|
selectText: t.selectText,
|
|
1628
1642
|
uploadedCount: t.uploadedCount,
|
|
1629
1643
|
uploadServerToken: t.uploadServerToken,
|
|
1630
|
-
enableMulti:
|
|
1631
|
-
options:
|
|
1644
|
+
enableMulti: b.value,
|
|
1645
|
+
options: d.value,
|
|
1632
1646
|
extendConfig: t.extendConfig,
|
|
1633
|
-
onStateChange: (r) =>
|
|
1647
|
+
onStateChange: (r) => V(r)
|
|
1634
1648
|
}, null)]) : null;
|
|
1635
1649
|
}
|
|
1636
|
-
function
|
|
1637
|
-
return !
|
|
1650
|
+
function oe() {
|
|
1651
|
+
return !x.value && g.value && m.value ? l("div", {
|
|
1638
1652
|
class: "header--left-container header--countInfo"
|
|
1639
1653
|
}, [l("p", {
|
|
1640
1654
|
class: "m-0"
|
|
1641
|
-
}, [
|
|
1655
|
+
}, [F("共"), l("span", {
|
|
1642
1656
|
class: "count"
|
|
1643
|
-
}, [
|
|
1657
|
+
}, [E.value.length + H.value.length]), F("个附件"), M.value > 0 ? l(G, null, [F("(已选"), l("span", {
|
|
1644
1658
|
class: "count-selected"
|
|
1645
|
-
}, [
|
|
1659
|
+
}, [M.value]), F("个)")]) : ""])]) : null;
|
|
1646
1660
|
}
|
|
1647
|
-
function
|
|
1648
|
-
return (!
|
|
1661
|
+
function Re() {
|
|
1662
|
+
return (!T.value || !t.deleteButtonDisable) && g.value && m.value ? l("div", {
|
|
1649
1663
|
class: "header--right-container"
|
|
1650
|
-
}, [
|
|
1664
|
+
}, [T.value ? null : l("button", {
|
|
1651
1665
|
class: "btn btn-primary f-btn-ml",
|
|
1652
|
-
disabled:
|
|
1653
|
-
onClick: (S) =>
|
|
1654
|
-
}, [
|
|
1666
|
+
disabled: M.value === 0,
|
|
1667
|
+
onClick: (S) => Z(S)
|
|
1668
|
+
}, [F("下载")]), t.deleteButtonDisable.value ? null : l("button", {
|
|
1655
1669
|
class: "btn btn-secondary f-btn-ml",
|
|
1656
|
-
disabled:
|
|
1657
|
-
onClick: (S) =>
|
|
1658
|
-
}, [
|
|
1670
|
+
disabled: M.value === 0,
|
|
1671
|
+
onClick: (S) => k(S)
|
|
1672
|
+
}, [F("删除")])]) : null;
|
|
1659
1673
|
}
|
|
1660
1674
|
function we() {
|
|
1661
|
-
return
|
|
1675
|
+
return D.value.map((r) => Y(r) ? l("th", {
|
|
1662
1676
|
style: {
|
|
1663
1677
|
width: r.width ? r.width + "px" : "auto"
|
|
1664
1678
|
},
|
|
1665
|
-
class: [!
|
|
1666
|
-
}, [!
|
|
1679
|
+
class: [!v.value && r.checkbox && r.checkbox ? "td--hascheckbox" : ""]
|
|
1680
|
+
}, [!v.value && w.value && r.checkbox ? l(Q("f-preview-checkbox"), {
|
|
1667
1681
|
class: "preview-checkbox",
|
|
1668
1682
|
id: "previewMultiBtn",
|
|
1669
|
-
checked:
|
|
1683
|
+
checked: y.value,
|
|
1670
1684
|
onCheckedChange: (p) => ee(p)
|
|
1671
1685
|
}, null) : null, r.title]) : null);
|
|
1672
1686
|
}
|
|
1673
1687
|
function Ne() {
|
|
1674
|
-
return
|
|
1688
|
+
return E.value.map((r) => {
|
|
1675
1689
|
var p;
|
|
1676
1690
|
return l("tr", {
|
|
1677
1691
|
class: "uploadAndpreview--upload-item",
|
|
1678
1692
|
id: "uploadAndpreview--upload-item" + (((p = r == null ? void 0 : r.file) == null ? void 0 : p.id) || "")
|
|
1679
|
-
}, [
|
|
1680
|
-
var
|
|
1693
|
+
}, [D.value.map((S) => {
|
|
1694
|
+
var I;
|
|
1681
1695
|
return l("td", {
|
|
1682
|
-
class: [!
|
|
1683
|
-
}, [
|
|
1684
|
-
id: (
|
|
1696
|
+
class: [!v.value && S.checkbox && S.checkbox ? "td--hascheckbox" : ""]
|
|
1697
|
+
}, [w.value && S.checkbox ? l(Q("f-preview-checkbox"), {
|
|
1698
|
+
id: (I = r == null ? void 0 : r.file) == null ? void 0 : I.id,
|
|
1685
1699
|
checked: r.checked,
|
|
1686
1700
|
disabled: r.type !== "done",
|
|
1687
1701
|
class: "preview-checkbox",
|
|
1688
|
-
onCheckedChange: (
|
|
1689
|
-
}, null) : null, W(S, "upload") ?
|
|
1702
|
+
onCheckedChange: (P) => z(P)
|
|
1703
|
+
}, null) : null, W(S, "upload") ? R("upload", r, null, S) : null]);
|
|
1690
1704
|
})]);
|
|
1691
1705
|
});
|
|
1692
1706
|
}
|
|
1693
1707
|
function ye() {
|
|
1694
|
-
return
|
|
1695
|
-
class: ["uploadAndpreview--preview-item",
|
|
1708
|
+
return H.value.map((r) => l("tr", {
|
|
1709
|
+
class: ["uploadAndpreview--preview-item", A.value === r.id ? "uploadAndpreview--currentfile" : ""],
|
|
1696
1710
|
id: "uploadAndpreview--preview-item" + r.id,
|
|
1697
1711
|
onClick: (p) => te(p, r)
|
|
1698
|
-
}, [
|
|
1699
|
-
class: [!
|
|
1700
|
-
}, [!
|
|
1712
|
+
}, [D.value.map((p) => Y(p) ? l("td", {
|
|
1713
|
+
class: [!v.value && p.checkbox && p.checkbox ? "td--hascheckbox" : ""]
|
|
1714
|
+
}, [!v.value && w.value && p.checkbox ? l(Q("f-preview-checkbox"), {
|
|
1701
1715
|
id: r.id,
|
|
1702
1716
|
checked: r.checked,
|
|
1703
1717
|
class: "preview-checkbox",
|
|
1704
|
-
onCheckedChange: (S) =>
|
|
1705
|
-
}, null) : null, W(p, "preview") ?
|
|
1718
|
+
onCheckedChange: (S) => z(S)
|
|
1719
|
+
}, null) : null, W(p, "preview") ? R("preview", null, r, p) : l("div", {
|
|
1706
1720
|
class: "text-truncate",
|
|
1707
|
-
innerHTML:
|
|
1721
|
+
innerHTML: R("preview", null, r, p)
|
|
1708
1722
|
}, null)]) : null)]));
|
|
1709
1723
|
}
|
|
1710
|
-
return () =>
|
|
1724
|
+
return () => v.value ? l("div", {
|
|
1711
1725
|
class: "fv-upload-and-preview"
|
|
1712
|
-
}, [
|
|
1726
|
+
}, [m.value ? null : X(), g.value ? l("div", {
|
|
1713
1727
|
class: "uploadAndpreview--content"
|
|
1714
|
-
}, [
|
|
1728
|
+
}, [m.value ? l("table", {
|
|
1715
1729
|
class: "table table-bordered uploadAndpreview--table"
|
|
1716
1730
|
}, [l("thead", null, [we()]), l("tbody", null, [ye()])]) : l("p", {
|
|
1717
1731
|
class: "uploadAndpreview--nodata"
|
|
1718
|
-
}, [
|
|
1732
|
+
}, [F("无附件信息")])]) : null, m.value ? X() : null]) : l("div", {
|
|
1719
1733
|
class: "fv-upload-and-preview"
|
|
1720
1734
|
}, [l("div", {
|
|
1721
1735
|
class: "uploadAndpreview--header"
|
|
1722
|
-
}, [
|
|
1736
|
+
}, [_(), oe(), Re()]), m.value ? null : X(), g.value || x.value ? l("div", {
|
|
1723
1737
|
class: "uploadAndpreview--content"
|
|
1724
|
-
}, [(
|
|
1738
|
+
}, [(T.value || !x.value) && E.value.length === 0 && !m.value ? l("p", {
|
|
1725
1739
|
class: "uploadAndpreview--nodata"
|
|
1726
|
-
}, [
|
|
1740
|
+
}, [F("无附件信息")]) : "", E.value.length > 0 || m ? l("table", {
|
|
1727
1741
|
class: "table table-bordered uploadAndpreview--table"
|
|
1728
|
-
}, [l("thead", null, [we()]), l("tbody", null, [Ne(), ye()])]) : null]) : null,
|
|
1742
|
+
}, [l("thead", null, [we()]), l("tbody", null, [Ne(), ye()])]) : null]) : null, m.value ? X() : null]);
|
|
1729
1743
|
}
|
|
1730
|
-
}),
|
|
1744
|
+
}), At = /* @__PURE__ */ K({
|
|
1731
1745
|
name: "FUploaderDesign",
|
|
1732
1746
|
components: {
|
|
1733
1747
|
"f-preview-checkbox": Te,
|
|
@@ -1736,14 +1750,14 @@ const ue = /* @__PURE__ */ K({
|
|
|
1736
1750
|
props: he,
|
|
1737
1751
|
emits: ["filePreviewEvent", "fileDownloadEvent", "previewMultiSelectedEvent", "selectedEvent", "fileRemoveEvent", "fUploadDoneEvent", "uploadDoneEvent"],
|
|
1738
1752
|
setup(t, e) {
|
|
1739
|
-
const n = B(t.customInfo),
|
|
1753
|
+
const n = B(t.customInfo), i = Ae(t.uploadOptions, {
|
|
1740
1754
|
// 允许上传的文件类型
|
|
1741
1755
|
allowedContentTypes: ["*"],
|
|
1742
1756
|
// 默认不限制附件上传个数
|
|
1743
1757
|
maxUploads: 0,
|
|
1744
1758
|
// 单位KB,默认是12M
|
|
1745
1759
|
maxFileSize: "12MB"
|
|
1746
|
-
}), a = B(null),
|
|
1760
|
+
}), a = B(null), s = [{
|
|
1747
1761
|
id: "attach01",
|
|
1748
1762
|
name: ""
|
|
1749
1763
|
}, {
|
|
@@ -1753,29 +1767,29 @@ const ue = /* @__PURE__ */ K({
|
|
|
1753
1767
|
disabled: d,
|
|
1754
1768
|
uploadVisible: u,
|
|
1755
1769
|
uploadDisabled: v,
|
|
1756
|
-
downloadButtonDisable:
|
|
1770
|
+
downloadButtonDisable: x,
|
|
1757
1771
|
previewVisible: f,
|
|
1758
1772
|
previewColumns: T,
|
|
1759
|
-
previewEnableMulti:
|
|
1773
|
+
previewEnableMulti: g,
|
|
1760
1774
|
previewCurrentId: D,
|
|
1761
1775
|
showPreviewStateColumn: E
|
|
1762
|
-
} =
|
|
1776
|
+
} = Oe(t, e, a);
|
|
1763
1777
|
function H() {
|
|
1764
|
-
var
|
|
1765
|
-
return He((
|
|
1778
|
+
var m;
|
|
1779
|
+
return He((i == null ? void 0 : i.allowedContentTypes) || []) ? l("li", null, [l("span", null, [F("支持类型:")]), l("span", {
|
|
1766
1780
|
class: "support-info--item-detail",
|
|
1767
1781
|
style: "margin-right:4px;"
|
|
1768
|
-
}, [(
|
|
1782
|
+
}, [(m = i.allowedContentTypes) == null ? void 0 : m.join(""), F(",")])]) : null;
|
|
1769
1783
|
}
|
|
1770
|
-
function
|
|
1771
|
-
return De((
|
|
1784
|
+
function w() {
|
|
1785
|
+
return De((i == null ? void 0 : i.maxFileSize) || "") ? l("li", null, [l("span", null, [F("单个文件限制:")]), l("span", {
|
|
1772
1786
|
class: "support-info--item-detail"
|
|
1773
|
-
}, [
|
|
1787
|
+
}, [i.maxFileSize, F(", ")])]) : null;
|
|
1774
1788
|
}
|
|
1775
|
-
function
|
|
1776
|
-
return ((
|
|
1789
|
+
function M() {
|
|
1790
|
+
return ((i == null ? void 0 : i.maxUploads) || 0) > 0 ? l("li", null, [l("span", null, [F("文件总数限制:")]), l("span", {
|
|
1777
1791
|
class: "support-info--item-detail"
|
|
1778
|
-
}, [
|
|
1792
|
+
}, [i.maxUploads, F("个")])]) : null;
|
|
1779
1793
|
}
|
|
1780
1794
|
function y() {
|
|
1781
1795
|
return u.value && !v.value && !d.value ? l("div", {
|
|
@@ -1787,9 +1801,9 @@ const ue = /* @__PURE__ */ K({
|
|
|
1787
1801
|
innerHTML: n.value
|
|
1788
1802
|
}, null)])]) : l("ul", {
|
|
1789
1803
|
class: "support-info--wrapper"
|
|
1790
|
-
}, [H(),
|
|
1804
|
+
}, [H(), w(), M()])]) : null;
|
|
1791
1805
|
}
|
|
1792
|
-
function b(
|
|
1806
|
+
function b(m) {
|
|
1793
1807
|
return l("div", {
|
|
1794
1808
|
class: "uploadAndpreview--title-container"
|
|
1795
1809
|
}, [l("div", {
|
|
@@ -1802,7 +1816,7 @@ const ue = /* @__PURE__ */ K({
|
|
|
1802
1816
|
class: "ffilepreview--preview-block"
|
|
1803
1817
|
}, null)])]);
|
|
1804
1818
|
}
|
|
1805
|
-
function A(
|
|
1819
|
+
function A(m) {
|
|
1806
1820
|
return l("div", {
|
|
1807
1821
|
class: "uploadAndpreview--filesize-container"
|
|
1808
1822
|
}, [l("span", {
|
|
@@ -1816,12 +1830,12 @@ const ue = /* @__PURE__ */ K({
|
|
|
1816
1830
|
class: "upload-state--uploaded"
|
|
1817
1831
|
}, [l("i", {
|
|
1818
1832
|
class: "f-icon f-icon-success text-success"
|
|
1819
|
-
}, null), l("span", null, [
|
|
1833
|
+
}, null), l("span", null, [F("已上传")])])]);
|
|
1820
1834
|
}
|
|
1821
|
-
function
|
|
1835
|
+
function z(m) {
|
|
1822
1836
|
return l("div", {
|
|
1823
1837
|
class: "uploadAndpreview--action-container"
|
|
1824
|
-
}, [
|
|
1838
|
+
}, [x.value ? "" : l("button", {
|
|
1825
1839
|
class: "btn preview-btn",
|
|
1826
1840
|
title: "下载"
|
|
1827
1841
|
}, [l("span", {
|
|
@@ -1839,107 +1853,107 @@ const ue = /* @__PURE__ */ K({
|
|
|
1839
1853
|
style: "top: -1px"
|
|
1840
1854
|
}, null)])]);
|
|
1841
1855
|
}
|
|
1842
|
-
function
|
|
1856
|
+
function Z(m) {
|
|
1843
1857
|
return l("div", {
|
|
1844
1858
|
class: "uploadAndpreview--date-container"
|
|
1845
|
-
}, [
|
|
1859
|
+
}, [F(" "), l("span", {
|
|
1846
1860
|
class: "ffilepreview--preview-block"
|
|
1847
1861
|
}, null)]);
|
|
1848
1862
|
}
|
|
1849
|
-
function
|
|
1850
|
-
let
|
|
1851
|
-
if (
|
|
1852
|
-
switch (
|
|
1863
|
+
function ee(m, N, ie) {
|
|
1864
|
+
let U = null;
|
|
1865
|
+
if (m = m || "preview", m === "preview" && N)
|
|
1866
|
+
switch (ie.field) {
|
|
1853
1867
|
case "state":
|
|
1854
|
-
|
|
1868
|
+
U = k();
|
|
1855
1869
|
break;
|
|
1856
1870
|
case "name":
|
|
1857
|
-
|
|
1871
|
+
U = b();
|
|
1858
1872
|
break;
|
|
1859
1873
|
case "action":
|
|
1860
|
-
|
|
1874
|
+
U = z();
|
|
1861
1875
|
break;
|
|
1862
1876
|
case "size":
|
|
1863
|
-
|
|
1877
|
+
U = A();
|
|
1864
1878
|
break;
|
|
1865
1879
|
case "createTime":
|
|
1866
|
-
|
|
1880
|
+
U = Z();
|
|
1867
1881
|
break;
|
|
1868
1882
|
default:
|
|
1869
|
-
|
|
1883
|
+
U = l("span", {
|
|
1870
1884
|
class: "ffilepreview--preview-block"
|
|
1871
1885
|
}, null);
|
|
1872
1886
|
}
|
|
1873
|
-
return
|
|
1887
|
+
return U;
|
|
1874
1888
|
}
|
|
1875
|
-
function
|
|
1889
|
+
function te() {
|
|
1876
1890
|
return u.value ? l("div", {
|
|
1877
1891
|
class: "header--left-container"
|
|
1878
|
-
}, [l(
|
|
1892
|
+
}, [l(Q("f-file-select"), {
|
|
1879
1893
|
ref: a,
|
|
1880
1894
|
disabled: v.value,
|
|
1881
1895
|
selectText: t.selectText
|
|
1882
1896
|
}, null)]) : null;
|
|
1883
1897
|
}
|
|
1884
|
-
function
|
|
1885
|
-
return (!
|
|
1898
|
+
function W() {
|
|
1899
|
+
return (!x.value || !t.deleteButtonDisable) && f.value ? l("div", {
|
|
1886
1900
|
class: "header--right-container"
|
|
1887
|
-
}, [
|
|
1901
|
+
}, [x.value ? null : l("button", {
|
|
1888
1902
|
class: "btn btn-primary f-btn-ml",
|
|
1889
1903
|
disabled: !0
|
|
1890
|
-
}, [
|
|
1904
|
+
}, [F("下载")]), t.deleteButtonDisable.value ? null : l("button", {
|
|
1891
1905
|
class: "btn btn-secondary f-btn-ml",
|
|
1892
1906
|
disabled: !0
|
|
1893
|
-
}, [
|
|
1907
|
+
}, [F("删除")])]) : null;
|
|
1894
1908
|
}
|
|
1895
|
-
function
|
|
1896
|
-
return T.value.map((
|
|
1909
|
+
function Y() {
|
|
1910
|
+
return T.value.map((m) => E(m) ? l("th", {
|
|
1897
1911
|
style: {
|
|
1898
|
-
width:
|
|
1912
|
+
width: m.width ? m.width + "px" : "auto"
|
|
1899
1913
|
},
|
|
1900
|
-
class: [!d.value &&
|
|
1901
|
-
}, [!d.value &&
|
|
1914
|
+
class: [!d.value && m.checkbox && m.checkbox ? "td--hascheckbox" : ""]
|
|
1915
|
+
}, [!d.value && g.value && m.checkbox ? l(Q("f-preview-checkbox"), {
|
|
1902
1916
|
class: "preview-checkbox",
|
|
1903
1917
|
id: "previewMultiBtn"
|
|
1904
|
-
}, null) : null,
|
|
1918
|
+
}, null) : null, m.title]) : null);
|
|
1905
1919
|
}
|
|
1906
|
-
function
|
|
1907
|
-
return
|
|
1908
|
-
class: ["uploadAndpreview--preview-item", D.value ===
|
|
1909
|
-
id: "uploadAndpreview--preview-item" +
|
|
1910
|
-
}, [T.value.map((
|
|
1911
|
-
class: [!d.value &&
|
|
1912
|
-
}, [!d.value &&
|
|
1920
|
+
function le() {
|
|
1921
|
+
return s.map((m) => l("tr", {
|
|
1922
|
+
class: ["uploadAndpreview--preview-item", D.value === m.id ? "uploadAndpreview--currentfile" : ""],
|
|
1923
|
+
id: "uploadAndpreview--preview-item" + m.id
|
|
1924
|
+
}, [T.value.map((N) => E(N) ? l("td", {
|
|
1925
|
+
class: [!d.value && N.checkbox && N.checkbox ? "td--hascheckbox" : ""]
|
|
1926
|
+
}, [!d.value && g.value && N.checkbox ? l(Q("f-preview-checkbox"), {
|
|
1913
1927
|
class: "preview-checkbox"
|
|
1914
|
-
}, null) : null,
|
|
1928
|
+
}, null) : null, ee("preview", m, N)]) : null)]));
|
|
1915
1929
|
}
|
|
1916
|
-
|
|
1930
|
+
_e(() => {
|
|
1917
1931
|
});
|
|
1918
|
-
const
|
|
1932
|
+
const $ = B(), ne = J("design-item-context"), V = Xe($, ne);
|
|
1919
1933
|
return ve(() => {
|
|
1920
|
-
|
|
1921
|
-
}), e.expose(
|
|
1934
|
+
$.value.componentInstance = V;
|
|
1935
|
+
}), e.expose(V.value), () => l("div", {
|
|
1922
1936
|
class: "fv-upload-and-preview",
|
|
1923
|
-
ref:
|
|
1924
|
-
}, [f.value || u.value ? l(
|
|
1937
|
+
ref: $
|
|
1938
|
+
}, [f.value || u.value ? l(G, null, [d.value ? null : l("div", {
|
|
1925
1939
|
class: "uploadAndpreview--header"
|
|
1926
|
-
}, [
|
|
1940
|
+
}, [te(), W()]), l("div", {
|
|
1927
1941
|
class: "uploadAndpreview--content"
|
|
1928
1942
|
}, [l("table", {
|
|
1929
1943
|
class: "table table-bordered uploadAndpreview--table"
|
|
1930
|
-
}, [l("thead", null, [
|
|
1944
|
+
}, [l("thead", null, [Y()]), l("tbody", null, [le()])])]), y()]) : null]);
|
|
1931
1945
|
}
|
|
1932
1946
|
});
|
|
1933
|
-
ue.register = (t, e, n,
|
|
1947
|
+
ue.register = (t, e, n, i) => {
|
|
1934
1948
|
t.uploader = ue, e.uploader = Be;
|
|
1935
1949
|
};
|
|
1936
1950
|
ue.registerDesigner = (t, e, n) => {
|
|
1937
|
-
t.uploader =
|
|
1951
|
+
t.uploader = At, e.uploader = Be;
|
|
1938
1952
|
};
|
|
1939
|
-
const Ut =
|
|
1953
|
+
const Ut = Ye(ue);
|
|
1940
1954
|
export {
|
|
1941
1955
|
ue as FUploader,
|
|
1942
|
-
|
|
1956
|
+
ht as UploadServerAPI,
|
|
1943
1957
|
Ut as default,
|
|
1944
1958
|
Be as propsResolver,
|
|
1945
1959
|
he as uploaderProps
|