@aplus-frontend/ui 7.19.0-beta.2 → 7.19.1
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/src/ag-grid/editable/form-item.vue.mjs +87 -77
- package/es/src/ag-grid/editable/interface.d.ts +15 -1
- package/es/src/ag-grid/index.vue.mjs +119 -120
- package/es/src/ap-form/ap-form.vue2.mjs +63 -61
- package/es/src/ap-form/interface.d.ts +4 -0
- package/es/src/ap-table/components/setting/modal/index.vue.mjs +59 -59
- package/es/src/ap-table/hooks/use-table-template-storage.mjs +41 -40
- package/es/src/business/ap-upload/components/MultipleFile.vue2.mjs +128 -112
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ag-grid/editable/interface.d.ts +15 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/interface.d.ts +4 -0
- package/lib/src/ap-table/components/setting/modal/index.vue.js +1 -1
- package/lib/src/ap-table/hooks/use-table-template-storage.js +1 -1
- package/lib/src/business/ap-upload/components/MultipleFile.vue2.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useToken as G } from "@aplus-frontend/antdv/es/theme/internal";
|
|
2
|
-
import { isBoolean as P, isNumber as
|
|
3
|
-
import { ref as
|
|
2
|
+
import { isBoolean as P, isNumber as b, isObject as y, mergeWith as E, omit as R, isString as U } from "lodash-unified";
|
|
3
|
+
import { ref as k, watch as d, unref as v } from "vue";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
|
-
import { randomStr as
|
|
5
|
+
import { randomStr as N } from "../../utils/index.mjs";
|
|
6
6
|
import { getColumnStateString as W } from "../components/setting/utils.mjs";
|
|
7
7
|
import { useInjectApTable as X } from "../context.mjs";
|
|
8
8
|
import { getTableTitle as q } from "../utils.mjs";
|
|
@@ -11,16 +11,16 @@ import { useNamespace as H } from "../../config-provider/hooks/use-namespace.mjs
|
|
|
11
11
|
function Q(r, e, o, a) {
|
|
12
12
|
return a ? a.fixed : e ? e.fixed : o && "fixed" in o ? o.fixed : P(r.fixed) ? r.fixed ? "left" : void 0 : r.fixed;
|
|
13
13
|
}
|
|
14
|
-
const
|
|
14
|
+
const A = Number.MAX_SAFE_INTEGER, I = N();
|
|
15
15
|
function V(r, e) {
|
|
16
|
-
const o =
|
|
17
|
-
let a =
|
|
16
|
+
const o = b(r.order) ? r.order : A;
|
|
17
|
+
let a = b(e.order) ? e.order : A;
|
|
18
18
|
return r.fixed === "right" && e.fixed !== "right" && (a = o - 1), e.fixed === "left" && r.fixed !== "left" && (a = o - 1), o - a;
|
|
19
19
|
}
|
|
20
20
|
function Y(r, e) {
|
|
21
21
|
e && r.removeItem(e);
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function z(r, e) {
|
|
24
24
|
if (!e)
|
|
25
25
|
return [];
|
|
26
26
|
const o = r.getItem(e);
|
|
@@ -29,29 +29,30 @@ function I(r, e) {
|
|
|
29
29
|
const a = JSON.parse(o);
|
|
30
30
|
return Array.isArray(a) ? a : (Y(r, e), []);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
if (
|
|
34
|
-
return
|
|
32
|
+
function _(r, e) {
|
|
33
|
+
if (y(r) && y(e))
|
|
34
|
+
return E({}, r, e, _);
|
|
35
35
|
}
|
|
36
36
|
const ue = (r, e, o) => {
|
|
37
|
-
const { columnsBackup: a, size: s } = X(), { t:
|
|
37
|
+
const { columnsBackup: a, size: s } = X(), { t: L } = D(), { be: O } = H("ap-table"), [Z, B] = G(), m = k(), n = k([]);
|
|
38
|
+
let g;
|
|
39
|
+
g = d(
|
|
38
40
|
() => a?.value,
|
|
39
41
|
(t, i) => {
|
|
40
|
-
t?.length && !i?.length && (n.value =
|
|
41
|
-
|
|
42
|
-
),
|
|
42
|
+
t?.length && !i?.length && (n.value = T(
|
|
43
|
+
z(localStorage, v(e))
|
|
44
|
+
), g?.());
|
|
43
45
|
},
|
|
44
46
|
{
|
|
45
47
|
immediate: !0
|
|
46
48
|
}
|
|
47
|
-
)
|
|
48
|
-
d(
|
|
49
|
+
), d(
|
|
49
50
|
[a, s],
|
|
50
51
|
([t, i]) => {
|
|
51
|
-
t && (
|
|
52
|
+
t && (m.value = {
|
|
52
53
|
label: "basic_template",
|
|
53
54
|
columnState: f(t),
|
|
54
|
-
key:
|
|
55
|
+
key: I,
|
|
55
56
|
size: i
|
|
56
57
|
});
|
|
57
58
|
},
|
|
@@ -59,18 +60,18 @@ const ue = (r, e, o) => {
|
|
|
59
60
|
), d(
|
|
60
61
|
() => e.value,
|
|
61
62
|
(t) => {
|
|
62
|
-
const i =
|
|
63
|
-
|
|
63
|
+
const i = T(
|
|
64
|
+
z(localStorage, t)
|
|
64
65
|
);
|
|
65
|
-
n.value = i,
|
|
66
|
+
n.value = i, m.value = {
|
|
66
67
|
label: "basic_template",
|
|
67
68
|
columnState: f(a?.value || []),
|
|
68
|
-
key:
|
|
69
|
+
key: I,
|
|
69
70
|
size: s?.value
|
|
70
71
|
}, o(i ?? []);
|
|
71
72
|
}
|
|
72
73
|
);
|
|
73
|
-
function
|
|
74
|
+
function T(t) {
|
|
74
75
|
return t.length ? t.map((i) => ({
|
|
75
76
|
...i,
|
|
76
77
|
columnState: f(
|
|
@@ -80,29 +81,29 @@ const ue = (r, e, o) => {
|
|
|
80
81
|
)
|
|
81
82
|
})) : [
|
|
82
83
|
{
|
|
83
|
-
label:
|
|
84
|
-
key: r.getActiveKey?.("DEFAULT_TEMPLATE") ??
|
|
84
|
+
label: L("ap.apTable.setting.defaultTemplate"),
|
|
85
|
+
key: r.getActiveKey?.("DEFAULT_TEMPLATE") ?? N(),
|
|
85
86
|
size: s?.value,
|
|
86
87
|
columnState: f(a?.value || [])
|
|
87
88
|
}
|
|
88
89
|
];
|
|
89
90
|
}
|
|
90
91
|
function f(t, i = {}, l = !0) {
|
|
91
|
-
const
|
|
92
|
+
const c = E(
|
|
92
93
|
{},
|
|
93
94
|
l ? r.defaultValue || {} : {},
|
|
94
95
|
i,
|
|
95
|
-
|
|
96
|
+
_
|
|
96
97
|
);
|
|
97
|
-
function
|
|
98
|
+
function h(M, j, C) {
|
|
98
99
|
return M.map((u) => {
|
|
99
|
-
const
|
|
100
|
+
const S = j?.[u.key] || {}, p = {
|
|
100
101
|
key: u.key,
|
|
101
102
|
label: U(u.title) ? q(
|
|
102
103
|
u,
|
|
103
|
-
|
|
104
|
+
O("table-header", "title"),
|
|
104
105
|
void 0,
|
|
105
|
-
|
|
106
|
+
B.value.colorTextTertiary
|
|
106
107
|
) : u.title,
|
|
107
108
|
show: !0,
|
|
108
109
|
fixed: Q(
|
|
@@ -112,18 +113,18 @@ const ue = (r, e, o) => {
|
|
|
112
113
|
C
|
|
113
114
|
),
|
|
114
115
|
disabled: !1,
|
|
115
|
-
...R(
|
|
116
|
+
...R(S, ["children", "fixed"])
|
|
116
117
|
};
|
|
117
|
-
return p.children = u.children?.length ?
|
|
118
|
+
return p.children = u.children?.length ? h(
|
|
118
119
|
u.children,
|
|
119
|
-
|
|
120
|
+
S.children,
|
|
120
121
|
p
|
|
121
122
|
) : void 0, p;
|
|
122
123
|
}).sort(V);
|
|
123
124
|
}
|
|
124
|
-
return
|
|
125
|
+
return h(t || [], c);
|
|
125
126
|
}
|
|
126
|
-
function
|
|
127
|
+
function x(t) {
|
|
127
128
|
if (v(e)) {
|
|
128
129
|
const i = t.map((l) => ({
|
|
129
130
|
...l,
|
|
@@ -143,7 +144,7 @@ const ue = (r, e, o) => {
|
|
|
143
144
|
}
|
|
144
145
|
function J(t, i) {
|
|
145
146
|
const l = n.value.findIndex(
|
|
146
|
-
(
|
|
147
|
+
(c) => c.key === t
|
|
147
148
|
);
|
|
148
149
|
return n.value[l] = {
|
|
149
150
|
...n.value[l],
|
|
@@ -153,13 +154,13 @@ const ue = (r, e, o) => {
|
|
|
153
154
|
return d(
|
|
154
155
|
() => n.value,
|
|
155
156
|
(t) => {
|
|
156
|
-
t.length &&
|
|
157
|
+
t.length && x(t);
|
|
157
158
|
},
|
|
158
159
|
{ deep: !0, immediate: !0 }
|
|
159
160
|
), {
|
|
160
|
-
basicTemplate:
|
|
161
|
+
basicTemplate: m,
|
|
161
162
|
customizeTemplateList: n,
|
|
162
|
-
syncTemplateListToStorage:
|
|
163
|
+
syncTemplateListToStorage: x,
|
|
163
164
|
addTemplate: F,
|
|
164
165
|
deleteTemplate: w,
|
|
165
166
|
updateTemplate: J
|
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { UploadOutlined as
|
|
3
|
-
import { message as
|
|
4
|
-
import { IconApAdLineDownload as
|
|
5
|
-
import { ApFilePreview as
|
|
1
|
+
import { defineComponent as ne, inject as s, ref as re, watch as ie, nextTick as le, createElementBlock as N, openBlock as g, normalizeClass as ce, unref as a, createVNode as h, withCtx as w, createElementVNode as D, createTextVNode as L, toDisplayString as U, withModifiers as ue, createCommentVNode as pe, createBlock as z, resolveDynamicComponent as B, createSlots as de } from "vue";
|
|
2
|
+
import { UploadOutlined as me } from "@ant-design/icons-vue";
|
|
3
|
+
import { message as d, Upload as fe, Button as we, Tooltip as ge } from "@aplus-frontend/antdv";
|
|
4
|
+
import { IconApAdLineDownload as he } from "@aplus-frontend/icon";
|
|
5
|
+
import { ApFilePreview as ve } from "../../ap-file-preview/index.mjs";
|
|
6
6
|
import "../../../config-provider/index.mjs";
|
|
7
|
-
import { randomStr as
|
|
8
|
-
import { useOss as
|
|
9
|
-
import
|
|
10
|
-
import { fileMatchesAccept as
|
|
11
|
-
import { getPath as
|
|
12
|
-
import { useGlobalConfig as
|
|
13
|
-
import { useLocale as
|
|
14
|
-
import { useNamespace as
|
|
15
|
-
const
|
|
7
|
+
import { randomStr as xe } from "../../../utils/index.mjs";
|
|
8
|
+
import { useOss as ye, getOssInstance as O } from "../hooks/useOss.mjs";
|
|
9
|
+
import ke from "../style/index.mjs";
|
|
10
|
+
import { fileMatchesAccept as be, getAcceptText as Ce } from "../utils/accept.mjs";
|
|
11
|
+
import { getPath as _e, getName as Ne, getReturnData as V } from "../utils/returnData.mjs";
|
|
12
|
+
import { useGlobalConfig as Ue } from "../../../config-provider/hooks/use-global-config.mjs";
|
|
13
|
+
import { useLocale as Ee } from "../../../config-provider/hooks/use-locale.mjs";
|
|
14
|
+
import { useNamespace as Fe } from "../../../config-provider/hooks/use-namespace.mjs";
|
|
15
|
+
const Ae = { class: "multiple-file-context" }, Te = { key: 0 }, Pe = { key: 1 }, He = /* @__PURE__ */ ne({
|
|
16
16
|
__name: "MultipleFile",
|
|
17
|
-
setup(
|
|
18
|
-
const E =
|
|
17
|
+
setup(Re, { expose: q }) {
|
|
18
|
+
const E = Ue(
|
|
19
19
|
"downloadCenterTriggerConfig"
|
|
20
|
-
), { t:
|
|
21
|
-
|
|
22
|
-
() =>
|
|
20
|
+
), { t: r } = Ee(), { b: j } = Fe("ap-upload-multiple-file"), $ = ke("ap-upload"), { put: G } = ye(), W = s("dirName"), H = s("baseDirName"), C = s("accept") || "*", F = s("maxSize") ?? 500, J = s("title") || r("ap.apUpload.uploadFile"), v = s("subTitle"), l = s("maxCount") ?? 10, m = s("uploadingCount"), A = s("beforeUpload"), T = s("customRequest"), x = s("getOssAccess"), K = s("maxSizeErrorMsg"), Q = s("maxCountErrorMsg"), X = s("acceptErrorMsg"), P = s("onRemove"), _ = s("showUploadErrorMsg"), R = s("bucket"), Y = s("showDownload") ?? !0, c = s("showPreview") ?? !0, i = s("value"), u = [], y = s("needName"), f = re(null);
|
|
21
|
+
ie(
|
|
22
|
+
() => i?.value,
|
|
23
23
|
function(e) {
|
|
24
|
-
!
|
|
24
|
+
!f?.value?.fileList?.length && e && I(e);
|
|
25
25
|
},
|
|
26
26
|
{ immediate: !0 }
|
|
27
27
|
);
|
|
28
28
|
function I(e) {
|
|
29
29
|
if (!e) {
|
|
30
|
-
|
|
30
|
+
p = [], f.value.fileList = [], i.value = void 0, u.splice(0, u.length);
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
le(() => {
|
|
34
34
|
const o = e.map((t) => {
|
|
35
|
-
const n =
|
|
35
|
+
const n = _e(y, t), M = Ne(y, t), b = new File(
|
|
36
36
|
[t],
|
|
37
37
|
M,
|
|
38
38
|
{}
|
|
39
39
|
);
|
|
40
|
-
return
|
|
40
|
+
return b.response = n, b.uid = xe(18), b.status = "done", b;
|
|
41
41
|
});
|
|
42
42
|
if (l && o.length > l) {
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
d.warning(
|
|
44
|
+
r("ap.apUpload.fileInitializationException", {
|
|
45
45
|
maxCount: l
|
|
46
46
|
})
|
|
47
47
|
);
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
50
|
o.forEach((t) => {
|
|
51
|
-
|
|
51
|
+
p.push(t), u.push({
|
|
52
52
|
uid: t.uid,
|
|
53
53
|
path: t.response
|
|
54
54
|
});
|
|
55
|
-
}),
|
|
55
|
+
}), f.value.fileList = o, i.value = e;
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
|
|
59
|
-
let
|
|
60
|
-
function
|
|
58
|
+
q({ setValue: I });
|
|
59
|
+
let p = [], S;
|
|
60
|
+
function k(e) {
|
|
61
61
|
setTimeout(() => {
|
|
62
|
-
const o =
|
|
62
|
+
const o = f.value.fileList.findIndex(
|
|
63
63
|
(t) => t.uid === e.uid
|
|
64
64
|
);
|
|
65
|
-
o >= 0 &&
|
|
65
|
+
o >= 0 && f.value.fileList.splice(o, 1);
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
async function
|
|
69
|
-
if (l && l > 1 &&
|
|
70
|
-
return clearTimeout(
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
async function Z(e) {
|
|
69
|
+
if (l && l > 1 && p.length >= l)
|
|
70
|
+
return clearTimeout(S), S = setTimeout(() => {
|
|
71
|
+
d.warning(
|
|
72
|
+
Q || r("ap.apUpload.maxUploadFiles", {
|
|
73
73
|
maxCount: l
|
|
74
74
|
})
|
|
75
75
|
);
|
|
76
|
-
}),
|
|
77
|
-
if (e.size >
|
|
78
|
-
return
|
|
79
|
-
|
|
80
|
-
maxSize:
|
|
76
|
+
}), k(e), !1;
|
|
77
|
+
if (e.size > F * 1024 * 1024)
|
|
78
|
+
return d.warning(
|
|
79
|
+
K || r("ap.apUpload.maxUploadFileSize", {
|
|
80
|
+
maxSize: F
|
|
81
81
|
})
|
|
82
|
-
),
|
|
83
|
-
if (!
|
|
84
|
-
return
|
|
85
|
-
|
|
86
|
-
),
|
|
87
|
-
if (typeof
|
|
88
|
-
return
|
|
89
|
-
l && l === 1 && (
|
|
82
|
+
), k(e), !1;
|
|
83
|
+
if (!be(e, C))
|
|
84
|
+
return d.warning(
|
|
85
|
+
X || r("ap.apUpload.fileFormatNotSupported")
|
|
86
|
+
), k(e), !1;
|
|
87
|
+
if (typeof A == "function" && await A(e) === !1)
|
|
88
|
+
return k(e), !1;
|
|
89
|
+
l && l === 1 && (p = [], i.value = void 0), p.push(e);
|
|
90
90
|
}
|
|
91
|
-
async function
|
|
92
|
-
if (m.value++, typeof
|
|
93
|
-
|
|
91
|
+
async function ee(e) {
|
|
92
|
+
if (m.value++, typeof T == "function") {
|
|
93
|
+
T({
|
|
94
94
|
onProgress: (o) => {
|
|
95
95
|
setTimeout(() => {
|
|
96
96
|
e.onProgress({
|
|
@@ -99,7 +99,7 @@ const Ee = { class: "multiple-file-context" }, _e = { key: 0 }, Fe = { key: 1 },
|
|
|
99
99
|
});
|
|
100
100
|
},
|
|
101
101
|
onError: (o) => {
|
|
102
|
-
|
|
102
|
+
_ && d.warning(o || r("ap.apUpload.networkAnomaly")), setTimeout(() => {
|
|
103
103
|
e.onError({
|
|
104
104
|
name: o,
|
|
105
105
|
message: o
|
|
@@ -109,10 +109,10 @@ const Ee = { class: "multiple-file-context" }, _e = { key: 0 }, Fe = { key: 1 },
|
|
|
109
109
|
onSuccess: (o) => {
|
|
110
110
|
setTimeout(() => {
|
|
111
111
|
e.onSuccess(o);
|
|
112
|
-
}),
|
|
113
|
-
...
|
|
114
|
-
|
|
115
|
-
],
|
|
112
|
+
}), i.value = [
|
|
113
|
+
...i.value || [],
|
|
114
|
+
V(y, o, e.file.name)
|
|
115
|
+
], u.push({
|
|
116
116
|
uid: e.file.uid,
|
|
117
117
|
path: o
|
|
118
118
|
}), m.value--;
|
|
@@ -122,22 +122,22 @@ const Ee = { class: "multiple-file-context" }, _e = { key: 0 }, Fe = { key: 1 },
|
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
124
|
try {
|
|
125
|
-
const o = await (
|
|
126
|
-
e.file.oss = t,
|
|
125
|
+
const o = await (R ? x(R) : x()), t = await O(async () => o);
|
|
126
|
+
e.file.oss = t, G({
|
|
127
127
|
file: e.file,
|
|
128
|
-
dirName:
|
|
128
|
+
dirName: W,
|
|
129
129
|
oss: t,
|
|
130
130
|
successCallBack(n) {
|
|
131
|
-
e.onSuccess(n),
|
|
132
|
-
...
|
|
133
|
-
|
|
134
|
-
],
|
|
131
|
+
e.onSuccess(n), i.value = [
|
|
132
|
+
...i.value || [],
|
|
133
|
+
V(y, n, e.file.name)
|
|
134
|
+
], u.push({
|
|
135
135
|
uid: e.file.uid,
|
|
136
136
|
path: n
|
|
137
137
|
}), m.value--;
|
|
138
138
|
},
|
|
139
139
|
errorCallBack(n) {
|
|
140
|
-
|
|
140
|
+
_ && d.warning(n || r("ap.apUpload.networkAnomaly")), e.onError({
|
|
141
141
|
name: n,
|
|
142
142
|
message: n
|
|
143
143
|
}), m.value--;
|
|
@@ -147,32 +147,32 @@ const Ee = { class: "multiple-file-context" }, _e = { key: 0 }, Fe = { key: 1 },
|
|
|
147
147
|
percent: n
|
|
148
148
|
});
|
|
149
149
|
},
|
|
150
|
-
baseDirName:
|
|
150
|
+
baseDirName: H,
|
|
151
151
|
bucket: o?.bucket
|
|
152
152
|
});
|
|
153
153
|
} catch (o) {
|
|
154
|
-
|
|
155
|
-
typeof o?.message == "string" ? o.message :
|
|
154
|
+
_ && d.warning(
|
|
155
|
+
typeof o?.message == "string" ? o.message : r("ap.apUpload.networkAnomaly")
|
|
156
156
|
), e.onError({
|
|
157
|
-
name: o?.message ||
|
|
158
|
-
message: o?.message ||
|
|
157
|
+
name: o?.message || r("ap.apUpload.networkAnomaly"),
|
|
158
|
+
message: o?.message || r("ap.apUpload.networkAnomaly")
|
|
159
159
|
}), m.value--;
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function oe(e) {
|
|
163
163
|
if (P && P?.(e), e.response) {
|
|
164
|
-
if (Array.isArray(
|
|
165
|
-
const t =
|
|
166
|
-
t >= 0 && (
|
|
164
|
+
if (Array.isArray(i.value)) {
|
|
165
|
+
const t = u.findIndex((n) => n.uid === e.uid);
|
|
166
|
+
t >= 0 && (i?.value.splice(t, 1), u.splice(t, 1)), i.value.length === 0 && (i.value = void 0);
|
|
167
167
|
}
|
|
168
168
|
} else
|
|
169
169
|
e?.oss?.pauseUpload();
|
|
170
|
-
const o =
|
|
170
|
+
const o = p.findIndex(
|
|
171
171
|
(t) => t.uid === e.uid
|
|
172
172
|
);
|
|
173
|
-
return
|
|
173
|
+
return p.splice(o, 1), Promise.resolve(!0);
|
|
174
174
|
}
|
|
175
|
-
const
|
|
175
|
+
const te = async (e) => {
|
|
176
176
|
if (E.value?.trigger) {
|
|
177
177
|
let o = [e].map((t) => ({
|
|
178
178
|
objectName: t.response,
|
|
@@ -181,8 +181,8 @@ const Ee = { class: "multiple-file-context" }, _e = { key: 0 }, Fe = { key: 1 },
|
|
|
181
181
|
E.value?.trigger?.(o);
|
|
182
182
|
} else {
|
|
183
183
|
const o = e.response?.match(/^([^:]+):(.*)$/), t = o?.[1], n = o?.[2] ?? e.response;
|
|
184
|
-
(await
|
|
185
|
-
() => t ?
|
|
184
|
+
(await O(
|
|
185
|
+
() => t ? x?.(t) : x?.()
|
|
186
186
|
)).downloadFile([
|
|
187
187
|
{
|
|
188
188
|
path: n,
|
|
@@ -190,22 +190,22 @@ const Ee = { class: "multiple-file-context" }, _e = { key: 0 }, Fe = { key: 1 },
|
|
|
190
190
|
}
|
|
191
191
|
]);
|
|
192
192
|
}
|
|
193
|
-
},
|
|
194
|
-
(typeof
|
|
193
|
+
}, se = (e) => {
|
|
194
|
+
(typeof c == "function" ? c(e) : c) && ve.createFilePreviewModal({
|
|
195
195
|
src: e.response,
|
|
196
196
|
fileName: e.name
|
|
197
197
|
});
|
|
198
|
-
};
|
|
199
|
-
return (e, o) => (
|
|
200
|
-
class:
|
|
201
|
-
[a(
|
|
202
|
-
[a(
|
|
198
|
+
}, ae = (e) => (typeof c == "function" ? c(e) : c) ? ["done"].includes(e.status) : !1;
|
|
199
|
+
return (e, o) => (g(), N("div", {
|
|
200
|
+
class: ce({
|
|
201
|
+
[a(j)()]: !0,
|
|
202
|
+
[a($) ?? ""]: !0
|
|
203
203
|
})
|
|
204
204
|
}, [
|
|
205
|
-
|
|
205
|
+
h(a(fe), {
|
|
206
206
|
ref_key: "uploadRef",
|
|
207
|
-
ref:
|
|
208
|
-
accept: a(
|
|
207
|
+
ref: f,
|
|
208
|
+
accept: a(C),
|
|
209
209
|
multiple: "",
|
|
210
210
|
"max-count": a(l),
|
|
211
211
|
progress: {
|
|
@@ -213,37 +213,53 @@ const Ee = { class: "multiple-file-context" }, _e = { key: 0 }, Fe = { key: 1 },
|
|
|
213
213
|
showInfo: !1,
|
|
214
214
|
strokeColor: "#0070FF"
|
|
215
215
|
},
|
|
216
|
-
"before-upload":
|
|
217
|
-
"custom-request":
|
|
216
|
+
"before-upload": Z,
|
|
217
|
+
"custom-request": ee,
|
|
218
218
|
"show-upload-list": {
|
|
219
|
-
showDownloadIcon: a(
|
|
219
|
+
showDownloadIcon: a(Y),
|
|
220
220
|
showRemoveIcon: !0,
|
|
221
|
-
showPreviewIcon: a(
|
|
221
|
+
showPreviewIcon: a(c)
|
|
222
222
|
},
|
|
223
|
-
onPreview:
|
|
224
|
-
onRemove:
|
|
225
|
-
onDownload:
|
|
223
|
+
onPreview: se,
|
|
224
|
+
onRemove: oe,
|
|
225
|
+
onDownload: te
|
|
226
226
|
}, {
|
|
227
|
-
downloadIcon:
|
|
228
|
-
|
|
227
|
+
downloadIcon: w(() => [
|
|
228
|
+
h(a(he), { class: "anticon anticon-vertical-align-bottom" })
|
|
229
229
|
]),
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
230
|
+
itemRender: w(({ originNode: t, file: n }) => [
|
|
231
|
+
h(a(ge), null, de({
|
|
232
|
+
default: w(() => [
|
|
233
|
+
(g(), z(B(t)))
|
|
234
|
+
]),
|
|
235
|
+
_: 2
|
|
236
|
+
}, [
|
|
237
|
+
ae(n) ? {
|
|
238
|
+
name: "title",
|
|
239
|
+
fn: w(() => [
|
|
240
|
+
L(U(a(r)("ap.apAppendix.previewFile")), 1)
|
|
241
|
+
]),
|
|
242
|
+
key: "0"
|
|
243
|
+
} : void 0
|
|
244
|
+
]), 1024)
|
|
245
|
+
]),
|
|
246
|
+
default: w(() => [
|
|
247
|
+
D("div", Ae, [
|
|
248
|
+
h(a(we), { class: "file-btn" }, {
|
|
249
|
+
default: w(() => [
|
|
250
|
+
h(a(me)),
|
|
251
|
+
L(" " + U(a(J)), 1)
|
|
236
252
|
]),
|
|
237
253
|
_: 1
|
|
238
254
|
}),
|
|
239
|
-
|
|
255
|
+
D("div", {
|
|
240
256
|
class: "sub-title",
|
|
241
|
-
onClick: o[0] || (o[0] =
|
|
257
|
+
onClick: o[0] || (o[0] = ue(() => {
|
|
242
258
|
}, ["stop"]))
|
|
243
259
|
}, [
|
|
244
|
-
typeof a(
|
|
245
|
-
(
|
|
246
|
-
])) :
|
|
260
|
+
typeof a(v) == "string" ? (g(), N("div", Te, U(a(v) || `${a(r)("ap.apUpload.supportExtension")}:${a(Ce)(a(C))}`), 1)) : a(v) ? (g(), N("div", Pe, [
|
|
261
|
+
(g(), z(B(a(v))))
|
|
262
|
+
])) : pe("", !0)
|
|
247
263
|
])
|
|
248
264
|
])
|
|
249
265
|
]),
|
|
@@ -253,5 +269,5 @@ const Ee = { class: "multiple-file-context" }, _e = { key: 0 }, Fe = { key: 1 },
|
|
|
253
269
|
}
|
|
254
270
|
});
|
|
255
271
|
export {
|
|
256
|
-
|
|
272
|
+
He as default
|
|
257
273
|
};
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.19.
|
|
1
|
+
declare const _default: "7.19.1";
|
|
2
2
|
export default _default;
|
package/es/src/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),u=require("lodash-unified"),y=require("../../ap-form/index.js"),k=require("../../ap-form/context.js"),A=require("../../ap-form/hooks/use-watch.js"),z=require("../../ap-form/utils/get.js"),H=require("../../ap-form/utils/transform.js");require("../../config-provider/index.js");const L=require("../hooks/use-editable-columns.js"),G=require("../hooks/use-editable-form-item-api.js");require("../index.vue2.js");const W=require("../style/editable.js"),U=require("../utils.js"),c=require("./utils.js"),$=require("../../config-provider/hooks/use-namespace.js"),J=require("../../config-provider/hooks/use-global-config.js"),Q=require("../index.vue.js"),X=o.defineComponent({name:"EditableGrid",__name:"form-item",props:{dropdownPrefixCls:{},bordered:{type:Boolean},locale:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{},showSorterTooltip:{type:[Boolean,Object]},prefixCls:{},rowKey:{type:[String,Function],default:"key"},tableLayout:{},title:{},id:{},showHeader:{type:Boolean},components:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean]},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean},indentSize:{},expandIconColumnIndex:{},showExpandColumn:{type:Boolean},expandedRowClassName:{},childrenColumnName:{},rowExpandable:{},transformCellText:{},rowHoverable:{type:Boolean},rowSelection:{type:[Boolean,Object]},onLoadingChange:{},onShownColumnsChange:{},pagination:{type:[Boolean,Object],default:!1},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},tableStyle:{},adaptive:{type:Boolean},columnResizable:{type:Boolean,default:!1},loading:{type:Boolean,default:void 0},summary:{},rowHeight:{default:66},getRowHeight:{},advanceRenderer:{type:Boolean},browserTooltips:{type:Boolean},virtual:{type:[Boolean,Object],default:void 0},onRowClicked:{},onScrollEnd:{},rowClassName:{},rowClassRules:{},autoHeight:{type:Boolean},onUpdate:{},customRow:{},theme:{},emptyComponent:{},emptyText:{},onColumnResized:{},animateRows:{type:Boolean},plugins:{},columns:{},defaultValue:{},onChange:{},maxLength:{},onFieldChange:{},label:{},name:{},formItem:{}},setup(h,{expose:b}){const C=o.useSlots(),a=h,{b:R}=$.useNamespace("editable-aggrid"),v=W.default("editable-aggrid"),d=o.ref(),{internalInstance:l}=k.useInjectForm();function x(e){const t=c.getColumnTransformOptions(a.columns||[]);if(!Object.keys(t).length||!e?.length)return e;let n=[];for(const i of e)n.push(H.transformValues(i,t));return n}const s=U.getShadowName(a.name);let f=[];o.onMounted(()=>{const e=a.formItem?.initialValue??z.getModelValue(l?.getInitialValues()??{},a.name);e&&(l?.updateInitialModel(s,c.arrayToObject(u.cloneDeep(e),a.rowKey)),f=u.cloneDeep(e),r.value||F(u.cloneDeep(e),"suffix",!0))});const r=o.ref([]),B=A.useWatch(a.name);o.watch(()=>B.value,e=>{u.isEqual(e,r.value)||g(e??u.cloneDeep(f))},{deep:!0,flush:"post",immediate:!0});const S=J.useGlobalConfig("valueTypeMap"),q=L.useGetEditableColumns(a,S,s),{add:I,addMultiple:_,__addMultiple:F,remove:T,removeByKey:E,getRowData:N,getRowsData:V,setRowData:j,clear:D,refreshRowIds:m}=G.useEditableFormItemApi(a,l,r,s);function O(){const e=d.value?._internalGridApi;if(!m.value?.length||!e)return;const t=m.value.map(n=>e.getRowNode(n)).filter(n=>!!n);e.refreshCells({rowNodes:t,force:!0}),m.value=[]}function g(e){r.value=[...e];const t=c.arrayToObject(e,a.rowKey);l?.setFieldValue(a.name,[...e]),l?.setFieldValue(s,t)}function w(e,t){const n=e==="end"?r.value.length-1:e;d.value?.scrollToRow(n,t)}function K(e,t){d.value?.scrollToColumn(e,t)}function M(e,t){const n=[s,String(e),t].flat();return l?.validateFields([n])}function P(e){const n=o.unref(r).map((i,p)=>[s,String(c.getRowKey(i,p,a.rowKey)),e].flat());return l?.validateFields(n)}return b({add:I,addMultiple:_,remove:T,removeByKey:E,getRowData:N,getRowsData:V,setRowData:j,clear:D,setTableData:g,scrollTo:w,scrollToRow:w,scrollToColumn:K,validateCell:M,validateColumn:P,table:d}),(e,t)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(o.unref(y.ApForm).FormItem,{hidden:"",name:e.name,"initial-value":e.formItem?.initialValue,transform:x},null,8,["name","initial-value"]),o.createVNode(o.unref(y.ApForm).FormItem,o.mergeProps({label:e.label},e.formItem),{default:o.withCtx(()=>[o.createVNode(Q.default,o.mergeProps(o.unref(u.omit)(a,["name","maxLength","onChange","defaultValue","formItem"]),{ref_key:"tableRef",ref:d,class:[o.unref(R)(),o.unref(v)],size:"mini",columns:o.unref(q),"data-source":r.value,"search-form":!1,onUpdate:O}),o.createSlots({_:2},[o.renderList(C,(n,i)=>({name:i,fn:o.withCtx(p=>[o.renderSlot(e.$slots,i,o.normalizeProps(o.guardReactiveProps(p||{})))])}))]),1040,["class","columns","data-source"])]),_:3},16,["label"])],64))}});exports.default=X;
|
|
@@ -87,7 +87,21 @@ export type EditableAgGridExpose<RecordType = any, ModelType = RecordType[]> = O
|
|
|
87
87
|
validateFieldsReturnTransformed: EditableTableExpose<ModelType, RecordType>['validateFields'];
|
|
88
88
|
table: AgGridExpose;
|
|
89
89
|
};
|
|
90
|
-
export type EditableAgGridFormItemExpose<RecordType = any, ModelType = RecordType[]> = Omit<EditableAgGridExpose<RecordType, ModelType>, 'resetFields' | 'validateFields' | 'validateFieldsReturnTransformed'
|
|
90
|
+
export type EditableAgGridFormItemExpose<RecordType = any, ModelType = RecordType[]> = Omit<EditableAgGridExpose<RecordType, ModelType>, 'resetFields' | 'validateFields' | 'validateFieldsReturnTransformed'> & {
|
|
91
|
+
/**
|
|
92
|
+
* 校验单元格
|
|
93
|
+
* @param rowId 行唯一标识
|
|
94
|
+
* @param field 字段
|
|
95
|
+
* @returns
|
|
96
|
+
*/
|
|
97
|
+
validateCell: (rowId: any, field: NamePath) => any;
|
|
98
|
+
/**
|
|
99
|
+
* 校验列
|
|
100
|
+
* @param colKey 列唯一标识
|
|
101
|
+
* @returns
|
|
102
|
+
*/
|
|
103
|
+
validateColumn: (colKey: string | number) => any;
|
|
104
|
+
};
|
|
91
105
|
export type EditableAgGridFormItemProps<RecordType = any> = Omit<EditableAgGridProps<RecordType>, 'name' | 'value' | 'onUpdate:value'> & {
|
|
92
106
|
label?: string;
|
|
93
107
|
/**
|