@aplus-frontend/ui 0.0.30 → 0.0.31
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.
- package/es/src/ap-field/date-range/index.vue.mjs +15 -15
- package/es/src/ap-form/ap-form-item.vue.mjs +11 -10
- package/es/src/ap-form/interface.d.ts +4 -0
- package/es/src/ap-form/items/checkbox/index.vue.mjs +11 -10
- package/es/src/ap-form/items/date/index.vue.mjs +6 -5
- package/es/src/ap-form/items/date-range/index.vue.mjs +7 -6
- package/es/src/ap-form/items/number/index.vue.mjs +7 -6
- package/es/src/ap-form/items/radio/index.vue.mjs +4 -3
- package/es/src/ap-form/items/select/index.vue.mjs +8 -7
- package/es/src/ap-form/items/switch/index.vue.mjs +7 -6
- package/es/src/ap-form/items/text/index.vue2.mjs +6 -5
- package/es/src/ap-form/items/text/password.vue.mjs +4 -3
- package/es/src/ap-form/items/text-area/index.vue.mjs +7 -6
- package/es/src/ap-form/search-form/index.vue.mjs +82 -79
- package/es/src/ap-form/search-form/utils.d.ts +5 -0
- package/es/src/ap-form/search-form/utils.mjs +35 -0
- package/es/src/ap-table/ap-table.vue.mjs +84 -81
- package/es/src/ap-table/constants.d.ts +132 -0
- package/es/src/editable-table/hooks/use-get-columns.mjs +26 -25
- package/es/src/editable-table/style/index.css +7 -1
- package/es/src/editable-table/utils.d.ts +1 -0
- package/es/src/editable-table/utils.mjs +31 -22
- package/es/src/theme/editable-table/index.css +7 -1
- package/es/src/transition/create-transition.mjs +34 -34
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-form/ap-form-item.vue.js +1 -1
- package/lib/src/ap-form/interface.d.ts +4 -0
- package/lib/src/ap-form/items/checkbox/index.vue.js +1 -1
- package/lib/src/ap-form/items/date/index.vue.js +1 -1
- package/lib/src/ap-form/items/date-range/index.vue.js +1 -1
- package/lib/src/ap-form/items/number/index.vue.js +1 -1
- package/lib/src/ap-form/items/radio/index.vue.js +1 -1
- package/lib/src/ap-form/items/select/index.vue.js +1 -1
- package/lib/src/ap-form/items/switch/index.vue.js +1 -1
- package/lib/src/ap-form/items/text/index.vue2.js +1 -1
- package/lib/src/ap-form/items/text/password.vue.js +1 -1
- package/lib/src/ap-form/items/text-area/index.vue.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-form/search-form/utils.d.ts +5 -0
- package/lib/src/ap-form/search-form/utils.js +1 -0
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/constants.d.ts +132 -0
- package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
- package/lib/src/editable-table/style/index.css +7 -1
- package/lib/src/editable-table/utils.d.ts +1 -0
- package/lib/src/editable-table/utils.js +1 -1
- package/lib/src/theme/editable-table/index.css +7 -1
- package/lib/src/transition/create-transition.js +1 -1
- package/package.json +1 -1
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { isVNode as
|
|
2
|
-
import { Col as
|
|
1
|
+
import { isVNode as te, defineComponent as ae, useSlots as oe, ref as le, unref as t, shallowRef as j, computed as g, watch as D, cloneVNode as ne, createVNode as l, Fragment as F, openBlock as c, createBlock as h, mergeProps as re, withCtx as R, resolveDynamicComponent as b, createElementBlock as se, renderList as ue } from "vue";
|
|
2
|
+
import { Col as v, Flex as O, Space as ie, Button as B, Row as pe } from "ant-design-vue";
|
|
3
3
|
import "../ap-form.vue.mjs";
|
|
4
4
|
import "../ap-form-item.vue2.mjs";
|
|
5
5
|
import "../../hooks/index.mjs";
|
|
6
|
-
import { genRealChildren as
|
|
7
|
-
import { DoubleRightOutlined as
|
|
6
|
+
import { genRealChildren as $ } from "../ap-form-item-group/helper.mjs";
|
|
7
|
+
import { DoubleRightOutlined as ce } from "@ant-design/icons-vue";
|
|
8
8
|
import "../../config-provider/index.mjs";
|
|
9
9
|
import "../style/search-form.css";
|
|
10
|
-
import { isArray as
|
|
11
|
-
import { isDef as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
10
|
+
import { isArray as de, omit as fe } from "lodash-unified";
|
|
11
|
+
import { isDef as me } from "../../utils/index.mjs";
|
|
12
|
+
import { diffFormItem as he } from "./utils.mjs";
|
|
13
|
+
import { useControllableValue as xe } from "../../hooks/useControllableValue.mjs";
|
|
14
|
+
import { useNamespace as Ce } from "../../config-provider/hooks/use-namespace.mjs";
|
|
15
|
+
import { useLocale as ge } from "../../config-provider/hooks/use-locale.mjs";
|
|
15
16
|
import L from "../ap-form-item.vue.mjs";
|
|
16
|
-
import
|
|
17
|
-
function
|
|
18
|
-
return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !
|
|
17
|
+
import ye from "../ap-form.vue2.mjs";
|
|
18
|
+
function _e(d) {
|
|
19
|
+
return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !te(d);
|
|
19
20
|
}
|
|
20
|
-
const
|
|
21
|
+
const i = 24, $e = /* @__PURE__ */ ae({
|
|
21
22
|
name: "ApFormSearchForm",
|
|
22
23
|
__name: "index",
|
|
23
24
|
props: {
|
|
@@ -98,94 +99,96 @@ const p = 24, Ie = /* @__PURE__ */ te({
|
|
|
98
99
|
emits: ["update:collapse"],
|
|
99
100
|
setup(d, {
|
|
100
101
|
expose: M,
|
|
101
|
-
emit:
|
|
102
|
+
emit: q
|
|
102
103
|
}) {
|
|
103
|
-
var
|
|
104
|
-
const r =
|
|
104
|
+
var k;
|
|
105
|
+
const r = oe(), a = d, z = q, {
|
|
105
106
|
value: f,
|
|
106
|
-
updateValue:
|
|
107
|
-
} =
|
|
107
|
+
updateValue: U
|
|
108
|
+
} = xe(a, z, {
|
|
108
109
|
valuePropName: "collapse",
|
|
109
110
|
defaultValuePropName: "defaultCollapse"
|
|
110
111
|
}), {
|
|
111
|
-
b:
|
|
112
|
-
} =
|
|
113
|
-
t:
|
|
114
|
-
} =
|
|
115
|
-
function W() {
|
|
116
|
-
z(!t(f));
|
|
117
|
-
}
|
|
112
|
+
b: W
|
|
113
|
+
} = Ce("ap-form-search-form"), {
|
|
114
|
+
t: w
|
|
115
|
+
} = ge(), x = le();
|
|
118
116
|
function G() {
|
|
117
|
+
U(!t(f));
|
|
118
|
+
}
|
|
119
|
+
function H() {
|
|
119
120
|
var e, o;
|
|
120
121
|
(o = (e = x.value) == null ? void 0 : e.validateFields()) == null || o.then(a.onSubmit);
|
|
121
122
|
}
|
|
122
|
-
function
|
|
123
|
+
function J() {
|
|
123
124
|
var e, o, n;
|
|
124
125
|
a.customReset || (o = (e = x.value) == null ? void 0 : e.resetFields) == null || o.call(e), (n = a.onReset) == null || n.call(a);
|
|
125
126
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
let E = [];
|
|
128
|
+
const y = j($(r.default())), m = j((k = r.extra) == null ? void 0 : k.call(r)), N = g(() => Math.floor(i / a.countPerRow));
|
|
129
|
+
D(() => r.default(), (e) => {
|
|
130
|
+
E = y.value, y.value = $(e);
|
|
131
|
+
}), D(() => {
|
|
130
132
|
var e;
|
|
131
133
|
return (e = r.extra) == null ? void 0 : e.call(r);
|
|
132
134
|
}, (e) => {
|
|
133
135
|
m.value = e;
|
|
134
136
|
});
|
|
135
|
-
const
|
|
136
|
-
const e =
|
|
137
|
-
let
|
|
137
|
+
const K = (e) => me(e) ? (de(e) ? e : [e]).join("") : Date.now(), _ = g(() => {
|
|
138
|
+
const e = he(E, y.value), o = [], n = [], s = t(N);
|
|
139
|
+
let S = 0;
|
|
138
140
|
e.forEach((u) => {
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
+
const p = u.props;
|
|
142
|
+
p != null && p.hidden ? o.push(u) : (S += p.span || s, n.push(u));
|
|
141
143
|
});
|
|
142
|
-
const
|
|
143
|
-
let
|
|
144
|
-
const
|
|
145
|
-
const
|
|
146
|
-
if (
|
|
147
|
-
o.push(
|
|
144
|
+
const A = i - (S + s) % i, X = A < s ? i : A, P = i - s * (t(m) && !a.extraInAction ? 2 : 1), Y = !a.forceExpand && S > P;
|
|
145
|
+
let T = 0, V = 0;
|
|
146
|
+
const Z = n.map((u, p) => {
|
|
147
|
+
const C = u.props, I = C.span || s;
|
|
148
|
+
if (T += I, !a.forceExpand && t(f) && T > P) {
|
|
149
|
+
o.push(ne(u, {
|
|
148
150
|
hidden: !0
|
|
149
151
|
}));
|
|
150
152
|
return;
|
|
151
153
|
}
|
|
152
|
-
return
|
|
154
|
+
return V += I, {
|
|
153
155
|
node: u,
|
|
154
|
-
span:
|
|
155
|
-
key: `ApFormSearchFormItem-${
|
|
156
|
+
span: C.span || s,
|
|
157
|
+
key: `ApFormSearchFormItem-${p}-${K(C.name)}-${C._signal}`
|
|
156
158
|
};
|
|
157
|
-
}).filter(Boolean),
|
|
159
|
+
}).filter(Boolean), ee = i - V - s;
|
|
158
160
|
return {
|
|
159
|
-
hideNode: l(
|
|
160
|
-
nodes:
|
|
161
|
-
defaultExtraSpan:
|
|
162
|
-
actualExtraSpan:
|
|
163
|
-
showCollapse:
|
|
161
|
+
hideNode: l(F, null, [o]),
|
|
162
|
+
nodes: Z,
|
|
163
|
+
defaultExtraSpan: X,
|
|
164
|
+
actualExtraSpan: ee,
|
|
165
|
+
showCollapse: Y
|
|
164
166
|
};
|
|
165
|
-
}),
|
|
167
|
+
}), Q = g(() => {
|
|
166
168
|
let e;
|
|
167
|
-
const o = t(
|
|
168
|
-
return l(
|
|
169
|
-
span: t(t(
|
|
169
|
+
const o = t(_);
|
|
170
|
+
return l(F, null, [l(v, {
|
|
171
|
+
span: t(t(N))
|
|
170
172
|
}, {
|
|
171
173
|
default: () => [l(L, null, {
|
|
172
|
-
default: () => [l(
|
|
174
|
+
default: () => [l(O, {
|
|
173
175
|
justify: "space-between"
|
|
174
176
|
}, {
|
|
175
|
-
default: () => [l(
|
|
176
|
-
default: () => [l(
|
|
177
|
+
default: () => [l(ie, null, {
|
|
178
|
+
default: () => [l(B, {
|
|
177
179
|
type: "primary",
|
|
178
|
-
onClick:
|
|
179
|
-
loading: a.submitLoading
|
|
180
|
+
onClick: H,
|
|
181
|
+
loading: a.submitLoading,
|
|
182
|
+
htmlType: "submit"
|
|
180
183
|
}, {
|
|
181
|
-
default: () => [a.searchText ||
|
|
182
|
-
}), l(
|
|
183
|
-
onClick:
|
|
184
|
+
default: () => [a.searchText || w("ap.apForm.search.search")]
|
|
185
|
+
}), l(B, {
|
|
186
|
+
onClick: J
|
|
184
187
|
}, {
|
|
185
|
-
default: () => [a.resetText ||
|
|
186
|
-
}), o.showCollapse ? l(
|
|
187
|
-
onClick:
|
|
188
|
-
icon: l(
|
|
188
|
+
default: () => [a.resetText || w("ap.apForm.search.reset")]
|
|
189
|
+
}), o.showCollapse ? l(B, {
|
|
190
|
+
onClick: G,
|
|
191
|
+
icon: l(ce, {
|
|
189
192
|
style: "color:#B8C3D1",
|
|
190
193
|
rotate: t(f) ? 90 : -90
|
|
191
194
|
}, null)
|
|
@@ -193,35 +196,35 @@ const p = 24, Ie = /* @__PURE__ */ te({
|
|
|
193
196
|
}), a.extraInAction ? t(m) : null]
|
|
194
197
|
})]
|
|
195
198
|
})]
|
|
196
|
-
}), !a.extraInAction && t(m) ? l(
|
|
199
|
+
}), !a.extraInAction && t(m) ? l(v, {
|
|
197
200
|
span: t(f) ? o.actualExtraSpan : o.defaultExtraSpan
|
|
198
201
|
}, {
|
|
199
202
|
default: () => [l(L, null, {
|
|
200
|
-
default: () => [l(
|
|
201
|
-
justify: !t(f) && o.defaultExtraSpan ===
|
|
202
|
-
},
|
|
203
|
+
default: () => [l(O, {
|
|
204
|
+
justify: !t(f) && o.defaultExtraSpan === i ? "start" : "end"
|
|
205
|
+
}, _e(e = t(m)) ? e : {
|
|
203
206
|
default: () => [e]
|
|
204
207
|
})]
|
|
205
208
|
})]
|
|
206
209
|
}) : null]);
|
|
207
210
|
});
|
|
208
211
|
return M({
|
|
209
|
-
apForm:
|
|
210
|
-
}), (e, o) => (c(), h(
|
|
211
|
-
class: t(
|
|
212
|
+
apForm: g(() => t(x))
|
|
213
|
+
}), (e, o) => (c(), h(ye, re({
|
|
214
|
+
class: t(W)(),
|
|
212
215
|
ref_key: "apForm",
|
|
213
216
|
ref: x
|
|
214
|
-
}, t(
|
|
215
|
-
default: R(() => [(c(), h(
|
|
217
|
+
}, t(fe)(a, ["collapse", "defaultCollapse", "onUpdate:collapse", "searchText", "resetText", "onSubmit", "onReset", "extraInAction", "forceExpand", "countPerRow"])), {
|
|
218
|
+
default: R(() => [(c(), h(b(_.value.hideNode))), l(t(pe), {
|
|
216
219
|
gutter: 16
|
|
217
220
|
}, {
|
|
218
|
-
default: R(() => [(c(!0),
|
|
221
|
+
default: R(() => [(c(!0), se(F, null, ue(_.value.nodes, (n) => (c(), h(t(v), {
|
|
219
222
|
key: n.key,
|
|
220
223
|
span: n.span
|
|
221
224
|
}, {
|
|
222
|
-
default: R(() => [(c(), h(
|
|
225
|
+
default: R(() => [(c(), h(b(n.node)))]),
|
|
223
226
|
_: 2
|
|
224
|
-
}, 1032, ["span"]))), 128)), (c(), h(
|
|
227
|
+
}, 1032, ["span"]))), 128)), (c(), h(b(Q.value)))]),
|
|
225
228
|
_: 1
|
|
226
229
|
})]),
|
|
227
230
|
_: 1
|
|
@@ -229,5 +232,5 @@ const p = 24, Ie = /* @__PURE__ */ te({
|
|
|
229
232
|
}
|
|
230
233
|
});
|
|
231
234
|
export {
|
|
232
|
-
|
|
235
|
+
$e as default
|
|
233
236
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { cloneVNode as g } from "vue";
|
|
2
|
+
import { isArray as y } from "lodash-unified";
|
|
3
|
+
function M(n, r) {
|
|
4
|
+
const t = p(n), e = p(r);
|
|
5
|
+
return r.map((o) => {
|
|
6
|
+
const i = u(o.props.name), c = e.get(i), s = t.get(i);
|
|
7
|
+
if (!t.get(i) || (c == null ? void 0 : c.index) !== (s == null ? void 0 : s.index))
|
|
8
|
+
return o;
|
|
9
|
+
const a = f(s.item), m = f(c.item);
|
|
10
|
+
return JSON.stringify(a) !== JSON.stringify(m) ? o : g(o, { _signal: s.item._signal });
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function u(n) {
|
|
14
|
+
return n ? (y(n) ? n : [n]).map((t) => "" + t).join("") : "";
|
|
15
|
+
}
|
|
16
|
+
function p(n) {
|
|
17
|
+
const r = /* @__PURE__ */ new Map();
|
|
18
|
+
return n.forEach((t, e) => {
|
|
19
|
+
const o = t.props, i = u(o.name);
|
|
20
|
+
r.set(i, { item: o, index: e });
|
|
21
|
+
}), r;
|
|
22
|
+
}
|
|
23
|
+
function f(n) {
|
|
24
|
+
if (n === null || typeof n != "object")
|
|
25
|
+
return n;
|
|
26
|
+
const r = {};
|
|
27
|
+
for (const t in n) {
|
|
28
|
+
const e = n[t];
|
|
29
|
+
t === "_signal" || typeof e == "function" || (r[t] = f(e));
|
|
30
|
+
}
|
|
31
|
+
return r;
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
M as diffFormItem
|
|
35
|
+
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Typography as
|
|
3
|
-
import { useToken as
|
|
4
|
-
import { ApForm as
|
|
5
|
-
import { apTableRenderItemMap as
|
|
1
|
+
import { defineComponent as te, useSlots as oe, computed as s, createVNode as d, mergeProps as f, unref as l, watch as re, openBlock as i, createElementBlock as m, normalizeClass as F, normalizeStyle as R, createSlots as L, withCtx as p, Fragment as le, renderList as E, createBlock as ne, resolveDynamicComponent as se, renderSlot as w, createCommentVNode as O, createElementVNode as V, toDisplayString as de, normalizeProps as ue, guardReactiveProps as ie } from "vue";
|
|
2
|
+
import { Typography as pe, Table as ce, Tooltip as fe } from "ant-design-vue";
|
|
3
|
+
import { useToken as me } from "ant-design-vue/es/theme/internal";
|
|
4
|
+
import { ApForm as ge } from "../ap-form/index.mjs";
|
|
5
|
+
import { apTableRenderItemMap as ye, noRenderAsFormItemValueList as z, apTableFormItemMap as be } from "./constants.mjs";
|
|
6
6
|
import "../config-provider/index.mjs";
|
|
7
|
-
import { useTablePaging as
|
|
8
|
-
import { omit as
|
|
7
|
+
import { useTablePaging as he } from "./hooks/use-table-paging.mjs";
|
|
8
|
+
import { omit as N, isUndefined as x, isBoolean as Ce } from "lodash-unified";
|
|
9
9
|
import "./style/ap-table.css";
|
|
10
|
-
import { QuestionCircleOutlined as
|
|
11
|
-
import { apColumnToColumn as
|
|
12
|
-
import
|
|
13
|
-
import { getRawDisplayValue as
|
|
14
|
-
import { useLocale as
|
|
15
|
-
import { useNamespace as
|
|
16
|
-
import { useGlobalConfig as
|
|
17
|
-
const
|
|
10
|
+
import { QuestionCircleOutlined as Se } from "@ant-design/icons-vue";
|
|
11
|
+
import { apColumnToColumn as Fe, getTableRenderType as Re, getTableRenderProps as we, getColumnOrder as D, updateFormProps as xe, getFieldProps as Te, getPlaceholder as Be } from "./utils.mjs";
|
|
12
|
+
import Pe from "./hooks/use-table-content-height.mjs";
|
|
13
|
+
import { getRawDisplayValue as ve } from "../editable-table/utils.mjs";
|
|
14
|
+
import { useLocale as Ie } from "../config-provider/hooks/use-locale.mjs";
|
|
15
|
+
import { useNamespace as ke } from "../config-provider/hooks/use-namespace.mjs";
|
|
16
|
+
import { useGlobalConfig as Le } from "../config-provider/hooks/use-global-config.mjs";
|
|
17
|
+
const Ee = {
|
|
18
18
|
key: 0
|
|
19
|
-
},
|
|
19
|
+
}, Ue = /* @__PURE__ */ te({
|
|
20
20
|
name: "ApTable",
|
|
21
21
|
__name: "ap-table",
|
|
22
22
|
props: {
|
|
@@ -130,31 +130,33 @@ const Le = {
|
|
|
130
130
|
default: !1
|
|
131
131
|
}
|
|
132
132
|
},
|
|
133
|
-
setup(
|
|
134
|
-
expose:
|
|
133
|
+
setup(W, {
|
|
134
|
+
expose: _
|
|
135
135
|
}) {
|
|
136
|
-
const o =
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
const o = W;
|
|
137
|
+
let T = 0;
|
|
138
|
+
const B = oe(), [, j] = me(), {
|
|
139
|
+
t: A
|
|
140
|
+
} = Ie(), {
|
|
139
141
|
e: g,
|
|
140
142
|
b: u
|
|
141
|
-
} =
|
|
142
|
-
height:
|
|
143
|
-
contentRef:
|
|
144
|
-
} =
|
|
143
|
+
} = ke("ap-table"), M = Le("uiMode", "aplus"), {
|
|
144
|
+
height: q,
|
|
145
|
+
contentRef: H
|
|
146
|
+
} = Pe(), y = s(() => {
|
|
145
147
|
var t;
|
|
146
148
|
let e = ((t = o.columns) == null ? void 0 : t.filter((a) => !a.hideInTable)) || [];
|
|
147
149
|
return e = e.map((a) => ({
|
|
148
|
-
...
|
|
150
|
+
...N(Fe(a), ["ellipsis"]),
|
|
149
151
|
customRender({
|
|
150
152
|
value: r,
|
|
151
153
|
...n
|
|
152
154
|
}) {
|
|
153
|
-
const C =
|
|
155
|
+
const C = Re(a), k = ye[C], ae = we(a, {
|
|
154
156
|
value: r,
|
|
155
157
|
...n
|
|
156
158
|
});
|
|
157
|
-
let S =
|
|
159
|
+
let S = Y(a, r, d(k, f(ae, {
|
|
158
160
|
mode: "read"
|
|
159
161
|
}), null));
|
|
160
162
|
return a.customRender && (S = a.customRender({
|
|
@@ -165,13 +167,13 @@ const Le = {
|
|
|
165
167
|
})), S;
|
|
166
168
|
}
|
|
167
169
|
})), e;
|
|
168
|
-
}),
|
|
170
|
+
}), P = s(() => {
|
|
169
171
|
var e, t, a;
|
|
170
|
-
return ((a = (t = (e = o.columns) == null ? void 0 : e.filter((r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !
|
|
171
|
-
let C =
|
|
172
|
-
return
|
|
172
|
+
return T++, ((a = (t = (e = o.columns) == null ? void 0 : e.filter((r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !z.includes(r.valueType))) == null ? void 0 : t.sort((r, n) => {
|
|
173
|
+
let C = D(r.order);
|
|
174
|
+
return D(n.order) - C;
|
|
173
175
|
})) == null ? void 0 : a.map((r) => {
|
|
174
|
-
const n =
|
|
176
|
+
const n = xe(r, Te(r.fieldProps, {}));
|
|
175
177
|
return {
|
|
176
178
|
...r,
|
|
177
179
|
fieldProps: {
|
|
@@ -179,18 +181,19 @@ const Le = {
|
|
|
179
181
|
name: r.dataIndex,
|
|
180
182
|
...n || {},
|
|
181
183
|
// 格式化placeholder
|
|
182
|
-
placeholder:
|
|
184
|
+
placeholder: Be(A, r.valueType, n == null ? void 0 : n.placeholder),
|
|
185
|
+
_signal: T
|
|
183
186
|
}
|
|
184
187
|
};
|
|
185
188
|
})) || [];
|
|
186
|
-
}),
|
|
189
|
+
}), K = s(() => l(y).filter((e) => e.sorter === !0).map((e) => e.dataIndex)), $ = s(() => l(y).filter((e) => e.filters && !e.onFilter).map((e) => e.dataIndex)), {
|
|
187
190
|
formRef: b,
|
|
188
|
-
submit:
|
|
189
|
-
reset:
|
|
191
|
+
submit: v,
|
|
192
|
+
reset: I,
|
|
190
193
|
tableProps: c,
|
|
191
|
-
handleTableChange:
|
|
194
|
+
handleTableChange: G,
|
|
192
195
|
data: h
|
|
193
|
-
} =
|
|
196
|
+
} = he({
|
|
194
197
|
async request(e) {
|
|
195
198
|
var a, r;
|
|
196
199
|
const t = await ((a = o.request) == null ? void 0 : a.call(o, e));
|
|
@@ -199,29 +202,29 @@ const Le = {
|
|
|
199
202
|
total: (t == null ? void 0 : t.total) || 0
|
|
200
203
|
};
|
|
201
204
|
},
|
|
202
|
-
filterFields: l(
|
|
203
|
-
sortFields: l(
|
|
205
|
+
filterFields: l($),
|
|
206
|
+
sortFields: l(K),
|
|
204
207
|
defaultParams: o.params,
|
|
205
208
|
defaultData: o.defaultData,
|
|
206
209
|
manual: o.manual,
|
|
207
210
|
defaultCurrent: o.pagination ? o.pagination.defaultCurrent : void 0,
|
|
208
211
|
defaultPageSize: o.pagination ? o.pagination.defaultPageSize : void 0,
|
|
209
212
|
formatParams: o.beforeSearchSubmit
|
|
210
|
-
}),
|
|
213
|
+
}), Q = s(() => {
|
|
211
214
|
var e;
|
|
212
215
|
return o.scroll ? o.scroll : o.adaptive && (h.value.total > 0 || (e = o.dataSource) != null && e.length) ? {
|
|
213
|
-
y: l(
|
|
216
|
+
y: l(q),
|
|
214
217
|
x: "100%"
|
|
215
218
|
} : {
|
|
216
219
|
x: !0
|
|
217
220
|
};
|
|
218
|
-
}),
|
|
221
|
+
}), U = s(() => {
|
|
219
222
|
var e;
|
|
220
223
|
if (o.tableLayout)
|
|
221
224
|
return o.tableLayout;
|
|
222
225
|
if ((e = o.columns) != null && e.some((t) => t.ellipsis))
|
|
223
226
|
return "fixed";
|
|
224
|
-
}),
|
|
227
|
+
}), J = s(() => {
|
|
225
228
|
const e = l(c), t = x(o.dataSource) ? e : {
|
|
226
229
|
...e,
|
|
227
230
|
dataSource: o.dataSource,
|
|
@@ -232,101 +235,101 @@ const Le = {
|
|
|
232
235
|
...t,
|
|
233
236
|
loading: x(o.loading) ? l(c).loading : o.loading,
|
|
234
237
|
pagination: o.pagination === !1 ? !1 : l(c).pagination,
|
|
235
|
-
scroll: l(
|
|
238
|
+
scroll: l(Q)
|
|
236
239
|
};
|
|
237
|
-
}),
|
|
238
|
-
function
|
|
239
|
-
return
|
|
240
|
+
}), X = s(() => [u(), o.card ? null : u("wrapper"), o.adaptive ? u("adaptive") : null].filter(Boolean));
|
|
241
|
+
function Y(e, t, a) {
|
|
242
|
+
return z.includes(e.valueType) ? a : e.copyable || e.ellipsis ? d(pe.Paragraph, {
|
|
240
243
|
copyable: e.copyable ? {
|
|
241
244
|
text: t,
|
|
242
245
|
tooltip: !1
|
|
243
246
|
} : !1,
|
|
244
|
-
ellipsis: e.ellipsis ?
|
|
247
|
+
ellipsis: e.ellipsis ? Ce(e.ellipsis) ? {
|
|
245
248
|
tooltip: t
|
|
246
249
|
} : {
|
|
247
250
|
...e.ellipsis,
|
|
248
251
|
tooltip: t
|
|
249
252
|
} : !1,
|
|
250
|
-
content: e.ellipsis ?
|
|
253
|
+
content: e.ellipsis ? ve(e, t) : a
|
|
251
254
|
}, null) : a;
|
|
252
255
|
}
|
|
253
|
-
|
|
256
|
+
re(() => l(h).loading, (e) => {
|
|
254
257
|
var t;
|
|
255
258
|
(t = o.onLoadingChange) == null || t.call(o, e);
|
|
256
259
|
});
|
|
257
|
-
function
|
|
260
|
+
function Z(e) {
|
|
258
261
|
var t, a, r;
|
|
259
262
|
(r = (a = (t = b.value) == null ? void 0 : t.apForm) == null ? void 0 : a.setFieldsValue) == null || r.call(a, e);
|
|
260
263
|
}
|
|
261
|
-
function
|
|
264
|
+
function ee() {
|
|
262
265
|
var e, t, a;
|
|
263
266
|
return (a = (t = (e = b.value) == null ? void 0 : e.apForm) == null ? void 0 : t.getFieldsValue) == null ? void 0 : a.call(t, !0);
|
|
264
267
|
}
|
|
265
|
-
return
|
|
266
|
-
submit: () =>
|
|
267
|
-
reset: () =>
|
|
268
|
-
setSearchFormValues:
|
|
269
|
-
getSearchFormValues:
|
|
268
|
+
return _({
|
|
269
|
+
submit: () => v(),
|
|
270
|
+
reset: () => I(),
|
|
271
|
+
setSearchFormValues: Z,
|
|
272
|
+
getSearchFormValues: ee,
|
|
270
273
|
dataSource: s(() => l(h).records)
|
|
271
274
|
}), (e, t) => (i(), m("div", {
|
|
272
|
-
class: F(
|
|
273
|
-
}, [l(x)(e.dataSource) && e.searchForm !== !1 &&
|
|
275
|
+
class: F(X.value)
|
|
276
|
+
}, [l(x)(e.dataSource) && e.searchForm !== !1 && P.value.length > 0 ? (i(), m("div", {
|
|
274
277
|
key: 0,
|
|
275
278
|
class: F(e.card ? l(g)("search-wrapper") : null),
|
|
276
279
|
style: R(e.searchFormWrapperStyle)
|
|
277
|
-
}, [d(l(
|
|
280
|
+
}, [d(l(ge).SearchForm, f(e.searchForm || {}, {
|
|
278
281
|
ref_key: "formRef",
|
|
279
282
|
ref: b,
|
|
280
283
|
"custom-reset": "",
|
|
281
|
-
onSubmit: l(
|
|
282
|
-
onReset: l(
|
|
284
|
+
onSubmit: l(v),
|
|
285
|
+
onReset: l(I),
|
|
283
286
|
"submit-loading": l(c).loading
|
|
284
|
-
}),
|
|
285
|
-
default: p(() => [(i(!0), m(
|
|
287
|
+
}), L({
|
|
288
|
+
default: p(() => [(i(!0), m(le, null, E(P.value, (a) => (i(), ne(se(a.customRenderFormItem ? a.customRenderFormItem(a) : l(be)[a.valueType || "text"]), f({
|
|
286
289
|
key: a.dataIndex,
|
|
287
290
|
ref_for: !0
|
|
288
291
|
}, a.fieldProps || {}, {
|
|
289
292
|
span: a.span
|
|
290
293
|
}), null, 16, ["span"]))), 128))]),
|
|
291
294
|
_: 2
|
|
292
|
-
}, [
|
|
295
|
+
}, [B.searchFormExtra ? {
|
|
293
296
|
name: "extra",
|
|
294
297
|
fn: p(() => [w(e.$slots, "searchFormExtra")]),
|
|
295
298
|
key: "0"
|
|
296
|
-
} : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) :
|
|
299
|
+
} : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : O("", !0), V("div", {
|
|
297
300
|
ref_key: "contentRef",
|
|
298
|
-
ref:
|
|
301
|
+
ref: H,
|
|
299
302
|
class: F([l(g)("table-wrapper"), e.card ? l(g)("table-wrapper-card") : null]),
|
|
300
303
|
style: R(e.tableWrapperStyle)
|
|
301
|
-
}, [w(e.$slots, "title"), d(l(
|
|
302
|
-
class: l(
|
|
303
|
-
},
|
|
304
|
-
"table-layout":
|
|
305
|
-
onChange: l(
|
|
304
|
+
}, [w(e.$slots, "title"), d(l(ce), f({
|
|
305
|
+
class: l(M) === "admin" ? l(u)("table-admin") : l(u)("table")
|
|
306
|
+
}, J.value, {
|
|
307
|
+
"table-layout": U.value,
|
|
308
|
+
onChange: l(G),
|
|
306
309
|
columns: y.value
|
|
307
|
-
}),
|
|
310
|
+
}), L({
|
|
308
311
|
headerCell: p(({
|
|
309
312
|
column: a,
|
|
310
313
|
title: r
|
|
311
|
-
}) => [a.tooltip ? (i(), m("span",
|
|
314
|
+
}) => [a.tooltip ? (i(), m("span", Ee, [V("span", null, de(r), 1), d(l(fe), {
|
|
312
315
|
title: a.tooltip,
|
|
313
316
|
placement: "bottom"
|
|
314
317
|
}, {
|
|
315
|
-
default: p(() => [d(l(
|
|
318
|
+
default: p(() => [d(l(Se), {
|
|
316
319
|
style: R({
|
|
317
320
|
paddingLeft: "4px",
|
|
318
321
|
color: l(j).colorPrimary
|
|
319
322
|
})
|
|
320
323
|
}, null, 8, ["style"])]),
|
|
321
324
|
_: 2
|
|
322
|
-
}, 1032, ["title"])])) :
|
|
325
|
+
}, 1032, ["title"])])) : O("", !0)]),
|
|
323
326
|
_: 2
|
|
324
|
-
}, [
|
|
327
|
+
}, [E(l(N)(B, ["title", "searchFormExtra"]), (a, r) => ({
|
|
325
328
|
name: r,
|
|
326
|
-
fn: p((n) => [w(e.$slots, r,
|
|
329
|
+
fn: p((n) => [w(e.$slots, r, ue(ie(n || {})))])
|
|
327
330
|
}))]), 1040, ["class", "table-layout", "onChange", "columns"])], 6)], 2));
|
|
328
331
|
}
|
|
329
332
|
});
|
|
330
333
|
export {
|
|
331
|
-
|
|
334
|
+
Ue as default
|
|
332
335
|
};
|