@king-one/antdv 1.0.76 → 1.0.78

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 (84) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/es/components/index.mjs +8 -6
  3. package/dist/es/components/pro-table/hooks/use-pro-table.mjs +11 -0
  4. package/dist/es/components/pro-table/index.mjs +12 -0
  5. package/dist/es/components/pro-table/src/constants.mjs +23 -0
  6. package/dist/es/components/pro-table/src/field/field-date-range/field-date-range.vue.mjs +4 -0
  7. package/dist/es/components/pro-table/src/field/field-date-range/field-date-range.vue2.mjs +28 -0
  8. package/dist/es/components/pro-table/src/field/field-input/field-input.vue.mjs +4 -0
  9. package/dist/es/components/pro-table/src/field/field-input/field-input.vue2.mjs +28 -0
  10. package/dist/es/components/pro-table/src/field/field-radio/field-radio.vue.mjs +4 -0
  11. package/dist/es/components/pro-table/src/field/field-radio/field-radio.vue2.mjs +54 -0
  12. package/dist/es/components/pro-table/src/field/field-select/field-select.vue.mjs +4 -0
  13. package/dist/es/components/pro-table/src/field/field-select/field-select.vue2.mjs +54 -0
  14. package/dist/es/components/pro-table/src/field/field.css +1 -0
  15. package/dist/es/components/pro-table/src/field/field.vue.mjs +5 -0
  16. package/dist/es/components/pro-table/src/field/field.vue2.mjs +118 -0
  17. package/dist/es/components/pro-table/src/form-render.css +1 -0
  18. package/dist/es/components/pro-table/src/form-render.vue.mjs +5 -0
  19. package/dist/es/components/pro-table/src/form-render.vue2.mjs +147 -0
  20. package/dist/es/components/pro-table/src/hooks/use-form.mjs +22 -0
  21. package/dist/es/components/pro-table/src/hooks/use-table.mjs +39 -0
  22. package/dist/es/components/pro-table/src/pro-table.css +1 -0
  23. package/dist/es/components/pro-table/src/pro-table.vue.mjs +5 -0
  24. package/dist/es/components/pro-table/src/pro-table.vue2.mjs +192 -0
  25. package/dist/es/components/pro-table/src/types.mjs +1 -0
  26. package/dist/es/components/pro-table/style/index.mjs +2 -0
  27. package/dist/es/components/pro-table/utils.mjs +15 -0
  28. package/dist/es/components/scale-virtual-list/hooks/useVirtualList.mjs +39 -40
  29. package/dist/es/components/scroll-bar/src/scroll-bar.mjs +140 -130
  30. package/dist/es/components/scroll-bar/src/types.mjs +6 -3
  31. package/dist/es/index.mjs +14 -10
  32. package/dist/lib/components/index.js +1 -1
  33. package/dist/lib/components/pro-table/hooks/use-pro-table.js +1 -0
  34. package/dist/lib/components/pro-table/index.js +1 -0
  35. package/dist/lib/components/pro-table/src/constants.js +1 -0
  36. package/dist/lib/components/pro-table/src/field/field-date-range/field-date-range.vue.js +1 -0
  37. package/dist/lib/components/pro-table/src/field/field-date-range/field-date-range.vue2.js +1 -0
  38. package/dist/lib/components/pro-table/src/field/field-input/field-input.vue.js +1 -0
  39. package/dist/lib/components/pro-table/src/field/field-input/field-input.vue2.js +1 -0
  40. package/dist/lib/components/pro-table/src/field/field-radio/field-radio.vue.js +1 -0
  41. package/dist/lib/components/pro-table/src/field/field-radio/field-radio.vue2.js +1 -0
  42. package/dist/lib/components/pro-table/src/field/field-select/field-select.vue.js +1 -0
  43. package/dist/lib/components/pro-table/src/field/field-select/field-select.vue2.js +1 -0
  44. package/dist/lib/components/pro-table/src/field/field.css +1 -0
  45. package/dist/lib/components/pro-table/src/field/field.vue.js +1 -0
  46. package/dist/lib/components/pro-table/src/field/field.vue2.js +1 -0
  47. package/dist/lib/components/pro-table/src/form-render.css +1 -0
  48. package/dist/lib/components/pro-table/src/form-render.vue.js +1 -0
  49. package/dist/lib/components/pro-table/src/form-render.vue2.js +1 -0
  50. package/dist/lib/components/pro-table/src/hooks/use-form.js +1 -0
  51. package/dist/lib/components/pro-table/src/hooks/use-table.js +1 -0
  52. package/dist/lib/components/pro-table/src/pro-table.css +1 -0
  53. package/dist/lib/components/pro-table/src/pro-table.vue.js +1 -0
  54. package/dist/lib/components/pro-table/src/pro-table.vue2.js +1 -0
  55. package/dist/lib/components/pro-table/src/types.js +1 -0
  56. package/dist/lib/components/pro-table/style/index.js +1 -0
  57. package/dist/lib/components/pro-table/utils.js +1 -0
  58. package/dist/lib/components/scale-virtual-list/hooks/useVirtualList.js +1 -1
  59. package/dist/lib/components/scroll-bar/src/scroll-bar.js +1 -1
  60. package/dist/lib/components/scroll-bar/src/types.js +1 -1
  61. package/dist/lib/index.js +1 -1
  62. package/dist/theme-chalk/icon.css +1 -1
  63. package/dist/theme-chalk/index.css +1 -1
  64. package/dist/theme-chalk/pro-table.css +1 -0
  65. package/dist/types/components/index.d.ts +1 -0
  66. package/dist/types/components/pro-table/hooks/use-pro-table.d.ts +6 -0
  67. package/dist/types/components/pro-table/index.d.ts +7 -0
  68. package/dist/types/components/pro-table/src/constants.d.ts +5 -0
  69. package/dist/types/components/pro-table/src/field/field-date-range/field-date-range.vue.d.ts +10 -0
  70. package/dist/types/components/pro-table/src/field/field-input/field-input.vue.d.ts +10 -0
  71. package/dist/types/components/pro-table/src/field/field-radio/field-radio.vue.d.ts +10 -0
  72. package/dist/types/components/pro-table/src/field/field-select/field-select.vue.d.ts +10 -0
  73. package/dist/types/components/pro-table/src/field/field.vue.d.ts +7 -0
  74. package/dist/types/components/pro-table/src/form-render.vue.d.ts +8 -0
  75. package/dist/types/components/pro-table/src/hooks/use-form.d.ts +6 -0
  76. package/dist/types/components/pro-table/src/hooks/use-table.d.ts +17 -0
  77. package/dist/types/components/pro-table/src/pro-table.vue.d.ts +62 -0
  78. package/dist/types/components/pro-table/src/types.d.ts +158 -0
  79. package/dist/types/components/pro-table/utils.d.ts +9 -0
  80. package/dist/types/components/scroll-bar/index.d.ts +10 -2
  81. package/dist/types/components/scroll-bar/src/scroll-bar.d.ts +10 -2
  82. package/dist/types/components/scroll-bar/src/types.d.ts +4 -1
  83. package/global.d.ts +1 -0
  84. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @king-one/antdv
2
2
 
3
+ ## 1.0.78
4
+
5
+ ### Patch Changes
6
+
7
+ - feat:KScrollBar 组件,横向滚动条时,增加 wheel 事件,通过滚轮控制滚动
8
+
9
+ ## 1.0.77
10
+
11
+ ### Patch Changes
12
+
13
+ - 优化 scrollTop 逻辑
14
+
3
15
  ## 1.0.76
4
16
 
5
17
  ### Patch Changes
@@ -4,21 +4,23 @@ import { KProModal as f } from "./pro-modal/index.mjs";
4
4
  import { KProTitle as a } from "./pro-title/index.mjs";
5
5
  import { KScrollBar as P } from "./scroll-bar/index.mjs";
6
6
  import { KScaleVirtualList as c } from "./scale-virtual-list/index.mjs";
7
- import { KProTag as s } from "./pro-tag/index.mjs";
8
- import { KProPicker as T } from "./pro-picker/index.mjs";
7
+ import { KProTag as T } from "./pro-tag/index.mjs";
8
+ import { KProPicker as S } from "./pro-picker/index.mjs";
9
9
  import { KProArea as u } from "./pro-area/index.mjs";
10
10
  import { KProSignature as I } from "./pro-signature/index.mjs";
11
- import { KIcon as k } from "./icon/index.mjs";
11
+ import { KProTable as d } from "./pro-table/index.mjs";
12
+ import { KIcon as A } from "./icon/index.mjs";
12
13
  export {
13
14
  p as KCollapseTranstion,
14
15
  e as KForm,
15
16
  t as KFormItem,
16
- k as KIcon,
17
+ A as KIcon,
17
18
  u as KProArea,
18
19
  f as KProModal,
19
- T as KProPicker,
20
+ S as KProPicker,
20
21
  I as KProSignature,
21
- s as KProTag,
22
+ d as KProTable,
23
+ T as KProTag,
22
24
  a as KProTitle,
23
25
  c as KScaleVirtualList,
24
26
  P as KScrollBar
@@ -0,0 +1,11 @@
1
+ import { ref as r } from "vue";
2
+ function s() {
3
+ const e = r();
4
+ return { proTableRef: e, onRefresh: () => {
5
+ var o;
6
+ (o = e.value) == null || o.onRefresh();
7
+ } };
8
+ }
9
+ export {
10
+ s as useProTable
11
+ };
@@ -0,0 +1,12 @@
1
+ import { withInstall as o } from "../utils/install.mjs";
2
+ import "./src/pro-table.vue.mjs";
3
+ import "./style/index.mjs";
4
+ import "./src/types.mjs";
5
+ import { useProTable as s } from "./hooks/use-pro-table.mjs";
6
+ import r from "./src/pro-table.vue2.mjs";
7
+ const e = o(r);
8
+ export {
9
+ e as KProTable,
10
+ e as default,
11
+ s as useProTable
12
+ };
@@ -0,0 +1,23 @@
1
+ const e = Symbol(
2
+ "PRO_TABLE_CONTEXT_PROVIDE_KEY"
3
+ ), o = Symbol(
4
+ "PRO_FIELD_CONTEXT_PROVIDE_KEY"
5
+ ), E = [
6
+ "bodyCell",
7
+ "customFilterDropdown",
8
+ "customFilterIcon",
9
+ "default",
10
+ "emptyText",
11
+ "expandColumnTitle",
12
+ "expandIcon",
13
+ "expandedRowRender",
14
+ "footer",
15
+ "headerCell",
16
+ "summary",
17
+ "title"
18
+ ];
19
+ export {
20
+ E as ANTD_SLOT_NAMES,
21
+ o as FIELD_CONTEXT_PROVIDE_KEY,
22
+ e as TABLE_CONTEXT_PROVIDE_KEY
23
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./field-date-range.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,28 @@
1
+ import { defineComponent as d, useModel as i, inject as u, toRefs as m, resolveComponent as s, createElementBlock as c, openBlock as p, createCommentVNode as f, createVNode as _, mergeProps as v, unref as V } from "vue";
2
+ import { FIELD_CONTEXT_PROVIDE_KEY as g } from "../../constants.mjs";
3
+ const C = { class: "field-date-range" }, R = /* @__PURE__ */ d({
4
+ __name: "field-date-range",
5
+ props: {
6
+ modelValue: {
7
+ required: !0
8
+ },
9
+ modelModifiers: {}
10
+ },
11
+ emits: ["update:modelValue"],
12
+ setup(t) {
13
+ const e = i(t, "modelValue"), n = u(g), { column: r } = m(n);
14
+ return (E, o) => {
15
+ const l = s("ARangePicker");
16
+ return p(), c("div", C, [
17
+ f(" prettier-ignore-attribute v-bind "),
18
+ _(l, v({
19
+ value: e.value,
20
+ "onUpdate:value": o[0] || (o[0] = (a) => e.value = a)
21
+ }, V(r).fieldProps), null, 16, ["value"])
22
+ ]);
23
+ };
24
+ }
25
+ });
26
+ export {
27
+ R as default
28
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./field-input.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,28 @@
1
+ import { defineComponent as d, useModel as i, inject as m, resolveComponent as a, createElementBlock as p, openBlock as s, createCommentVNode as c, createVNode as f, mergeProps as _, unref as v } from "vue";
2
+ import { FIELD_CONTEXT_PROVIDE_KEY as V } from "../../constants.mjs";
3
+ const C = { class: "field-input" }, N = /* @__PURE__ */ d({
4
+ __name: "field-input",
5
+ props: {
6
+ modelValue: {
7
+ required: !0
8
+ },
9
+ modelModifiers: {}
10
+ },
11
+ emits: ["update:modelValue"],
12
+ setup(t) {
13
+ const e = i(t, "modelValue"), n = m(V), { column: l } = n;
14
+ return (E, o) => {
15
+ const r = a("AInput");
16
+ return s(), p("div", C, [
17
+ c(" prettier-ignore-attribute v-bind "),
18
+ f(r, _({
19
+ value: e.value,
20
+ "onUpdate:value": o[0] || (o[0] = (u) => e.value = u)
21
+ }, v(l).fieldProps), null, 16, ["value"])
22
+ ]);
23
+ };
24
+ }
25
+ });
26
+ export {
27
+ N as default
28
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./field-radio.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,54 @@
1
+ import { defineComponent as f, useModel as _, inject as v, toRefs as V, resolveComponent as a, createElementBlock as r, openBlock as o, createCommentVNode as b, createVNode as C, mergeProps as R, unref as d, withCtx as n, Fragment as x, renderList as E, createBlock as g, createTextVNode as k, toDisplayString as A } from "vue";
2
+ import { FIELD_CONTEXT_PROVIDE_KEY as N } from "../../constants.mjs";
3
+ const B = { class: "field-select" }, T = /* @__PURE__ */ f({
4
+ __name: "field-radio",
5
+ props: {
6
+ modelValue: {
7
+ required: !0
8
+ },
9
+ modelModifiers: {}
10
+ },
11
+ emits: ["update:modelValue"],
12
+ setup(i) {
13
+ const t = _(i, "modelValue"), u = v(N), { fieldOptions: s, column: m } = V(u);
14
+ return (D, l) => {
15
+ const c = a("ARadio"), p = a("ARadioGroup");
16
+ return o(), r("div", B, [
17
+ b(" prettier-ignore-attribute v-bind "),
18
+ C(p, R({
19
+ value: t.value,
20
+ "onUpdate:value": l[0] || (l[0] = (e) => t.value = e)
21
+ }, d(m).fieldProps), {
22
+ default: n(() => [
23
+ (o(!0), r(
24
+ x,
25
+ null,
26
+ E(d(s), (e) => (o(), g(c, {
27
+ key: e.value,
28
+ value: e.value,
29
+ disabled: e.disabled
30
+ }, {
31
+ default: n(() => [
32
+ k(
33
+ A(e.label),
34
+ 1
35
+ /* TEXT */
36
+ )
37
+ ]),
38
+ _: 2
39
+ /* DYNAMIC */
40
+ }, 1032, ["value", "disabled"]))),
41
+ 128
42
+ /* KEYED_FRAGMENT */
43
+ ))
44
+ ]),
45
+ _: 1
46
+ /* STABLE */
47
+ }, 16, ["value"])
48
+ ]);
49
+ };
50
+ }
51
+ });
52
+ export {
53
+ T as default
54
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./field-select.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,54 @@
1
+ import { defineComponent as f, useModel as _, inject as v, toRefs as V, resolveComponent as n, createElementBlock as r, openBlock as t, createCommentVNode as b, createVNode as C, mergeProps as x, unref as a, withCtx as d, Fragment as E, renderList as O, createBlock as S, createTextVNode as g, toDisplayString as k } from "vue";
2
+ import { FIELD_CONTEXT_PROVIDE_KEY as A } from "../../constants.mjs";
3
+ const N = { class: "field-select" }, T = /* @__PURE__ */ f({
4
+ __name: "field-select",
5
+ props: {
6
+ modelValue: {
7
+ required: !0
8
+ },
9
+ modelModifiers: {}
10
+ },
11
+ emits: ["update:modelValue"],
12
+ setup(i) {
13
+ const l = _(i, "modelValue"), s = v(A), { fieldOptions: u, column: c } = V(s);
14
+ return (B, o) => {
15
+ const m = n("ASelectOption"), p = n("ASelect");
16
+ return t(), r("div", N, [
17
+ b(" prettier-ignore-attribute v-bind "),
18
+ C(p, x({
19
+ value: l.value,
20
+ "onUpdate:value": o[0] || (o[0] = (e) => l.value = e)
21
+ }, a(c).fieldProps), {
22
+ default: d(() => [
23
+ (t(!0), r(
24
+ E,
25
+ null,
26
+ O(a(u), (e) => (t(), S(m, {
27
+ key: e.value,
28
+ value: e.value,
29
+ disabled: e.disabled
30
+ }, {
31
+ default: d(() => [
32
+ g(
33
+ k(e.label),
34
+ 1
35
+ /* TEXT */
36
+ )
37
+ ]),
38
+ _: 2
39
+ /* DYNAMIC */
40
+ }, 1032, ["value", "disabled"]))),
41
+ 128
42
+ /* KEYED_FRAGMENT */
43
+ ))
44
+ ]),
45
+ _: 1
46
+ /* STABLE */
47
+ }, 16, ["value"])
48
+ ]);
49
+ };
50
+ }
51
+ });
52
+ export {
53
+ T as default
54
+ };
@@ -0,0 +1 @@
1
+ .field .ant-picker{width:100%}
@@ -0,0 +1,5 @@
1
+ import o from "./field.vue2.mjs";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };
@@ -0,0 +1,118 @@
1
+ import { defineComponent as C, inject as I, toRefs as N, computed as v, reactive as E, ref as P, watchEffect as S, readonly as w, provide as B, resolveComponent as D, createElementBlock as y, openBlock as n, Fragment as F, createCommentVNode as r, createElementVNode as U, createBlock as m, resolveDynamicComponent as $, unref as q, normalizeProps as k, mergeProps as x } from "vue";
2
+ import { TABLE_CONTEXT_PROVIDE_KEY as A, FIELD_CONTEXT_PROVIDE_KEY as K } from "../constants.mjs";
3
+ import { getAvailableVNode as j, handleFn as L } from "../../utils.mjs";
4
+ import "./field-input/field-input.vue.mjs";
5
+ import "./field-select/field-select.vue.mjs";
6
+ import "./field-radio/field-radio.vue.mjs";
7
+ import "./field-date-range/field-date-range.vue.mjs";
8
+ import M from "./field-input/field-input.vue2.mjs";
9
+ import X from "./field-select/field-select.vue2.mjs";
10
+ import Y from "./field-radio/field-radio.vue2.mjs";
11
+ import h from "./field-date-range/field-date-range.vue2.mjs";
12
+ const z = { class: "field" }, ne = /* @__PURE__ */ C({
13
+ __name: "field",
14
+ props: {
15
+ column: {}
16
+ },
17
+ setup(e) {
18
+ const p = I(A), { tableSlots: c } = p, { formState: s } = N(p), V = e.column.dataIndex, o = v({
19
+ get() {
20
+ return s.value[V];
21
+ },
22
+ set(t) {
23
+ s.value[V] = t;
24
+ }
25
+ }), f = E({
26
+ column: e.column,
27
+ value: o.value,
28
+ formState: s
29
+ }), b = v(() => c.formField ? !!j(c.formField(f)).length : !1), i = v(
30
+ () => e.column.valueType || (e.column.valueEnum ? "select" : "text")
31
+ ), d = P([]);
32
+ function O() {
33
+ e.column.request ? T() : R();
34
+ }
35
+ O(), S(() => {
36
+ e.column._fieldOptions = w(d.value);
37
+ });
38
+ function R() {
39
+ if (e.column.valueEnum) {
40
+ const t = new Map(Object.entries(e.column.valueEnum));
41
+ d.value = Array.from(t).map(([l, a]) => ({
42
+ text: a.text,
43
+ value: l,
44
+ label: a.text,
45
+ disabled: a.disabled
46
+ }));
47
+ }
48
+ }
49
+ async function T() {
50
+ const t = await L(e.column.request, {});
51
+ t && (d.value = t);
52
+ }
53
+ const g = E({
54
+ fieldOptions: d,
55
+ column: e.column
56
+ });
57
+ return B(
58
+ K,
59
+ g
60
+ ), (t, l) => {
61
+ const a = D("column.customFormFieldRender");
62
+ return n(), y(
63
+ F,
64
+ null,
65
+ [
66
+ r(" eslint-disable vue/component-name-in-template-casing "),
67
+ U("div", z, [
68
+ b.value ? (n(), m(
69
+ $(q(c).formField),
70
+ k(x({ key: 0 }, f)),
71
+ null,
72
+ 16
73
+ /* FULL_PROPS */
74
+ )) : t.column.customFormFieldRender ? (n(), m(
75
+ a,
76
+ k(x({ key: 1 }, f)),
77
+ null,
78
+ 16
79
+ /* FULL_PROPS */
80
+ )) : (n(), y(
81
+ F,
82
+ { key: 2 },
83
+ [
84
+ i.value === "text" ? (n(), m(M, {
85
+ key: 0,
86
+ modelValue: o.value,
87
+ "onUpdate:modelValue": l[0] || (l[0] = (u) => o.value = u)
88
+ }, null, 8, ["modelValue"])) : r("v-if", !0),
89
+ i.value === "select" ? (n(), m(X, {
90
+ key: 1,
91
+ modelValue: o.value,
92
+ "onUpdate:modelValue": l[1] || (l[1] = (u) => o.value = u)
93
+ }, null, 8, ["modelValue"])) : r("v-if", !0),
94
+ i.value === "radio" ? (n(), m(Y, {
95
+ key: 2,
96
+ modelValue: o.value,
97
+ "onUpdate:modelValue": l[2] || (l[2] = (u) => o.value = u)
98
+ }, null, 8, ["modelValue"])) : r("v-if", !0),
99
+ i.value === "dateRange" ? (n(), m(h, {
100
+ key: 3,
101
+ modelValue: o.value,
102
+ "onUpdate:modelValue": l[3] || (l[3] = (u) => o.value = u)
103
+ }, null, 8, ["modelValue"])) : r("v-if", !0)
104
+ ],
105
+ 64
106
+ /* STABLE_FRAGMENT */
107
+ ))
108
+ ])
109
+ ],
110
+ 2112
111
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
112
+ );
113
+ };
114
+ }
115
+ });
116
+ export {
117
+ ne as default
118
+ };
@@ -0,0 +1 @@
1
+ .pro-table .pro-table-form .ant-form .ant-form-item{margin-bottom:0}
@@ -0,0 +1,5 @@
1
+ import o from "./form-render.vue2.mjs";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };
@@ -0,0 +1,147 @@
1
+ import { defineComponent as q, inject as z, toRefs as K, ref as X, computed as i, resolveComponent as a, createElementBlock as c, openBlock as m, createVNode as t, mergeProps as d, unref as u, withCtx as o, createCommentVNode as p, Fragment as b, renderList as Y, createBlock as $, normalizeProps as G, guardReactiveProps as H, createTextVNode as I } from "vue";
2
+ import "./field/field.vue.mjs";
3
+ import { TABLE_CONTEXT_PROVIDE_KEY as J } from "./constants.mjs";
4
+ import M from "./field/field.vue2.mjs";
5
+ const Q = { class: "pro-table-form" }, oe = /* @__PURE__ */ q({
6
+ __name: "form-render",
7
+ setup(U, { expose: R }) {
8
+ const _ = z(J), { columns: v, pageData: h, handleRequest: B } = _, { loading: N, antdFormProps: S, formColNum: f, formState: T, buttonCol: w } = K(_), r = X();
9
+ function A(e) {
10
+ return e.valueType !== "option" && !e.hideInForm;
11
+ }
12
+ const E = (e) => e.dataIndex;
13
+ function C() {
14
+ h.pageNum = 1, B();
15
+ }
16
+ function O() {
17
+ r.value && r.value.validate().then(() => {
18
+ C();
19
+ }).catch(console.error);
20
+ }
21
+ function V() {
22
+ r.value && (r.value.resetFields(), C());
23
+ }
24
+ const s = i(() => (f == null ? void 0 : f.value) || 0), g = i(() => 24 / s.value), D = i(() => {
25
+ const e = v.filter(A).length;
26
+ return (s.value - 1 - e % s.value) * g.value;
27
+ });
28
+ function k(e, l = !1) {
29
+ return e = {
30
+ span: g.value,
31
+ // 4 列
32
+ ...e || {}
33
+ }, l && e.offset == null && (e.offset = D.value), e;
34
+ }
35
+ return R({
36
+ formRef: r
37
+ }), (e, l) => {
38
+ const y = a("AFormItem"), F = a("ACol"), x = a("AButton"), L = a("ASpace"), P = a("ARow"), j = a("AForm");
39
+ return m(), c("div", Q, [
40
+ t(j, d({
41
+ ref_key: "formRef",
42
+ ref: r,
43
+ autocomplete: "off",
44
+ "label-col": { span: 5 }
45
+ }, u(S), { model: u(T) }), {
46
+ default: o(() => [
47
+ t(P, { gutter: [0, 24] }, {
48
+ default: o(() => [
49
+ p(" TODO 处理 key 的问题, 有的项没有 key, 有的项没有 dataIndex "),
50
+ (m(!0), c(
51
+ b,
52
+ null,
53
+ Y(u(v), (n) => (m(), c(
54
+ b,
55
+ null,
56
+ [
57
+ A(n) ? (m(), $(
58
+ F,
59
+ d({
60
+ key: n.key,
61
+ ref_for: !0
62
+ }, k(n.fieldCol)),
63
+ {
64
+ default: o(() => [
65
+ t(y, d({
66
+ label: n.title,
67
+ name: E(n),
68
+ ref_for: !0
69
+ }, n.formItemProps), {
70
+ default: o(() => [
71
+ t(M, { column: n }, null, 8, ["column"])
72
+ ]),
73
+ _: 2
74
+ /* DYNAMIC */
75
+ }, 1040, ["label", "name"])
76
+ ]),
77
+ _: 2
78
+ /* DYNAMIC */
79
+ },
80
+ 1040
81
+ /* FULL_PROPS, DYNAMIC_SLOTS */
82
+ )) : p("v-if", !0)
83
+ ],
84
+ 64
85
+ /* STABLE_FRAGMENT */
86
+ ))),
87
+ 256
88
+ /* UNKEYED_FRAGMENT */
89
+ )),
90
+ p(" 重置查询按钮 "),
91
+ t(
92
+ F,
93
+ G(H(k(u(w), !0))),
94
+ {
95
+ default: o(() => [
96
+ t(y, { "wrapper-col": { style: { textAlign: "right" } } }, {
97
+ default: o(() => [
98
+ t(L, null, {
99
+ default: o(() => [
100
+ t(x, { onClick: V }, {
101
+ default: o(() => l[0] || (l[0] = [
102
+ I(" 重置 ")
103
+ ])),
104
+ _: 1
105
+ /* STABLE */
106
+ }),
107
+ t(x, {
108
+ type: "primary",
109
+ loading: u(N),
110
+ onClick: O
111
+ }, {
112
+ default: o(() => l[1] || (l[1] = [
113
+ I(" 查询 ")
114
+ ])),
115
+ _: 1
116
+ /* STABLE */
117
+ }, 8, ["loading"])
118
+ ]),
119
+ _: 1
120
+ /* STABLE */
121
+ })
122
+ ]),
123
+ _: 1
124
+ /* STABLE */
125
+ })
126
+ ]),
127
+ _: 1
128
+ /* STABLE */
129
+ },
130
+ 16
131
+ /* FULL_PROPS */
132
+ )
133
+ ]),
134
+ _: 1
135
+ /* STABLE */
136
+ })
137
+ ]),
138
+ _: 1
139
+ /* STABLE */
140
+ }, 16, ["model"])
141
+ ]);
142
+ };
143
+ }
144
+ });
145
+ export {
146
+ oe as default
147
+ };
@@ -0,0 +1,22 @@
1
+ import { ref as o } from "vue";
2
+ function m(n) {
3
+ const { columns: r } = n, a = o({}), u = ["dateRange"];
4
+ return {
5
+ formState: a,
6
+ genFormState: () => {
7
+ a.value = r.reduce(
8
+ (t, e) => {
9
+ if (e.dataIndex && !e.hideInForm) {
10
+ const d = e.valueType && u.includes(e.valueType) ? [] : "";
11
+ t[e.dataIndex] = a.value[e.dataIndex] || e.initialValue || d;
12
+ }
13
+ return t;
14
+ },
15
+ {}
16
+ );
17
+ }
18
+ };
19
+ }
20
+ export {
21
+ m as useForm
22
+ };
@@ -0,0 +1,39 @@
1
+ import { computed as C, readonly as h, unref as q, onMounted as x } from "vue";
2
+ import { handleFn as N, getAvailableVNode as O } from "../../utils.mjs";
3
+ function B(d, n, { loading: o, pageData: t, formState: i, dataSource: f }) {
4
+ const { columns: c, request: m, requestImmediately: p } = d, y = C(
5
+ () => c.filter(({ hideInTable: e }) => !e)
6
+ ), u = async () => {
7
+ o.value = !0;
8
+ const e = await N(
9
+ m,
10
+ h({
11
+ pageSize: t.pageSize,
12
+ pageNum: t.pageNum,
13
+ ...q(i)
14
+ })
15
+ );
16
+ e && e.success && (t.total = e.total || 0, f.value = e.data), o.value = !1;
17
+ };
18
+ x(() => {
19
+ p && u();
20
+ });
21
+ const s = (e, l) => {
22
+ var r;
23
+ if (l.valueType === "select" || l.valueEnum)
24
+ return (r = (l._fieldOptions || []).find((v) => v.value === e)) == null ? void 0 : r.label;
25
+ }, b = (e) => n.bodyCell ? !!O(n.bodyCell(a(e))).length : !1, a = (e) => ({
26
+ ...e,
27
+ labelText: s(e.text, e.column)
28
+ });
29
+ return {
30
+ filteredColumns: y,
31
+ handleRequest: u,
32
+ getLabelByValue: s,
33
+ hasCurrentColBodySlot: b,
34
+ bodyCellProps: a
35
+ };
36
+ }
37
+ export {
38
+ B as useTable
39
+ };
@@ -0,0 +1 @@
1
+ .pro-table .ant-card .ant-card-head .ant-card-head-wrapper .ant-card-extra{margin-inline-start:unset}.pro-table .ant-table .ant-table-thead tr th{@apply bg-[#F7F8FA];}.pro-table .ant-table .ant-table-thead tr th:before{@apply hidden;}.pro-table .ant-table .ant-table-tbody tr td{background-color:transparent!important}
@@ -0,0 +1,5 @@
1
+ import o from "./pro-table.vue2.mjs";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };