@aplus-frontend/ui 0.6.0-beta.1 → 0.6.0-beta.3
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-button/ap-button.vue.mjs +1 -1
- package/es/src/ap-form/search-form/components/popover-sorter/index.vue2.mjs +39 -34
- package/es/src/ap-form/search-form/index.vue.mjs +1 -1
- package/es/src/ap-grid/editable/form-item.vue.mjs +23 -20
- package/es/src/ap-grid/editable/index.vue.mjs +3 -0
- package/es/src/ap-grid/index.vue.mjs +146 -136
- package/es/src/ap-grid/interface.d.ts +1 -1
- package/es/src/ap-grid/utils/table.mjs +32 -32
- package/es/src/ap-table/ap-table.vue2.mjs +206 -199
- package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +1 -1
- package/es/src/ap-tag/ap-tag.vue.d.ts +1 -0
- package/es/src/ap-tag/ap-tag.vue.mjs +18 -12
- package/es/src/ap-tag/interface.d.ts +4 -0
- package/es/src/business/ap-expand-alert/ApExpandAlert.vue2.mjs +11 -12
- package/es/src/business/ap-export-group/ApExportGroup.vue.d.ts +1 -0
- package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +108 -99
- package/es/src/business/ap-export-group/index.d.ts +3 -0
- package/es/src/business/ap-export-group/interface.d.ts +7 -2
- package/es/src/business/ap-table-modal/modal-title.vue2.mjs +2 -2
- package/es/src/business/ap-view/ap-view.vue2.mjs +72 -69
- package/es/src/business/ap-view/components/main-button-content.vue2.mjs +49 -43
- package/es/src/business/ap-view/interface.d.ts +4 -0
- package/es/src/business/hooks/usePageListApGrid.mjs +2 -4
- package/es/src/config-provider/css-var.mjs +2 -2
- package/es/src/locale/lang/en.mjs +1 -1
- package/es/src/locale/lang/zh-cn.mjs +1 -1
- package/lib/src/ap-button/ap-button.vue.js +1 -1
- package/lib/src/ap-form/search-form/components/popover-sorter/index.vue2.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.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.vue.js +1 -1
- package/lib/src/ap-grid/interface.d.ts +1 -1
- 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/components/setting/tree-select/index.vue2.js +1 -1
- package/lib/src/ap-tag/ap-tag.vue.d.ts +1 -0
- package/lib/src/ap-tag/ap-tag.vue.js +1 -1
- package/lib/src/ap-tag/interface.d.ts +4 -0
- package/lib/src/business/ap-expand-alert/ApExpandAlert.vue2.js +1 -1
- package/lib/src/business/ap-export-group/ApExportGroup.vue.d.ts +1 -0
- package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
- package/lib/src/business/ap-export-group/index.d.ts +3 -0
- package/lib/src/business/ap-export-group/interface.d.ts +7 -2
- package/lib/src/business/ap-table-modal/modal-title.vue2.js +1 -1
- package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
- package/lib/src/business/ap-view/components/main-button-content.vue2.js +1 -1
- package/lib/src/business/ap-view/interface.d.ts +4 -0
- package/lib/src/business/hooks/usePageListApGrid.js +1 -1
- package/lib/src/config-provider/css-var.js +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/package.json +4 -4
- package/theme/antd-global-overwrite/admin/index.css +9 -25
- package/theme/antd-global-overwrite/admin/modal.css +6 -22
- package/theme/antd-global-overwrite/admin/modal.less +7 -22
- package/theme/antd-global-overwrite/admin/table.css +3 -3
- package/theme/antd-global-overwrite/admin/table.less +3 -3
- package/theme/antd-global-overwrite/aplus/index.css +9 -19
- package/theme/antd-global-overwrite/aplus/modal.css +6 -16
- package/theme/antd-global-overwrite/aplus/modal.less +7 -17
- package/theme/antd-global-overwrite/aplus/table.css +3 -3
- package/theme/antd-global-overwrite/aplus/table.less +3 -3
- package/theme/ap-appendix/ap-appendix.css +4 -2
- package/theme/ap-appendix/ap-appendix.less +4 -2
- package/theme/ap-attachment/ap-attachment.css +4 -4
- package/theme/ap-attachment/ap-attachment.less +4 -4
- package/theme/ap-batch-action/ap-batch-action.css +6 -3
- package/theme/ap-batch-action/ap-batch-action.less +6 -3
- package/theme/ap-descriptions/ap-descriptions.css +3 -5
- package/theme/ap-descriptions/ap-descriptions.less +3 -5
- package/theme/ap-download/ap-download.css +7 -10
- package/theme/ap-download/ap-download.less +8 -11
- package/theme/ap-expand-alert/ap-expand-alert.css +1 -1
- package/theme/ap-expand-alert/ap-expand-alert.less +3 -4
- package/theme/ap-form/ap-form-item.css +2 -2
- package/theme/ap-form/ap-form-item.less +2 -2
- package/theme/ap-form/index.css +5 -2
- package/theme/ap-form/search-form.css +5 -2
- package/theme/ap-form/search-form.less +3 -0
- package/theme/ap-grid/editable.less +3 -2
- package/theme/ap-grid/index.css +6 -3
- package/theme/ap-grid/index.less +6 -4
- package/theme/ap-ladder/ap-ladder.css +3 -3
- package/theme/ap-ladder/ap-ladder.less +3 -3
- package/theme/ap-select-layout/ap-select-layout.css +8 -8
- package/theme/ap-select-layout/ap-select-layout.less +8 -8
- package/theme/ap-status/ap-status.css +2 -3
- package/theme/ap-status/ap-status.less +2 -4
- package/theme/ap-summary/index.css +3 -3
- package/theme/ap-summary/index.less +3 -3
- package/theme/ap-table/ap-table-index.css +5 -5
- package/theme/ap-table/ap-table-index.less +5 -5
- package/theme/ap-table/ap-table-paragraph-ellipsis.less +1 -1
- package/theme/ap-table/ap-table.css +15 -14
- package/theme/ap-table/ap-table.less +2 -5
- package/theme/ap-table/setting/index.css +3 -3
- package/theme/ap-table/setting/modal.css +1 -2
- package/theme/ap-table/setting/modal.less +1 -2
- package/theme/ap-table/setting/select-group.css +2 -1
- package/theme/ap-table/setting/select-group.less +2 -1
- package/theme/ap-table-modal/index.css +15 -14
- package/theme/ap-tag/ap-tag-group.less +2 -2
- package/theme/ap-tag/ap-tag.css +24 -15
- package/theme/ap-tag/ap-tag.less +37 -24
- package/theme/ap-title/ap-title.css +2 -2
- package/theme/ap-title/ap-title.less +2 -2
- package/theme/ap-upload/index.css +3 -3
- package/theme/ap-upload/multiple-file.css +1 -1
- package/theme/ap-upload/multiple-file.less +1 -1
- package/theme/ap-upload/picture.css +2 -2
- package/theme/ap-upload/picture.less +2 -2
- package/theme/ap-view/ap-view.css +4 -0
- package/theme/ap-view/ap-view.less +4 -0
- package/theme/editable-table/index.css +5 -2
- package/theme/index.css +90 -77
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { VxeTable as
|
|
1
|
+
import { defineComponent as Be, useSlots as Fe, getCurrentInstance as Ie, ref as B, computed as n, unref as o, watch as F, createElementBlock as I, openBlock as s, normalizeStyle as V, normalizeClass as g, createCommentVNode as S, createElementVNode as E, createVNode as X, mergeProps as h, createSlots as J, withCtx as v, Fragment as Q, renderList as L, createBlock as p, resolveDynamicComponent as D, renderSlot as O, normalizeProps as Ee, guardReactiveProps as Pe } from "vue";
|
|
2
|
+
import { VxeTable as Ne, VxeColumn as Y } from "vxe-table";
|
|
3
3
|
import "vxe-table/es/style.css";
|
|
4
4
|
import "vxe-pc-ui/es/style.css";
|
|
5
5
|
import { VxeUI as Z } from "vxe-pc-ui";
|
|
6
|
-
import { isUndefined as
|
|
7
|
-
import { ApForm as
|
|
6
|
+
import { isUndefined as w, omit as Te } from "lodash-unified";
|
|
7
|
+
import { ApForm as ze } from "../ap-form/index.mjs";
|
|
8
8
|
import "../config-provider/index.mjs";
|
|
9
|
-
import { noRenderAsFormItemValueList as
|
|
10
|
-
import { getColumnOrder as ee, updateFormProps as
|
|
11
|
-
import { useTablePaging as
|
|
12
|
-
import { Empty as ae, Pagination as
|
|
13
|
-
import { useInnerParams as
|
|
14
|
-
import { toVxeProps as
|
|
15
|
-
import
|
|
16
|
-
import { useProvideApTable as
|
|
17
|
-
import { sizeReverseMap as
|
|
18
|
-
import { useRenderColumns as
|
|
19
|
-
import { useToken as
|
|
9
|
+
import { noRenderAsFormItemValueList as _e } from "../ap-table/constants.mjs";
|
|
10
|
+
import { getColumnOrder as ee, updateFormProps as Ae, getFieldProps as Ve, getSearchFormItemRenderNode as Le, recursionApColumns as oe } from "../ap-table/utils.mjs";
|
|
11
|
+
import { useTablePaging as De } from "../ap-table/hooks/use-table-paging-ng.mjs";
|
|
12
|
+
import { Empty as ae, Pagination as Oe } from "@aplus-frontend/antdv";
|
|
13
|
+
import { useInnerParams as $e } from "./hooks/use-inner-params.mjs";
|
|
14
|
+
import { toVxeProps as Ke, getRowExpandProps as We, getRowSelectionProps as je } from "./utils/table.mjs";
|
|
15
|
+
import He from "../ap-table/hooks/use-table-row-selection.mjs";
|
|
16
|
+
import { useProvideApTable as Me } from "../ap-table/context.mjs";
|
|
17
|
+
import { sizeReverseMap as qe, sizeMap as Ue, ROW_SELECTION_FIELD as Ge } from "./constants.mjs";
|
|
18
|
+
import { useRenderColumns as Xe } from "./hooks/use-render-columns.mjs";
|
|
19
|
+
import { useToken as Je } from "@aplus-frontend/antdv/es/theme/internal";
|
|
20
20
|
import "../scroll-bar/index.mjs";
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import
|
|
25
|
-
|
|
21
|
+
import { isDef as Qe } from "../utils/index.mjs";
|
|
22
|
+
import { getValidVNodeList as Ye } from "../utils/slot.mjs";
|
|
23
|
+
import { useNamespace as Ze } from "../config-provider/hooks/use-namespace.mjs";
|
|
24
|
+
import { useGlobalConfig as eo } from "../config-provider/hooks/use-global-config.mjs";
|
|
25
|
+
import { useLocale as oo } from "../config-provider/hooks/use-locale.mjs";
|
|
26
|
+
import ao from "../scroll-bar/index.vue.mjs";
|
|
27
|
+
const No = /* @__PURE__ */ Be({
|
|
26
28
|
name: "ApGrid",
|
|
27
29
|
__name: "index",
|
|
28
30
|
props: {
|
|
@@ -85,6 +87,7 @@ const Bo = /* @__PURE__ */ ke({
|
|
|
85
87
|
loadingConfig: {},
|
|
86
88
|
headerCellConfig: {},
|
|
87
89
|
footerCellConfig: {},
|
|
90
|
+
round: { type: Boolean, default: void 0 },
|
|
88
91
|
columns: {},
|
|
89
92
|
rowSelection: { type: Boolean },
|
|
90
93
|
card: { type: Boolean, default: !1 },
|
|
@@ -100,7 +103,7 @@ const Bo = /* @__PURE__ */ ke({
|
|
|
100
103
|
searchFormWrapperStyle: {},
|
|
101
104
|
tableWrapperStyle: {},
|
|
102
105
|
wrapperStyle: {},
|
|
103
|
-
manual: { type: Boolean, default:
|
|
106
|
+
manual: { type: Boolean, default: void 0 },
|
|
104
107
|
size: { default: "mini" },
|
|
105
108
|
adaptive: { type: Boolean, default: !1 },
|
|
106
109
|
columnResizable: { type: [Boolean, Object], default: !1 },
|
|
@@ -112,15 +115,15 @@ const Bo = /* @__PURE__ */ ke({
|
|
|
112
115
|
},
|
|
113
116
|
setup(re, { expose: te }) {
|
|
114
117
|
var G;
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
const { e:
|
|
118
|
+
const C = Fe(), a = re, x = (G = Ie()) == null ? void 0 : G.appContext.app;
|
|
119
|
+
x && !x.__VXE_PC_UI_INSTALLED__ && (x.use(Z), x.__VXE_PC_UI_INSTALLED__ = !0);
|
|
120
|
+
const { e: P, b: u, be: le } = Ze("ap-grid"), ne = eo("valueTypeMap"), i = B([]), $ = B([]), m = B(), y = B(a.size), [, d] = Je(), { t: se } = oo();
|
|
118
121
|
Z.setConfig({
|
|
119
122
|
i18n: (e, r) => se(`ap.${e}`, r)
|
|
120
123
|
});
|
|
121
|
-
const { renderConfig: ie, updateSignal: de } =
|
|
124
|
+
const { renderConfig: ie, updateSignal: de } = Xe(i);
|
|
122
125
|
let K = 0;
|
|
123
|
-
const
|
|
126
|
+
const ue = n(() => {
|
|
124
127
|
if (m.value)
|
|
125
128
|
return m.value.$el.querySelector(
|
|
126
129
|
".vxe-table--header-inner-wrapper"
|
|
@@ -128,34 +131,40 @@ const Bo = /* @__PURE__ */ ke({
|
|
|
128
131
|
}), W = n(() => {
|
|
129
132
|
var e, r, l;
|
|
130
133
|
return K++, ((l = (r = (e = a.columns) == null ? void 0 : e.filter(
|
|
131
|
-
(t) => !t.hideInSearch && t.dataIndex && (t.valueType || t.customRenderFormItem) && !
|
|
132
|
-
)) == null ? void 0 : r.sort((t,
|
|
133
|
-
let
|
|
134
|
-
return ee(
|
|
134
|
+
(t) => !t.hideInSearch && t.dataIndex && (t.valueType || t.customRenderFormItem) && !_e.includes(t.valueType)
|
|
135
|
+
)) == null ? void 0 : r.sort((t, c) => {
|
|
136
|
+
let b = ee(t.order);
|
|
137
|
+
return ee(c.order) - b;
|
|
135
138
|
})) == null ? void 0 : l.map((t) => {
|
|
136
|
-
const
|
|
139
|
+
const c = Ae(
|
|
137
140
|
t,
|
|
138
|
-
|
|
139
|
-
),
|
|
141
|
+
Ve(t.fieldProps, {})
|
|
142
|
+
), b = {
|
|
140
143
|
...t,
|
|
141
144
|
fieldProps: {
|
|
142
145
|
label: t.title,
|
|
143
146
|
name: t.dataIndex,
|
|
144
|
-
...
|
|
147
|
+
...c || {},
|
|
145
148
|
_signal: K
|
|
146
149
|
},
|
|
147
150
|
renderNode: void 0
|
|
148
151
|
};
|
|
149
|
-
return
|
|
150
|
-
|
|
152
|
+
return b.renderNode = Le(
|
|
153
|
+
b,
|
|
151
154
|
o(ne)
|
|
152
|
-
),
|
|
155
|
+
), b;
|
|
153
156
|
})) || [];
|
|
154
|
-
}),
|
|
155
|
-
|
|
156
|
-
a.
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
}), ce = n(() => {
|
|
158
|
+
var r;
|
|
159
|
+
return Qe(a.manual) ? a.manual : Ye(((r = C.searchFormExtra) == null ? void 0 : r.call(C)) || []).some((l) => {
|
|
160
|
+
var t;
|
|
161
|
+
return ((t = l.type) == null ? void 0 : t.name) === "ApView";
|
|
162
|
+
});
|
|
163
|
+
}), pe = n(() => [
|
|
164
|
+
u(),
|
|
165
|
+
a.card ? null : u("wrapper"),
|
|
166
|
+
a.adaptive ? u("adaptive") : null,
|
|
167
|
+
a.sticky ? u("sticky") : null
|
|
159
168
|
].filter(Boolean)), j = n(() => oe(o(i), (e) => {
|
|
160
169
|
if (e.sorter === !0)
|
|
161
170
|
return e.key || e.dataIndex;
|
|
@@ -163,18 +172,18 @@ const Bo = /* @__PURE__ */ ke({
|
|
|
163
172
|
if (e.filters && !e.onFilter)
|
|
164
173
|
return e.key || e.dataIndex;
|
|
165
174
|
}).filter(Boolean)), {
|
|
166
|
-
formRef:
|
|
167
|
-
submit:
|
|
168
|
-
reset:
|
|
169
|
-
refresh:
|
|
175
|
+
formRef: N,
|
|
176
|
+
submit: T,
|
|
177
|
+
reset: z,
|
|
178
|
+
refresh: me,
|
|
170
179
|
data: f,
|
|
171
180
|
tableProps: M,
|
|
172
|
-
setDataSource:
|
|
173
|
-
handleTableChange:
|
|
174
|
-
} =
|
|
181
|
+
setDataSource: fe,
|
|
182
|
+
handleTableChange: ge
|
|
183
|
+
} = De({
|
|
175
184
|
async request(e) {
|
|
176
185
|
var l;
|
|
177
|
-
if (!
|
|
186
|
+
if (!k.value.preserveSelectedRowKeys && w(a.dataSource) && A(), !w(a.dataSource)) {
|
|
178
187
|
const t = e.pageSize * (e.current - 1);
|
|
179
188
|
return {
|
|
180
189
|
data: (a.pagination === !1 ? a.dataSource : a.dataSource.slice(t, t + e.pageSize)) || [],
|
|
@@ -192,20 +201,20 @@ const Bo = /* @__PURE__ */ ke({
|
|
|
192
201
|
sortFields: j,
|
|
193
202
|
defaultParams: a.params,
|
|
194
203
|
defaultData: a.defaultData,
|
|
195
|
-
manual:
|
|
204
|
+
manual: o(ce),
|
|
196
205
|
formatParams: a.beforeSearchSubmit,
|
|
197
206
|
pagination: a.pagination
|
|
198
|
-
}), { sortChangeEvent:
|
|
199
|
-
|
|
207
|
+
}), { sortChangeEvent: he, filterChangeEvent: ve, paginationChangeEvent: Ce } = $e(ge);
|
|
208
|
+
Me({
|
|
200
209
|
columns: n(() => i.value),
|
|
201
210
|
columnsBackup: n(() => $.value),
|
|
202
|
-
size: n(() =>
|
|
211
|
+
size: n(() => y.value ? Ue[y.value] : "middle"),
|
|
203
212
|
updateColumns(e) {
|
|
204
213
|
var r;
|
|
205
214
|
i.value = e, (r = a.onShownColumnsChange) == null || r.call(a, e);
|
|
206
215
|
},
|
|
207
216
|
updateSize(e) {
|
|
208
|
-
|
|
217
|
+
y.value = qe[e];
|
|
209
218
|
},
|
|
210
219
|
renderConfig: n(() => ({
|
|
211
220
|
className: le("table-header", "title"),
|
|
@@ -214,115 +223,115 @@ const Bo = /* @__PURE__ */ ke({
|
|
|
214
223
|
dataSource: n(() => o(f).records),
|
|
215
224
|
getSearchFormValues: U,
|
|
216
225
|
setSearchFormValues: q,
|
|
217
|
-
submit:
|
|
218
|
-
reset:
|
|
226
|
+
submit: T,
|
|
227
|
+
reset: z
|
|
219
228
|
});
|
|
220
|
-
const
|
|
229
|
+
const ye = n(
|
|
221
230
|
() => i.value.some(
|
|
222
231
|
(e) => e.fixed === "left" || e.fixed === !0
|
|
223
232
|
) ? "left" : void 0
|
|
224
|
-
),
|
|
225
|
-
() =>
|
|
233
|
+
), be = n(
|
|
234
|
+
() => w(a.loading) ? f.loading : a.loading
|
|
226
235
|
), Se = n(
|
|
227
|
-
() =>
|
|
228
|
-
), { selectedRows:
|
|
236
|
+
() => w(a.dataSource) ? f.records : a.dataSource
|
|
237
|
+
), { selectedRows: R, rowSelection: k, ...we } = He({
|
|
229
238
|
...a.rowSelection === !0 ? {} : a.rowSelection,
|
|
230
239
|
dataSource: Se,
|
|
231
240
|
rowKey: a.rowKey
|
|
232
|
-
}),
|
|
241
|
+
}), _ = () => {
|
|
233
242
|
const e = m.value;
|
|
234
|
-
e && (
|
|
243
|
+
e && (R.value = [
|
|
235
244
|
...e.getCheckboxReserveRecords(),
|
|
236
245
|
...e.getCheckboxRecords()
|
|
237
246
|
]);
|
|
238
|
-
},
|
|
247
|
+
}, xe = () => {
|
|
239
248
|
const e = m.value;
|
|
240
|
-
e && (
|
|
249
|
+
e && (R.value = [e.getRadioRecord()]);
|
|
241
250
|
};
|
|
242
|
-
function
|
|
251
|
+
function Re() {
|
|
243
252
|
var e;
|
|
244
253
|
return ((e = a.columns) == null ? void 0 : e.filter((r) => !r.hideInTable)) || [];
|
|
245
254
|
}
|
|
246
255
|
function q(e) {
|
|
247
256
|
var r, l, t;
|
|
248
|
-
(t = (l = (r =
|
|
257
|
+
(t = (l = (r = N.value) == null ? void 0 : r.apForm) == null ? void 0 : l.setFieldsValue) == null || t.call(l, e);
|
|
249
258
|
}
|
|
250
259
|
function U(e = !1) {
|
|
251
|
-
var l, t,
|
|
260
|
+
var l, t, c;
|
|
252
261
|
const r = e ? "getFieldsValueTransformed" : "getFieldsValue";
|
|
253
|
-
return (
|
|
262
|
+
return (c = (t = (l = N.value) == null ? void 0 : l.apForm) == null ? void 0 : t[r]) == null ? void 0 : c.call(t, !0);
|
|
254
263
|
}
|
|
255
|
-
function
|
|
256
|
-
|
|
264
|
+
function A() {
|
|
265
|
+
we.clearAll();
|
|
257
266
|
const e = m.value;
|
|
258
|
-
e && (
|
|
267
|
+
e && (k.value.type === "radio" ? (e.clearRadioRow(), e.clearRadioReserve()) : (e.clearCheckboxRow(), e.clearCheckboxReserve()));
|
|
259
268
|
}
|
|
260
|
-
async function
|
|
269
|
+
async function ke(e, r) {
|
|
261
270
|
var t;
|
|
262
271
|
const l = f.records[e];
|
|
263
272
|
if (l)
|
|
264
273
|
return (t = m.value) == null ? void 0 : t.scrollToRow(l, r);
|
|
265
274
|
}
|
|
266
|
-
return
|
|
275
|
+
return F(
|
|
267
276
|
() => [a.columnResizable, a.columns],
|
|
268
277
|
() => {
|
|
269
278
|
var r;
|
|
270
|
-
const e =
|
|
279
|
+
const e = Re();
|
|
271
280
|
i.value = e, (r = a.onShownColumnsChange) == null || r.call(a, e), $.value = e;
|
|
272
281
|
},
|
|
273
282
|
{
|
|
274
283
|
deep: !0,
|
|
275
284
|
immediate: !0
|
|
276
285
|
}
|
|
277
|
-
),
|
|
286
|
+
), F(
|
|
278
287
|
() => a.dataSource,
|
|
279
288
|
(e) => {
|
|
280
|
-
|
|
289
|
+
fe(e);
|
|
281
290
|
},
|
|
282
291
|
{ immediate: !0, deep: !0 }
|
|
283
|
-
),
|
|
292
|
+
), F(
|
|
284
293
|
() => o(f).loading,
|
|
285
294
|
(e) => {
|
|
286
295
|
var r;
|
|
287
296
|
(r = a.onLoadingChange) == null || r.call(a, e);
|
|
288
297
|
}
|
|
289
|
-
),
|
|
298
|
+
), F(
|
|
290
299
|
() => a.size,
|
|
291
300
|
(e) => {
|
|
292
|
-
|
|
301
|
+
y.value = e;
|
|
293
302
|
}
|
|
294
303
|
), te({
|
|
295
|
-
submit:
|
|
296
|
-
reset:
|
|
297
|
-
refresh:
|
|
304
|
+
submit: T,
|
|
305
|
+
reset: z,
|
|
306
|
+
refresh: me,
|
|
298
307
|
setSearchFormValues: q,
|
|
299
308
|
getSearchFormValues: U,
|
|
300
309
|
getShowColumns: () => o(i),
|
|
301
310
|
rowSelection: {
|
|
302
|
-
selectedRows: n(() =>
|
|
303
|
-
clearAll:
|
|
311
|
+
selectedRows: n(() => R.value),
|
|
312
|
+
clearAll: A
|
|
304
313
|
},
|
|
305
|
-
scrollToRow:
|
|
314
|
+
scrollToRow: ke,
|
|
306
315
|
getDataSource: () => o(f.records)
|
|
307
|
-
}), (e, r) => (s(),
|
|
308
|
-
class: g(
|
|
309
|
-
style:
|
|
316
|
+
}), (e, r) => (s(), I("div", {
|
|
317
|
+
class: g(pe.value),
|
|
318
|
+
style: V(e.wrapperStyle)
|
|
310
319
|
}, [
|
|
311
|
-
o(
|
|
320
|
+
o(w)(e.dataSource) && e.searchForm !== !1 && W.value.length > 0 ? (s(), I("div", {
|
|
312
321
|
key: 0,
|
|
313
|
-
class: g(e.card ? o(
|
|
314
|
-
style:
|
|
322
|
+
class: g(e.card ? o(P)("search-wrapper") : null),
|
|
323
|
+
style: V(e.searchFormWrapperStyle)
|
|
315
324
|
}, [
|
|
316
|
-
X(o(
|
|
325
|
+
X(o(ze).SearchForm, h(e.searchForm || {}, {
|
|
317
326
|
ref_key: "formRef",
|
|
318
|
-
ref:
|
|
327
|
+
ref: N,
|
|
319
328
|
"custom-reset": "",
|
|
320
329
|
"submit-loading": o(M).loading,
|
|
321
|
-
onSubmit: o(
|
|
322
|
-
onReset: o(
|
|
330
|
+
onSubmit: o(T),
|
|
331
|
+
onReset: o(z)
|
|
323
332
|
}), J({
|
|
324
333
|
default: v(() => [
|
|
325
|
-
(s(!0),
|
|
334
|
+
(s(!0), I(Q, null, L(W.value, (l) => (s(), p(D(l.renderNode.Comp), h({
|
|
326
335
|
key: l.dataIndex,
|
|
327
336
|
item: l,
|
|
328
337
|
ref_for: !0
|
|
@@ -333,40 +342,40 @@ const Bo = /* @__PURE__ */ ke({
|
|
|
333
342
|
]),
|
|
334
343
|
_: 2
|
|
335
344
|
}, [
|
|
336
|
-
|
|
345
|
+
C.searchFormExtra ? {
|
|
337
346
|
name: "extra",
|
|
338
347
|
fn: v(() => [
|
|
339
|
-
|
|
348
|
+
O(e.$slots, "searchFormExtra")
|
|
340
349
|
]),
|
|
341
350
|
key: "0"
|
|
342
351
|
} : void 0
|
|
343
352
|
]), 1040, ["submit-loading", "onSubmit", "onReset"])
|
|
344
353
|
], 6)) : S("", !0),
|
|
345
|
-
|
|
346
|
-
class: g([o(
|
|
347
|
-
style:
|
|
354
|
+
E("div", {
|
|
355
|
+
class: g([o(P)("table-wrapper"), e.card ? o(P)("table-wrapper-card") : null]),
|
|
356
|
+
style: V(e.tableWrapperStyle)
|
|
348
357
|
}, [
|
|
349
|
-
|
|
350
|
-
class: g(o(
|
|
358
|
+
E("div", {
|
|
359
|
+
class: g(o(u)("header-wrapper"))
|
|
351
360
|
}, [
|
|
352
|
-
|
|
353
|
-
selectedRows: o(
|
|
354
|
-
selectedRowKeys: o(
|
|
361
|
+
O(e.$slots, "title", {
|
|
362
|
+
selectedRows: o(R),
|
|
363
|
+
selectedRowKeys: o(k).selectedRowKeys,
|
|
355
364
|
shownColumns: i.value,
|
|
356
|
-
clearAll:
|
|
365
|
+
clearAll: A
|
|
357
366
|
})
|
|
358
367
|
], 2),
|
|
359
|
-
|
|
360
|
-
class: g(o(
|
|
368
|
+
E("div", {
|
|
369
|
+
class: g(o(u)("vxe-wrapper"))
|
|
361
370
|
}, [
|
|
362
|
-
(s(), p(o(
|
|
371
|
+
(s(), p(o(Ne), h(o(Ke)(a), {
|
|
363
372
|
ref_key: "tableRef",
|
|
364
373
|
ref: m,
|
|
365
374
|
key: o(de),
|
|
366
375
|
data: o(f).records,
|
|
367
376
|
"sort-config": { remote: j.value.length > 0 },
|
|
368
377
|
"filter-config": { remote: H.value.length > 0 },
|
|
369
|
-
loading:
|
|
378
|
+
loading: be.value,
|
|
370
379
|
style: {
|
|
371
380
|
"--vxe-ui-table-row-checkbox-checked-background-color": o(d).controlItemBgActive,
|
|
372
381
|
"--vxe-ui-table-row-hover-checkbox-checked-background-color": o(d).controlItemBgActiveHover,
|
|
@@ -379,15 +388,16 @@ const Bo = /* @__PURE__ */ ke({
|
|
|
379
388
|
"--vxe-ui-font-color": o(d).colorTextBase,
|
|
380
389
|
"--vxe-ui-table-border-color": o(d).colorBorderSecondary,
|
|
381
390
|
"--vxe-ui-table-header-font-color": o(d).colorTextBase,
|
|
382
|
-
"--vxe-ui-table-cell-padding-mini": "8px"
|
|
391
|
+
"--vxe-ui-table-cell-padding-mini": "8px",
|
|
392
|
+
"--vxe-ui-table-row-line-height": "18px"
|
|
383
393
|
},
|
|
384
|
-
size:
|
|
385
|
-
onSortChange: o(
|
|
386
|
-
onFilterChange: o(
|
|
387
|
-
onCheckboxChange:
|
|
388
|
-
onCheckboxRangeChange:
|
|
389
|
-
onCheckboxAll:
|
|
390
|
-
onRadioChange:
|
|
394
|
+
size: y.value,
|
|
395
|
+
onSortChange: o(he),
|
|
396
|
+
onFilterChange: o(ve),
|
|
397
|
+
onCheckboxChange: _,
|
|
398
|
+
onCheckboxRangeChange: _,
|
|
399
|
+
onCheckboxAll: _,
|
|
400
|
+
onRadioChange: xe
|
|
391
401
|
}), J({
|
|
392
402
|
empty: v(() => [
|
|
393
403
|
X(o(ae), {
|
|
@@ -395,45 +405,45 @@ const Bo = /* @__PURE__ */ ke({
|
|
|
395
405
|
}, null, 8, ["image"])
|
|
396
406
|
]),
|
|
397
407
|
default: v(() => [
|
|
398
|
-
a.expandable ? (s(), p(o(Y), h({ key: 0 }, o(
|
|
408
|
+
a.expandable ? (s(), p(o(Y), h({ key: 0 }, o(We)(e.expandable), { fixed: ye.value }), {
|
|
399
409
|
content: v((l) => [
|
|
400
|
-
(s(), p(
|
|
410
|
+
(s(), p(D(a.expandable.renderContent(l))))
|
|
401
411
|
]),
|
|
402
412
|
_: 1
|
|
403
413
|
}, 16, ["fixed"])) : S("", !0),
|
|
404
|
-
a.rowSelection ? (s(), p(o(Y), h({ key: 1 }, o(
|
|
405
|
-
(s(!0),
|
|
414
|
+
a.rowSelection ? (s(), p(o(Y), h({ key: 1 }, o(je)(o(k), i.value), { field: o(Ge) }), null, 16, ["field"])) : S("", !0),
|
|
415
|
+
(s(!0), I(Q, null, L(o(ie), (l) => (s(), p(D(l), {
|
|
406
416
|
key: l.props.colId
|
|
407
417
|
}))), 128))
|
|
408
418
|
]),
|
|
409
419
|
_: 2
|
|
410
420
|
}, [
|
|
411
|
-
|
|
421
|
+
L(o(Te)(C, ["searchFormExtra"]), (l, t) => ({
|
|
412
422
|
name: t,
|
|
413
|
-
fn: v((
|
|
414
|
-
|
|
423
|
+
fn: v((c) => [
|
|
424
|
+
O(e.$slots, t, Ee(Pe(c || {})))
|
|
415
425
|
])
|
|
416
426
|
}))
|
|
417
427
|
]), 1040, ["data", "sort-config", "filter-config", "loading", "style", "size", "onSortChange", "onFilterChange"]))
|
|
418
428
|
], 2),
|
|
419
|
-
|
|
420
|
-
class: g(o(
|
|
429
|
+
E("div", {
|
|
430
|
+
class: g(o(u)("pagination-wrapper"))
|
|
421
431
|
}, [
|
|
422
|
-
e.sticky ? (s(), p(o(
|
|
432
|
+
e.sticky ? (s(), p(o(ao), {
|
|
423
433
|
key: 0,
|
|
424
434
|
direction: "horizontal",
|
|
425
|
-
"scroll-container":
|
|
435
|
+
"scroll-container": ue.value,
|
|
426
436
|
"extra-size": -4.2
|
|
427
437
|
}, null, 8, ["scroll-container"])) : S("", !0),
|
|
428
|
-
e.pagination !== !1 ? (s(), p(o(
|
|
438
|
+
e.pagination !== !1 ? (s(), p(o(Oe), h({
|
|
429
439
|
key: 1,
|
|
430
|
-
class: o(
|
|
431
|
-
}, o(M).pagination, { onChange: o(
|
|
440
|
+
class: o(u)("pagination")
|
|
441
|
+
}, o(M).pagination, { onChange: o(Ce) }), null, 16, ["class", "onChange"])) : S("", !0)
|
|
432
442
|
], 2)
|
|
433
443
|
], 6)
|
|
434
444
|
], 6));
|
|
435
445
|
}
|
|
436
446
|
});
|
|
437
447
|
export {
|
|
438
|
-
|
|
448
|
+
No as default
|
|
439
449
|
};
|
|
@@ -119,7 +119,7 @@ export type ApGridRowSelection<RecordType> = Pick<TableRowSelection<RecordType>,
|
|
|
119
119
|
*/
|
|
120
120
|
range?: boolean;
|
|
121
121
|
};
|
|
122
|
-
export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection' | 'rowKey' | 'rowClassName' | 'footer' | 'loading'> & Pick<VxeTableProps<RecordType>, 'rowClassName' | 'stripe' | 'headerRowClassName' | 'footerRowClassName' | 'cellClassName' | 'headerCellClassName' | 'footerCellClassName' | 'rowStyle' | 'headerRowStyle' | 'footerRowStyle' | 'cellStyle' | 'headerCellStyle' | 'footerCellStyle' | 'height' | 'minHeight' | 'maxHeight' | 'mergeCells' | 'mergeFooterItems' | 'cellConfig' | 'loading' | 'loadingConfig' | 'headerCellConfig' | 'footerCellConfig'> & {
|
|
122
|
+
export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection' | 'rowKey' | 'rowClassName' | 'footer' | 'loading'> & Pick<VxeTableProps<RecordType>, 'rowClassName' | 'stripe' | 'headerRowClassName' | 'footerRowClassName' | 'cellClassName' | 'headerCellClassName' | 'footerCellClassName' | 'rowStyle' | 'headerRowStyle' | 'footerRowStyle' | 'cellStyle' | 'headerCellStyle' | 'footerCellStyle' | 'height' | 'minHeight' | 'maxHeight' | 'mergeCells' | 'mergeFooterItems' | 'cellConfig' | 'loading' | 'loadingConfig' | 'headerCellConfig' | 'footerCellConfig' | 'round'> & {
|
|
123
123
|
/**
|
|
124
124
|
* 列配置
|
|
125
125
|
*/
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import { omit as
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { omit as u, isUndefined as l, isFunction as h, isNumber as m } from "lodash-unified";
|
|
2
|
+
import { isDef as w } from "../../utils/index.mjs";
|
|
3
|
+
const y = 20, C = 50, b = (e) => e.some((t) => !!t.html);
|
|
4
|
+
function v(e) {
|
|
4
5
|
var i;
|
|
5
6
|
const t = {
|
|
6
|
-
...
|
|
7
|
+
...u(e, [
|
|
7
8
|
"columns",
|
|
8
9
|
"request",
|
|
9
10
|
"searchForm",
|
|
10
11
|
"dataSource",
|
|
11
12
|
"rowKey",
|
|
12
|
-
"value"
|
|
13
|
+
"value",
|
|
14
|
+
"round"
|
|
13
15
|
])
|
|
14
16
|
};
|
|
15
|
-
if (
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
if (t.rowConfig = {
|
|
18
|
+
isHover: !0,
|
|
19
|
+
keyField: e.rowKey
|
|
20
|
+
}, 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) {
|
|
18
21
|
const o = e.rowSelection === !0 ? {} : e.rowSelection;
|
|
19
22
|
o.type === "radio" ? t.radioConfig = {
|
|
20
23
|
highlight: !0,
|
|
@@ -25,7 +28,7 @@ function R(e) {
|
|
|
25
28
|
return o.shown ? o.shown(r) : !0;
|
|
26
29
|
},
|
|
27
30
|
checkRowKey: (i = o.defaultSelectedRowKeys) == null ? void 0 : i[0],
|
|
28
|
-
reserve:
|
|
31
|
+
reserve: l(o.preserveSelectedRowKeys) ? !0 : o.preserveSelectedRowKeys
|
|
29
32
|
} : t.checkboxConfig = {
|
|
30
33
|
highlight: !0,
|
|
31
34
|
checkMethod({ row: r }) {
|
|
@@ -35,11 +38,11 @@ function R(e) {
|
|
|
35
38
|
return o.shown ? o.shown(r) : !0;
|
|
36
39
|
},
|
|
37
40
|
checkRowKeys: o.defaultSelectedRowKeys,
|
|
38
|
-
reserve:
|
|
41
|
+
reserve: l(o.preserveSelectedRowKeys) ? !0 : o.preserveSelectedRowKeys,
|
|
39
42
|
range: o.range || !1
|
|
40
43
|
};
|
|
41
44
|
}
|
|
42
|
-
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 = u(e.expandable, [
|
|
43
46
|
"renderContent",
|
|
44
47
|
"width",
|
|
45
48
|
"title"
|
|
@@ -47,34 +50,31 @@ function R(e) {
|
|
|
47
50
|
enabled: !1
|
|
48
51
|
}, t.virtualYConfig = {
|
|
49
52
|
enabled: !1
|
|
50
|
-
}) : (
|
|
51
|
-
isHover: !0,
|
|
52
|
-
keyField: e.rowKey
|
|
53
|
-
}, t.round = !0, t;
|
|
53
|
+
}) : (f(t, "X", e.virtual), f(t, "Y", e.virtual)), t.round = w(e.round) ? e.round : !e.card, t;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
const
|
|
57
|
-
e[
|
|
58
|
-
enabled:
|
|
55
|
+
function f(e, t, n) {
|
|
56
|
+
const i = t === "X", o = i ? "x" : "y", r = i ? "virtualXConfig" : "virtualYConfig", d = n == null ? void 0 : n[o], a = d !== !1, s = i ? y : C, c = m(d) && d >= 0 ? d : s;
|
|
57
|
+
e[r] = {
|
|
58
|
+
enabled: a,
|
|
59
59
|
gt: c,
|
|
60
|
-
oSize: (
|
|
60
|
+
oSize: (n == null ? void 0 : n.oSize) || 0
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
function x(e) {
|
|
64
64
|
return e === !0 ? "left" : e;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
const
|
|
68
|
-
let
|
|
69
|
-
return
|
|
70
|
-
(
|
|
66
|
+
function K(e, t) {
|
|
67
|
+
const n = e === !0 || !e.type ? "checkbox" : e.type, i = e === !0 ? 60 : e.columnWidth || 60;
|
|
68
|
+
let o = e === !0 ? void 0 : x(e.fixed);
|
|
69
|
+
return o || (o === !1 ? o = void 0 : o = t.some(
|
|
70
|
+
(r) => r.fixed === "left" || r.fixed === !0
|
|
71
71
|
) ? "left" : void 0), {
|
|
72
|
-
type:
|
|
73
|
-
width:
|
|
74
|
-
fixed:
|
|
72
|
+
type: n,
|
|
73
|
+
width: i,
|
|
74
|
+
fixed: o
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function k(e) {
|
|
78
78
|
const t = (e == null ? void 0 : e.width) || "auto";
|
|
79
79
|
return {
|
|
80
80
|
type: "expand",
|
|
@@ -83,7 +83,7 @@ function g(e) {
|
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
85
|
export {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
k as getRowExpandProps,
|
|
87
|
+
K as getRowSelectionProps,
|
|
88
|
+
v as toVxeProps
|
|
89
89
|
};
|