@aplus-frontend/ui 0.0.3 → 0.0.4

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 (33) hide show
  1. package/es/src/ap-table/ap-table.vue.mjs +77 -81
  2. package/es/src/ap-table/components/interface.d.ts +12 -0
  3. package/es/src/ap-table/components/status/index.vue.d.ts +14 -0
  4. package/es/src/ap-table/components/status/index.vue.mjs +4 -0
  5. package/es/src/ap-table/components/status/index.vue2.mjs +17 -0
  6. package/es/src/ap-table/constants.d.ts +20 -25
  7. package/es/src/ap-table/constants.mjs +19 -16
  8. package/es/src/ap-table/interface.d.ts +16 -3
  9. package/es/src/ap-table/utils.d.ts +174 -1
  10. package/es/src/ap-table/utils.mjs +75 -48
  11. package/es/src/theme/antd-global-overwrite/admin/index.css +69 -29
  12. package/es/src/theme/antd-global-overwrite/admin/pagination.css +30 -14
  13. package/es/src/theme/antd-global-overwrite/admin/steps.css +39 -15
  14. package/es/src/theme/antd-global-overwrite/aplus/index.css +75 -33
  15. package/es/src/theme/antd-global-overwrite/aplus/pagination.css +38 -18
  16. package/es/src/theme/antd-global-overwrite/aplus/steps.css +37 -15
  17. package/lib/src/ap-table/ap-table.vue.js +1 -1
  18. package/lib/src/ap-table/components/interface.d.ts +12 -0
  19. package/lib/src/ap-table/components/status/index.vue.d.ts +14 -0
  20. package/lib/src/ap-table/components/status/index.vue.js +1 -0
  21. package/lib/src/ap-table/components/status/index.vue2.js +1 -0
  22. package/lib/src/ap-table/constants.d.ts +20 -25
  23. package/lib/src/ap-table/constants.js +1 -1
  24. package/lib/src/ap-table/interface.d.ts +16 -3
  25. package/lib/src/ap-table/utils.d.ts +174 -1
  26. package/lib/src/ap-table/utils.js +1 -1
  27. package/lib/src/theme/antd-global-overwrite/admin/index.css +69 -29
  28. package/lib/src/theme/antd-global-overwrite/admin/pagination.css +30 -14
  29. package/lib/src/theme/antd-global-overwrite/admin/steps.css +39 -15
  30. package/lib/src/theme/antd-global-overwrite/aplus/index.css +75 -33
  31. package/lib/src/theme/antd-global-overwrite/aplus/pagination.css +38 -18
  32. package/lib/src/theme/antd-global-overwrite/aplus/steps.css +37 -15
  33. package/package.json +1 -1
@@ -1,19 +1,19 @@
1
- import { defineComponent as U, computed as u, createVNode as d, mergeProps as f, unref as n, watch as J, openBlock as i, createElementBlock as m, normalizeClass as b, normalizeStyle as T, withCtx as y, Fragment as X, renderList as B, createBlock as Y, resolveDynamicComponent as Z, createCommentVNode as I, createElementVNode as v, renderSlot as P, createSlots as ee, toDisplayString as ae, normalizeProps as te, guardReactiveProps as oe } from "vue";
2
- import { Typography as ne, Table as le, Tooltip as re } from "ant-design-vue";
3
- import { ApForm as de } from "../ap-form/index.mjs";
4
- import { apTableRenderItemMap as se, noRenderAsFormItemValueList as k, apTableFormItemMap as ue } from "./constants.mjs";
1
+ import { defineComponent as K, computed as u, createVNode as d, mergeProps as m, unref as n, watch as $, openBlock as p, createElementBlock as c, normalizeClass as b, normalizeStyle as T, withCtx as f, Fragment as H, renderList as x, createBlock as G, resolveDynamicComponent as Q, createCommentVNode as B, createElementVNode as P, renderSlot as I, createSlots as U, toDisplayString as J, normalizeProps as X, guardReactiveProps as Y } from "vue";
2
+ import { Typography as Z, Table as ee, Tooltip as ae } from "ant-design-vue";
3
+ import { ApForm as te } from "../ap-form/index.mjs";
4
+ import { apTableRenderItemMap as oe, noRenderAsFormItemValueList as v, apTableFormItemMap as ne } from "./constants.mjs";
5
5
  import "../config-provider/index.mjs";
6
- import { useTablePaging as ie } from "./hooks/use-table-paging.mjs";
7
- import { omit as O, isUndefined as pe } from "lodash-unified";
6
+ import { useTablePaging as le } from "./hooks/use-table-paging.mjs";
7
+ import { isUndefined as re, omit as de } from "lodash-unified";
8
8
  import "./style/ap-table.css";
9
- import { QuestionCircleOutlined as ce } from "@ant-design/icons-vue";
10
- import { getFieldProps as z, getColumnOrder as E, getPlaceholder as fe } from "./utils.mjs";
11
- import { useLocale as me } from "../config-provider/hooks/use-locale.mjs";
9
+ import { QuestionCircleOutlined as se } from "@ant-design/icons-vue";
10
+ import { apColumnToColumn as ue, getTableRenderType as pe, getTableRenderProps as ie, getColumnOrder as k, updateFormProps as me, getFieldProps as ce, getPlaceholder as fe } from "./utils.mjs";
11
+ import { useLocale as ge } from "../config-provider/hooks/use-locale.mjs";
12
12
  import { useNamespace as ye } from "../config-provider/hooks/use-namespace.mjs";
13
- import { useGlobalConfig as ge } from "../config-provider/hooks/use-global-config.mjs";
13
+ import { useGlobalConfig as be } from "../config-provider/hooks/use-global-config.mjs";
14
14
  const he = {
15
15
  key: 0
16
- }, Oe = /* @__PURE__ */ U({
16
+ }, ze = /* @__PURE__ */ K({
17
17
  name: "ApTable",
18
18
  __name: "ap-table",
19
19
  props: {
@@ -122,19 +122,19 @@ const he = {
122
122
  default: "middle"
123
123
  }
124
124
  },
125
- setup(L, {
126
- expose: N
125
+ setup(O, {
126
+ expose: z
127
127
  }) {
128
- const l = L, {
129
- t: D
130
- } = me(), {
131
- e: C,
128
+ const l = O, {
129
+ t: E
130
+ } = ge(), {
131
+ e: h,
132
132
  b: g
133
- } = ye("ap-table"), V = ge("uiMode"), h = u(() => {
133
+ } = ye("ap-table"), L = be("uiMode"), y = u(() => {
134
134
  var o;
135
135
  let e = ((o = l.columns) == null ? void 0 : o.filter((a) => !a.hideInTable)) || [];
136
136
  return e = e.map((a) => ({
137
- ...a,
137
+ ...ue(a),
138
138
  customRender({
139
139
  value: t,
140
140
  ...r
@@ -147,47 +147,43 @@ const he = {
147
147
  column: a
148
148
  });
149
149
  else {
150
- const R = se[a.valueType || "text"], c = z(a.fieldProps, {
150
+ const w = pe(a), _ = oe[w], q = ie(a, {
151
151
  value: t,
152
152
  ...r
153
- }), $ = (c == null ? void 0 : c.field) || c || {}, H = a.valueType === "switch", G = a.valueType === "index", Q = H ? {
154
- checked: t
155
- } : {
156
- value: G ? r.index + 1 : t
157
- };
158
- s = d(R, f(O($, ["request"]), Q, {
153
+ });
154
+ s = d(_, m(q, {
159
155
  mode: "read"
160
156
  }), null);
161
157
  }
162
- return _(a, t, s);
158
+ return A(a, t, s);
163
159
  }
164
160
  })), e;
165
- }), S = u(() => {
161
+ }), C = u(() => {
166
162
  var e, o, a;
167
- return ((a = (o = (e = l.columns) == null ? void 0 : e.filter((t) => !t.hideInSearch && t.dataIndex && (t.valueType || t.customRenderFormItem) && !k.includes(t.valueType))) == null ? void 0 : o.sort((t, r) => {
168
- let s = E(t.order);
169
- return E(r.order) - s;
163
+ return ((a = (o = (e = l.columns) == null ? void 0 : e.filter((t) => !t.hideInSearch && t.dataIndex && (t.valueType || t.customRenderFormItem) && !v.includes(t.valueType))) == null ? void 0 : o.sort((t, r) => {
164
+ let s = k(t.order);
165
+ return k(r.order) - s;
170
166
  })) == null ? void 0 : a.map((t) => {
171
- const r = z(t.fieldProps);
167
+ const r = me(t, ce(t.fieldProps));
172
168
  return {
173
169
  ...t,
174
170
  fieldProps: {
175
- ...r || {},
176
171
  label: t.title,
177
172
  name: t.dataIndex,
173
+ ...r || {},
178
174
  // 格式化placeholder
179
- placeholder: fe(D, t.valueType, r == null ? void 0 : r.placeholder)
175
+ placeholder: fe(E, t.valueType, r == null ? void 0 : r.placeholder)
180
176
  }
181
177
  };
182
178
  })) || [];
183
- }), j = u(() => n(h).filter((e) => e.sorter === !0).map((e) => e.dataIndex)), W = u(() => n(h).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex)), {
184
- formRef: w,
185
- submit: x,
186
- reset: F,
187
- tableProps: p,
188
- handleTableChange: q,
189
- data: A
190
- } = ie({
179
+ }), N = u(() => n(y).filter((e) => e.sorter === !0).map((e) => e.dataIndex)), D = u(() => n(y).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex)), {
180
+ formRef: F,
181
+ submit: R,
182
+ reset: S,
183
+ tableProps: i,
184
+ handleTableChange: V,
185
+ data: j
186
+ } = le({
191
187
  async request(e) {
192
188
  var a, t;
193
189
  const o = await ((a = l.request) == null ? void 0 : a.call(l, e));
@@ -196,22 +192,22 @@ const he = {
196
192
  total: (o == null ? void 0 : o.total) || 0
197
193
  };
198
194
  },
199
- filterFields: n(W),
200
- sortFields: n(j),
195
+ filterFields: n(D),
196
+ sortFields: n(N),
201
197
  defaultParams: l.params,
202
198
  defaultData: l.defaultData,
203
199
  manual: l.manual,
204
200
  defaultCurrent: l.pagination ? l.pagination.defaultCurrent : void 0,
205
201
  defaultPageSize: l.pagination ? l.pagination.defaultPageSize : void 0,
206
202
  formatParams: l.beforeSearchSubmit
207
- }), M = u(() => ({
203
+ }), W = u(() => ({
208
204
  ...l,
209
- ...n(p),
210
- loading: pe(l.loading) ? n(p).loading : l.loading,
211
- pagination: l.pagination === !1 ? !1 : n(p).pagination
205
+ ...n(i),
206
+ loading: re(l.loading) ? n(i).loading : l.loading,
207
+ pagination: l.pagination === !1 ? !1 : n(i).pagination
212
208
  }));
213
- function _(e, o, a) {
214
- return k.includes(e.valueType) ? a : e.copyable || e.ellipsis ? d(ne.Text, {
209
+ function A(e, o, a) {
210
+ return v.includes(e.valueType) ? a : e.copyable || e.ellipsis ? d(Z.Text, {
215
211
  copyable: e.copyable ? {
216
212
  text: o,
217
213
  tooltip: !1
@@ -222,70 +218,70 @@ const he = {
222
218
  content: a
223
219
  }, null) : a;
224
220
  }
225
- J(() => n(A).loading, (e) => {
221
+ $(() => n(j).loading, (e) => {
226
222
  var o;
227
223
  (o = l.onLoadingChange) == null || o.call(l, e);
228
224
  });
229
- function K(e) {
225
+ function M(e) {
230
226
  var o, a, t;
231
- (t = (a = (o = w.value) == null ? void 0 : o.apForm) == null ? void 0 : a.setFieldsValue) == null || t.call(a, e);
227
+ (t = (a = (o = F.value) == null ? void 0 : o.apForm) == null ? void 0 : a.setFieldsValue) == null || t.call(a, e);
232
228
  }
233
- return N({
234
- submit: () => x(),
235
- reset: () => F(),
236
- setSearchFormValues: K
237
- }), (e, o) => (i(), m("div", {
229
+ return z({
230
+ submit: () => R(),
231
+ reset: () => S(),
232
+ setSearchFormValues: M
233
+ }), (e, o) => (p(), c("div", {
238
234
  class: b(e.card ? null : n(g)("wrapper"))
239
- }, [e.searchForm !== !1 && S.value.length > 0 ? (i(), m("div", {
235
+ }, [e.searchForm !== !1 && C.value.length > 0 ? (p(), c("div", {
240
236
  key: 0,
241
- class: b(e.card ? n(C)("search-wrapper") : null),
237
+ class: b(e.card ? n(h)("search-wrapper") : null),
242
238
  style: T(e.searchFormWrapperStyle)
243
- }, [d(n(de).SearchForm, f(e.searchForm || {}, {
239
+ }, [d(n(te).SearchForm, m(e.searchForm || {}, {
244
240
  ref_key: "formRef",
245
- ref: w,
241
+ ref: F,
246
242
  "custom-reset": "",
247
- onSubmit: n(x),
248
- onReset: n(F),
249
- "submit-loading": n(p).loading
243
+ onSubmit: n(R),
244
+ onReset: n(S),
245
+ "submit-loading": n(i).loading
250
246
  }), {
251
- default: y(() => [(i(!0), m(X, null, B(S.value, (a) => (i(), Y(Z(a.customRenderFormItem ? a.customRenderFormItem(a) : n(ue)[a.valueType || "text"]), f({
247
+ default: f(() => [(p(!0), c(H, null, x(C.value, (a) => (p(), G(Q(a.customRenderFormItem ? a.customRenderFormItem(a) : n(ne)[a.valueType || "text"]), m({
252
248
  key: a.dataIndex,
253
249
  ref_for: !0
254
250
  }, a.fieldProps || {}, {
255
251
  span: a.span
256
252
  }), null, 16, ["span"]))), 128))]),
257
253
  _: 1
258
- }, 16, ["onSubmit", "onReset", "submit-loading"])], 6)) : I("", !0), v("div", {
259
- class: b(e.card ? n(C)("table-wrapper") : null),
254
+ }, 16, ["onSubmit", "onReset", "submit-loading"])], 6)) : B("", !0), P("div", {
255
+ class: b(e.card ? n(h)("table-wrapper") : null),
260
256
  style: T(e.tableWrapperStyle)
261
- }, [P(e.$slots, "title"), d(n(le), f({
262
- class: n(V) === "admin" ? n(g)("table-admin") : n(g)("table")
263
- }, M.value, {
264
- onChange: n(q),
265
- columns: h.value
266
- }), ee({
267
- headerCell: y(({
257
+ }, [I(e.$slots, "title"), d(n(ee), m({
258
+ class: n(L) === "admin" ? n(g)("table-admin") : n(g)("table")
259
+ }, W.value, {
260
+ onChange: n(V),
261
+ columns: y.value
262
+ }), U({
263
+ headerCell: f(({
268
264
  column: a,
269
265
  title: t
270
- }) => [a.tooltip ? (i(), m("span", he, [v("span", null, ae(t), 1), d(n(re), {
266
+ }) => [a.tooltip ? (p(), c("span", he, [P("span", null, J(t), 1), d(n(ae), {
271
267
  title: a.tooltip,
272
268
  placement: "bottom"
273
269
  }, {
274
- default: y(() => [d(n(ce), {
270
+ default: f(() => [d(n(se), {
275
271
  style: {
276
272
  color: "#0070ff",
277
273
  "padding-left": "4px"
278
274
  }
279
275
  })]),
280
276
  _: 2
281
- }, 1032, ["title"])])) : I("", !0)]),
277
+ }, 1032, ["title"])])) : B("", !0)]),
282
278
  _: 2
283
- }, [B(n(O)(e.$slots, "title"), (a, t) => ({
279
+ }, [x(n(de)(e.$slots, "title"), (a, t) => ({
284
280
  name: t,
285
- fn: y((r) => [P(e.$slots, t, te(oe(r || {})))])
281
+ fn: f((r) => [I(e.$slots, t, X(Y(r || {})))])
286
282
  }))]), 1040, ["class", "onChange", "columns"])], 6)], 2));
287
283
  }
288
284
  });
289
285
  export {
290
- Oe as default
286
+ ze as default
291
287
  };
@@ -1,3 +1,5 @@
1
+ import { ValueEnum } from '../interface';
2
+
1
3
  export type ApTablePaginationProps = {
2
4
  /** dataSource的总数量 */
3
5
  total?: number;
@@ -18,3 +20,13 @@ export type ApTableIndexProps = {
18
20
  */
19
21
  value?: any;
20
22
  };
23
+ export type ApTableStatusProps = {
24
+ /**
25
+ * 配置的值到配置的枚举值
26
+ */
27
+ valueEnum: ValueEnum;
28
+ /**
29
+ * 当前的值
30
+ */
31
+ value?: any;
32
+ };
@@ -0,0 +1,14 @@
1
+ import { ApTableStatusProps } from '../interface';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
3
+
4
+ declare const _default: DefineComponent<__VLS_TypePropsToRuntimeProps<ApTableStatusProps>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToRuntimeProps<ApTableStatusProps>>>, {}, {}>;
5
+ export default _default;
6
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
7
+ type __VLS_TypePropsToRuntimeProps<T> = {
8
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
9
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
10
+ } : {
11
+ type: PropType<T[K]>;
12
+ required: true;
13
+ };
14
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./index.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,17 @@
1
+ import { defineComponent as n, computed as o, openBlock as u, createBlock as a, unref as m, normalizeProps as p, mergeProps as l, createCommentVNode as c } from "vue";
2
+ import { Badge as s } from "ant-design-vue";
3
+ const v = /* @__PURE__ */ n({
4
+ name: "_ApTableStatus",
5
+ __name: "index",
6
+ props: {
7
+ valueEnum: {},
8
+ value: {}
9
+ },
10
+ setup(t) {
11
+ const e = t, r = o(() => e.valueEnum[e.value]);
12
+ return (_, d) => r.value ? (u(), a(m(s), p(l({ key: 0 }, r.value)), null, 16)) : c("", !0);
13
+ }
14
+ });
15
+ export {
16
+ v as default
17
+ };
@@ -1,4 +1,4 @@
1
- import { ApTableValueFields } from './interface';
1
+ import { ApTableValueFields, ValueEnum } from './interface';
2
2
  import { CreateComponentPublicInstance, ExtractPropTypes, PropType, HTMLAttributes, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase, DefineComponent, PublicProps, VNode, RendererNode, RendererElement, CSSProperties, ComputedRef } from 'vue';
3
3
  import { ColSize } from 'ant-design-vue/es/grid';
4
4
  import { ApFieldDateProps, ApFieldDateRangeProps, ApFieldNumberProps, ApFieldRadioProps, ApFieldSelectProps, ApFieldSwitchProps, ApFieldTextProps, ApFieldTextAreaProps, ApFieldCheckboxProps, FieldMode } from '../ap-field';
@@ -2482,9 +2482,6 @@ export declare const apTableFormItemMap: {
2482
2482
  addonAfter?: any;
2483
2483
  prefix?: any;
2484
2484
  default?: any;
2485
- /**
2486
- * 表格到查询表单的映射
2487
- */
2488
2485
  upIcon?: any;
2489
2486
  downIcon?: any;
2490
2487
  }> & {
@@ -2492,9 +2489,6 @@ export declare const apTableFormItemMap: {
2492
2489
  addonAfter?: any;
2493
2490
  prefix?: any;
2494
2491
  default?: any;
2495
- /**
2496
- * 表格到查询表单的映射
2497
- */
2498
2492
  upIcon?: any;
2499
2493
  downIcon?: any;
2500
2494
  };
@@ -5305,17 +5299,13 @@ export declare const apTableFormItemMap: {
5305
5299
  validateFirst: boolean;
5306
5300
  }, {}, string, {}> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
5307
5301
  $slots: Readonly<{
5308
- addonAfter: any; /**
5309
- * 表格到查询表单的映射
5310
- */
5302
+ addonAfter: any;
5311
5303
  addonBefore: any;
5312
5304
  prefix: any;
5313
5305
  suffix: any;
5314
5306
  clearIcon: any;
5315
5307
  }> & {
5316
- addonAfter: any; /**
5317
- * 表格到查询表单的映射
5318
- */
5308
+ addonAfter: any;
5319
5309
  addonBefore: any;
5320
5310
  prefix: any;
5321
5311
  suffix: any;
@@ -9820,9 +9810,6 @@ export declare const apTableRenderItemMap: {
9820
9810
  default: any;
9821
9811
  type: PropType<any>;
9822
9812
  };
9823
- /**
9824
- * 表格自定义渲染
9825
- */
9826
9813
  icon: {
9827
9814
  default: any;
9828
9815
  type: PropType<any>;
@@ -10193,9 +10180,6 @@ export declare const apTableRenderItemMap: {
10193
10180
  default: any;
10194
10181
  type: PropType<any>;
10195
10182
  };
10196
- /**
10197
- * 表格自定义渲染
10198
- */
10199
10183
  icon: {
10200
10184
  default: any;
10201
10185
  type: PropType<any>;
@@ -10577,9 +10561,6 @@ export declare const apTableRenderItemMap: {
10577
10561
  default: any;
10578
10562
  type: PropType<any>;
10579
10563
  };
10580
- /**
10581
- * 表格自定义渲染
10582
- */
10583
10564
  icon: {
10584
10565
  default: any;
10585
10566
  type: PropType<any>;
@@ -10958,9 +10939,6 @@ export declare const apTableRenderItemMap: {
10958
10939
  default: any;
10959
10940
  type: PropType<any>;
10960
10941
  };
10961
- /**
10962
- * 表格自定义渲染
10963
- */
10964
10942
  icon: {
10965
10943
  default: any;
10966
10944
  type: PropType<any>;
@@ -12333,6 +12311,23 @@ export declare const apTableRenderItemMap: {
12333
12311
  }>>, {
12334
12312
  bordered: boolean;
12335
12313
  }, {}>;
12314
+ status: DefineComponent<{
12315
+ valueEnum: {
12316
+ type: PropType<ValueEnum>;
12317
+ required: true;
12318
+ };
12319
+ value: {
12320
+ type: PropType<any>;
12321
+ };
12322
+ }, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
12323
+ valueEnum: {
12324
+ type: PropType<ValueEnum>;
12325
+ required: true;
12326
+ };
12327
+ value: {
12328
+ type: PropType<any>;
12329
+ };
12330
+ }>>, {}, {}>;
12336
12331
  };
12337
12332
  /**
12338
12333
  * 不需要渲染到Form表单的valueType字段
@@ -2,6 +2,7 @@ import "../ap-action/index.mjs";
2
2
  import "../ap-field/index.mjs";
3
3
  import "../ap-form/index.mjs";
4
4
  import "./components/index/index.vue.mjs";
5
+ import "./components/status/index.vue.mjs";
5
6
  import m from "../ap-form/items/date/index.vue.mjs";
6
7
  import o from "../ap-form/items/date-range/index.vue.mjs";
7
8
  import r from "../ap-form/items/number/index.vue.mjs";
@@ -11,18 +12,19 @@ import f from "../ap-form/items/switch/index.vue.mjs";
11
12
  import a from "../ap-form/items/text/index.vue.mjs";
12
13
  import _ from "../ap-form/items/text-area/index.vue.mjs";
13
14
  import c from "../ap-form/items/checkbox/index.vue.mjs";
14
- import e from "../ap-field/date/index.vue.mjs";
15
- import n from "../ap-field/date-range/index.vue.mjs";
16
- import p from "../ap-field/number/index.vue.mjs";
17
- import s from "../ap-field/radio/index.vue.mjs";
15
+ import n from "../ap-field/date/index.vue.mjs";
16
+ import e from "../ap-field/date-range/index.vue.mjs";
17
+ import s from "../ap-field/number/index.vue.mjs";
18
+ import p from "../ap-field/radio/index.vue.mjs";
18
19
  import $ from "../ap-field/select/index.vue.mjs";
19
20
  import d from "../ap-field/switch/index.vue.mjs";
20
21
  import x from "../ap-field/text/index.vue.mjs";
21
22
  import b from "../ap-field/text-area/index.vue.mjs";
22
23
  import h from "../ap-field/checkbox/index.vue.mjs";
23
24
  import l from "../ap-action/group/index.vue.mjs";
24
- import R from "./components/index/index.vue2.mjs";
25
- const N = {
25
+ import u from "./components/index/index.vue2.mjs";
26
+ import R from "./components/status/index.vue2.mjs";
27
+ const Q = {
26
28
  date: m,
27
29
  dateRange: o,
28
30
  number: r,
@@ -32,24 +34,25 @@ const N = {
32
34
  text: a,
33
35
  textArea: _,
34
36
  checkbox: c
35
- }, O = {
36
- date: e,
37
- dateRange: n,
38
- number: p,
39
- radio: s,
37
+ }, S = {
38
+ date: n,
39
+ dateRange: e,
40
+ number: s,
41
+ radio: p,
40
42
  select: $,
41
43
  switch: d,
42
44
  text: x,
43
45
  textArea: b,
44
46
  checkbox: h,
45
47
  action: l,
46
- index: R
47
- }, P = [
48
+ index: u,
49
+ status: R
50
+ }, U = [
48
51
  "action",
49
52
  "index"
50
53
  ];
51
54
  export {
52
- N as apTableFormItemMap,
53
- O as apTableRenderItemMap,
54
- P as noRenderAsFormItemValueList
55
+ Q as apTableFormItemMap,
56
+ S as apTableRenderItemMap,
57
+ U as noRenderAsFormItemValueList
55
58
  };
@@ -1,7 +1,7 @@
1
1
  import { ColumnType, TableProps } from 'ant-design-vue/es/table';
2
2
  import { CompareFn, SortOrder } from 'ant-design-vue/es/table/interface';
3
3
  import { ApFormSearchFormProps } from '../ap-form';
4
- import { ApFormItemCheckboxProps, ApFormItemDateProps, ApFormItemDateRangeProps, ApFormItemNumberProps, ApFormItemRadioProps, ApFormItemSelectProps, ApFormItemSwitchProps, ApFormItemTextAreaProps, ApFormItemTextProps } from 'src/ap-form/items/interface';
4
+ import { ApFormItemCheckboxProps, ApFormItemDateProps, ApFormItemDateRangeProps, ApFormItemNumberProps, ApFormItemRadioProps, ApFormItemSelectProps, ApFormItemSwitchProps, ApFormItemTextAreaProps, ApFormItemTextProps } from '../ap-form/items/interface';
5
5
  import { Recordable } from '../type';
6
6
  import { CSSProperties } from 'vue';
7
7
  import { ApActionGroupProps } from '../ap-action';
@@ -9,7 +9,13 @@ import { ApTableIndexProps } from './components/interface';
9
9
 
10
10
  export type ValueEnumType = {
11
11
  text: string;
12
- status?: string;
12
+ /**
13
+ * 当前枚举值与定义的状态,等同于Badge的status
14
+ */
15
+ status?: 'success' | 'error' | 'processing' | 'warning' | 'default';
16
+ /**
17
+ * 如果status预定义的颜色无法满足需求,你可以自定义徽标的颜色,注意`color`比`status`的优先级更高
18
+ */
13
19
  color?: string;
14
20
  disabled?: boolean;
15
21
  };
@@ -45,7 +51,7 @@ export type ApTableValueFields = {
45
51
  index: ApTableIndexProps;
46
52
  };
47
53
  export type ValueEnum = Record<string, ValueEnumType>;
48
- export type ExtraProColumnType<T> = Omit<ColumnType<T>, 'children'> & {
54
+ export type ExtraProColumnType<T> = Omit<ColumnType<T>, 'children' | 'filters'> & {
49
55
  sorter?: string | boolean | CompareFn<T> | {
50
56
  compare?: CompareFn<T>;
51
57
  /** Config multiple sorter order priority */
@@ -102,6 +108,10 @@ export type ApColumnType<ValueType extends keyof ApTableValueFields = 'text', Re
102
108
  * @description 值越大,越排在前面,请设置正整数,设置为0或负数将会无效
103
109
  */
104
110
  order?: number;
111
+ /**
112
+ * 表头的菜单筛选项,设置为true后会尝试使用valueEnum生成filters
113
+ */
114
+ filters?: ColumnType<RecordType>['filters'] | true;
105
115
  };
106
116
  export type RequestData<T> = {
107
117
  data: T[] | undefined;
@@ -190,3 +200,6 @@ export type ApTableExpose = {
190
200
  submit: () => void;
191
201
  reset: () => void;
192
202
  };
203
+ export type FixedApColumnType<ValueType extends keyof ApTableValueFields = 'text', RecordType = any> = Omit<ApColumnType<ValueType, RecordType>, 'filters'> & {
204
+ filters?: ColumnType<RecordType>['filters'];
205
+ };