@aplus-frontend/ui 0.6.5 → 0.6.7
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/index.mjs +28 -26
- package/es/src/ap-form/list/index.vue.d.ts +2 -1
- package/es/src/ap-form/list/index.vue.mjs +31 -27
- package/es/src/ap-form/search-form/hooks/use-sorter.mjs +4 -1
- package/es/src/ap-grid/editable/form-item.vue.mjs +25 -24
- package/es/src/ap-grid/editable/index.vue.mjs +1 -0
- package/es/src/ap-grid/index.d.ts +1 -0
- package/es/src/ap-grid/index.mjs +4 -2
- package/es/src/ap-grid/index.vue.mjs +2 -1
- package/es/src/ap-grid/interface.d.ts +12 -0
- package/es/src/ap-grid/utils/col.mjs +44 -44
- package/es/src/ap-grid/utils/renderer.mjs +9 -9
- package/es/src/ap-grid/utils/table.mjs +15 -9
- package/es/src/ap-grid/utils/to-tree-array.d.ts +13 -0
- package/es/src/ap-grid/utils/to-tree-array.mjs +19 -0
- package/es/src/business/ap-copy/ApCopy.mjs +27 -25
- package/es/src/business/ap-label/ApLabel.d.ts +4 -3
- package/es/src/business/ap-label/ApLabel.mjs +18 -17
- package/es/src/business/ap-label/constans.d.ts +2 -2
- package/es/src/business/ap-label/constans.mjs +1 -1
- package/es/src/business/ap-label/index.d.ts +7 -7
- package/es/src/business/ap-label/interface.d.ts +1 -1
- package/es/src/business/ap-product-info/ApProductInfo.d.ts +3 -3
- package/es/src/business/ap-product-info/ApProductInfo.mjs +55 -40
- package/es/src/business/ap-product-info/interface.d.ts +2 -0
- package/es/src/business/ap-view/ap-view.vue2.mjs +1 -1
- package/es/src/index.mjs +24 -22
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/index.js +1 -1
- package/lib/src/ap-form/list/index.vue.d.ts +2 -1
- package/lib/src/ap-form/list/index.vue.js +1 -1
- package/lib/src/ap-form/search-form/hooks/use-sorter.js +1 -1
- package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ap-grid/editable/index.vue.js +1 -1
- package/lib/src/ap-grid/index.d.ts +1 -0
- package/lib/src/ap-grid/index.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/interface.d.ts +12 -0
- package/lib/src/ap-grid/utils/col.js +1 -1
- package/lib/src/ap-grid/utils/renderer.js +1 -1
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-grid/utils/to-tree-array.d.ts +13 -0
- package/lib/src/ap-grid/utils/to-tree-array.js +1 -0
- package/lib/src/business/ap-copy/ApCopy.js +1 -1
- package/lib/src/business/ap-label/ApLabel.d.ts +4 -3
- package/lib/src/business/ap-label/ApLabel.js +1 -1
- package/lib/src/business/ap-label/constans.d.ts +2 -2
- package/lib/src/business/ap-label/constans.js +1 -1
- package/lib/src/business/ap-label/index.d.ts +7 -7
- package/lib/src/business/ap-label/interface.d.ts +1 -1
- package/lib/src/business/ap-product-info/ApProductInfo.d.ts +3 -3
- package/lib/src/business/ap-product-info/ApProductInfo.js +1 -1
- package/lib/src/business/ap-product-info/interface.d.ts +2 -0
- package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
- package/theme/ap-grid/index.css +12 -0
- package/theme/ap-grid/index.less +16 -0
- package/theme/ap-label/ap-label.css +4 -0
- package/theme/ap-label/ap-label.less +5 -1
- package/theme/ap-product-info/ap-product-info.less +0 -1
- package/theme/font/aplusuiiconfont.otf +0 -0
- package/theme/font/font.css +5 -0
- package/theme/font/font.less +6 -0
- package/theme/index.css +21 -0
- package/theme/index.less +1 -0
package/es/index.mjs
CHANGED
|
@@ -128,19 +128,20 @@ import { default as dp } from "./src/portal/index.vue.mjs";
|
|
|
128
128
|
import { default as up } from "./src/full-screen/index.vue.mjs";
|
|
129
129
|
import { default as ip } from "./src/resize-observer/index.vue.mjs";
|
|
130
130
|
import { ROW_SELECTION_FIELD as cp } from "./src/ap-grid/constants.mjs";
|
|
131
|
-
import {
|
|
132
|
-
import { default as Sp } from "./src/ap-grid/
|
|
133
|
-
import { default as Cp } from "./src/ap-grid/editable/
|
|
134
|
-
import { default as Dp } from "./src/
|
|
135
|
-
import { default as Gp } from "./src/text/
|
|
136
|
-
import { default as Ep } from "./src/
|
|
137
|
-
import {
|
|
138
|
-
import {
|
|
139
|
-
import {
|
|
140
|
-
import {
|
|
141
|
-
import {
|
|
142
|
-
import {
|
|
143
|
-
import {
|
|
131
|
+
import { toTreeArray as Ip } from "./src/ap-grid/utils/to-tree-array.mjs";
|
|
132
|
+
import { default as Sp } from "./src/ap-grid/index.vue.mjs";
|
|
133
|
+
import { default as Cp } from "./src/ap-grid/editable/index.vue.mjs";
|
|
134
|
+
import { default as Dp } from "./src/ap-grid/editable/form-item.vue.mjs";
|
|
135
|
+
import { default as Gp } from "./src/text/index.vue.mjs";
|
|
136
|
+
import { default as Ep } from "./src/text/group.vue.mjs";
|
|
137
|
+
import { default as Lp } from "./src/mask/index.vue.mjs";
|
|
138
|
+
import { Splitter as vp } from "./src/splitter/index.mjs";
|
|
139
|
+
import { useMessage as yp } from "./src/hooks/useMessage.mjs";
|
|
140
|
+
import { useControllableValue as kp } from "./src/hooks/useControllableValue.mjs";
|
|
141
|
+
import { useManualRef as Kp } from "./src/hooks/useManualRef.mjs";
|
|
142
|
+
import { useThrottleRef as Up } from "./src/hooks/useThrottleRef.mjs";
|
|
143
|
+
import { useFullScreen as _p } from "./src/hooks/useFullScreen.mjs";
|
|
144
|
+
import { useResize as Wp } from "./src/hooks/useResize.mjs";
|
|
144
145
|
const a = console.log;
|
|
145
146
|
a(`APlus-UI version ${p}`);
|
|
146
147
|
const l = {
|
|
@@ -215,7 +216,7 @@ export {
|
|
|
215
216
|
Re as ApFormProvider,
|
|
216
217
|
ne as ApFormSearchForm,
|
|
217
218
|
be as ApFormSet,
|
|
218
|
-
|
|
219
|
+
Sp as ApGrid,
|
|
219
220
|
ct as ApGroupSearch,
|
|
220
221
|
vr as ApImage,
|
|
221
222
|
vo as ApInfoLayout,
|
|
@@ -240,8 +241,8 @@ export {
|
|
|
240
241
|
fr as ApTableModal,
|
|
241
242
|
Eo as ApTag,
|
|
242
243
|
Lo as ApTagGroup,
|
|
243
|
-
|
|
244
|
-
|
|
244
|
+
Gp as ApText,
|
|
245
|
+
Ep as ApTextGroup,
|
|
245
246
|
qr as ApTitle,
|
|
246
247
|
pr as ApTransformDataHelper,
|
|
247
248
|
ko as ApUpload,
|
|
@@ -254,21 +255,21 @@ export {
|
|
|
254
255
|
n as DEFAULT_NAMESPACE,
|
|
255
256
|
c as DEFAULT_UIMODE,
|
|
256
257
|
bo as DictCode,
|
|
257
|
-
|
|
258
|
-
|
|
258
|
+
Cp as EditableGrid,
|
|
259
|
+
Dp as EditableGridFormItem,
|
|
259
260
|
Qt as EditableTable,
|
|
260
261
|
Yt as EditableTableFormItem,
|
|
261
262
|
up as FullScreen,
|
|
262
263
|
fp as InternalScrollBar,
|
|
263
264
|
Ut as LruCacher,
|
|
264
|
-
|
|
265
|
+
Lp as Mask,
|
|
265
266
|
yo as NeedNameKeyDefault,
|
|
266
267
|
dp as Portal,
|
|
267
268
|
cp as ROW_SELECTION_FIELD,
|
|
268
269
|
ip as ResizeObserver,
|
|
269
270
|
pp as ScrollBar,
|
|
270
271
|
lp as ScrollView,
|
|
271
|
-
|
|
272
|
+
vp as Splitter,
|
|
272
273
|
Go as WorkOrderModal,
|
|
273
274
|
mo as adminToken,
|
|
274
275
|
lo as aplusToken,
|
|
@@ -296,23 +297,24 @@ export {
|
|
|
296
297
|
L as namespaceContextKey,
|
|
297
298
|
s as pathMap,
|
|
298
299
|
S as provideGlobalConfig,
|
|
300
|
+
Ip as toTreeArray,
|
|
299
301
|
G as translate,
|
|
300
302
|
_t as useApKeepAliveInject,
|
|
301
|
-
|
|
302
|
-
|
|
303
|
+
kp as useControllableValue,
|
|
304
|
+
_p as useFullScreen,
|
|
303
305
|
M as useGetDerivedNamespace,
|
|
304
306
|
b as useGlobalConfig,
|
|
305
307
|
rt as useGridRefresh,
|
|
306
308
|
P as useLocale,
|
|
307
|
-
|
|
308
|
-
|
|
309
|
+
Kp as useManualRef,
|
|
310
|
+
yp as useMessage,
|
|
309
311
|
v as useNamespace,
|
|
310
312
|
et as usePageListApGrid,
|
|
311
313
|
Qr as usePageListApTable,
|
|
312
|
-
|
|
314
|
+
Wp as useResize,
|
|
313
315
|
lr as useTableModal,
|
|
314
316
|
jt as useTablePaging,
|
|
315
317
|
Yr as useTableRefresh,
|
|
316
318
|
dr as useTableSelectModal,
|
|
317
|
-
|
|
319
|
+
Up as useThrottleRef
|
|
318
320
|
};
|
|
@@ -7,8 +7,9 @@ type FormListField = {
|
|
|
7
7
|
fieldName: number;
|
|
8
8
|
};
|
|
9
9
|
type FormListActions = {
|
|
10
|
-
add: (defaultValue?: any) =>
|
|
10
|
+
add: (defaultValue?: any) => number;
|
|
11
11
|
remove: (name: number) => void;
|
|
12
|
+
getFieldKeys: () => number[];
|
|
12
13
|
};
|
|
13
14
|
type ApFormListSlots = {
|
|
14
15
|
default(props: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useInjectForm as
|
|
3
|
-
import { isArray as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as v, onMounted as V, computed as p, unref as i, renderSlot as K } from "vue";
|
|
2
|
+
import { useInjectForm as g } from "../context.mjs";
|
|
3
|
+
import { isArray as h } from "lodash-unified";
|
|
4
|
+
const b = /* @__PURE__ */ v({
|
|
5
5
|
name: "ApFormList",
|
|
6
6
|
__name: "index",
|
|
7
7
|
props: {
|
|
@@ -9,43 +9,47 @@ const g = /* @__PURE__ */ V({
|
|
|
9
9
|
initialValue: {},
|
|
10
10
|
transform: { type: [Function, Object] }
|
|
11
11
|
},
|
|
12
|
-
setup(
|
|
13
|
-
let
|
|
14
|
-
const a = [], t =
|
|
15
|
-
|
|
12
|
+
setup(y) {
|
|
13
|
+
let s = 1;
|
|
14
|
+
const a = [], t = y, { model: u, updateModel: o, internalInstance: c } = g();
|
|
15
|
+
V(() => {
|
|
16
16
|
c == null || c.registerField({
|
|
17
17
|
name: t.name,
|
|
18
18
|
initialValue: t.initialValue,
|
|
19
19
|
transform: t.transform
|
|
20
20
|
});
|
|
21
21
|
});
|
|
22
|
-
const
|
|
23
|
-
function
|
|
24
|
-
const n =
|
|
25
|
-
a.push(
|
|
22
|
+
const m = p(() => t.name ? h(t.name) ? t.name.reduce((e, n) => e == null ? void 0 : e[n], i(u)) : u == null ? void 0 : u.value[t.name] : null);
|
|
23
|
+
function d(e = void 0) {
|
|
24
|
+
const n = i(m) ? [...i(m), e] : [e], r = s;
|
|
25
|
+
return a.push(r), s += 1, o == null || o(t.name, n), r;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
let n =
|
|
29
|
-
n = [...n.slice(0, e), ...n.slice(e + 1)], a.splice(e, 1),
|
|
27
|
+
function F(e) {
|
|
28
|
+
let n = i(m) || [];
|
|
29
|
+
n = [...n.slice(0, e), ...n.slice(e + 1)], a.splice(e, 1), o == null || o(t.name, n);
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
function _() {
|
|
32
|
+
return f.value.map((e) => e.key);
|
|
33
|
+
}
|
|
34
|
+
const k = {
|
|
35
|
+
add: d,
|
|
36
|
+
remove: F,
|
|
37
|
+
getFieldKeys: _
|
|
38
|
+
}, f = p(() => (i(m) || []).map((n, r) => {
|
|
39
|
+
let l = a[r];
|
|
40
|
+
return typeof l > "u" && (a[r] = s, l = s, s += 1), {
|
|
37
41
|
key: l,
|
|
38
|
-
fieldName:
|
|
39
|
-
name: [t.name,
|
|
42
|
+
fieldName: r,
|
|
43
|
+
name: [t.name, r].flat(),
|
|
40
44
|
value: n
|
|
41
45
|
};
|
|
42
46
|
}));
|
|
43
|
-
return (e, n) =>
|
|
44
|
-
fields:
|
|
45
|
-
actions:
|
|
47
|
+
return (e, n) => K(e.$slots, "default", {
|
|
48
|
+
fields: f.value,
|
|
49
|
+
actions: k
|
|
46
50
|
});
|
|
47
51
|
}
|
|
48
52
|
});
|
|
49
53
|
export {
|
|
50
|
-
|
|
54
|
+
b as default
|
|
51
55
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as P, useSlots as A, toRef as W, ref as h, unref as
|
|
1
|
+
import { defineComponent as P, useSlots as A, toRef as W, ref as h, unref as u, watch as G, nextTick as U, createBlock as $, openBlock as q, mergeProps as y, withCtx as g, createVNode as J, createSlots as Q, renderList as X, renderSlot as Y, normalizeProps as Z, guardReactiveProps as I } from "vue";
|
|
2
2
|
import { ApForm as C } from "../../ap-form/index.mjs";
|
|
3
3
|
import { isArray as w, isUndefined as M, isNumber as m, cloneDeep as ee, omit as oe } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
@@ -148,6 +148,7 @@ const Ce = /* @__PURE__ */ P({
|
|
|
148
148
|
rowHighlightable: {
|
|
149
149
|
type: [Boolean, Function]
|
|
150
150
|
},
|
|
151
|
+
treeConfig: {},
|
|
151
152
|
columns: {},
|
|
152
153
|
defaultValue: {},
|
|
153
154
|
"onUpdate:value": {},
|
|
@@ -172,7 +173,7 @@ const Ce = /* @__PURE__ */ P({
|
|
|
172
173
|
const {
|
|
173
174
|
internalInstance: o,
|
|
174
175
|
model: v
|
|
175
|
-
} = ae(), p = W(l.name), d = h(F(
|
|
176
|
+
} = ae(), p = W(l.name), d = h(F(u(v), p.value) || []), N = C.useWatch(p);
|
|
176
177
|
G(() => N.value, async (e) => {
|
|
177
178
|
var t;
|
|
178
179
|
await U(), d.value = e, (t = l.onChange) == null || t.call(l, e);
|
|
@@ -182,61 +183,61 @@ const Ce = /* @__PURE__ */ P({
|
|
|
182
183
|
const c = h(), D = ne("valueTypeMap"), V = te(l, D);
|
|
183
184
|
function L(e, t) {
|
|
184
185
|
var f;
|
|
185
|
-
const n = ((f =
|
|
186
|
+
const n = ((f = u(d)) == null ? void 0 : f.length) || 0;
|
|
186
187
|
if (b(l.maxLength) && n >= l.maxLength)
|
|
187
188
|
return;
|
|
188
189
|
const a = {
|
|
189
190
|
...e || {}
|
|
190
191
|
};
|
|
191
|
-
o == null || o.setFieldValue(l.name, a, !0, (
|
|
192
|
-
if (!s
|
|
193
|
-
s
|
|
192
|
+
o == null || o.setFieldValue(l.name, a, !0, (r, s) => {
|
|
193
|
+
if (!r[s]) {
|
|
194
|
+
r[s] = [a];
|
|
194
195
|
return;
|
|
195
196
|
}
|
|
196
|
-
M(t) ? s
|
|
197
|
+
M(t) ? r[s].push(a) : r[s].splice(t, 0, a);
|
|
197
198
|
});
|
|
198
199
|
}
|
|
199
200
|
function T(e, t = "suffix") {
|
|
200
|
-
var
|
|
201
|
-
const n = ((
|
|
201
|
+
var r;
|
|
202
|
+
const n = ((r = u(d)) == null ? void 0 : r.length) || 0, a = m(e) ? e : e.length;
|
|
202
203
|
if (b(l.maxLength) && n + a > l.maxLength)
|
|
203
204
|
return;
|
|
204
205
|
const f = m(e) ? new Array(e).fill(0).map(() => ({})) : ee(e);
|
|
205
|
-
o == null || o.setFieldValue(l.name, f, !0, (
|
|
206
|
-
if (!
|
|
207
|
-
|
|
206
|
+
o == null || o.setFieldValue(l.name, f, !0, (s, i) => {
|
|
207
|
+
if (!s[i]) {
|
|
208
|
+
s[i] = [...f];
|
|
208
209
|
return;
|
|
209
210
|
}
|
|
210
|
-
t === "suffix" ?
|
|
211
|
+
t === "suffix" ? s[i].push(...f) : s[i].unshift(...f);
|
|
211
212
|
});
|
|
212
213
|
}
|
|
213
214
|
function k(e) {
|
|
214
215
|
const t = new Set(m(e) ? [e] : e);
|
|
215
216
|
o == null || o.setFieldValue(l.name, void 0, !0, (n, a) => {
|
|
216
|
-
n[a] = n[a].filter((f,
|
|
217
|
+
n[a] = n[a].filter((f, r) => !t.has(r));
|
|
217
218
|
});
|
|
218
219
|
}
|
|
219
220
|
function _(e) {
|
|
220
221
|
var n;
|
|
221
222
|
const t = new Set(w(e) ? e : [e]);
|
|
222
223
|
t.size !== 0 && ((n = o == null ? void 0 : o.setFieldValue) == null || n.call(o, l.name, void 0, !0, (a, f) => {
|
|
223
|
-
a[f] = a[f].filter((
|
|
224
|
+
a[f] = a[f].filter((r) => !t.has(r[l.rowKey]));
|
|
224
225
|
}));
|
|
225
226
|
}
|
|
226
227
|
function j() {
|
|
227
|
-
return
|
|
228
|
+
return u(d);
|
|
228
229
|
}
|
|
229
230
|
function E(e) {
|
|
230
231
|
var t;
|
|
231
|
-
return (t =
|
|
232
|
+
return (t = u(d)) == null ? void 0 : t[e];
|
|
232
233
|
}
|
|
233
234
|
function O(e, t, n = !0) {
|
|
234
235
|
o == null || o.setFieldValue(l.name, void 0, !0, (a, f) => {
|
|
235
236
|
if (!(!a[f] || !a[f][e])) {
|
|
236
237
|
if (!n) {
|
|
237
|
-
const
|
|
238
|
-
for (const
|
|
239
|
-
|
|
238
|
+
const r = Object.keys(a[f][e]);
|
|
239
|
+
for (const s of r)
|
|
240
|
+
s !== l.rowKey && delete a[f][e][s];
|
|
240
241
|
}
|
|
241
242
|
Object.assign(a[f][e], {
|
|
242
243
|
...t
|
|
@@ -267,15 +268,15 @@ const Ce = /* @__PURE__ */ P({
|
|
|
267
268
|
setTableData: z,
|
|
268
269
|
clear: H,
|
|
269
270
|
removeByKey: _
|
|
270
|
-
}), (e, t) => (q(), $(
|
|
271
|
+
}), (e, t) => (q(), $(u(C).FormItem, y(e.formItem, {
|
|
271
272
|
name: e.name,
|
|
272
273
|
label: e.label
|
|
273
274
|
}), {
|
|
274
|
-
default: g(() => [J(fe, y(
|
|
275
|
+
default: g(() => [J(fe, y(u(oe)(l, ["name", "value", "onUpdate:value", "maxLength", "onChange", "defaultValue", "formItem"]), {
|
|
275
276
|
ref_key: "tableRef",
|
|
276
277
|
ref: c,
|
|
277
|
-
class:
|
|
278
|
-
columns:
|
|
278
|
+
class: u(S)(),
|
|
279
|
+
columns: u(V),
|
|
279
280
|
"data-source": d.value,
|
|
280
281
|
"search-form": !1
|
|
281
282
|
}), Q({
|
package/es/src/ap-grid/index.mjs
CHANGED
|
@@ -3,7 +3,9 @@ import "./editable/index.vue2.mjs";
|
|
|
3
3
|
import "./editable/form-item.vue2.mjs";
|
|
4
4
|
import "./interface.mjs";
|
|
5
5
|
import "./editable/interface.mjs";
|
|
6
|
-
import { ROW_SELECTION_FIELD as
|
|
6
|
+
import { ROW_SELECTION_FIELD as E } from "./constants.mjs";
|
|
7
|
+
import { toTreeArray as x } from "./utils/to-tree-array.mjs";
|
|
7
8
|
export {
|
|
8
|
-
|
|
9
|
+
E as ROW_SELECTION_FIELD,
|
|
10
|
+
x as toTreeArray
|
|
9
11
|
};
|
|
@@ -111,7 +111,8 @@ const Go = /* @__PURE__ */ Oe({
|
|
|
111
111
|
virtual: { type: [Boolean, Object], default: void 0 },
|
|
112
112
|
expandable: {},
|
|
113
113
|
value: {},
|
|
114
|
-
rowHighlightable: { type: [Boolean, Function], default: !1 }
|
|
114
|
+
rowHighlightable: { type: [Boolean, Function], default: !1 },
|
|
115
|
+
treeConfig: {}
|
|
115
116
|
},
|
|
116
117
|
setup(se, { expose: ie }) {
|
|
117
118
|
var Y;
|
|
@@ -65,6 +65,14 @@ export type ApGridColumnType<RecordType = any, ExtraValueType = 'text', ValueTyp
|
|
|
65
65
|
* 指定渲染内容是否为html
|
|
66
66
|
*/
|
|
67
67
|
html?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* 指定当前列是否是VxeTable内置的序号列
|
|
70
|
+
*/
|
|
71
|
+
seq?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* 指定当前列为树节点
|
|
74
|
+
*/
|
|
75
|
+
treeNode?: boolean;
|
|
68
76
|
/**
|
|
69
77
|
* 值类型额外配置的参数(用于查询表单渲染)
|
|
70
78
|
*/
|
|
@@ -244,6 +252,10 @@ export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
|
|
|
244
252
|
* 行是否可以被高亮(传入函数可以获取当前被选中的行)
|
|
245
253
|
*/
|
|
246
254
|
rowHighlightable?: boolean | ((current: RecordType) => void);
|
|
255
|
+
/**
|
|
256
|
+
* 树形表格设置(部分vxe-table.treeConfig配置)
|
|
257
|
+
*/
|
|
258
|
+
treeConfig?: Omit<VxeTablePropTypes.TreeConfig<RecordType>, 'transform' | 'iconOpen' | 'iconClose' | 'iconLoaded'>;
|
|
247
259
|
};
|
|
248
260
|
export type ApGridVirtualConfig = {
|
|
249
261
|
x?: false | number;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { createVNode as v, Fragment as O } from "vue";
|
|
2
|
-
import { isUndefined as S, isArray as $, isString as x, isBoolean as
|
|
3
|
-
import { valueEnumToArray as V, objectToString as j, getTableTitle as
|
|
4
|
-
import { noRenderAsFormItemValueList as
|
|
2
|
+
import { isUndefined as S, isArray as $, isString as x, isBoolean as A, isNumber as M, pick as R } from "lodash-unified";
|
|
3
|
+
import { valueEnumToArray as V, objectToString as j, getTableTitle as c, getTableRenderType as q, getTableRenderProps as B, getTableCellRenderNode as W } from "../../ap-table/utils.mjs";
|
|
4
|
+
import { noRenderAsFormItemValueList as _ } from "../../ap-table/constants.mjs";
|
|
5
5
|
import "../../ap-table/components/paragraph-ellipsis/index.vue.mjs";
|
|
6
|
-
import
|
|
7
|
-
function
|
|
6
|
+
import k from "../../ap-table/components/paragraph-ellipsis/index.vue2.mjs";
|
|
7
|
+
function N(e) {
|
|
8
8
|
if (!S(e))
|
|
9
9
|
return $(e) ? e.reduce((r, i) => x(i) ? `${r}.${i}` : `${r}[${i}]`, "") : String(e);
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function b(e) {
|
|
12
12
|
if (e)
|
|
13
13
|
return e === !0 ? "left" : e;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return
|
|
15
|
+
function z(e) {
|
|
16
|
+
return A(e) ? {
|
|
17
17
|
sortable: e
|
|
18
18
|
} : e ? {
|
|
19
19
|
sortable: !0,
|
|
@@ -23,18 +23,18 @@ function G(e) {
|
|
|
23
23
|
sortable: !1
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function G(e) {
|
|
27
27
|
let r;
|
|
28
|
-
return
|
|
28
|
+
return A(e.filters) && e.valueEnum ? r = V(e.valueEnum) : r = e.filters, r == null ? void 0 : r.map((i) => ({
|
|
29
29
|
label: x(i.text) ? i.text : "",
|
|
30
30
|
value: i.value
|
|
31
31
|
}));
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function I(e) {
|
|
34
34
|
if (e)
|
|
35
35
|
return (r) => e(r.value, r.row);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function L(e, r) {
|
|
38
38
|
return e ? M(e) ? {
|
|
39
39
|
tooltip: r,
|
|
40
40
|
rows: e
|
|
@@ -47,12 +47,12 @@ function U(e, r) {
|
|
|
47
47
|
htmlTitle: e === "title" ? r : ""
|
|
48
48
|
} : !1;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
if (
|
|
50
|
+
function U(e, r, i) {
|
|
51
|
+
if (_.includes(e.valueType))
|
|
52
52
|
return i;
|
|
53
53
|
if (e.copyable || e.ellipsis) {
|
|
54
|
-
const l =
|
|
55
|
-
return v(
|
|
54
|
+
const l = L(e.ellipsis, r), t = j(r);
|
|
55
|
+
return v(k, {
|
|
56
56
|
rawValue: t,
|
|
57
57
|
copyable: e.copyable,
|
|
58
58
|
ellipsis: l,
|
|
@@ -62,63 +62,63 @@ function q(e, r, i) {
|
|
|
62
62
|
return i;
|
|
63
63
|
}
|
|
64
64
|
function y(e, r, i) {
|
|
65
|
-
const l =
|
|
66
|
-
return l.field =
|
|
67
|
-
header: () =>
|
|
65
|
+
const l = R(e, ["width", "minWidth", "align"]);
|
|
66
|
+
return l.field = N(e.dataIndex), l.fixed = b(e.fixed), l.slots = {
|
|
67
|
+
header: () => c(e, i, void 0, r)
|
|
68
68
|
}, l.headerAlign = e.align, l.showOverflow = !1, l.showFooterOverflow = !1, l;
|
|
69
69
|
}
|
|
70
70
|
function F(e, r, i, l) {
|
|
71
|
-
const t =
|
|
72
|
-
t.field =
|
|
71
|
+
const t = R(e, ["width", "minWidth", "align", "resizable", "className", "headerClassName", "footerClassName", "treeNode"]);
|
|
72
|
+
t.field = N(e.dataIndex), t.fixed = b(e.fixed), t.headerAlign = e.align, t.footerAlign = e.align, t.showOverflow = !1, t.showFooterOverflow = !1, Object.assign(t, z(e.sorter)), t.filters = G(e), t.filterMultiple = e.filterMultiple, t.filterMethod = I(e.onFilter);
|
|
73
73
|
const f = ({
|
|
74
|
-
value:
|
|
74
|
+
value: d,
|
|
75
75
|
...s
|
|
76
76
|
}) => {
|
|
77
77
|
var o, T;
|
|
78
|
-
const a =
|
|
78
|
+
const a = q(e), u = B({
|
|
79
79
|
...e,
|
|
80
80
|
valueType: a
|
|
81
81
|
}, {
|
|
82
|
-
value:
|
|
82
|
+
value: d,
|
|
83
83
|
...s
|
|
84
|
-
}),
|
|
85
|
-
value:
|
|
84
|
+
}), w = W(a, u, s.record, l), h = ((o = e.renderText) == null ? void 0 : o.call(e, {
|
|
85
|
+
value: d,
|
|
86
86
|
...s
|
|
87
|
-
})) ||
|
|
88
|
-
value:
|
|
87
|
+
})) || d, E = e.renderText ? v(O, null, [(T = e.renderText) == null ? void 0 : T.call(e, {
|
|
88
|
+
value: d,
|
|
89
89
|
...s
|
|
90
|
-
})]) :
|
|
91
|
-
let p =
|
|
90
|
+
})]) : w;
|
|
91
|
+
let p = U(e, h, E);
|
|
92
92
|
return e.customRender && (p = e.customRender({
|
|
93
|
-
value:
|
|
93
|
+
value: d,
|
|
94
94
|
...s,
|
|
95
95
|
column: e,
|
|
96
96
|
originalNode: p,
|
|
97
97
|
originalText: h
|
|
98
98
|
})), p;
|
|
99
|
-
},
|
|
100
|
-
row:
|
|
99
|
+
}, n = ({
|
|
100
|
+
row: d,
|
|
101
101
|
rowIndex: s
|
|
102
102
|
}) => f({
|
|
103
|
-
value:
|
|
104
|
-
text:
|
|
105
|
-
record:
|
|
103
|
+
value: d[t.field],
|
|
104
|
+
text: d[t.field],
|
|
105
|
+
record: d,
|
|
106
106
|
index: s,
|
|
107
107
|
renderIndex: s,
|
|
108
108
|
column: e
|
|
109
109
|
});
|
|
110
110
|
return t.slots = {
|
|
111
|
-
header: () =>
|
|
112
|
-
default:
|
|
113
|
-
footer:
|
|
114
|
-
}, e.html && (delete t.slots.default, delete t.slots.footer, t.type = "html"), t;
|
|
111
|
+
header: () => c(e, i, void 0, r),
|
|
112
|
+
default: n,
|
|
113
|
+
footer: n
|
|
114
|
+
}, e.html && (delete t.slots.default, delete t.slots.footer, t.type = "html"), e.seq && (t.type = "seq", t.slots = {}), t;
|
|
115
115
|
}
|
|
116
116
|
function Y(e, r, i, l) {
|
|
117
|
-
var
|
|
118
|
-
if (!((
|
|
117
|
+
var n;
|
|
118
|
+
if (!((n = e.children) != null && n.length))
|
|
119
119
|
return F(e, r, i, l);
|
|
120
|
-
function t(
|
|
121
|
-
return
|
|
120
|
+
function t(d) {
|
|
121
|
+
return d.map((s) => {
|
|
122
122
|
var a;
|
|
123
123
|
if ((a = s.children) != null && a.length) {
|
|
124
124
|
const u = y(s, r, i);
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { createVNode as
|
|
1
|
+
import { createVNode as l } from "vue";
|
|
2
2
|
import { VxeColumn as u, VxeColgroup as p } from "vxe-table";
|
|
3
|
-
import { transformCol as
|
|
3
|
+
import { transformCol as s } from "./col.mjs";
|
|
4
4
|
function n(r) {
|
|
5
5
|
var e;
|
|
6
|
-
return (e = r.children) != null && e.length ?
|
|
6
|
+
return (e = r.children) != null && e.length ? l(p, r, {
|
|
7
7
|
...r.slots || {},
|
|
8
8
|
default: () => {
|
|
9
|
-
var
|
|
10
|
-
return (
|
|
9
|
+
var o;
|
|
10
|
+
return (o = r.children) == null ? void 0 : o.map((t) => n(t));
|
|
11
11
|
}
|
|
12
|
-
}) :
|
|
12
|
+
}) : (console.log("config", r), l(u, r, {
|
|
13
13
|
...r.slots || {}
|
|
14
|
-
});
|
|
14
|
+
}));
|
|
15
15
|
}
|
|
16
|
-
function C(r, e,
|
|
17
|
-
return r.map((
|
|
16
|
+
function C(r, e, o, t) {
|
|
17
|
+
return r.map((m) => n(s(m, e, o, t)));
|
|
18
18
|
}
|
|
19
19
|
export {
|
|
20
20
|
C as renderWithColumns
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { omit as
|
|
1
|
+
import { omit as d, isUndefined as s, isFunction as c, isNumber as C } from "lodash-unified";
|
|
2
2
|
import { isDef as m } from "../../utils/index.mjs";
|
|
3
|
-
const
|
|
3
|
+
const g = 20, w = 50, b = (e) => e.some((t) => !!t.html);
|
|
4
4
|
function R(e) {
|
|
5
5
|
var n;
|
|
6
6
|
const t = {
|
|
7
|
-
...
|
|
7
|
+
...d(e, [
|
|
8
8
|
"columns",
|
|
9
9
|
"request",
|
|
10
10
|
"searchForm",
|
|
@@ -18,7 +18,7 @@ function R(e) {
|
|
|
18
18
|
isHover: !0,
|
|
19
19
|
keyField: e.rowKey,
|
|
20
20
|
isCurrent: !!e.rowHighlightable
|
|
21
|
-
}, t.columnConfig = {},
|
|
21
|
+
}, t.columnConfig = {}, b(e.columns || []) && (t.rowConfig.useKey = !0, t.columnConfig.useKey = !0), e.adaptive && (t.autoResize = !0, t.height = "100%"), e.columnResizable && (t.columnConfig.resizable = !0), e.rowSelection) {
|
|
22
22
|
const o = e.rowSelection === !0 ? {} : e.rowSelection;
|
|
23
23
|
o.type === "radio" ? t.radioConfig = {
|
|
24
24
|
highlight: !0,
|
|
@@ -42,7 +42,7 @@ function R(e) {
|
|
|
42
42
|
range: o.range || !1
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
return t.border = e.bordered === !1 ? "inner" : !0, e.expandable && (t.expandConfig =
|
|
45
|
+
return t.border = e.bordered === !1 ? "inner" : !0, e.expandable && (t.expandConfig = d(e.expandable, [
|
|
46
46
|
"renderContent",
|
|
47
47
|
"width",
|
|
48
48
|
"title"
|
|
@@ -50,15 +50,21 @@ function R(e) {
|
|
|
50
50
|
enabled: !1
|
|
51
51
|
}, t.virtualYConfig = {
|
|
52
52
|
enabled: !1
|
|
53
|
-
}) : (
|
|
53
|
+
}) : (f(t, "X", e.virtual), f(t, "Y", e.virtual)), t.round = m(e.round) ? e.round : !e.card, e.virtual !== !1 && (t.headerCellConfig = {
|
|
54
54
|
height: 36,
|
|
55
55
|
...t.headerCellConfig || {}
|
|
56
|
+
}), t.treeConfig && (t.treeConfig = {
|
|
57
|
+
...t.treeConfig || {},
|
|
58
|
+
/**
|
|
59
|
+
* 使用非树层级列表,配合transform
|
|
60
|
+
*/
|
|
61
|
+
transform: !0
|
|
56
62
|
}), t;
|
|
57
63
|
}
|
|
58
|
-
function
|
|
59
|
-
const n = t === "X", o = n ? "x" : "y", r = n ? "virtualXConfig" : "virtualYConfig", l = i == null ? void 0 : i[o],
|
|
64
|
+
function f(e, t, i) {
|
|
65
|
+
const n = t === "X", o = n ? "x" : "y", r = n ? "virtualXConfig" : "virtualYConfig", l = i == null ? void 0 : i[o], a = l !== !1, u = n ? g : w, h = C(l) && l >= 0 ? l : u;
|
|
60
66
|
e[r] = {
|
|
61
|
-
enabled:
|
|
67
|
+
enabled: a,
|
|
62
68
|
gt: h,
|
|
63
69
|
oSize: (i == null ? void 0 : i.oSize) || 0
|
|
64
70
|
};
|