@aplus-frontend/ui 0.5.3 → 0.5.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.
- package/es/index.mjs +37 -33
- package/es/src/ap-action/group/index.vue.mjs +3 -3
- package/es/src/ap-action/item/index.vue2.mjs +5 -5
- package/es/src/ap-action/item-dropdown/index.vue.mjs +7 -7
- package/es/src/ap-action/item-modal/index.vue.mjs +2 -2
- package/es/src/ap-action/item-popconfirm/index.vue.mjs +2 -2
- package/es/src/ap-button/ap-action-button.vue.mjs +2 -2
- package/es/src/ap-button/ap-button.vue.mjs +2 -2
- package/es/src/ap-button/ap-confirm-button.vue.mjs +2 -2
- package/es/src/ap-descriptions/ap-descriptions.vue.mjs +3 -3
- package/es/src/ap-descriptions/help-message/index.vue2.mjs +4 -4
- package/es/src/ap-download/ap-download.vue.mjs +1 -1
- package/es/src/ap-field/checkbox/index.vue.mjs +1 -1
- package/es/src/ap-field/date/index.vue.mjs +4 -4
- package/es/src/ap-field/date-range/index.vue.mjs +8 -8
- package/es/src/ap-field/index.mjs +30 -30
- package/es/src/ap-field/number/index.vue.mjs +8 -8
- package/es/src/ap-field/radio/index.vue.mjs +1 -1
- package/es/src/ap-field/rate/index.vue.mjs +2 -2
- package/es/src/ap-field/segmented/index.vue.mjs +1 -1
- package/es/src/ap-field/select/index.vue.mjs +2 -2
- package/es/src/ap-field/slider/index.vue.mjs +4 -4
- package/es/src/ap-field/switch/index.vue.mjs +3 -3
- package/es/src/ap-field/text/index.vue2.mjs +13 -13
- package/es/src/ap-field/text/password.vue.mjs +2 -2
- package/es/src/ap-field/text-area/index.vue.mjs +3 -3
- package/es/src/ap-form/ap-form.vue2.mjs +2 -2
- package/es/src/ap-form/drawer-form/index.vue.mjs +9 -9
- package/es/src/ap-form/item/index.vue.mjs +7 -7
- package/es/src/ap-form/item-group/index.vue.mjs +3 -3
- package/es/src/ap-form/items/checkbox/index.vue.mjs +2 -2
- package/es/src/ap-form/items/date/index.vue.mjs +2 -2
- package/es/src/ap-form/items/date-range/index.vue.mjs +2 -2
- package/es/src/ap-form/items/number/index.vue.mjs +2 -2
- package/es/src/ap-form/items/radio/index.vue.mjs +2 -2
- package/es/src/ap-form/items/select/index.vue.mjs +2 -2
- package/es/src/ap-form/items/switch/index.vue.mjs +2 -2
- package/es/src/ap-form/items/text/group.vue2.mjs +2 -2
- package/es/src/ap-form/items/text/index.vue2.mjs +2 -2
- package/es/src/ap-form/items/text/password.vue.mjs +2 -2
- package/es/src/ap-form/items/text-area/index.vue.mjs +2 -2
- package/es/src/ap-form/modal-form/index.vue.mjs +7 -7
- package/es/src/ap-form/render/item.vue.mjs +2 -2
- package/es/src/ap-form/search-form/index.vue.mjs +1 -1
- package/es/src/ap-form/set/index.vue.mjs +1 -1
- package/es/src/ap-grid/editable/form-item.vue.d.ts +16 -0
- package/es/src/ap-grid/editable/form-item.vue.mjs +257 -0
- package/es/src/ap-grid/editable/form-item.vue2.mjs +4 -0
- package/es/src/ap-grid/editable/index.vue.d.ts +18 -0
- package/es/src/ap-grid/editable/index.vue.mjs +288 -0
- package/es/src/ap-grid/editable/index.vue2.mjs +4 -0
- package/es/src/ap-grid/editable/interface.d.ts +95 -0
- package/es/src/ap-grid/editable/interface.mjs +1 -0
- package/es/src/ap-grid/editable/style/css.d.ts +0 -0
- package/es/src/ap-grid/editable/style/css.js +1 -0
- package/es/src/ap-grid/editable/style/index.d.ts +0 -0
- package/es/src/ap-grid/editable/style/index.js +1 -0
- package/es/src/ap-grid/hooks/use-editable-columns.d.ts +6 -0
- package/es/src/ap-grid/hooks/use-editable-columns.mjs +68 -0
- package/es/src/ap-grid/hooks/use-inner-params.mjs +3 -3
- package/es/src/ap-grid/index.d.ts +4 -1
- package/es/src/ap-grid/index.mjs +3 -0
- package/es/src/ap-grid/index.vue.mjs +113 -103
- package/es/src/ap-grid/interface.d.ts +15 -0
- package/es/src/ap-grid/utils/col.mjs +39 -39
- package/es/src/ap-grid/utils/editable.d.ts +3 -0
- package/es/src/ap-grid/utils/editable.mjs +27 -0
- package/es/src/ap-grid/utils/table.mjs +24 -17
- package/es/src/ap-info-layout/ApInfoLayout.vue.mjs +2 -2
- package/es/src/ap-info-layout/ap-info-layout-admin/ApInfoLayoutAdmin.vue2.mjs +2 -2
- package/es/src/ap-info-layout/ap-info-layout-aplus/ap-info-layout.vue2.mjs +1 -1
- package/es/src/ap-list/index.vue.mjs +4 -4
- package/es/src/ap-table/ap-table.vue2.mjs +26 -26
- package/es/src/ap-table/components/dynamic-component/index.vue2.mjs +2 -2
- package/es/src/ap-table/components/index/index.vue2.mjs +2 -2
- package/es/src/ap-table/components/paragraph-ellipsis/index.vue2.mjs +3 -3
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +3 -3
- package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +1 -1
- package/es/src/ap-table/components/setting/sortable/index.vue2.mjs +1 -1
- package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +1 -1
- package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +11 -11
- package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +1 -1
- package/es/src/ap-table/components/status/index.vue2.mjs +2 -2
- package/es/src/ap-table/constants.mjs +40 -40
- package/es/src/ap-table/hooks/use-table-column-state.mjs +3 -3
- package/es/src/ap-tag/ap-tag-group.vue.mjs +8 -8
- package/es/src/ap-tag/ap-tag.vue.mjs +2 -2
- package/es/src/ap-upload/apUpload.vue.mjs +5 -5
- package/es/src/ap-upload/components/MultipleFile.vue2.mjs +3 -3
- package/es/src/ap-upload/components/Picture.vue2.mjs +6 -6
- package/es/src/ap-upload/components/SingleFile.vue2.mjs +7 -7
- package/es/src/business/ap-appendix/ap-appendix.vue2.mjs +1 -1
- package/es/src/business/ap-appendix/icons/file-icon.vue.mjs +2 -2
- package/es/src/business/ap-batch-action/ApBatchAction.vue2.mjs +2 -2
- package/es/src/business/ap-batch-action-group/ApBatchActionGroup.vue2.mjs +10 -10
- package/es/src/business/ap-batch-action-group/MenuItemGroup.vue2.mjs +1 -1
- package/es/src/business/ap-button-group/ApButtonGroup.vue2.mjs +1 -1
- package/es/src/business/ap-card/ApCard.vue2.mjs +7 -7
- package/es/src/business/ap-expand-alert/ApExpandAlert.vue2.mjs +11 -11
- package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +9 -9
- package/es/src/business/ap-group-search/ap-group-search.vue2.mjs +5 -5
- package/es/src/business/ap-group-search/extension-select/index.vue2.mjs +4 -4
- package/es/src/business/ap-group-search/images/icon-down.vue.mjs +2 -2
- package/es/src/business/ap-group-search/images/icon-line-select.vue.mjs +2 -2
- package/es/src/business/ap-group-search/popover-select/index.vue2.mjs +2 -2
- package/es/src/business/ap-image/ApImage.vue2.mjs +1 -1
- package/es/src/business/ap-input-radio/ApInputRadio.vue2.mjs +2 -2
- package/es/src/business/ap-ladder/ApLadder.vue2.mjs +1 -1
- package/es/src/business/ap-ladder/HelpMessageIcon.vue2.mjs +1 -1
- package/es/src/business/ap-select-layout/select-layout.vue2.mjs +4 -4
- package/es/src/business/ap-status/ApStatus.vue2.mjs +8 -8
- package/es/src/business/ap-status/group/ApStatusGroup.vue2.mjs +4 -4
- package/es/src/business/ap-summary/ap-summary.vue2.mjs +1 -1
- package/es/src/business/ap-table-modal/modal-title.vue2.mjs +2 -2
- package/es/src/business/ap-table-modal/table-layout/index.vue2.mjs +14 -14
- package/es/src/business/ap-table-modal/table-modal.vue2.mjs +3 -3
- package/es/src/business/ap-title/ApTitle.vue2.mjs +7 -7
- package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs +1 -1
- package/es/src/business/ap-upload-file/icon/delete-icon.vue.mjs +2 -2
- package/es/src/business/ap-upload-file/icon/file-icon.vue.mjs +2 -2
- package/es/src/business/batch-input-group/form-item.vue.mjs +2 -2
- package/es/src/business/batch-input-group/index.vue.mjs +7 -6
- package/es/src/business/batch-input-group/popover-input/index.vue2.mjs +2 -2
- package/es/src/check-card/index.vue2.mjs +3 -3
- package/es/src/config-provider/config-provider-props.mjs +1 -1
- package/es/src/editable-table/form-item.vue.mjs +2 -2
- package/es/src/editable-table/index.vue.mjs +2 -2
- package/es/src/editable-table/utils.d.ts +3 -2
- package/es/src/full-screen/index.vue.mjs +3 -3
- package/es/src/hooks/useFullScreen.mjs +5 -5
- package/es/src/index.mjs +24 -20
- package/es/src/path-map.mjs +3 -1
- package/es/src/portal/index.vue.mjs +2 -2
- package/es/src/scroll-bar/index.vue.mjs +3 -3
- package/es/src/scroll-bar/internal.vue.mjs +2 -2
- package/es/src/scroll-view/index.vue.mjs +9 -9
- package/es/src/work-order-modal/help-message.vue2.mjs +2 -2
- package/es/src/work-order-modal/work-order-modal.vue.mjs +2 -2
- package/lib/index.js +1 -1
- package/lib/src/ap-action/item-dropdown/index.vue.js +1 -1
- package/lib/src/ap-field/index.js +1 -1
- package/lib/src/ap-field/text/index.vue2.js +1 -1
- package/lib/src/ap-grid/editable/form-item.vue.d.ts +16 -0
- package/lib/src/ap-grid/editable/form-item.vue.js +1 -0
- package/lib/src/ap-grid/editable/form-item.vue2.js +1 -0
- package/lib/src/ap-grid/editable/index.vue.d.ts +18 -0
- package/lib/src/ap-grid/editable/index.vue.js +1 -0
- package/lib/src/ap-grid/editable/index.vue2.js +1 -0
- package/lib/src/ap-grid/editable/interface.d.ts +95 -0
- package/lib/src/ap-grid/editable/interface.js +1 -0
- package/lib/src/ap-grid/editable/style/css.cjs +1 -0
- package/lib/src/ap-grid/editable/style/css.d.ts +0 -0
- package/lib/src/ap-grid/editable/style/index.cjs +1 -0
- package/lib/src/ap-grid/editable/style/index.d.ts +0 -0
- package/lib/src/ap-grid/hooks/use-editable-columns.d.ts +6 -0
- package/lib/src/ap-grid/hooks/use-editable-columns.js +1 -0
- package/lib/src/ap-grid/index.d.ts +4 -1
- 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 +15 -0
- package/lib/src/ap-grid/utils/col.js +1 -1
- package/lib/src/ap-grid/utils/editable.d.ts +3 -0
- package/lib/src/ap-grid/utils/editable.js +1 -0
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/constants.js +1 -1
- package/lib/src/ap-upload/apUpload.vue.js +1 -1
- package/lib/src/business/batch-input-group/index.vue.js +2 -2
- package/lib/src/config-provider/config-provider-props.js +1 -1
- package/lib/src/editable-table/utils.d.ts +3 -2
- package/lib/src/index.js +1 -1
- package/lib/src/path-map.js +1 -1
- package/package.json +1 -1
- package/theme/ap-grid/editable.css +22 -0
- package/theme/ap-grid/editable.less +28 -0
- package/theme/index.css +22 -0
- package/theme/index.less +1 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { useSlots as E, computed as R, unref as m } from "vue";
|
|
2
|
+
import { isFunction as T, isArray as s } from "lodash-unified";
|
|
3
|
+
import { getEditableTableTitle as k, mergeClass as A } from "../../editable-table/utils.mjs";
|
|
4
|
+
import { updateFormProps as q, getFieldProps as v } from "../../ap-table/utils.mjs";
|
|
5
|
+
import "../../config-provider/index.mjs";
|
|
6
|
+
import { useToken as w } from "@aplus-frontend/antdv/es/theme/internal";
|
|
7
|
+
import { getFinalEditableNode as G } from "../utils/editable.mjs";
|
|
8
|
+
import { useNamespace as S } from "../../config-provider/hooks/use-namespace.mjs";
|
|
9
|
+
const M = (n, f) => {
|
|
10
|
+
const {
|
|
11
|
+
em: b,
|
|
12
|
+
be: x
|
|
13
|
+
} = S("editable-grid"), g = E(), [, h] = w();
|
|
14
|
+
return R(() => {
|
|
15
|
+
const l = n.columns;
|
|
16
|
+
if (!l)
|
|
17
|
+
return [];
|
|
18
|
+
function o(C) {
|
|
19
|
+
return C.map((e) => ({
|
|
20
|
+
...e,
|
|
21
|
+
children: o(e.children || []),
|
|
22
|
+
title: k(e, x("table-header", "title"), b("header-cell", "required"), g.headerCell, m(h).colorPrimary),
|
|
23
|
+
// tips: 已经处理了title,传递tooltip为undefined不会再内部处理
|
|
24
|
+
tooltip: void 0,
|
|
25
|
+
customRender({
|
|
26
|
+
value: r,
|
|
27
|
+
originalNode: F,
|
|
28
|
+
...a
|
|
29
|
+
}) {
|
|
30
|
+
const i = T(e.editable) ? e.editable(a.text, a.record, a.index) : !!e.editable;
|
|
31
|
+
let d = F;
|
|
32
|
+
if (i) {
|
|
33
|
+
const t = q(e, v(e.fieldProps, {
|
|
34
|
+
value: r,
|
|
35
|
+
...a
|
|
36
|
+
})), c = {};
|
|
37
|
+
n.onFieldChange && (c[`onUpdate:${t.valuePropName || "value"}`] = (y) => {
|
|
38
|
+
var u;
|
|
39
|
+
return (u = n.onFieldChange) == null ? void 0 : u.call(n, a.index, e.dataIndex, y);
|
|
40
|
+
});
|
|
41
|
+
const N = s(e.dataIndex) ? e.dataIndex : [e.dataIndex], I = {
|
|
42
|
+
name: [...s(n.name) ? n.name : [n.name], a.index, ...N],
|
|
43
|
+
...t || {},
|
|
44
|
+
field: {
|
|
45
|
+
style: "width: 100%",
|
|
46
|
+
...(t == null ? void 0 : t.field) || {},
|
|
47
|
+
...c,
|
|
48
|
+
class: A("is-editable", t.class)
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
d = G(e, I, a.record, m(f));
|
|
52
|
+
}
|
|
53
|
+
return e.customRender ? e.customRender({
|
|
54
|
+
value: r,
|
|
55
|
+
...a,
|
|
56
|
+
editable: i,
|
|
57
|
+
originalNode: d
|
|
58
|
+
}) : d;
|
|
59
|
+
}
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
62
|
+
return o(l);
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
export {
|
|
66
|
+
M as default,
|
|
67
|
+
M as useGetEditableColumns
|
|
68
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DEFAULT_PAGE_SIZE as g, DEFAULT_CURRENT as E } from "../../ap-table/hooks/use-table-paging-ng.mjs";
|
|
2
2
|
const a = {
|
|
3
3
|
asc: "ascend",
|
|
4
4
|
desc: "descend"
|
|
@@ -6,8 +6,8 @@ const a = {
|
|
|
6
6
|
const t = {};
|
|
7
7
|
let c = {};
|
|
8
8
|
const s = {
|
|
9
|
-
current:
|
|
10
|
-
pageSize:
|
|
9
|
+
current: E,
|
|
10
|
+
pageSize: g
|
|
11
11
|
};
|
|
12
12
|
function i(n) {
|
|
13
13
|
o == null || o(s, c, t, {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { default as ApGrid } from './index.vue';
|
|
2
|
-
|
|
2
|
+
import { default as EditableGrid } from './editable/index.vue';
|
|
3
|
+
import { default as EditableGridFormItem } from './editable/form-item.vue';
|
|
4
|
+
export { ApGrid, EditableGrid, EditableGridFormItem };
|
|
3
5
|
export * from './interface';
|
|
6
|
+
export * from './editable/interface';
|
package/es/src/ap-grid/index.mjs
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { defineComponent as Ce, useSlots as be, ref as x, computed as n, unref as o, watch as E, openBlock as s,
|
|
2
|
-
import { VxeTable as
|
|
3
|
-
import { isUndefined as F, omit as
|
|
4
|
-
import { ApForm as
|
|
1
|
+
import { defineComponent as Ce, useSlots as be, ref as x, computed as n, unref as o, watch as E, createElementBlock as R, openBlock as s, normalizeStyle as N, normalizeClass as f, createCommentVNode as w, createElementVNode as k, createVNode as q, mergeProps as g, createSlots as _, withCtx as v, Fragment as G, renderList as z, createBlock as u, resolveDynamicComponent as T, renderSlot as A, normalizeProps as Se, guardReactiveProps as xe } from "vue";
|
|
2
|
+
import { VxeTable as Re, VxeColumn as U } from "vxe-table";
|
|
3
|
+
import { isUndefined as F, omit as ke } from "lodash-unified";
|
|
4
|
+
import { ApForm as Fe } from "../ap-form/index.mjs";
|
|
5
5
|
import "../config-provider/index.mjs";
|
|
6
|
-
import { noRenderAsFormItemValueList as
|
|
7
|
-
import { getColumnOrder as J, updateFormProps as
|
|
8
|
-
import { useTablePaging as
|
|
9
|
-
import { Empty as X, Pagination as
|
|
10
|
-
import { useInnerParams as
|
|
11
|
-
import { toVxeProps as Ae, getRowExpandProps as
|
|
12
|
-
import
|
|
13
|
-
import { useProvideApTable as
|
|
14
|
-
import {
|
|
15
|
-
import { useRenderColumns as
|
|
16
|
-
import { useToken as
|
|
6
|
+
import { noRenderAsFormItemValueList as Be } from "../ap-table/constants.mjs";
|
|
7
|
+
import { getColumnOrder as J, updateFormProps as Pe, getFieldProps as Ie, getSearchFormItemRenderNode as Ee, recursionApColumns as Q } from "../ap-table/utils.mjs";
|
|
8
|
+
import { useTablePaging as Ne } from "../ap-table/hooks/use-table-paging-ng.mjs";
|
|
9
|
+
import { Empty as X, Pagination as ze } from "@aplus-frontend/antdv";
|
|
10
|
+
import { useInnerParams as Te } from "./hooks/use-inner-params.mjs";
|
|
11
|
+
import { toVxeProps as Ae, getRowExpandProps as Ve, getRowSelectionProps as Oe } from "./utils/table.mjs";
|
|
12
|
+
import Ke from "../ap-table/hooks/use-table-row-selection.mjs";
|
|
13
|
+
import { useProvideApTable as De } from "../ap-table/context.mjs";
|
|
14
|
+
import { sizeReverseMap as Le, sizeMap as $e } from "./constants.mjs";
|
|
15
|
+
import { useRenderColumns as je } from "./hooks/use-render-columns.mjs";
|
|
16
|
+
import { useToken as He } from "@aplus-frontend/antdv/es/theme/internal";
|
|
17
17
|
import "../scroll-bar/index.mjs";
|
|
18
|
-
import { useLoadVxe as
|
|
19
|
-
import { useNamespace as
|
|
20
|
-
import { useGlobalConfig as
|
|
18
|
+
import { useLoadVxe as We } from "./hooks/use-load-vxe.mjs";
|
|
19
|
+
import { useNamespace as Me } from "../config-provider/hooks/use-namespace.mjs";
|
|
20
|
+
import { useGlobalConfig as qe } from "../config-provider/hooks/use-global-config.mjs";
|
|
21
21
|
import _e from "../scroll-bar/index.vue.mjs";
|
|
22
|
-
const
|
|
22
|
+
const vo = /* @__PURE__ */ Ce({
|
|
23
23
|
name: "ApGrid",
|
|
24
24
|
__name: "index",
|
|
25
25
|
props: {
|
|
@@ -92,6 +92,7 @@ const go = /* @__PURE__ */ Ce({
|
|
|
92
92
|
pagination: { type: [Boolean, Object], default: void 0 },
|
|
93
93
|
searchFormWrapperStyle: {},
|
|
94
94
|
tableWrapperStyle: {},
|
|
95
|
+
wrapperStyle: {},
|
|
95
96
|
manual: { type: Boolean, default: !1 },
|
|
96
97
|
size: { default: void 0 },
|
|
97
98
|
adaptive: { type: Boolean, default: !1 },
|
|
@@ -99,65 +100,66 @@ const go = /* @__PURE__ */ Ce({
|
|
|
99
100
|
rowKey: { default: "key" },
|
|
100
101
|
footer: {},
|
|
101
102
|
virtual: { type: [Boolean, Object], default: void 0 },
|
|
102
|
-
expandable: {}
|
|
103
|
+
expandable: {},
|
|
104
|
+
value: {}
|
|
103
105
|
},
|
|
104
106
|
setup(Y, { expose: Z }) {
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
const d = x([]),
|
|
108
|
-
let
|
|
107
|
+
const V = be(), a = Y, { e: B, b: i, be: ee } = Me("ap-grid"), oe = qe("valueTypeMap");
|
|
108
|
+
We();
|
|
109
|
+
const d = x([]), O = x([]), p = x(), C = x(a.size), [, m] = He(), { renderConfig: ae, updateSignal: re } = je(d);
|
|
110
|
+
let K = 0;
|
|
109
111
|
const te = n(() => {
|
|
110
112
|
if (p.value)
|
|
111
113
|
return p.value.$el.querySelector(
|
|
112
114
|
".vxe-table--header-inner-wrapper"
|
|
113
115
|
);
|
|
114
|
-
}),
|
|
116
|
+
}), D = n(() => {
|
|
115
117
|
var e, l, t;
|
|
116
|
-
return
|
|
117
|
-
(r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !
|
|
118
|
+
return K++, ((t = (l = (e = a.columns) == null ? void 0 : e.filter(
|
|
119
|
+
(r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !Be.includes(r.valueType)
|
|
118
120
|
)) == null ? void 0 : l.sort((r, c) => {
|
|
119
|
-
let
|
|
120
|
-
return J(c.order) -
|
|
121
|
+
let y = J(r.order);
|
|
122
|
+
return J(c.order) - y;
|
|
121
123
|
})) == null ? void 0 : t.map((r) => {
|
|
122
|
-
const c =
|
|
124
|
+
const c = Pe(
|
|
123
125
|
r,
|
|
124
|
-
|
|
125
|
-
),
|
|
126
|
+
Ie(r.fieldProps, {})
|
|
127
|
+
), y = {
|
|
126
128
|
...r,
|
|
127
129
|
fieldProps: {
|
|
128
130
|
label: r.title,
|
|
129
131
|
name: r.dataIndex,
|
|
130
132
|
...c || {},
|
|
131
|
-
_signal:
|
|
133
|
+
_signal: K
|
|
132
134
|
},
|
|
133
135
|
renderNode: void 0
|
|
134
136
|
};
|
|
135
|
-
return
|
|
136
|
-
|
|
137
|
+
return y.renderNode = Ee(
|
|
138
|
+
y,
|
|
137
139
|
o(oe)
|
|
138
|
-
),
|
|
140
|
+
), y;
|
|
139
141
|
})) || [];
|
|
140
142
|
}), le = n(() => [
|
|
141
143
|
i(),
|
|
142
144
|
a.card ? null : i("wrapper"),
|
|
143
145
|
a.adaptive ? i("adaptive") : null,
|
|
144
146
|
a.sticky ? i("sticky") : null
|
|
145
|
-
].filter(Boolean)),
|
|
147
|
+
].filter(Boolean)), L = n(() => Q(o(d), (e) => {
|
|
146
148
|
if (e.sorter === !0)
|
|
147
149
|
return e.key || e.dataIndex;
|
|
148
|
-
}).filter(Boolean)),
|
|
150
|
+
}).filter(Boolean)), $ = n(() => Q(o(d), (e) => {
|
|
149
151
|
if (e.filters && !e.onFilter)
|
|
150
152
|
return e.key || e.dataIndex;
|
|
151
153
|
}).filter(Boolean)), {
|
|
152
154
|
formRef: P,
|
|
153
|
-
submit:
|
|
154
|
-
reset:
|
|
155
|
+
submit: j,
|
|
156
|
+
reset: H,
|
|
155
157
|
refresh: ne,
|
|
156
|
-
data:
|
|
158
|
+
data: h,
|
|
157
159
|
tableProps: se,
|
|
158
160
|
setDataSource: de,
|
|
159
161
|
handleTableChange: ie
|
|
160
|
-
} =
|
|
162
|
+
} = Ne({
|
|
161
163
|
async request(e) {
|
|
162
164
|
var t;
|
|
163
165
|
if (!S.value.preserveSelectedRowKeys && F(a.dataSource) && I(), !F(a.dataSource)) {
|
|
@@ -174,18 +176,18 @@ const go = /* @__PURE__ */ Ce({
|
|
|
174
176
|
};
|
|
175
177
|
},
|
|
176
178
|
namespace: "ap-grid",
|
|
177
|
-
filterFields:
|
|
178
|
-
sortFields:
|
|
179
|
+
filterFields: $,
|
|
180
|
+
sortFields: L,
|
|
179
181
|
defaultParams: a.params,
|
|
180
182
|
defaultData: a.defaultData,
|
|
181
183
|
manual: a.manual,
|
|
182
184
|
formatParams: a.beforeSearchSubmit,
|
|
183
185
|
pagination: a.pagination
|
|
184
|
-
}), { sortChangeEvent: ce, filterChangeEvent: ue, paginationChangeEvent: pe } =
|
|
185
|
-
|
|
186
|
+
}), { sortChangeEvent: ce, filterChangeEvent: ue, paginationChangeEvent: pe } = Te(ie);
|
|
187
|
+
De({
|
|
186
188
|
columns: n(() => d.value),
|
|
187
|
-
columnsBackup: n(() =>
|
|
188
|
-
size: n(() => C.value ?
|
|
189
|
+
columnsBackup: n(() => O.value),
|
|
190
|
+
size: n(() => C.value ? $e[C.value] : "middle"),
|
|
189
191
|
updateColumns(e) {
|
|
190
192
|
d.value = e;
|
|
191
193
|
},
|
|
@@ -197,31 +199,31 @@ const go = /* @__PURE__ */ Ce({
|
|
|
197
199
|
color: m.value.colorPrimary
|
|
198
200
|
}))
|
|
199
201
|
});
|
|
200
|
-
const
|
|
202
|
+
const W = n(
|
|
201
203
|
() => d.value.some(
|
|
202
204
|
(e) => e.fixed === "left" || e.fixed === !0
|
|
203
205
|
) ? "left" : void 0
|
|
204
206
|
), me = n(
|
|
205
|
-
() => F(a.dataSource) ?
|
|
206
|
-
), { selectedRows:
|
|
207
|
+
() => F(a.dataSource) ? h.records : a.dataSource
|
|
208
|
+
), { selectedRows: b, rowSelection: S, ...fe } = Ke({
|
|
207
209
|
...a.rowSelection === !0 ? {} : a.rowSelection,
|
|
208
210
|
dataSource: me,
|
|
209
211
|
rowKey: a.rowKey
|
|
210
|
-
}),
|
|
212
|
+
}), M = () => {
|
|
211
213
|
const e = p.value;
|
|
212
|
-
e && (
|
|
214
|
+
e && (b.value = [
|
|
213
215
|
...e.getCheckboxReserveRecords(),
|
|
214
216
|
...e.getCheckboxRecords()
|
|
215
217
|
]);
|
|
216
218
|
}, ge = () => {
|
|
217
219
|
const e = p.value;
|
|
218
|
-
e && (
|
|
220
|
+
e && (b.value = [e.getRadioRecord()]);
|
|
219
221
|
};
|
|
220
|
-
function
|
|
222
|
+
function ve() {
|
|
221
223
|
var e;
|
|
222
224
|
return ((e = a.columns) == null ? void 0 : e.filter((l) => !l.hideInTable)) || [];
|
|
223
225
|
}
|
|
224
|
-
function
|
|
226
|
+
function he(e) {
|
|
225
227
|
var l, t, r;
|
|
226
228
|
(r = (t = (l = P.value) == null ? void 0 : l.apForm) == null ? void 0 : t.setFieldsValue) == null || r.call(t, e);
|
|
227
229
|
}
|
|
@@ -235,11 +237,17 @@ const go = /* @__PURE__ */ Ce({
|
|
|
235
237
|
const e = p.value;
|
|
236
238
|
e && (S.value.type === "radio" ? (e.clearRadioRow(), e.clearRadioReserve()) : (e.clearCheckboxRow(), e.clearCheckboxReserve()));
|
|
237
239
|
}
|
|
240
|
+
async function we(e, l) {
|
|
241
|
+
var r;
|
|
242
|
+
const t = h.records[e];
|
|
243
|
+
if (t)
|
|
244
|
+
return (r = p.value) == null ? void 0 : r.scrollToRow(t, l);
|
|
245
|
+
}
|
|
238
246
|
return E(
|
|
239
247
|
() => [a.columnResizable, a.columns],
|
|
240
248
|
() => {
|
|
241
|
-
const e =
|
|
242
|
-
d.value = e,
|
|
249
|
+
const e = ve();
|
|
250
|
+
d.value = e, O.value = e;
|
|
243
251
|
},
|
|
244
252
|
{
|
|
245
253
|
deep: !0,
|
|
@@ -252,40 +260,42 @@ const go = /* @__PURE__ */ Ce({
|
|
|
252
260
|
},
|
|
253
261
|
{ immediate: !0 }
|
|
254
262
|
), E(
|
|
255
|
-
() => o(
|
|
263
|
+
() => o(h).loading,
|
|
256
264
|
(e) => {
|
|
257
265
|
var l;
|
|
258
266
|
(l = a.onLoadingChange) == null || l.call(a, e);
|
|
259
267
|
}
|
|
260
268
|
), Z({
|
|
261
|
-
submit:
|
|
262
|
-
reset:
|
|
269
|
+
submit: j,
|
|
270
|
+
reset: H,
|
|
263
271
|
refresh: ne,
|
|
264
|
-
setSearchFormValues:
|
|
272
|
+
setSearchFormValues: he,
|
|
265
273
|
getSearchFormValues: ye,
|
|
266
274
|
getShowColumns: () => o(d),
|
|
267
275
|
rowSelection: {
|
|
268
|
-
selectedRows: n(() =>
|
|
276
|
+
selectedRows: n(() => b.value),
|
|
269
277
|
clearAll: I
|
|
270
|
-
}
|
|
278
|
+
},
|
|
279
|
+
scrollToRow: we
|
|
271
280
|
}), (e, l) => (s(), R("div", {
|
|
272
|
-
class: f(le.value)
|
|
281
|
+
class: f(le.value),
|
|
282
|
+
style: N(e.wrapperStyle)
|
|
273
283
|
}, [
|
|
274
|
-
o(F)(e.dataSource) && e.searchForm !== !1 &&
|
|
284
|
+
o(F)(e.dataSource) && e.searchForm !== !1 && D.value.length > 0 ? (s(), R("div", {
|
|
275
285
|
key: 0,
|
|
276
286
|
class: f(e.card ? o(B)("search-wrapper") : null),
|
|
277
|
-
style:
|
|
287
|
+
style: N(e.searchFormWrapperStyle)
|
|
278
288
|
}, [
|
|
279
|
-
|
|
289
|
+
q(o(Fe).SearchForm, g(e.searchForm || {}, {
|
|
280
290
|
ref_key: "formRef",
|
|
281
291
|
ref: P,
|
|
282
292
|
"custom-reset": "",
|
|
283
293
|
"submit-loading": !1,
|
|
284
|
-
onSubmit: o(
|
|
285
|
-
onReset: o(
|
|
286
|
-
}),
|
|
287
|
-
default:
|
|
288
|
-
(s(!0), R(G, null,
|
|
294
|
+
onSubmit: o(j),
|
|
295
|
+
onReset: o(H)
|
|
296
|
+
}), _({
|
|
297
|
+
default: v(() => [
|
|
298
|
+
(s(!0), R(G, null, z(D.value, (t) => (s(), u(T(t.renderNode.Comp), g({
|
|
289
299
|
key: t.dataIndex,
|
|
290
300
|
item: t,
|
|
291
301
|
ref_for: !0
|
|
@@ -296,24 +306,24 @@ const go = /* @__PURE__ */ Ce({
|
|
|
296
306
|
]),
|
|
297
307
|
_: 2
|
|
298
308
|
}, [
|
|
299
|
-
|
|
309
|
+
V.searchFormExtra ? {
|
|
300
310
|
name: "extra",
|
|
301
|
-
fn:
|
|
311
|
+
fn: v(() => [
|
|
302
312
|
A(e.$slots, "searchFormExtra")
|
|
303
313
|
]),
|
|
304
314
|
key: "0"
|
|
305
315
|
} : void 0
|
|
306
316
|
]), 1040, ["onSubmit", "onReset"])
|
|
307
|
-
], 6)) :
|
|
317
|
+
], 6)) : w("", !0),
|
|
308
318
|
k("div", {
|
|
309
319
|
class: f([o(B)("table-wrapper"), e.card ? o(B)("table-wrapper-card") : null]),
|
|
310
|
-
style:
|
|
320
|
+
style: N(e.tableWrapperStyle)
|
|
311
321
|
}, [
|
|
312
322
|
k("div", {
|
|
313
323
|
class: f(o(i)("header-wrapper"))
|
|
314
324
|
}, [
|
|
315
325
|
A(e.$slots, "title", {
|
|
316
|
-
selectedRows: o(
|
|
326
|
+
selectedRows: o(b),
|
|
317
327
|
selectedRowKeys: o(S).selectedRowKeys,
|
|
318
328
|
shownColumns: d.value,
|
|
319
329
|
clearAll: I
|
|
@@ -322,14 +332,14 @@ const go = /* @__PURE__ */ Ce({
|
|
|
322
332
|
k("div", {
|
|
323
333
|
class: f(o(i)("vxe-wrapper"))
|
|
324
334
|
}, [
|
|
325
|
-
(s(), u(o(
|
|
335
|
+
(s(), u(o(Re), g(o(Ae)(a), {
|
|
326
336
|
ref_key: "tableRef",
|
|
327
337
|
ref: p,
|
|
328
338
|
key: o(re),
|
|
329
|
-
data: o(
|
|
330
|
-
"sort-config": { remote:
|
|
331
|
-
"filter-config": { remote:
|
|
332
|
-
loading: o(
|
|
339
|
+
data: o(h).records,
|
|
340
|
+
"sort-config": { remote: L.value.length > 0 },
|
|
341
|
+
"filter-config": { remote: $.value.length > 0 },
|
|
342
|
+
loading: o(h).loading,
|
|
333
343
|
"row-config": {
|
|
334
344
|
isHover: !0,
|
|
335
345
|
keyField: a.rowKey
|
|
@@ -347,33 +357,33 @@ const go = /* @__PURE__ */ Ce({
|
|
|
347
357
|
size: C.value,
|
|
348
358
|
onSortChange: o(ce),
|
|
349
359
|
onFilterChange: o(ue),
|
|
350
|
-
onCheckboxChange:
|
|
351
|
-
onCheckboxAll:
|
|
360
|
+
onCheckboxChange: M,
|
|
361
|
+
onCheckboxAll: M,
|
|
352
362
|
onRadioChange: ge
|
|
353
|
-
}),
|
|
354
|
-
empty:
|
|
355
|
-
|
|
363
|
+
}), _({
|
|
364
|
+
empty: v(() => [
|
|
365
|
+
q(o(X), {
|
|
356
366
|
image: o(X).PRESENTED_IMAGE_SIMPLE
|
|
357
367
|
}, null, 8, ["image"])
|
|
358
368
|
]),
|
|
359
|
-
default:
|
|
360
|
-
a.expandable ? (s(), u(o(U), g({ key: 0 }, o(
|
|
361
|
-
content:
|
|
362
|
-
(s(), u(
|
|
369
|
+
default: v(() => [
|
|
370
|
+
a.expandable ? (s(), u(o(U), g({ key: 0 }, o(Ve)(e.expandable), { fixed: W.value }), {
|
|
371
|
+
content: v((t) => [
|
|
372
|
+
(s(), u(T(a.expandable.renderContent(t))))
|
|
363
373
|
]),
|
|
364
374
|
_: 1
|
|
365
|
-
}, 16, ["fixed"])) :
|
|
366
|
-
a.rowSelection ? (s(), u(o(U), g({ key: 1 }, o(
|
|
367
|
-
(s(!0), R(G, null,
|
|
375
|
+
}, 16, ["fixed"])) : w("", !0),
|
|
376
|
+
a.rowSelection ? (s(), u(o(U), g({ key: 1 }, o(Oe)(o(S)), { fixed: W.value }), null, 16, ["fixed"])) : w("", !0),
|
|
377
|
+
(s(!0), R(G, null, z(o(ae), (t) => (s(), u(T(t), {
|
|
368
378
|
key: t.props.colId
|
|
369
379
|
}))), 128))
|
|
370
380
|
]),
|
|
371
381
|
_: 2
|
|
372
382
|
}, [
|
|
373
|
-
|
|
383
|
+
z(o(ke)(V, ["searchFormExtra"]), (t, r) => ({
|
|
374
384
|
name: r,
|
|
375
|
-
fn:
|
|
376
|
-
A(e.$slots, r,
|
|
385
|
+
fn: v((c) => [
|
|
386
|
+
A(e.$slots, r, Se(xe(c || {})))
|
|
377
387
|
])
|
|
378
388
|
}))
|
|
379
389
|
]), 1040, ["data", "sort-config", "filter-config", "loading", "row-config", "style", "size", "onSortChange", "onFilterChange"]))
|
|
@@ -385,16 +395,16 @@ const go = /* @__PURE__ */ Ce({
|
|
|
385
395
|
key: 0,
|
|
386
396
|
direction: "horizontal",
|
|
387
397
|
"scroll-container": te.value
|
|
388
|
-
}, null, 8, ["scroll-container"])) :
|
|
389
|
-
e.pagination !== !1 ? (s(), u(o(
|
|
398
|
+
}, null, 8, ["scroll-container"])) : w("", !0),
|
|
399
|
+
e.pagination !== !1 ? (s(), u(o(ze), g({
|
|
390
400
|
key: 1,
|
|
391
401
|
class: o(i)("pagination")
|
|
392
|
-
}, o(se).pagination, { onChange: o(pe) }), null, 16, ["class", "onChange"])) :
|
|
402
|
+
}, o(se).pagination, { onChange: o(pe) }), null, 16, ["class", "onChange"])) : w("", !0)
|
|
393
403
|
], 2)
|
|
394
404
|
], 6)
|
|
395
|
-
],
|
|
405
|
+
], 6));
|
|
396
406
|
}
|
|
397
407
|
});
|
|
398
408
|
export {
|
|
399
|
-
|
|
409
|
+
vo as default
|
|
400
410
|
};
|
|
@@ -170,6 +170,10 @@ export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
|
|
|
170
170
|
* 自定义表格样式
|
|
171
171
|
*/
|
|
172
172
|
tableWrapperStyle?: CSSProperties;
|
|
173
|
+
/**
|
|
174
|
+
* 表格最外层容器自定义样式
|
|
175
|
+
*/
|
|
176
|
+
wrapperStyle?: CSSProperties;
|
|
173
177
|
/**
|
|
174
178
|
* 是否手动发起第一次网络请求
|
|
175
179
|
*/
|
|
@@ -212,6 +216,10 @@ export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
|
|
|
212
216
|
*/
|
|
213
217
|
title?: string;
|
|
214
218
|
};
|
|
219
|
+
/**
|
|
220
|
+
* 作为表单项时内部传递,请勿使用
|
|
221
|
+
*/
|
|
222
|
+
value?: any;
|
|
215
223
|
};
|
|
216
224
|
export type ApGridVirtualConfig = {
|
|
217
225
|
x?: false | number;
|
|
@@ -260,4 +268,11 @@ export type ApGridExpose<SearchParamsType = Recordable, RecordType = any> = {
|
|
|
260
268
|
selectedRows: ComputedRef<RecordType[]>;
|
|
261
269
|
clearAll: () => void;
|
|
262
270
|
};
|
|
271
|
+
/**
|
|
272
|
+
* 滚动到某一行
|
|
273
|
+
* @param index 行索引
|
|
274
|
+
* @param fieldOrColumn
|
|
275
|
+
* @returns
|
|
276
|
+
*/
|
|
277
|
+
scrollToRow: (index: number, fieldOrColumn?: any) => Promise<any>;
|
|
263
278
|
};
|