@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.
@@ -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, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ApDownLoadProps>, {
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 b, useSlots as h, computed as t, unref as s, openBlock as l, createBlock as B, mergeProps as z, withCtx as k, createElementVNode as a, normalizeClass as w, createElementBlock as N, renderSlot as O, createCommentVNode as v, toDisplayString as F } from "vue";
2
- import { Button as x } from "ant-design-vue";
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 A } from "./hooks/index.mjs";
5
+ import { useOssInit as j } from "./hooks/index.mjs";
5
6
  import "./style/ap-download.css";
6
- import { getFileInfo as S } from "./utils/getFileInfo.mjs";
7
- import { useStyle as I } from "./hooks/useStyle.mjs";
8
- import { useLocale as M } from "../config-provider/hooks/use-locale.mjs";
9
- import { useGlobalConfig as i } from "../config-provider/hooks/use-global-config.mjs";
10
- const U = {
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
- }, j = { class: "text" }, H = /* @__PURE__ */ b({
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
- setup(c) {
40
- const { lang: r } = M(), p = h(), d = t(() => r.value === "zh-cn" ? "zh_CN" : "en_US"), m = i("uiMode"), e = c, u = i("apUpload"), n = t(() => e.disabled), f = t(() => e.color ? e.color : m.value === "aplus" ? "#0070FF" : "#1890FF"), g = t(() => e.size), { getInnerWrapperClass: y } = I(f, g, n), C = t(() => {
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 = u.value) == null ? void 0 : o.getOssAccess);
43
- }), _ = async () => {
44
- e.disabled || await (await A(
45
- C.value,
46
- s(d)
47
- )).downloadFile(S(e.needName, e.fileName));
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, D) => (l(), B(s(x), z(e, {
66
+ return (o, i) => (l(), F(s(U), x(e, {
50
67
  type: e.type,
51
68
  size: e.size,
52
- disabled: n.value,
53
- onClick: _
69
+ disabled: a.value,
70
+ onClick: v
54
71
  }), {
55
- default: k(() => [
56
- a("div", {
57
- class: w(s(y))
72
+ default: A(() => [
73
+ r("div", {
74
+ class: S(s(w))
58
75
  }, [
59
- s(p).icon ? (l(), N("span", U, [
60
- O(o.$slots, "icon")
61
- ])) : v("", !0),
62
- a("span", j, F(o.text), 1)
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
- H as default
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/Button';
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 {};
@@ -9,6 +9,9 @@
9
9
  display: flex;
10
10
  align-items: center;
11
11
  }
12
+ .aplus-ap-download-inner-wrapper .spin {
13
+ margin-right: 5px;
14
+ }
12
15
  .aplus-ap-download-inner-wrapper .icon {
13
16
  position: relative;
14
17
  font-size: 18px;
@@ -1,11 +1,11 @@
1
- import { defineComponent as k, ref as f, onMounted as q, computed as m, unref as u, openBlock as v, createElementBlock as A, toDisplayString as M, createBlock as T, mergeProps as _, createSlots as R, renderList as z, withCtx as h, renderSlot as D, normalizeProps as U, guardReactiveProps as L, createVNode as K } from "vue";
2
- import { debounce as H, isFunction as y, isArray as $, isNil as j, omit as E } from "lodash-unified";
3
- import { Select as W, Spin as G } from "ant-design-vue";
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 J } from "../../utils/index.mjs";
6
- import { useDefaultPlaceholder as Q } from "../hooks/use-default-placeholder.mjs";
7
- import { useControllableValue as X } from "../../hooks/useControllableValue.mjs";
8
- const Y = { key: 0 }, re = /* @__PURE__ */ k({
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(w, { expose: S, emit: g }) {
96
+ setup(B, { expose: F, emit: b }) {
97
97
  let n = 0;
98
- const B = H((o) => {
99
- if (!y(e.request))
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 = [], a.value = !0, e.request(o).then((l) => {
103
+ i.value = [], r.value = !0, e.request(o).then((l) => {
104
104
  n === t && (i.value = l);
105
105
  }).finally(() => {
106
- a.value = !1;
106
+ r.value = !1;
107
107
  });
108
- }, 300), e = w, F = (o, t) => {
109
- var r;
110
- const l = ((r = e.fieldNames) == null ? void 0 : r.label) || "label";
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 = f((e == null ? void 0 : e.options) || []), d = f(), a = f((e == null ? void 0 : e.loading) || !1), C = g;
113
- async function s(o = !0) {
114
- if (!y(e.request))
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
- a.value = !0, n += 1;
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
- a.value = !1;
125
+ r.value = !1;
126
126
  }
127
127
  }
128
- function b(o) {
128
+ function I(o) {
129
129
  var t;
130
- (t = e.onFocus) == null || t.call(e, o), e.refetchOnFocus && n > 0 && !a.value && s(!0);
130
+ (t = e.onFocus) == null || t.call(e, o), e.refetchOnFocus && n > 0 && !r.value && c(!0);
131
131
  }
132
- q(() => {
132
+ _(() => {
133
133
  if (e.lazy) {
134
134
  n += 1;
135
135
  return;
136
136
  }
137
- s();
137
+ c();
138
138
  });
139
- const { value: p, updateValue: x } = X(e, C), I = Q("Select", e), O = m(() => {
140
- const o = u(p);
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
- if ($(o))
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
- (l) => {
146
- var r;
147
- return (r = u(i).find((c) => c.value === l)) == null ? void 0 : r.label;
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 t = u(i).find((l) => l.value === o);
151
- return (t == null ? void 0 : t.label) || e.emptyText;
152
- }), P = m(() => {
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: B,
159
- notFoundContent: a.value ? void 0 : null
160
+ onSearch: C,
161
+ notFoundContent: r.value ? void 0 : null
160
162
  } : {
161
163
  showArrow: !0,
162
- filterOption: j(e == null ? void 0 : e.filterOption) ? F : e == null ? void 0 : e.filterOption
164
+ filterOption: J(e == null ? void 0 : e.filterOption) ? N : e == null ? void 0 : e.filterOption
163
165
  }), {
164
- ...J(
165
- E(e, [
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(I),
177
+ placeholder: u(P),
176
178
  ...l
177
179
  };
178
180
  });
179
- function V() {
181
+ function q() {
180
182
  var o;
181
- (o = d.value) == null || o.focus();
183
+ (o = s.value) == null || o.focus();
182
184
  }
183
- function N() {
185
+ function A() {
184
186
  var o;
185
- (o = d.value) == null || o.blur();
187
+ (o = s.value) == null || o.blur();
186
188
  }
187
- return S({
188
- focus: V,
189
- blur: N,
190
- request: s
191
- }), (o, t) => o.mode === "read" ? (v(), A("span", Y, M(O.value), 1)) : (v(), T(u(W), _({
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: d
196
- }, P.value, {
197
+ ref: s
198
+ }, k.value, {
197
199
  mode: o.multiple ? "multiple" : void 0,
198
- value: u(p),
199
- "onUpdate:value": u(x),
200
+ value: u(m),
201
+ "onUpdate:value": u(O),
200
202
  options: i.value,
201
- loading: a.value,
202
- onFocus: b
203
- }), R({ _: 2 }, [
204
- z(o.$slots, (l, r) => ({
205
- name: r,
206
- fn: h((c) => [
207
- D(o.$slots, r, U(L(c || {})))
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
- a.value ? {
212
+ r.value ? {
211
213
  name: "notFoundContent",
212
- fn: h(() => [
213
- K(u(G), { size: "small" })
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
- re as default
223
+ se as default
222
224
  };
@@ -1,85 +1,105 @@
1
- import { defineComponent as O, useSlots as T, computed as o, cloneVNode as P, unref as k, toRaw as u, createVNode as a, createTextVNode as S } from "vue";
2
- import { Tooltip as V, Popover as b } from "ant-design-vue";
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 z } from "./constans.mjs";
5
- import { getHexWithOpacity as I, getFileInfo as M } from "../../ap-download/utils/getFileInfo.mjs";
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 U } from "../../ap-download/hooks/index.mjs";
8
- import { isArray as _ } from "lodash-unified";
9
- import { useNamespace as B } from "../../config-provider/hooks/use-namespace.mjs";
10
- import { useGlobalConfig as v } from "../../config-provider/hooks/use-global-config.mjs";
11
- import { useLocale as G } from "../../config-provider/hooks/use-locale.mjs";
12
- const Y = /* @__PURE__ */ O({
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: z(),
15
+ props: B(),
15
16
  setup(t) {
16
17
  const {
17
- b: p,
18
- e: l
19
- } = B("ap-attachment"), A = v("uiMode"), g = v("apUpload"), {
20
- lang: w,
21
- t: i
22
- } = G(), s = T(), C = o(() => w.value === "zh-cn" ? "zh_CN" : "en_US"), n = o(() => t.attachmentList.length === 1), d = o(() => t.attachmentList.length > 0 ? t.attachmentList[0].fileName : ""), L = o(() => n.value ? d.value : i("ap.apAttachment.downloadall")), f = o(() => t.color ? t.color : A.value === "aplus" ? "#0070FF" : "#1890FF"), N = o(() => ({
23
- width: n.value ? "auto" : "266px"
24
- })), h = o(() => ({
25
- "--download-main-color": f.value,
26
- "--download-main-color-opacity": I(f.value, 0.6)
27
- })), y = o(() => {
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 = g.value) == null ? void 0 : e.getOssAccess);
30
- }), F = o(() => {
31
- const e = s.default ? s.default()[0] : null;
32
- return e ? P(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
- }), m = async (e) => {
38
+ }), d = async (e, i) => {
38
39
  if (!t.disabled) {
39
- const c = await U(y.value, k(C)), r = _(u(e)) ? u(e) : [u(e)];
40
- await c.downloadFile(M(t.needName, r));
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
- }, x = (e) => e && e.length > 0 ? a("ul", {
43
- class: [l("file-list")],
44
- style: h.value
45
- }, [e.map((c, r) => a("li", {
46
- key: r,
47
- class: [l("file-item")],
48
- onClick: () => m(c)
49
- }, [c.fileName])), a("li", {
50
- class: [l("down-load-all")],
51
- onClick: () => m(t.attachmentList)
52
- }, [i("ap.apAttachment.downloadall")])]) : null;
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 && a("div", {
56
- class: [p()],
57
- style: [N.value, h.value]
58
- }, [a(V, {
59
- title: L.value,
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: () => [a("div", {
64
- class: [l("content")],
65
- onClick: () => m(n.value ? t.attachmentList[0] : t.attachmentList)
66
- }, [s.default ? a("div", {
67
- class: [l("text-render")]
68
- }, [F.value, S(" ")]) : null, a("div", {
69
- class: [l("text-inner")]
70
- }, [d.value])])]
71
- }), a(b, {
72
- content: x(t.attachmentList),
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: () => [!n.value && a("div", {
77
- class: [l("more")]
78
- }, [i("ap.apAttachment.more")])]
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
- Y as default
104
+ at as default
85
105
  };
@@ -1,5 +1,5 @@
1
1
  import { ApDownLoadProps } from '../../ap-download/interface';
2
- import { TooltipPlacement } from 'ant-design-vue/es/Tooltip';
2
+ import { TooltipPlacement } from 'ant-design-vue/es/tooltip';
3
3
  export type AttachmentItemProps = {
4
4
  fileName: string;
5
5
  filePath: string;
@@ -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;
@@ -9,6 +9,9 @@
9
9
  display: flex;
10
10
  align-items: center;
11
11
  }
12
+ .aplus-ap-download-inner-wrapper .spin {
13
+ margin-right: 5px;
14
+ }
12
15
  .aplus-ap-download-inner-wrapper .icon {
13
16
  position: relative;
14
17
  font-size: 18px;
@@ -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, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ApDownLoadProps>, {
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"),y=require("ant-design-vue");require("../config-provider/index.js");const b=require("./hooks/index.js");require("./style/ap-download.css");const C=require("./utils/getFileInfo.js"),_=require("./hooks/useStyle.js"),B=require("../config-provider/hooks/use-locale.js"),n=require("../config-provider/hooks/use-global-config.js"),h={key:0,class:"icon"},k={class:"text"},q=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:{}},setup(l){const{lang:a}=B.useLocale(),c=e.useSlots(),i=e.computed(()=>a.value==="zh-cn"?"zh_CN":"en_US"),r=n.useGlobalConfig("uiMode"),o=l,u=n.useGlobalConfig("apUpload"),s=e.computed(()=>o.disabled),d=e.computed(()=>o.color?o.color:r.value==="aplus"?"#0070FF":"#1890FF"),p=e.computed(()=>o.size),{getInnerWrapperClass:f}=_.useStyle(d,p,s),m=e.computed(()=>{var t;return o.getOssAccess||((t=u.value)==null?void 0:t.getOssAccess)}),g=async()=>{o.disabled||await(await b.useOssInit(m.value,e.unref(i))).downloadFile(C.getFileInfo(o.needName,o.fileName))};return(t,v)=>(e.openBlock(),e.createBlock(e.unref(y.Button),e.mergeProps(o,{type:o.type,size:o.size,disabled:s.value,onClick:g}),{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(f))},[e.unref(c).icon?(e.openBlock(),e.createElementBlock("span",h,[e.renderSlot(t.$slots,"icon")])):e.createCommentVNode("",!0),e.createElementVNode("span",k,e.toDisplayString(t.text),1)],2)]),_:3},16,["type","size","disabled"]))}});exports.default=q;
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/Button';
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 {};
@@ -9,6 +9,9 @@
9
9
  display: flex;
10
10
  align-items: center;
11
11
  }
12
+ .aplus-ap-download-inner-wrapper .spin {
13
+ margin-right: 5px;
14
+ }
12
15
  .aplus-ap-download-inner-wrapper .icon {
13
16
  position: relative;
14
17
  font-size: 18px;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),d=require("lodash-unified"),v=require("ant-design-vue");require("../../hooks/index.js");const P=require("../../utils/index.js"),V=require("../hooks/use-default-placeholder.js"),O=require("../../hooks/useControllableValue.js"),M={key:0},k=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(h,{expose:m,emit:y}){let a=0;const g=d.debounce(o=>{if(!d.isFunction(e.request))return;a+=1;const n=a;i.value=[],u.value=!0,e.request(o).then(l=>{a===n&&(i.value=l)}).finally(()=>{u.value=!1})},300),e=h,w=(o,n)=>{var r;const l=((r=e.fieldNames)==null?void 0:r.label)||"label";return typeof(n==null?void 0:n[l])=="string"&&n[l].indexOf(o)>-1},i=t.ref((e==null?void 0:e.options)||[]),s=t.ref(),u=t.ref((e==null?void 0:e.loading)||!1),S=y;async function c(o=!0){if(!d.isFunction(e.request))return;u.value=!0,a+=1;const n=a;try{o&&(i.value=[]);const l=await e.request();if(n!==a)return;i.value=l}finally{u.value=!1}}function B(o){var n;(n=e.onFocus)==null||n.call(e,o),e.refetchOnFocus&&a>0&&!u.value&&c(!0)}t.onMounted(()=>{if(e.lazy){a+=1;return}c()});const{value:p,updateValue:F}=O.useControllableValue(e,S),b=V.useDefaultPlaceholder("Select",e),C=t.computed(()=>{const o=t.unref(p);if(!o)return e.emptyText;if(d.isArray(o))return o.map(l=>{var r;return(r=t.unref(i).find(f=>f.value===l))==null?void 0:r.label}).filter(Boolean).join("、")||e.emptyText;const n=t.unref(i).find(l=>l.value===o);return(n==null?void 0:n.label)||e.emptyText}),q=t.computed(()=>{const o=!!(e!=null&&e.showSearch),n=e.searchMode;let l={};return o&&(l=n==="request"?{showArrow:!1,defaultActiveFirstOption:!1,onSearch:g,notFoundContent:u.value?void 0:null}:{showArrow:!0,filterOption:d.isNil(e==null?void 0:e.filterOption)?w:e==null?void 0:e.filterOption}),{...P.omitUndefined(d.omit(e,["mode","value","onUpdate:value","onSearch","request","searchMode","onFocus"])),placeholder:t.unref(b),...l}});function x(){var o;(o=s.value)==null||o.focus()}function I(){var o;(o=s.value)==null||o.blur()}return m({focus:x,blur:I,request:c}),(o,n)=>o.mode==="read"?(t.openBlock(),t.createElementBlock("span",M,t.toDisplayString(C.value),1)):(t.openBlock(),t.createBlock(t.unref(v.Select),t.mergeProps({key:1,"allow-clear":"",ref_key:"selectRef",ref:s},q.value,{mode:o.multiple?"multiple":void 0,value:t.unref(p),"onUpdate:value":t.unref(F),options:i.value,loading:u.value,onFocus:B}),t.createSlots({_:2},[t.renderList(o.$slots,(l,r)=>({name:r,fn:t.withCtx(f=>[t.renderSlot(o.$slots,r,t.normalizeProps(t.guardReactiveProps(f||{})))])})),u.value?{name:"notFoundContent",fn:t.withCtx(()=>[t.createVNode(t.unref(v.Spin),{size:"small"})]),key:"0"}:void 0]),1040,["mode","value","onUpdate:value","options","loading"]))}});exports.default=k;
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"),f=require("ant-design-vue");require("../../config-provider/index.js");const F=require("./constans.js"),v=require("../../ap-download/utils/getFileInfo.js");require("./style.css");const x=require("../../ap-download/hooks/index.js"),O=require("lodash-unified"),T=require("../../config-provider/hooks/use-namespace.js"),h=require("../../config-provider/hooks/use-global-config.js"),b=require("../../config-provider/hooks/use-locale.js"),P=e.defineComponent({name:"ApAttachment",props:F.ApAttachmentProps(),setup(t){const{b:g,e:o}=T.useNamespace("ap-attachment"),N=h.useGlobalConfig("uiMode"),p=h.useGlobalConfig("apUpload"),{lang:A,t:c}=b.useLocale(),s=e.useSlots(),V=e.computed(()=>A.value==="zh-cn"?"zh_CN":"en_US"),n=e.computed(()=>t.attachmentList.length===1),r=e.computed(()=>t.attachmentList.length>0?t.attachmentList[0].fileName:""),w=e.computed(()=>n.value?r.value:c("ap.apAttachment.downloadall")),d=e.computed(()=>t.color?t.color:N.value==="aplus"?"#0070FF":"#1890FF"),C=e.computed(()=>({width:n.value?"auto":"266px"})),m=e.computed(()=>({"--download-main-color":d.value,"--download-main-color-opacity":v.getHexWithOpacity(d.value,.6)})),L=e.computed(()=>{var a;return t.getOssAccess||((a=p.value)==null?void 0:a.getOssAccess)}),q=e.computed(()=>{const a=s.default?s.default()[0]:null;return a?e.cloneVNode(a,{style:{"font-size":"16px"}}):null}),i=async a=>{if(!t.disabled){const l=await x.useOssInit(L.value,e.unref(V)),u=O.isArray(e.toRaw(a))?e.toRaw(a):[e.toRaw(a)];await l.downloadFile(v.getFileInfo(t.needName,u))}},y=a=>a&&a.length>0?e.createVNode("ul",{class:[o("file-list")],style:m.value},[a.map((l,u)=>e.createVNode("li",{key:u,class:[o("file-item")],onClick:()=>i(l)},[l.fileName])),e.createVNode("li",{class:[o("down-load-all")],onClick:()=>i(t.attachmentList)},[c("ap.apAttachment.downloadall")])]):null;return()=>{var a;return((a=t.attachmentList)==null?void 0:a.length)>0&&e.createVNode("div",{class:[g()],style:[C.value,m.value]},[e.createVNode(f.Tooltip,{title:w.value,placement:t.textToolTipPlacement,color:t.toolTipBgColor},{default:()=>[e.createVNode("div",{class:[o("content")],onClick:()=>i(n.value?t.attachmentList[0]:t.attachmentList)},[s.default?e.createVNode("div",{class:[o("text-render")]},[q.value,e.createTextVNode(" ")]):null,e.createVNode("div",{class:[o("text-inner")]},[r.value])])]}),e.createVNode(f.Popover,{content:y(t.attachmentList),placement:t.fileMorePopoverPlacement,color:"#fff"},{default:()=>[!n.value&&e.createVNode("div",{class:[o("more")]},[c("ap.apAttachment.more")])]})])}}});exports.default=P;
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=_;
@@ -1,5 +1,5 @@
1
1
  import { ApDownLoadProps } from '../../ap-download/interface';
2
- import { TooltipPlacement } from 'ant-design-vue/es/Tooltip';
2
+ import { TooltipPlacement } from 'ant-design-vue/es/tooltip';
3
3
  export type AttachmentItemProps = {
4
4
  fileName: string;
5
5
  filePath: string;
@@ -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;
@@ -9,6 +9,9 @@
9
9
  display: flex;
10
10
  align-items: center;
11
11
  }
12
+ .aplus-ap-download-inner-wrapper .spin {
13
+ margin-right: 5px;
14
+ }
12
15
  .aplus-ap-download-inner-wrapper .icon {
13
16
  position: relative;
14
17
  font-size: 18px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aplus-frontend/ui",
3
- "version": "0.1.27",
3
+ "version": "0.1.28",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "files": [