@aplus-frontend/ui 0.6.0-beta.0 → 0.6.0-beta.2

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 (209) hide show
  1. package/es/src/ap-button/ap-button.vue.mjs +1 -1
  2. package/es/src/ap-form/ap-form.vue2.mjs +57 -58
  3. package/es/src/ap-form/interface.d.ts +4 -0
  4. package/es/src/ap-form/item/index.vue.mjs +33 -28
  5. package/es/src/ap-form/items/checkbox/index.vue.mjs +1 -0
  6. package/es/src/ap-form/items/date/index.vue.mjs +8 -7
  7. package/es/src/ap-form/items/date-range/index.vue.mjs +1 -0
  8. package/es/src/ap-form/items/number/index.vue.mjs +9 -8
  9. package/es/src/ap-form/items/radio/index.vue.mjs +1 -0
  10. package/es/src/ap-form/items/select/index.vue.mjs +7 -6
  11. package/es/src/ap-form/items/switch/index.vue.mjs +1 -0
  12. package/es/src/ap-form/items/text/index.vue2.mjs +8 -7
  13. package/es/src/ap-form/items/text/password.vue.mjs +1 -0
  14. package/es/src/ap-form/items/text-area/index.vue.mjs +1 -0
  15. package/es/src/ap-form/items/tree-select/index.vue.mjs +6 -5
  16. package/es/src/ap-form/render/item.vue.mjs +5 -4
  17. package/es/src/ap-form/search-form/components/popover-filter.vue2.mjs +10 -10
  18. package/es/src/ap-form/search-form/components/popover-sorter/sortable-item.vue2.mjs +8 -8
  19. package/es/src/ap-form/search-form/index.vue.mjs +36 -35
  20. package/es/src/ap-grid/editable/form-item.vue.mjs +1 -1
  21. package/es/src/ap-grid/editable/index.vue.mjs +1 -1
  22. package/es/src/ap-grid/index.vue.mjs +149 -140
  23. package/es/src/ap-grid/interface.d.ts +1 -1
  24. package/es/src/ap-table/ap-table.vue2.mjs +206 -199
  25. package/es/src/ap-tag/ap-tag.vue.d.ts +1 -0
  26. package/es/src/ap-tag/ap-tag.vue.mjs +18 -12
  27. package/es/src/ap-tag/interface.d.ts +4 -0
  28. package/es/src/business/ap-expand-alert/ApExpandAlert.vue2.mjs +11 -12
  29. package/es/src/business/ap-export-group/ApExportGroup.vue.d.ts +1 -0
  30. package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +108 -99
  31. package/es/src/business/ap-export-group/index.d.ts +3 -0
  32. package/es/src/business/ap-export-group/interface.d.ts +7 -2
  33. package/es/src/business/ap-table-modal/modal-title.vue2.mjs +2 -2
  34. package/es/src/business/ap-view/ap-view.vue2.mjs +120 -114
  35. package/es/src/business/ap-view/components/main-button-content.vue2.mjs +63 -55
  36. package/es/src/business/ap-view/components/menu-list-content.vue2.mjs +38 -38
  37. package/es/src/business/ap-view/interface.d.ts +4 -0
  38. package/es/src/business/batch-input-group/form-item.vue.mjs +1 -0
  39. package/es/src/business/hooks/usePageListApGrid.mjs +2 -4
  40. package/es/src/check-card/index.vue2.mjs +1 -1
  41. package/es/src/config-provider/css-var.mjs +2 -2
  42. package/es/src/design-token/index.mjs +9 -3
  43. package/es/src/editable-table/form-item.vue.mjs +1 -1
  44. package/es/src/editable-table/index.vue.mjs +27 -27
  45. package/es/src/locale/lang/en.mjs +1 -1
  46. package/es/src/locale/lang/zh-cn.mjs +1 -1
  47. package/lib/src/ap-button/ap-button.vue.js +1 -1
  48. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  49. package/lib/src/ap-form/interface.d.ts +4 -0
  50. package/lib/src/ap-form/item/index.vue.js +1 -1
  51. package/lib/src/ap-form/items/checkbox/index.vue.js +1 -1
  52. package/lib/src/ap-form/items/date/index.vue.js +1 -1
  53. package/lib/src/ap-form/items/date-range/index.vue.js +1 -1
  54. package/lib/src/ap-form/items/number/index.vue.js +1 -1
  55. package/lib/src/ap-form/items/radio/index.vue.js +1 -1
  56. package/lib/src/ap-form/items/select/index.vue.js +1 -1
  57. package/lib/src/ap-form/items/switch/index.vue.js +1 -1
  58. package/lib/src/ap-form/items/text/index.vue2.js +1 -1
  59. package/lib/src/ap-form/items/text/password.vue.js +1 -1
  60. package/lib/src/ap-form/items/text-area/index.vue.js +1 -1
  61. package/lib/src/ap-form/items/tree-select/index.vue.js +1 -1
  62. package/lib/src/ap-form/render/item.vue.js +1 -1
  63. package/lib/src/ap-form/search-form/components/popover-filter.vue2.js +1 -1
  64. package/lib/src/ap-form/search-form/components/popover-sorter/sortable-item.vue2.js +1 -1
  65. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  66. package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
  67. package/lib/src/ap-grid/editable/index.vue.js +1 -1
  68. package/lib/src/ap-grid/index.vue.js +1 -1
  69. package/lib/src/ap-grid/interface.d.ts +1 -1
  70. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  71. package/lib/src/ap-tag/ap-tag.vue.d.ts +1 -0
  72. package/lib/src/ap-tag/ap-tag.vue.js +1 -1
  73. package/lib/src/ap-tag/interface.d.ts +4 -0
  74. package/lib/src/business/ap-expand-alert/ApExpandAlert.vue2.js +1 -1
  75. package/lib/src/business/ap-export-group/ApExportGroup.vue.d.ts +1 -0
  76. package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
  77. package/lib/src/business/ap-export-group/index.d.ts +3 -0
  78. package/lib/src/business/ap-export-group/interface.d.ts +7 -2
  79. package/lib/src/business/ap-table-modal/modal-title.vue2.js +1 -1
  80. package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
  81. package/lib/src/business/ap-view/components/main-button-content.vue2.js +1 -1
  82. package/lib/src/business/ap-view/components/menu-list-content.vue2.js +1 -1
  83. package/lib/src/business/ap-view/interface.d.ts +4 -0
  84. package/lib/src/business/batch-input-group/form-item.vue.js +1 -1
  85. package/lib/src/business/hooks/usePageListApGrid.js +1 -1
  86. package/lib/src/check-card/index.vue2.js +1 -1
  87. package/lib/src/config-provider/css-var.js +1 -1
  88. package/lib/src/design-token/index.js +1 -1
  89. package/lib/src/editable-table/form-item.vue.js +1 -1
  90. package/lib/src/editable-table/index.vue.js +1 -1
  91. package/lib/src/locale/lang/en.js +1 -1
  92. package/lib/src/locale/lang/zh-cn.js +1 -1
  93. package/package.json +1 -1
  94. package/theme/antd-global-overwrite/admin/index.css +5 -8
  95. package/theme/antd-global-overwrite/admin/modal.css +2 -5
  96. package/theme/antd-global-overwrite/admin/modal.less +3 -3
  97. package/theme/antd-global-overwrite/admin/table.css +3 -3
  98. package/theme/antd-global-overwrite/admin/table.less +3 -3
  99. package/theme/antd-global-overwrite/aplus/index.css +5 -8
  100. package/theme/antd-global-overwrite/aplus/modal.css +2 -5
  101. package/theme/antd-global-overwrite/aplus/modal.less +3 -3
  102. package/theme/antd-global-overwrite/aplus/table.css +3 -3
  103. package/theme/antd-global-overwrite/aplus/table.less +3 -3
  104. package/theme/ap-action/item-dropdown.css +5 -5
  105. package/theme/ap-action/item-dropdown.less +1 -1
  106. package/theme/ap-action/item.css +5 -5
  107. package/theme/ap-action/item.less +1 -1
  108. package/theme/ap-appendix/ap-appendix.css +7 -5
  109. package/theme/ap-appendix/ap-appendix.less +4 -2
  110. package/theme/ap-attachment/ap-attachment.css +7 -7
  111. package/theme/ap-attachment/ap-attachment.less +4 -4
  112. package/theme/ap-batch-action/ap-batch-action.css +9 -6
  113. package/theme/ap-batch-action/ap-batch-action.less +6 -3
  114. package/theme/ap-button/ap-button.css +3 -3
  115. package/theme/ap-card/ap-card.css +3 -3
  116. package/theme/ap-descriptions/ap-descriptions.css +6 -8
  117. package/theme/ap-descriptions/ap-descriptions.less +3 -5
  118. package/theme/ap-download/ap-download.css +10 -13
  119. package/theme/ap-download/ap-download.less +8 -11
  120. package/theme/ap-expand-alert/ap-expand-alert.css +4 -4
  121. package/theme/ap-expand-alert/ap-expand-alert.less +3 -4
  122. package/theme/ap-field/checkbox.css +4 -4
  123. package/theme/ap-field/checkbox.less +2 -1
  124. package/theme/ap-field/index.css +5 -5
  125. package/theme/ap-field/number.css +3 -3
  126. package/theme/ap-field/radio.css +4 -4
  127. package/theme/ap-field/radio.less +1 -1
  128. package/theme/ap-field/text-area.css +3 -3
  129. package/theme/ap-form/ap-form-item-group.css +3 -3
  130. package/theme/ap-form/ap-form-item.css +10 -8
  131. package/theme/ap-form/ap-form-item.less +8 -6
  132. package/theme/ap-form/drawer-form.css +3 -3
  133. package/theme/ap-form/index.css +21 -19
  134. package/theme/ap-form/item-text-group.css +3 -3
  135. package/theme/ap-form/item-text.css +3 -3
  136. package/theme/ap-form/modal-form.css +3 -3
  137. package/theme/ap-form/search-form-sorter.css +12 -12
  138. package/theme/ap-form/search-form-sorter.less +7 -7
  139. package/theme/ap-form/search-form.css +21 -19
  140. package/theme/ap-form/search-form.less +5 -5
  141. package/theme/ap-grid/editable.css +5 -5
  142. package/theme/ap-grid/editable.less +3 -2
  143. package/theme/ap-grid/index.css +43 -32
  144. package/theme/ap-grid/index.less +20 -9
  145. package/theme/ap-group-search/ap-extension-select.css +3 -3
  146. package/theme/ap-group-search/ap-group-search.css +3 -3
  147. package/theme/ap-group-search/ap-popover-select.css +3 -3
  148. package/theme/ap-image/ap-image.css +3 -3
  149. package/theme/ap-input-radio/ap-input-radio.css +3 -3
  150. package/theme/ap-label/ap-label.css +3 -3
  151. package/theme/ap-ladder/ap-ladder.css +6 -6
  152. package/theme/ap-ladder/ap-ladder.less +3 -3
  153. package/theme/ap-layout/ap-info-layout.css +3 -3
  154. package/theme/ap-list/index.css +4 -4
  155. package/theme/ap-list/index.less +2 -1
  156. package/theme/ap-product-info/ap-product-info.css +3 -3
  157. package/theme/ap-select-layout/ap-select-layout.css +11 -11
  158. package/theme/ap-select-layout/ap-select-layout.less +8 -8
  159. package/theme/ap-size-input/ap-size-input.css +3 -3
  160. package/theme/ap-status/ap-status.css +5 -6
  161. package/theme/ap-status/ap-status.less +2 -4
  162. package/theme/ap-summary/index.css +6 -6
  163. package/theme/ap-summary/index.less +3 -3
  164. package/theme/ap-table/ap-table-index.css +8 -8
  165. package/theme/ap-table/ap-table-index.less +5 -5
  166. package/theme/ap-table/ap-table-paragraph-ellipsis.css +3 -3
  167. package/theme/ap-table/ap-table-paragraph-ellipsis.less +1 -1
  168. package/theme/ap-table/ap-table.css +46 -42
  169. package/theme/ap-table/ap-table.less +10 -9
  170. package/theme/ap-table/setting/index.css +7 -7
  171. package/theme/ap-table/setting/modal.css +5 -5
  172. package/theme/ap-table/setting/select-group.css +3 -3
  173. package/theme/ap-table/setting/sortable-item-meta.css +3 -3
  174. package/theme/ap-table/setting/sortable-item.css +3 -3
  175. package/theme/ap-table/setting/sorter.css +5 -5
  176. package/theme/ap-table-modal/index.css +46 -42
  177. package/theme/ap-tag/ap-tag-group.css +3 -3
  178. package/theme/ap-tag/ap-tag-group.less +2 -2
  179. package/theme/ap-tag/ap-tag.css +27 -18
  180. package/theme/ap-tag/ap-tag.less +37 -24
  181. package/theme/ap-title/ap-title.css +5 -5
  182. package/theme/ap-title/ap-title.less +2 -2
  183. package/theme/ap-upload/index.css +6 -6
  184. package/theme/ap-upload/multiple-file.css +4 -4
  185. package/theme/ap-upload/multiple-file.less +1 -1
  186. package/theme/ap-upload/picture.css +5 -5
  187. package/theme/ap-upload/picture.less +2 -2
  188. package/theme/ap-upload/single-file.css +3 -3
  189. package/theme/ap-upload/upload.css +3 -3
  190. package/theme/ap-upload-single/index.css +3 -3
  191. package/theme/ap-view/ap-view.css +7 -3
  192. package/theme/ap-view/ap-view.less +4 -0
  193. package/theme/batch-input-group/index.css +5 -5
  194. package/theme/batch-input-group/popover-input.css +3 -3
  195. package/theme/check-card/index.css +22 -22
  196. package/theme/check-card/index.less +17 -15
  197. package/theme/editable-table/index.css +36 -32
  198. package/theme/editable-table/index.less +9 -7
  199. package/theme/full-screen/index.css +3 -3
  200. package/theme/index.css +174 -147
  201. package/theme/mask/index.css +3 -3
  202. package/theme/mixins/config.less +26 -4
  203. package/theme/mixins/mixins.css +3 -3
  204. package/theme/scroll-bar/index.css +3 -3
  205. package/theme/scroll-view/index.css +3 -3
  206. package/theme/splitter/index.css +8 -8
  207. package/theme/text/group.css +3 -3
  208. package/theme/text/index.css +5 -5
  209. package/theme/work-order-modal/index.css +3 -3
@@ -1,4 +1,4 @@
1
- import { defineComponent as $, computed as n, createElementBlock as b, openBlock as y, normalizeClass as p, normalizeStyle as w, createVNode as z, unref as B } from "vue";
1
+ import { defineComponent as $, computed as n, createElementBlock as S, openBlock as b, normalizeClass as i, normalizeStyle as w, createVNode as z, unref as B } from "vue";
2
2
  import "../config-provider/index.mjs";
3
3
  import { TypographyText as v } from "@aplus-frontend/antdv";
4
4
  import { useGlobalConfig as I } from "../config-provider/hooks/use-global-config.mjs";
@@ -7,31 +7,37 @@ const A = /* @__PURE__ */ $({
7
7
  name: "ApTag",
8
8
  __name: "ap-tag",
9
9
  props: {
10
+ type: { default: "purely" },
10
11
  text: {},
11
12
  color: { default: "#34B77C" },
12
13
  size: { default: "middle" },
13
14
  disabled: { type: Boolean, default: !1 }
14
15
  },
15
- setup(i) {
16
- const e = i, o = I("uiMode"), { b: r, bm: a } = _("tag");
17
- function l(t, s) {
16
+ setup(o) {
17
+ const e = o, l = I("uiMode"), { b: r, bm: a } = _("tag");
18
+ function p(t, s) {
18
19
  t.length === 4 && (t = `#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`);
19
- const m = parseInt(t.slice(1, 3), 16), f = parseInt(t.slice(3, 5), 16), g = parseInt(t.slice(5, 7), 16), S = Math.round(s * 255).toString(16).padStart(2, "0");
20
- return `#${m.toString(16).padStart(2, "0")}${f.toString(16).padStart(2, "0")}${g.toString(16).padStart(2, "0")}${S}`;
20
+ const m = parseInt(t.slice(1, 3), 16), f = parseInt(t.slice(3, 5), 16), g = parseInt(t.slice(5, 7), 16), y = Math.round(s * 255).toString(16).padStart(2, "0");
21
+ return `#${m.toString(16).padStart(2, "0")}${f.toString(16).padStart(2, "0")}${g.toString(16).padStart(2, "0")}${y}`;
21
22
  }
22
23
  const c = n(() => ({
23
24
  "--tag-main-color": e.color,
24
- "--tag-main-color-opacity": l(e.color, 0.06)
25
- })), u = n(() => [r("wrapper"), a("wrapper", e.size)].filter(Boolean)), d = n(() => {
25
+ "--tag-main-color-opacity": p(e.color, 0.06),
26
+ "--tag-main-color-background": p(e.color, 0.15)
27
+ })), u = n(() => [
28
+ r("wrapper"),
29
+ r(`wrapper-${e.type}`),
30
+ a("wrapper", e.size)
31
+ ].filter(Boolean)), d = n(() => {
26
32
  const t = [r("inner-wrapper"), a("inner-wrapper", e.size)];
27
- return e.disabled && (o.value === "aplus" ? t.push(a("inner-wrapper", "disabled")) : t.push(a("inner-wrapper", "disabled-admin"))), t;
33
+ return e.disabled && (l.value === "aplus" ? t.push(a("inner-wrapper", "disabled")) : t.push(a("inner-wrapper", "disabled-admin"))), t;
28
34
  });
29
- return (t, s) => (y(), b("span", {
35
+ return (t, s) => (b(), S("span", {
30
36
  style: w(c.value),
31
- class: p(u.value)
37
+ class: i(u.value)
32
38
  }, [
33
39
  z(B(v), {
34
- class: p(d.value),
40
+ class: i(d.value),
35
41
  ellipsis: { tooltip: t.text },
36
42
  content: t.text
37
43
  }, null, 8, ["class", "ellipsis", "content"])
@@ -1,5 +1,9 @@
1
1
  import { TooltipProps } from '@aplus-frontend/antdv/es/tooltip';
2
2
  export interface ApTagProps {
3
+ /**
4
+ * 标签类型
5
+ */
6
+ type?: 'purely' | 'border';
3
7
  /**
4
8
  * 标签内容
5
9
  */
@@ -1,4 +1,4 @@
1
- import { defineComponent as W, computed as f, ref as h, watch as T, nextTick as w, createElementBlock as n, openBlock as a, normalizeClass as s, unref as t, createVNode as x, withCtx as m, createElementVNode as g, normalizeStyle as c, renderSlot as A, createBlock as b, toDisplayString as p, resolveDynamicComponent as N, Fragment as C, renderList as j, createCommentVNode as I, createTextVNode as q } from "vue";
1
+ import { defineComponent as W, computed as f, ref as h, watch as T, nextTick as w, createElementBlock as n, openBlock as a, normalizeClass as s, unref as t, createVNode as x, withCtx as m, createElementVNode as b, normalizeStyle as c, renderSlot as A, createBlock as g, toDisplayString as p, resolveDynamicComponent as N, Fragment as C, renderList as j, createCommentVNode as I, createTextVNode as q } from "vue";
2
2
  import { DownOutlined as J } from "@ant-design/icons-vue";
3
3
  import { Alert as K, Tooltip as P } from "@aplus-frontend/antdv";
4
4
  import { ApActionItem as Q } from "../../ap-action/index.mjs";
@@ -24,8 +24,8 @@ const Z = ["onClick"], pe = /* @__PURE__ */ W({
24
24
  showIcon: { type: Boolean, default: !0 }
25
25
  },
26
26
  emits: ["choose", "expand"],
27
- setup(L, { expose: $, emit: H }) {
28
- const z = H, r = L, { t: S } = U(), V = f(() => {
27
+ setup(L, { expose: $, emit: z }) {
28
+ const H = z, r = L, { t: S } = U(), V = f(() => {
29
29
  if (r.type != "card")
30
30
  return r.type;
31
31
  }), l = h(""), u = h(null), D = f(() => ({
@@ -34,11 +34,10 @@ const Z = ["onClick"], pe = /* @__PURE__ */ W({
34
34
  overflow: "hidden",
35
35
  display: "-webkit-box",
36
36
  webkitLineClamp: l.value,
37
- webkitBoxOrient: "vertical",
38
- lineHeight: "22px"
37
+ webkitBoxOrient: "vertical"
39
38
  }));
40
39
  function R() {
41
- l.value === "1" ? l.value = "" : l.value = "1", z("expand");
40
+ l.value === "1" ? l.value = "" : l.value = "1", H("expand");
42
41
  }
43
42
  const M = f(() => l.value === "1" ? S("ap.apExpandAlert.expand") : S("ap.apExpandAlert.collapse")), y = h(!0), B = f(() => l.value !== "1");
44
43
  function v(e) {
@@ -82,14 +81,14 @@ const Z = ["onClick"], pe = /* @__PURE__ */ W({
82
81
  class: s([t(o)("antAlert"), e.type == "card" ? "card-alert" : ""])
83
82
  }, {
84
83
  action: m(() => [
85
- y.value ? (a(), b(t(Q), {
84
+ y.value ? (a(), g(t(Q), {
86
85
  key: 0,
87
86
  size: "small",
88
87
  style: { "font-size": "12px", "padding-left": "16px" },
89
88
  onClick: d[0] || (d[0] = (i) => R())
90
89
  }, {
91
90
  default: m(() => [
92
- g("span", {
91
+ b("span", {
93
92
  class: s(t(o)("expandText"))
94
93
  }, p(M.value), 3),
95
94
  x(t(J), {
@@ -100,7 +99,7 @@ const Z = ["onClick"], pe = /* @__PURE__ */ W({
100
99
  })) : I("", !0)
101
100
  ]),
102
101
  message: m(() => [
103
- g("div", {
102
+ b("div", {
104
103
  ref_key: "ellipsisBoxRef",
105
104
  ref: u,
106
105
  style: c({ ...D.value, ...e.contentStyle }),
@@ -111,7 +110,7 @@ const Z = ["onClick"], pe = /* @__PURE__ */ W({
111
110
  key: 0,
112
111
  class: s(t(o)("prefix")),
113
112
  style: c(e.prefixStyle)
114
- }, p(e.prefix), 7)) : (a(), b(N(e.prefix), {
113
+ }, p(e.prefix), 7)) : (a(), g(N(e.prefix), {
115
114
  key: 1,
116
115
  style: c(e.prefixStyle)
117
116
  }, null, 8, ["style"])),
@@ -127,7 +126,7 @@ const Z = ["onClick"], pe = /* @__PURE__ */ W({
127
126
  record: i,
128
127
  index: k
129
128
  }, () => [
130
- g("span", {
129
+ b("span", {
131
130
  class: s(t(o)("showItem")),
132
131
  onClick: (_) => e.$emit("choose", i)
133
132
  }, p(e.mapLabel ? i[e.mapLabel] : i), 11, Z)
@@ -142,7 +141,7 @@ const Z = ["onClick"], pe = /* @__PURE__ */ W({
142
141
  }, [
143
142
  t(E)(e.separator) ? (a(), n(C, { key: 0 }, [
144
143
  q(p(e.separator), 1)
145
- ], 64)) : (a(), b(N(e.separator), { key: 1 }))
144
+ ], 64)) : (a(), g(N(e.separator), { key: 1 }))
146
145
  ], 6)) : I("", !0)
147
146
  ], 64))), 128))
148
147
  ])
@@ -1,6 +1,7 @@
1
1
  import { ApExportGroupProps } from './interface';
2
2
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
3
  declare const _default: DefineComponent<ApExportGroupProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApExportGroupProps> & Readonly<{}>, {
4
+ type: "button" | "dropdown";
4
5
  exportField: boolean | {
5
6
  key?: string;
6
7
  convertField?: {
@@ -1,18 +1,21 @@
1
- import { defineComponent as N, ref as L, computed as s, watch as O, createBlock as g, createCommentVNode as V, openBlock as p, unref as o, normalizeClass as q, withCtx as n, createVNode as b, mergeProps as z, createTextVNode as w, toDisplayString as h } from "vue";
1
+ import { defineComponent as O, ref as A, computed as s, watch as V, createElementBlock as $, openBlock as d, Fragment as q, createBlock as y, createCommentVNode as M, unref as a, mergeProps as B, withCtx as n, createTextVNode as x, toDisplayString as g, normalizeClass as z, createVNode as h } from "vue";
2
2
  import { DownOutlined as U } from "@ant-design/icons-vue";
3
- import { message as $, Dropdown as H, Button as J, Menu as Q, MenuItem as S } from "@aplus-frontend/antdv";
3
+ import { message as H, Dropdown as J, Menu as Q, MenuItem as G } from "@aplus-frontend/antdv";
4
4
  import "../../config-provider/index.mjs";
5
- import { ApExportGroupActionType as m } from "./interface.mjs";
5
+ import { ApExportGroupActionType as r } from "./interface.mjs";
6
6
  import { usePermission as W } from "@aplus-frontend/hooks";
7
7
  import { handleExportDownload as X } from "./handleExportDownload.mjs";
8
8
  import { useInjectApTable as Y } from "../../ap-table/context.mjs";
9
9
  import { convertExportField as Z } from "./convertExportField.mjs";
10
+ import "../../ap-button/index.mjs";
10
11
  import { useNamespace as ee } from "../../config-provider/hooks/use-namespace.mjs";
11
12
  import { useLocale as te } from "../../config-provider/hooks/use-locale.mjs";
12
- import { useGlobalConfig as A } from "../../config-provider/hooks/use-global-config.mjs";
13
- const ve = /* @__PURE__ */ N({
13
+ import { useGlobalConfig as ae } from "../../config-provider/hooks/use-global-config.mjs";
14
+ import P from "../../ap-button/ap-button.vue.mjs";
15
+ const ge = /* @__PURE__ */ O({
14
16
  __name: "ApExportGroup",
15
17
  props: {
18
+ type: { default: "button" },
16
19
  selectedRowKeys: {},
17
20
  disabled: { type: Boolean },
18
21
  auth: {},
@@ -26,124 +29,130 @@ const ve = /* @__PURE__ */ N({
26
29
  successMessage: { type: [Boolean, String], default: !1 },
27
30
  exportField: { type: [Boolean, Object], default: void 0 }
28
31
  },
29
- setup(_) {
30
- const { hasPermission: B } = W(), e = _, { columns: u, dataSource: r } = Y(), { b: G } = ee("ap-export-group"), { t: i } = te(), P = A("uiMode"), E = A("exportField"), c = L(!1), v = L(!1), K = s(() => {
31
- const t = {
32
- aplus: "#0070FF",
33
- admin: "#34b77c"
34
- };
35
- return d.value ? "" : t[P.value] || t.aplus;
36
- }), d = s(
32
+ setup(K) {
33
+ const { hasPermission: T } = W(), e = K, { columns: c, dataSource: f } = Y(), { b: D } = ee("ap-export-group"), { t: u } = te(), C = ae("exportField"), i = A(!1), p = A(!1), m = s(
37
34
  () => {
38
35
  var t;
39
- return !!(e != null && e.disabled) || (r !== void 0 ? !((t = r == null ? void 0 : r.value) != null && t.length) : !1) || c.value;
36
+ return !!(e != null && e.disabled) || (f !== void 0 ? !((t = f == null ? void 0 : f.value) != null && t.length) : !1) || i.value;
40
37
  }
41
38
  );
42
- O(
43
- () => d.value,
39
+ V(
40
+ () => m.value,
44
41
  () => {
45
- d.value && (v.value = !1);
42
+ m.value && (p.value = !1);
46
43
  },
47
44
  {
48
45
  immediate: !0
49
46
  }
50
47
  );
51
- const D = s(() => (e == null ? void 0 : e.successMessage) === !0 ? i("ap.apExportGroup.exportSuccess") : e != null && e.successMessage ? e.successMessage : ""), y = s(() => {
52
- const t = "exportFieldList", a = (e == null ? void 0 : e.exportField) ?? (E.value === "" ? !0 : E.value) ?? !1;
53
- return a === !0 ? {
48
+ const R = s(() => (e == null ? void 0 : e.successMessage) === !0 ? u("ap.apExportGroup.exportSuccess") : e != null && e.successMessage ? e.successMessage : ""), b = s(() => {
49
+ const t = "exportFieldList", l = (e == null ? void 0 : e.exportField) ?? (C.value === "" ? !0 : C.value) ?? !1;
50
+ return l === !0 ? {
54
51
  key: t
55
- } : typeof a == "object" ? {
56
- ...a,
57
- key: a.key ?? t
58
- } : a;
59
- }), R = {
52
+ } : typeof l == "object" ? {
53
+ ...l,
54
+ key: l.key ?? t
55
+ } : l;
56
+ }), j = {
60
57
  textAlign: "center"
61
- }, F = s(() => (e == null ? void 0 : e.selectedRowKeys) || []), T = s(() => {
58
+ }, k = s(() => (e == null ? void 0 : e.selectedRowKeys) || []), L = s(() => {
62
59
  let t = e == null ? void 0 : e.ifShow;
63
- return !(e != null && e.ifShow) && (e != null && e.auth) && (t = () => B(e.auth)), (t == null ? void 0 : t()) ?? !0;
60
+ return !(e != null && e.ifShow) && (e != null && e.auth) && (t = () => T(e.auth)), (t == null ? void 0 : t()) ?? !0;
64
61
  });
65
- async function j({ key: t }) {
66
- var M, k, C;
67
- const { getRequestParams: a, request: l } = e || {};
68
- let x = {};
69
- t === m.SELECT ? x = {
70
- [(e == null ? void 0 : e.idKey) || "ids"]: F.value
71
- } : t === m.ALL && (x = (a == null ? void 0 : a()) || {});
72
- const I = ((M = e == null ? void 0 : e.getInitialParams) == null ? void 0 : M.call(e)) || {};
62
+ async function I() {
63
+ k.value.length > 0 ? w({ key: r.SELECT }) : w({ key: r.ALL });
64
+ }
65
+ async function w({ key: t }) {
66
+ var F, S, _;
67
+ const { getRequestParams: l, request: o } = e || {};
68
+ let E = {};
69
+ t === r.SELECT ? E = {
70
+ [(e == null ? void 0 : e.idKey) || "ids"]: k.value
71
+ } : t === r.ALL && (E = (l == null ? void 0 : l()) || {});
72
+ const N = ((F = e == null ? void 0 : e.getInitialParams) == null ? void 0 : F.call(e)) || {};
73
73
  try {
74
- c.value = !0;
75
- let f = Object.assign(
74
+ i.value = !0;
75
+ let v = Object.assign(
76
76
  {
77
- ...x,
78
- ...I
77
+ ...E,
78
+ ...N
79
79
  },
80
- y.value && (u != null && u.value) ? {
81
- [y.value.key]: Z(
82
- u.value,
83
- (k = y.value) == null ? void 0 : k.convertField
80
+ b.value && (c != null && c.value) ? {
81
+ [b.value.key]: Z(
82
+ c.value,
83
+ (S = b.value) == null ? void 0 : S.convertField
84
84
  )
85
85
  } : {}
86
86
  );
87
- f = ((C = e == null ? void 0 : e.beforeRequest) == null ? void 0 : C.call(e, f)) || f, await X(async () => await (l == null ? void 0 : l(f))), e != null && e.successMessage && $.success(D.value);
87
+ v = ((_ = e == null ? void 0 : e.beforeRequest) == null ? void 0 : _.call(e, v)) || v, await X(async () => await (o == null ? void 0 : o(v))), e != null && e.successMessage && H.success(R.value);
88
88
  } finally {
89
- c.value = !1;
89
+ i.value = !1;
90
90
  }
91
91
  }
92
- return (t, a) => T.value ? (p(), g(o(H), {
93
- key: 0,
94
- open: v.value,
95
- "onUpdate:open": a[0] || (a[0] = (l) => v.value = l),
96
- class: q([o(G)()]),
97
- "overlay-style": R,
98
- disabled: d.value
99
- }, {
100
- overlay: n(() => [
101
- b(o(Q), { onClick: j }, {
102
- default: n(() => {
103
- var l;
104
- return [
105
- (p(), g(o(S), {
106
- key: o(m).SELECT,
107
- disabled: ((l = F.value) == null ? void 0 : l.length) === 0
108
- }, {
109
- default: n(() => [
110
- w(h(o(i)("ap.apExportGroup.exportSelected")), 1)
111
- ]),
112
- _: 1
113
- }, 8, ["disabled"])),
114
- (p(), g(o(S), {
115
- key: o(m).ALL
116
- }, {
117
- default: n(() => [
118
- w(h(o(i)("ap.apExportGroup.exportAll")), 1)
119
- ]),
120
- _: 1
121
- }))
122
- ];
123
- }),
124
- _: 1
125
- })
126
- ]),
127
- default: n(() => [
128
- b(o(J), z({
129
- ...t.$attrs
130
- }, {
131
- style: {
132
- color: K.value
133
- },
134
- loading: c.value
135
- }), {
136
- default: n(() => [
137
- w(h((e == null ? void 0 : e.text) ?? o(i)("ap.apExportGroup.export")) + " ", 1),
138
- b(o(U))
139
- ]),
140
- _: 1
141
- }, 16, ["style", "loading"])
142
- ]),
143
- _: 1
144
- }, 8, ["open", "class", "disabled"])) : V("", !0);
92
+ return (t, l) => (d(), $(q, null, [
93
+ L.value && e.type === "button" ? (d(), y(a(P), B({ key: 0 }, {
94
+ ...t.$attrs
95
+ }, {
96
+ disabled: m.value,
97
+ loading: i.value,
98
+ onClick: I
99
+ }), {
100
+ default: n(() => [
101
+ x(g((e == null ? void 0 : e.text) ?? a(u)("ap.apExportGroup.export")), 1)
102
+ ]),
103
+ _: 1
104
+ }, 16, ["disabled", "loading"])) : M("", !0),
105
+ L.value && e.type === "dropdown" ? (d(), y(a(J), {
106
+ key: 1,
107
+ open: p.value,
108
+ "onUpdate:open": l[0] || (l[0] = (o) => p.value = o),
109
+ class: z([a(D)()]),
110
+ "overlay-style": j,
111
+ disabled: m.value
112
+ }, {
113
+ overlay: n(() => [
114
+ h(a(Q), { onClick: w }, {
115
+ default: n(() => {
116
+ var o;
117
+ return [
118
+ (d(), y(a(G), {
119
+ key: a(r).SELECT,
120
+ disabled: ((o = k.value) == null ? void 0 : o.length) === 0
121
+ }, {
122
+ default: n(() => [
123
+ x(g(a(u)("ap.apExportGroup.exportSelected")), 1)
124
+ ]),
125
+ _: 1
126
+ }, 8, ["disabled"])),
127
+ (d(), y(a(G), {
128
+ key: a(r).ALL
129
+ }, {
130
+ default: n(() => [
131
+ x(g(a(u)("ap.apExportGroup.exportAll")), 1)
132
+ ]),
133
+ _: 1
134
+ }))
135
+ ];
136
+ }),
137
+ _: 1
138
+ })
139
+ ]),
140
+ default: n(() => [
141
+ h(a(P), B({
142
+ ...t.$attrs
143
+ }, { loading: i.value }), {
144
+ default: n(() => [
145
+ x(g((e == null ? void 0 : e.text) ?? a(u)("ap.apExportGroup.export")) + " ", 1),
146
+ h(a(U))
147
+ ]),
148
+ _: 1
149
+ }, 16, ["loading"])
150
+ ]),
151
+ _: 1
152
+ }, 8, ["open", "class", "disabled"])) : M("", !0)
153
+ ], 64));
145
154
  }
146
155
  });
147
156
  export {
148
- ve as default
157
+ ge as default
149
158
  };
@@ -5,6 +5,7 @@ import { ApExportGroupProps } from './interface';
5
5
  export * from './interface';
6
6
  declare const ApExportGroup: {
7
7
  new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly< ApExportGroupProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
8
+ type: "button" | "dropdown";
8
9
  exportField: boolean | {
9
10
  key?: string;
10
11
  convertField?: {
@@ -20,6 +21,7 @@ declare const ApExportGroup: {
20
21
  M: {};
21
22
  Defaults: {};
22
23
  }, Readonly< ApExportGroupProps> & Readonly<{}>, {}, {}, {}, {}, {
24
+ type: "button" | "dropdown";
23
25
  exportField: boolean | {
24
26
  key?: string;
25
27
  convertField?: {
@@ -32,6 +34,7 @@ declare const ApExportGroup: {
32
34
  __isTeleport?: never;
33
35
  __isSuspense?: never;
34
36
  } & ComponentOptionsBase<Readonly< ApExportGroupProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
37
+ type: "button" | "dropdown";
35
38
  exportField: boolean | {
36
39
  key?: string;
37
40
  convertField?: {
@@ -1,5 +1,8 @@
1
- import { MenuProps } from '@aplus-frontend/antdv';
2
1
  export interface ApExportGroupProps {
2
+ /**
3
+ * 类型
4
+ */
5
+ type?: 'button' | 'dropdown';
3
6
  /**
4
7
  * 选中行的Key列表
5
8
  */
@@ -52,5 +55,7 @@ export declare enum ApExportGroupActionType {
52
55
  ALL = "ALL",
53
56
  SELECT = "SELECT"
54
57
  }
55
- export type ApExportGroupAntMenuInfo = Parameters<Exclude<MenuProps['onClick'], undefined>>[0];
58
+ export type ApExportGroupAntMenuInfo = {
59
+ key: string | number;
60
+ };
56
61
  export type ApExportGroupMixedParams<ParamsType> = Partial<ParamsType>;
@@ -29,9 +29,9 @@ const T = /* @__PURE__ */ m({
29
29
  r("span", {
30
30
  style: u({
31
31
  color: o(l) === "admin" ? "#999999" : "#8896b0",
32
- fontSize: "14px",
32
+ fontSize: "12px",
33
33
  fontWeight: "normal",
34
- marginLeft: "16px"
34
+ marginLeft: "12px"
35
35
  }),
36
36
  class: "product-number"
37
37
  }, [