@aplus-frontend/ui 0.1.27 → 0.1.28
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/ap-download/ap-download.vue.d.ts +6 -2
- package/es/src/ap-download/ap-download.vue.mjs +48 -28
- package/es/src/ap-download/interface.d.ts +3 -2
- package/es/src/ap-download/style/ap-download.css +3 -0
- package/es/src/ap-field/select/index.vue.mjs +65 -63
- package/es/src/business/ap-attachment/ApAttachment.mjs +79 -59
- package/es/src/business/ap-attachment/interface.d.ts +1 -1
- package/es/src/business/ap-attachment/style.css +4 -0
- package/es/src/business/ap-input-radio/interface.d.ts +1 -1
- package/es/src/business/index.d.ts +0 -2
- package/es/src/theme/ap-attachment/ap-attachment.css +4 -0
- package/es/src/theme/ap-download/ap-download.css +3 -0
- package/lib/src/ap-download/ap-download.vue.d.ts +6 -2
- package/lib/src/ap-download/ap-download.vue.js +1 -1
- package/lib/src/ap-download/interface.d.ts +3 -2
- package/lib/src/ap-download/style/ap-download.css +3 -0
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
- package/lib/src/business/ap-attachment/interface.d.ts +1 -1
- package/lib/src/business/ap-attachment/style.css +4 -0
- package/lib/src/business/ap-input-radio/interface.d.ts +1 -1
- package/lib/src/business/index.d.ts +0 -2
- package/lib/src/theme/ap-attachment/ap-attachment.css +4 -0
- package/lib/src/theme/ap-download/ap-download.css +3 -0
- package/package.json +1 -1
|
@@ -13,11 +13,15 @@ declare const __VLS_component: DefineComponent<__VLS_WithDefaults<__VLS_TypeProp
|
|
|
13
13
|
type: string;
|
|
14
14
|
size: string;
|
|
15
15
|
disabled: boolean;
|
|
16
|
-
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
16
|
+
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
17
|
+
downloadCallback: (...args: any[]) => void;
|
|
18
|
+
}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ApDownLoadProps>, {
|
|
17
19
|
type: string;
|
|
18
20
|
size: string;
|
|
19
21
|
disabled: boolean;
|
|
20
|
-
}
|
|
22
|
+
}>>> & {
|
|
23
|
+
onDownloadCallback?: ((...args: any[]) => any) | undefined;
|
|
24
|
+
}, {
|
|
21
25
|
size: "small" | "large" | "middle";
|
|
22
26
|
type: ButtonType;
|
|
23
27
|
disabled: boolean;
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Button as
|
|
1
|
+
import { defineComponent as z, ref as N, useSlots as O, computed as t, unref as s, openBlock as l, createBlock as F, mergeProps as x, withCtx as A, createElementVNode as r, normalizeClass as S, createElementBlock as c, createVNode as I, createCommentVNode as d, renderSlot as L, toDisplayString as M } from "vue";
|
|
2
|
+
import { Button as U } from "ant-design-vue";
|
|
3
|
+
import { LoadingOutlined as V } from "@ant-design/icons-vue";
|
|
3
4
|
import "../config-provider/index.mjs";
|
|
4
|
-
import { useOssInit as
|
|
5
|
+
import { useOssInit as j } from "./hooks/index.mjs";
|
|
5
6
|
import "./style/ap-download.css";
|
|
6
|
-
import { getFileInfo as
|
|
7
|
-
import { useStyle as
|
|
8
|
-
import { useLocale as
|
|
9
|
-
import { useGlobalConfig as
|
|
10
|
-
const
|
|
7
|
+
import { getFileInfo as D } from "./utils/getFileInfo.mjs";
|
|
8
|
+
import { useStyle as E } from "./hooks/useStyle.mjs";
|
|
9
|
+
import { useLocale as G } from "../config-provider/hooks/use-locale.mjs";
|
|
10
|
+
import { useGlobalConfig as p } from "../config-provider/hooks/use-global-config.mjs";
|
|
11
|
+
const P = {
|
|
11
12
|
key: 0,
|
|
13
|
+
class: "spin"
|
|
14
|
+
}, R = {
|
|
15
|
+
key: 1,
|
|
12
16
|
class: "icon"
|
|
13
|
-
},
|
|
17
|
+
}, T = { class: "text" }, ee = /* @__PURE__ */ z({
|
|
14
18
|
name: "ApDownload",
|
|
15
19
|
__name: "ap-download",
|
|
16
20
|
props: {
|
|
@@ -36,30 +40,46 @@ const U = {
|
|
|
36
40
|
needName: { type: [Boolean, Object] },
|
|
37
41
|
getOssAccess: {}
|
|
38
42
|
},
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
emits: ["downloadCallback"],
|
|
44
|
+
setup(m, { emit: u }) {
|
|
45
|
+
const f = u, n = N(!1), { lang: g } = G(), y = O(), C = t(() => g.value === "zh-cn" ? "zh_CN" : "en_US"), _ = p("uiMode"), e = m, b = p("apUpload"), a = t(() => e.disabled), h = t(() => e.color ? e.color : _.value === "aplus" ? "#0070FF" : "#1890FF"), k = t(() => e.size), { getInnerWrapperClass: w } = E(h, k, a), B = t(() => {
|
|
41
46
|
var o;
|
|
42
|
-
return e.getOssAccess || ((o =
|
|
43
|
-
}),
|
|
44
|
-
e.disabled
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
return e.getOssAccess || ((o = b.value) == null ? void 0 : o.getOssAccess);
|
|
48
|
+
}), v = async () => {
|
|
49
|
+
if (!e.disabled) {
|
|
50
|
+
n.value = !0;
|
|
51
|
+
try {
|
|
52
|
+
const i = await (await j(
|
|
53
|
+
B.value,
|
|
54
|
+
s(C)
|
|
55
|
+
)).downloadFile(
|
|
56
|
+
D(e.needName, e.fileName)
|
|
57
|
+
);
|
|
58
|
+
f("downloadCallback", i);
|
|
59
|
+
} catch (o) {
|
|
60
|
+
console.error(o);
|
|
61
|
+
} finally {
|
|
62
|
+
n.value = !1;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
48
65
|
};
|
|
49
|
-
return (o,
|
|
66
|
+
return (o, i) => (l(), F(s(U), x(e, {
|
|
50
67
|
type: e.type,
|
|
51
68
|
size: e.size,
|
|
52
|
-
disabled:
|
|
53
|
-
onClick:
|
|
69
|
+
disabled: a.value,
|
|
70
|
+
onClick: v
|
|
54
71
|
}), {
|
|
55
|
-
default:
|
|
56
|
-
|
|
57
|
-
class:
|
|
72
|
+
default: A(() => [
|
|
73
|
+
r("div", {
|
|
74
|
+
class: S(s(w))
|
|
58
75
|
}, [
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
])) :
|
|
62
|
-
|
|
76
|
+
n.value ? (l(), c("span", P, [
|
|
77
|
+
I(s(V), { spin: !0 })
|
|
78
|
+
])) : d("", !0),
|
|
79
|
+
s(y).icon ? (l(), c("span", R, [
|
|
80
|
+
L(o.$slots, "icon")
|
|
81
|
+
])) : d("", !0),
|
|
82
|
+
r("span", T, M(o.text), 1)
|
|
63
83
|
], 2)
|
|
64
84
|
]),
|
|
65
85
|
_: 3
|
|
@@ -67,5 +87,5 @@ const U = {
|
|
|
67
87
|
}
|
|
68
88
|
});
|
|
69
89
|
export {
|
|
70
|
-
|
|
90
|
+
ee as default
|
|
71
91
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { accessCreate } from '@aplus-frontend/oss';
|
|
2
|
-
import { ButtonProps } from 'ant-design-vue/es/
|
|
1
|
+
import { accessCreate, client } from '@aplus-frontend/oss';
|
|
2
|
+
import { ButtonProps } from 'ant-design-vue/es/button';
|
|
3
3
|
/**
|
|
4
4
|
* 类型转换为单例和数组
|
|
5
5
|
*/
|
|
@@ -37,4 +37,5 @@ export declare enum ApDownLoadNeedNameKeyDefault {
|
|
|
37
37
|
nameKey = "name",
|
|
38
38
|
pathKey = "path"
|
|
39
39
|
}
|
|
40
|
+
export type actionResponse = Awaited<ReturnType<typeof client.downloadFile>>;
|
|
40
41
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { debounce as
|
|
3
|
-
import { Select as
|
|
1
|
+
import { defineComponent as T, ref as p, onMounted as _, computed as y, unref as u, openBlock as w, createElementBlock as R, toDisplayString as z, createBlock as D, mergeProps as U, createSlots as L, renderList as K, withCtx as S, renderSlot as H, normalizeProps as $, guardReactiveProps as j, createVNode as E } from "vue";
|
|
2
|
+
import { debounce as W, isFunction as g, isArray as G, isNil as J, omit as Q } from "lodash-unified";
|
|
3
|
+
import { Select as X, Spin as Y } from "ant-design-vue";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
5
|
-
import { omitUndefined as
|
|
6
|
-
import { useDefaultPlaceholder as
|
|
7
|
-
import { useControllableValue as
|
|
8
|
-
const
|
|
5
|
+
import { omitUndefined as Z } from "../../utils/index.mjs";
|
|
6
|
+
import { useDefaultPlaceholder as ee } from "../hooks/use-default-placeholder.mjs";
|
|
7
|
+
import { useControllableValue as oe } from "../../hooks/useControllableValue.mjs";
|
|
8
|
+
const te = { key: 0 }, se = /* @__PURE__ */ T({
|
|
9
9
|
name: "ApFieldSelect",
|
|
10
10
|
__name: "index",
|
|
11
11
|
props: {
|
|
@@ -93,27 +93,27 @@ const Y = { key: 0 }, re = /* @__PURE__ */ k({
|
|
|
93
93
|
lazy: { type: Boolean, default: !1 }
|
|
94
94
|
},
|
|
95
95
|
emits: ["update:value"],
|
|
96
|
-
setup(
|
|
96
|
+
setup(B, { expose: F, emit: b }) {
|
|
97
97
|
let n = 0;
|
|
98
|
-
const
|
|
99
|
-
if (!
|
|
98
|
+
const C = W((o) => {
|
|
99
|
+
if (!g(e.request))
|
|
100
100
|
return;
|
|
101
101
|
n += 1;
|
|
102
102
|
const t = n;
|
|
103
|
-
i.value = [],
|
|
103
|
+
i.value = [], r.value = !0, e.request(o).then((l) => {
|
|
104
104
|
n === t && (i.value = l);
|
|
105
105
|
}).finally(() => {
|
|
106
|
-
|
|
106
|
+
r.value = !1;
|
|
107
107
|
});
|
|
108
|
-
}, 300), e =
|
|
109
|
-
var
|
|
110
|
-
const l = ((
|
|
108
|
+
}, 300), e = B, N = (o, t) => {
|
|
109
|
+
var a;
|
|
110
|
+
const l = ((a = e.fieldNames) == null ? void 0 : a.label) || "label";
|
|
111
111
|
return typeof (t == null ? void 0 : t[l]) == "string" && t[l].indexOf(o) > -1;
|
|
112
|
-
}, i =
|
|
113
|
-
async function
|
|
114
|
-
if (!
|
|
112
|
+
}, i = p((e == null ? void 0 : e.options) || []), s = p(), r = p((e == null ? void 0 : e.loading) || !1), x = b;
|
|
113
|
+
async function c(o = !0) {
|
|
114
|
+
if (!g(e.request))
|
|
115
115
|
return;
|
|
116
|
-
|
|
116
|
+
r.value = !0, n += 1;
|
|
117
117
|
const t = n;
|
|
118
118
|
try {
|
|
119
119
|
o && (i.value = []);
|
|
@@ -122,47 +122,49 @@ const Y = { key: 0 }, re = /* @__PURE__ */ k({
|
|
|
122
122
|
return;
|
|
123
123
|
i.value = l;
|
|
124
124
|
} finally {
|
|
125
|
-
|
|
125
|
+
r.value = !1;
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function I(o) {
|
|
129
129
|
var t;
|
|
130
|
-
(t = e.onFocus) == null || t.call(e, o), e.refetchOnFocus && n > 0 && !
|
|
130
|
+
(t = e.onFocus) == null || t.call(e, o), e.refetchOnFocus && n > 0 && !r.value && c(!0);
|
|
131
131
|
}
|
|
132
|
-
|
|
132
|
+
_(() => {
|
|
133
133
|
if (e.lazy) {
|
|
134
134
|
n += 1;
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
|
-
|
|
137
|
+
c();
|
|
138
138
|
});
|
|
139
|
-
const { value:
|
|
140
|
-
|
|
139
|
+
const { value: m, updateValue: O } = oe(e, x), P = ee("Select", e), V = y(() => {
|
|
140
|
+
var d, v;
|
|
141
|
+
const o = u(m);
|
|
141
142
|
if (!o)
|
|
142
143
|
return e.emptyText;
|
|
143
|
-
|
|
144
|
+
const t = ((d = e.fieldNames) == null ? void 0 : d.label) || "label", l = ((v = e.fieldNames) == null ? void 0 : v.value) || "value";
|
|
145
|
+
if (G(o))
|
|
144
146
|
return o.map(
|
|
145
|
-
(
|
|
146
|
-
var
|
|
147
|
-
return (
|
|
147
|
+
(f) => {
|
|
148
|
+
var h;
|
|
149
|
+
return (h = u(i).find((M) => M[l] === f)) == null ? void 0 : h[t];
|
|
148
150
|
}
|
|
149
151
|
).filter(Boolean).join("、") || e.emptyText;
|
|
150
|
-
const
|
|
151
|
-
return (
|
|
152
|
-
}),
|
|
152
|
+
const a = u(i).find((f) => f.value === o);
|
|
153
|
+
return (a == null ? void 0 : a.label) || e.emptyText;
|
|
154
|
+
}), k = y(() => {
|
|
153
155
|
const o = !!(e != null && e.showSearch), t = e.searchMode;
|
|
154
156
|
let l = {};
|
|
155
157
|
return o && (l = t === "request" ? {
|
|
156
158
|
showArrow: !1,
|
|
157
159
|
defaultActiveFirstOption: !1,
|
|
158
|
-
onSearch:
|
|
159
|
-
notFoundContent:
|
|
160
|
+
onSearch: C,
|
|
161
|
+
notFoundContent: r.value ? void 0 : null
|
|
160
162
|
} : {
|
|
161
163
|
showArrow: !0,
|
|
162
|
-
filterOption:
|
|
164
|
+
filterOption: J(e == null ? void 0 : e.filterOption) ? N : e == null ? void 0 : e.filterOption
|
|
163
165
|
}), {
|
|
164
|
-
...
|
|
165
|
-
|
|
166
|
+
...Z(
|
|
167
|
+
Q(e, [
|
|
166
168
|
"mode",
|
|
167
169
|
"value",
|
|
168
170
|
"onUpdate:value",
|
|
@@ -172,45 +174,45 @@ const Y = { key: 0 }, re = /* @__PURE__ */ k({
|
|
|
172
174
|
"onFocus"
|
|
173
175
|
])
|
|
174
176
|
),
|
|
175
|
-
placeholder: u(
|
|
177
|
+
placeholder: u(P),
|
|
176
178
|
...l
|
|
177
179
|
};
|
|
178
180
|
});
|
|
179
|
-
function
|
|
181
|
+
function q() {
|
|
180
182
|
var o;
|
|
181
|
-
(o =
|
|
183
|
+
(o = s.value) == null || o.focus();
|
|
182
184
|
}
|
|
183
|
-
function
|
|
185
|
+
function A() {
|
|
184
186
|
var o;
|
|
185
|
-
(o =
|
|
187
|
+
(o = s.value) == null || o.blur();
|
|
186
188
|
}
|
|
187
|
-
return
|
|
188
|
-
focus:
|
|
189
|
-
blur:
|
|
190
|
-
request:
|
|
191
|
-
}), (o, t) => o.mode === "read" ? (
|
|
189
|
+
return F({
|
|
190
|
+
focus: q,
|
|
191
|
+
blur: A,
|
|
192
|
+
request: c
|
|
193
|
+
}), (o, t) => o.mode === "read" ? (w(), R("span", te, z(V.value), 1)) : (w(), D(u(X), U({
|
|
192
194
|
key: 1,
|
|
193
195
|
"allow-clear": "",
|
|
194
196
|
ref_key: "selectRef",
|
|
195
|
-
ref:
|
|
196
|
-
},
|
|
197
|
+
ref: s
|
|
198
|
+
}, k.value, {
|
|
197
199
|
mode: o.multiple ? "multiple" : void 0,
|
|
198
|
-
value: u(
|
|
199
|
-
"onUpdate:value": u(
|
|
200
|
+
value: u(m),
|
|
201
|
+
"onUpdate:value": u(O),
|
|
200
202
|
options: i.value,
|
|
201
|
-
loading:
|
|
202
|
-
onFocus:
|
|
203
|
-
}),
|
|
204
|
-
|
|
205
|
-
name:
|
|
206
|
-
fn:
|
|
207
|
-
|
|
203
|
+
loading: r.value,
|
|
204
|
+
onFocus: I
|
|
205
|
+
}), L({ _: 2 }, [
|
|
206
|
+
K(o.$slots, (l, a) => ({
|
|
207
|
+
name: a,
|
|
208
|
+
fn: S((d) => [
|
|
209
|
+
H(o.$slots, a, $(j(d || {})))
|
|
208
210
|
])
|
|
209
211
|
})),
|
|
210
|
-
|
|
212
|
+
r.value ? {
|
|
211
213
|
name: "notFoundContent",
|
|
212
|
-
fn:
|
|
213
|
-
|
|
214
|
+
fn: S(() => [
|
|
215
|
+
E(u(Y), { size: "small" })
|
|
214
216
|
]),
|
|
215
217
|
key: "0"
|
|
216
218
|
} : void 0
|
|
@@ -218,5 +220,5 @@ const Y = { key: 0 }, re = /* @__PURE__ */ k({
|
|
|
218
220
|
}
|
|
219
221
|
});
|
|
220
222
|
export {
|
|
221
|
-
|
|
223
|
+
se as default
|
|
222
224
|
};
|
|
@@ -1,85 +1,105 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Tooltip as
|
|
1
|
+
import { defineComponent as S, ref as A, useSlots as V, computed as o, cloneVNode as z, unref as I, toRaw as f, createVNode as l, createTextVNode as M } from "vue";
|
|
2
|
+
import { Tooltip as U, Popover as _ } from "ant-design-vue";
|
|
3
3
|
import "../../config-provider/index.mjs";
|
|
4
|
-
import { ApAttachmentProps as
|
|
5
|
-
import { getHexWithOpacity as
|
|
4
|
+
import { ApAttachmentProps as B } from "./constans.mjs";
|
|
5
|
+
import { getHexWithOpacity as G, getFileInfo as H } from "../../ap-download/utils/getFileInfo.mjs";
|
|
6
6
|
import "./style.css";
|
|
7
|
-
import { useOssInit as
|
|
8
|
-
import { isArray as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
7
|
+
import { useOssInit as R } from "../../ap-download/hooks/index.mjs";
|
|
8
|
+
import { isArray as W } from "lodash-unified";
|
|
9
|
+
import { LoadingOutlined as v } from "@ant-design/icons-vue";
|
|
10
|
+
import { useNamespace as j } from "../../config-provider/hooks/use-namespace.mjs";
|
|
11
|
+
import { useGlobalConfig as y } from "../../config-provider/hooks/use-global-config.mjs";
|
|
12
|
+
import { useLocale as q } from "../../config-provider/hooks/use-locale.mjs";
|
|
13
|
+
const at = /* @__PURE__ */ S({
|
|
13
14
|
name: "ApAttachment",
|
|
14
|
-
props:
|
|
15
|
+
props: B(),
|
|
15
16
|
setup(t) {
|
|
16
17
|
const {
|
|
17
|
-
b:
|
|
18
|
-
e:
|
|
19
|
-
} =
|
|
20
|
-
lang:
|
|
21
|
-
t:
|
|
22
|
-
} =
|
|
23
|
-
width:
|
|
24
|
-
})),
|
|
25
|
-
"--download-main-color":
|
|
26
|
-
"--download-main-color-opacity":
|
|
27
|
-
})),
|
|
18
|
+
b: L,
|
|
19
|
+
e: a
|
|
20
|
+
} = j("ap-attachment"), w = y("uiMode"), C = y("apUpload"), {
|
|
21
|
+
lang: F,
|
|
22
|
+
t: r
|
|
23
|
+
} = q(), c = A(!1), s = A(""), m = V(), N = o(() => F.value === "zh-cn" ? "zh_CN" : "en_US"), u = o(() => t.attachmentList.length === 1), p = o(() => t.attachmentList.length > 0 ? t.attachmentList[0].fileName : ""), O = o(() => u.value ? p.value : r("ap.apAttachment.downloadall")), h = o(() => t.color ? t.color : w.value === "aplus" ? "#0070FF" : "#1890FF"), T = o(() => ({
|
|
24
|
+
width: u.value ? "auto" : "266px"
|
|
25
|
+
})), g = o(() => ({
|
|
26
|
+
"--download-main-color": h.value,
|
|
27
|
+
"--download-main-color-opacity": G(h.value, 0.6)
|
|
28
|
+
})), b = o(() => {
|
|
28
29
|
var e;
|
|
29
|
-
return t.getOssAccess || ((e =
|
|
30
|
-
}),
|
|
31
|
-
const e =
|
|
32
|
-
return e ?
|
|
30
|
+
return t.getOssAccess || ((e = C.value) == null ? void 0 : e.getOssAccess);
|
|
31
|
+
}), x = o(() => {
|
|
32
|
+
const e = m.default ? m.default()[0] : null;
|
|
33
|
+
return e ? z(e, {
|
|
33
34
|
style: {
|
|
34
35
|
"font-size": "16px"
|
|
35
36
|
}
|
|
36
37
|
}) : null;
|
|
37
|
-
}),
|
|
38
|
+
}), d = async (e, i) => {
|
|
38
39
|
if (!t.disabled) {
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
c.value = !0, i && (s.value = i);
|
|
41
|
+
try {
|
|
42
|
+
const n = await R(b.value, I(N)), k = W(f(e)) ? f(e) : [f(e)];
|
|
43
|
+
await n.downloadFile(H(t.needName, k));
|
|
44
|
+
} catch (n) {
|
|
45
|
+
console.error(n);
|
|
46
|
+
} finally {
|
|
47
|
+
c.value = !1, s.value = "";
|
|
48
|
+
}
|
|
41
49
|
}
|
|
42
|
-
},
|
|
43
|
-
class: [
|
|
44
|
-
style:
|
|
45
|
-
}, [e.map((
|
|
46
|
-
key:
|
|
47
|
-
class: [
|
|
48
|
-
onClick: () =>
|
|
49
|
-
}, [c.
|
|
50
|
-
class: [
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
}, P = (e) => e && e.length > 0 ? l("ul", {
|
|
51
|
+
class: [a("file-list")],
|
|
52
|
+
style: g.value
|
|
53
|
+
}, [e.map((i, n) => l("li", {
|
|
54
|
+
key: n,
|
|
55
|
+
class: [a("file-item")],
|
|
56
|
+
onClick: () => d(i, n + 1)
|
|
57
|
+
}, [c.value && s.value === n + 1 ? l("span", {
|
|
58
|
+
class: [a("spin")]
|
|
59
|
+
}, [l(v, {
|
|
60
|
+
spin: !0
|
|
61
|
+
}, null)]) : null, i.fileName])), l("li", {
|
|
62
|
+
class: [a("down-load-all")],
|
|
63
|
+
onClick: () => d(t.attachmentList, "all")
|
|
64
|
+
}, [c.value && s.value === "all" ? l("span", {
|
|
65
|
+
class: [a("spin")]
|
|
66
|
+
}, [l(v, {
|
|
67
|
+
spin: !0
|
|
68
|
+
}, null)]) : null, r("ap.apAttachment.downloadall")])]) : null;
|
|
53
69
|
return () => {
|
|
54
70
|
var e;
|
|
55
|
-
return ((e = t.attachmentList) == null ? void 0 : e.length) > 0 &&
|
|
56
|
-
class: [
|
|
57
|
-
style: [
|
|
58
|
-
}, [
|
|
59
|
-
title:
|
|
71
|
+
return ((e = t.attachmentList) == null ? void 0 : e.length) > 0 && l("div", {
|
|
72
|
+
class: [L()],
|
|
73
|
+
style: [T.value, g.value]
|
|
74
|
+
}, [l(U, {
|
|
75
|
+
title: O.value,
|
|
60
76
|
placement: t.textToolTipPlacement,
|
|
61
77
|
color: t.toolTipBgColor
|
|
62
78
|
}, {
|
|
63
|
-
default: () => [
|
|
64
|
-
class: [
|
|
65
|
-
onClick: () =>
|
|
66
|
-
}, [s.
|
|
67
|
-
class: [
|
|
68
|
-
}, [
|
|
69
|
-
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
|
|
79
|
+
default: () => [l("div", {
|
|
80
|
+
class: [a("content")],
|
|
81
|
+
onClick: () => d(u.value ? t.attachmentList[0] : t.attachmentList, "global")
|
|
82
|
+
}, [c.value && s.value === "global" ? l("div", {
|
|
83
|
+
class: [a("spin")]
|
|
84
|
+
}, [l(v, {
|
|
85
|
+
spin: !0
|
|
86
|
+
}, null)]) : null, m.default ? l("div", {
|
|
87
|
+
class: [a("text-render")]
|
|
88
|
+
}, [x.value, M(" ")]) : null, l("div", {
|
|
89
|
+
class: [a("text-inner")]
|
|
90
|
+
}, [p.value])])]
|
|
91
|
+
}), l(_, {
|
|
92
|
+
content: P(t.attachmentList),
|
|
73
93
|
placement: t.fileMorePopoverPlacement,
|
|
74
94
|
color: "#fff"
|
|
75
95
|
}, {
|
|
76
|
-
default: () => [!
|
|
77
|
-
class: [
|
|
78
|
-
}, [
|
|
96
|
+
default: () => [!u.value && l("div", {
|
|
97
|
+
class: [a("more")]
|
|
98
|
+
}, [r("ap.apAttachment.more")])]
|
|
79
99
|
})]);
|
|
80
100
|
};
|
|
81
101
|
}
|
|
82
102
|
});
|
|
83
103
|
export {
|
|
84
|
-
|
|
104
|
+
at as default
|
|
85
105
|
};
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
.aplus-ap-attachment__text-render:hover {
|
|
14
14
|
color: var(--download-main-color-opacity);
|
|
15
15
|
}
|
|
16
|
+
.aplus-ap-attachment__spin {
|
|
17
|
+
float: left;
|
|
18
|
+
margin-right: 5px;
|
|
19
|
+
}
|
|
16
20
|
.aplus-ap-attachment__text-inner {
|
|
17
21
|
max-width: 190px;
|
|
18
22
|
display: inline-block;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InputNumberProps } from 'ant-design-vue/es/input-number';
|
|
2
2
|
type ApInputProps = Pick<InputNumberProps, 'disabled' | 'stringMode' | 'precision' | 'max' | 'min' | 'step' | 'bordered' | 'autofocus' | 'decimalSeparator' | 'controls' | 'formatter' | 'onInput' | 'onChange' | 'onPressEnter' | 'onStep' | 'onBlur' | 'onFocus'>;
|
|
3
3
|
export type ApInputValType = {
|
|
4
|
-
value
|
|
4
|
+
value?: {
|
|
5
5
|
inputVal: string | number;
|
|
6
6
|
radioVal: string | number;
|
|
7
7
|
};
|
|
@@ -1110,7 +1110,6 @@ export declare const ApInputRadio: DefineComponent<{
|
|
|
1110
1110
|
inputVal: string | number;
|
|
1111
1111
|
radioVal: string | number;
|
|
1112
1112
|
}>;
|
|
1113
|
-
required: true;
|
|
1114
1113
|
};
|
|
1115
1114
|
disabled: {
|
|
1116
1115
|
type: PropType<boolean>;
|
|
@@ -1194,7 +1193,6 @@ export declare const ApInputRadio: DefineComponent<{
|
|
|
1194
1193
|
inputVal: string | number;
|
|
1195
1194
|
radioVal: string | number;
|
|
1196
1195
|
}>;
|
|
1197
|
-
required: true;
|
|
1198
1196
|
};
|
|
1199
1197
|
disabled: {
|
|
1200
1198
|
type: PropType<boolean>;
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
.aplus-ap-attachment__text-render:hover {
|
|
14
14
|
color: var(--download-main-color-opacity);
|
|
15
15
|
}
|
|
16
|
+
.aplus-ap-attachment__spin {
|
|
17
|
+
float: left;
|
|
18
|
+
margin-right: 5px;
|
|
19
|
+
}
|
|
16
20
|
.aplus-ap-attachment__text-inner {
|
|
17
21
|
max-width: 190px;
|
|
18
22
|
display: inline-block;
|
|
@@ -13,11 +13,15 @@ declare const __VLS_component: DefineComponent<__VLS_WithDefaults<__VLS_TypeProp
|
|
|
13
13
|
type: string;
|
|
14
14
|
size: string;
|
|
15
15
|
disabled: boolean;
|
|
16
|
-
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
16
|
+
}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
17
|
+
downloadCallback: (...args: any[]) => void;
|
|
18
|
+
}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ApDownLoadProps>, {
|
|
17
19
|
type: string;
|
|
18
20
|
size: string;
|
|
19
21
|
disabled: boolean;
|
|
20
|
-
}
|
|
22
|
+
}>>> & {
|
|
23
|
+
onDownloadCallback?: ((...args: any[]) => any) | undefined;
|
|
24
|
+
}, {
|
|
21
25
|
size: "small" | "large" | "middle";
|
|
22
26
|
type: ButtonType;
|
|
23
27
|
disabled: boolean;
|
|
@@ -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"),k=require("ant-design-vue"),B=require("@ant-design/icons-vue");require("../config-provider/index.js");const h=require("./hooks/index.js");require("./style/ap-download.css");const v=require("./utils/getFileInfo.js"),q=require("./hooks/useStyle.js"),w=require("../config-provider/hooks/use-locale.js"),a=require("../config-provider/hooks/use-global-config.js"),N={key:0,class:"spin"},z={key:1,class:"icon"},O={class:"text"},S=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:{},text:{},color:{},fileName:{},needName:{type:[Boolean,Object]},getOssAccess:{}},emits:["downloadCallback"],setup(c,{emit:r}){const i=r,s=e.ref(!1),{lang:u}=w.useLocale(),d=e.useSlots(),p=e.computed(()=>u.value==="zh-cn"?"zh_CN":"en_US"),f=a.useGlobalConfig("uiMode"),o=c,m=a.useGlobalConfig("apUpload"),n=e.computed(()=>o.disabled),g=e.computed(()=>o.color?o.color:f.value==="aplus"?"#0070FF":"#1890FF"),y=e.computed(()=>o.size),{getInnerWrapperClass:C}=q.useStyle(g,y,n),b=e.computed(()=>{var t;return o.getOssAccess||((t=m.value)==null?void 0:t.getOssAccess)}),_=async()=>{if(!o.disabled){s.value=!0;try{const l=await(await h.useOssInit(b.value,e.unref(p))).downloadFile(v.getFileInfo(o.needName,o.fileName));i("downloadCallback",l)}catch(t){console.error(t)}finally{s.value=!1}}};return(t,l)=>(e.openBlock(),e.createBlock(e.unref(k.Button),e.mergeProps(o,{type:o.type,size:o.size,disabled:n.value,onClick:_}),{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(C))},[s.value?(e.openBlock(),e.createElementBlock("span",N,[e.createVNode(e.unref(B.LoadingOutlined),{spin:!0})])):e.createCommentVNode("",!0),e.unref(d).icon?(e.openBlock(),e.createElementBlock("span",z,[e.renderSlot(t.$slots,"icon")])):e.createCommentVNode("",!0),e.createElementVNode("span",O,e.toDisplayString(t.text),1)],2)]),_:3},16,["type","size","disabled"]))}});exports.default=S;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { accessCreate } from '@aplus-frontend/oss';
|
|
2
|
-
import { ButtonProps } from 'ant-design-vue/es/
|
|
1
|
+
import { accessCreate, client } from '@aplus-frontend/oss';
|
|
2
|
+
import { ButtonProps } from 'ant-design-vue/es/button';
|
|
3
3
|
/**
|
|
4
4
|
* 类型转换为单例和数组
|
|
5
5
|
*/
|
|
@@ -37,4 +37,5 @@ export declare enum ApDownLoadNeedNameKeyDefault {
|
|
|
37
37
|
nameKey = "name",
|
|
38
38
|
pathKey = "path"
|
|
39
39
|
}
|
|
40
|
+
export type actionResponse = Awaited<ReturnType<typeof client.downloadFile>>;
|
|
40
41
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),s=require("lodash-unified"),y=require("ant-design-vue");require("../../hooks/index.js");const M=require("../../utils/index.js"),k=require("../hooks/use-default-placeholder.js"),T=require("../../hooks/useControllableValue.js"),_={key:0},A=t.defineComponent({name:"ApFieldSelect",__name:"index",props:{mode:{default:"edit"},class:{},style:{},defaultValue:{},notFoundContent:{},suffixIcon:{},itemIcon:{},size:{},bordered:{type:Boolean,default:void 0},transitionName:{},choiceTransitionName:{},popupClassName:{},dropdownClassName:{},placement:{},status:{},children:{},listHeight:{},onMouseenter:{},onMouseleave:{},tabindex:{},onClick:{},onFocus:{},onBlur:{},onChange:{},onKeydown:{},onKeyup:{},onMousedown:{},onSelect:{},open:{type:Boolean,default:void 0},animation:{},direction:{},disabled:{type:Boolean,default:void 0},prefixCls:{},id:{},autofocus:{type:Boolean,default:void 0},getPopupContainer:{},virtual:{type:Boolean,default:void 0},dropdownMatchSelectWidth:{},options:{},showAction:{},onDeselect:{},loading:{type:Boolean,default:void 0},placeholder:{},clearIcon:{},allowClear:{type:Boolean,default:!0},fieldNames:{},dropdownStyle:{},dropdownRender:{},dropdownAlign:{},showSearch:{type:Boolean,default:void 0},searchValue:{},onInputKeyDown:{},removeIcon:{},maxTagCount:{},maxTagTextLength:{},maxTagPlaceholder:{},tokenSeparators:{},tagRender:{},optionLabelRender:{},onClear:{},defaultOpen:{type:Boolean,default:void 0},onDropdownVisibleChange:{},showArrow:{type:Boolean,default:void 0},onPopupScroll:{},menuItemSelectedIcon:{},listItemHeight:{},inputValue:{},autoClearSearchValue:{type:Boolean,default:void 0},filterOption:{},filterSort:{},optionFilterProp:{},optionLabelProp:{},defaultActiveFirstOption:{type:Boolean,default:void 0},labelInValue:{type:Boolean,default:void 0},emptyText:{default:"--"},request:{},multiple:{type:Boolean,default:void 0},value:{},"onUpdate:value":{},searchMode:{default:"filter"},refetchOnFocus:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1}},emits:["update:value"],setup(g,{expose:w,emit:S}){let u=0;const B=s.debounce(o=>{if(!s.isFunction(e.request))return;u+=1;const l=u;i.value=[],r.value=!0,e.request(o).then(n=>{u===l&&(i.value=n)}).finally(()=>{r.value=!1})},300),e=g,b=(o,l)=>{var a;const n=((a=e.fieldNames)==null?void 0:a.label)||"label";return typeof(l==null?void 0:l[n])=="string"&&l[n].indexOf(o)>-1},i=t.ref((e==null?void 0:e.options)||[]),c=t.ref(),r=t.ref((e==null?void 0:e.loading)||!1),F=S;async function f(o=!0){if(!s.isFunction(e.request))return;r.value=!0,u+=1;const l=u;try{o&&(i.value=[]);const n=await e.request();if(l!==u)return;i.value=n}finally{r.value=!1}}function C(o){var l;(l=e.onFocus)==null||l.call(e,o),e.refetchOnFocus&&u>0&&!r.value&&f(!0)}t.onMounted(()=>{if(e.lazy){u+=1;return}f()});const{value:v,updateValue:q}=T.useControllableValue(e,F),x=k.useDefaultPlaceholder("Select",e),N=t.computed(()=>{var d,m;const o=t.unref(v);if(!o)return e.emptyText;const l=((d=e.fieldNames)==null?void 0:d.label)||"label",n=((m=e.fieldNames)==null?void 0:m.value)||"value";if(s.isArray(o))return o.map(p=>{var h;return(h=t.unref(i).find(O=>O[n]===p))==null?void 0:h[l]}).filter(Boolean).join("、")||e.emptyText;const a=t.unref(i).find(p=>p.value===o);return(a==null?void 0:a.label)||e.emptyText}),I=t.computed(()=>{const o=!!(e!=null&&e.showSearch),l=e.searchMode;let n={};return o&&(n=l==="request"?{showArrow:!1,defaultActiveFirstOption:!1,onSearch:B,notFoundContent:r.value?void 0:null}:{showArrow:!0,filterOption:s.isNil(e==null?void 0:e.filterOption)?b:e==null?void 0:e.filterOption}),{...M.omitUndefined(s.omit(e,["mode","value","onUpdate:value","onSearch","request","searchMode","onFocus"])),placeholder:t.unref(x),...n}});function P(){var o;(o=c.value)==null||o.focus()}function V(){var o;(o=c.value)==null||o.blur()}return w({focus:P,blur:V,request:f}),(o,l)=>o.mode==="read"?(t.openBlock(),t.createElementBlock("span",_,t.toDisplayString(N.value),1)):(t.openBlock(),t.createBlock(t.unref(y.Select),t.mergeProps({key:1,"allow-clear":"",ref_key:"selectRef",ref:c},I.value,{mode:o.multiple?"multiple":void 0,value:t.unref(v),"onUpdate:value":t.unref(q),options:i.value,loading:r.value,onFocus:C}),t.createSlots({_:2},[t.renderList(o.$slots,(n,a)=>({name:a,fn:t.withCtx(d=>[t.renderSlot(o.$slots,a,t.normalizeProps(t.guardReactiveProps(d||{})))])})),r.value?{name:"notFoundContent",fn:t.withCtx(()=>[t.createVNode(t.unref(y.Spin),{size:"small"})]),key:"0"}:void 0]),1040,["mode","value","onUpdate:value","options","loading"]))}});exports.default=A;
|
|
@@ -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"),h=require("ant-design-vue");require("../../config-provider/index.js");const x=require("./constans.js"),N=require("../../ap-download/utils/getFileInfo.js");require("./style.css");const P=require("../../ap-download/hooks/index.js"),S=require("lodash-unified"),m=require("@ant-design/icons-vue"),I=require("../../config-provider/hooks/use-namespace.js"),p=require("../../config-provider/hooks/use-global-config.js"),M=require("../../config-provider/hooks/use-locale.js"),_=e.defineComponent({name:"ApAttachment",props:x.ApAttachmentProps(),setup(t){const{b:V,e:l}=I.useNamespace("ap-attachment"),A=p.useGlobalConfig("uiMode"),L=p.useGlobalConfig("apUpload"),{lang:w,t:i}=M.useLocale(),n=e.ref(!1),c=e.ref(""),r=e.useSlots(),y=e.computed(()=>w.value==="zh-cn"?"zh_CN":"en_US"),u=e.computed(()=>t.attachmentList.length===1),v=e.computed(()=>t.attachmentList.length>0?t.attachmentList[0].fileName:""),C=e.computed(()=>u.value?v.value:i("ap.apAttachment.downloadall")),f=e.computed(()=>t.color?t.color:A.value==="aplus"?"#0070FF":"#1890FF"),q=e.computed(()=>({width:u.value?"auto":"266px"})),g=e.computed(()=>({"--download-main-color":f.value,"--download-main-color-opacity":N.getHexWithOpacity(f.value,.6)})),F=e.computed(()=>{var a;return t.getOssAccess||((a=L.value)==null?void 0:a.getOssAccess)}),O=e.computed(()=>{const a=r.default?r.default()[0]:null;return a?e.cloneVNode(a,{style:{"font-size":"16px"}}):null}),d=async(a,s)=>{if(!t.disabled){n.value=!0,s&&(c.value=s);try{const o=await P.useOssInit(F.value,e.unref(y)),T=S.isArray(e.toRaw(a))?e.toRaw(a):[e.toRaw(a)];await o.downloadFile(N.getFileInfo(t.needName,T))}catch(o){console.error(o)}finally{n.value=!1,c.value=""}}},b=a=>a&&a.length>0?e.createVNode("ul",{class:[l("file-list")],style:g.value},[a.map((s,o)=>e.createVNode("li",{key:o,class:[l("file-item")],onClick:()=>d(s,o+1)},[n.value&&c.value===o+1?e.createVNode("span",{class:[l("spin")]},[e.createVNode(m.LoadingOutlined,{spin:!0},null)]):null,s.fileName])),e.createVNode("li",{class:[l("down-load-all")],onClick:()=>d(t.attachmentList,"all")},[n.value&&c.value==="all"?e.createVNode("span",{class:[l("spin")]},[e.createVNode(m.LoadingOutlined,{spin:!0},null)]):null,i("ap.apAttachment.downloadall")])]):null;return()=>{var a;return((a=t.attachmentList)==null?void 0:a.length)>0&&e.createVNode("div",{class:[V()],style:[q.value,g.value]},[e.createVNode(h.Tooltip,{title:C.value,placement:t.textToolTipPlacement,color:t.toolTipBgColor},{default:()=>[e.createVNode("div",{class:[l("content")],onClick:()=>d(u.value?t.attachmentList[0]:t.attachmentList,"global")},[n.value&&c.value==="global"?e.createVNode("div",{class:[l("spin")]},[e.createVNode(m.LoadingOutlined,{spin:!0},null)]):null,r.default?e.createVNode("div",{class:[l("text-render")]},[O.value,e.createTextVNode(" ")]):null,e.createVNode("div",{class:[l("text-inner")]},[v.value])])]}),e.createVNode(h.Popover,{content:b(t.attachmentList),placement:t.fileMorePopoverPlacement,color:"#fff"},{default:()=>[!u.value&&e.createVNode("div",{class:[l("more")]},[i("ap.apAttachment.more")])]})])}}});exports.default=_;
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
.aplus-ap-attachment__text-render:hover {
|
|
14
14
|
color: var(--download-main-color-opacity);
|
|
15
15
|
}
|
|
16
|
+
.aplus-ap-attachment__spin {
|
|
17
|
+
float: left;
|
|
18
|
+
margin-right: 5px;
|
|
19
|
+
}
|
|
16
20
|
.aplus-ap-attachment__text-inner {
|
|
17
21
|
max-width: 190px;
|
|
18
22
|
display: inline-block;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InputNumberProps } from 'ant-design-vue/es/input-number';
|
|
2
2
|
type ApInputProps = Pick<InputNumberProps, 'disabled' | 'stringMode' | 'precision' | 'max' | 'min' | 'step' | 'bordered' | 'autofocus' | 'decimalSeparator' | 'controls' | 'formatter' | 'onInput' | 'onChange' | 'onPressEnter' | 'onStep' | 'onBlur' | 'onFocus'>;
|
|
3
3
|
export type ApInputValType = {
|
|
4
|
-
value
|
|
4
|
+
value?: {
|
|
5
5
|
inputVal: string | number;
|
|
6
6
|
radioVal: string | number;
|
|
7
7
|
};
|
|
@@ -1110,7 +1110,6 @@ export declare const ApInputRadio: DefineComponent<{
|
|
|
1110
1110
|
inputVal: string | number;
|
|
1111
1111
|
radioVal: string | number;
|
|
1112
1112
|
}>;
|
|
1113
|
-
required: true;
|
|
1114
1113
|
};
|
|
1115
1114
|
disabled: {
|
|
1116
1115
|
type: PropType<boolean>;
|
|
@@ -1194,7 +1193,6 @@ export declare const ApInputRadio: DefineComponent<{
|
|
|
1194
1193
|
inputVal: string | number;
|
|
1195
1194
|
radioVal: string | number;
|
|
1196
1195
|
}>;
|
|
1197
|
-
required: true;
|
|
1198
1196
|
};
|
|
1199
1197
|
disabled: {
|
|
1200
1198
|
type: PropType<boolean>;
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
.aplus-ap-attachment__text-render:hover {
|
|
14
14
|
color: var(--download-main-color-opacity);
|
|
15
15
|
}
|
|
16
|
+
.aplus-ap-attachment__spin {
|
|
17
|
+
float: left;
|
|
18
|
+
margin-right: 5px;
|
|
19
|
+
}
|
|
16
20
|
.aplus-ap-attachment__text-inner {
|
|
17
21
|
max-width: 190px;
|
|
18
22
|
display: inline-block;
|