@aplus-frontend/ui 0.1.22 → 0.1.24

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 (81) hide show
  1. package/es/index.mjs +66 -63
  2. package/es/src/ap-download/ap-download.vue.d.ts +0 -3
  3. package/es/src/ap-download/ap-download.vue.mjs +10 -10
  4. package/es/src/ap-field/number/index.vue.mjs +20 -19
  5. package/es/src/ap-form/ap-form-item.vue.mjs +27 -25
  6. package/es/src/ap-form/ap-form.vue.d.ts +1 -1
  7. package/es/src/ap-form/ap-form.vue2.mjs +18 -18
  8. package/es/src/ap-form/interface.d.ts +2 -2
  9. package/es/src/ap-form/modal-form/index.vue.d.ts +2 -2
  10. package/es/src/ap-form/search-form/index.vue.d.ts +2 -2
  11. package/es/src/ap-table/ap-table.vue.mjs +202 -198
  12. package/es/src/ap-table/interface.d.ts +1 -1
  13. package/es/src/ap-table/style/ap-table.css +3 -0
  14. package/es/src/ap-table/utils.mjs +1 -1
  15. package/es/src/business/ap-attachment/ApAttachment.d.ts +97 -0
  16. package/es/src/business/ap-attachment/ApAttachment.mjs +82 -0
  17. package/es/src/business/ap-attachment/constans.d.ts +44 -0
  18. package/es/src/business/ap-attachment/constans.mjs +42 -0
  19. package/es/src/business/ap-attachment/index.d.ts +3 -0
  20. package/es/src/business/ap-attachment/interface.d.ts +13 -0
  21. package/es/src/business/ap-attachment/style.css +62 -0
  22. package/es/src/business/ap-input-radio/ApInputRadio.vue.d.ts +2 -0
  23. package/es/src/business/ap-input-radio/ApInputRadio.vue2.mjs +25 -22
  24. package/es/src/business/ap-input-radio/interface.d.ts +8 -2
  25. package/es/src/business/ap-label/ApLabel.mjs +8 -7
  26. package/es/src/business/hooks/index.d.ts +1 -0
  27. package/es/src/business/hooks/index.mjs +4 -0
  28. package/es/src/business/hooks/usePageListApTable.d.ts +29 -0
  29. package/es/src/business/hooks/usePageListApTable.mjs +67 -0
  30. package/es/src/business/index.d.ts +123 -3
  31. package/es/src/business/index.mjs +29 -26
  32. package/es/src/editable-table/form-item.vue.mjs +80 -77
  33. package/es/src/editable-table/hooks/use-get-columns.mjs +64 -56
  34. package/es/src/editable-table/interface.d.ts +4 -4
  35. package/es/src/editable-table/utils.mjs +17 -17
  36. package/es/src/index.mjs +204 -201
  37. package/es/src/locale/lang/en.mjs +4 -0
  38. package/es/src/locale/lang/zh-cn.mjs +4 -0
  39. package/es/src/theme/ap-attachment/ap-attachment.css +62 -0
  40. package/es/src/theme/ap-table/ap-table.css +3 -0
  41. package/lib/index.js +1 -1
  42. package/lib/src/ap-download/ap-download.vue.d.ts +0 -3
  43. package/lib/src/ap-download/ap-download.vue.js +1 -1
  44. package/lib/src/ap-field/number/index.vue.js +1 -1
  45. package/lib/src/ap-form/ap-form-item.vue.js +1 -1
  46. package/lib/src/ap-form/ap-form.vue.d.ts +1 -1
  47. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  48. package/lib/src/ap-form/interface.d.ts +2 -2
  49. package/lib/src/ap-form/modal-form/index.vue.d.ts +2 -2
  50. package/lib/src/ap-form/search-form/index.vue.d.ts +2 -2
  51. package/lib/src/ap-table/ap-table.vue.js +1 -1
  52. package/lib/src/ap-table/interface.d.ts +1 -1
  53. package/lib/src/ap-table/style/ap-table.css +3 -0
  54. package/lib/src/ap-table/utils.js +1 -1
  55. package/lib/src/business/ap-attachment/ApAttachment.d.ts +97 -0
  56. package/lib/src/business/ap-attachment/ApAttachment.js +1 -0
  57. package/lib/src/business/ap-attachment/constans.d.ts +44 -0
  58. package/lib/src/business/ap-attachment/constans.js +1 -0
  59. package/lib/src/business/ap-attachment/index.d.ts +3 -0
  60. package/lib/src/business/ap-attachment/interface.d.ts +13 -0
  61. package/lib/src/business/ap-attachment/style.css +62 -0
  62. package/lib/src/business/ap-input-radio/ApInputRadio.vue.d.ts +2 -0
  63. package/lib/src/business/ap-input-radio/ApInputRadio.vue2.js +1 -1
  64. package/lib/src/business/ap-input-radio/interface.d.ts +8 -2
  65. package/lib/src/business/ap-label/ApLabel.js +1 -1
  66. package/lib/src/business/hooks/index.d.ts +1 -0
  67. package/lib/src/business/hooks/index.js +1 -0
  68. package/lib/src/business/hooks/usePageListApTable.d.ts +29 -0
  69. package/lib/src/business/hooks/usePageListApTable.js +1 -0
  70. package/lib/src/business/index.d.ts +123 -3
  71. package/lib/src/business/index.js +1 -1
  72. package/lib/src/editable-table/form-item.vue.js +1 -1
  73. package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
  74. package/lib/src/editable-table/interface.d.ts +4 -4
  75. package/lib/src/editable-table/utils.js +1 -1
  76. package/lib/src/index.js +1 -1
  77. package/lib/src/locale/lang/en.js +1 -1
  78. package/lib/src/locale/lang/zh-cn.js +1 -1
  79. package/lib/src/theme/ap-attachment/ap-attachment.css +62 -0
  80. package/lib/src/theme/ap-table/ap-table.css +3 -0
  81. package/package.json +2 -2
@@ -1,9 +1,9 @@
1
1
  import { defineComponent as A, ref as E, reactive as N, nextTick as O, toRaw as m, computed as j, openBlock as S, createBlock as W, unref as C, mergeProps as q, withCtx as z, renderSlot as D } from "vue";
2
2
  import { Form as L } from "ant-design-vue";
3
3
  import { useProvideForm as P } from "./context.mjs";
4
- import { isArray as g, cloneDeep as V, omit as K } from "lodash-unified";
4
+ import { isArray as p, cloneDeep as V, omit as K } from "lodash-unified";
5
5
  import { INTERNAL_FORM_INSTANCE_MARK as $ } from "./constant.mjs";
6
- import { isDef as p } from "../utils/index.mjs";
6
+ import { isDef as h } from "../utils/index.mjs";
7
7
  const Y = /* @__PURE__ */ A({
8
8
  __name: "ap-form",
9
9
  props: {
@@ -34,26 +34,26 @@ const Y = /* @__PURE__ */ A({
34
34
  },
35
35
  setup(_, { expose: R }) {
36
36
  const i = _;
37
- function h(e, t, l = !0) {
37
+ function f(e, t, l = !0) {
38
38
  var y;
39
- if (g(e)) {
39
+ if (p(e)) {
40
40
  let n = o;
41
41
  for (let u = 0; u < e.length - 1; u++)
42
42
  e[u] in n || (n[e[u]] = {}), n = n[e[u]];
43
43
  n[e[e.length - 1]] = t;
44
44
  } else
45
45
  o[e] = t;
46
- let r = g(e) ? e[0] : e;
46
+ let r = p(e) ? e[0] : e;
47
47
  l && ((y = i.onValuesChange) == null || y.call(i, { [r]: o[r] }, o)), d();
48
48
  }
49
49
  const a = E();
50
- let f = i.initialValues ? V(i.initialValues) : {};
50
+ let c = i.initialValues ? V(i.initialValues) : {};
51
51
  const o = N(i.initialValues || {});
52
52
  let s = [];
53
53
  const B = async () => {
54
54
  var e;
55
55
  (e = a.value) == null || e.resetFields(), await O(() => {
56
- Object.keys(o).forEach((t) => delete o[t]), Object.assign(o, V(f)), d();
56
+ Object.keys(o).forEach((t) => delete o[t]), Object.assign(o, V(c)), d();
57
57
  });
58
58
  }, I = (e) => {
59
59
  var t;
@@ -73,22 +73,22 @@ const Y = /* @__PURE__ */ A({
73
73
  }, w = (e) => {
74
74
  Object.assign(o, e), d();
75
75
  }, F = (e, t) => {
76
- o[e] = t, d();
76
+ f(e, t), d();
77
77
  };
78
- function c(e, t) {
78
+ function g(e, t) {
79
79
  return t || e(m(o)), s.push(e), () => {
80
80
  s = s.filter((l) => l !== e);
81
81
  };
82
82
  }
83
83
  function v({ initialValue: e, name: t }) {
84
- if (p(e) && p(t))
85
- if (h(t, e, !1), g(t)) {
86
- let l = f;
84
+ if (h(e) && h(t))
85
+ if (f(t, e, !1), p(t)) {
86
+ let l = c;
87
87
  for (let r = 0; r < t.length - 1; r++)
88
- p(l[t[r]]) || (l[t[r]] = {}), l = l[t[r]];
88
+ h(l[t[r]]) || (l[t[r]] = {}), l = l[t[r]];
89
89
  l[t[t.length - 1]] = e;
90
90
  } else
91
- f[t] = e;
91
+ c[t] = e;
92
92
  }
93
93
  function x(e) {
94
94
  if (e !== $) {
@@ -97,7 +97,7 @@ const Y = /* @__PURE__ */ A({
97
97
  }
98
98
  return {
99
99
  registerField: v,
100
- registerWatch: c
100
+ registerWatch: g
101
101
  };
102
102
  }
103
103
  function d() {
@@ -110,9 +110,9 @@ const Y = /* @__PURE__ */ A({
110
110
  }
111
111
  return P({
112
112
  model: j(() => o),
113
- updateModel: h,
113
+ updateModel: f,
114
114
  internalInstance: {
115
- registerWatch: c,
115
+ registerWatch: g,
116
116
  registerField: v,
117
117
  setFieldValue: F
118
118
  }
@@ -125,7 +125,7 @@ const Y = /* @__PURE__ */ A({
125
125
  scrollToField: k,
126
126
  setFieldsValue: w,
127
127
  setFieldValue: F,
128
- registerWatch: c,
128
+ registerWatch: g,
129
129
  getInternalInstance: x
130
130
  }), (e, t) => (S(), W(C(L), q({
131
131
  ref_key: "formRef",
@@ -11,7 +11,7 @@ export type ApFormItemProps = FormItemProps & Partial<ApFormColProps> & {
11
11
  bordered?: boolean;
12
12
  valuePropName?: string;
13
13
  /**
14
- * 表单项的默认值(只生效一次)
14
+ * 表单项的默认值(只生效一次),支持传入异步函数
15
15
  */
16
16
  initialValue?: any;
17
17
  /**
@@ -35,7 +35,7 @@ export type ApFormProps = Omit<FormProps, 'model'> & {
35
35
  export type WatchFunc = (values?: Recordable) => void;
36
36
  export type ApFormExpose<ModelType = any> = {
37
37
  setFieldsValue: (fields: Partial<ModelType>) => void;
38
- setFieldValue: (key: keyof ModelType, value: any) => void;
38
+ setFieldValue: (name: NamePath, value: any) => void;
39
39
  resetFields: () => Promise<void>;
40
40
  clearValidate: (name?: NamePath) => void;
41
41
  validateFields: (nameList?: NamePath[] | string, options?: ValidateOptions) => Promise<Partial<ModelType>> | undefined;
@@ -440,7 +440,7 @@ declare function __VLS_template(): {
440
440
  }> | undefined;
441
441
  scrollToField: (name: NamePath, options?: {}) => void;
442
442
  setFieldsValue: (values: Record<string, any>) => void;
443
- setFieldValue: (key: any, newValue: any) => void;
443
+ setFieldValue: (name: NamePath, newValue: any) => void;
444
444
  registerWatch: (callback: WatchFunc, inner: boolean) => () => void;
445
445
  getInternalInstance: (mark: string) => {
446
446
  registerField: ({ initialValue, name }: RegistedFieldType) => void;
@@ -632,7 +632,7 @@ declare function __VLS_template(): {
632
632
  }> | undefined;
633
633
  scrollToField: (name: NamePath, options?: {}) => void;
634
634
  setFieldsValue: (values: Record<string, any>) => void;
635
- setFieldValue: (key: any, newValue: any) => void;
635
+ setFieldValue: (name: NamePath, newValue: any) => void;
636
636
  registerWatch: (callback: WatchFunc, inner: boolean) => () => void;
637
637
  getInternalInstance: (mark: string) => {
638
638
  registerField: ({ initialValue, name }: RegistedFieldType) => void;
@@ -435,7 +435,7 @@ declare function __VLS_template(): {
435
435
  }> | undefined;
436
436
  scrollToField: (name: NamePath, options?: {}) => void;
437
437
  setFieldsValue: (values: Record<string, any>) => void;
438
- setFieldValue: (key: any, newValue: any) => void;
438
+ setFieldValue: (name: NamePath, newValue: any) => void;
439
439
  registerWatch: (callback: WatchFunc, inner: boolean) => () => void;
440
440
  getInternalInstance: (mark: string) => {
441
441
  registerField: ({ initialValue, name }: RegistedFieldType) => void;
@@ -627,7 +627,7 @@ declare function __VLS_template(): {
627
627
  }> | undefined;
628
628
  scrollToField: (name: NamePath, options?: {}) => void;
629
629
  setFieldsValue: (values: Record<string, any>) => void;
630
- setFieldValue: (key: any, newValue: any) => void;
630
+ setFieldValue: (name: NamePath, newValue: any) => void;
631
631
  registerWatch: (callback: WatchFunc, inner: boolean) => () => void;
632
632
  getInternalInstance: (mark: string) => {
633
633
  registerField: ({ initialValue, name }: RegistedFieldType) => void;
@@ -1,21 +1,21 @@
1
- import { defineComponent as ie, useSlots as ce, ref as pe, unref as l, createVNode as m, Fragment as D, watchEffect as fe, computed as s, watch as me, openBlock as g, createElementBlock as x, normalizeClass as v, normalizeStyle as j, mergeProps as y, createSlots as A, withCtx as h, renderList as W, createBlock as ge, resolveDynamicComponent as ye, renderSlot as b, createCommentVNode as he, createElementVNode as be, normalizeProps as Se, guardReactiveProps as we } from "vue";
2
- import { Typography as Re, Table as Ce } from "ant-design-vue";
3
- import { useToken as Te } from "ant-design-vue/es/theme/internal";
4
- import { ApForm as Fe } from "../ap-form/index.mjs";
5
- import { noRenderAsFormItemValueList as H } from "./constants.mjs";
1
+ import { defineComponent as pe, useSlots as fe, ref as me, unref as l, createVNode as g, Fragment as j, watchEffect as ge, computed as d, watch as ye, openBlock as y, createElementBlock as v, normalizeClass as B, normalizeStyle as A, mergeProps as h, createSlots as W, withCtx as b, renderList as H, createBlock as he, resolveDynamicComponent as be, renderSlot as S, createCommentVNode as Se, createElementVNode as we, normalizeProps as Re, guardReactiveProps as Ce } from "vue";
2
+ import { Typography as Te, Table as Fe } from "ant-design-vue";
3
+ import { useToken as xe } from "ant-design-vue/es/theme/internal";
4
+ import { ApForm as ve } from "../ap-form/index.mjs";
5
+ import { noRenderAsFormItemValueList as $ } from "./constants.mjs";
6
6
  import "../config-provider/index.mjs";
7
- import { useTablePaging as xe } from "./hooks/use-table-paging.mjs";
8
- import { omit as $, isUndefined as u, isBoolean as ve } from "lodash-unified";
7
+ import { useTablePaging as Be } from "./hooks/use-table-paging.mjs";
8
+ import { omit as q, isUndefined as i, isBoolean as Pe } from "lodash-unified";
9
9
  import "./style/ap-table.css";
10
- import { apColumnToColumn as Be, getTableTitle as Pe, getTableRenderType as Ie, getTableRenderProps as ke, getTableCellRenderNode as ze, getColumnOrder as q, updateFormProps as Ne, getFieldProps as Le, getPlaceholder as Ee, getSearchFormItemRenderNode as Ve, objectToString as Ke } from "./utils.mjs";
11
- import Oe from "./hooks/use-table-content-height.mjs";
12
- import { getRawDisplayValue as De } from "../editable-table/utils.mjs";
13
- import je from "./hooks/use-table-row-selection.mjs";
14
- import { isDef as Ae } from "../utils/index.mjs";
15
- import { useLocale as We } from "../config-provider/hooks/use-locale.mjs";
16
- import { useNamespace as He } from "../config-provider/hooks/use-namespace.mjs";
17
- import { useGlobalConfig as $e } from "../config-provider/hooks/use-global-config.mjs";
18
- const sa = /* @__PURE__ */ ie({
10
+ import { apColumnToColumn as Ie, getTableTitle as ke, getTableRenderType as ze, getTableRenderProps as Ne, getTableCellRenderNode as Le, getColumnOrder as U, updateFormProps as Ee, getFieldProps as Ve, getPlaceholder as Ke, getSearchFormItemRenderNode as Oe, objectToString as De } from "./utils.mjs";
11
+ import je from "./hooks/use-table-content-height.mjs";
12
+ import { getRawDisplayValue as Ae } from "../editable-table/utils.mjs";
13
+ import We from "./hooks/use-table-row-selection.mjs";
14
+ import { isDef as He } from "../utils/index.mjs";
15
+ import { useLocale as $e } from "../config-provider/hooks/use-locale.mjs";
16
+ import { useNamespace as qe } from "../config-provider/hooks/use-namespace.mjs";
17
+ import { useGlobalConfig as Ue } from "../config-provider/hooks/use-global-config.mjs";
18
+ const ua = /* @__PURE__ */ pe({
19
19
  name: "ApTable",
20
20
  __name: "ap-table",
21
21
  props: {
@@ -135,240 +135,244 @@ const sa = /* @__PURE__ */ ie({
135
135
  default: !1
136
136
  }
137
137
  },
138
- setup(U, {
139
- expose: G
138
+ setup(G, {
139
+ expose: M
140
140
  }) {
141
- const a = U;
142
- let B = 0;
143
- const S = ce(), [, M] = Te(), {
144
- t: J
145
- } = We(), {
146
- e: w,
147
- b: c
148
- } = He("ap-table"), P = $e("valueTypeMap"), {
149
- height: Q,
150
- contentRef: X
151
- } = Oe(), i = pe([]), Y = () => {
141
+ const e = G;
142
+ let P = 0;
143
+ const w = fe(), [, J] = xe(), {
144
+ t: Q
145
+ } = $e(), {
146
+ e: R,
147
+ b: p
148
+ } = qe("ap-table"), I = Ue("valueTypeMap"), {
149
+ height: X,
150
+ contentRef: Y
151
+ } = je(), c = me([]), Z = () => {
152
152
  var t;
153
- let e = ((t = a.columns) == null ? void 0 : t.filter((o) => !o.hideInTable)) || [];
154
- return e = e.map((o) => ({
155
- resizable: Ae(o.resizable) ? o.resizable : a.columnResizable,
156
- ...$(Be(o), ["ellipsis"]),
157
- title: Pe(o, S.headerCell, l(M).colorPrimary),
158
- customRender({
159
- value: r,
160
- ...n
161
- }) {
162
- var K, O;
163
- const d = Ie(o), E = ke({
164
- ...o,
165
- valueType: d
166
- }, {
167
- value: r,
168
- ...n
169
- }), de = ze(d, E, n.record, l(P)), V = ((K = o.renderText) == null ? void 0 : K.call(o, {
170
- value: r,
171
- ...n
172
- })) || r, ue = o.renderText ? m(D, null, [(O = o.renderText) == null ? void 0 : O.call(o, {
173
- value: r,
174
- ...n
175
- })]) : de;
176
- let F = le(o, V, ue);
177
- return o.customRender && (F = o.customRender({
178
- value: r,
179
- ...n,
180
- column: o,
181
- originalNode: F,
182
- originalText: V
183
- })), F;
184
- }
185
- })), e;
153
+ let a = ((t = e.columns) == null ? void 0 : t.filter((r) => !r.hideInTable)) || [];
154
+ function o(r) {
155
+ return r.map((n) => ({
156
+ resizable: He(n.resizable) ? n.resizable : e.columnResizable,
157
+ ...q(Ie(n), ["ellipsis"]),
158
+ title: ke(n, w.headerCell, l(J).colorPrimary),
159
+ customRender({
160
+ value: s,
161
+ ...u
162
+ }) {
163
+ var O, D;
164
+ const V = ze(n), ue = Ne({
165
+ ...n,
166
+ valueType: V
167
+ }, {
168
+ value: s,
169
+ ...u
170
+ }), ie = Le(V, ue, u.record, l(I)), K = ((O = n.renderText) == null ? void 0 : O.call(n, {
171
+ value: s,
172
+ ...u
173
+ })) || s, ce = n.renderText ? g(j, null, [(D = n.renderText) == null ? void 0 : D.call(n, {
174
+ value: s,
175
+ ...u
176
+ })]) : ie;
177
+ let x = ne(n, K, ce);
178
+ return n.customRender && (x = n.customRender({
179
+ value: s,
180
+ ...u,
181
+ column: n,
182
+ originalNode: x,
183
+ originalText: K
184
+ })), x;
185
+ },
186
+ children: o(n.children || [])
187
+ }));
188
+ }
189
+ return o(a);
186
190
  };
187
- fe(() => {
188
- i.value = Y();
191
+ ge(() => {
192
+ c.value = Z();
189
193
  });
190
- const I = s(() => {
191
- var e, t, o;
192
- return B++, ((o = (t = (e = a.columns) == null ? void 0 : e.filter((r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !H.includes(r.valueType))) == null ? void 0 : t.sort((r, n) => {
193
- let d = q(r.order);
194
- return q(n.order) - d;
195
- })) == null ? void 0 : o.map((r) => {
196
- const n = Ne(r, Le(r.fieldProps, {})), d = {
194
+ const k = d(() => {
195
+ var a, o, t;
196
+ return P++, ((t = (o = (a = e.columns) == null ? void 0 : a.filter((r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !$.includes(r.valueType))) == null ? void 0 : o.sort((r, n) => {
197
+ let s = U(r.order);
198
+ return U(n.order) - s;
199
+ })) == null ? void 0 : t.map((r) => {
200
+ const n = Ee(r, Ve(r.fieldProps, {})), s = {
197
201
  ...r,
198
202
  fieldProps: {
199
203
  label: r.title,
200
204
  name: r.dataIndex,
201
205
  ...n || {},
202
206
  // 格式化placeholder
203
- placeholder: Ee(J, r.valueType, n == null ? void 0 : n.placeholder),
204
- _signal: B
207
+ placeholder: Ke(Q, r.valueType, n == null ? void 0 : n.placeholder),
208
+ _signal: P
205
209
  },
206
210
  renderNode: void 0
207
211
  };
208
- return d.renderNode = Ve(d, l(P)), d;
212
+ return s.renderNode = Oe(s, l(I)), s;
209
213
  })) || [];
210
- }), Z = s(() => l(i).filter((e) => e.sorter === !0).map((e) => e.dataIndex).filter(Boolean)), _ = s(() => l(i).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex).filter(Boolean)), ee = s(() => u(a.dataSource) ? f.value.records : a.dataSource), {
211
- rowSelection: R,
212
- selectedRows: k,
213
- ...C
214
- } = je({
215
- ...a.rowSelection === !0 ? {} : a.rowSelection,
216
- rowKey: a.rowKey,
217
- dataSource: ee
214
+ }), _ = d(() => l(c).filter((a) => a.sorter === !0).map((a) => a.dataIndex).filter(Boolean)), ee = d(() => l(c).filter((a) => a.filters && !a.onFilter).map((a) => a.dataIndex).filter(Boolean)), ae = d(() => i(e.dataSource) ? m.value.records : e.dataSource), {
215
+ rowSelection: C,
216
+ selectedRows: z,
217
+ ...T
218
+ } = We({
219
+ ...e.rowSelection === !0 ? {} : e.rowSelection,
220
+ rowKey: e.rowKey,
221
+ dataSource: ae
218
222
  }), {
219
- formRef: T,
220
- submit: z,
221
- reset: N,
222
- tableProps: p,
223
- handleTableChange: ae,
224
- data: f
225
- } = xe({
226
- async request(e) {
227
- var o, r;
228
- !R.value.preserveSelectedRowKeys && u(a.dataSource) && C.clearAll();
229
- const t = await ((o = a.request) == null ? void 0 : o.call(a, e));
230
- return (r = a.onLoad) == null || r.call(a, (t == null ? void 0 : t.data) || []), {
231
- data: (t == null ? void 0 : t.data) || [],
232
- total: (t == null ? void 0 : t.total) || 0
223
+ formRef: F,
224
+ submit: N,
225
+ reset: L,
226
+ tableProps: f,
227
+ handleTableChange: oe,
228
+ data: m
229
+ } = Be({
230
+ async request(a) {
231
+ var t, r;
232
+ !C.value.preserveSelectedRowKeys && i(e.dataSource) && T.clearAll();
233
+ const o = await ((t = e.request) == null ? void 0 : t.call(e, a));
234
+ return (r = e.onLoad) == null || r.call(e, (o == null ? void 0 : o.data) || []), {
235
+ data: (o == null ? void 0 : o.data) || [],
236
+ total: (o == null ? void 0 : o.total) || 0
233
237
  };
234
238
  },
235
- filterFields: _,
236
- sortFields: Z,
237
- defaultParams: a.params,
238
- defaultData: a.defaultData,
239
- manual: a.manual,
240
- defaultCurrent: a.pagination ? a.pagination.defaultCurrent : void 0,
241
- defaultPageSize: a.pagination ? a.pagination.defaultPageSize : void 0,
242
- formatParams: a.beforeSearchSubmit,
243
- showLessItems: a.pagination ? a.pagination.showLessItems : void 0,
244
- showTotal: a.pagination ? a.pagination.showTotal : void 0
245
- }), oe = s(() => {
246
- var t, o;
247
- if (a.adaptive && (f.value.total > 0 || ((t = a.dataSource) == null ? void 0 : t.length)))
239
+ filterFields: ee,
240
+ sortFields: _,
241
+ defaultParams: e.params,
242
+ defaultData: e.defaultData,
243
+ manual: e.manual,
244
+ defaultCurrent: e.pagination ? e.pagination.defaultCurrent : void 0,
245
+ defaultPageSize: e.pagination ? e.pagination.defaultPageSize : void 0,
246
+ formatParams: e.beforeSearchSubmit,
247
+ showLessItems: e.pagination ? e.pagination.showLessItems : void 0,
248
+ showTotal: e.pagination ? e.pagination.showTotal : void 0
249
+ }), re = d(() => {
250
+ var o, t;
251
+ if (e.adaptive && (m.value.total > 0 || ((o = e.dataSource) == null ? void 0 : o.length)))
248
252
  return {
249
- y: l(Q),
250
- x: ((o = a.scroll) == null ? void 0 : o.x) || "100%"
253
+ y: l(X),
254
+ x: ((t = e.scroll) == null ? void 0 : t.x) || "100%"
251
255
  };
252
- if (a.scroll)
253
- return a.scroll;
254
- }), te = s(() => {
255
- var e;
256
- if (a.tableLayout)
257
- return a.tableLayout;
258
- if ((e = a.columns) != null && e.some((t) => t.ellipsis))
256
+ if (e.scroll)
257
+ return e.scroll;
258
+ }), te = d(() => {
259
+ var a;
260
+ if (e.tableLayout)
261
+ return e.tableLayout;
262
+ if ((a = e.columns) != null && a.some((o) => o.ellipsis))
259
263
  return "fixed";
260
- }), L = s(() => {
264
+ }), E = d(() => {
261
265
  var r;
262
- const e = l(p), t = u(a.dataSource) ? e : {
263
- ...e,
264
- dataSource: a.dataSource,
265
- onChange: a.onChange
266
- }, o = l(R);
267
- return {
266
+ const a = l(f), o = i(e.dataSource) ? a : {
268
267
  ...a,
269
- ...t,
270
- rowSelection: a.rowSelection === !0 || ((r = a.rowSelection) == null ? void 0 : r.mode) === "internal" ? {
271
- ...o,
268
+ dataSource: e.dataSource,
269
+ onChange: e.onChange
270
+ }, t = l(C);
271
+ return {
272
+ ...e,
273
+ ...o,
274
+ rowSelection: e.rowSelection === !0 || ((r = e.rowSelection) == null ? void 0 : r.mode) === "internal" ? {
275
+ ...t,
272
276
  // tips 如果是前端分页,则默认会走缓存
273
- preserveSelectedRowKeys: u(a.dataSource) ? o.preserveSelectedRowKeys : !0
274
- } : a.rowSelection,
275
- loading: u(a.loading) ? l(p).loading : a.loading,
276
- pagination: a.pagination === !1 ? !1 : l(p).pagination,
277
- scroll: l(oe)
277
+ preserveSelectedRowKeys: i(e.dataSource) ? t.preserveSelectedRowKeys : !0
278
+ } : e.rowSelection,
279
+ loading: i(e.loading) ? l(f).loading : e.loading,
280
+ pagination: e.pagination === !1 ? !1 : l(f).pagination,
281
+ scroll: l(re)
278
282
  };
279
- }), re = s(() => [c(), a.card ? null : c("wrapper"), a.adaptive ? c("adaptive") : null].filter(Boolean));
280
- function le(e, t, o) {
281
- if (H.includes(e.valueType))
282
- return o;
283
- const r = Ke(t);
284
- return e.copyable || e.ellipsis ? m(Re.Paragraph, {
285
- copyable: e.copyable ? {
283
+ }), le = d(() => [p(), e.card ? null : p("wrapper"), e.adaptive ? p("adaptive") : null].filter(Boolean));
284
+ function ne(a, o, t) {
285
+ if ($.includes(a.valueType))
286
+ return t;
287
+ const r = De(o);
288
+ return a.copyable || a.ellipsis ? g(Te.Paragraph, {
289
+ copyable: a.copyable ? {
286
290
  text: r,
287
291
  tooltip: !1
288
292
  } : !1,
289
- ellipsis: e.ellipsis ? ve(e.ellipsis) ? {
293
+ ellipsis: a.ellipsis ? Pe(a.ellipsis) ? {
290
294
  tooltip: r
291
295
  } : {
292
- ...e.ellipsis,
296
+ ...a.ellipsis,
293
297
  tooltip: r
294
298
  } : !1,
295
- content: e.ellipsis ? De(e, t) : o
296
- }, null) : o;
299
+ content: a.ellipsis ? Ae(a, o) : t
300
+ }, null) : t;
297
301
  }
298
- me(() => l(f).loading, (e) => {
299
- var t;
300
- (t = a.onLoadingChange) == null || t.call(a, e);
302
+ ye(() => l(m).loading, (a) => {
303
+ var o;
304
+ (o = e.onLoadingChange) == null || o.call(e, a);
301
305
  });
302
- function ne(e) {
303
- var t, o, r;
304
- (r = (o = (t = T.value) == null ? void 0 : t.apForm) == null ? void 0 : o.setFieldsValue) == null || r.call(o, e);
306
+ function se(a) {
307
+ var o, t, r;
308
+ (r = (t = (o = F.value) == null ? void 0 : o.apForm) == null ? void 0 : t.setFieldsValue) == null || r.call(t, a);
305
309
  }
306
- function se() {
307
- var e, t, o;
308
- return (o = (t = (e = T.value) == null ? void 0 : e.apForm) == null ? void 0 : t.getFieldsValue) == null ? void 0 : o.call(t, !0);
310
+ function de() {
311
+ var a, o, t;
312
+ return (t = (o = (a = F.value) == null ? void 0 : a.apForm) == null ? void 0 : o.getFieldsValue) == null ? void 0 : t.call(o, !0);
309
313
  }
310
- return G({
311
- submit: () => z(),
312
- reset: () => N(),
313
- setSearchFormValues: ne,
314
- getSearchFormValues: se,
315
- dataSource: s(() => l(f).records),
314
+ return M({
315
+ submit: () => N(),
316
+ reset: () => L(),
317
+ setSearchFormValues: se,
318
+ getSearchFormValues: de,
319
+ dataSource: d(() => l(m).records),
316
320
  rowSelection: {
317
- selectedRows: s(() => l(k)),
318
- ...C
321
+ selectedRows: d(() => l(z)),
322
+ ...T
319
323
  }
320
- }), (e, t) => (g(), x("div", {
321
- class: v(re.value)
322
- }, [l(u)(e.dataSource) && e.searchForm !== !1 && I.value.length > 0 ? (g(), x("div", {
324
+ }), (a, o) => (y(), v("div", {
325
+ class: B(le.value)
326
+ }, [l(i)(a.dataSource) && a.searchForm !== !1 && k.value.length > 0 ? (y(), v("div", {
323
327
  key: 0,
324
- class: v(e.card ? l(w)("search-wrapper") : null),
325
- style: j(e.searchFormWrapperStyle)
326
- }, [m(l(Fe).SearchForm, y(e.searchForm || {}, {
328
+ class: B(a.card ? l(R)("search-wrapper") : null),
329
+ style: A(a.searchFormWrapperStyle)
330
+ }, [g(l(ve).SearchForm, h(a.searchForm || {}, {
327
331
  ref_key: "formRef",
328
- ref: T,
332
+ ref: F,
329
333
  "custom-reset": "",
330
- onSubmit: l(z),
331
- onReset: l(N),
332
- "submit-loading": l(p).loading
333
- }), A({
334
- default: h(() => [(g(!0), x(D, null, W(I.value, (o) => (g(), ge(ye(o.renderNode), y({
335
- key: o.dataIndex,
334
+ onSubmit: l(N),
335
+ onReset: l(L),
336
+ "submit-loading": l(f).loading
337
+ }), W({
338
+ default: b(() => [(y(!0), v(j, null, H(k.value, (t) => (y(), he(be(t.renderNode), h({
339
+ key: t.dataIndex,
336
340
  ref_for: !0
337
- }, o.fieldProps || {}, {
338
- span: o.span
341
+ }, t.fieldProps || {}, {
342
+ span: t.span
339
343
  }), null, 16, ["span"]))), 128))]),
340
344
  _: 2
341
- }, [S.searchFormExtra ? {
345
+ }, [w.searchFormExtra ? {
342
346
  name: "extra",
343
- fn: h(() => [b(e.$slots, "searchFormExtra")]),
347
+ fn: b(() => [S(a.$slots, "searchFormExtra")]),
344
348
  key: "0"
345
- } : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : he("", !0), be("div", {
349
+ } : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : Se("", !0), we("div", {
346
350
  ref_key: "contentRef",
347
- ref: X,
348
- class: v([l(w)("table-wrapper"), e.card ? l(w)("table-wrapper-card") : null]),
349
- style: j(e.tableWrapperStyle)
350
- }, [b(e.$slots, "title", y({
351
- selectedRows: l(k),
352
- selectedRowKeys: l(R).selectedRowKeys
353
- }, C)), m(l(Ce), y({
354
- class: l(c)("table")
355
- }, L.value, {
351
+ ref: Y,
352
+ class: B([l(R)("table-wrapper"), a.card ? l(R)("table-wrapper-card") : null]),
353
+ style: A(a.tableWrapperStyle)
354
+ }, [S(a.$slots, "title", h({
355
+ selectedRows: l(z),
356
+ selectedRowKeys: l(C).selectedRowKeys
357
+ }, T)), g(l(Fe), h({
358
+ class: l(p)("table")
359
+ }, E.value, {
356
360
  "table-layout": te.value,
357
- onChange: l(ae),
358
- columns: i.value,
359
- onResizeColumn: t[0] || (t[0] = (o, r) => r.width = o)
360
- }), A({
361
- summary: h(() => [b(e.$slots, "summary", {
362
- columns: i.value,
363
- records: L.value.dataSource
361
+ onChange: l(oe),
362
+ columns: c.value,
363
+ onResizeColumn: o[0] || (o[0] = (t, r) => r.width = t)
364
+ }), W({
365
+ summary: b(() => [S(a.$slots, "summary", {
366
+ columns: c.value,
367
+ records: E.value.dataSource
364
368
  })]),
365
369
  _: 2
366
- }, [W(l($)(S, ["title", "searchFormExtra", "headerCell"]), (o, r) => ({
370
+ }, [H(l(q)(w, ["title", "searchFormExtra", "headerCell"]), (t, r) => ({
367
371
  name: r,
368
- fn: h((n) => [b(e.$slots, r, Se(we(n || {})))])
372
+ fn: b((n) => [S(a.$slots, r, Re(Ce(n || {})))])
369
373
  }))]), 1040, ["class", "table-layout", "onChange", "columns"])], 6)], 2));
370
374
  }
371
375
  });
372
376
  export {
373
- sa as default
377
+ ua as default
374
378
  };
@@ -68,7 +68,7 @@ export type ApTableRowSelection<RecordType = any> = Omit<TableRowSelection<Recor
68
68
  mode: 'internal';
69
69
  };
70
70
  export type CommonFieldReturnType = ApFormItemProps & {
71
- field: Recordable;
71
+ field?: Recordable;
72
72
  placeholder?: string;
73
73
  disabled?: boolean;
74
74
  };