@aplus-frontend/ui 6.37.0 → 6.39.0
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 +215 -218
- package/es/src/ag-grid/components/row/index.vue.d.ts +6 -0
- package/es/src/ag-grid/components/row/index.vue.mjs +4 -0
- package/es/src/ag-grid/components/row/index.vue2.mjs +14 -0
- package/es/src/ag-grid/editable/form-item.vue.mjs +10 -9
- package/es/src/ag-grid/editable/index.vue.mjs +17 -16
- package/es/src/ag-grid/hooks/use-columns-def.mjs +73 -71
- package/es/src/ag-grid/hooks/use-row-selection.d.ts +1 -1
- package/es/src/ag-grid/hooks/use-row-selection.mjs +81 -68
- package/es/src/ag-grid/index.vue.d.ts +2 -1
- package/es/src/ag-grid/index.vue.mjs +282 -257
- package/es/src/ag-grid/interface.d.ts +54 -3
- package/es/src/ap-action/group/index.vue.mjs +24 -21
- package/es/src/ap-action/item/index.vue2.mjs +28 -20
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +72 -71
- package/es/src/ap-table/interface.d.ts +6 -0
- package/es/src/business/ag-grid-modal/constants.d.ts +4 -0
- package/es/src/business/ag-grid-modal/constants.mjs +6 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +33 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +50 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +3 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +58 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -0
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +122 -0
- package/es/src/business/ag-grid-modal/hooks/use-modal-title.d.ts +24 -0
- package/es/src/business/ag-grid-modal/hooks/use-modal-title.mjs +49 -0
- package/es/src/business/ag-grid-modal/index.d.ts +2 -0
- package/es/src/business/ag-grid-modal/index.mjs +6 -0
- package/es/src/business/ag-grid-modal/interface.d.ts +130 -0
- package/es/src/business/ag-grid-modal/modal-layout/index.vue.d.ts +43 -0
- package/es/src/business/ag-grid-modal/modal-layout/index.vue.mjs +4 -0
- package/es/src/business/ag-grid-modal/modal-layout/index.vue2.mjs +102 -0
- package/es/src/business/ag-grid-modal/style/css.js +1 -0
- package/es/src/business/ag-grid-modal/style/index.js +1 -0
- package/es/src/business/ag-grid-modal/utils.d.ts +52 -0
- package/es/src/business/ag-grid-modal/utils.mjs +72 -0
- package/es/src/business/ag-grid-modal/wrapper/index.vue.d.ts +23 -0
- package/es/src/business/ag-grid-modal/wrapper/index.vue.mjs +4 -0
- package/es/src/business/ag-grid-modal/wrapper/index.vue2.mjs +25 -0
- package/es/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +1 -0
- package/es/src/business/ap-table-modal/hooks/use-table-modal.d.ts +1 -0
- package/es/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +1 -0
- package/es/src/business/ap-table-modal/index.d.ts +3 -0
- package/es/src/business/ap-table-modal/table-modal.vue.d.ts +1 -0
- package/es/src/business/hooks/usePageListApTable.d.ts +1 -0
- package/es/src/business/index.d.ts +1 -0
- package/es/src/business/index.mjs +55 -54
- package/es/src/index.d.ts +0 -1
- package/es/src/index.mjs +280 -284
- package/es/src/path-map.mjs +3 -2
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/index.js +1 -1
- package/lib/src/ag-grid/components/row/index.vue.d.ts +6 -0
- package/lib/src/ag-grid/components/row/index.vue.js +1 -0
- package/lib/src/ag-grid/components/row/index.vue2.js +1 -0
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ag-grid/editable/index.vue.js +1 -1
- package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
- package/lib/src/ag-grid/hooks/use-row-selection.d.ts +1 -1
- package/lib/src/ag-grid/hooks/use-row-selection.js +1 -1
- package/lib/src/ag-grid/index.vue.d.ts +2 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +54 -3
- package/lib/src/ap-action/group/index.vue.js +1 -1
- package/lib/src/ap-action/item/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
- package/lib/src/ap-table/interface.d.ts +6 -0
- package/lib/src/business/ag-grid-modal/constants.d.ts +4 -0
- package/lib/src/business/ag-grid-modal/constants.js +1 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +33 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.js +1 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +3 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.js +1 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -0
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.js +1 -0
- package/lib/src/business/ag-grid-modal/hooks/use-modal-title.d.ts +24 -0
- package/lib/src/business/ag-grid-modal/hooks/use-modal-title.js +1 -0
- package/lib/src/business/ag-grid-modal/index.d.ts +2 -0
- package/lib/src/business/ag-grid-modal/index.js +1 -0
- package/lib/src/business/ag-grid-modal/interface.d.ts +130 -0
- package/lib/src/business/ag-grid-modal/modal-layout/index.vue.d.ts +43 -0
- package/lib/src/business/ag-grid-modal/modal-layout/index.vue.js +1 -0
- package/lib/src/business/ag-grid-modal/modal-layout/index.vue2.js +1 -0
- package/lib/src/business/ag-grid-modal/style/css.cjs +1 -0
- package/lib/src/business/ag-grid-modal/style/index.cjs +1 -0
- package/lib/src/business/ag-grid-modal/utils.d.ts +52 -0
- package/lib/src/business/ag-grid-modal/utils.js +1 -0
- package/lib/src/business/ag-grid-modal/wrapper/index.vue.d.ts +23 -0
- package/lib/src/business/ag-grid-modal/wrapper/index.vue.js +1 -0
- package/lib/src/business/ag-grid-modal/wrapper/index.vue2.js +1 -0
- package/lib/src/business/ap-table-modal/hooks/use-create-table-modal.d.ts +1 -0
- package/lib/src/business/ap-table-modal/hooks/use-table-modal.d.ts +1 -0
- package/lib/src/business/ap-table-modal/hooks/use-table-select-modal.d.ts +1 -0
- package/lib/src/business/ap-table-modal/index.d.ts +3 -0
- package/lib/src/business/ap-table-modal/table-modal.vue.d.ts +1 -0
- package/lib/src/business/hooks/usePageListApTable.d.ts +1 -0
- package/lib/src/business/index.d.ts +1 -0
- package/lib/src/business/index.js +1 -1
- package/lib/src/index.d.ts +0 -1
- package/lib/src/index.js +1 -1
- package/lib/src/path-map.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/ag-grid/index.css +3 -0
- package/theme/ag-grid-modal/index.css +773 -0
- package/theme/ag-grid-modal/index.less +58 -0
- package/theme/ap-form/ap-form-item.css +3 -0
- package/theme/ap-form/ap-form-item.less +3 -0
- package/theme/ap-form/index.css +3 -0
- package/theme/ap-form/search-form.css +3 -0
- package/theme/ap-grid/index.css +3 -0
- package/theme/ap-table/ap-table.css +3 -0
- package/theme/ap-table-modal/index.css +3 -0
- package/theme/ap-upload/index.css +5 -0
- package/theme/ap-upload/multiple-file.css +5 -0
- package/theme/ap-upload/multiple-file.less +6 -0
- package/theme/editable-table/index.css +3 -0
- package/theme/index.css +54 -3
- package/theme/index.less +1 -1
- package/es/src/work-order-modal/createWorkOrder.d.ts +0 -3
- package/es/src/work-order-modal/createWorkOrder.mjs +0 -32
- package/es/src/work-order-modal/help-message.vue.d.ts +0 -3
- package/es/src/work-order-modal/help-message.vue.mjs +0 -4
- package/es/src/work-order-modal/help-message.vue2.mjs +0 -36
- package/es/src/work-order-modal/index.d.ts +0 -4
- package/es/src/work-order-modal/index.mjs +0 -8
- package/es/src/work-order-modal/interfaces.d.ts +0 -31
- package/es/src/work-order-modal/interfaces.mjs +0 -9
- package/es/src/work-order-modal/style/css.js +0 -4
- package/es/src/work-order-modal/style/index.js +0 -4
- package/es/src/work-order-modal/work-order-modal.vue.d.ts +0 -846
- package/es/src/work-order-modal/work-order-modal.vue.mjs +0 -192
- package/es/src/work-order-modal/work-order-modal.vue2.mjs +0 -4
- package/lib/src/work-order-modal/createWorkOrder.d.ts +0 -3
- package/lib/src/work-order-modal/createWorkOrder.js +0 -1
- package/lib/src/work-order-modal/help-message.vue.d.ts +0 -3
- package/lib/src/work-order-modal/help-message.vue.js +0 -1
- package/lib/src/work-order-modal/help-message.vue2.js +0 -1
- package/lib/src/work-order-modal/index.d.ts +0 -4
- package/lib/src/work-order-modal/index.js +0 -1
- package/lib/src/work-order-modal/interfaces.d.ts +0 -31
- package/lib/src/work-order-modal/interfaces.js +0 -1
- package/lib/src/work-order-modal/style/css.cjs +0 -4
- package/lib/src/work-order-modal/style/index.cjs +0 -4
- package/lib/src/work-order-modal/work-order-modal.vue.d.ts +0 -846
- package/lib/src/work-order-modal/work-order-modal.vue.js +0 -1
- package/lib/src/work-order-modal/work-order-modal.vue2.js +0 -1
- /package/es/src/{work-order-modal → business/ag-grid-modal}/style/css.d.ts +0 -0
- /package/es/src/{work-order-modal → business/ag-grid-modal}/style/index.d.ts +0 -0
- /package/lib/src/{work-order-modal → business/ag-grid-modal}/style/css.d.ts +0 -0
- /package/lib/src/{work-order-modal → business/ag-grid-modal}/style/index.d.ts +0 -0
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { AgGridVue as
|
|
3
|
-
import { ModuleRegistry as
|
|
4
|
-
import { mergeProps as
|
|
5
|
-
import { Spin as
|
|
6
|
-
import { isUndefined as
|
|
1
|
+
import { defineComponent as so, useSlots as io, ref as D, toRef as N, unref as t, computed as n, nextTick as A, watch as M, createElementBlock as V, openBlock as b, normalizeStyle as W, normalizeClass as f, createCommentVNode as le, createElementVNode as F, createVNode as O, mergeProps as G, createSlots as uo, withCtx as ne, Fragment as co, renderList as mo, createBlock as se, resolveDynamicComponent as po, renderSlot as ie, withDirectives as fo, vShow as go } from "vue";
|
|
2
|
+
import { AgGridVue as wo } from "ag-grid-vue3";
|
|
3
|
+
import { ModuleRegistry as So, AllCommunityModule as yo } from "ag-grid-community";
|
|
4
|
+
import { mergeProps as ho } from "./utils.mjs";
|
|
5
|
+
import { Spin as Co, Pagination as Ro } from "@aplus-frontend/antdv";
|
|
6
|
+
import { isUndefined as B, isFunction as H } from "lodash-unified";
|
|
7
7
|
import "../config-provider/index.mjs";
|
|
8
|
-
import { ApForm as
|
|
9
|
-
import { recursionApColumns as
|
|
10
|
-
import { useTablePaging as
|
|
11
|
-
import
|
|
12
|
-
import { useProvideSorter as
|
|
13
|
-
import { useProvideApTable as
|
|
14
|
-
import { DEFAULT_ROW_SELECTION_CONFIG as
|
|
15
|
-
import { useToken as
|
|
16
|
-
import { useTheme as
|
|
17
|
-
import { useColumns as
|
|
18
|
-
import { useColumnsDef as
|
|
19
|
-
import { isDef as
|
|
20
|
-
import { getValidVNodeList as
|
|
21
|
-
import { useSearchForm as
|
|
8
|
+
import { ApForm as vo } from "../ap-form/index.mjs";
|
|
9
|
+
import { recursionApColumns as bo } from "../ap-table/utils.mjs";
|
|
10
|
+
import { useTablePaging as Fo } from "../ap-table/hooks/use-table-paging-ng.mjs";
|
|
11
|
+
import Bo from "./hooks/use-row-selection.mjs";
|
|
12
|
+
import { useProvideSorter as ko } from "./context.mjs";
|
|
13
|
+
import { useProvideApTable as xo } from "../ap-table/context.mjs";
|
|
14
|
+
import { DEFAULT_ROW_SELECTION_CONFIG as de, sizeReverseMap as Io, sizeMap as Do } from "../ap-grid/constants.mjs";
|
|
15
|
+
import { useToken as No } from "@aplus-frontend/antdv/es/theme/internal";
|
|
16
|
+
import { useTheme as To } from "./theme.mjs";
|
|
17
|
+
import { useColumns as Eo } from "./hooks/use-columns.mjs";
|
|
18
|
+
import { useColumnsDef as Ko } from "./hooks/use-columns-def.mjs";
|
|
19
|
+
import { isDef as Po } from "../utils/index.mjs";
|
|
20
|
+
import { getValidVNodeList as zo } from "../utils/slot.mjs";
|
|
21
|
+
import { useSearchForm as Ao } from "./hooks/use-search-form.mjs";
|
|
22
22
|
import "./components/empty/index.vue.mjs";
|
|
23
|
-
import
|
|
24
|
-
import { usePinnedRow as
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import {
|
|
28
|
-
import
|
|
29
|
-
|
|
23
|
+
import Mo from "./hooks/use-virtual-config.mjs";
|
|
24
|
+
import { usePinnedRow as Vo } from "./hooks/use-pinned-row.mjs";
|
|
25
|
+
import Wo from "./hooks/use-selection-col-def.mjs";
|
|
26
|
+
import "./components/row/index.vue.mjs";
|
|
27
|
+
import { useNamespace as Oo } from "../config-provider/hooks/use-namespace.mjs";
|
|
28
|
+
import { useGlobalConfig as Go } from "../config-provider/hooks/use-global-config.mjs";
|
|
29
|
+
import Ho from "./components/row/index.vue2.mjs";
|
|
30
|
+
import Lo from "./components/empty/index.vue2.mjs";
|
|
31
|
+
const Ct = /* @__PURE__ */ so({
|
|
30
32
|
name: "AgGrid",
|
|
31
33
|
__name: "index",
|
|
32
34
|
props: {
|
|
@@ -46,7 +48,6 @@ const mt = /* @__PURE__ */ oo({
|
|
|
46
48
|
id: {},
|
|
47
49
|
showHeader: { type: Boolean },
|
|
48
50
|
components: {},
|
|
49
|
-
customRow: {},
|
|
50
51
|
customHeaderRow: {},
|
|
51
52
|
direction: {},
|
|
52
53
|
expandFixed: { type: [String, Boolean] },
|
|
@@ -89,6 +90,7 @@ const mt = /* @__PURE__ */ oo({
|
|
|
89
90
|
loading: { type: Boolean, default: void 0 },
|
|
90
91
|
summary: {},
|
|
91
92
|
rowHeight: {},
|
|
93
|
+
getRowHeight: {},
|
|
92
94
|
advanceRenderer: { type: Boolean },
|
|
93
95
|
browserTooltips: { type: Boolean },
|
|
94
96
|
virtual: { type: [Boolean, Object], default: void 0 },
|
|
@@ -97,67 +99,68 @@ const mt = /* @__PURE__ */ oo({
|
|
|
97
99
|
rowClassName: {},
|
|
98
100
|
rowClassRules: {},
|
|
99
101
|
autoHeight: { type: Boolean },
|
|
100
|
-
onUpdate: {}
|
|
102
|
+
onUpdate: {},
|
|
103
|
+
customRow: {}
|
|
101
104
|
},
|
|
102
|
-
setup(
|
|
103
|
-
|
|
104
|
-
const o =
|
|
105
|
-
|
|
106
|
-
),
|
|
107
|
-
let
|
|
108
|
-
const
|
|
109
|
-
|
|
105
|
+
setup(ue, { expose: ce }) {
|
|
106
|
+
So.registerModules([yo]);
|
|
107
|
+
const o = ue, L = io(), { e: k, b: u, be: me } = Oo("ag-grid"), h = D(o.size), pe = To(h, N(o, "rowHeight")), fe = Mo(N(o, "virtual")), { rowPinnedGridConfig: U, getRowPinnedCellClass: ge } = Vo(
|
|
108
|
+
N(o, "summary")
|
|
109
|
+
), we = Go("apGrid"), s = D(), [, Se] = No();
|
|
110
|
+
let C = !!o.dataSource;
|
|
111
|
+
const j = Ao(o), { shownColumns: g, columns: $, columnKeys: ye, getTargetColumnByKey: he } = Eo(o), { defaultColDef: Ce, columnDefs: Re, gridWrapperRef: ve } = Ko($, o, ge), x = D({});
|
|
112
|
+
ko({
|
|
110
113
|
sorter: x,
|
|
111
114
|
setSorter(e) {
|
|
112
115
|
x.value = e;
|
|
113
116
|
}
|
|
114
117
|
});
|
|
115
|
-
const
|
|
118
|
+
const be = {
|
|
116
119
|
asc: "ascend",
|
|
117
120
|
desc: "descend"
|
|
118
121
|
};
|
|
119
|
-
function
|
|
122
|
+
function Fe() {
|
|
120
123
|
const e = s.value.getColumns()?.filter((c) => c.getSort() !== void 0), r = t(x) || {};
|
|
121
124
|
let a = e?.[0];
|
|
122
|
-
const
|
|
123
|
-
if (
|
|
125
|
+
const i = Object.keys(r);
|
|
126
|
+
if (i.length && i.every((c) => r[c] === null)) {
|
|
124
127
|
const c = Object.keys(r)[0];
|
|
125
128
|
c && (a = s.value?.getColumn(c));
|
|
126
129
|
}
|
|
127
130
|
if (!a)
|
|
128
131
|
return;
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
column:
|
|
132
|
-
field:
|
|
133
|
-
order:
|
|
132
|
+
const d = a.getColDef(), m = a.getSort(), p = he(d.colId);
|
|
133
|
+
_(void 0, void 0, {
|
|
134
|
+
column: d,
|
|
135
|
+
field: p?.field ?? d.field ?? d.colId,
|
|
136
|
+
order: m ? be[m] : null
|
|
134
137
|
});
|
|
135
138
|
}
|
|
136
|
-
const Be =
|
|
139
|
+
const Be = n(() => bo(t(g), (e) => {
|
|
137
140
|
if (e.sorter === !0)
|
|
138
141
|
return e.field ?? e.dataIndex ?? e.key;
|
|
139
|
-
}).filter(Boolean)),
|
|
142
|
+
}).filter(Boolean)), ke = () => {
|
|
140
143
|
x.value = {};
|
|
141
144
|
const e = s.value;
|
|
142
145
|
if (!e)
|
|
143
146
|
return;
|
|
144
147
|
const r = e.getColumnState()?.map((a) => ({ ...a, sort: null }));
|
|
145
148
|
e.applyColumnState({ state: r });
|
|
146
|
-
},
|
|
147
|
-
formRef:
|
|
148
|
-
submit:
|
|
149
|
-
reset:
|
|
150
|
-
data:
|
|
151
|
-
tableProps:
|
|
152
|
-
handleTableChangeOptional:
|
|
153
|
-
submitWith:
|
|
154
|
-
refresh:
|
|
155
|
-
getPaging:
|
|
156
|
-
setPaging:
|
|
157
|
-
setDataSource:
|
|
158
|
-
} =
|
|
149
|
+
}, xe = n(() => Po(o.manual) ? o.manual : zo(L.searchFormExtra?.() || []).some((r) => r.type?.name === "ApView")), {
|
|
150
|
+
formRef: w,
|
|
151
|
+
submit: T,
|
|
152
|
+
reset: E,
|
|
153
|
+
data: S,
|
|
154
|
+
tableProps: q,
|
|
155
|
+
handleTableChangeOptional: _,
|
|
156
|
+
submitWith: J,
|
|
157
|
+
refresh: Q,
|
|
158
|
+
getPaging: Ie,
|
|
159
|
+
setPaging: De,
|
|
160
|
+
setDataSource: Ne
|
|
161
|
+
} = Fo({
|
|
159
162
|
async request(e) {
|
|
160
|
-
if (
|
|
163
|
+
if (C = !1, y.value && !y.value.preserveSelectedRowKeys && B(o.dataSource) && z(), !B(o.dataSource)) {
|
|
161
164
|
const a = e.pageSize * (e.current - 1);
|
|
162
165
|
return {
|
|
163
166
|
data: (o.pagination === !1 ? o.dataSource : o.dataSource.slice(a, a + e.pageSize)) || [],
|
|
@@ -171,338 +174,360 @@ const mt = /* @__PURE__ */ oo({
|
|
|
171
174
|
};
|
|
172
175
|
},
|
|
173
176
|
namespace: "ap-grid",
|
|
174
|
-
filterFields:
|
|
175
|
-
params:
|
|
177
|
+
filterFields: D([]),
|
|
178
|
+
params: N(o, "params"),
|
|
176
179
|
defaultData: o.defaultData,
|
|
177
|
-
manual: t(
|
|
180
|
+
manual: t(xe),
|
|
178
181
|
formatParams: o.beforeSearchSubmit,
|
|
179
182
|
pagination: o.pagination,
|
|
180
183
|
sortFields: Be,
|
|
181
|
-
onClickReset:
|
|
182
|
-
}),
|
|
183
|
-
const e = o.rowSelection ||
|
|
184
|
+
onClickReset: ke
|
|
185
|
+
}), y = n(() => {
|
|
186
|
+
const e = o.rowSelection || we.value?.rowSelection;
|
|
184
187
|
if (e)
|
|
185
|
-
return e === !0 ?
|
|
186
|
-
...
|
|
188
|
+
return e === !0 ? de : {
|
|
189
|
+
...de,
|
|
187
190
|
...e
|
|
188
191
|
};
|
|
189
|
-
}),
|
|
190
|
-
() =>
|
|
192
|
+
}), Te = Wo(o, g), Ee = n(
|
|
193
|
+
() => B(o.dataSource) ? S.records : o.dataSource
|
|
191
194
|
), {
|
|
192
|
-
select:
|
|
193
|
-
unSelect:
|
|
194
|
-
selectedRows:
|
|
195
|
-
selectedRowKeys:
|
|
196
|
-
clearAll:
|
|
197
|
-
selectMultiByKeys:
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
195
|
+
select: Ke,
|
|
196
|
+
unSelect: Pe,
|
|
197
|
+
selectedRows: K,
|
|
198
|
+
selectedRowKeys: ze,
|
|
199
|
+
clearAll: Ae,
|
|
200
|
+
selectMultiByKeys: Me,
|
|
201
|
+
selectMulti: Ve,
|
|
202
|
+
unSelectMulti: We
|
|
203
|
+
} = Bo({
|
|
204
|
+
...y.value,
|
|
205
|
+
dataSource: Ee,
|
|
201
206
|
rowKey: o.rowKey
|
|
202
|
-
}),
|
|
207
|
+
}), Oe = {
|
|
203
208
|
checkbox: "multiRow",
|
|
204
209
|
radio: "singleRow"
|
|
205
|
-
},
|
|
206
|
-
const e =
|
|
210
|
+
}, Ge = n(() => {
|
|
211
|
+
const e = y.value;
|
|
207
212
|
if (!e)
|
|
208
213
|
return;
|
|
209
214
|
const { type: r = "checkbox", disabled: a } = e;
|
|
210
215
|
return {
|
|
211
|
-
mode:
|
|
212
|
-
isRowSelectable: (
|
|
216
|
+
mode: Oe[r],
|
|
217
|
+
isRowSelectable: (i) => a ? !a(i.data) : !0,
|
|
213
218
|
hideDisabledCheckboxes: e.hideDisabled ?? !1
|
|
214
219
|
};
|
|
215
220
|
});
|
|
216
|
-
function
|
|
217
|
-
return
|
|
221
|
+
function P(e) {
|
|
222
|
+
return H(o.rowKey) ? o.rowKey(e) : e[o.rowKey];
|
|
218
223
|
}
|
|
219
|
-
const
|
|
224
|
+
const I = ({
|
|
220
225
|
api: e = s.value
|
|
221
226
|
}) => {
|
|
222
|
-
if (o.onUpdate?.(), !
|
|
227
|
+
if (o.onUpdate?.(), !y.value)
|
|
223
228
|
return;
|
|
224
|
-
const r =
|
|
225
|
-
|
|
226
|
-
setTimeout(() => {
|
|
227
|
-
p = !0;
|
|
228
|
-
}, 0);
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
p = !1;
|
|
229
|
+
const r = K.value || [];
|
|
230
|
+
C = !1;
|
|
232
231
|
const a = [];
|
|
233
|
-
e.forEachNode((
|
|
234
|
-
const
|
|
235
|
-
r.find((
|
|
232
|
+
e.forEachNode((i) => {
|
|
233
|
+
const R = i.data, d = P(R), m = i.isSelected();
|
|
234
|
+
r.find((p) => P(p) === d) ? !m && a.push(i) : m && i.setSelected(!1);
|
|
236
235
|
}), e.setNodesSelected({ nodes: a, newValue: !0 }), setTimeout(() => {
|
|
237
|
-
|
|
236
|
+
C = !0;
|
|
238
237
|
}, 0);
|
|
239
|
-
},
|
|
240
|
-
|
|
238
|
+
}, He = (e) => {
|
|
239
|
+
C && (e.node.isSelected() ? Ke(e.data) : Pe(e.data), H(y.value?.tooltip) && e.api.refreshCells({
|
|
241
240
|
rowNodes: [e.node],
|
|
242
241
|
// todo: 取消硬编码
|
|
243
242
|
columns: ["ag-Grid-SelectionColumn"],
|
|
244
243
|
force: !0
|
|
245
244
|
}));
|
|
246
|
-
},
|
|
247
|
-
|
|
248
|
-
},
|
|
249
|
-
|
|
245
|
+
}, Le = () => {
|
|
246
|
+
C = !0;
|
|
247
|
+
}, z = () => {
|
|
248
|
+
Ae(), s.value?.deselectAll();
|
|
250
249
|
};
|
|
251
|
-
function
|
|
252
|
-
|
|
253
|
-
|
|
250
|
+
function Ue(e) {
|
|
251
|
+
Me(e), A(() => {
|
|
252
|
+
I({});
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
const je = n(() => {
|
|
256
|
+
const e = o.customRow;
|
|
257
|
+
return e ? {
|
|
258
|
+
isFullWidthRow: e.isCustomRow,
|
|
259
|
+
fullWidthCellRenderer: Ho,
|
|
260
|
+
fullWidthCellRendererParams: {
|
|
261
|
+
render: e.render
|
|
262
|
+
}
|
|
263
|
+
} : {};
|
|
264
|
+
});
|
|
265
|
+
function $e(e) {
|
|
266
|
+
Ve(e), A(() => {
|
|
267
|
+
I({});
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
function qe(e) {
|
|
271
|
+
We(e), A(() => {
|
|
272
|
+
I({});
|
|
254
273
|
});
|
|
255
274
|
}
|
|
256
275
|
function X(e = !1) {
|
|
257
276
|
const r = e ? "getFieldsValueTransformed" : "getFieldsValue";
|
|
258
|
-
return
|
|
277
|
+
return w.value?.apForm?.[r]?.(!0);
|
|
259
278
|
}
|
|
260
279
|
function Y(e) {
|
|
261
|
-
|
|
280
|
+
w.value?.apForm?.setFieldsValue?.(e);
|
|
262
281
|
}
|
|
263
282
|
function Z() {
|
|
264
|
-
return
|
|
283
|
+
return w.value?.getSorterItems() || [];
|
|
265
284
|
}
|
|
266
|
-
function
|
|
267
|
-
|
|
285
|
+
function ee(e) {
|
|
286
|
+
w.value?.setSorterItems(e);
|
|
268
287
|
}
|
|
269
|
-
function
|
|
270
|
-
|
|
288
|
+
function oe() {
|
|
289
|
+
w.value?.resetSorterItems();
|
|
271
290
|
}
|
|
272
|
-
function
|
|
291
|
+
function te(e) {
|
|
273
292
|
return e && String(e);
|
|
274
293
|
}
|
|
275
|
-
function
|
|
294
|
+
function _e(e) {
|
|
276
295
|
const r = s.value;
|
|
277
296
|
if (!r)
|
|
278
297
|
return;
|
|
279
|
-
const a = r.getColumnState() || [],
|
|
280
|
-
if (!
|
|
281
|
-
return
|
|
282
|
-
const
|
|
283
|
-
...
|
|
284
|
-
hide:
|
|
285
|
-
},
|
|
286
|
-
(
|
|
298
|
+
const a = r.getColumnState() || [], i = e.map((l) => l.key ? String(l.key) : l.key).filter(Boolean), R = a.map((l) => {
|
|
299
|
+
if (!ye.value.includes(l.colId))
|
|
300
|
+
return l;
|
|
301
|
+
const v = !i.includes(l.colId), re = {
|
|
302
|
+
...l,
|
|
303
|
+
hide: v
|
|
304
|
+
}, ae = e.find(
|
|
305
|
+
(no) => te(no.key) === l.colId
|
|
287
306
|
);
|
|
288
|
-
return
|
|
289
|
-
}),
|
|
290
|
-
e.map((
|
|
291
|
-
),
|
|
292
|
-
(
|
|
293
|
-
),
|
|
307
|
+
return ae && (re.pinned = ae.fixed || null), re;
|
|
308
|
+
}), d = new Map(
|
|
309
|
+
e.map((l, v) => [te(l.key), v])
|
|
310
|
+
), m = R.filter((l) => d.has(l.colId)).sort(
|
|
311
|
+
(l, v) => d.get(l.colId) - d.get(v.colId)
|
|
312
|
+
), p = [];
|
|
294
313
|
let c = 0;
|
|
295
|
-
for (const
|
|
296
|
-
|
|
314
|
+
for (const l of R)
|
|
315
|
+
d.has(l.colId) ? p.push(m[c++]) : p.push(l);
|
|
297
316
|
r.applyColumnState({
|
|
298
|
-
state:
|
|
317
|
+
state: p,
|
|
299
318
|
applyOrder: !0
|
|
300
319
|
});
|
|
301
320
|
}
|
|
302
|
-
|
|
303
|
-
columns:
|
|
304
|
-
columnsBackup:
|
|
305
|
-
size:
|
|
321
|
+
xo({
|
|
322
|
+
columns: n(() => g.value),
|
|
323
|
+
columnsBackup: n(() => $.value),
|
|
324
|
+
size: n(() => Do[h.value]),
|
|
306
325
|
updateColumns(e) {
|
|
307
|
-
|
|
326
|
+
g.value = e, o.onShownColumnsChange?.(e), _e(e);
|
|
308
327
|
},
|
|
309
328
|
updateSize(e) {
|
|
310
|
-
|
|
329
|
+
h.value = Io[e];
|
|
311
330
|
},
|
|
312
|
-
renderConfig:
|
|
313
|
-
className:
|
|
314
|
-
color:
|
|
331
|
+
renderConfig: n(() => ({
|
|
332
|
+
className: me("table-header", "title"),
|
|
333
|
+
color: Se.value.colorTextTertiary
|
|
315
334
|
})),
|
|
316
|
-
dataSource:
|
|
335
|
+
dataSource: n(() => t(S).records),
|
|
317
336
|
getSearchFormValues: X,
|
|
318
337
|
setSearchFormValues: Y,
|
|
319
|
-
submit:
|
|
320
|
-
submitWith:
|
|
321
|
-
reset:
|
|
322
|
-
refresh:
|
|
338
|
+
submit: T,
|
|
339
|
+
submitWith: J,
|
|
340
|
+
reset: E,
|
|
341
|
+
refresh: Q,
|
|
323
342
|
getSearchFormSorterItems: Z,
|
|
324
|
-
setSearchFormSorterItems:
|
|
325
|
-
resetSearchFormSorterItems:
|
|
343
|
+
setSearchFormSorterItems: ee,
|
|
344
|
+
resetSearchFormSorterItems: oe
|
|
326
345
|
});
|
|
327
|
-
const
|
|
328
|
-
() =>
|
|
329
|
-
),
|
|
346
|
+
const Je = n(
|
|
347
|
+
() => B(o.loading) ? S.loading : o.loading
|
|
348
|
+
), Qe = n(() => [
|
|
330
349
|
u(),
|
|
331
350
|
o.card ? null : u("wrapper"),
|
|
332
351
|
u("adaptive"),
|
|
333
|
-
u(`size-${
|
|
334
|
-
].filter(Boolean)),
|
|
352
|
+
u(`size-${h.value}`)
|
|
353
|
+
].filter(Boolean)), Xe = n(() => ({
|
|
335
354
|
height: "100%",
|
|
336
355
|
...o.tableStyle || {}
|
|
337
|
-
})),
|
|
338
|
-
|
|
356
|
+
})), Ye = (e, r) => {
|
|
357
|
+
_({ current: e, pageSize: r });
|
|
339
358
|
};
|
|
340
|
-
function
|
|
359
|
+
function Ze(e) {
|
|
341
360
|
const r = e.data;
|
|
342
|
-
return
|
|
361
|
+
return P(r);
|
|
343
362
|
}
|
|
344
|
-
function
|
|
363
|
+
function eo(e, r) {
|
|
345
364
|
s.value?.ensureIndexVisible(e, r);
|
|
346
365
|
}
|
|
347
|
-
function
|
|
366
|
+
function oo(e) {
|
|
348
367
|
o.onRowClicked?.(e.data, e.event);
|
|
349
368
|
}
|
|
350
|
-
function
|
|
369
|
+
function to(e) {
|
|
351
370
|
o.onScrollEnd?.(e.direction);
|
|
352
371
|
}
|
|
353
|
-
function
|
|
372
|
+
function ro(e) {
|
|
354
373
|
return s.value?.refreshCells(e);
|
|
355
374
|
}
|
|
356
|
-
function
|
|
375
|
+
function ao(e) {
|
|
357
376
|
return s.value?.redrawRows(e);
|
|
358
377
|
}
|
|
359
|
-
const
|
|
378
|
+
const lo = (e) => {
|
|
360
379
|
const r = [
|
|
361
|
-
|
|
380
|
+
U.value.getRowClass?.(e)
|
|
362
381
|
];
|
|
363
382
|
if (!e.node.rowPinned) {
|
|
364
|
-
const a =
|
|
383
|
+
const a = H(o.rowClassName) ? o.rowClassName(e.data, e.rowIndex) : o.rowClassName;
|
|
365
384
|
r.push(a);
|
|
366
385
|
}
|
|
367
386
|
return r.flat().filter(Boolean);
|
|
368
387
|
};
|
|
369
|
-
return
|
|
388
|
+
return M(
|
|
370
389
|
() => o.dataSource,
|
|
371
390
|
(e) => {
|
|
372
|
-
|
|
391
|
+
Ne(e);
|
|
373
392
|
},
|
|
374
393
|
{ immediate: !0, deep: !0 }
|
|
375
|
-
),
|
|
394
|
+
), M(
|
|
376
395
|
() => o.size,
|
|
377
396
|
(e) => {
|
|
378
|
-
|
|
397
|
+
h.value = e;
|
|
379
398
|
}
|
|
380
|
-
),
|
|
381
|
-
() => t(
|
|
399
|
+
), M(
|
|
400
|
+
() => t(S).loading,
|
|
382
401
|
(e) => {
|
|
383
402
|
o.onLoadingChange?.(e);
|
|
384
403
|
}
|
|
385
|
-
),
|
|
386
|
-
submit:
|
|
387
|
-
reset:
|
|
388
|
-
refresh:
|
|
389
|
-
submitWith:
|
|
404
|
+
), ce({
|
|
405
|
+
submit: T,
|
|
406
|
+
reset: E,
|
|
407
|
+
refresh: Q,
|
|
408
|
+
submitWith: J,
|
|
390
409
|
setSearchFormValues: Y,
|
|
391
410
|
getSearchFormValues: X,
|
|
392
|
-
getShowColumns: () => t(
|
|
411
|
+
getShowColumns: () => t(g),
|
|
393
412
|
rowSelection: {
|
|
394
|
-
selectedRows:
|
|
395
|
-
setSelectedRowKeys:
|
|
396
|
-
|
|
413
|
+
selectedRows: n(() => K.value),
|
|
414
|
+
setSelectedRowKeys: Ue,
|
|
415
|
+
setSelectedRows: $e,
|
|
416
|
+
clearAll: z,
|
|
417
|
+
unSelectRows: qe
|
|
397
418
|
},
|
|
398
|
-
scrollToRow:
|
|
399
|
-
getDataSource: () => t(
|
|
400
|
-
getPaging:
|
|
401
|
-
setPaging:
|
|
419
|
+
scrollToRow: eo,
|
|
420
|
+
getDataSource: () => t(S.records),
|
|
421
|
+
getPaging: Ie,
|
|
422
|
+
setPaging: De,
|
|
402
423
|
getSearchFormSorterItems: Z,
|
|
403
|
-
setSearchFormSorterItems:
|
|
404
|
-
resetSearchFormSorterItems:
|
|
405
|
-
refreshCells:
|
|
406
|
-
redrawRows:
|
|
407
|
-
_internalGridApi:
|
|
408
|
-
}), (e, r) => (b(),
|
|
409
|
-
class:
|
|
410
|
-
style:
|
|
424
|
+
setSearchFormSorterItems: ee,
|
|
425
|
+
resetSearchFormSorterItems: oe,
|
|
426
|
+
refreshCells: ro,
|
|
427
|
+
redrawRows: ao,
|
|
428
|
+
_internalGridApi: n(() => s.value)
|
|
429
|
+
}), (e, r) => (b(), V("div", {
|
|
430
|
+
class: f(Qe.value),
|
|
431
|
+
style: W(e.wrapperStyle)
|
|
411
432
|
}, [
|
|
412
|
-
t(
|
|
433
|
+
t(B)(e.dataSource) && e.searchForm !== !1 && t(j).length > 0 ? (b(), V("div", {
|
|
413
434
|
key: 0,
|
|
414
|
-
class:
|
|
415
|
-
style:
|
|
435
|
+
class: f(e.card ? t(k)("search-wrapper") : null),
|
|
436
|
+
style: W(e.searchFormWrapperStyle)
|
|
416
437
|
}, [
|
|
417
|
-
|
|
438
|
+
O(t(vo).SearchForm, G(e.searchForm || {}, {
|
|
418
439
|
ref_key: "formRef",
|
|
419
|
-
ref:
|
|
440
|
+
ref: w,
|
|
420
441
|
"custom-reset": "",
|
|
421
|
-
"submit-loading": t(
|
|
422
|
-
onSubmit: t(
|
|
423
|
-
onReset: t(
|
|
424
|
-
}),
|
|
442
|
+
"submit-loading": t(q).loading,
|
|
443
|
+
onSubmit: t(T),
|
|
444
|
+
onReset: t(E)
|
|
445
|
+
}), uo({
|
|
425
446
|
default: ne(() => [
|
|
426
|
-
(b(!0),
|
|
447
|
+
(b(!0), V(co, null, mo(t(j), (a) => (b(), se(po(a.renderNode), {
|
|
427
448
|
key: a.dataIndex
|
|
428
449
|
}))), 128))
|
|
429
450
|
]),
|
|
430
451
|
_: 2
|
|
431
452
|
}, [
|
|
432
|
-
|
|
453
|
+
L.searchFormExtra ? {
|
|
433
454
|
name: "extra",
|
|
434
455
|
fn: ne(() => [
|
|
435
|
-
|
|
456
|
+
ie(e.$slots, "searchFormExtra")
|
|
436
457
|
]),
|
|
437
458
|
key: "0"
|
|
438
459
|
} : void 0
|
|
439
460
|
]), 1040, ["submit-loading", "onSubmit", "onReset"])
|
|
440
|
-
], 6)) :
|
|
441
|
-
|
|
442
|
-
class:
|
|
443
|
-
style:
|
|
461
|
+
], 6)) : le("", !0),
|
|
462
|
+
F("div", {
|
|
463
|
+
class: f([t(k)("table-wrapper"), e.card ? t(k)("table-wrapper-card") : null]),
|
|
464
|
+
style: W(e.tableWrapperStyle)
|
|
444
465
|
}, [
|
|
445
|
-
|
|
446
|
-
class:
|
|
466
|
+
F("div", {
|
|
467
|
+
class: f(t(u)("header-wrapper"))
|
|
447
468
|
}, [
|
|
448
|
-
|
|
449
|
-
selectedRows: t(
|
|
450
|
-
selectedRowKeys: t(
|
|
451
|
-
shownColumns: t(
|
|
452
|
-
clearAll:
|
|
469
|
+
ie(e.$slots, "title", {
|
|
470
|
+
selectedRows: t(K),
|
|
471
|
+
selectedRowKeys: t(ze),
|
|
472
|
+
shownColumns: t(g),
|
|
473
|
+
clearAll: z
|
|
453
474
|
})
|
|
454
475
|
], 2),
|
|
455
|
-
|
|
476
|
+
F("div", {
|
|
456
477
|
ref_key: "gridWrapperRef",
|
|
457
478
|
ref: ve,
|
|
458
|
-
class:
|
|
479
|
+
class: f(t(u)("grid-wrapper"))
|
|
459
480
|
}, [
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
481
|
+
O(t(wo), G(
|
|
482
|
+
t(ho)(t(fe), t(U), je.value),
|
|
483
|
+
{
|
|
484
|
+
"get-row-class": lo,
|
|
485
|
+
style: Xe.value,
|
|
486
|
+
"row-data": t(S).records,
|
|
487
|
+
"column-defs": t(Re),
|
|
488
|
+
"default-col-def": t(Ce),
|
|
489
|
+
"suppress-loading-overlay": "",
|
|
490
|
+
"row-selection": Ge.value,
|
|
491
|
+
"selection-column-def": t(Te),
|
|
492
|
+
"get-row-id": Ze,
|
|
493
|
+
"get-row-height": o.getRowHeight,
|
|
494
|
+
theme: t(pe),
|
|
495
|
+
"tooltip-show-delay": 500,
|
|
496
|
+
"enable-browser-tooltips": e.browserTooltips,
|
|
497
|
+
"tooltip-interaction": "",
|
|
498
|
+
"row-class-rules": e.rowClassRules,
|
|
499
|
+
"no-rows-overlay-component": Lo,
|
|
500
|
+
"suppress-cell-focus": "",
|
|
501
|
+
"dom-layout": e.autoHeight ? "autoHeight" : "normal",
|
|
502
|
+
onSortChanged: Fe,
|
|
503
|
+
onGridReady: r[0] || (r[0] = (a) => s.value = a.api),
|
|
504
|
+
onRowDataUpdated: I,
|
|
505
|
+
onRowSelected: He,
|
|
506
|
+
onFirstDataRendered: Le,
|
|
507
|
+
onRowClicked: oo,
|
|
508
|
+
onBodyScrollEnd: to
|
|
509
|
+
}
|
|
510
|
+
), null, 16, ["style", "row-data", "column-defs", "default-col-def", "row-selection", "selection-column-def", "get-row-height", "theme", "enable-browser-tooltips", "row-class-rules", "dom-layout"]),
|
|
511
|
+
fo(F("div", {
|
|
512
|
+
class: f(t(k)("table-loading-wrapper"))
|
|
488
513
|
}, [
|
|
489
|
-
|
|
514
|
+
O(t(Co), { delay: 300 })
|
|
490
515
|
], 2), [
|
|
491
|
-
[
|
|
516
|
+
[go, Je.value]
|
|
492
517
|
])
|
|
493
518
|
], 2),
|
|
494
|
-
|
|
495
|
-
class:
|
|
519
|
+
F("div", {
|
|
520
|
+
class: f(t(u)("pagination-wrapper"))
|
|
496
521
|
}, [
|
|
497
|
-
e.pagination !== !1 ? (b(),
|
|
522
|
+
e.pagination !== !1 ? (b(), se(t(Ro), G({
|
|
498
523
|
key: 0,
|
|
499
524
|
class: t(u)("pagination")
|
|
500
|
-
}, t(
|
|
525
|
+
}, t(q).pagination, { onChange: Ye }), null, 16, ["class"])) : le("", !0)
|
|
501
526
|
], 2)
|
|
502
527
|
], 6)
|
|
503
528
|
], 6));
|
|
504
529
|
}
|
|
505
530
|
});
|
|
506
531
|
export {
|
|
507
|
-
|
|
532
|
+
Ct as default
|
|
508
533
|
};
|