@aplus-frontend/ui 7.10.2 → 7.10.4
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/index.vue.mjs +85 -79
- package/es/src/business/ap-download/ap-download.vue.d.ts +2 -1
- package/es/src/business/ap-download/ap-download.vue.mjs +10 -10
- package/es/src/business/ap-image/ApImage.vue2.mjs +49 -46
- package/es/src/business/ap-image/hooks/useOss.d.ts +1 -1
- package/es/src/business/ap-image/hooks/useOss.mjs +30 -28
- package/es/src/business/ap-image/interface.d.ts +1 -1
- package/es/src/business/ap-upload/apUpload.vue.d.ts +1 -1
- package/es/src/config-provider/constants.d.ts +2 -2
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/editable/index.vue.js +1 -1
- package/lib/src/business/ap-download/ap-download.vue.d.ts +2 -1
- package/lib/src/business/ap-download/ap-download.vue.js +1 -1
- package/lib/src/business/ap-image/ApImage.vue2.js +1 -1
- package/lib/src/business/ap-image/hooks/useOss.d.ts +1 -1
- package/lib/src/business/ap-image/hooks/useOss.js +1 -1
- package/lib/src/business/ap-image/interface.d.ts +1 -1
- package/lib/src/business/ap-upload/apUpload.vue.d.ts +1 -1
- package/lib/src/config-provider/constants.d.ts +2 -2
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isEqual as
|
|
3
|
-
import { ApForm as
|
|
1
|
+
import { defineComponent as $, useSlots as q, ref as b, watch as J, unref as n, createBlock as Q, openBlock as X, withCtx as c, createVNode as R, mergeProps as Y, createSlots as Z, renderList as ee, renderSlot as oe, normalizeProps as ae, guardReactiveProps as te } from "vue";
|
|
2
|
+
import { isEqual as ne, isArray as v, omit as le } from "lodash-unified";
|
|
3
|
+
import { ApForm as f } from "../../ap-form/index.mjs";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
|
-
import { useEditableApi as
|
|
7
|
-
import { useGetEditableColumns as
|
|
6
|
+
import { useEditableApi as re } from "../hooks/use-editable-api.mjs";
|
|
7
|
+
import { useGetEditableColumns as se } from "../hooks/use-editable-columns.mjs";
|
|
8
8
|
import "../index.vue2.mjs";
|
|
9
|
-
import
|
|
10
|
-
import { arrayToObject as
|
|
11
|
-
import { useNamespace as
|
|
12
|
-
import { useControllableValue as
|
|
13
|
-
import { useGlobalConfig as
|
|
14
|
-
import
|
|
15
|
-
const
|
|
9
|
+
import ie from "../style/editable.mjs";
|
|
10
|
+
import { arrayToObject as y, getRowKey as de } from "./utils.mjs";
|
|
11
|
+
import { useNamespace as ue } from "../../config-provider/hooks/use-namespace.mjs";
|
|
12
|
+
import { useControllableValue as pe } from "../../hooks/useControllableValue.mjs";
|
|
13
|
+
import { useGlobalConfig as me } from "../../config-provider/hooks/use-global-config.mjs";
|
|
14
|
+
import ce from "../index.vue.mjs";
|
|
15
|
+
const Fe = /* @__PURE__ */ $({
|
|
16
16
|
name: "EditableGrid",
|
|
17
17
|
__name: "index",
|
|
18
18
|
props: {
|
|
@@ -131,107 +131,113 @@ const xe = /* @__PURE__ */ G({
|
|
|
131
131
|
onFieldChange: {}
|
|
132
132
|
},
|
|
133
133
|
emits: ["update:value"],
|
|
134
|
-
setup(
|
|
135
|
-
expose:
|
|
136
|
-
emit:
|
|
134
|
+
setup(C, {
|
|
135
|
+
expose: x,
|
|
136
|
+
emit: B
|
|
137
137
|
}) {
|
|
138
|
-
const
|
|
139
|
-
b:
|
|
140
|
-
} =
|
|
138
|
+
const S = q(), o = C, {
|
|
139
|
+
b: T
|
|
140
|
+
} = ue("editable-aggrid"), _ = ie("editable-aggrid"), F = B, d = b(), {
|
|
141
141
|
value: r,
|
|
142
|
-
updateValue:
|
|
143
|
-
} =
|
|
144
|
-
|
|
145
|
-
const a =
|
|
146
|
-
|
|
142
|
+
updateValue: w
|
|
143
|
+
} = pe(o, F), l = b(), E = f.useWatch(o.name, l);
|
|
144
|
+
J(r, (e) => {
|
|
145
|
+
const a = y(e, o.rowKey);
|
|
146
|
+
ne(a, n(E)) || l.value?.setFieldValue(o.name, a);
|
|
147
147
|
}, {
|
|
148
148
|
deep: !0
|
|
149
149
|
});
|
|
150
|
-
const
|
|
151
|
-
add:
|
|
152
|
-
addMultiple:
|
|
153
|
-
remove:
|
|
154
|
-
removeByKey:
|
|
155
|
-
getRowData:
|
|
156
|
-
getRowsData:
|
|
157
|
-
setRowData:
|
|
158
|
-
clear:
|
|
159
|
-
refreshRowIds:
|
|
160
|
-
} =
|
|
161
|
-
function
|
|
162
|
-
const e =
|
|
163
|
-
if (!
|
|
150
|
+
const K = me("valueTypeMap"), k = se(o, K), {
|
|
151
|
+
add: N,
|
|
152
|
+
addMultiple: j,
|
|
153
|
+
remove: A,
|
|
154
|
+
removeByKey: D,
|
|
155
|
+
getRowData: I,
|
|
156
|
+
getRowsData: V,
|
|
157
|
+
setRowData: H,
|
|
158
|
+
clear: O,
|
|
159
|
+
refreshRowIds: p
|
|
160
|
+
} = re(o, l, r, w);
|
|
161
|
+
function z() {
|
|
162
|
+
const e = d.value?._internalGridApi;
|
|
163
|
+
if (!p.value?.length || !e)
|
|
164
164
|
return;
|
|
165
|
-
const a =
|
|
165
|
+
const a = p.value.map((t) => e.getRowNode(t)).filter((t) => !!t);
|
|
166
166
|
e.refreshCells({
|
|
167
167
|
rowNodes: a,
|
|
168
168
|
force: !0
|
|
169
|
-
}),
|
|
169
|
+
}), p.value = [];
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function L() {
|
|
172
172
|
l.value?.resetFields();
|
|
173
173
|
}
|
|
174
|
-
function
|
|
175
|
-
return e ? (
|
|
174
|
+
function P(e) {
|
|
175
|
+
return e ? (v(e) ? e : [e]).map((t) => v(t) ? [o.name, ...t] : [o.name, t]) : void 0;
|
|
176
176
|
}
|
|
177
|
-
async function
|
|
178
|
-
|
|
177
|
+
async function G(e, a) {
|
|
178
|
+
const s = (await l.value?.validateFields(P(e), a))?.[o.name];
|
|
179
|
+
try {
|
|
180
|
+
const u = Object.keys(s), h = r.value.map((i) => de(i, void 0, o.rowKey));
|
|
181
|
+
return u.sort((i, M) => h.findIndex((m) => String(m) === i) - h.findIndex((m) => String(m) === M)), u.map((i) => s[i]);
|
|
182
|
+
} catch {
|
|
183
|
+
return s;
|
|
184
|
+
}
|
|
179
185
|
}
|
|
180
|
-
function
|
|
181
|
-
|
|
182
|
-
const a =
|
|
186
|
+
function U(e) {
|
|
187
|
+
w(e);
|
|
188
|
+
const a = y(e, o.rowKey);
|
|
183
189
|
l.value?.setFieldValue(o.name, a);
|
|
184
190
|
}
|
|
185
|
-
function
|
|
191
|
+
function g(e, a) {
|
|
186
192
|
const t = e === "end" ? r.value.length - 1 : e;
|
|
187
|
-
|
|
193
|
+
d.value?.scrollToRow(t, a);
|
|
188
194
|
}
|
|
189
|
-
function
|
|
190
|
-
|
|
195
|
+
function W(e, a) {
|
|
196
|
+
d.value?.scrollToColumn(e, a);
|
|
191
197
|
}
|
|
192
|
-
return
|
|
193
|
-
resetFields:
|
|
194
|
-
validateFields:
|
|
195
|
-
add:
|
|
196
|
-
addMultiple:
|
|
197
|
-
remove:
|
|
198
|
-
removeByKey:
|
|
199
|
-
getRowData:
|
|
200
|
-
getRowsData:
|
|
201
|
-
setRowData:
|
|
202
|
-
clear:
|
|
203
|
-
setTableData:
|
|
204
|
-
scrollTo:
|
|
205
|
-
scrollToRow:
|
|
206
|
-
scrollToColumn:
|
|
207
|
-
}), (e, a) => (
|
|
198
|
+
return x({
|
|
199
|
+
resetFields: L,
|
|
200
|
+
validateFields: G,
|
|
201
|
+
add: N,
|
|
202
|
+
addMultiple: j,
|
|
203
|
+
remove: A,
|
|
204
|
+
removeByKey: D,
|
|
205
|
+
getRowData: I,
|
|
206
|
+
getRowsData: V,
|
|
207
|
+
setRowData: H,
|
|
208
|
+
clear: O,
|
|
209
|
+
setTableData: U,
|
|
210
|
+
scrollTo: g,
|
|
211
|
+
scrollToRow: g,
|
|
212
|
+
scrollToColumn: W
|
|
213
|
+
}), (e, a) => (X(), Q(n(f), {
|
|
208
214
|
ref_key: "formRef",
|
|
209
215
|
ref: l,
|
|
210
216
|
"initial-values": {
|
|
211
|
-
[o.name]: n(
|
|
217
|
+
[o.name]: n(y)(n(r), o.rowKey)
|
|
212
218
|
},
|
|
213
219
|
style: {
|
|
214
220
|
height: "100%"
|
|
215
221
|
}
|
|
216
222
|
}, {
|
|
217
|
-
default:
|
|
223
|
+
default: c(() => [R(n(f).FormItem, {
|
|
218
224
|
name: e.name,
|
|
219
225
|
"no-style": ""
|
|
220
226
|
}, {
|
|
221
|
-
default:
|
|
227
|
+
default: c(() => [R(ce, Y(n(le)(o, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue"]), {
|
|
222
228
|
ref_key: "tableRef",
|
|
223
|
-
ref:
|
|
224
|
-
class: [n(
|
|
229
|
+
ref: d,
|
|
230
|
+
class: [n(T)(), n(_)],
|
|
225
231
|
size: "mini",
|
|
226
|
-
columns: n(
|
|
232
|
+
columns: n(k),
|
|
227
233
|
"data-source": n(r),
|
|
228
234
|
"search-form": !1,
|
|
229
|
-
onUpdate:
|
|
230
|
-
}),
|
|
235
|
+
onUpdate: z
|
|
236
|
+
}), Z({
|
|
231
237
|
_: 2
|
|
232
|
-
}, [
|
|
233
|
-
name:
|
|
234
|
-
fn:
|
|
238
|
+
}, [ee(S, (t, s) => ({
|
|
239
|
+
name: s,
|
|
240
|
+
fn: c((u) => [oe(e.$slots, s, ae(te(u || {})))])
|
|
235
241
|
}))]), 1040, ["class", "columns", "data-source"])]),
|
|
236
242
|
_: 3
|
|
237
243
|
}, 8, ["name"])]),
|
|
@@ -240,5 +246,5 @@ const xe = /* @__PURE__ */ G({
|
|
|
240
246
|
}
|
|
241
247
|
});
|
|
242
248
|
export {
|
|
243
|
-
|
|
249
|
+
Fe as default
|
|
244
250
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApDownLoadProps, downloadCallbackResponse } from './interface';
|
|
1
|
+
import { ApDownLoadProps, downloadCallbackResponse, ApDownLoadNeedNameModel } from './interface';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
3
|
import { ButtonType } from '@aplus-frontend/antdv/es/button';
|
|
4
4
|
type __VLS_Props = ApDownLoadProps;
|
|
@@ -19,6 +19,7 @@ declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, Comp
|
|
|
19
19
|
size: "small" | "large" | "middle";
|
|
20
20
|
type: ButtonType;
|
|
21
21
|
disabled: boolean;
|
|
22
|
+
needName: ApDownLoadNeedNameModel;
|
|
22
23
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
23
24
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
24
25
|
export default _default;
|
|
@@ -40,20 +40,20 @@ const M = {
|
|
|
40
40
|
variant: {},
|
|
41
41
|
text: {},
|
|
42
42
|
fileName: {},
|
|
43
|
-
needName: { type: [Boolean, Object] },
|
|
43
|
+
needName: { type: [Boolean, Object], default: void 0 },
|
|
44
44
|
getOssAccess: {}
|
|
45
45
|
},
|
|
46
46
|
emits: ["downloadCallback"],
|
|
47
47
|
setup(C, { emit: N }) {
|
|
48
|
-
const r = N,
|
|
48
|
+
const r = N, l = z(!1), { lang: b } = G(), v = A(), w = s(() => b.value === "zh-cn" ? "zh_CN" : "en_US"), e = C, n = y("apUpload"), c = y(
|
|
49
49
|
"downloadCenterTriggerConfig"
|
|
50
|
-
), d = s(() => e.disabled),
|
|
50
|
+
), d = s(() => e.disabled), h = s(() => e.size), { getInnerWrapperClass: _ } = P(h, d), k = s(() => e.getOssAccess || n.value?.getOssAccess), B = async () => {
|
|
51
51
|
if (!e.disabled) {
|
|
52
|
-
|
|
52
|
+
l.value = !0;
|
|
53
53
|
try {
|
|
54
54
|
if (c.value?.trigger) {
|
|
55
55
|
let a = g(
|
|
56
|
-
e.needName ??
|
|
56
|
+
e.needName ?? n?.value?.needName,
|
|
57
57
|
e.fileName
|
|
58
58
|
).map((p) => ({
|
|
59
59
|
objectName: p.path,
|
|
@@ -63,10 +63,10 @@ const M = {
|
|
|
63
63
|
} else {
|
|
64
64
|
const a = await (await E(
|
|
65
65
|
k.value,
|
|
66
|
-
t(
|
|
66
|
+
t(w)
|
|
67
67
|
)).downloadFile(
|
|
68
68
|
g(
|
|
69
|
-
e.needName ??
|
|
69
|
+
e.needName ?? n?.value?.needName,
|
|
70
70
|
e.fileName
|
|
71
71
|
)
|
|
72
72
|
);
|
|
@@ -75,7 +75,7 @@ const M = {
|
|
|
75
75
|
} catch (o) {
|
|
76
76
|
console.error(o);
|
|
77
77
|
} finally {
|
|
78
|
-
|
|
78
|
+
l.value = !1;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
};
|
|
@@ -89,10 +89,10 @@ const M = {
|
|
|
89
89
|
m("div", {
|
|
90
90
|
class: j(t(_))
|
|
91
91
|
}, [
|
|
92
|
-
|
|
92
|
+
l.value ? (i(), f("span", M, [
|
|
93
93
|
I(t(U), { spin: !0 })
|
|
94
94
|
])) : u("", !0),
|
|
95
|
-
t(
|
|
95
|
+
t(v).icon ? (i(), f("span", R, [
|
|
96
96
|
F(o.$slots, "icon")
|
|
97
97
|
])) : u("", !0),
|
|
98
98
|
m("span", W, T(o.text), 1)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { DownloadOutlined as
|
|
3
|
-
import { Image as
|
|
4
|
-
import { omit as
|
|
1
|
+
import { defineComponent as S, computed as n, ref as j, watchEffect as B, createBlock as h, openBlock as i, unref as o, mergeProps as v, withCtx as E, renderSlot as F, normalizeProps as L, guardReactiveProps as U, createElementVNode as b, normalizeClass as W, createElementBlock as x, Fragment as D, renderList as P, resolveDynamicComponent as R, createVNode as T } from "vue";
|
|
2
|
+
import { DownloadOutlined as z } from "@ant-design/icons-vue";
|
|
3
|
+
import { Image as V } from "@aplus-frontend/antdv";
|
|
4
|
+
import { omit as $ } from "lodash-unified";
|
|
5
5
|
import "../../config-provider/index.mjs";
|
|
6
|
-
import { injectLocaleToOss as
|
|
6
|
+
import { injectLocaleToOss as G, getOssInstance as q, getSignatureUrl as H } from "./hooks/useOss.mjs";
|
|
7
7
|
import J from "./imgs/admin-fallback.jpg.mjs";
|
|
8
8
|
import K from "./imgs/user-fallback.jpg.mjs";
|
|
9
9
|
import Q from "./style/index.mjs";
|
|
10
10
|
import { useNamespace as X } from "../../config-provider/hooks/use-namespace.mjs";
|
|
11
|
-
import { useGlobalConfig as
|
|
11
|
+
import { useGlobalConfig as m } from "../../config-provider/hooks/use-global-config.mjs";
|
|
12
12
|
import { useLocale as Y } from "../../config-provider/hooks/use-locale.mjs";
|
|
13
|
-
const ue = /* @__PURE__ */
|
|
13
|
+
const ue = /* @__PURE__ */ S({
|
|
14
14
|
__name: "ApImage",
|
|
15
15
|
props: {
|
|
16
16
|
getOssAccess: {},
|
|
@@ -23,78 +23,81 @@ const ue = /* @__PURE__ */ M({
|
|
|
23
23
|
uiMode: {},
|
|
24
24
|
preview: { type: [Boolean, Object], default: !0 }
|
|
25
25
|
},
|
|
26
|
-
setup(
|
|
27
|
-
const { b:
|
|
26
|
+
setup(k) {
|
|
27
|
+
const { b: u } = X("ap-image"), p = Q("ap-image"), e = k, d = {
|
|
28
28
|
aplus: K,
|
|
29
29
|
admin: J
|
|
30
|
-
},
|
|
30
|
+
}, w = m("apImage", { uiMode: "aplus" }), C = m("apUpload"), f = m(
|
|
31
31
|
"downloadCenterTriggerConfig"
|
|
32
|
-
),
|
|
33
|
-
() => e.uiMode ||
|
|
34
|
-
), { t:
|
|
35
|
-
() => e.getOssAccess ||
|
|
36
|
-
),
|
|
37
|
-
() =>
|
|
38
|
-
),
|
|
39
|
-
|
|
32
|
+
), O = n(
|
|
33
|
+
() => e.uiMode || w.value?.uiMode
|
|
34
|
+
), { t: y, lang: A } = Y(), g = n(
|
|
35
|
+
() => e.getOssAccess || C.value?.getOssAccess
|
|
36
|
+
), N = n(
|
|
37
|
+
() => d[O.value] || d.aplus
|
|
38
|
+
), I = n(() => e?.fallback || N.value), s = j("");
|
|
39
|
+
G(y, A), B(async () => {
|
|
40
40
|
if (!e?.src) {
|
|
41
41
|
s.value = "";
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
if (
|
|
44
|
+
if (e.src?.startsWith("http") || e.src?.startsWith("data:")) {
|
|
45
45
|
s.value = e.src;
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
try {
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
const a = e.src?.match(/^([^:]+):(.*)$/), r = a?.[1], t = a?.[2] ?? e.src, l = await q(
|
|
50
|
+
() => r ? g.value?.(r) : g.value?.(),
|
|
51
|
+
r
|
|
52
|
+
), c = await H({
|
|
53
|
+
oss: l,
|
|
54
|
+
fileName: t
|
|
52
55
|
});
|
|
53
|
-
|
|
56
|
+
c && (s.value = c);
|
|
54
57
|
} catch {
|
|
55
58
|
s.value = "";
|
|
56
59
|
}
|
|
57
60
|
});
|
|
58
|
-
async function
|
|
61
|
+
async function _() {
|
|
59
62
|
if (!e?.src)
|
|
60
63
|
return;
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
63
|
-
|
|
64
|
+
const a = e.src, r = e.fileName ?? e.src;
|
|
65
|
+
if (e.src?.startsWith("http") || e.src?.startsWith("data:")) {
|
|
66
|
+
M(a, r);
|
|
64
67
|
return;
|
|
65
68
|
}
|
|
66
|
-
if (
|
|
67
|
-
let
|
|
69
|
+
if (f.value?.trigger) {
|
|
70
|
+
let t = [
|
|
68
71
|
{
|
|
69
|
-
objectName:
|
|
72
|
+
objectName: a,
|
|
70
73
|
fileName: r
|
|
71
74
|
}
|
|
72
75
|
];
|
|
73
|
-
await
|
|
76
|
+
await f.value?.trigger(t);
|
|
74
77
|
}
|
|
75
78
|
}
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
+
const M = (a, r) => {
|
|
80
|
+
const t = document.createElement("a");
|
|
81
|
+
t.href = a, t.rel = "noopener noreferrer", t.setAttribute("download", r), document.body.appendChild(t), t.click(), document.body.removeChild(t);
|
|
79
82
|
};
|
|
80
|
-
return (
|
|
81
|
-
class: [
|
|
83
|
+
return (a, r) => (i(), h(o(V), v({
|
|
84
|
+
class: [o(u)(), o(p)]
|
|
82
85
|
}, {
|
|
83
|
-
...
|
|
84
|
-
fallback:
|
|
86
|
+
...o($)(e, ["src", "getOssAccess"]),
|
|
87
|
+
fallback: I.value,
|
|
85
88
|
src: s.value
|
|
86
89
|
}), {
|
|
87
|
-
toolbarRender:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
class:
|
|
90
|
+
toolbarRender: E((t) => [
|
|
91
|
+
F(a.$slots, "toolbarRender", L(U({ ...t })), () => [
|
|
92
|
+
b("div", {
|
|
93
|
+
class: W([o(u)("toolbar"), o(p)])
|
|
91
94
|
}, [
|
|
92
|
-
(
|
|
93
|
-
|
|
95
|
+
(i(!0), x(D, null, P(t.originalNodes, (l, c) => (i(), h(R(l), v({ ref_for: !0 }, e, { key: c }), null, 16))), 128)),
|
|
96
|
+
b("div", {
|
|
94
97
|
class: "ant-image-preview-operations-operation",
|
|
95
|
-
onClick:
|
|
98
|
+
onClick: _
|
|
96
99
|
}, [
|
|
97
|
-
|
|
100
|
+
T(o(z))
|
|
98
101
|
])
|
|
99
102
|
], 2)
|
|
100
103
|
])
|
|
@@ -3,7 +3,7 @@ import { Ref } from 'vue';
|
|
|
3
3
|
import { Translator } from '../../../config-provider';
|
|
4
4
|
type GetOssAccess = () => Promise<accessCreate>;
|
|
5
5
|
export declare function injectLocaleToOss(tValue: Translator, langValue: Ref<string>): void;
|
|
6
|
-
export declare function getOssInstance(getOssAccess?: GetOssAccess): Promise<Oss>;
|
|
6
|
+
export declare function getOssInstance(getOssAccess?: GetOssAccess, bucket?: string): Promise<Oss>;
|
|
7
7
|
export declare function getSignatureUrl({ oss, fileName }: {
|
|
8
8
|
oss: Oss;
|
|
9
9
|
fileName: string;
|
|
@@ -1,46 +1,48 @@
|
|
|
1
|
-
import { createOssInstance as
|
|
2
|
-
const
|
|
3
|
-
let n,
|
|
4
|
-
function
|
|
5
|
-
n =
|
|
1
|
+
import { createOssInstance as u } from "@aplus-frontend/oss";
|
|
2
|
+
const g = 1e4;
|
|
3
|
+
let n, i;
|
|
4
|
+
function _(t, s) {
|
|
5
|
+
n = t, i = s;
|
|
6
6
|
}
|
|
7
|
-
const
|
|
7
|
+
const f = {
|
|
8
8
|
"zh-cn": "zh_CN",
|
|
9
9
|
en: "en_US"
|
|
10
10
|
};
|
|
11
|
-
function
|
|
12
|
-
return
|
|
11
|
+
function m() {
|
|
12
|
+
return f[i.value] ?? "zh_CN";
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
async function
|
|
16
|
-
if (!
|
|
14
|
+
const c = /* @__PURE__ */ new Map();
|
|
15
|
+
async function w(t, s) {
|
|
16
|
+
if (!t)
|
|
17
17
|
throw new Error(`${n("ap.apUpload.pleasePass")}getOssAccess`);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
const a = s || "ap_image_default_bucket";
|
|
19
|
+
let e = c.get(a);
|
|
20
|
+
return e?.createDate && e.createDate < Date.now() + g && e?.oss || (e = {
|
|
21
|
+
oss: new Promise((l, p) => {
|
|
22
|
+
const o = u();
|
|
23
|
+
o.initOssClient({
|
|
24
|
+
getOssAccess: t,
|
|
25
|
+
locale: m(),
|
|
26
|
+
onFailure: (r) => {
|
|
27
|
+
p(
|
|
28
|
+
typeof r?.message == "string" ? r.message : n("ap.apUpload.FailedToObtainOssTemporaryPermissions")
|
|
27
29
|
);
|
|
28
30
|
}
|
|
29
31
|
}).then(() => {
|
|
30
|
-
|
|
32
|
+
l(o);
|
|
31
33
|
});
|
|
32
34
|
}),
|
|
33
35
|
createDate: Date.now()
|
|
34
|
-
}),
|
|
36
|
+
}, c.set(a, e)), e.oss;
|
|
35
37
|
}
|
|
36
|
-
function
|
|
37
|
-
oss:
|
|
38
|
+
function U({
|
|
39
|
+
oss: t,
|
|
38
40
|
fileName: s
|
|
39
41
|
}) {
|
|
40
|
-
return
|
|
42
|
+
return t.getSignatureUrl(s);
|
|
41
43
|
}
|
|
42
44
|
export {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
w as getOssInstance,
|
|
46
|
+
U as getSignatureUrl,
|
|
47
|
+
_ as injectLocaleToOss
|
|
46
48
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { accessCreate } from '@aplus-frontend/oss';
|
|
2
2
|
import { UiModeType } from '../../config-provider';
|
|
3
3
|
export interface ApImageProps {
|
|
4
|
-
getOssAccess?: () => Promise<accessCreate>;
|
|
4
|
+
getOssAccess?: (bucket?: string) => Promise<accessCreate>;
|
|
5
5
|
width?: number | string;
|
|
6
6
|
height?: number | string;
|
|
7
7
|
alt?: string;
|
|
@@ -181,8 +181,8 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
|
|
|
181
181
|
value: string | unknown[] | Record<string, any>;
|
|
182
182
|
maxCount: number;
|
|
183
183
|
maxSize: number;
|
|
184
|
-
getOssAccess: GetOssAccess;
|
|
185
184
|
needName: boolean | Record<string, any>;
|
|
185
|
+
getOssAccess: GetOssAccess;
|
|
186
186
|
accept: string;
|
|
187
187
|
beforeUpload: BeforeUpload;
|
|
188
188
|
onRemove: Function;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DefaultOptionType } from '@aplus-frontend/antdv/es/select';
|
|
2
|
-
import {
|
|
2
|
+
import { accessCreate } from '@aplus-frontend/oss';
|
|
3
3
|
import { InjectionKey, Ref, VNode } from 'vue';
|
|
4
4
|
import { Recordable } from '../type';
|
|
5
5
|
import { ConfigProviderProps } from './config-provider-props';
|
|
@@ -18,7 +18,7 @@ export type ApiType = {
|
|
|
18
18
|
};
|
|
19
19
|
export type ApUploadConfig = {
|
|
20
20
|
dirName?: string;
|
|
21
|
-
getOssAccess?:
|
|
21
|
+
getOssAccess?: (bucket?: string) => Promise<accessCreate>;
|
|
22
22
|
needName?: boolean | {
|
|
23
23
|
pathKey?: string;
|
|
24
24
|
nameKey?: string;
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.10.
|
|
1
|
+
declare const _default: "7.10.4";
|
|
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 e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("lodash-unified"),y=require("../../ap-form/index.js");require("../../config-provider/index.js");require("../../hooks/index.js");const L=require("../hooks/use-editable-api.js"),M=require("../hooks/use-editable-columns.js");require("../index.vue2.js");const U=require("../style/editable.js"),p=require("./utils.js"),W=require("../../config-provider/hooks/use-namespace.js"),$=require("../../hooks/useControllableValue.js"),J=require("../../config-provider/hooks/use-global-config.js"),Q=require("../index.vue.js"),X=e.defineComponent({name:"EditableGrid",__name:"index",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:{},columns:{},value:{},defaultValue:{},"onUpdate:value":{},onChange:{},maxLength:{},name:{default:"ap-editable-table-inner-name"},onFieldChange:{}},emits:["update:value"],setup(h,{expose:v,emit:C}){const R=e.useSlots(),a=h,{b:x}=W.useNamespace("editable-aggrid"),B=U.default("editable-aggrid"),_=C,i=e.ref(),{value:r,updateValue:w}=$.useControllableValue(a,_),l=e.ref(),S=y.ApForm.useWatch(a.name,l);e.watch(r,o=>{const t=p.arrayToObject(o,a.rowKey);c.isEqual(t,e.unref(S))||l.value?.setFieldValue(a.name,t)},{deep:!0});const T=J.useGlobalConfig("valueTypeMap"),q=M.useGetEditableColumns(a,T),{add:F,addMultiple:E,remove:A,removeByKey:j,getRowData:N,getRowsData:K,setRowData:V,clear:k,refreshRowIds:f}=L.useEditableApi(a,l,r,w);function O(){const o=i.value?._internalGridApi;if(!f.value?.length||!o)return;const t=f.value.map(n=>o.getRowNode(n)).filter(n=>!!n);o.refreshCells({rowNodes:t,force:!0}),f.value=[]}function D(){l.value?.resetFields()}function I(o){return o?(c.isArray(o)?o:[o]).map(n=>c.isArray(n)?[a.name,...n]:[a.name,n]):void 0}async function H(o,t){const s=(await l.value?.validateFields(I(o),t))?.[a.name];try{const d=Object.keys(s),g=r.value.map(u=>p.getRowKey(u,void 0,a.rowKey));return d.sort((u,G)=>g.findIndex(m=>String(m)===u)-g.findIndex(m=>String(m)===G)),d.map(u=>s[u])}catch{return s}}function P(o){w(o);const t=p.arrayToObject(o,a.rowKey);l.value?.setFieldValue(a.name,t)}function b(o,t){const n=o==="end"?r.value.length-1:o;i.value?.scrollToRow(n,t)}function z(o,t){i.value?.scrollToColumn(o,t)}return v({resetFields:D,validateFields:H,add:F,addMultiple:E,remove:A,removeByKey:j,getRowData:N,getRowsData:K,setRowData:V,clear:k,setTableData:P,scrollTo:b,scrollToRow:b,scrollToColumn:z}),(o,t)=>(e.openBlock(),e.createBlock(e.unref(y.ApForm),{ref_key:"formRef",ref:l,"initial-values":{[a.name]:e.unref(p.arrayToObject)(e.unref(r),a.rowKey)},style:{height:"100%"}},{default:e.withCtx(()=>[e.createVNode(e.unref(y.ApForm).FormItem,{name:o.name,"no-style":""},{default:e.withCtx(()=>[e.createVNode(Q.default,e.mergeProps(e.unref(c.omit)(a,["name","value","onUpdate:value","maxLength","onChange","defaultValue"]),{ref_key:"tableRef",ref:i,class:[e.unref(x)(),e.unref(B)],size:"mini",columns:e.unref(q),"data-source":e.unref(r),"search-form":!1,onUpdate:O}),e.createSlots({_:2},[e.renderList(R,(n,s)=>({name:s,fn:e.withCtx(d=>[e.renderSlot(o.$slots,s,e.normalizeProps(e.guardReactiveProps(d||{})))])}))]),1040,["class","columns","data-source"])]),_:3},8,["name"])]),_:3},8,["initial-values"]))}});exports.default=X;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApDownLoadProps, downloadCallbackResponse } from './interface';
|
|
1
|
+
import { ApDownLoadProps, downloadCallbackResponse, ApDownLoadNeedNameModel } from './interface';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
3
|
import { ButtonType } from '@aplus-frontend/antdv/es/button';
|
|
4
4
|
type __VLS_Props = ApDownLoadProps;
|
|
@@ -19,6 +19,7 @@ declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, Comp
|
|
|
19
19
|
size: "small" | "large" | "middle";
|
|
20
20
|
type: ButtonType;
|
|
21
21
|
disabled: boolean;
|
|
22
|
+
needName: ApDownLoadNeedNameModel;
|
|
22
23
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
23
24
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
24
25
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),k=require("@ant-design/icons-vue"),_=require("@aplus-frontend/antdv"),h=require("lodash-unified");require("../../config-provider/index.js");const w=require("./hooks/index.js"),B=require("./hooks/useStyle.js"),d=require("./utils/getFileInfo.js"),O=require("../../config-provider/hooks/use-locale.js"),u=require("../../config-provider/hooks/use-global-config.js"),q={key:0,class:"spin"},z={key:1,class:"icon"},S={class:"text"},I=e.defineComponent({name:"ApDownload",__name:"ap-download",props:{prefixCls:{},type:{default:"link"},htmlType:{},shape:{},size:{default:"middle"},loading:{type:[Boolean,Object]},disabled:{type:Boolean,default:!1},ghost:{type:Boolean},block:{type:Boolean},danger:{type:Boolean},icon:{},href:{},target:{},title:{},onClick:{},onMousedown:{},autoInsertSpace:{type:Boolean},iconPosition:{},color:{},variant:{},text:{},fileName:{},needName:{type:[Boolean,Object]},getOssAccess:{}},emits:["downloadCallback"],setup(p,{emit:f}){const l=f,s=e.ref(!1),{lang:m}=O.useLocale(),g=e.useSlots(),C=e.computed(()=>m.value==="zh-cn"?"zh_CN":"en_US"),t=p,a=u.useGlobalConfig("apUpload"),i=u.useGlobalConfig("downloadCenterTriggerConfig"),c=e.computed(()=>t.disabled),y=e.computed(()=>t.size),{getInnerWrapperClass:b}=B.useStyle(y,c),N=e.computed(()=>t.getOssAccess||a.value?.getOssAccess),v=async()=>{if(!t.disabled){s.value=!0;try{if(i.value?.trigger){let n=d.getFileInfo(t.needName??a?.value?.needName,t.fileName).map(r=>({objectName:r.path,fileName:r.fileName}));await i.value?.trigger(n),l("downloadCallback",n)}else{const n=await(await w.useOssInit(N.value,e.unref(C))).downloadFile(d.getFileInfo(t.needName??a?.value?.needName,t.fileName));l("downloadCallback",n)}}catch(o){console.error(o)}finally{s.value=!1}}};return(o,n)=>(e.openBlock(),e.createBlock(e.unref(_.Button),e.mergeProps(e.unref(h.omit)(t,["getOssAccess","fileName","needName"]),{type:t.type,size:t.size,disabled:c.value,onClick:v}),{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(b))},[s.value?(e.openBlock(),e.createElementBlock("span",q,[e.createVNode(e.unref(k.LoadingOutlined),{spin:!0})])):e.createCommentVNode("",!0),e.unref(g).icon?(e.openBlock(),e.createElementBlock("span",z,[e.renderSlot(o.$slots,"icon")])):e.createCommentVNode("",!0),e.createElementVNode("span",S,e.toDisplayString(o.text),1)],2)]),_:3},16,["type","size","disabled"]))}});exports.default=I;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),k=require("@ant-design/icons-vue"),_=require("@aplus-frontend/antdv"),h=require("lodash-unified");require("../../config-provider/index.js");const w=require("./hooks/index.js"),B=require("./hooks/useStyle.js"),d=require("./utils/getFileInfo.js"),O=require("../../config-provider/hooks/use-locale.js"),u=require("../../config-provider/hooks/use-global-config.js"),q={key:0,class:"spin"},z={key:1,class:"icon"},S={class:"text"},I=e.defineComponent({name:"ApDownload",__name:"ap-download",props:{prefixCls:{},type:{default:"link"},htmlType:{},shape:{},size:{default:"middle"},loading:{type:[Boolean,Object]},disabled:{type:Boolean,default:!1},ghost:{type:Boolean},block:{type:Boolean},danger:{type:Boolean},icon:{},href:{},target:{},title:{},onClick:{},onMousedown:{},autoInsertSpace:{type:Boolean},iconPosition:{},color:{},variant:{},text:{},fileName:{},needName:{type:[Boolean,Object],default:void 0},getOssAccess:{}},emits:["downloadCallback"],setup(p,{emit:f}){const l=f,s=e.ref(!1),{lang:m}=O.useLocale(),g=e.useSlots(),C=e.computed(()=>m.value==="zh-cn"?"zh_CN":"en_US"),t=p,a=u.useGlobalConfig("apUpload"),i=u.useGlobalConfig("downloadCenterTriggerConfig"),c=e.computed(()=>t.disabled),y=e.computed(()=>t.size),{getInnerWrapperClass:b}=B.useStyle(y,c),N=e.computed(()=>t.getOssAccess||a.value?.getOssAccess),v=async()=>{if(!t.disabled){s.value=!0;try{if(i.value?.trigger){let n=d.getFileInfo(t.needName??a?.value?.needName,t.fileName).map(r=>({objectName:r.path,fileName:r.fileName}));await i.value?.trigger(n),l("downloadCallback",n)}else{const n=await(await w.useOssInit(N.value,e.unref(C))).downloadFile(d.getFileInfo(t.needName??a?.value?.needName,t.fileName));l("downloadCallback",n)}}catch(o){console.error(o)}finally{s.value=!1}}};return(o,n)=>(e.openBlock(),e.createBlock(e.unref(_.Button),e.mergeProps(e.unref(h.omit)(t,["getOssAccess","fileName","needName"]),{type:t.type,size:t.size,disabled:c.value,onClick:v}),{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(b))},[s.value?(e.openBlock(),e.createElementBlock("span",q,[e.createVNode(e.unref(k.LoadingOutlined),{spin:!0})])):e.createCommentVNode("",!0),e.unref(g).icon?(e.openBlock(),e.createElementBlock("span",z,[e.renderSlot(o.$slots,"icon")])):e.createCommentVNode("",!0),e.createElementVNode("span",S,e.toDisplayString(o.text),1)],2)]),_:3},16,["type","size","disabled"]))}});exports.default=I;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("@ant-design/icons-vue"),_=require("@aplus-frontend/antdv"),I=require("lodash-unified");require("../../config-provider/index.js");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("@ant-design/icons-vue"),_=require("@aplus-frontend/antdv"),I=require("lodash-unified");require("../../config-provider/index.js");const l=require("./hooks/useOss.js"),M=require("./imgs/admin-fallback.jpg.js"),A=require("./imgs/user-fallback.jpg.js"),B=require("./style/index.js"),S=require("../../config-provider/hooks/use-namespace.js"),u=require("../../config-provider/hooks/use-global-config.js"),j=require("../../config-provider/hooks/use-locale.js"),E=e.defineComponent({__name:"ApImage",props:{getOssAccess:{},width:{},height:{},alt:{},fallback:{},src:{},fileName:{},uiMode:{},preview:{type:[Boolean,Object],default:!0}},setup(g){const{b:i}=S.useNamespace("ap-image"),d=B.default("ap-image"),t=g,f={aplus:A.default,admin:M.default},b=u.useGlobalConfig("apImage",{uiMode:"aplus"}),v=u.useGlobalConfig("apUpload"),m=u.useGlobalConfig("downloadCenterTriggerConfig"),h=e.computed(()=>t.uiMode||b.value?.uiMode),{t:k,lang:C}=j.useLocale(),p=e.computed(()=>t.getOssAccess||v.value?.getOssAccess),w=e.computed(()=>f[h.value]||f.aplus),q=e.computed(()=>t?.fallback||w.value),o=e.ref("");l.injectLocaleToOss(k,C),e.watchEffect(async()=>{if(!t?.src){o.value="";return}if(t.src?.startsWith("http")||t.src?.startsWith("data:")){o.value=t.src;return}try{const r=t.src?.match(/^([^:]+):(.*)$/),s=r?.[1],a=r?.[2]??t.src,n=await l.getOssInstance(()=>s?p.value?.(s):p.value?.(),s),c=await l.getSignatureUrl({oss:n,fileName:a});c&&(o.value=c)}catch{o.value=""}});async function O(){if(!t?.src)return;const r=t.src,s=t.fileName??t.src;if(t.src?.startsWith("http")||t.src?.startsWith("data:")){N(r,s);return}if(m.value?.trigger){let a=[{objectName:r,fileName:s}];await m.value?.trigger(a)}}const N=(r,s)=>{const a=document.createElement("a");a.href=r,a.rel="noopener noreferrer",a.setAttribute("download",s),document.body.appendChild(a),a.click(),document.body.removeChild(a)};return(r,s)=>(e.openBlock(),e.createBlock(e.unref(_.Image),e.mergeProps({class:[e.unref(i)(),e.unref(d)]},{...e.unref(I.omit)(t,["src","getOssAccess"]),fallback:q.value,src:o.value}),{toolbarRender:e.withCtx(a=>[e.renderSlot(r.$slots,"toolbarRender",e.normalizeProps(e.guardReactiveProps({...a})),()=>[e.createElementVNode("div",{class:e.normalizeClass([e.unref(i)("toolbar"),e.unref(d)])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.originalNodes,(n,c)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n),e.mergeProps({ref_for:!0},t,{key:c}),null,16))),128)),e.createElementVNode("div",{class:"ant-image-preview-operations-operation",onClick:O},[e.createVNode(e.unref(y.DownloadOutlined))])],2)])]),_:3},16,["class"]))}});exports.default=E;
|
|
@@ -3,7 +3,7 @@ import { Ref } from 'vue';
|
|
|
3
3
|
import { Translator } from '../../../config-provider';
|
|
4
4
|
type GetOssAccess = () => Promise<accessCreate>;
|
|
5
5
|
export declare function injectLocaleToOss(tValue: Translator, langValue: Ref<string>): void;
|
|
6
|
-
export declare function getOssInstance(getOssAccess?: GetOssAccess): Promise<Oss>;
|
|
6
|
+
export declare function getOssInstance(getOssAccess?: GetOssAccess, bucket?: string): Promise<Oss>;
|
|
7
7
|
export declare function getSignatureUrl({ oss, fileName }: {
|
|
8
8
|
oss: Oss;
|
|
9
9
|
fileName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("@aplus-frontend/oss"),p=1e4;let n,i;function O(t,s){n=t,i=s}const f={"zh-cn":"zh_CN",en:"en_US"};function m(){return f[i.value]??"zh_CN"}const c=new Map;async function T(t,s){if(!t)throw new Error(`${n("ap.apUpload.pleasePass")}getOssAccess`);const a=s||"ap_image_default_bucket";let e=c.get(a);return e?.createDate&&e.createDate<Date.now()+p&&e?.oss||(e={oss:new Promise((l,u)=>{const o=g.createOssInstance();o.initOssClient({getOssAccess:t,locale:m(),onFailure:r=>{u(typeof r?.message=="string"?r.message:n("ap.apUpload.FailedToObtainOssTemporaryPermissions"))}}).then(()=>{l(o)})}),createDate:Date.now()},c.set(a,e)),e.oss}function U({oss:t,fileName:s}){return t.getSignatureUrl(s)}exports.getOssInstance=T;exports.getSignatureUrl=U;exports.injectLocaleToOss=O;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { accessCreate } from '@aplus-frontend/oss';
|
|
2
2
|
import { UiModeType } from '../../config-provider';
|
|
3
3
|
export interface ApImageProps {
|
|
4
|
-
getOssAccess?: () => Promise<accessCreate>;
|
|
4
|
+
getOssAccess?: (bucket?: string) => Promise<accessCreate>;
|
|
5
5
|
width?: number | string;
|
|
6
6
|
height?: number | string;
|
|
7
7
|
alt?: string;
|
|
@@ -181,8 +181,8 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
|
|
|
181
181
|
value: string | unknown[] | Record<string, any>;
|
|
182
182
|
maxCount: number;
|
|
183
183
|
maxSize: number;
|
|
184
|
-
getOssAccess: GetOssAccess;
|
|
185
184
|
needName: boolean | Record<string, any>;
|
|
185
|
+
getOssAccess: GetOssAccess;
|
|
186
186
|
accept: string;
|
|
187
187
|
beforeUpload: BeforeUpload;
|
|
188
188
|
onRemove: Function;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DefaultOptionType } from '@aplus-frontend/antdv/es/select';
|
|
2
|
-
import {
|
|
2
|
+
import { accessCreate } from '@aplus-frontend/oss';
|
|
3
3
|
import { InjectionKey, Ref, VNode } from 'vue';
|
|
4
4
|
import { Recordable } from '../type';
|
|
5
5
|
import { ConfigProviderProps } from './config-provider-props';
|
|
@@ -18,7 +18,7 @@ export type ApiType = {
|
|
|
18
18
|
};
|
|
19
19
|
export type ApUploadConfig = {
|
|
20
20
|
dirName?: string;
|
|
21
|
-
getOssAccess?:
|
|
21
|
+
getOssAccess?: (bucket?: string) => Promise<accessCreate>;
|
|
22
22
|
needName?: boolean | {
|
|
23
23
|
pathKey?: string;
|
|
24
24
|
nameKey?: string;
|
package/lib/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.10.
|
|
1
|
+
declare const _default: "7.10.4";
|
|
2
2
|
export default _default;
|
package/lib/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.10.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.10.4";exports.default=e;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aplus-frontend/ui",
|
|
3
|
-
"version": "7.10.
|
|
3
|
+
"version": "7.10.4",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -46,14 +46,14 @@
|
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@aplus-frontend/antdv": "^1.3.5",
|
|
48
48
|
"@aplus-frontend/icon": "^2.0.4",
|
|
49
|
-
"@aplus-frontend/oss": "^1.1.
|
|
49
|
+
"@aplus-frontend/oss": "^1.1.10",
|
|
50
50
|
"vue": "^3.5.21",
|
|
51
51
|
"vxe-table": "^4.13.37"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@aplus-frontend/antdv": "^1.3.5",
|
|
55
55
|
"@aplus-frontend/icon": "^2.0.4",
|
|
56
|
-
"@aplus-frontend/oss": "^1.1.
|
|
56
|
+
"@aplus-frontend/oss": "^1.1.10",
|
|
57
57
|
"@emotion/serialize": "^1.3.3",
|
|
58
58
|
"@types/sortablejs": "^1.15.8",
|
|
59
59
|
"axios": "^1.7.2",
|