@aplus-frontend/ui 0.1.25 → 0.1.27

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.
Files changed (151) hide show
  1. package/es/src/ap-download/ap-download.vue.d.ts +7 -3
  2. package/es/src/ap-download/ap-download.vue.mjs +50 -35
  3. package/es/src/ap-download/interface.d.ts +3 -11
  4. package/es/src/ap-download/style/ap-download.css +3 -0
  5. package/es/src/ap-form/ap-form-item.vue.mjs +26 -26
  6. package/es/src/ap-table/ap-table.vue.mjs +231 -183
  7. package/es/src/ap-table/components/interface.d.ts +33 -1
  8. package/es/src/ap-table/components/setting/images/icon_carst_down.svg.mjs +4 -0
  9. package/es/src/ap-table/components/setting/images/icon_fill_right.svg.mjs +4 -0
  10. package/es/src/ap-table/components/setting/modal/index.vue.d.ts +28 -0
  11. package/es/src/ap-table/components/setting/modal/index.vue.mjs +4 -0
  12. package/es/src/ap-table/components/setting/modal/index.vue2.mjs +152 -0
  13. package/es/src/ap-table/components/setting/select-group/index.vue.d.ts +13 -0
  14. package/es/src/ap-table/components/setting/select-group/index.vue.mjs +4 -0
  15. package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +96 -0
  16. package/es/src/ap-table/components/setting/sortable/index.vue.d.ts +13 -0
  17. package/es/src/ap-table/components/setting/sortable/index.vue.mjs +4 -0
  18. package/es/src/ap-table/components/setting/sortable/index.vue2.mjs +51 -0
  19. package/es/src/ap-table/components/setting/sortable/item.vue.d.ts +20 -0
  20. package/es/src/ap-table/components/setting/sortable/item.vue.mjs +4 -0
  21. package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +140 -0
  22. package/es/src/ap-table/components/setting/sorter/context.d.ts +11 -0
  23. package/es/src/ap-table/components/setting/sorter/context.mjs +20 -0
  24. package/es/src/ap-table/components/setting/sorter/index.vue.d.ts +18 -0
  25. package/es/src/ap-table/components/setting/sorter/index.vue.mjs +4 -0
  26. package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +199 -0
  27. package/es/src/ap-table/components/setting/tree-select/index.vue.d.ts +13 -0
  28. package/es/src/ap-table/components/setting/tree-select/index.vue.mjs +4 -0
  29. package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +75 -0
  30. package/es/src/ap-table/components/setting/utils.d.ts +17 -0
  31. package/es/src/ap-table/components/setting/utils.mjs +48 -0
  32. package/es/src/ap-table/components/style/setting/modal.css +39 -0
  33. package/es/src/ap-table/components/style/setting/select-group.css +7 -0
  34. package/es/src/ap-table/components/style/setting/sortable-item-meta.css +50 -0
  35. package/es/src/ap-table/components/style/setting/sortable-item.css +3 -0
  36. package/es/src/ap-table/components/style/setting/sorter.css +26 -0
  37. package/es/src/ap-table/constants.d.ts +31 -8
  38. package/es/src/ap-table/constants.mjs +41 -53
  39. package/es/src/ap-table/context.d.ts +31 -0
  40. package/es/src/ap-table/context.mjs +20 -0
  41. package/es/src/ap-table/hooks/use-table-column-state.d.ts +18 -0
  42. package/es/src/ap-table/hooks/use-table-column-state.mjs +46 -0
  43. package/es/src/ap-table/hooks/use-table-content-height.mjs +19 -19
  44. package/es/src/ap-table/hooks/use-table-paging.d.ts +1 -0
  45. package/es/src/ap-table/hooks/use-table-paging.mjs +87 -82
  46. package/es/src/ap-table/interface.d.ts +51 -1
  47. package/es/src/ap-table/style/ap-table.css +29 -1
  48. package/es/src/ap-table/utils.d.ts +1 -1
  49. package/es/src/ap-table/utils.mjs +82 -82
  50. package/es/src/ap-upload/components/MultipleFile.vue2.mjs +91 -89
  51. package/es/src/ap-upload/components/Picture.vue2.mjs +114 -112
  52. package/es/src/ap-upload/components/SingleFile.vue2.mjs +10 -7
  53. package/es/src/business/ap-attachment/ApAttachment.d.ts +1 -1
  54. package/es/src/business/ap-attachment/ApAttachment.mjs +45 -42
  55. package/es/src/business/ap-attachment/style.css +2 -0
  56. package/es/src/business/ap-ladder/ApLadder.vue2.mjs +114 -84
  57. package/es/src/business/ap-ladder/interface.d.ts +42 -0
  58. package/es/src/business/ap-ladder/interface.mjs +10 -0
  59. package/es/src/business/hooks/usePageListApTable.d.ts +8 -3
  60. package/es/src/business/hooks/usePageListApTable.mjs +27 -17
  61. package/es/src/business/hooks/useTableRefresh.d.ts +3 -4
  62. package/es/src/business/hooks/useTableRefresh.mjs +9 -9
  63. package/es/src/business/index.d.ts +4 -4
  64. package/es/src/editable-table/interface.d.ts +1 -1
  65. package/es/src/locale/lang/en.mjs +14 -0
  66. package/es/src/locale/lang/zh-cn.mjs +14 -0
  67. package/es/src/theme/ap-attachment/ap-attachment.css +2 -0
  68. package/es/src/theme/ap-download/ap-download.css +3 -0
  69. package/es/src/theme/ap-table/ap-table.css +29 -1
  70. package/es/src/theme/ap-table/setting/modal.css +39 -0
  71. package/es/src/theme/ap-table/setting/select-group.css +7 -0
  72. package/es/src/theme/ap-table/setting/sortable-item-meta.css +50 -0
  73. package/es/src/theme/ap-table/setting/sortable-item.css +3 -0
  74. package/es/src/theme/ap-table/setting/sorter.css +26 -0
  75. package/es/src/theme/css-var/index.mjs +22 -12
  76. package/lib/src/ap-download/ap-download.vue.d.ts +7 -3
  77. package/lib/src/ap-download/ap-download.vue.js +1 -1
  78. package/lib/src/ap-download/interface.d.ts +3 -11
  79. package/lib/src/ap-download/style/ap-download.css +3 -0
  80. package/lib/src/ap-form/ap-form-item.vue.js +1 -1
  81. package/lib/src/ap-table/ap-table.vue.js +1 -1
  82. package/lib/src/ap-table/components/interface.d.ts +33 -1
  83. package/lib/src/ap-table/components/setting/images/icon_carst_down.svg.js +1 -0
  84. package/lib/src/ap-table/components/setting/images/icon_fill_right.svg.js +1 -0
  85. package/lib/src/ap-table/components/setting/modal/index.vue.d.ts +28 -0
  86. package/lib/src/ap-table/components/setting/modal/index.vue.js +1 -0
  87. package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -0
  88. package/lib/src/ap-table/components/setting/select-group/index.vue.d.ts +13 -0
  89. package/lib/src/ap-table/components/setting/select-group/index.vue.js +1 -0
  90. package/lib/src/ap-table/components/setting/select-group/index.vue2.js +1 -0
  91. package/lib/src/ap-table/components/setting/sortable/index.vue.d.ts +13 -0
  92. package/lib/src/ap-table/components/setting/sortable/index.vue.js +1 -0
  93. package/lib/src/ap-table/components/setting/sortable/index.vue2.js +1 -0
  94. package/lib/src/ap-table/components/setting/sortable/item.vue.d.ts +20 -0
  95. package/lib/src/ap-table/components/setting/sortable/item.vue.js +1 -0
  96. package/lib/src/ap-table/components/setting/sortable/item.vue2.js +1 -0
  97. package/lib/src/ap-table/components/setting/sorter/context.d.ts +11 -0
  98. package/lib/src/ap-table/components/setting/sorter/context.js +1 -0
  99. package/lib/src/ap-table/components/setting/sorter/index.vue.d.ts +18 -0
  100. package/lib/src/ap-table/components/setting/sorter/index.vue.js +1 -0
  101. package/lib/src/ap-table/components/setting/sorter/index.vue2.js +1 -0
  102. package/lib/src/ap-table/components/setting/tree-select/index.vue.d.ts +13 -0
  103. package/lib/src/ap-table/components/setting/tree-select/index.vue.js +1 -0
  104. package/lib/src/ap-table/components/setting/tree-select/index.vue2.js +1 -0
  105. package/lib/src/ap-table/components/setting/utils.d.ts +17 -0
  106. package/lib/src/ap-table/components/setting/utils.js +1 -0
  107. package/lib/src/ap-table/components/style/setting/modal.css +39 -0
  108. package/lib/src/ap-table/components/style/setting/select-group.css +7 -0
  109. package/lib/src/ap-table/components/style/setting/sortable-item-meta.css +50 -0
  110. package/lib/src/ap-table/components/style/setting/sortable-item.css +3 -0
  111. package/lib/src/ap-table/components/style/setting/sorter.css +26 -0
  112. package/lib/src/ap-table/constants.d.ts +31 -8
  113. package/lib/src/ap-table/constants.js +1 -1
  114. package/lib/src/ap-table/context.d.ts +31 -0
  115. package/lib/src/ap-table/context.js +1 -0
  116. package/lib/src/ap-table/hooks/use-table-column-state.d.ts +18 -0
  117. package/lib/src/ap-table/hooks/use-table-column-state.js +1 -0
  118. package/lib/src/ap-table/hooks/use-table-content-height.js +1 -1
  119. package/lib/src/ap-table/hooks/use-table-paging.d.ts +1 -0
  120. package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
  121. package/lib/src/ap-table/interface.d.ts +51 -1
  122. package/lib/src/ap-table/style/ap-table.css +29 -1
  123. package/lib/src/ap-table/utils.d.ts +1 -1
  124. package/lib/src/ap-table/utils.js +1 -1
  125. package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
  126. package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
  127. package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
  128. package/lib/src/business/ap-attachment/ApAttachment.d.ts +1 -1
  129. package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
  130. package/lib/src/business/ap-attachment/style.css +2 -0
  131. package/lib/src/business/ap-ladder/ApLadder.vue2.js +1 -1
  132. package/lib/src/business/ap-ladder/interface.d.ts +42 -0
  133. package/lib/src/business/ap-ladder/interface.js +1 -0
  134. package/lib/src/business/hooks/usePageListApTable.d.ts +8 -3
  135. package/lib/src/business/hooks/usePageListApTable.js +1 -1
  136. package/lib/src/business/hooks/useTableRefresh.d.ts +3 -4
  137. package/lib/src/business/hooks/useTableRefresh.js +1 -1
  138. package/lib/src/business/index.d.ts +4 -4
  139. package/lib/src/editable-table/interface.d.ts +1 -1
  140. package/lib/src/locale/lang/en.js +1 -1
  141. package/lib/src/locale/lang/zh-cn.js +1 -1
  142. package/lib/src/theme/ap-attachment/ap-attachment.css +2 -0
  143. package/lib/src/theme/ap-download/ap-download.css +3 -0
  144. package/lib/src/theme/ap-table/ap-table.css +29 -1
  145. package/lib/src/theme/ap-table/setting/modal.css +39 -0
  146. package/lib/src/theme/ap-table/setting/select-group.css +7 -0
  147. package/lib/src/theme/ap-table/setting/sortable-item-meta.css +50 -0
  148. package/lib/src/theme/ap-table/setting/sortable-item.css +3 -0
  149. package/lib/src/theme/ap-table/setting/sorter.css +26 -0
  150. package/lib/src/theme/css-var/index.js +1 -1
  151. package/package.json +3 -2
@@ -1,74 +1,76 @@
1
- import { defineComponent as H, inject as u, ref as I, watch as J, openBlock as f, createElementBlock as h, normalizeClass as K, unref as o, createElementVNode as d, Fragment as Q, renderList as W, withDirectives as X, createVNode as C, createCommentVNode as R, vShow as Y, toDisplayString as U } from "vue";
1
+ import { defineComponent as J, inject as u, ref as R, watch as K, openBlock as f, createElementBlock as h, normalizeClass as Q, unref as i, createElementVNode as p, Fragment as W, renderList as X, withDirectives as Y, createVNode as C, createCommentVNode as $, vShow as Z, toDisplayString as U } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
- import { getPath as Z, getName as F, getReturnData as w } from "../utils/returnData.mjs";
4
- import { CloseOutlined as ee, PlusOutlined as te } from "@ant-design/icons-vue";
5
- import { useOss as ne, getOssInstance as $ } from "../hooks/useOss.mjs";
6
- import { fileMatchesAccept as ae, getAcceptText as se } from "../utils/accept.mjs";
7
- import { message as m, Progress as oe } from "ant-design-vue";
3
+ import { getPath as F, getName as ee, getReturnData as w } from "../utils/returnData.mjs";
4
+ import { CloseOutlined as te, PlusOutlined as ne } from "@ant-design/icons-vue";
5
+ import { useOss as ae, getOssInstance as D } from "../hooks/useOss.mjs";
6
+ import { fileMatchesAccept as se, getAcceptText as oe } from "../utils/accept.mjs";
7
+ import { message as d, Progress as ie } from "ant-design-vue";
8
8
  import "../styles/picture.css";
9
- import { useLocale as ie } from "../../config-provider/hooks/use-locale.mjs";
10
- import { useNamespace as ce } from "../../config-provider/hooks/use-namespace.mjs";
11
- const ue = ["accept"], re = { class: "picture-context" }, le = { class: "picture-item-box" }, pe = ["src"], de = { class: "picture-item-shadow" }, me = ["onClick"], fe = {
9
+ import { useLocale as ce } from "../../config-provider/hooks/use-locale.mjs";
10
+ import { useNamespace as ue } from "../../config-provider/hooks/use-namespace.mjs";
11
+ const re = ["accept"], le = { class: "picture-context" }, pe = { class: "picture-item-box" }, de = ["src"], me = { class: "picture-item-shadow" }, fe = ["onClick"], he = {
12
12
  key: 0,
13
13
  class: "picture-item-uploading"
14
- }, he = { class: "picture-title" }, ge = { key: 0 }, ve = { key: 1 }, be = /* @__PURE__ */ H({
14
+ }, ge = { class: "picture-title" }, ve = { key: 0 }, _e = { key: 1 }, ze = /* @__PURE__ */ J({
15
15
  __name: "Picture",
16
- setup(_e) {
17
- const { t: r } = ie(), { b: A } = ce("ap-upload-picture"), { put: D } = ne(), E = u("theme"), O = u("dirName"), y = u("accept") || "image/*", k = u("maxSize") ?? 5, N = u("title"), l = u("maxCount") ?? 10, g = u("uploadingCount"), P = u("beforeUpload"), S = u("customRequest"), b = u("getOssAccess"), x = I(null), c = u("value"), v = u("needName");
18
- let i = I([]);
16
+ setup(xe) {
17
+ const { t: r } = ce(), { b: A } = ue("ap-upload-picture"), { put: E } = ae(), O = u("theme"), T = u("dirName"), y = u("accept") || "image/*", k = u("maxSize") ?? 5, N = u("title"), l = u("maxCount") ?? 10, g = u("uploadingCount"), P = u("beforeUpload"), S = u("customRequest"), b = u("getOssAccess"), x = R(null), c = u("value"), v = u("needName");
18
+ let o = R([]);
19
19
  const _ = [];
20
- J(
20
+ K(
21
21
  () => c == null ? void 0 : c.value,
22
22
  async function(e) {
23
- if (!i.value.length && e) {
24
- const a = [];
23
+ var a;
24
+ if (!((a = o == null ? void 0 : o.value) != null && a.length) && e) {
25
+ const n = [];
25
26
  for (let t of e) {
26
- const n = Z(v, t), s = F(v, t), p = await $(b), j = await p.getSignatureUrl(n), G = {
27
- ...new File([t], s, {}),
27
+ const s = F(v, t), m = ee(v, t), I = await D(b), G = await I.getSignatureUrl(s), H = {
28
+ ...new File([t], m, {}),
28
29
  uid: `${(/* @__PURE__ */ new Date()).getTime()}-${Math.random()}`,
29
- thumbUrl: j,
30
+ thumbUrl: G,
30
31
  status: "success",
31
32
  percent: 100,
32
- path: n
33
+ path: s
33
34
  };
34
- a.push(G), p.destroy();
35
+ n.push(H), I.destroy();
35
36
  }
36
- if (l && a.length > l) {
37
- m.warning(
37
+ if (l && n.length > l) {
38
+ d.warning(
38
39
  r("ap.apUpload.fileInitializationException", {
39
40
  maxCount: l
40
41
  })
41
42
  );
42
43
  return;
43
44
  }
44
- a.forEach((t) => {
45
- i.value.push(t), _.push({
45
+ n.forEach((t) => {
46
+ o.value.push(t), _.push({
46
47
  uid: t.uid,
47
48
  path: t.path
48
49
  });
49
50
  });
50
51
  }
51
- }
52
+ },
53
+ { immediate: !0 }
52
54
  );
53
- function T() {
55
+ function B() {
54
56
  var e;
55
57
  (e = x.value) == null || e.click();
56
58
  }
57
- function B(e) {
59
+ function q(e) {
58
60
  const a = e.target;
59
61
  L(a == null ? void 0 : a.files);
60
62
  }
61
63
  function L(e) {
62
64
  if (e != null && e.length)
63
65
  for (let a = 0; a < e.length; a++)
64
- q(e[a]);
66
+ M(e[a]);
65
67
  x.value && (x.value.value = "");
66
68
  }
67
69
  let z;
68
- function q(e) {
69
- if (l && l > 1 && i.value.length >= l)
70
+ function M(e) {
71
+ if (l && l > 1 && o.value.length >= l)
70
72
  return clearTimeout(z), z = setTimeout(() => {
71
- m.warning(
73
+ d.warning(
72
74
  r("ap.apUpload.maxUploadPicture", { maxCount: l })
73
75
  );
74
76
  }), !1;
@@ -77,45 +79,45 @@ const ue = ["accept"], re = { class: "picture-context" }, le = { class: "picture
77
79
  return !1;
78
80
  } else {
79
81
  if (e.size > k * 1024 * 1024)
80
- return m.warning(
82
+ return d.warning(
81
83
  r("ap.apUpload.maxUploadFileSize", { maxSize: k })
82
84
  ), !1;
83
- if (!/image\/\w+/.test(e.type) || !ae(e, y))
84
- return m.warning(r("ap.apUpload.pictureFormatNotSupported")), !1;
85
+ if (!/image\/\w+/.test(e.type) || !se(e, y))
86
+ return d.warning(r("ap.apUpload.pictureFormatNotSupported")), !1;
85
87
  }
86
88
  const a = new FileReader();
87
89
  a.readAsDataURL(e), a.onload = function() {
88
- const t = {
90
+ const n = {
89
91
  ...e,
90
92
  uid: `${(/* @__PURE__ */ new Date()).getTime()}-${Math.random()}`,
91
93
  thumbUrl: this.result,
92
94
  status: "uploading",
93
95
  percent: 0
94
96
  };
95
- M(t, e);
97
+ V(n, e);
96
98
  }, a.onerror = function() {
97
- m.warning(r("ap.apUpload.imageParsingFailed"));
99
+ d.warning(r("ap.apUpload.imageParsingFailed"));
98
100
  };
99
101
  }
100
- async function M(e, a) {
102
+ async function V(e, a) {
101
103
  if (g.value++, typeof S == "function") {
102
104
  S({
103
- onProgress: (t) => {
104
- const n = i.value.find((s) => s.uid === e.uid);
105
- n && (n.percent = t);
105
+ onProgress: (n) => {
106
+ const t = o.value.find((s) => s.uid === e.uid);
107
+ t && (t.percent = n);
106
108
  },
107
- onError: (t) => {
108
- m.warning(t || r("ap.apUpload.networkAnomaly"));
109
- const n = i.value.findIndex(
109
+ onError: (n) => {
110
+ d.warning(n || r("ap.apUpload.networkAnomaly"));
111
+ const t = o.value.findIndex(
110
112
  (s) => s.uid === e.uid
111
113
  );
112
- n > -1 && i.value.splice(n, 1), g.value--;
114
+ t > -1 && o.value.splice(t, 1), g.value--;
113
115
  },
114
- onSuccess: (t) => {
115
- const n = i.value.find((s) => s.uid === e.uid);
116
- n && (n.status = "success", n.path = t), c.value ? c.value.push(w(v, t, a.name)) : c.value = [w(v, t, a.name)], _.push({
116
+ onSuccess: (n) => {
117
+ const t = o.value.find((s) => s.uid === e.uid);
118
+ t && (t.status = "success", t.path = n), c.value ? c.value.push(w(v, n, a.name)) : c.value = [w(v, n, a.name)], _.push({
117
119
  uid: e.uid,
118
- path: t
120
+ path: n
119
121
  }), g.value--;
120
122
  },
121
123
  file: a
@@ -123,117 +125,117 @@ const ue = ["accept"], re = { class: "picture-context" }, le = { class: "picture
123
125
  return;
124
126
  }
125
127
  try {
126
- const t = await $(b);
127
- e.oss = t, i.value.push(e), D({
128
+ const n = await D(b);
129
+ e.oss = n, o.value.push(e), E({
128
130
  file: a,
129
- dirName: O,
130
- oss: t,
131
- successCallBack(n) {
132
- const s = i.value.find((p) => p.uid === e.uid);
133
- s && (s.status = "success", s.path = n), c.value ? c.value.push(w(v, n, a.name)) : c.value = [w(v, n, a.name)], _.push({
131
+ dirName: T,
132
+ oss: n,
133
+ successCallBack(t) {
134
+ const s = o.value.find((m) => m.uid === e.uid);
135
+ s && (s.status = "success", s.path = t), c.value ? c.value.push(w(v, t, a.name)) : c.value = [w(v, t, a.name)], _.push({
134
136
  uid: e.uid,
135
- path: n
137
+ path: t
136
138
  }), g.value--;
137
139
  },
138
- errorCallBack(n) {
139
- m.warning(n || r("ap.apUpload.networkAnomaly"));
140
- const s = i.value.findIndex(
141
- (p) => p.uid === e.uid
140
+ errorCallBack(t) {
141
+ d.warning(t || r("ap.apUpload.networkAnomaly"));
142
+ const s = o.value.findIndex(
143
+ (m) => m.uid === e.uid
142
144
  );
143
- s > -1 && i.value.splice(s, 1), g.value--;
145
+ s > -1 && o.value.splice(s, 1), g.value--;
144
146
  },
145
- progressCallBack(n) {
146
- const s = i.value.find((p) => p.uid === e.uid);
147
- s && (s.percent = n);
147
+ progressCallBack(t) {
148
+ const s = o.value.find((m) => m.uid === e.uid);
149
+ s && (s.percent = t);
148
150
  }
149
151
  });
150
- } catch (t) {
151
- m.warning(
152
- typeof (t == null ? void 0 : t.message) == "string" ? t.message : r("ap.apUpload.networkAnomaly")
152
+ } catch (n) {
153
+ d.warning(
154
+ typeof (n == null ? void 0 : n.message) == "string" ? n.message : r("ap.apUpload.networkAnomaly")
153
155
  );
154
- const n = i.value.findIndex((s) => s.uid === e.uid);
155
- n > -1 && i.value.splice(n, 1), g.value--;
156
+ const t = o.value.findIndex((s) => s.uid === e.uid);
157
+ t > -1 && o.value.splice(t, 1), g.value--;
156
158
  }
157
159
  }
158
- function V(e) {
159
- var t;
160
+ function j(e) {
161
+ var n;
160
162
  if (e.path) {
161
163
  if (Array.isArray(c.value)) {
162
- const n = _.findIndex(
164
+ const t = _.findIndex(
163
165
  (s) => s.uid === e.uid
164
166
  );
165
- n >= 0 && (c == null || c.value.splice(n, 1), _.splice(n, 1)), c.value.length === 0 && (c.value = void 0);
167
+ t >= 0 && (c == null || c.value.splice(t, 1), _.splice(t, 1)), c.value.length === 0 && (c.value = void 0);
166
168
  }
167
169
  } else
168
- (t = e == null ? void 0 : e.oss) == null || t.pauseUpload();
169
- const a = i.value.findIndex(
170
- (n) => n.uid === e.uid
170
+ (n = e == null ? void 0 : e.oss) == null || n.pauseUpload();
171
+ const a = o.value.findIndex(
172
+ (t) => t.uid === e.uid
171
173
  );
172
- return i.value.splice(a, 1), Promise.resolve(!0);
174
+ return o.value.splice(a, 1), Promise.resolve(!0);
173
175
  }
174
176
  return (e, a) => (f(), h("div", {
175
- class: K({
176
- [o(A)()]: !0,
177
- [o(A)("admin")]: o(E) === "admin"
177
+ class: Q({
178
+ [i(A)()]: !0,
179
+ [i(A)("admin")]: i(O) === "admin"
178
180
  })
179
181
  }, [
180
- d("input", {
182
+ p("input", {
181
183
  style: { display: "none" },
182
184
  type: "file",
183
185
  ref_key: "fileRef",
184
186
  ref: x,
185
- accept: o(y),
186
- onChange: B
187
- }, null, 40, ue),
188
- d("div", re, [
189
- (f(!0), h(Q, null, W(o(i), (t) => (f(), h("div", {
187
+ accept: i(y),
188
+ onChange: q
189
+ }, null, 40, re),
190
+ p("div", le, [
191
+ (f(!0), h(W, null, X(i(o), (n) => (f(), h("div", {
190
192
  class: "picture-item",
191
- key: t.uid
193
+ key: n.uid
192
194
  }, [
193
- d("div", le, [
194
- d("img", {
195
- src: t.thumbUrl,
195
+ p("div", pe, [
196
+ p("img", {
197
+ src: n.thumbUrl,
196
198
  alt: ""
197
- }, null, 8, pe),
198
- X(d("div", de, [
199
- d("div", {
199
+ }, null, 8, de),
200
+ Y(p("div", me, [
201
+ p("div", {
200
202
  class: "picture-item-close",
201
- onClick: (n) => V(t)
203
+ onClick: (t) => j(n)
202
204
  }, [
203
- C(o(ee))
204
- ], 8, me),
205
- t.status === "uploading" ? (f(), h("div", fe, [
206
- C(o(oe), {
207
- percent: t.percent,
205
+ C(i(te))
206
+ ], 8, fe),
207
+ n.status === "uploading" ? (f(), h("div", he, [
208
+ C(i(ie), {
209
+ percent: n.percent,
208
210
  strokeColor: "#ffffff",
209
211
  trailColor: "rgba(255, 255, 255, 0.3)",
210
212
  size: 4,
211
213
  showInfo: !1
212
214
  }, null, 8, ["percent"])
213
- ])) : R("", !0)
215
+ ])) : $("", !0)
214
216
  ], 512), [
215
- [Y, t.status === "uploading"]
217
+ [Z, n.status === "uploading"]
216
218
  ])
217
219
  ])
218
220
  ]))), 128)),
219
- o(l) === void 0 || o(i).length < o(l) ? (f(), h("div", {
221
+ i(l) === void 0 || i(o).length < i(l) ? (f(), h("div", {
220
222
  key: 0,
221
223
  class: "picture-upload",
222
- onClick: T
224
+ onClick: B
223
225
  }, [
224
- C(o(te)),
225
- d("div", null, U(o(r)("ap.apUpload.update")), 1)
226
- ])) : R("", !0)
226
+ C(i(ne)),
227
+ p("div", null, U(i(r)("ap.apUpload.update")), 1)
228
+ ])) : $("", !0)
227
229
  ]),
228
- d("div", he, [
229
- o(N) ? (f(), h("div", ge, U(o(N)), 1)) : (f(), h("div", ve, U(`${o(r)("ap.apUpload.supportExtension")}:${o(se)(o(y))},${o(r)(
230
+ p("div", ge, [
231
+ i(N) ? (f(), h("div", ve, U(i(N)), 1)) : (f(), h("div", _e, U(`${i(r)("ap.apUpload.supportExtension")}:${i(oe)(i(y))},${i(r)(
230
232
  "ap.apUpload.maxUploadPictureSize",
231
- { maxSize: o(k) }
233
+ { maxSize: i(k) }
232
234
  )}`), 1))
233
235
  ])
234
236
  ], 2));
235
237
  }
236
238
  });
237
239
  export {
238
- be as default
240
+ ze as default
239
241
  };
@@ -22,13 +22,16 @@ const ge = ["accept"], he = {
22
22
  ee(
23
23
  () => n == null ? void 0 : n.value,
24
24
  function(e) {
25
- const t = re(F, e);
26
- o.value === null && e && (l.value = 3, o.value = new File(
27
- [e],
28
- t,
29
- {}
30
- ));
31
- }
25
+ if (o.value === null && e) {
26
+ const t = re(F, e);
27
+ l.value = 3, o.value = new File(
28
+ [e],
29
+ t,
30
+ {}
31
+ );
32
+ }
33
+ },
34
+ { immediate: !0 }
32
35
  );
33
36
  const l = h(1), f = h(0), m = h(null), P = te(() => o.value && (n == null ? void 0 : n.value));
34
37
  function H() {
@@ -42,7 +42,7 @@ declare const _default: DefineComponent<{
42
42
  toolTipBgColor: {
43
43
  type: StringConstructor;
44
44
  };
45
- }, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
45
+ }, () => false | import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
46
46
  attachmentList: {
47
47
  type: PropType<Array<AttachmentItemProps>>;
48
48
  default: never[];
@@ -1,4 +1,4 @@
1
- import { defineComponent as O, useSlots as T, computed as a, cloneVNode as P, unref as k, toRaw as u, createVNode as o, createTextVNode as S } from "vue";
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
2
  import { Tooltip as V, Popover as b } from "ant-design-vue";
3
3
  import "../../config-provider/index.mjs";
4
4
  import { ApAttachmentProps as z } from "./constans.mjs";
@@ -7,7 +7,7 @@ import "./style.css";
7
7
  import { useOssInit as U } from "../../ap-download/hooks/index.mjs";
8
8
  import { isArray as _ } from "lodash-unified";
9
9
  import { useNamespace as B } from "../../config-provider/hooks/use-namespace.mjs";
10
- import { useGlobalConfig as h } from "../../config-provider/hooks/use-global-config.mjs";
10
+ import { useGlobalConfig as v } from "../../config-provider/hooks/use-global-config.mjs";
11
11
  import { useLocale as G } from "../../config-provider/hooks/use-locale.mjs";
12
12
  const Y = /* @__PURE__ */ O({
13
13
  name: "ApAttachment",
@@ -16,65 +16,68 @@ const Y = /* @__PURE__ */ O({
16
16
  const {
17
17
  b: p,
18
18
  e: l
19
- } = B("ap-attachment"), A = h("uiMode"), g = h("apUpload"), {
19
+ } = B("ap-attachment"), A = v("uiMode"), g = v("apUpload"), {
20
20
  lang: w,
21
21
  t: i
22
- } = G(), s = T(), C = a(() => w.value === "zh-cn" ? "zh_CN" : "en_US"), n = a(() => t.attachmentList.length === 1), d = a(() => t.attachmentList.length > 0 ? t.attachmentList[0].fileName : ""), N = a(() => n.value ? d.value : i("ap.apAttachment.downloadall")), f = a(() => t.color ? t.color : A.value === "aplus" ? "#0070FF" : "#1890FF"), y = a(() => ({
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
23
  width: n.value ? "auto" : "266px"
24
- })), v = a(() => ({
24
+ })), h = o(() => ({
25
25
  "--download-main-color": f.value,
26
26
  "--download-main-color-opacity": I(f.value, 0.6)
27
- })), F = a(() => {
27
+ })), y = o(() => {
28
28
  var e;
29
29
  return t.getOssAccess || ((e = g.value) == null ? void 0 : e.getOssAccess);
30
- }), L = a(() => {
30
+ }), F = o(() => {
31
31
  const e = s.default ? s.default()[0] : null;
32
32
  return e ? P(e, {
33
33
  style: {
34
34
  "font-size": "16px"
35
35
  }
36
36
  }) : null;
37
- }), r = async (e) => {
37
+ }), m = async (e) => {
38
38
  if (!t.disabled) {
39
- const c = await U(F.value, k(C)), m = _(u(e)) ? u(e) : [u(e)];
40
- await c.downloadFile(M(t.needName, m));
39
+ const c = await U(y.value, k(C)), r = _(u(e)) ? u(e) : [u(e)];
40
+ await c.downloadFile(M(t.needName, r));
41
41
  }
42
- }, x = (e) => e && e.length > 0 ? o("ul", {
42
+ }, x = (e) => e && e.length > 0 ? a("ul", {
43
43
  class: [l("file-list")],
44
- style: v.value
45
- }, [e.map((c, m) => o("li", {
46
- key: m,
44
+ style: h.value
45
+ }, [e.map((c, r) => a("li", {
46
+ key: r,
47
47
  class: [l("file-item")],
48
- onClick: () => r(c)
49
- }, [c.fileName])), o("li", {
48
+ onClick: () => m(c)
49
+ }, [c.fileName])), a("li", {
50
50
  class: [l("down-load-all")],
51
- onClick: () => r(t.attachmentList)
51
+ onClick: () => m(t.attachmentList)
52
52
  }, [i("ap.apAttachment.downloadall")])]) : null;
53
- return () => o("div", {
54
- class: [p()],
55
- style: [y.value, v.value]
56
- }, [o(V, {
57
- title: N.value,
58
- placement: t.textToolTipPlacement,
59
- color: t.toolTipBgColor
60
- }, {
61
- default: () => [o("div", {
62
- class: [l("content")],
63
- onClick: () => r(n.value ? t.attachmentList[0] : t.attachmentList)
64
- }, [s.default ? o("div", {
65
- class: [l("text-render")]
66
- }, [L.value, S(" ")]) : null, o("div", {
67
- class: [l("text-inner")]
68
- }, [d.value])])]
69
- }), o(b, {
70
- content: x(t.attachmentList),
71
- placement: t.fileMorePopoverPlacement,
72
- color: "#fff"
73
- }, {
74
- default: () => [!n.value && o("div", {
75
- class: [l("more")]
76
- }, [i("ap.apAttachment.more")])]
77
- })]);
53
+ return () => {
54
+ 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,
60
+ placement: t.textToolTipPlacement,
61
+ color: t.toolTipBgColor
62
+ }, {
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),
73
+ placement: t.fileMorePopoverPlacement,
74
+ color: "#fff"
75
+ }, {
76
+ default: () => [!n.value && a("div", {
77
+ class: [l("more")]
78
+ }, [i("ap.apAttachment.more")])]
79
+ })]);
80
+ };
78
81
  }
79
82
  });
80
83
  export {
@@ -39,6 +39,8 @@
39
39
  max-width: 312px;
40
40
  display: flex;
41
41
  flex-direction: column;
42
+ margin: 0;
43
+ padding: 0;
42
44
  }
43
45
  .aplus-ap-attachment__file-item {
44
46
  flex: 1;