@aplus-frontend/ui 0.4.13 → 0.4.15
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/index.mjs +84 -80
- package/es/src/ap-descriptions/help-message/index.vue2.mjs +17 -12
- package/es/src/ap-field/date/helper.mjs +9 -9
- package/es/src/ap-table/ap-table.vue2.mjs +206 -181
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +62 -62
- package/es/src/ap-upload/apUpload.vue.d.ts +9 -0
- package/es/src/ap-upload/apUpload.vue.mjs +22 -18
- package/es/src/ap-upload/components/MultipleFile.vue2.mjs +66 -66
- package/es/src/ap-upload/components/Picture.vue2.mjs +82 -82
- package/es/src/ap-upload/components/SingleFile.vue2.mjs +114 -114
- package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +79 -67
- package/es/src/config-provider/config-provider.d.ts +3 -0
- package/es/src/config-provider/css-var.d.ts +3 -0
- package/es/src/config-provider/css-var.mjs +21 -14
- package/es/src/config-provider/index.d.ts +15 -0
- package/es/src/hooks/index.d.ts +1 -0
- package/es/src/hooks/index.mjs +6 -4
- package/es/src/hooks/useResize.d.ts +8 -0
- package/es/src/hooks/useResize.mjs +23 -0
- package/es/src/index.d.ts +1 -0
- package/es/src/index.mjs +212 -209
- package/es/src/path-map.mjs +2 -1
- package/es/src/resize-observer/index.d.ts +3 -0
- package/es/src/resize-observer/index.mjs +2 -0
- package/es/src/resize-observer/index.vue.d.ts +25 -0
- package/es/src/resize-observer/index.vue.mjs +45 -0
- package/es/src/resize-observer/index.vue2.mjs +4 -0
- package/es/src/resize-observer/interface.d.ts +27 -0
- package/es/src/resize-observer/interface.mjs +1 -0
- package/es/src/resize-observer/style/css.d.ts +1 -0
- package/es/src/resize-observer/style/css.js +1 -0
- package/es/src/resize-observer/style/index.d.ts +1 -0
- package/es/src/resize-observer/style/index.js +1 -0
- package/es/src/scroll-bar/index.vue.d.ts +1 -0
- package/es/src/scroll-bar/index.vue.mjs +31 -30
- package/es/src/scroll-bar/interface.d.ts +3 -1
- package/es/src/theme/antd-global-overwrite/admin/index.css +24 -2
- package/es/src/theme/antd-global-overwrite/admin/table.css +24 -2
- package/es/src/theme/antd-global-overwrite/aplus/index.css +24 -2
- package/es/src/theme/antd-global-overwrite/aplus/table.css +24 -2
- package/es/src/utils/index.d.ts +1 -0
- package/es/src/utils/index.mjs +40 -30
- package/lib/index.js +1 -1
- package/lib/src/ap-descriptions/help-message/index.vue2.js +1 -1
- package/lib/src/ap-field/date/helper.js +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/ap-upload/apUpload.vue.d.ts +9 -0
- package/lib/src/ap-upload/apUpload.vue.js +1 -1
- package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
- package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
- package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
- package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +3 -0
- package/lib/src/config-provider/css-var.d.ts +3 -0
- package/lib/src/config-provider/css-var.js +1 -1
- package/lib/src/config-provider/index.d.ts +15 -0
- package/lib/src/hooks/index.d.ts +1 -0
- package/lib/src/hooks/index.js +1 -1
- package/lib/src/hooks/useResize.d.ts +8 -0
- package/lib/src/hooks/useResize.js +1 -0
- package/lib/src/index.d.ts +1 -0
- package/lib/src/index.js +1 -1
- package/lib/src/path-map.js +1 -1
- package/lib/src/resize-observer/index.d.ts +3 -0
- package/lib/src/resize-observer/index.js +1 -0
- package/lib/src/resize-observer/index.vue.d.ts +25 -0
- package/lib/src/resize-observer/index.vue.js +1 -0
- package/lib/src/resize-observer/index.vue2.js +1 -0
- package/lib/src/resize-observer/interface.d.ts +27 -0
- package/lib/src/resize-observer/interface.js +1 -0
- package/lib/src/resize-observer/style/css.cjs +1 -0
- package/lib/src/resize-observer/style/css.d.ts +1 -0
- package/lib/src/resize-observer/style/index.cjs +1 -0
- package/lib/src/resize-observer/style/index.d.ts +1 -0
- package/lib/src/scroll-bar/index.vue.d.ts +1 -0
- package/lib/src/scroll-bar/index.vue.js +1 -1
- package/lib/src/scroll-bar/interface.d.ts +3 -1
- package/lib/src/theme/antd-global-overwrite/admin/index.css +24 -2
- package/lib/src/theme/antd-global-overwrite/admin/table.css +24 -2
- package/lib/src/theme/antd-global-overwrite/aplus/index.css +24 -2
- package/lib/src/theme/antd-global-overwrite/aplus/table.css +24 -2
- package/lib/src/utils/index.d.ts +1 -0
- package/lib/src/utils/index.js +1 -1
- package/package.json +3 -3
- package/theme/antd-global-overwrite/admin/index.css +24 -2
- package/theme/antd-global-overwrite/admin/table.css +24 -2
- package/theme/antd-global-overwrite/admin/table.less +8 -2
- package/theme/antd-global-overwrite/aplus/index.css +24 -2
- package/theme/antd-global-overwrite/aplus/table.css +24 -2
- package/theme/antd-global-overwrite/aplus/table.less +7 -2
- package/theme/ap-descriptions/ap-descriptions.css +3 -0
- package/theme/ap-descriptions/ap-descriptions.less +7 -0
- package/theme/ap-table/ap-table.css +8 -1
- package/theme/ap-table/ap-table.less +11 -9
- package/theme/ap-table-modal/index.css +8 -1
- package/theme/index.css +11 -1
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as oe, inject as o, ref as _, watch as le, computed as se, openBlock as k, createElementBlock as z, normalizeClass as re, unref as a, createElementVNode as i, toDisplayString as A, createCommentVNode as b, normalizeStyle as ie, createBlock as ce, withModifiers as ue, createVNode as pe } from "vue";
|
|
2
2
|
import "../../config-provider/index.mjs";
|
|
3
|
-
import { getName as
|
|
4
|
-
import { useOss as
|
|
5
|
-
import { fileMatchesAccept as
|
|
6
|
-
import { message as u, Progress as
|
|
7
|
-
import { DeleteOutlined as
|
|
8
|
-
import
|
|
9
|
-
import { useLocale as
|
|
10
|
-
import { useNamespace as
|
|
11
|
-
const
|
|
3
|
+
import { getName as ve, getReturnData as I } from "../utils/returnData.mjs";
|
|
4
|
+
import { useOss as de, useOssInit as fe } from "../hooks/useOss.mjs";
|
|
5
|
+
import { fileMatchesAccept as me, getAcceptText as ge } from "../utils/accept.mjs";
|
|
6
|
+
import { message as u, Progress as he } from "@aplus-frontend/antdv";
|
|
7
|
+
import { DeleteOutlined as _e } from "@ant-design/icons-vue";
|
|
8
|
+
import j from "../assets/single-file-icon.png.mjs";
|
|
9
|
+
import { useLocale as ke } from "../../config-provider/hooks/use-locale.mjs";
|
|
10
|
+
import { useNamespace as ye } from "../../config-provider/hooks/use-namespace.mjs";
|
|
11
|
+
const we = ["accept"], De = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "state-un"
|
|
14
|
-
},
|
|
14
|
+
}, Ue = ["src"], Fe = { class: "state-un-title" }, Ce = { class: "state-un-subtitle" }, Ee = {
|
|
15
15
|
key: 1,
|
|
16
16
|
class: "state-ing"
|
|
17
|
-
},
|
|
17
|
+
}, Se = { class: "left" }, Ne = ["src"], xe = { class: "center" }, ze = { class: "center-progress" }, Ie = /* @__PURE__ */ oe({
|
|
18
18
|
__name: "SingleFile",
|
|
19
|
-
setup(
|
|
20
|
-
const { t: r } =
|
|
21
|
-
|
|
22
|
-
() =>
|
|
19
|
+
setup(Ae, { expose: G }) {
|
|
20
|
+
const { t: r } = ke(), { b: y } = ye("ap-upload-single-file"), { put: W, client: B } = de(), w = o("theme"), H = o("dirName"), D = o("accept") || "*", U = o("maxSize") ?? 500, J = o("title") || r("ap.apUpload.clickOrDragUpload"), F = o("subTitle"), l = o("value"), C = o("needName"), p = o("uploadingCount"), R = o("beforeUpload"), M = o("customRequest"), K = o("getOssAccess"), Q = o("maxSizeErrorMsg"), X = o("acceptErrorMsg"), f = o("onRemove"), n = _(null);
|
|
21
|
+
le(
|
|
22
|
+
() => l == null ? void 0 : l.value,
|
|
23
23
|
function(e) {
|
|
24
|
-
|
|
24
|
+
n.value === null && e && O(e);
|
|
25
25
|
},
|
|
26
26
|
{ immediate: !0 }
|
|
27
27
|
);
|
|
28
|
-
function
|
|
28
|
+
function O(e) {
|
|
29
29
|
e ? setTimeout(() => {
|
|
30
|
-
const t =
|
|
31
|
-
|
|
32
|
-
}) : (
|
|
30
|
+
const t = ve(C, e);
|
|
31
|
+
s.value = 3, n.value = new File([e], t, {}), l.value = e;
|
|
32
|
+
}) : (s.value = 1, n.value = null, l.value = void 0);
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
function
|
|
34
|
+
G({ setValue: O });
|
|
35
|
+
const s = _(1), m = _(0), g = _(null), P = se(() => n.value && (l == null ? void 0 : l.value));
|
|
36
|
+
function Y() {
|
|
37
37
|
var e;
|
|
38
|
-
|
|
38
|
+
s.value === 1 && ((e = g.value) == null || e.click());
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function T(e) {
|
|
41
41
|
e.preventDefault(), e.stopPropagation();
|
|
42
42
|
}
|
|
43
|
-
function Y(e) {
|
|
44
|
-
e.dataTransfer.dropEffect = "copy", e.preventDefault(), e.stopPropagation();
|
|
45
|
-
}
|
|
46
43
|
function Z(e) {
|
|
47
|
-
|
|
44
|
+
e.dataTransfer.dropEffect = "copy", e.preventDefault(), e.stopPropagation();
|
|
48
45
|
}
|
|
49
46
|
function V(e) {
|
|
50
|
-
|
|
47
|
+
L(e);
|
|
48
|
+
}
|
|
49
|
+
function ee(e) {
|
|
50
|
+
if (e.preventDefault(), e.stopPropagation(), s.value !== 1)
|
|
51
51
|
return;
|
|
52
|
-
var t = e.dataTransfer, c = [],
|
|
52
|
+
var t = e.dataTransfer, c = [], $ = 0, q = t.files.length;
|
|
53
53
|
function v() {
|
|
54
|
-
|
|
54
|
+
$ === q - 1 && V(c), $++;
|
|
55
55
|
}
|
|
56
56
|
if (t.items !== void 0)
|
|
57
|
-
for (var
|
|
58
|
-
var
|
|
59
|
-
if (
|
|
60
|
-
var
|
|
61
|
-
c.push(
|
|
57
|
+
for (var E = 0; E < t.items.length; E++) {
|
|
58
|
+
var S = t.items[E];
|
|
59
|
+
if (S.kind === "file" && S.webkitGetAsEntry().isFile) {
|
|
60
|
+
var ne = S.getAsFile();
|
|
61
|
+
c.push(ne), v();
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
else
|
|
65
|
-
for (let
|
|
66
|
-
var
|
|
67
|
-
if (
|
|
68
|
-
c.push(
|
|
65
|
+
for (let x = 0; x < q; x++) {
|
|
66
|
+
var h = t.files[x];
|
|
67
|
+
if (h.type)
|
|
68
|
+
c.push(h), v();
|
|
69
69
|
else
|
|
70
70
|
try {
|
|
71
|
-
var
|
|
72
|
-
|
|
71
|
+
var N = new FileReader();
|
|
72
|
+
N.readAsDataURL(h.slice(0, 3)), N.addEventListener(
|
|
73
73
|
"load",
|
|
74
74
|
function(d) {
|
|
75
|
-
console.warn(d, "load"), c.push(
|
|
75
|
+
console.warn(d, "load"), c.push(h), v();
|
|
76
76
|
},
|
|
77
77
|
!1
|
|
78
|
-
),
|
|
78
|
+
), N.addEventListener(
|
|
79
79
|
"error",
|
|
80
80
|
function(d) {
|
|
81
81
|
console.warn(d, "error"), u.warning(r("ap.apUpload.foldersNotSupported")), v();
|
|
@@ -87,143 +87,143 @@ const ye = ["accept"], we = {
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
async function
|
|
90
|
+
async function te(e) {
|
|
91
91
|
const t = e.target;
|
|
92
|
-
await
|
|
92
|
+
await L(t == null ? void 0 : t.files), g.value && (g.value.value = "");
|
|
93
93
|
}
|
|
94
|
-
async function
|
|
94
|
+
async function L(e) {
|
|
95
95
|
if (e != null && e.length) {
|
|
96
|
-
if (e[0].size >
|
|
96
|
+
if (e[0].size > U * 1024 * 1024) {
|
|
97
97
|
u.warning(
|
|
98
|
-
|
|
99
|
-
maxSize:
|
|
98
|
+
Q || r("ap.apUpload.maxUploadFileSize", {
|
|
99
|
+
maxSize: U
|
|
100
100
|
})
|
|
101
101
|
);
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
|
-
if (!
|
|
104
|
+
if (!me(e[0], D)) {
|
|
105
105
|
u.warning(
|
|
106
|
-
|
|
106
|
+
X || r("ap.apUpload.fileFormatNotSupported")
|
|
107
107
|
);
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
if (typeof
|
|
110
|
+
if (typeof R == "function" && await R(e[0]) === !1)
|
|
111
111
|
return;
|
|
112
|
-
if (
|
|
113
|
-
|
|
112
|
+
if (n.value = e[0], s.value = 2, m.value = 0, p.value++, typeof M == "function") {
|
|
113
|
+
M({
|
|
114
114
|
onProgress: (t) => {
|
|
115
|
-
|
|
115
|
+
m.value = t;
|
|
116
116
|
},
|
|
117
117
|
onError: (t) => {
|
|
118
|
-
u.warning(t || r("ap.apUpload.networkAnomaly")),
|
|
118
|
+
u.warning(t || r("ap.apUpload.networkAnomaly")), s.value = 1, n.value = null, p.value--;
|
|
119
119
|
},
|
|
120
120
|
onSuccess: (t) => {
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
l.value = I(
|
|
122
|
+
C,
|
|
123
123
|
t,
|
|
124
|
-
|
|
125
|
-
),
|
|
124
|
+
n.value.name
|
|
125
|
+
), s.value = 3, p.value--;
|
|
126
126
|
},
|
|
127
127
|
file: e[0]
|
|
128
128
|
});
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
131
|
try {
|
|
132
|
-
await
|
|
133
|
-
file:
|
|
134
|
-
dirName:
|
|
135
|
-
oss:
|
|
132
|
+
await fe(K), W({
|
|
133
|
+
file: n.value,
|
|
134
|
+
dirName: H,
|
|
135
|
+
oss: B,
|
|
136
136
|
successCallBack(t) {
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
l.value = I(
|
|
138
|
+
C,
|
|
139
139
|
t,
|
|
140
|
-
|
|
141
|
-
),
|
|
140
|
+
n.value.name
|
|
141
|
+
), s.value = 3, p.value--;
|
|
142
142
|
},
|
|
143
143
|
errorCallBack(t) {
|
|
144
|
-
u.warning(t || r("ap.apUpload.networkAnomaly")),
|
|
144
|
+
u.warning(t || r("ap.apUpload.networkAnomaly")), s.value = 1, n.value = null, p.value--;
|
|
145
145
|
},
|
|
146
146
|
progressCallBack(t) {
|
|
147
|
-
|
|
147
|
+
m.value = t;
|
|
148
148
|
}
|
|
149
149
|
});
|
|
150
150
|
} catch (t) {
|
|
151
151
|
u.warning(
|
|
152
152
|
typeof (t == null ? void 0 : t.message) == "string" ? t.message : r("ap.apUpload.networkAnomaly")
|
|
153
|
-
),
|
|
153
|
+
), s.value = 1, n.value = null, p.value--;
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
function
|
|
158
|
-
|
|
157
|
+
function ae() {
|
|
158
|
+
f && (f == null || f(n.value)), n.value && !(l != null && l.value) && B.pauseUpload(), s.value = 1, n.value = null, l.value = void 0;
|
|
159
159
|
}
|
|
160
160
|
return (e, t) => {
|
|
161
161
|
var c;
|
|
162
|
-
return
|
|
163
|
-
class:
|
|
164
|
-
[a(
|
|
165
|
-
[a(
|
|
166
|
-
[a(
|
|
162
|
+
return k(), z("div", {
|
|
163
|
+
class: re({
|
|
164
|
+
[a(y)()]: !0,
|
|
165
|
+
[a(y)("admin")]: a(w) === "admin",
|
|
166
|
+
[a(y)("un")]: s.value === 1
|
|
167
167
|
}),
|
|
168
|
-
onClick:
|
|
169
|
-
onDragenter:
|
|
170
|
-
onDragover:
|
|
171
|
-
onDragleave:
|
|
172
|
-
onDrop:
|
|
168
|
+
onClick: Y,
|
|
169
|
+
onDragenter: T,
|
|
170
|
+
onDragover: Z,
|
|
171
|
+
onDragleave: T,
|
|
172
|
+
onDrop: ee
|
|
173
173
|
}, [
|
|
174
174
|
i("input", {
|
|
175
175
|
ref_key: "fileRef",
|
|
176
|
-
ref:
|
|
176
|
+
ref: g,
|
|
177
177
|
style: { display: "none" },
|
|
178
178
|
type: "file",
|
|
179
|
-
accept: a(
|
|
180
|
-
onChange:
|
|
181
|
-
}, null, 40,
|
|
182
|
-
|
|
179
|
+
accept: a(D),
|
|
180
|
+
onChange: te
|
|
181
|
+
}, null, 40, we),
|
|
182
|
+
s.value === 1 ? (k(), z("div", De, [
|
|
183
183
|
i("img", {
|
|
184
184
|
class: "state-un-icon",
|
|
185
|
-
src: a(
|
|
186
|
-
}, null, 8,
|
|
187
|
-
i("div",
|
|
188
|
-
i("div",
|
|
189
|
-
a(
|
|
185
|
+
src: a(j)
|
|
186
|
+
}, null, 8, Ue),
|
|
187
|
+
i("div", Fe, A(a(J)), 1),
|
|
188
|
+
i("div", Ce, A(typeof a(F) == "string" && a(F).length > 0 ? a(F) : `${a(r)("ap.apUpload.supportExtension")}:${a(ge)(
|
|
189
|
+
a(D)
|
|
190
190
|
)},${a(r)("ap.apUpload.maxWarnUploadFileSize", {
|
|
191
|
-
maxSize: a(
|
|
191
|
+
maxSize: a(U)
|
|
192
192
|
})}`), 1)
|
|
193
|
-
])) :
|
|
194
|
-
[2, 3].includes(
|
|
195
|
-
i("div",
|
|
196
|
-
i("img", { src: a(
|
|
193
|
+
])) : b("", !0),
|
|
194
|
+
[2, 3].includes(s.value) ? (k(), z("div", Ee, [
|
|
195
|
+
i("div", Se, [
|
|
196
|
+
i("img", { src: a(j) }, null, 8, Ne)
|
|
197
197
|
]),
|
|
198
|
-
i("div",
|
|
198
|
+
i("div", xe, [
|
|
199
199
|
i("div", {
|
|
200
200
|
class: "center-title",
|
|
201
|
-
style:
|
|
202
|
-
color:
|
|
201
|
+
style: ie({
|
|
202
|
+
color: P.value ? "#0070FF" : "#182948"
|
|
203
203
|
})
|
|
204
|
-
},
|
|
205
|
-
i("div",
|
|
206
|
-
|
|
204
|
+
}, A((c = n.value) == null ? void 0 : c.name), 5),
|
|
205
|
+
i("div", ze, [
|
|
206
|
+
P.value ? b("", !0) : (k(), ce(a(he), {
|
|
207
207
|
key: 0,
|
|
208
|
-
percent:
|
|
208
|
+
percent: m.value,
|
|
209
209
|
size: 4,
|
|
210
210
|
"show-info": !1,
|
|
211
|
-
"trail-color": a(
|
|
212
|
-
"stroke-color": a(
|
|
211
|
+
"trail-color": a(w) === "admin" ? "#D9D9D9" : "#DEE4ED",
|
|
212
|
+
"stroke-color": a(w) === "admin" ? "#34B77C" : "#0070FF"
|
|
213
213
|
}, null, 8, ["percent", "trail-color", "stroke-color"]))
|
|
214
214
|
])
|
|
215
215
|
]),
|
|
216
216
|
i("div", {
|
|
217
217
|
class: "right",
|
|
218
|
-
onClick:
|
|
218
|
+
onClick: ue(ae, ["stop"])
|
|
219
219
|
}, [
|
|
220
|
-
|
|
220
|
+
pe(a(_e))
|
|
221
221
|
])
|
|
222
|
-
])) :
|
|
222
|
+
])) : b("", !0)
|
|
223
223
|
], 34);
|
|
224
224
|
};
|
|
225
225
|
}
|
|
226
226
|
});
|
|
227
227
|
export {
|
|
228
|
-
|
|
228
|
+
Ie as default
|
|
229
229
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { DownOutlined as
|
|
3
|
-
import { message as
|
|
1
|
+
import { defineComponent as N, ref as L, computed as s, watch as O, openBlock as g, createBlock as p, unref as o, normalizeClass as V, withCtx as n, createVNode as b, createTextVNode as w, toDisplayString as h, mergeProps as q, createCommentVNode as z } from "vue";
|
|
2
|
+
import { DownOutlined as U } from "@ant-design/icons-vue";
|
|
3
|
+
import { message as $, Dropdown as H, Menu as J, MenuItem as S, Button as Q } from "@aplus-frontend/antdv";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
|
-
import { ApExportGroupActionType as
|
|
6
|
-
import { usePermission as
|
|
7
|
-
import { handleExportDownload as
|
|
8
|
-
import { useInjectApTable as
|
|
9
|
-
import { convertExportField as
|
|
10
|
-
import { useNamespace as
|
|
11
|
-
import { useLocale as
|
|
12
|
-
import { useGlobalConfig as
|
|
13
|
-
const
|
|
5
|
+
import { ApExportGroupActionType as m } from "./interface.mjs";
|
|
6
|
+
import { usePermission as W } from "@aplus-frontend/hooks";
|
|
7
|
+
import { handleExportDownload as X } from "./handleExportDownload.mjs";
|
|
8
|
+
import { useInjectApTable as Y } from "../../ap-table/context.mjs";
|
|
9
|
+
import { convertExportField as Z } from "./convertExportField.mjs";
|
|
10
|
+
import { useNamespace as ee } from "../../config-provider/hooks/use-namespace.mjs";
|
|
11
|
+
import { useLocale as te } from "../../config-provider/hooks/use-locale.mjs";
|
|
12
|
+
import { useGlobalConfig as A } from "../../config-provider/hooks/use-global-config.mjs";
|
|
13
|
+
const ve = /* @__PURE__ */ N({
|
|
14
14
|
__name: "ApExportGroup",
|
|
15
15
|
props: {
|
|
16
16
|
selectedRowKeys: {},
|
|
@@ -26,84 +26,96 @@ const fe = /* @__PURE__ */ j({
|
|
|
26
26
|
successMessage: { type: [Boolean, String], default: !1 },
|
|
27
27
|
exportField: { type: [Boolean, Object], default: void 0 }
|
|
28
28
|
},
|
|
29
|
-
setup(
|
|
30
|
-
const { hasPermission:
|
|
29
|
+
setup(_) {
|
|
30
|
+
const { hasPermission: B } = W(), e = _, { columns: u, dataSource: r } = Y(), { b: G } = ee("ap-export-group"), { t: i } = te(), P = A("uiMode"), E = A("exportField"), c = L(!1), v = L(!1), K = s(() => {
|
|
31
31
|
const t = {
|
|
32
32
|
aplus: "#0070FF",
|
|
33
33
|
admin: "#34b77c"
|
|
34
34
|
};
|
|
35
|
-
return
|
|
36
|
-
}),
|
|
35
|
+
return d.value ? "" : t[P.value] || t.aplus;
|
|
36
|
+
}), d = s(
|
|
37
37
|
() => {
|
|
38
38
|
var t;
|
|
39
|
-
return !!(e != null && e.disabled) || (
|
|
39
|
+
return !!(e != null && e.disabled) || (r !== void 0 ? !((t = r == null ? void 0 : r.value) != null && t.length) : !1) || c.value;
|
|
40
40
|
}
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
);
|
|
42
|
+
O(
|
|
43
|
+
() => d.value,
|
|
44
|
+
() => {
|
|
45
|
+
d.value && (v.value = !1);
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
immediate: !0
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
const D = s(() => (e == null ? void 0 : e.successMessage) === !0 ? i("ap.apExportGroup.exportSuccess") : e != null && e.successMessage ? e.successMessage : ""), y = s(() => {
|
|
52
|
+
const t = "exportFieldList", a = (e == null ? void 0 : e.exportField) ?? (E.value === "" ? !0 : E.value) ?? !1;
|
|
53
|
+
return a === !0 ? {
|
|
44
54
|
key: t
|
|
45
|
-
} : typeof
|
|
46
|
-
...
|
|
47
|
-
key:
|
|
48
|
-
} :
|
|
49
|
-
}),
|
|
55
|
+
} : typeof a == "object" ? {
|
|
56
|
+
...a,
|
|
57
|
+
key: a.key ?? t
|
|
58
|
+
} : a;
|
|
59
|
+
}), R = {
|
|
50
60
|
textAlign: "center"
|
|
51
|
-
},
|
|
61
|
+
}, F = s(() => (e == null ? void 0 : e.selectedRowKeys) || []), T = s(() => {
|
|
52
62
|
let t = e == null ? void 0 : e.ifShow;
|
|
53
|
-
return !(e != null && e.ifShow) && (e != null && e.auth) && (t = () =>
|
|
63
|
+
return !(e != null && e.ifShow) && (e != null && e.auth) && (t = () => B(e.auth)), (t == null ? void 0 : t()) ?? !0;
|
|
54
64
|
});
|
|
55
|
-
async function
|
|
56
|
-
var
|
|
57
|
-
const { getRequestParams:
|
|
58
|
-
let
|
|
59
|
-
t ===
|
|
60
|
-
[(e == null ? void 0 : e.idKey) || "ids"]:
|
|
61
|
-
} : t ===
|
|
62
|
-
const
|
|
65
|
+
async function j({ key: t }) {
|
|
66
|
+
var M, k, C;
|
|
67
|
+
const { getRequestParams: a, request: l } = e || {};
|
|
68
|
+
let x = {};
|
|
69
|
+
t === m.SELECT ? x = {
|
|
70
|
+
[(e == null ? void 0 : e.idKey) || "ids"]: F.value
|
|
71
|
+
} : t === m.ALL && (x = (a == null ? void 0 : a()) || {});
|
|
72
|
+
const I = ((M = e == null ? void 0 : e.getInitialParams) == null ? void 0 : M.call(e)) || {};
|
|
63
73
|
try {
|
|
64
74
|
c.value = !0;
|
|
65
|
-
let
|
|
75
|
+
let f = Object.assign(
|
|
66
76
|
{
|
|
67
|
-
...
|
|
68
|
-
...
|
|
77
|
+
...x,
|
|
78
|
+
...I
|
|
69
79
|
},
|
|
70
|
-
|
|
71
|
-
[
|
|
72
|
-
|
|
73
|
-
(
|
|
80
|
+
y.value && (u != null && u.value) ? {
|
|
81
|
+
[y.value.key]: Z(
|
|
82
|
+
u.value,
|
|
83
|
+
(k = y.value) == null ? void 0 : k.convertField
|
|
74
84
|
)
|
|
75
85
|
} : {}
|
|
76
86
|
);
|
|
77
|
-
|
|
87
|
+
f = ((C = e == null ? void 0 : e.beforeRequest) == null ? void 0 : C.call(e, f)) || f, await X(async () => await (l == null ? void 0 : l(f))), e != null && e.successMessage && $.success(D.value);
|
|
78
88
|
} finally {
|
|
79
89
|
c.value = !1;
|
|
80
90
|
}
|
|
81
91
|
}
|
|
82
|
-
return (t,
|
|
92
|
+
return (t, a) => T.value ? (g(), p(o(H), {
|
|
83
93
|
key: 0,
|
|
84
|
-
|
|
85
|
-
"
|
|
86
|
-
|
|
94
|
+
open: v.value,
|
|
95
|
+
"onUpdate:open": a[0] || (a[0] = (l) => v.value = l),
|
|
96
|
+
class: V([o(G)()]),
|
|
97
|
+
"overlay-style": R,
|
|
98
|
+
disabled: d.value
|
|
87
99
|
}, {
|
|
88
|
-
overlay:
|
|
89
|
-
|
|
90
|
-
default:
|
|
100
|
+
overlay: n(() => [
|
|
101
|
+
b(o(J), { onClick: j }, {
|
|
102
|
+
default: n(() => {
|
|
91
103
|
var l;
|
|
92
104
|
return [
|
|
93
|
-
(
|
|
94
|
-
key:
|
|
95
|
-
disabled: ((l =
|
|
105
|
+
(g(), p(o(S), {
|
|
106
|
+
key: o(m).SELECT,
|
|
107
|
+
disabled: ((l = F.value) == null ? void 0 : l.length) === 0
|
|
96
108
|
}, {
|
|
97
|
-
default:
|
|
98
|
-
|
|
109
|
+
default: n(() => [
|
|
110
|
+
w(h(o(i)("ap.apExportGroup.exportSelected")), 1)
|
|
99
111
|
]),
|
|
100
112
|
_: 1
|
|
101
113
|
}, 8, ["disabled"])),
|
|
102
|
-
(
|
|
103
|
-
key:
|
|
114
|
+
(g(), p(o(S), {
|
|
115
|
+
key: o(m).ALL
|
|
104
116
|
}, {
|
|
105
|
-
default:
|
|
106
|
-
|
|
117
|
+
default: n(() => [
|
|
118
|
+
w(h(o(i)("ap.apExportGroup.exportAll")), 1)
|
|
107
119
|
]),
|
|
108
120
|
_: 1
|
|
109
121
|
}))
|
|
@@ -112,26 +124,26 @@ const fe = /* @__PURE__ */ j({
|
|
|
112
124
|
_: 1
|
|
113
125
|
})
|
|
114
126
|
]),
|
|
115
|
-
default:
|
|
116
|
-
|
|
127
|
+
default: n(() => [
|
|
128
|
+
b(o(Q), q({
|
|
117
129
|
...t.$attrs
|
|
118
130
|
}, {
|
|
119
131
|
style: {
|
|
120
|
-
color:
|
|
132
|
+
color: K.value
|
|
121
133
|
},
|
|
122
134
|
loading: c.value
|
|
123
135
|
}), {
|
|
124
|
-
default:
|
|
125
|
-
|
|
126
|
-
|
|
136
|
+
default: n(() => [
|
|
137
|
+
w(h((e == null ? void 0 : e.text) ?? o(i)("ap.apExportGroup.export")) + " ", 1),
|
|
138
|
+
b(o(U))
|
|
127
139
|
]),
|
|
128
140
|
_: 1
|
|
129
141
|
}, 16, ["style", "loading"])
|
|
130
142
|
]),
|
|
131
143
|
_: 1
|
|
132
|
-
}, 8, ["class", "disabled"])) :
|
|
144
|
+
}, 8, ["open", "class", "disabled"])) : z("", !0);
|
|
133
145
|
}
|
|
134
146
|
});
|
|
135
147
|
export {
|
|
136
|
-
|
|
148
|
+
ve as default
|
|
137
149
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { getScrollbarSize as F } from "../utils/index.mjs";
|
|
2
|
+
const l = F(), p = {
|
|
2
3
|
"ap-form": {
|
|
3
4
|
bordered: {
|
|
4
5
|
"border-color": {
|
|
@@ -64,6 +65,9 @@ const F = {
|
|
|
64
65
|
basic: {
|
|
65
66
|
color: {
|
|
66
67
|
primary: "#0070ff"
|
|
68
|
+
},
|
|
69
|
+
scrollbar: {
|
|
70
|
+
size: `${l}px`
|
|
67
71
|
}
|
|
68
72
|
},
|
|
69
73
|
"ap-descriptions": {
|
|
@@ -100,7 +104,7 @@ const F = {
|
|
|
100
104
|
"color-disabled": "rgba(24, 41, 72, 0.25)"
|
|
101
105
|
}
|
|
102
106
|
}
|
|
103
|
-
},
|
|
107
|
+
}, d = {
|
|
104
108
|
"ap-form": {
|
|
105
109
|
bordered: {
|
|
106
110
|
"border-color": {
|
|
@@ -166,6 +170,9 @@ const F = {
|
|
|
166
170
|
basic: {
|
|
167
171
|
color: {
|
|
168
172
|
primary: "#34b77c"
|
|
173
|
+
},
|
|
174
|
+
scrollbar: {
|
|
175
|
+
size: `${l}px`
|
|
169
176
|
}
|
|
170
177
|
},
|
|
171
178
|
"ap-descriptions": {
|
|
@@ -203,26 +210,26 @@ const F = {
|
|
|
203
210
|
}
|
|
204
211
|
}
|
|
205
212
|
};
|
|
206
|
-
function
|
|
213
|
+
function n(t) {
|
|
207
214
|
const o = {};
|
|
208
|
-
function r(a,
|
|
209
|
-
const
|
|
210
|
-
for (const c of
|
|
211
|
-
const e = a[c],
|
|
212
|
-
e !== null && typeof e == "object" ? r(e,
|
|
215
|
+
function r(a, s) {
|
|
216
|
+
const b = Object.keys(a);
|
|
217
|
+
for (const c of b) {
|
|
218
|
+
const e = a[c], i = [...s, c];
|
|
219
|
+
e !== null && typeof e == "object" ? r(e, i) : o[`--${i.join("-")}`] = e;
|
|
213
220
|
}
|
|
214
221
|
}
|
|
215
222
|
return r(t, []), o;
|
|
216
223
|
}
|
|
217
|
-
const
|
|
218
|
-
function
|
|
224
|
+
const g = n(p), m = n(d);
|
|
225
|
+
function D(t) {
|
|
219
226
|
Object.entries(t).forEach(([o, r]) => {
|
|
220
227
|
document.documentElement.style.setProperty(o, r);
|
|
221
228
|
});
|
|
222
229
|
}
|
|
223
230
|
export {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
231
|
+
m as adminCssVar,
|
|
232
|
+
g as aplusCssVar,
|
|
233
|
+
n as generateCssVar,
|
|
234
|
+
D as setCSSVariables
|
|
228
235
|
};
|