vxe-table 3.16.0-beta.0 → 3.16.0-beta.2
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/grid/src/grid.js +864 -690
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/mixin.js +0 -4
- package/es/table/module/custom/panel.js +0 -1
- package/es/table/module/keyboard/mixin.js +2 -2
- package/es/table/src/anime.js +46 -0
- package/es/table/src/body.js +15 -40
- package/es/table/src/columnInfo.js +6 -1
- package/es/table/src/footer.js +1 -19
- package/es/table/src/header.js +1 -19
- package/es/table/src/methods.js +532 -346
- package/es/table/src/table.js +22 -3
- package/es/table/style.css +8 -8
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +3 -2
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +8 -8
- package/es/vxe-table/style.min.css +1 -1
- package/lib/grid/src/grid.js +969 -808
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +1595 -1245
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/mixin.js +0 -4
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/custom/panel.js +0 -1
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +2 -2
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/src/anime.js +56 -0
- package/lib/table/src/anime.min.js +1 -0
- package/lib/table/src/body.js +3 -28
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/columnInfo.js +6 -1
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +1 -19
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +1 -19
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +539 -355
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +22 -2
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +8 -8
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +3 -2
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +8 -8
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/grid/src/grid.ts +1005 -777
- package/packages/table/module/custom/mixin.ts +0 -4
- package/packages/table/module/custom/panel.ts +0 -1
- package/packages/table/module/keyboard/mixin.ts +2 -2
- package/packages/table/src/anime.ts +52 -0
- package/packages/table/src/body.ts +15 -40
- package/packages/table/src/columnInfo.ts +6 -1
- package/packages/table/src/footer.ts +1 -19
- package/packages/table/src/header.ts +1 -20
- package/packages/table/src/methods.ts +554 -360
- package/packages/table/src/props.ts +4 -4
- package/packages/table/src/table.ts +22 -3
- package/packages/ui/index.ts +2 -1
- package/styles/components/table.scss +9 -9
- /package/es/{iconfont.1750770351840.ttf → iconfont.1751194972120.ttf} +0 -0
- /package/es/{iconfont.1750770351840.woff → iconfont.1751194972120.woff} +0 -0
- /package/es/{iconfont.1750770351840.woff2 → iconfont.1751194972120.woff2} +0 -0
- /package/lib/{iconfont.1750770351840.ttf → iconfont.1751194972120.ttf} +0 -0
- /package/lib/{iconfont.1750770351840.woff → iconfont.1751194972120.woff} +0 -0
- /package/lib/{iconfont.1750770351840.woff2 → iconfont.1751194972120.woff2} +0 -0
package/lib/grid/src/grid.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
var _comp = require("../../ui/src/comp");
|
|
7
8
|
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
8
9
|
var _utils = require("../../ui/src/utils");
|
|
9
10
|
var _dom = require("../../ui/src/dom");
|
|
@@ -20,170 +21,13 @@ const {
|
|
|
20
21
|
commands,
|
|
21
22
|
globalEvents,
|
|
22
23
|
globalMixins,
|
|
24
|
+
createEvent,
|
|
25
|
+
GLOBAL_EVENT_KEYS,
|
|
23
26
|
renderEmptyElement
|
|
24
27
|
} = _ui.VxeUI;
|
|
25
|
-
const
|
|
28
|
+
const tableMethods = {};
|
|
26
29
|
const propKeys = Object.keys(_props.default);
|
|
27
30
|
const defaultLayouts = [['Form'], ['Toolbar', 'Top', 'Table', 'Bottom', 'Pager']];
|
|
28
|
-
function initPages($xeGrid, propKey) {
|
|
29
|
-
const props = $xeGrid;
|
|
30
|
-
const reactData = $xeGrid;
|
|
31
|
-
const {
|
|
32
|
-
tablePage
|
|
33
|
-
} = reactData;
|
|
34
|
-
const {
|
|
35
|
-
pagerConfig
|
|
36
|
-
} = props;
|
|
37
|
-
const pagerOpts = $xeGrid.computePagerOpts;
|
|
38
|
-
if (pagerConfig && (0, _utils.isEnableConf)(pagerOpts)) {
|
|
39
|
-
if (propKey) {
|
|
40
|
-
if (pagerOpts[propKey]) {
|
|
41
|
-
tablePage[propKey] = _xeUtils.default.toNumber(pagerOpts[propKey]);
|
|
42
|
-
}
|
|
43
|
-
} else {
|
|
44
|
-
const {
|
|
45
|
-
currentPage,
|
|
46
|
-
pageSize,
|
|
47
|
-
total
|
|
48
|
-
} = pagerOpts;
|
|
49
|
-
if (currentPage) {
|
|
50
|
-
tablePage.currentPage = currentPage;
|
|
51
|
-
}
|
|
52
|
-
if (pageSize) {
|
|
53
|
-
tablePage.pageSize = pageSize;
|
|
54
|
-
}
|
|
55
|
-
if (total) {
|
|
56
|
-
tablePage.pageSize = total;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
function renderDefaultForm(h, $xeGrid) {
|
|
62
|
-
const VxeUIFormComponent = _ui.VxeUI.getComponent('VxeForm');
|
|
63
|
-
const props = $xeGrid;
|
|
64
|
-
const slots = $xeGrid.$scopedSlots;
|
|
65
|
-
const reactData = $xeGrid;
|
|
66
|
-
const {
|
|
67
|
-
proxyConfig,
|
|
68
|
-
formConfig
|
|
69
|
-
} = props;
|
|
70
|
-
const {
|
|
71
|
-
formData
|
|
72
|
-
} = reactData;
|
|
73
|
-
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
74
|
-
const formOpts = $xeGrid.computeFormOpts;
|
|
75
|
-
if ((0, _utils.isEnableConf)(formConfig) && formOpts.items && formOpts.items.length) {
|
|
76
|
-
const formSlots = {};
|
|
77
|
-
if (!formOpts.inited) {
|
|
78
|
-
formOpts.inited = true;
|
|
79
|
-
const beforeItem = proxyOpts.beforeItem;
|
|
80
|
-
if (proxyOpts && beforeItem) {
|
|
81
|
-
formOpts.items.forEach(item => {
|
|
82
|
-
beforeItem.call($xeGrid, {
|
|
83
|
-
$grid: $xeGrid,
|
|
84
|
-
item
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
// 处理插槽
|
|
90
|
-
formOpts.items.forEach(item => {
|
|
91
|
-
_xeUtils.default.each(item.slots, func => {
|
|
92
|
-
if (!_xeUtils.default.isFunction(func)) {
|
|
93
|
-
if (slots[func]) {
|
|
94
|
-
formSlots[func] = slots[func];
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
return [VxeUIFormComponent ? h(VxeUIFormComponent, {
|
|
100
|
-
props: Object.assign({}, formOpts, {
|
|
101
|
-
data: proxyConfig && proxyOpts.form ? formData : formOpts.data
|
|
102
|
-
}),
|
|
103
|
-
on: {
|
|
104
|
-
submit: $xeGrid.submitEvent,
|
|
105
|
-
reset: $xeGrid.resetEvent,
|
|
106
|
-
collapse: $xeGrid.collapseEvent,
|
|
107
|
-
'submit-invalid': $xeGrid.submitInvalidEvent
|
|
108
|
-
},
|
|
109
|
-
scopedSlots: formSlots
|
|
110
|
-
}) : renderEmptyElement($xeGrid)];
|
|
111
|
-
}
|
|
112
|
-
return [];
|
|
113
|
-
}
|
|
114
|
-
function getFuncSlot($xeGrid, optSlots, slotKey) {
|
|
115
|
-
const slots = $xeGrid.$scopedSlots;
|
|
116
|
-
const funcSlot = optSlots[slotKey];
|
|
117
|
-
if (funcSlot) {
|
|
118
|
-
if (_xeUtils.default.isString(funcSlot)) {
|
|
119
|
-
if (slots[funcSlot]) {
|
|
120
|
-
return slots[funcSlot];
|
|
121
|
-
} else {
|
|
122
|
-
(0, _log.errLog)('vxe.error.notSlot', [funcSlot]);
|
|
123
|
-
}
|
|
124
|
-
} else {
|
|
125
|
-
return funcSlot;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return null;
|
|
129
|
-
}
|
|
130
|
-
const getConfigSlot = ($xeGrid, slotConfigs) => {
|
|
131
|
-
const slots = $xeGrid.$scopedSlots;
|
|
132
|
-
const slotConf = {};
|
|
133
|
-
_xeUtils.default.objectMap(slotConfigs, (slotFunc, slotKey) => {
|
|
134
|
-
if (slotFunc) {
|
|
135
|
-
if (_xeUtils.default.isString(slotFunc)) {
|
|
136
|
-
if (slots[slotFunc]) {
|
|
137
|
-
slotConf[slotKey] = slots[slotFunc];
|
|
138
|
-
} else {
|
|
139
|
-
(0, _log.errLog)('vxe.error.notSlot', [slotFunc]);
|
|
140
|
-
}
|
|
141
|
-
} else {
|
|
142
|
-
slotConf[slotKey] = slotFunc;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
return slotConf;
|
|
147
|
-
};
|
|
148
|
-
function getToolbarSlots($xeGrid) {
|
|
149
|
-
const slots = $xeGrid.$scopedSlots;
|
|
150
|
-
const toolbarOpts = $xeGrid.computeToolbarOpts;
|
|
151
|
-
const toolbarOptSlots = toolbarOpts.slots;
|
|
152
|
-
const toolbarSlots = {};
|
|
153
|
-
if (slots.buttons && (!toolbarOptSlots || toolbarOptSlots.buttons !== 'buttons')) {
|
|
154
|
-
(0, _log.warnLog)('vxe.error.reqProp', ['toolbar-config.slots.buttons']);
|
|
155
|
-
}
|
|
156
|
-
if (slots.tools && (!toolbarOptSlots || toolbarOptSlots.tools !== 'tools')) {
|
|
157
|
-
(0, _log.warnLog)('vxe.error.reqProp', ['toolbar-config.slots.tools']);
|
|
158
|
-
}
|
|
159
|
-
if (toolbarOptSlots) {
|
|
160
|
-
const buttonsSlot = getFuncSlot($xeGrid, toolbarOptSlots, 'buttons');
|
|
161
|
-
const buttonPrefixSlot = getFuncSlot($xeGrid, toolbarOptSlots, 'buttonPrefix');
|
|
162
|
-
const buttonSuffixSlot = getFuncSlot($xeGrid, toolbarOptSlots, 'buttonSuffix');
|
|
163
|
-
const toolsSlot = getFuncSlot($xeGrid, toolbarOptSlots, 'tools');
|
|
164
|
-
const toolPrefixSlot = getFuncSlot($xeGrid, toolbarOptSlots, 'toolPrefix');
|
|
165
|
-
const toolSuffixSlot = getFuncSlot($xeGrid, toolbarOptSlots, 'toolSuffix');
|
|
166
|
-
if (buttonsSlot) {
|
|
167
|
-
toolbarSlots.buttons = buttonsSlot;
|
|
168
|
-
}
|
|
169
|
-
if (buttonPrefixSlot) {
|
|
170
|
-
toolbarSlots.buttonPrefix = buttonPrefixSlot;
|
|
171
|
-
}
|
|
172
|
-
if (buttonSuffixSlot) {
|
|
173
|
-
toolbarSlots.buttonSuffix = buttonSuffixSlot;
|
|
174
|
-
}
|
|
175
|
-
if (toolsSlot) {
|
|
176
|
-
toolbarSlots.tools = toolsSlot;
|
|
177
|
-
}
|
|
178
|
-
if (toolPrefixSlot) {
|
|
179
|
-
toolbarSlots.toolPrefix = toolPrefixSlot;
|
|
180
|
-
}
|
|
181
|
-
if (toolSuffixSlot) {
|
|
182
|
-
toolbarSlots.toolSuffix = toolSuffixSlot;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
return toolbarSlots;
|
|
186
|
-
}
|
|
187
31
|
function getTableOns(_vm) {
|
|
188
32
|
const {
|
|
189
33
|
$listeners,
|
|
@@ -206,256 +50,47 @@ function getTableOns(_vm) {
|
|
|
206
50
|
}
|
|
207
51
|
return ons;
|
|
208
52
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
} = props;
|
|
215
|
-
const {
|
|
216
|
-
tablePage
|
|
217
|
-
} = reactData;
|
|
218
|
-
const {
|
|
219
|
-
$event,
|
|
220
|
-
currentPage,
|
|
221
|
-
pageSize
|
|
222
|
-
} = params;
|
|
223
|
-
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
224
|
-
tablePage.currentPage = currentPage;
|
|
225
|
-
tablePage.pageSize = pageSize;
|
|
226
|
-
$xeGrid.dispatchEvent('page-change', params, $event);
|
|
227
|
-
if (proxyConfig && (0, _utils.isEnableConf)(proxyOpts)) {
|
|
228
|
-
$xeGrid.commitProxy('query').then(rest => {
|
|
229
|
-
$xeGrid.dispatchEvent('proxy-query', rest, $event);
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* 渲染表单
|
|
235
|
-
*/
|
|
236
|
-
function renderForm(h, $xeGrid) {
|
|
237
|
-
const slots = $xeGrid.$scopedSlots;
|
|
238
|
-
const props = $xeGrid;
|
|
239
|
-
const {
|
|
240
|
-
formConfig
|
|
241
|
-
} = props;
|
|
242
|
-
const formSlot = slots.form;
|
|
243
|
-
const hasForm = !!(formSlot || (0, _utils.isEnableConf)(formConfig));
|
|
244
|
-
if (hasForm) {
|
|
245
|
-
return h('div', {
|
|
246
|
-
key: 'form',
|
|
247
|
-
ref: 'refFormWrapper',
|
|
248
|
-
class: 'vxe-grid--form-wrapper'
|
|
249
|
-
}, formSlot ? formSlot.call($xeGrid, {
|
|
250
|
-
$grid: $xeGrid
|
|
251
|
-
}) : renderDefaultForm(h, $xeGrid));
|
|
252
|
-
}
|
|
253
|
-
return renderEmptyElement($xeGrid);
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* 渲染工具栏
|
|
257
|
-
*/
|
|
258
|
-
function renderToolbar(h, $xeGrid) {
|
|
259
|
-
const slots = $xeGrid.$scopedSlots;
|
|
260
|
-
const props = $xeGrid;
|
|
261
|
-
const {
|
|
262
|
-
toolbarConfig
|
|
263
|
-
} = props;
|
|
264
|
-
const toolbarSlot = slots.toolbar;
|
|
265
|
-
const hasToolbar = !!(toolbarSlot || (0, _utils.isEnableConf)(toolbarConfig) || toolbar);
|
|
266
|
-
const toolbarOpts = $xeGrid.computeToolbarOpts;
|
|
267
|
-
if (hasToolbar) {
|
|
268
|
-
return h('div', {
|
|
269
|
-
key: 'toolbar',
|
|
270
|
-
ref: 'refToolbarWrapper',
|
|
271
|
-
class: 'vxe-grid--toolbar-wrapper'
|
|
272
|
-
}, toolbarSlot ? toolbarSlot.call($xeGrid, {
|
|
273
|
-
$grid: $xeGrid
|
|
274
|
-
}) : [h(_toolbar.default, {
|
|
275
|
-
props: Object.assign({}, toolbarOpts, {
|
|
276
|
-
slots: undefined
|
|
277
|
-
}),
|
|
278
|
-
ref: 'xToolbar',
|
|
279
|
-
scopedSlots: getToolbarSlots($xeGrid)
|
|
280
|
-
})]);
|
|
281
|
-
}
|
|
282
|
-
return renderEmptyElement($xeGrid);
|
|
283
|
-
}
|
|
284
|
-
/**
|
|
285
|
-
* 渲染表格顶部区域
|
|
286
|
-
*/
|
|
287
|
-
function renderTop(h, $xeGrid) {
|
|
288
|
-
const slots = $xeGrid.$scopedSlots;
|
|
289
|
-
const topSlot = slots.top;
|
|
290
|
-
return topSlot ? h('div', {
|
|
291
|
-
key: 'top',
|
|
292
|
-
ref: 'refTopWrapper',
|
|
293
|
-
class: 'vxe-grid--top-wrapper'
|
|
294
|
-
}, topSlot.call($xeGrid, {
|
|
295
|
-
$grid: $xeGrid
|
|
296
|
-
})) : renderEmptyElement($xeGrid);
|
|
297
|
-
}
|
|
298
|
-
function renderTableLeft(h, $xeGrid) {
|
|
299
|
-
const slots = $xeGrid.$scopedSlots;
|
|
300
|
-
const leftSlot = slots.left;
|
|
301
|
-
if (leftSlot) {
|
|
302
|
-
return h('div', {
|
|
303
|
-
class: 'vxe-grid--left-wrapper'
|
|
304
|
-
}, leftSlot({
|
|
305
|
-
$grid: $xeGrid
|
|
306
|
-
}));
|
|
307
|
-
}
|
|
308
|
-
return renderEmptyElement($xeGrid);
|
|
309
|
-
}
|
|
310
|
-
function renderTableRight(h, $xeGrid) {
|
|
311
|
-
const slots = $xeGrid.$scopedSlots;
|
|
312
|
-
const rightSlot = slots.right;
|
|
313
|
-
if (rightSlot) {
|
|
314
|
-
return h('div', {
|
|
315
|
-
class: 'vxe-grid--right-wrapper'
|
|
316
|
-
}, rightSlot({
|
|
317
|
-
$grid: $xeGrid
|
|
318
|
-
}));
|
|
319
|
-
}
|
|
320
|
-
return renderEmptyElement($xeGrid);
|
|
321
|
-
}
|
|
322
|
-
/**
|
|
323
|
-
* 渲染表格
|
|
324
|
-
*/
|
|
325
|
-
function renderTable(h, $xeGrid) {
|
|
326
|
-
const slots = $xeGrid.$scopedSlots;
|
|
327
|
-
const tableProps = $xeGrid.computeTableProps;
|
|
328
|
-
return h('div', {
|
|
329
|
-
class: 'vxe-grid--table-wrapper'
|
|
330
|
-
}, [h('vxe-table', {
|
|
331
|
-
key: 'table',
|
|
332
|
-
props: tableProps,
|
|
333
|
-
on: getTableOns($xeGrid),
|
|
334
|
-
scopedSlots: slots,
|
|
335
|
-
ref: 'xTable'
|
|
336
|
-
})]);
|
|
337
|
-
}
|
|
338
|
-
/**
|
|
339
|
-
* 渲染表格底部区域
|
|
340
|
-
*/
|
|
341
|
-
function renderBottom(h, $xeGrid) {
|
|
342
|
-
const slots = $xeGrid.$scopedSlots;
|
|
343
|
-
const bottomSlot = slots.bottom;
|
|
344
|
-
return bottomSlot ? h('div', {
|
|
345
|
-
key: 'bottom',
|
|
346
|
-
ref: 'refBottomWrapper',
|
|
347
|
-
class: 'vxe-grid--bottom-wrapper'
|
|
348
|
-
}, bottomSlot.call($xeGrid, {
|
|
349
|
-
$grid: $xeGrid
|
|
350
|
-
})) : renderEmptyElement($xeGrid);
|
|
351
|
-
}
|
|
352
|
-
/**
|
|
353
|
-
* 渲染分页
|
|
354
|
-
*/
|
|
355
|
-
function renderPager(h, $xeGrid) {
|
|
356
|
-
const VxeUIPagerComponent = _ui.VxeUI.getComponent('VxePager');
|
|
357
|
-
const props = $xeGrid;
|
|
358
|
-
const slots = $xeGrid.$scopedSlots;
|
|
359
|
-
const reactData = $xeGrid;
|
|
360
|
-
const {
|
|
361
|
-
proxyConfig,
|
|
362
|
-
pagerConfig
|
|
363
|
-
} = props;
|
|
364
|
-
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
365
|
-
const pagerOpts = $xeGrid.computePagerOpts;
|
|
366
|
-
const pagerSlot = slots.pager;
|
|
367
|
-
if (pagerConfig && (0, _utils.isEnableConf)(pagerOpts) || slots.pager) {
|
|
368
|
-
return h('div', {
|
|
369
|
-
ref: 'refPagerWrapper',
|
|
370
|
-
key: 'pager',
|
|
371
|
-
class: 'vxe-grid--pager-wrapper'
|
|
372
|
-
}, pagerSlot ? pagerSlot.call($xeGrid, {
|
|
373
|
-
$grid: $xeGrid
|
|
374
|
-
}) : [VxeUIPagerComponent ? h(VxeUIPagerComponent, {
|
|
375
|
-
ref: 'refPager',
|
|
376
|
-
props: Object.assign(Object.assign({}, pagerOpts), proxyConfig && (0, _utils.isEnableConf)(proxyOpts) ? reactData.tablePage : {}),
|
|
377
|
-
on: {
|
|
378
|
-
'page-change'(params) {
|
|
379
|
-
pageChangeEvent($xeGrid, params);
|
|
380
|
-
}
|
|
381
|
-
},
|
|
382
|
-
scopedSlots: getConfigSlot($xeGrid, pagerOpts.slots)
|
|
383
|
-
}) : renderEmptyElement($xeGrid)]);
|
|
384
|
-
}
|
|
385
|
-
return renderEmptyElement($xeGrid);
|
|
386
|
-
}
|
|
387
|
-
function renderChildLayout(h, $xeGrid, layoutKeys) {
|
|
388
|
-
const childVNs = [];
|
|
389
|
-
layoutKeys.forEach(key => {
|
|
390
|
-
switch (key) {
|
|
391
|
-
case 'Form':
|
|
392
|
-
childVNs.push(renderForm(h, $xeGrid));
|
|
393
|
-
break;
|
|
394
|
-
case 'Toolbar':
|
|
395
|
-
childVNs.push(renderToolbar(h, $xeGrid));
|
|
396
|
-
break;
|
|
397
|
-
case 'Top':
|
|
398
|
-
childVNs.push(renderTop(h, $xeGrid));
|
|
399
|
-
break;
|
|
400
|
-
case 'Table':
|
|
401
|
-
childVNs.push(h('div', {
|
|
402
|
-
key: 'table',
|
|
403
|
-
class: 'vxe-grid--table-container'
|
|
404
|
-
}, [renderTableLeft(h, $xeGrid), renderTable(h, $xeGrid), renderTableRight(h, $xeGrid)]));
|
|
405
|
-
break;
|
|
406
|
-
case 'Bottom':
|
|
407
|
-
childVNs.push(renderBottom(h, $xeGrid));
|
|
408
|
-
break;
|
|
409
|
-
case 'Pager':
|
|
410
|
-
childVNs.push(renderPager(h, $xeGrid));
|
|
411
|
-
break;
|
|
412
|
-
default:
|
|
413
|
-
(0, _log.errLog)('vxe.error.notProp', [`layouts -> ${key}`]);
|
|
414
|
-
break;
|
|
415
|
-
}
|
|
416
|
-
});
|
|
417
|
-
return childVNs;
|
|
418
|
-
}
|
|
419
|
-
function renderLayout(h, $xeGrid) {
|
|
420
|
-
const slots = $xeGrid.$scopedSlots;
|
|
421
|
-
const currLayoutConf = $xeGrid.computeCurrLayoutConf;
|
|
422
|
-
const {
|
|
423
|
-
headKeys,
|
|
424
|
-
bodyKeys,
|
|
425
|
-
footKeys
|
|
426
|
-
} = currLayoutConf;
|
|
427
|
-
const asideLeftSlot = slots.asideLeft || slots['aside-left'];
|
|
428
|
-
const asideRightSlot = slots.asideRight || slots['aside-right'];
|
|
429
|
-
return [h('div', {
|
|
430
|
-
class: 'vxe-grid--layout-header-wrapper'
|
|
431
|
-
}, renderChildLayout(h, $xeGrid, headKeys)), h('div', {
|
|
432
|
-
class: 'vxe-grid--layout-body-wrapper'
|
|
433
|
-
}, [asideLeftSlot ? h('div', {
|
|
434
|
-
class: 'vxe-grid--layout-aside-left-wrapper'
|
|
435
|
-
}, asideLeftSlot({})) : renderEmptyElement($xeGrid), h('div', {
|
|
436
|
-
class: 'vxe-grid--layout-body-content-wrapper'
|
|
437
|
-
}, renderChildLayout(h, $xeGrid, bodyKeys)), asideRightSlot ? h('div', {
|
|
438
|
-
class: 'vxe-grid--layout-aside-right-wrapper'
|
|
439
|
-
}, asideRightSlot({})) : renderEmptyElement($xeGrid)]), h('div', {
|
|
440
|
-
class: 'vxe-grid--layout-footer-wrapper'
|
|
441
|
-
}, renderChildLayout(h, $xeGrid, footKeys))];
|
|
442
|
-
}
|
|
443
|
-
Object.keys(_table.default.methods).forEach(name => {
|
|
444
|
-
methods[name] = function (...args) {
|
|
445
|
-
return this.$refs.xTable && this.$refs.xTable[name](...args);
|
|
53
|
+
_xeUtils.default.each(_table.default.methods, (fn, name) => {
|
|
54
|
+
tableMethods[name] = function (...args) {
|
|
55
|
+
const $xeGrid = this;
|
|
56
|
+
const $xeTable = $xeGrid.$refs.refTable;
|
|
57
|
+
return $xeTable && $xeTable[name](...args);
|
|
446
58
|
};
|
|
447
59
|
});
|
|
448
|
-
var _default = exports.default = {
|
|
60
|
+
var _default = exports.default = /* define-vxe-component start */(0, _comp.defineVxeComponent)({
|
|
449
61
|
name: 'VxeGrid',
|
|
450
62
|
mixins: [globalMixins.sizeMixin],
|
|
451
|
-
props: Object.assign(Object.assign({
|
|
63
|
+
props: Object.assign(Object.assign({
|
|
64
|
+
// 以下仅用于类型
|
|
65
|
+
round: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: () => getConfig().table.round
|
|
68
|
+
},
|
|
69
|
+
height: [Number, String],
|
|
70
|
+
minHeight: {
|
|
71
|
+
type: [Number, String],
|
|
72
|
+
default: () => getConfig().table.minHeight
|
|
73
|
+
},
|
|
74
|
+
maxHeight: [Number, String],
|
|
75
|
+
seqConfig: Object,
|
|
76
|
+
sortConfig: Object,
|
|
77
|
+
filterConfig: Object,
|
|
78
|
+
editConfig: [Boolean, Object],
|
|
79
|
+
loading: Boolean,
|
|
80
|
+
validConfig: Object,
|
|
81
|
+
editRules: Object,
|
|
82
|
+
animat: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: () => getConfig().table.animat
|
|
85
|
+
}
|
|
86
|
+
}, _props.default), {
|
|
87
|
+
// 以上仅用于类型
|
|
452
88
|
layouts: Array,
|
|
453
89
|
columns: Array,
|
|
454
|
-
pagerConfig:
|
|
90
|
+
pagerConfig: Object,
|
|
455
91
|
proxyConfig: Object,
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
formConfig: [Boolean, Object],
|
|
92
|
+
toolbarConfig: Object,
|
|
93
|
+
formConfig: Object,
|
|
459
94
|
zoomConfig: Object,
|
|
460
95
|
size: {
|
|
461
96
|
type: String,
|
|
@@ -463,14 +98,17 @@ var _default = exports.default = {
|
|
|
463
98
|
}
|
|
464
99
|
}),
|
|
465
100
|
provide() {
|
|
101
|
+
const $xeGrid = this;
|
|
466
102
|
return {
|
|
467
|
-
$xeGrid
|
|
103
|
+
$xeGrid
|
|
468
104
|
};
|
|
469
105
|
},
|
|
470
106
|
data() {
|
|
471
107
|
var _a;
|
|
472
|
-
|
|
108
|
+
const xID = _xeUtils.default.uniqueId();
|
|
109
|
+
const reactData = {
|
|
473
110
|
tableLoading: false,
|
|
111
|
+
proxyInited: false,
|
|
474
112
|
isZMax: false,
|
|
475
113
|
tableData: [],
|
|
476
114
|
filterData: [],
|
|
@@ -483,51 +121,79 @@ var _default = exports.default = {
|
|
|
483
121
|
currentPage: 1
|
|
484
122
|
}
|
|
485
123
|
};
|
|
124
|
+
return {
|
|
125
|
+
xID,
|
|
126
|
+
reactData
|
|
127
|
+
};
|
|
486
128
|
},
|
|
487
|
-
computed: {
|
|
129
|
+
computed: Object.assign(Object.assign({}, {}), {
|
|
488
130
|
isRespMsg() {
|
|
489
|
-
const
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
131
|
+
const $xeGrid = this;
|
|
132
|
+
return $xeGrid.computeIsRespMsg;
|
|
133
|
+
},
|
|
134
|
+
computeIsRespMsg() {
|
|
135
|
+
const $xeGrid = this;
|
|
136
|
+
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
137
|
+
return !!(_xeUtils.default.isBoolean(proxyOpts.message) ? proxyOpts.message : proxyOpts.showResponseMsg);
|
|
493
138
|
},
|
|
494
139
|
isActiveMsg() {
|
|
495
|
-
|
|
140
|
+
const $xeGrid = this;
|
|
141
|
+
return $xeGrid.computeIsActiveMsg;
|
|
142
|
+
},
|
|
143
|
+
computeIsActiveMsg() {
|
|
144
|
+
const $xeGrid = this;
|
|
145
|
+
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
146
|
+
return !!proxyOpts.showActiveMsg;
|
|
496
147
|
},
|
|
497
148
|
proxyOpts() {
|
|
498
|
-
|
|
149
|
+
const $xeGrid = this;
|
|
150
|
+
return $xeGrid.computeProxyOpts;
|
|
499
151
|
},
|
|
500
152
|
computeProxyOpts() {
|
|
501
|
-
|
|
153
|
+
const $xeGrid = this;
|
|
154
|
+
const props = $xeGrid;
|
|
155
|
+
return _xeUtils.default.merge({}, _xeUtils.default.clone(getConfig().grid.proxyConfig, true), props.proxyConfig);
|
|
502
156
|
},
|
|
503
157
|
pagerOpts() {
|
|
504
|
-
|
|
158
|
+
const $xeGrid = this;
|
|
159
|
+
return $xeGrid.computePagerOpts;
|
|
505
160
|
},
|
|
506
161
|
computePagerOpts() {
|
|
507
|
-
|
|
162
|
+
const $xeGrid = this;
|
|
163
|
+
const props = $xeGrid;
|
|
164
|
+
return Object.assign({}, getConfig().grid.pagerConfig, props.pagerConfig);
|
|
508
165
|
},
|
|
509
166
|
formOpts() {
|
|
510
|
-
|
|
167
|
+
const $xeGrid = this;
|
|
168
|
+
return $xeGrid.computeFormOpts;
|
|
511
169
|
},
|
|
512
170
|
computeFormOpts() {
|
|
513
|
-
|
|
171
|
+
const $xeGrid = this;
|
|
172
|
+
const props = $xeGrid;
|
|
173
|
+
return Object.assign({}, getConfig().grid.formConfig, props.formConfig);
|
|
514
174
|
},
|
|
515
175
|
toolbarOpts() {
|
|
516
|
-
|
|
176
|
+
const $xeGrid = this;
|
|
177
|
+
return $xeGrid.computeToolbarOpts;
|
|
517
178
|
},
|
|
518
179
|
computeToolbarOpts() {
|
|
519
|
-
|
|
180
|
+
const $xeGrid = this;
|
|
181
|
+
const props = $xeGrid;
|
|
182
|
+
return Object.assign({}, getConfig().grid.toolbarConfig, props.toolbarConfig);
|
|
520
183
|
},
|
|
521
184
|
zoomOpts() {
|
|
522
|
-
|
|
185
|
+
const $xeGrid = this;
|
|
186
|
+
return $xeGrid.computeZoomOpts;
|
|
523
187
|
},
|
|
524
188
|
computeZoomOpts() {
|
|
525
|
-
|
|
189
|
+
const $xeGrid = this;
|
|
190
|
+
const props = $xeGrid;
|
|
191
|
+
return Object.assign({}, getConfig().grid.zoomConfig, props.zoomConfig);
|
|
526
192
|
},
|
|
527
193
|
computeStyles() {
|
|
528
194
|
const $xeGrid = this;
|
|
529
195
|
const props = $xeGrid;
|
|
530
|
-
const reactData = $xeGrid;
|
|
196
|
+
const reactData = $xeGrid.reactData;
|
|
531
197
|
const {
|
|
532
198
|
height,
|
|
533
199
|
maxHeight
|
|
@@ -549,26 +215,34 @@ var _default = exports.default = {
|
|
|
549
215
|
}
|
|
550
216
|
return stys;
|
|
551
217
|
},
|
|
552
|
-
|
|
218
|
+
computeTableExtendProps() {
|
|
219
|
+
const $xeGrid = this;
|
|
220
|
+
const props = $xeGrid;
|
|
553
221
|
const rest = {};
|
|
222
|
+
const gridProps = props;
|
|
554
223
|
propKeys.forEach(key => {
|
|
555
|
-
rest[key] =
|
|
224
|
+
rest[key] = gridProps[key];
|
|
556
225
|
});
|
|
557
226
|
return rest;
|
|
558
227
|
},
|
|
559
228
|
computeTableProps() {
|
|
229
|
+
const $xeGrid = this;
|
|
230
|
+
const props = $xeGrid;
|
|
231
|
+
const reactData = $xeGrid.reactData;
|
|
560
232
|
const {
|
|
561
|
-
isZMax,
|
|
562
233
|
seqConfig,
|
|
563
234
|
pagerConfig,
|
|
564
|
-
loading,
|
|
565
235
|
editConfig,
|
|
566
|
-
proxyConfig
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
236
|
+
proxyConfig
|
|
237
|
+
} = props;
|
|
238
|
+
const {
|
|
239
|
+
isZMax,
|
|
570
240
|
tablePage
|
|
571
|
-
} =
|
|
241
|
+
} = reactData;
|
|
242
|
+
const tableExtendProps = $xeGrid.computeTableExtendProps;
|
|
243
|
+
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
244
|
+
const pagerOpts = $xeGrid.computePagerOpts;
|
|
245
|
+
const isLoading = $xeGrid.computeIsLoading;
|
|
572
246
|
const tProps = Object.assign({}, tableExtendProps);
|
|
573
247
|
if (isZMax) {
|
|
574
248
|
if (tableExtendProps.maxHeight) {
|
|
@@ -577,9 +251,9 @@ var _default = exports.default = {
|
|
|
577
251
|
tProps.height = '100%';
|
|
578
252
|
}
|
|
579
253
|
}
|
|
580
|
-
if (proxyConfig) {
|
|
581
|
-
tProps.loading =
|
|
582
|
-
if (proxyOpts.seq && (0, _utils.isEnableConf)(
|
|
254
|
+
if (proxyConfig && (0, _utils.isEnableConf)(proxyOpts)) {
|
|
255
|
+
tProps.loading = isLoading;
|
|
256
|
+
if (pagerConfig && proxyOpts.seq && (0, _utils.isEnableConf)(pagerOpts)) {
|
|
583
257
|
tProps.seqConfig = Object.assign({}, seqConfig, {
|
|
584
258
|
startIndex: (tablePage.currentPage - 1) * tablePage.pageSize
|
|
585
259
|
});
|
|
@@ -591,7 +265,8 @@ var _default = exports.default = {
|
|
|
591
265
|
return tProps;
|
|
592
266
|
},
|
|
593
267
|
tableProps() {
|
|
594
|
-
|
|
268
|
+
const $xeGrid = this;
|
|
269
|
+
return $xeGrid.computeTableProps;
|
|
595
270
|
},
|
|
596
271
|
computeCurrLayoutConf() {
|
|
597
272
|
const $xeGrid = this;
|
|
@@ -637,101 +312,100 @@ var _default = exports.default = {
|
|
|
637
312
|
const $xeGrid = this;
|
|
638
313
|
const pagerOpts = $xeGrid.computePagerOpts;
|
|
639
314
|
return pagerOpts.total;
|
|
315
|
+
},
|
|
316
|
+
computeIsLoading() {
|
|
317
|
+
const $xeGrid = this;
|
|
318
|
+
const props = $xeGrid;
|
|
319
|
+
const reactData = $xeGrid.reactData;
|
|
320
|
+
const {
|
|
321
|
+
loading,
|
|
322
|
+
proxyConfig
|
|
323
|
+
} = props;
|
|
324
|
+
const {
|
|
325
|
+
tableLoading
|
|
326
|
+
} = reactData;
|
|
327
|
+
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
328
|
+
const {
|
|
329
|
+
showLoading
|
|
330
|
+
} = proxyOpts;
|
|
331
|
+
return loading || tableLoading && showLoading && proxyConfig && (0, _utils.isEnableConf)(proxyOpts);
|
|
640
332
|
}
|
|
641
|
-
},
|
|
333
|
+
}),
|
|
642
334
|
watch: {
|
|
643
335
|
columns(value) {
|
|
644
|
-
|
|
336
|
+
const $xeGrid = this;
|
|
337
|
+
$xeGrid.$nextTick(() => $xeGrid.loadColumn(value));
|
|
645
338
|
},
|
|
646
339
|
toolbar(value) {
|
|
340
|
+
const $xeGrid = this;
|
|
647
341
|
if (value) {
|
|
648
|
-
|
|
342
|
+
$xeGrid.initToolbar();
|
|
649
343
|
}
|
|
650
344
|
},
|
|
651
345
|
toolbarConfig(value) {
|
|
346
|
+
const $xeGrid = this;
|
|
652
347
|
if (value) {
|
|
653
|
-
|
|
348
|
+
$xeGrid.initToolbar();
|
|
654
349
|
}
|
|
655
350
|
},
|
|
656
351
|
proxyConfig() {
|
|
657
|
-
this
|
|
352
|
+
const $xeGrid = this;
|
|
353
|
+
$xeGrid.initProxy();
|
|
658
354
|
},
|
|
659
355
|
computeCustomCurrentPageFlag() {
|
|
660
356
|
const $xeGrid = this;
|
|
661
|
-
initPages(
|
|
357
|
+
$xeGrid.initPages('currentPage');
|
|
662
358
|
},
|
|
663
359
|
computeCustomPageSizeFlag() {
|
|
664
360
|
const $xeGrid = this;
|
|
665
|
-
initPages(
|
|
361
|
+
$xeGrid.initPages('pageSize');
|
|
666
362
|
},
|
|
667
363
|
computeCustomTotalFlag() {
|
|
668
364
|
const $xeGrid = this;
|
|
669
|
-
initPages(
|
|
365
|
+
$xeGrid.initPages('total');
|
|
670
366
|
}
|
|
671
367
|
},
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
368
|
+
methods: Object.assign(Object.assign({}, tableMethods), {
|
|
369
|
+
dispatchEvent(type, params, evnt) {
|
|
370
|
+
const $xeGrid = this;
|
|
371
|
+
$xeGrid.$emit(type, createEvent(evnt, {
|
|
372
|
+
$grid: $xeGrid
|
|
373
|
+
}, params));
|
|
374
|
+
},
|
|
375
|
+
initPages(propKey) {
|
|
376
|
+
const $xeGrid = this;
|
|
377
|
+
const props = $xeGrid;
|
|
378
|
+
const reactData = $xeGrid.reactData;
|
|
379
|
+
const {
|
|
380
|
+
tablePage
|
|
381
|
+
} = reactData;
|
|
382
|
+
const {
|
|
383
|
+
pagerConfig
|
|
384
|
+
} = props;
|
|
385
|
+
const pagerOpts = $xeGrid.computePagerOpts;
|
|
386
|
+
if (pagerConfig && (0, _utils.isEnableConf)(pagerOpts)) {
|
|
387
|
+
if (propKey) {
|
|
388
|
+
if (pagerOpts[propKey]) {
|
|
389
|
+
tablePage[propKey] = _xeUtils.default.toNumber(pagerOpts[propKey]);
|
|
390
|
+
}
|
|
391
|
+
} else {
|
|
392
|
+
const {
|
|
393
|
+
currentPage,
|
|
394
|
+
pageSize,
|
|
395
|
+
total
|
|
396
|
+
} = pagerOpts;
|
|
397
|
+
if (currentPage) {
|
|
398
|
+
tablePage.currentPage = currentPage;
|
|
399
|
+
}
|
|
400
|
+
if (pageSize) {
|
|
401
|
+
tablePage.pageSize = pageSize;
|
|
402
|
+
}
|
|
403
|
+
if (total) {
|
|
404
|
+
tablePage.pageSize = total;
|
|
405
|
+
}
|
|
700
406
|
}
|
|
701
407
|
}
|
|
702
|
-
}
|
|
703
|
-
initPages($xeGrid);
|
|
704
|
-
globalEvents.on(this, 'keydown', this.handleGlobalKeydownEvent);
|
|
705
|
-
},
|
|
706
|
-
mounted() {
|
|
707
|
-
if (this.columns && this.columns.length) {
|
|
708
|
-
this.loadColumn(this.columns);
|
|
709
|
-
}
|
|
710
|
-
this.initToolbar();
|
|
711
|
-
this.initProxy();
|
|
712
|
-
},
|
|
713
|
-
destroyed() {
|
|
714
|
-
globalEvents.off(this, 'keydown');
|
|
715
|
-
},
|
|
716
|
-
render(h) {
|
|
717
|
-
const $xeGrid = this;
|
|
718
|
-
const props = $xeGrid;
|
|
719
|
-
const reactData = $xeGrid;
|
|
720
|
-
const vSize = $xeGrid.computeSize;
|
|
721
|
-
const styles = $xeGrid.computeStyles;
|
|
722
|
-
return h('div', {
|
|
723
|
-
ref: 'refElem',
|
|
724
|
-
class: ['vxe-grid', {
|
|
725
|
-
[`size--${vSize}`]: vSize,
|
|
726
|
-
'is--animat': !!this.animat,
|
|
727
|
-
'is--round': this.round,
|
|
728
|
-
'is--maximize': reactData.isZMax,
|
|
729
|
-
'is--loading': props.loading || reactData.tableLoading
|
|
730
|
-
}],
|
|
731
|
-
style: styles
|
|
732
|
-
}, renderLayout(h, $xeGrid));
|
|
733
|
-
},
|
|
734
|
-
methods: Object.assign(Object.assign({}, methods), {
|
|
408
|
+
},
|
|
735
409
|
callSlot(slotFunc, params, h, vNodes) {
|
|
736
410
|
const $xeGrid = this;
|
|
737
411
|
const slots = $xeGrid.$scopedSlots;
|
|
@@ -754,7 +428,7 @@ var _default = exports.default = {
|
|
|
754
428
|
*/
|
|
755
429
|
getExcludeHeight() {
|
|
756
430
|
const $xeGrid = this;
|
|
757
|
-
const reactData = $xeGrid;
|
|
431
|
+
const reactData = $xeGrid.reactData;
|
|
758
432
|
const {
|
|
759
433
|
isZMax
|
|
760
434
|
} = reactData;
|
|
@@ -773,7 +447,7 @@ var _default = exports.default = {
|
|
|
773
447
|
},
|
|
774
448
|
getParentHeight() {
|
|
775
449
|
const $xeGrid = this;
|
|
776
|
-
const reactData = $xeGrid;
|
|
450
|
+
const reactData = $xeGrid.reactData;
|
|
777
451
|
const el = $xeGrid.$refs.refElem;
|
|
778
452
|
if (el) {
|
|
779
453
|
const parentEl = el.parentElement;
|
|
@@ -782,67 +456,147 @@ var _default = exports.default = {
|
|
|
782
456
|
return 0;
|
|
783
457
|
},
|
|
784
458
|
initToolbar() {
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
xTable.connect(xToolbar);
|
|
459
|
+
const $xeGrid = this;
|
|
460
|
+
$xeGrid.$nextTick(() => {
|
|
461
|
+
const $xeTable = $xeGrid.$refs.refTable;
|
|
462
|
+
const $xeToolbar = $xeGrid.$refs.refToolbar;
|
|
463
|
+
if ($xeTable && $xeToolbar) {
|
|
464
|
+
$xeTable.connect($xeToolbar);
|
|
792
465
|
}
|
|
793
466
|
});
|
|
794
467
|
},
|
|
468
|
+
getDefaultFormData() {
|
|
469
|
+
const $xeGrid = this;
|
|
470
|
+
const formOpts = $xeGrid.computeFormOpts;
|
|
471
|
+
if (formOpts.items) {
|
|
472
|
+
const fData = {};
|
|
473
|
+
formOpts.items.forEach(item => {
|
|
474
|
+
const {
|
|
475
|
+
field,
|
|
476
|
+
itemRender
|
|
477
|
+
} = item;
|
|
478
|
+
if (field) {
|
|
479
|
+
let itemValue = null;
|
|
480
|
+
if (itemRender) {
|
|
481
|
+
const {
|
|
482
|
+
defaultValue
|
|
483
|
+
} = itemRender;
|
|
484
|
+
if (_xeUtils.default.isFunction(defaultValue)) {
|
|
485
|
+
itemValue = defaultValue({
|
|
486
|
+
item
|
|
487
|
+
});
|
|
488
|
+
} else if (!_xeUtils.default.isUndefined(defaultValue)) {
|
|
489
|
+
itemValue = defaultValue;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
fData[field] = itemValue;
|
|
493
|
+
}
|
|
494
|
+
});
|
|
495
|
+
return fData;
|
|
496
|
+
}
|
|
497
|
+
return {};
|
|
498
|
+
},
|
|
795
499
|
initProxy() {
|
|
500
|
+
const $xeGrid = this;
|
|
501
|
+
const props = $xeGrid;
|
|
502
|
+
const reactData = $xeGrid.reactData;
|
|
796
503
|
const {
|
|
797
|
-
proxyInited,
|
|
798
504
|
proxyConfig,
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
505
|
+
formConfig
|
|
506
|
+
} = props;
|
|
507
|
+
const {
|
|
508
|
+
proxyInited
|
|
509
|
+
} = reactData;
|
|
510
|
+
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
511
|
+
const formOpts = $xeGrid.computeFormOpts;
|
|
803
512
|
if (proxyConfig) {
|
|
804
513
|
if ((0, _utils.isEnableConf)(formConfig) && proxyOpts.form && formOpts.items) {
|
|
805
|
-
|
|
806
|
-
formOpts.items.forEach(item => {
|
|
807
|
-
const {
|
|
808
|
-
field,
|
|
809
|
-
itemRender
|
|
810
|
-
} = item;
|
|
811
|
-
if (field) {
|
|
812
|
-
let itemValue = null;
|
|
813
|
-
if (itemRender) {
|
|
814
|
-
const {
|
|
815
|
-
defaultValue
|
|
816
|
-
} = itemRender;
|
|
817
|
-
if (_xeUtils.default.isFunction(defaultValue)) {
|
|
818
|
-
itemValue = defaultValue({
|
|
819
|
-
item
|
|
820
|
-
});
|
|
821
|
-
} else if (!_xeUtils.default.isUndefined(defaultValue)) {
|
|
822
|
-
itemValue = defaultValue;
|
|
823
|
-
}
|
|
824
|
-
}
|
|
825
|
-
fData[field] = itemValue;
|
|
826
|
-
}
|
|
827
|
-
});
|
|
828
|
-
this.formData = fData;
|
|
514
|
+
reactData.formData = $xeGrid.getDefaultFormData();
|
|
829
515
|
}
|
|
830
516
|
if (!proxyInited && proxyOpts.autoLoad !== false) {
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
isInited: true
|
|
835
|
-
|
|
836
|
-
$event: new Event('init')
|
|
837
|
-
}));
|
|
517
|
+
reactData.proxyInited = true;
|
|
518
|
+
$xeGrid.$nextTick().then(() => $xeGrid.commitProxy('initial')).then(rest => {
|
|
519
|
+
$xeGrid.dispatchEvent('proxy-query', Object.assign(Object.assign({}, rest), {
|
|
520
|
+
isInited: true
|
|
521
|
+
}), new Event('initial'));
|
|
838
522
|
});
|
|
839
523
|
}
|
|
840
524
|
}
|
|
841
525
|
},
|
|
842
526
|
handleGlobalKeydownEvent(evnt) {
|
|
843
|
-
const
|
|
844
|
-
|
|
845
|
-
|
|
527
|
+
const $xeGrid = this;
|
|
528
|
+
const reactData = $xeGrid.reactData;
|
|
529
|
+
const zoomOpts = $xeGrid.computeZoomOpts;
|
|
530
|
+
const isEsc = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ESCAPE);
|
|
531
|
+
if (isEsc && reactData.isZMax && zoomOpts.escRestore !== false) {
|
|
532
|
+
$xeGrid.triggerZoomEvent(evnt);
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
getRespMsg(rest, defaultMsg) {
|
|
536
|
+
const $xeGrid = this;
|
|
537
|
+
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
538
|
+
const resConfigs = proxyOpts.response || proxyOpts.props || {};
|
|
539
|
+
const messageProp = resConfigs.message;
|
|
540
|
+
let msg;
|
|
541
|
+
if (rest && messageProp) {
|
|
542
|
+
msg = _xeUtils.default.isFunction(messageProp) ? messageProp({
|
|
543
|
+
data: rest,
|
|
544
|
+
$grid: $xeGrid
|
|
545
|
+
}) : _xeUtils.default.get(rest, messageProp);
|
|
546
|
+
}
|
|
547
|
+
return msg || getI18n(defaultMsg);
|
|
548
|
+
},
|
|
549
|
+
handleDeleteRow(code, alertKey, callback) {
|
|
550
|
+
const $xeGrid = this;
|
|
551
|
+
const isActiveMsg = $xeGrid.computeIsActiveMsg;
|
|
552
|
+
const selectRecords = $xeGrid.getCheckboxRecords();
|
|
553
|
+
if (isActiveMsg) {
|
|
554
|
+
if (selectRecords.length) {
|
|
555
|
+
if (_ui.VxeUI.modal) {
|
|
556
|
+
return _ui.VxeUI.modal.confirm({
|
|
557
|
+
id: `cfm_${code}`,
|
|
558
|
+
content: getI18n(alertKey),
|
|
559
|
+
escClosable: true
|
|
560
|
+
}).then(type => {
|
|
561
|
+
if (type === 'confirm') {
|
|
562
|
+
return callback();
|
|
563
|
+
}
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
} else {
|
|
567
|
+
if (_ui.VxeUI.modal) {
|
|
568
|
+
_ui.VxeUI.modal.message({
|
|
569
|
+
id: `msg_${code}`,
|
|
570
|
+
content: getI18n('vxe.grid.selectOneRecord'),
|
|
571
|
+
status: 'warning'
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
} else {
|
|
576
|
+
if (selectRecords.length) {
|
|
577
|
+
callback();
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
return Promise.resolve();
|
|
581
|
+
},
|
|
582
|
+
triggerPendingEvent(code) {
|
|
583
|
+
const $xeGrid = this;
|
|
584
|
+
const isActiveMsg = $xeGrid.computeIsActiveMsg;
|
|
585
|
+
const $xeTable = $xeGrid.$refs.refTable;
|
|
586
|
+
const selectRecords = $xeTable.getCheckboxRecords();
|
|
587
|
+
if (selectRecords.length) {
|
|
588
|
+
$xeTable.togglePendingRow(selectRecords);
|
|
589
|
+
$xeGrid.clearCheckboxRow();
|
|
590
|
+
} else {
|
|
591
|
+
if (isActiveMsg) {
|
|
592
|
+
if (_ui.VxeUI.modal) {
|
|
593
|
+
_ui.VxeUI.modal.message({
|
|
594
|
+
id: code,
|
|
595
|
+
content: getI18n('vxe.grid.selectOneRecord'),
|
|
596
|
+
status: 'warning'
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
}
|
|
846
600
|
}
|
|
847
601
|
},
|
|
848
602
|
/**
|
|
@@ -851,21 +605,28 @@ var _default = exports.default = {
|
|
|
851
605
|
*/
|
|
852
606
|
commitProxy(proxyTarget, ...args) {
|
|
853
607
|
const $xeGrid = this;
|
|
854
|
-
const
|
|
608
|
+
const props = $xeGrid;
|
|
609
|
+
const reactData = $xeGrid.reactData;
|
|
610
|
+
/**
|
|
611
|
+
* 已废弃
|
|
612
|
+
* @deprecated
|
|
613
|
+
*/
|
|
614
|
+
const toolbar = props.toolbar;
|
|
855
615
|
const {
|
|
856
|
-
|
|
857
|
-
toolbar,
|
|
616
|
+
proxyConfig,
|
|
858
617
|
toolbarConfig,
|
|
859
|
-
toolbarOpts,
|
|
860
|
-
proxyOpts,
|
|
861
|
-
tablePage,
|
|
862
618
|
pagerConfig,
|
|
863
619
|
editRules,
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
} =
|
|
620
|
+
validConfig
|
|
621
|
+
} = props;
|
|
622
|
+
const {
|
|
623
|
+
tablePage
|
|
624
|
+
} = reactData;
|
|
625
|
+
const isActiveMsg = $xeGrid.computeIsActiveMsg;
|
|
626
|
+
const isRespMsg = $xeGrid.computeIsRespMsg;
|
|
627
|
+
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
628
|
+
const pagerOpts = $xeGrid.computePagerOpts;
|
|
629
|
+
const toolbarOpts = $xeGrid.computeToolbarOpts;
|
|
869
630
|
const {
|
|
870
631
|
beforeQuery,
|
|
871
632
|
afterQuery,
|
|
@@ -876,16 +637,19 @@ var _default = exports.default = {
|
|
|
876
637
|
ajax = {}
|
|
877
638
|
} = proxyOpts;
|
|
878
639
|
const resConfigs = proxyOpts.response || proxyOpts.props || {};
|
|
879
|
-
const $xeTable = $refs.
|
|
880
|
-
|
|
881
|
-
let button;
|
|
882
|
-
let code;
|
|
640
|
+
const $xeTable = $xeGrid.$refs.refTable;
|
|
641
|
+
let formData = $xeGrid.getFormData();
|
|
642
|
+
let button = null;
|
|
643
|
+
let code = null;
|
|
883
644
|
if (_xeUtils.default.isString(proxyTarget)) {
|
|
884
|
-
const
|
|
645
|
+
const {
|
|
646
|
+
buttons
|
|
647
|
+
} = toolbarOpts;
|
|
648
|
+
const matchObj = (toolbarConfig || toolbar) && (0, _utils.isEnableConf)(toolbarOpts) && buttons ? _xeUtils.default.findTree(buttons, item => item.code === proxyTarget, {
|
|
885
649
|
children: 'dropdowns'
|
|
886
650
|
}) : null;
|
|
887
|
-
code = proxyTarget;
|
|
888
651
|
button = matchObj ? matchObj.item : null;
|
|
652
|
+
code = proxyTarget;
|
|
889
653
|
} else {
|
|
890
654
|
button = proxyTarget;
|
|
891
655
|
code = button.code;
|
|
@@ -905,10 +669,10 @@ var _default = exports.default = {
|
|
|
905
669
|
}) => $xeTable.setEditRow(row));
|
|
906
670
|
// 已废弃
|
|
907
671
|
case 'mark_cancel':
|
|
908
|
-
|
|
672
|
+
$xeGrid.triggerPendingEvent(code);
|
|
909
673
|
break;
|
|
910
674
|
case 'remove':
|
|
911
|
-
return
|
|
675
|
+
return $xeGrid.handleDeleteRow(code, 'vxe.grid.removeSelectRecord', () => $xeTable.removeCheckboxRow());
|
|
912
676
|
case 'import':
|
|
913
677
|
$xeTable.importData(btnParams);
|
|
914
678
|
break;
|
|
@@ -924,7 +688,7 @@ var _default = exports.default = {
|
|
|
924
688
|
case 'reset_custom':
|
|
925
689
|
$xeTable.resetCustom(true);
|
|
926
690
|
break;
|
|
927
|
-
case '
|
|
691
|
+
case 'initial':
|
|
928
692
|
case 'reload':
|
|
929
693
|
case 'query':
|
|
930
694
|
{
|
|
@@ -932,7 +696,7 @@ var _default = exports.default = {
|
|
|
932
696
|
const querySuccessMethods = ajax.querySuccess;
|
|
933
697
|
const queryErrorMethods = ajax.queryError;
|
|
934
698
|
if (ajaxMethods) {
|
|
935
|
-
const isInited = code === '
|
|
699
|
+
const isInited = code === 'initial';
|
|
936
700
|
const isReload = code === 'reload';
|
|
937
701
|
if (!isInited && reactData.tableLoading) {
|
|
938
702
|
return $xeGrid.$nextTick();
|
|
@@ -949,27 +713,46 @@ var _default = exports.default = {
|
|
|
949
713
|
}
|
|
950
714
|
}
|
|
951
715
|
if (isInited) {
|
|
952
|
-
|
|
716
|
+
// 重置代理表单数据
|
|
717
|
+
if (proxyConfig && (0, _utils.isEnableConf)(proxyOpts) && proxyOpts.form) {
|
|
718
|
+
formData = $xeGrid.getDefaultFormData();
|
|
719
|
+
reactData.formData = formData;
|
|
720
|
+
}
|
|
953
721
|
if ($xeTable) {
|
|
722
|
+
const tableInternalData = $xeTable;
|
|
954
723
|
const {
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
724
|
+
tableFullColumn,
|
|
725
|
+
fullColumnFieldData
|
|
726
|
+
} = tableInternalData;
|
|
727
|
+
const sortOpts = $xeTable.computeSortOpts;
|
|
728
|
+
let defaultSort = sortOpts.defaultSort;
|
|
729
|
+
tableFullColumn.forEach(column => {
|
|
730
|
+
column.order = null;
|
|
731
|
+
});
|
|
732
|
+
// 如果使用默认排序
|
|
733
|
+
if (defaultSort) {
|
|
734
|
+
if (!_xeUtils.default.isArray(defaultSort)) {
|
|
735
|
+
defaultSort = [defaultSort];
|
|
736
|
+
}
|
|
737
|
+
sortList = defaultSort.map(item => {
|
|
738
|
+
const {
|
|
739
|
+
field,
|
|
740
|
+
order
|
|
741
|
+
} = item;
|
|
742
|
+
const colRest = fullColumnFieldData[field];
|
|
743
|
+
if (colRest) {
|
|
744
|
+
const column = colRest.column;
|
|
745
|
+
if (column) {
|
|
746
|
+
column.order = order;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
return {
|
|
750
|
+
field,
|
|
751
|
+
property: field,
|
|
752
|
+
order
|
|
753
|
+
};
|
|
754
|
+
});
|
|
963
755
|
}
|
|
964
|
-
sortList = defaultSort.map(item => {
|
|
965
|
-
return {
|
|
966
|
-
field: item.field,
|
|
967
|
-
property: item.field,
|
|
968
|
-
order: item.order
|
|
969
|
-
};
|
|
970
|
-
});
|
|
971
|
-
}
|
|
972
|
-
if ($xeTable) {
|
|
973
756
|
filterList = $xeTable.getCheckedFilters();
|
|
974
757
|
}
|
|
975
758
|
} else {
|
|
@@ -987,7 +770,7 @@ var _default = exports.default = {
|
|
|
987
770
|
button,
|
|
988
771
|
isInited,
|
|
989
772
|
isReload,
|
|
990
|
-
$grid:
|
|
773
|
+
$grid: $xeGrid,
|
|
991
774
|
page: pageParams,
|
|
992
775
|
sort: sortList.length ? sortList[0] : {},
|
|
993
776
|
sorts: sortList,
|
|
@@ -995,25 +778,25 @@ var _default = exports.default = {
|
|
|
995
778
|
form: formData,
|
|
996
779
|
options: ajaxMethods
|
|
997
780
|
};
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
781
|
+
reactData.sortData = sortList;
|
|
782
|
+
reactData.filterData = filterList;
|
|
783
|
+
reactData.tableLoading = true;
|
|
1001
784
|
const applyArgs = [commitParams].concat(args);
|
|
1002
785
|
return Promise.resolve((beforeQuery || ajaxMethods)(...applyArgs)).then(rest => {
|
|
1003
786
|
let tableData = [];
|
|
1004
|
-
|
|
787
|
+
reactData.tableLoading = false;
|
|
1005
788
|
if (rest) {
|
|
1006
789
|
if (pagerConfig && (0, _utils.isEnableConf)(pagerOpts)) {
|
|
1007
790
|
const totalProp = resConfigs.total;
|
|
1008
791
|
const total = (_xeUtils.default.isFunction(totalProp) ? totalProp({
|
|
1009
792
|
data: rest,
|
|
1010
|
-
$grid:
|
|
793
|
+
$grid: $xeGrid
|
|
1011
794
|
}) : _xeUtils.default.get(rest, totalProp || 'page.total')) || 0;
|
|
1012
795
|
tablePage.total = _xeUtils.default.toNumber(total);
|
|
1013
796
|
const resultProp = resConfigs.result;
|
|
1014
797
|
tableData = (_xeUtils.default.isFunction(resultProp) ? resultProp({
|
|
1015
798
|
data: rest,
|
|
1016
|
-
$grid:
|
|
799
|
+
$grid: $xeGrid
|
|
1017
800
|
}) : _xeUtils.default.get(rest, resultProp || 'result')) || [];
|
|
1018
801
|
// 检验当前页码,不能超出当前最大页数
|
|
1019
802
|
const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
|
|
@@ -1024,7 +807,7 @@ var _default = exports.default = {
|
|
|
1024
807
|
const listProp = resConfigs.list;
|
|
1025
808
|
tableData = (listProp ? _xeUtils.default.isFunction(listProp) ? listProp({
|
|
1026
809
|
data: rest,
|
|
1027
|
-
$grid:
|
|
810
|
+
$grid: $xeGrid
|
|
1028
811
|
}) : _xeUtils.default.get(rest, listProp) : rest) || [];
|
|
1029
812
|
}
|
|
1030
813
|
}
|
|
@@ -1049,7 +832,7 @@ var _default = exports.default = {
|
|
|
1049
832
|
status: true
|
|
1050
833
|
};
|
|
1051
834
|
}).catch(rest => {
|
|
1052
|
-
|
|
835
|
+
reactData.tableLoading = false;
|
|
1053
836
|
if (queryErrorMethods) {
|
|
1054
837
|
queryErrorMethods(Object.assign(Object.assign({}, commitParams), {
|
|
1055
838
|
response: rest
|
|
@@ -1076,7 +859,7 @@ var _default = exports.default = {
|
|
|
1076
859
|
removeRecords
|
|
1077
860
|
};
|
|
1078
861
|
const commitParams = {
|
|
1079
|
-
$grid:
|
|
862
|
+
$grid: $xeGrid,
|
|
1080
863
|
code,
|
|
1081
864
|
button,
|
|
1082
865
|
body,
|
|
@@ -1085,13 +868,13 @@ var _default = exports.default = {
|
|
|
1085
868
|
};
|
|
1086
869
|
const applyArgs = [commitParams].concat(args);
|
|
1087
870
|
if (selectRecords.length) {
|
|
1088
|
-
return
|
|
871
|
+
return $xeGrid.handleDeleteRow(code, 'vxe.grid.deleteSelectRecord', () => {
|
|
1089
872
|
if (!removeRecords.length) {
|
|
1090
873
|
return $xeTable.remove(selectRecords);
|
|
1091
874
|
}
|
|
1092
|
-
|
|
875
|
+
reactData.tableLoading = true;
|
|
1093
876
|
return Promise.resolve((beforeDelete || ajaxMethods)(...applyArgs)).then(rest => {
|
|
1094
|
-
|
|
877
|
+
reactData.tableLoading = false;
|
|
1095
878
|
$xeTable.setPendingRow(removeRecords, false);
|
|
1096
879
|
if (isRespMsg) {
|
|
1097
880
|
// 检测弹窗模块
|
|
@@ -1099,14 +882,14 @@ var _default = exports.default = {
|
|
|
1099
882
|
(0, _log.errLog)('vxe.error.reqModule', ['Modal']);
|
|
1100
883
|
}
|
|
1101
884
|
_ui.VxeUI.modal.message({
|
|
1102
|
-
content:
|
|
885
|
+
content: $xeGrid.getRespMsg(rest, 'vxe.grid.delSuccess'),
|
|
1103
886
|
status: 'success'
|
|
1104
887
|
});
|
|
1105
888
|
}
|
|
1106
889
|
if (afterDelete) {
|
|
1107
890
|
afterDelete(...applyArgs);
|
|
1108
891
|
} else {
|
|
1109
|
-
|
|
892
|
+
$xeGrid.commitProxy('query');
|
|
1110
893
|
}
|
|
1111
894
|
if (deleteSuccessMethods) {
|
|
1112
895
|
deleteSuccessMethods(Object.assign(Object.assign({}, commitParams), {
|
|
@@ -1117,7 +900,7 @@ var _default = exports.default = {
|
|
|
1117
900
|
status: true
|
|
1118
901
|
};
|
|
1119
902
|
}).catch(rest => {
|
|
1120
|
-
|
|
903
|
+
reactData.tableLoading = false;
|
|
1121
904
|
if (isRespMsg) {
|
|
1122
905
|
// 检测弹窗模块
|
|
1123
906
|
if (!_ui.VxeUI.modal) {
|
|
@@ -1125,7 +908,7 @@ var _default = exports.default = {
|
|
|
1125
908
|
}
|
|
1126
909
|
_ui.VxeUI.modal.message({
|
|
1127
910
|
id: code,
|
|
1128
|
-
content:
|
|
911
|
+
content: $xeGrid.getRespMsg(rest, 'vxe.grid.operError'),
|
|
1129
912
|
status: 'error'
|
|
1130
913
|
});
|
|
1131
914
|
}
|
|
@@ -1163,7 +946,7 @@ var _default = exports.default = {
|
|
|
1163
946
|
const saveSuccessMethods = ajax.saveSuccess;
|
|
1164
947
|
const saveErrorMethods = ajax.saveError;
|
|
1165
948
|
if (ajaxMethods) {
|
|
1166
|
-
const body =
|
|
949
|
+
const body = $xeGrid.getRecordset();
|
|
1167
950
|
const {
|
|
1168
951
|
insertRecords,
|
|
1169
952
|
removeRecords,
|
|
@@ -1171,7 +954,7 @@ var _default = exports.default = {
|
|
|
1171
954
|
pendingRecords
|
|
1172
955
|
} = body;
|
|
1173
956
|
const commitParams = {
|
|
1174
|
-
$grid:
|
|
957
|
+
$grid: $xeGrid,
|
|
1175
958
|
code,
|
|
1176
959
|
button,
|
|
1177
960
|
body,
|
|
@@ -1190,7 +973,7 @@ var _default = exports.default = {
|
|
|
1190
973
|
let restPromise = Promise.resolve();
|
|
1191
974
|
if (editRules) {
|
|
1192
975
|
// 只校验新增和修改的数据
|
|
1193
|
-
restPromise =
|
|
976
|
+
restPromise = $xeGrid[validConfig && validConfig.msgMode === 'full' ? 'fullValidate' : 'validate'](body.insertRecords.concat(updateRecords));
|
|
1194
977
|
}
|
|
1195
978
|
return restPromise.then(errMap => {
|
|
1196
979
|
if (errMap) {
|
|
@@ -1198,9 +981,9 @@ var _default = exports.default = {
|
|
|
1198
981
|
return;
|
|
1199
982
|
}
|
|
1200
983
|
if (body.insertRecords.length || removeRecords.length || updateRecords.length || body.pendingRecords.length) {
|
|
1201
|
-
|
|
984
|
+
reactData.tableLoading = true;
|
|
1202
985
|
return Promise.resolve((beforeSave || ajaxMethods)(...applyArgs)).then(rest => {
|
|
1203
|
-
|
|
986
|
+
reactData.tableLoading = false;
|
|
1204
987
|
$xeTable.clearPendingRow();
|
|
1205
988
|
if (isRespMsg) {
|
|
1206
989
|
// 检测弹窗模块
|
|
@@ -1208,14 +991,14 @@ var _default = exports.default = {
|
|
|
1208
991
|
(0, _log.errLog)('vxe.error.reqModule', ['Modal']);
|
|
1209
992
|
}
|
|
1210
993
|
_ui.VxeUI.modal.message({
|
|
1211
|
-
content:
|
|
994
|
+
content: $xeGrid.getRespMsg(rest, 'vxe.grid.saveSuccess'),
|
|
1212
995
|
status: 'success'
|
|
1213
996
|
});
|
|
1214
997
|
}
|
|
1215
998
|
if (afterSave) {
|
|
1216
999
|
afterSave(...applyArgs);
|
|
1217
1000
|
} else {
|
|
1218
|
-
|
|
1001
|
+
$xeGrid.commitProxy('query');
|
|
1219
1002
|
}
|
|
1220
1003
|
if (saveSuccessMethods) {
|
|
1221
1004
|
saveSuccessMethods(Object.assign(Object.assign({}, commitParams), {
|
|
@@ -1226,7 +1009,7 @@ var _default = exports.default = {
|
|
|
1226
1009
|
status: true
|
|
1227
1010
|
};
|
|
1228
1011
|
}).catch(rest => {
|
|
1229
|
-
|
|
1012
|
+
reactData.tableLoading = false;
|
|
1230
1013
|
if (isRespMsg) {
|
|
1231
1014
|
// 检测弹窗模块
|
|
1232
1015
|
if (!_ui.VxeUI.modal) {
|
|
@@ -1234,7 +1017,7 @@ var _default = exports.default = {
|
|
|
1234
1017
|
}
|
|
1235
1018
|
_ui.VxeUI.modal.message({
|
|
1236
1019
|
id: code,
|
|
1237
|
-
content:
|
|
1020
|
+
content: $xeGrid.getRespMsg(rest, 'vxe.grid.operError'),
|
|
1238
1021
|
status: 'error'
|
|
1239
1022
|
});
|
|
1240
1023
|
}
|
|
@@ -1274,7 +1057,7 @@ var _default = exports.default = {
|
|
|
1274
1057
|
gCommandOpts.commandMethod({
|
|
1275
1058
|
code,
|
|
1276
1059
|
button,
|
|
1277
|
-
$grid:
|
|
1060
|
+
$grid: $xeGrid,
|
|
1278
1061
|
$table: $xeTable
|
|
1279
1062
|
}, ...args);
|
|
1280
1063
|
} else {
|
|
@@ -1283,66 +1066,34 @@ var _default = exports.default = {
|
|
|
1283
1066
|
}
|
|
1284
1067
|
}
|
|
1285
1068
|
}
|
|
1286
|
-
return
|
|
1287
|
-
},
|
|
1288
|
-
getRespMsg(rest, defaultMsg) {
|
|
1289
|
-
const {
|
|
1290
|
-
proxyOpts
|
|
1291
|
-
} = this;
|
|
1292
|
-
const resConfigs = proxyOpts.response || proxyOpts.props || {};
|
|
1293
|
-
let msg;
|
|
1294
|
-
if (rest && resConfigs.message) {
|
|
1295
|
-
msg = _xeUtils.default.get(rest, resConfigs.message);
|
|
1296
|
-
}
|
|
1297
|
-
return msg || getI18n(defaultMsg);
|
|
1298
|
-
},
|
|
1299
|
-
handleDeleteRow(code, alertKey, callback) {
|
|
1300
|
-
const selectRecords = this.getCheckboxRecords();
|
|
1301
|
-
if (this.isActiveMsg) {
|
|
1302
|
-
if (selectRecords.length) {
|
|
1303
|
-
return _ui.VxeUI.modal.confirm({
|
|
1304
|
-
id: `cfm_${code}`,
|
|
1305
|
-
content: getI18n(alertKey),
|
|
1306
|
-
escClosable: true
|
|
1307
|
-
}).then(type => {
|
|
1308
|
-
if (type === 'confirm') {
|
|
1309
|
-
return callback();
|
|
1310
|
-
}
|
|
1311
|
-
});
|
|
1312
|
-
} else {
|
|
1313
|
-
// 检测弹窗模块
|
|
1314
|
-
if (!_ui.VxeUI.modal) {
|
|
1315
|
-
(0, _log.errLog)('vxe.error.reqModule', ['Modal']);
|
|
1316
|
-
}
|
|
1317
|
-
_ui.VxeUI.modal.message({
|
|
1318
|
-
id: `msg_${code}`,
|
|
1319
|
-
content: getI18n('vxe.grid.selectOneRecord'),
|
|
1320
|
-
status: 'warning'
|
|
1321
|
-
});
|
|
1322
|
-
}
|
|
1323
|
-
} else {
|
|
1324
|
-
if (selectRecords.length) {
|
|
1325
|
-
callback();
|
|
1326
|
-
}
|
|
1327
|
-
}
|
|
1328
|
-
return Promise.resolve();
|
|
1069
|
+
return $xeGrid.$nextTick();
|
|
1329
1070
|
},
|
|
1330
1071
|
getFormData() {
|
|
1072
|
+
const $xeGrid = this;
|
|
1073
|
+
const props = $xeGrid;
|
|
1074
|
+
const reactData = $xeGrid.reactData;
|
|
1075
|
+
const {
|
|
1076
|
+
proxyConfig
|
|
1077
|
+
} = props;
|
|
1331
1078
|
const {
|
|
1332
|
-
proxyConfig,
|
|
1333
|
-
proxyOpts,
|
|
1334
|
-
formOpts,
|
|
1335
1079
|
formData
|
|
1336
|
-
} =
|
|
1080
|
+
} = reactData;
|
|
1081
|
+
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
1082
|
+
const formOpts = $xeGrid.computeFormOpts;
|
|
1337
1083
|
return proxyConfig && (0, _utils.isEnableConf)(proxyOpts) && proxyOpts.form ? formData : formOpts.data;
|
|
1338
1084
|
},
|
|
1339
1085
|
getFormItems(itemIndex) {
|
|
1086
|
+
const $xeGrid = this;
|
|
1087
|
+
const props = $xeGrid;
|
|
1088
|
+
const formOpts = $xeGrid.computeFormOpts;
|
|
1340
1089
|
const {
|
|
1341
|
-
formConfig
|
|
1342
|
-
|
|
1343
|
-
|
|
1090
|
+
formConfig
|
|
1091
|
+
} = props;
|
|
1092
|
+
const {
|
|
1093
|
+
items
|
|
1094
|
+
} = formOpts;
|
|
1344
1095
|
const itemList = [];
|
|
1345
|
-
_xeUtils.default.eachTree((0, _utils.isEnableConf)(
|
|
1096
|
+
_xeUtils.default.eachTree(formConfig && (0, _utils.isEnableConf)(formOpts) && items ? items : [], item => {
|
|
1346
1097
|
itemList.push(item);
|
|
1347
1098
|
}, {
|
|
1348
1099
|
children: 'children'
|
|
@@ -1350,210 +1101,215 @@ var _default = exports.default = {
|
|
|
1350
1101
|
return _xeUtils.default.isUndefined(itemIndex) ? itemList : itemList[itemIndex];
|
|
1351
1102
|
},
|
|
1352
1103
|
triggerToolbarCommitEvent(params, evnt) {
|
|
1104
|
+
const $xeGrid = this;
|
|
1353
1105
|
const {
|
|
1354
1106
|
code
|
|
1355
1107
|
} = params;
|
|
1356
|
-
return
|
|
1108
|
+
return $xeGrid.commitProxy(params, evnt).then(rest => {
|
|
1357
1109
|
if (code && rest && rest.status && ['query', 'reload', 'delete', 'save'].includes(code)) {
|
|
1358
|
-
|
|
1359
|
-
isReload: code === 'reload'
|
|
1360
|
-
|
|
1361
|
-
$event: evnt
|
|
1362
|
-
}));
|
|
1110
|
+
$xeGrid.dispatchEvent(code === 'delete' || code === 'save' ? `proxy-${code}` : 'proxy-query', Object.assign(Object.assign({}, rest), {
|
|
1111
|
+
isReload: code === 'reload'
|
|
1112
|
+
}), evnt);
|
|
1363
1113
|
}
|
|
1364
1114
|
});
|
|
1365
1115
|
},
|
|
1366
1116
|
triggerToolbarBtnEvent(button, evnt) {
|
|
1367
|
-
this
|
|
1368
|
-
|
|
1117
|
+
const $xeGrid = this;
|
|
1118
|
+
$xeGrid.triggerToolbarCommitEvent(button, evnt);
|
|
1119
|
+
$xeGrid.dispatchEvent('toolbar-button-click', {
|
|
1369
1120
|
code: button.code,
|
|
1370
|
-
button
|
|
1371
|
-
|
|
1372
|
-
$event: evnt
|
|
1373
|
-
});
|
|
1121
|
+
button
|
|
1122
|
+
}, evnt);
|
|
1374
1123
|
},
|
|
1375
1124
|
triggerToolbarTolEvent(tool, evnt) {
|
|
1376
|
-
this
|
|
1377
|
-
|
|
1125
|
+
const $xeGrid = this;
|
|
1126
|
+
$xeGrid.triggerToolbarCommitEvent(tool, evnt);
|
|
1127
|
+
$xeGrid.dispatchEvent('toolbar-tool-click', {
|
|
1378
1128
|
code: tool.code,
|
|
1379
|
-
tool
|
|
1380
|
-
|
|
1381
|
-
$event: evnt
|
|
1382
|
-
});
|
|
1129
|
+
tool
|
|
1130
|
+
}, evnt);
|
|
1383
1131
|
},
|
|
1384
|
-
|
|
1132
|
+
sortChangeEvent(params) {
|
|
1133
|
+
const $xeGrid = this;
|
|
1134
|
+
const props = $xeGrid;
|
|
1135
|
+
const reactData = $xeGrid.reactData;
|
|
1136
|
+
const $xeTable = $xeGrid.$refs.refTable;
|
|
1385
1137
|
const {
|
|
1386
|
-
|
|
1387
|
-
} =
|
|
1388
|
-
const
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
if (
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
}
|
|
1398
|
-
_ui.VxeUI.modal.message({
|
|
1399
|
-
id: code,
|
|
1400
|
-
content: getI18n('vxe.grid.selectOneRecord'),
|
|
1401
|
-
status: 'warning'
|
|
1138
|
+
proxyConfig
|
|
1139
|
+
} = props;
|
|
1140
|
+
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
1141
|
+
const sortOpts = $xeTable.computeSortOpts;
|
|
1142
|
+
// 如果是服务端排序
|
|
1143
|
+
if (sortOpts.remote) {
|
|
1144
|
+
reactData.sortData = params.sortList;
|
|
1145
|
+
if (proxyConfig && (0, _utils.isEnableConf)(proxyOpts)) {
|
|
1146
|
+
reactData.tablePage.currentPage = 1;
|
|
1147
|
+
$xeGrid.commitProxy('query').then(rest => {
|
|
1148
|
+
$xeGrid.dispatchEvent('proxy-query', rest, params.$event);
|
|
1402
1149
|
});
|
|
1403
1150
|
}
|
|
1404
1151
|
}
|
|
1152
|
+
$xeGrid.dispatchEvent('sort-change', params, params.$event);
|
|
1405
1153
|
},
|
|
1406
|
-
|
|
1154
|
+
pageChangeEvent(params) {
|
|
1155
|
+
const $xeGrid = this;
|
|
1156
|
+
const props = $xeGrid;
|
|
1157
|
+
const reactData = $xeGrid.reactData;
|
|
1158
|
+
const {
|
|
1159
|
+
proxyConfig
|
|
1160
|
+
} = props;
|
|
1407
1161
|
const {
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1162
|
+
tablePage
|
|
1163
|
+
} = reactData;
|
|
1164
|
+
const {
|
|
1165
|
+
$event,
|
|
1166
|
+
currentPage,
|
|
1167
|
+
pageSize
|
|
1411
1168
|
} = params;
|
|
1412
|
-
const
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
$grid: this,
|
|
1421
|
-
$event: params.$event
|
|
1422
|
-
}));
|
|
1423
|
-
});
|
|
1424
|
-
}
|
|
1169
|
+
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
1170
|
+
tablePage.currentPage = currentPage;
|
|
1171
|
+
tablePage.pageSize = pageSize;
|
|
1172
|
+
$xeGrid.dispatchEvent('page-change', params, $event);
|
|
1173
|
+
if (proxyConfig && (0, _utils.isEnableConf)(proxyOpts)) {
|
|
1174
|
+
$xeGrid.commitProxy('query').then(rest => {
|
|
1175
|
+
$xeGrid.dispatchEvent('proxy-query', rest, $event);
|
|
1176
|
+
});
|
|
1425
1177
|
}
|
|
1426
|
-
this.$emit('sort-change', Object.assign({
|
|
1427
|
-
$grid: this
|
|
1428
|
-
}, params));
|
|
1429
1178
|
},
|
|
1430
1179
|
filterChangeEvent(params) {
|
|
1180
|
+
const $xeGrid = this;
|
|
1181
|
+
const props = $xeGrid;
|
|
1182
|
+
const reactData = $xeGrid.reactData;
|
|
1183
|
+
const $xeTable = $xeGrid.$refs.refTable;
|
|
1431
1184
|
const {
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1185
|
+
proxyConfig
|
|
1186
|
+
} = props;
|
|
1187
|
+
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
1188
|
+
const filterOpts = $xeTable.computeFilterOpts;
|
|
1435
1189
|
// 如果是服务端过滤
|
|
1436
|
-
if (
|
|
1437
|
-
|
|
1438
|
-
if (
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
$grid: this,
|
|
1443
|
-
$event: params.$event
|
|
1444
|
-
}));
|
|
1190
|
+
if (filterOpts.remote) {
|
|
1191
|
+
reactData.filterData = params.filterList;
|
|
1192
|
+
if (proxyConfig && (0, _utils.isEnableConf)(proxyOpts)) {
|
|
1193
|
+
reactData.tablePage.currentPage = 1;
|
|
1194
|
+
$xeGrid.commitProxy('query').then(rest => {
|
|
1195
|
+
$xeGrid.dispatchEvent('proxy-query', rest, params.$event);
|
|
1445
1196
|
});
|
|
1446
1197
|
}
|
|
1447
1198
|
}
|
|
1448
|
-
|
|
1449
|
-
$grid: this
|
|
1450
|
-
}, params));
|
|
1199
|
+
$xeGrid.dispatchEvent('filter-change', params, params.$event);
|
|
1451
1200
|
},
|
|
1452
|
-
|
|
1201
|
+
submitFormEvent(params) {
|
|
1453
1202
|
const $xeGrid = this;
|
|
1454
|
-
const
|
|
1203
|
+
const props = $xeGrid;
|
|
1204
|
+
const reactData = $xeGrid.reactData;
|
|
1455
1205
|
const {
|
|
1456
1206
|
proxyConfig
|
|
1457
|
-
} =
|
|
1207
|
+
} = props;
|
|
1208
|
+
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
1458
1209
|
if (reactData.tableLoading) {
|
|
1459
1210
|
return;
|
|
1460
1211
|
}
|
|
1461
|
-
if (proxyConfig) {
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
isReload: true
|
|
1465
|
-
|
|
1466
|
-
$event: params.$event
|
|
1467
|
-
}));
|
|
1212
|
+
if (proxyConfig && (0, _utils.isEnableConf)(proxyOpts)) {
|
|
1213
|
+
$xeGrid.commitProxy('reload').then(rest => {
|
|
1214
|
+
$xeGrid.dispatchEvent('proxy-query', Object.assign(Object.assign({}, rest), {
|
|
1215
|
+
isReload: true
|
|
1216
|
+
}), params.$event);
|
|
1468
1217
|
});
|
|
1469
1218
|
}
|
|
1470
|
-
|
|
1471
|
-
$grid: this
|
|
1472
|
-
}, params));
|
|
1219
|
+
$xeGrid.dispatchEvent('form-submit', params, params.$event);
|
|
1473
1220
|
},
|
|
1474
|
-
|
|
1221
|
+
resetFormEvent(params) {
|
|
1222
|
+
const $xeGrid = this;
|
|
1223
|
+
const props = $xeGrid;
|
|
1224
|
+
const $xeTable = $xeGrid.$refs.refTable;
|
|
1475
1225
|
const {
|
|
1476
1226
|
proxyConfig
|
|
1477
|
-
} =
|
|
1478
|
-
const
|
|
1479
|
-
|
|
1227
|
+
} = props;
|
|
1228
|
+
const {
|
|
1229
|
+
$event
|
|
1230
|
+
} = params;
|
|
1231
|
+
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
1232
|
+
if (proxyConfig && (0, _utils.isEnableConf)(proxyOpts)) {
|
|
1480
1233
|
$xeTable.clearScroll();
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
isReload: true
|
|
1484
|
-
|
|
1485
|
-
$event: params.$event
|
|
1486
|
-
}));
|
|
1234
|
+
$xeGrid.commitProxy('reload').then(rest => {
|
|
1235
|
+
$xeGrid.dispatchEvent('proxy-query', Object.assign(Object.assign({}, rest), {
|
|
1236
|
+
isReload: true
|
|
1237
|
+
}), $event);
|
|
1487
1238
|
});
|
|
1488
1239
|
}
|
|
1489
|
-
|
|
1490
|
-
$grid: this
|
|
1491
|
-
}, params));
|
|
1240
|
+
$xeGrid.dispatchEvent('form-reset', params, $event);
|
|
1492
1241
|
},
|
|
1493
1242
|
submitInvalidEvent(params) {
|
|
1494
|
-
this
|
|
1495
|
-
|
|
1496
|
-
}, params));
|
|
1243
|
+
const $xeGrid = this;
|
|
1244
|
+
$xeGrid.dispatchEvent('form-submit-invalid', params, params.$event);
|
|
1497
1245
|
},
|
|
1498
1246
|
collapseEvent(params) {
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
$
|
|
1502
|
-
}
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
}, params));
|
|
1247
|
+
const $xeGrid = this;
|
|
1248
|
+
const {
|
|
1249
|
+
$event
|
|
1250
|
+
} = params;
|
|
1251
|
+
$xeGrid.dispatchEvent('form-toggle-collapse', params, $event);
|
|
1252
|
+
$xeGrid.dispatchEvent('form-collapse', params, $event);
|
|
1506
1253
|
},
|
|
1507
1254
|
triggerZoomEvent(evnt) {
|
|
1508
|
-
this
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
});
|
|
1255
|
+
const $xeGrid = this;
|
|
1256
|
+
const reactData = $xeGrid.reactData;
|
|
1257
|
+
$xeGrid.zoom();
|
|
1258
|
+
$xeGrid.dispatchEvent('zoom', {
|
|
1259
|
+
type: reactData.isZMax ? 'max' : 'revert'
|
|
1260
|
+
}, evnt);
|
|
1514
1261
|
},
|
|
1515
1262
|
zoom() {
|
|
1516
|
-
|
|
1263
|
+
const $xeGrid = this;
|
|
1264
|
+
const reactData = $xeGrid.reactData;
|
|
1265
|
+
return $xeGrid[reactData.isZMax ? 'revert' : 'maximize']();
|
|
1517
1266
|
},
|
|
1518
1267
|
isMaximized() {
|
|
1519
|
-
|
|
1268
|
+
const $xeGrid = this;
|
|
1269
|
+
const reactData = $xeGrid.reactData;
|
|
1270
|
+
return reactData.isZMax;
|
|
1520
1271
|
},
|
|
1521
1272
|
maximize() {
|
|
1522
|
-
|
|
1273
|
+
const $xeGrid = this;
|
|
1274
|
+
return $xeGrid.handleZoom(true);
|
|
1523
1275
|
},
|
|
1524
1276
|
revert() {
|
|
1525
|
-
|
|
1277
|
+
const $xeGrid = this;
|
|
1278
|
+
return $xeGrid.handleZoom();
|
|
1526
1279
|
},
|
|
1527
1280
|
handleZoom(isMax) {
|
|
1281
|
+
const $xeGrid = this;
|
|
1282
|
+
const reactData = $xeGrid.reactData;
|
|
1528
1283
|
const {
|
|
1529
1284
|
isZMax
|
|
1530
|
-
} =
|
|
1285
|
+
} = reactData;
|
|
1531
1286
|
if (isMax ? !isZMax : isZMax) {
|
|
1532
|
-
|
|
1533
|
-
if (
|
|
1534
|
-
|
|
1287
|
+
reactData.isZMax = !isZMax;
|
|
1288
|
+
if (reactData.tZindex < (0, _utils.getLastZIndex)()) {
|
|
1289
|
+
reactData.tZindex = (0, _utils.nextZIndex)();
|
|
1535
1290
|
}
|
|
1536
1291
|
}
|
|
1537
|
-
return
|
|
1538
|
-
setTimeout(() =>
|
|
1539
|
-
return
|
|
1292
|
+
return $xeGrid.$nextTick().then(() => $xeGrid.recalculate(true)).then(() => {
|
|
1293
|
+
setTimeout(() => $xeGrid.recalculate(true), 15);
|
|
1294
|
+
return reactData.isZMax;
|
|
1540
1295
|
});
|
|
1541
1296
|
},
|
|
1542
1297
|
getProxyInfo() {
|
|
1543
1298
|
const $xeGrid = this;
|
|
1544
|
-
const
|
|
1545
|
-
const
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1299
|
+
const props = $xeGrid;
|
|
1300
|
+
const $xeTable = $xeGrid.$refs.refTable;
|
|
1301
|
+
const reactData = $xeGrid.reactData;
|
|
1302
|
+
if (props.proxyConfig) {
|
|
1303
|
+
const {
|
|
1304
|
+
sortData
|
|
1305
|
+
} = reactData;
|
|
1550
1306
|
return {
|
|
1551
1307
|
data: $xeTable ? $xeTable.getFullData() : [],
|
|
1552
|
-
filter:
|
|
1553
|
-
form:
|
|
1308
|
+
filter: reactData.filterData,
|
|
1309
|
+
form: $xeGrid.getFormData(),
|
|
1554
1310
|
sort: sortData.length ? sortData[0] : {},
|
|
1555
1311
|
sorts: sortData,
|
|
1556
|
-
pager:
|
|
1312
|
+
pager: reactData.tablePage,
|
|
1557
1313
|
pendingRecords: $xeTable ? $xeTable.getPendingRecords() : []
|
|
1558
1314
|
};
|
|
1559
1315
|
}
|
|
@@ -1561,15 +1317,13 @@ var _default = exports.default = {
|
|
|
1561
1317
|
},
|
|
1562
1318
|
loadColumn(columns) {
|
|
1563
1319
|
const $xeGrid = this;
|
|
1564
|
-
const
|
|
1565
|
-
const
|
|
1566
|
-
$scopedSlots
|
|
1567
|
-
} = this;
|
|
1320
|
+
const slots = $xeGrid.$scopedSlots;
|
|
1321
|
+
const $xeTable = $xeGrid.$refs.refTable;
|
|
1568
1322
|
_xeUtils.default.eachTree(columns, column => {
|
|
1569
1323
|
if (column.slots) {
|
|
1570
1324
|
_xeUtils.default.each(column.slots, func => {
|
|
1571
1325
|
if (!_xeUtils.default.isFunction(func)) {
|
|
1572
|
-
if (
|
|
1326
|
+
if (!slots[func]) {
|
|
1573
1327
|
(0, _log.errLog)('vxe.error.notSlot', [func]);
|
|
1574
1328
|
}
|
|
1575
1329
|
}
|
|
@@ -1582,6 +1336,413 @@ var _default = exports.default = {
|
|
|
1582
1336
|
const $xeGrid = this;
|
|
1583
1337
|
$xeGrid.clearAll();
|
|
1584
1338
|
return $xeGrid.loadColumn(columns);
|
|
1339
|
+
},
|
|
1340
|
+
getConfigSlot(slotConfigs) {
|
|
1341
|
+
const $xeGrid = this;
|
|
1342
|
+
const slots = $xeGrid.$scopedSlots;
|
|
1343
|
+
const slotConf = {};
|
|
1344
|
+
_xeUtils.default.objectMap(slotConfigs, (slotFunc, slotKey) => {
|
|
1345
|
+
if (slotFunc) {
|
|
1346
|
+
if (_xeUtils.default.isString(slotFunc)) {
|
|
1347
|
+
if (slots[slotFunc]) {
|
|
1348
|
+
slotConf[slotKey] = slots[slotFunc];
|
|
1349
|
+
} else {
|
|
1350
|
+
(0, _log.errLog)('vxe.error.notSlot', [slotFunc]);
|
|
1351
|
+
}
|
|
1352
|
+
} else {
|
|
1353
|
+
slotConf[slotKey] = slotFunc;
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
});
|
|
1357
|
+
return slotConf;
|
|
1358
|
+
},
|
|
1359
|
+
getToolbarSlots() {
|
|
1360
|
+
const $xeGrid = this;
|
|
1361
|
+
const slots = $xeGrid.$scopedSlots;
|
|
1362
|
+
const toolbarOpts = $xeGrid.computeToolbarOpts;
|
|
1363
|
+
const toolbarOptSlots = toolbarOpts.slots;
|
|
1364
|
+
const toolbarSlots = {};
|
|
1365
|
+
if (slots.buttons && (!toolbarOptSlots || toolbarOptSlots.buttons !== 'buttons')) {
|
|
1366
|
+
(0, _log.warnLog)('vxe.error.reqProp', ['toolbar-config.slots.buttons']);
|
|
1367
|
+
}
|
|
1368
|
+
if (slots.tools && (!toolbarOptSlots || toolbarOptSlots.tools !== 'tools')) {
|
|
1369
|
+
(0, _log.warnLog)('vxe.error.reqProp', ['toolbar-config.slots.tools']);
|
|
1370
|
+
}
|
|
1371
|
+
if (toolbarOptSlots) {
|
|
1372
|
+
const buttonsSlot = $xeGrid.getFuncSlot(toolbarOptSlots, 'buttons');
|
|
1373
|
+
const buttonPrefixSlot = $xeGrid.getFuncSlot(toolbarOptSlots, 'buttonPrefix');
|
|
1374
|
+
const buttonSuffixSlot = $xeGrid.getFuncSlot(toolbarOptSlots, 'buttonSuffix');
|
|
1375
|
+
const toolsSlot = $xeGrid.getFuncSlot(toolbarOptSlots, 'tools');
|
|
1376
|
+
const toolPrefixSlot = $xeGrid.getFuncSlot(toolbarOptSlots, 'toolPrefix');
|
|
1377
|
+
const toolSuffixSlot = $xeGrid.getFuncSlot(toolbarOptSlots, 'toolSuffix');
|
|
1378
|
+
if (buttonsSlot) {
|
|
1379
|
+
toolbarSlots.buttons = buttonsSlot;
|
|
1380
|
+
}
|
|
1381
|
+
if (buttonPrefixSlot) {
|
|
1382
|
+
toolbarSlots.buttonPrefix = buttonPrefixSlot;
|
|
1383
|
+
}
|
|
1384
|
+
if (buttonSuffixSlot) {
|
|
1385
|
+
toolbarSlots.buttonSuffix = buttonSuffixSlot;
|
|
1386
|
+
}
|
|
1387
|
+
if (toolsSlot) {
|
|
1388
|
+
toolbarSlots.tools = toolsSlot;
|
|
1389
|
+
}
|
|
1390
|
+
if (toolPrefixSlot) {
|
|
1391
|
+
toolbarSlots.toolPrefix = toolPrefixSlot;
|
|
1392
|
+
}
|
|
1393
|
+
if (toolSuffixSlot) {
|
|
1394
|
+
toolbarSlots.toolSuffix = toolSuffixSlot;
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
return toolbarSlots;
|
|
1398
|
+
},
|
|
1399
|
+
getFuncSlot(optSlots, slotKey) {
|
|
1400
|
+
const $xeGrid = this;
|
|
1401
|
+
const slots = $xeGrid.$scopedSlots;
|
|
1402
|
+
const funcSlot = optSlots[slotKey];
|
|
1403
|
+
if (funcSlot) {
|
|
1404
|
+
if (_xeUtils.default.isString(funcSlot)) {
|
|
1405
|
+
if (slots[funcSlot]) {
|
|
1406
|
+
return slots[funcSlot];
|
|
1407
|
+
} else {
|
|
1408
|
+
(0, _log.errLog)('vxe.error.notSlot', [funcSlot]);
|
|
1409
|
+
}
|
|
1410
|
+
} else {
|
|
1411
|
+
return funcSlot;
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
return null;
|
|
1415
|
+
},
|
|
1416
|
+
//
|
|
1417
|
+
// Render
|
|
1418
|
+
//
|
|
1419
|
+
renderDefaultForm(h) {
|
|
1420
|
+
const VxeUIFormComponent = _ui.VxeUI.getComponent('VxeForm');
|
|
1421
|
+
const $xeGrid = this;
|
|
1422
|
+
const props = $xeGrid;
|
|
1423
|
+
const slots = $xeGrid.$scopedSlots;
|
|
1424
|
+
const reactData = $xeGrid.reactData;
|
|
1425
|
+
const {
|
|
1426
|
+
proxyConfig,
|
|
1427
|
+
formConfig
|
|
1428
|
+
} = props;
|
|
1429
|
+
const {
|
|
1430
|
+
formData
|
|
1431
|
+
} = reactData;
|
|
1432
|
+
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
1433
|
+
const formOpts = $xeGrid.computeFormOpts;
|
|
1434
|
+
if ((0, _utils.isEnableConf)(formConfig) && formOpts.items && formOpts.items.length) {
|
|
1435
|
+
const formSlots = {};
|
|
1436
|
+
if (!formOpts.inited) {
|
|
1437
|
+
formOpts.inited = true;
|
|
1438
|
+
const beforeItem = proxyOpts.beforeItem;
|
|
1439
|
+
if (proxyOpts && beforeItem) {
|
|
1440
|
+
formOpts.items.forEach(item => {
|
|
1441
|
+
beforeItem.call($xeGrid, {
|
|
1442
|
+
$grid: $xeGrid,
|
|
1443
|
+
item
|
|
1444
|
+
});
|
|
1445
|
+
});
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
// 处理插槽
|
|
1449
|
+
formOpts.items.forEach(item => {
|
|
1450
|
+
_xeUtils.default.each(item.slots, func => {
|
|
1451
|
+
if (!_xeUtils.default.isFunction(func)) {
|
|
1452
|
+
if (slots[func]) {
|
|
1453
|
+
formSlots[func] = slots[func];
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
});
|
|
1457
|
+
});
|
|
1458
|
+
return [VxeUIFormComponent ? h(VxeUIFormComponent, {
|
|
1459
|
+
props: Object.assign({}, formOpts, {
|
|
1460
|
+
data: proxyConfig && proxyOpts.form ? formData : formOpts.data
|
|
1461
|
+
}),
|
|
1462
|
+
on: {
|
|
1463
|
+
submit: $xeGrid.submitFormEvent,
|
|
1464
|
+
reset: $xeGrid.resetFormEvent,
|
|
1465
|
+
collapse: $xeGrid.collapseEvent,
|
|
1466
|
+
'submit-invalid': $xeGrid.submitInvalidEvent
|
|
1467
|
+
},
|
|
1468
|
+
scopedSlots: formSlots
|
|
1469
|
+
}) : renderEmptyElement($xeGrid)];
|
|
1470
|
+
}
|
|
1471
|
+
return [];
|
|
1472
|
+
},
|
|
1473
|
+
renderForm(h) {
|
|
1474
|
+
const $xeGrid = this;
|
|
1475
|
+
const props = $xeGrid;
|
|
1476
|
+
const slots = $xeGrid.$scopedSlots;
|
|
1477
|
+
const {
|
|
1478
|
+
formConfig
|
|
1479
|
+
} = props;
|
|
1480
|
+
const formSlot = slots.form;
|
|
1481
|
+
const hasForm = !!(formSlot || (0, _utils.isEnableConf)(formConfig));
|
|
1482
|
+
if (hasForm) {
|
|
1483
|
+
return h('div', {
|
|
1484
|
+
key: 'form',
|
|
1485
|
+
ref: 'refFormWrapper',
|
|
1486
|
+
class: 'vxe-grid--form-wrapper'
|
|
1487
|
+
}, formSlot ? formSlot.call($xeGrid, {
|
|
1488
|
+
$grid: $xeGrid
|
|
1489
|
+
}) : $xeGrid.renderDefaultForm(h));
|
|
1490
|
+
}
|
|
1491
|
+
return renderEmptyElement($xeGrid);
|
|
1492
|
+
},
|
|
1493
|
+
renderToolbar(h) {
|
|
1494
|
+
const $xeGrid = this;
|
|
1495
|
+
const props = $xeGrid;
|
|
1496
|
+
const slots = $xeGrid.$scopedSlots;
|
|
1497
|
+
const {
|
|
1498
|
+
toolbarConfig
|
|
1499
|
+
} = props;
|
|
1500
|
+
const toolbarSlot = slots.toolbar;
|
|
1501
|
+
const hasToolbar = !!(toolbarSlot || (0, _utils.isEnableConf)(toolbarConfig) || toolbar);
|
|
1502
|
+
const toolbarOpts = $xeGrid.computeToolbarOpts;
|
|
1503
|
+
if (hasToolbar) {
|
|
1504
|
+
return h('div', {
|
|
1505
|
+
key: 'toolbar',
|
|
1506
|
+
ref: 'refToolbarWrapper',
|
|
1507
|
+
class: 'vxe-grid--toolbar-wrapper'
|
|
1508
|
+
}, toolbarSlot ? toolbarSlot.call($xeGrid, {
|
|
1509
|
+
$grid: $xeGrid
|
|
1510
|
+
}) : [h(_toolbar.default, {
|
|
1511
|
+
props: Object.assign({}, toolbarOpts, {
|
|
1512
|
+
slots: undefined
|
|
1513
|
+
}),
|
|
1514
|
+
ref: 'xToolbar',
|
|
1515
|
+
scopedSlots: $xeGrid.getToolbarSlots()
|
|
1516
|
+
})]);
|
|
1517
|
+
}
|
|
1518
|
+
return renderEmptyElement($xeGrid);
|
|
1519
|
+
},
|
|
1520
|
+
renderTop(h) {
|
|
1521
|
+
const $xeGrid = this;
|
|
1522
|
+
const slots = $xeGrid.$scopedSlots;
|
|
1523
|
+
const topSlot = slots.top;
|
|
1524
|
+
return topSlot ? h('div', {
|
|
1525
|
+
key: 'top',
|
|
1526
|
+
ref: 'refTopWrapper',
|
|
1527
|
+
class: 'vxe-grid--top-wrapper'
|
|
1528
|
+
}, topSlot.call($xeGrid, {
|
|
1529
|
+
$grid: $xeGrid
|
|
1530
|
+
})) : renderEmptyElement($xeGrid);
|
|
1531
|
+
},
|
|
1532
|
+
renderTableLeft(h) {
|
|
1533
|
+
const $xeGrid = this;
|
|
1534
|
+
const slots = $xeGrid.$scopedSlots;
|
|
1535
|
+
const leftSlot = slots.left;
|
|
1536
|
+
if (leftSlot) {
|
|
1537
|
+
return h('div', {
|
|
1538
|
+
class: 'vxe-grid--left-wrapper'
|
|
1539
|
+
}, leftSlot({
|
|
1540
|
+
$grid: $xeGrid
|
|
1541
|
+
}));
|
|
1542
|
+
}
|
|
1543
|
+
return renderEmptyElement($xeGrid);
|
|
1544
|
+
},
|
|
1545
|
+
renderTableRight(h) {
|
|
1546
|
+
const $xeGrid = this;
|
|
1547
|
+
const slots = $xeGrid.$scopedSlots;
|
|
1548
|
+
const rightSlot = slots.right;
|
|
1549
|
+
if (rightSlot) {
|
|
1550
|
+
return h('div', {
|
|
1551
|
+
class: 'vxe-grid--right-wrapper'
|
|
1552
|
+
}, rightSlot({
|
|
1553
|
+
$grid: $xeGrid
|
|
1554
|
+
}));
|
|
1555
|
+
}
|
|
1556
|
+
return renderEmptyElement($xeGrid);
|
|
1557
|
+
},
|
|
1558
|
+
renderTable(h) {
|
|
1559
|
+
const $xeGrid = this;
|
|
1560
|
+
const slots = $xeGrid.$scopedSlots;
|
|
1561
|
+
const tableProps = $xeGrid.computeTableProps;
|
|
1562
|
+
return h('div', {
|
|
1563
|
+
class: 'vxe-grid--table-wrapper'
|
|
1564
|
+
}, [h(_table.default, {
|
|
1565
|
+
key: 'table',
|
|
1566
|
+
props: tableProps,
|
|
1567
|
+
on: getTableOns($xeGrid),
|
|
1568
|
+
scopedSlots: slots,
|
|
1569
|
+
ref: 'refTable'
|
|
1570
|
+
})]);
|
|
1571
|
+
},
|
|
1572
|
+
renderBottom(h) {
|
|
1573
|
+
const $xeGrid = this;
|
|
1574
|
+
const slots = $xeGrid.$scopedSlots;
|
|
1575
|
+
const bottomSlot = slots.bottom;
|
|
1576
|
+
return bottomSlot ? h('div', {
|
|
1577
|
+
key: 'bottom',
|
|
1578
|
+
ref: 'refBottomWrapper',
|
|
1579
|
+
class: 'vxe-grid--bottom-wrapper'
|
|
1580
|
+
}, bottomSlot.call($xeGrid, {
|
|
1581
|
+
$grid: $xeGrid
|
|
1582
|
+
})) : renderEmptyElement($xeGrid);
|
|
1583
|
+
},
|
|
1584
|
+
renderPager(h) {
|
|
1585
|
+
const VxeUIPagerComponent = _ui.VxeUI.getComponent('VxePager');
|
|
1586
|
+
const $xeGrid = this;
|
|
1587
|
+
const props = $xeGrid;
|
|
1588
|
+
const slots = $xeGrid.$scopedSlots;
|
|
1589
|
+
const reactData = $xeGrid.reactData;
|
|
1590
|
+
const {
|
|
1591
|
+
proxyConfig,
|
|
1592
|
+
pagerConfig
|
|
1593
|
+
} = props;
|
|
1594
|
+
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
1595
|
+
const pagerOpts = $xeGrid.computePagerOpts;
|
|
1596
|
+
const pagerSlot = slots.pager;
|
|
1597
|
+
if (pagerConfig && (0, _utils.isEnableConf)(pagerOpts) || slots.pager) {
|
|
1598
|
+
return h('div', {
|
|
1599
|
+
ref: 'refPagerWrapper',
|
|
1600
|
+
key: 'pager',
|
|
1601
|
+
class: 'vxe-grid--pager-wrapper'
|
|
1602
|
+
}, pagerSlot ? pagerSlot.call($xeGrid, {
|
|
1603
|
+
$grid: $xeGrid
|
|
1604
|
+
}) : [VxeUIPagerComponent ? h(VxeUIPagerComponent, {
|
|
1605
|
+
ref: 'refPager',
|
|
1606
|
+
props: Object.assign(Object.assign({}, pagerOpts), proxyConfig && (0, _utils.isEnableConf)(proxyOpts) ? reactData.tablePage : {}),
|
|
1607
|
+
on: {
|
|
1608
|
+
'page-change': $xeGrid.pageChangeEvent
|
|
1609
|
+
},
|
|
1610
|
+
scopedSlots: $xeGrid.getConfigSlot(pagerOpts.slots)
|
|
1611
|
+
}) : renderEmptyElement($xeGrid)]);
|
|
1612
|
+
}
|
|
1613
|
+
return renderEmptyElement($xeGrid);
|
|
1614
|
+
},
|
|
1615
|
+
renderChildLayout(h, layoutKeys) {
|
|
1616
|
+
const $xeGrid = this;
|
|
1617
|
+
const childVNs = [];
|
|
1618
|
+
layoutKeys.forEach(key => {
|
|
1619
|
+
switch (key) {
|
|
1620
|
+
case 'Form':
|
|
1621
|
+
childVNs.push($xeGrid.renderForm(h));
|
|
1622
|
+
break;
|
|
1623
|
+
case 'Toolbar':
|
|
1624
|
+
childVNs.push($xeGrid.renderToolbar(h));
|
|
1625
|
+
break;
|
|
1626
|
+
case 'Top':
|
|
1627
|
+
childVNs.push($xeGrid.renderTop(h));
|
|
1628
|
+
break;
|
|
1629
|
+
case 'Table':
|
|
1630
|
+
childVNs.push(h('div', {
|
|
1631
|
+
key: 'table',
|
|
1632
|
+
class: 'vxe-grid--table-container'
|
|
1633
|
+
}, [$xeGrid.renderTableLeft(h), $xeGrid.renderTable(h), $xeGrid.renderTableRight(h)]));
|
|
1634
|
+
break;
|
|
1635
|
+
case 'Bottom':
|
|
1636
|
+
childVNs.push($xeGrid.renderBottom(h));
|
|
1637
|
+
break;
|
|
1638
|
+
case 'Pager':
|
|
1639
|
+
childVNs.push($xeGrid.renderPager(h));
|
|
1640
|
+
break;
|
|
1641
|
+
default:
|
|
1642
|
+
(0, _log.errLog)('vxe.error.notProp', [`layouts -> ${key}`]);
|
|
1643
|
+
break;
|
|
1644
|
+
}
|
|
1645
|
+
});
|
|
1646
|
+
return childVNs;
|
|
1647
|
+
},
|
|
1648
|
+
renderLayout(h) {
|
|
1649
|
+
const $xeGrid = this;
|
|
1650
|
+
const slots = $xeGrid.$scopedSlots;
|
|
1651
|
+
const currLayoutConf = $xeGrid.computeCurrLayoutConf;
|
|
1652
|
+
const {
|
|
1653
|
+
headKeys,
|
|
1654
|
+
bodyKeys,
|
|
1655
|
+
footKeys
|
|
1656
|
+
} = currLayoutConf;
|
|
1657
|
+
const asideLeftSlot = slots.asideLeft || slots['aside-left'];
|
|
1658
|
+
const asideRightSlot = slots.asideRight || slots['aside-right'];
|
|
1659
|
+
return [h('div', {
|
|
1660
|
+
class: 'vxe-grid--layout-header-wrapper'
|
|
1661
|
+
}, $xeGrid.renderChildLayout(h, headKeys)), h('div', {
|
|
1662
|
+
class: 'vxe-grid--layout-body-wrapper'
|
|
1663
|
+
}, [asideLeftSlot ? h('div', {
|
|
1664
|
+
class: 'vxe-grid--layout-aside-left-wrapper'
|
|
1665
|
+
}, asideLeftSlot({})) : renderEmptyElement($xeGrid), h('div', {
|
|
1666
|
+
class: 'vxe-grid--layout-body-content-wrapper'
|
|
1667
|
+
}, $xeGrid.renderChildLayout(h, bodyKeys)), asideRightSlot ? h('div', {
|
|
1668
|
+
class: 'vxe-grid--layout-aside-right-wrapper'
|
|
1669
|
+
}, asideRightSlot({})) : renderEmptyElement($xeGrid)]), h('div', {
|
|
1670
|
+
class: 'vxe-grid--layout-footer-wrapper'
|
|
1671
|
+
}, $xeGrid.renderChildLayout(h, footKeys))];
|
|
1672
|
+
},
|
|
1673
|
+
renderVN(h) {
|
|
1674
|
+
const $xeGrid = this;
|
|
1675
|
+
const props = $xeGrid;
|
|
1676
|
+
const reactData = $xeGrid.reactData;
|
|
1677
|
+
const vSize = $xeGrid.computeSize;
|
|
1678
|
+
const styles = $xeGrid.computeStyles;
|
|
1679
|
+
const isLoading = $xeGrid.computeIsLoading;
|
|
1680
|
+
return h('div', {
|
|
1681
|
+
ref: 'refElem',
|
|
1682
|
+
class: ['vxe-grid', {
|
|
1683
|
+
[`size--${vSize}`]: vSize,
|
|
1684
|
+
'is--animat': !!props.animat,
|
|
1685
|
+
'is--round': props.round,
|
|
1686
|
+
'is--maximize': reactData.isZMax,
|
|
1687
|
+
'is--loading': isLoading
|
|
1688
|
+
}],
|
|
1689
|
+
style: styles
|
|
1690
|
+
}, $xeGrid.renderLayout(h));
|
|
1691
|
+
}
|
|
1692
|
+
}),
|
|
1693
|
+
created() {
|
|
1694
|
+
// 使用已安装的组件,如果未安装则不渲染
|
|
1695
|
+
const VxeUIFormComponent = _ui.VxeUI.getComponent('VxeForm');
|
|
1696
|
+
const VxeUIPagerComponent = _ui.VxeUI.getComponent('VxePager');
|
|
1697
|
+
const $xeGrid = this;
|
|
1698
|
+
const props = $xeGrid;
|
|
1699
|
+
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
1700
|
+
// const { data, formOpts, proxyOpts, proxyConfig } = this
|
|
1701
|
+
// if (proxyConfig && (data || (proxyOpts.form && formOpts.data))) {
|
|
1702
|
+
// errLog('vxe.error.errConflicts', ['grid.data', 'grid.proxy-config'])
|
|
1703
|
+
// }
|
|
1704
|
+
if (props.toolbar) {
|
|
1705
|
+
(0, _log.errLog)('vxe.error.delProp', ['grid.toolbar', 'grid.toolbar-config']);
|
|
1706
|
+
}
|
|
1707
|
+
if (props.toolbarConfig && !_xeUtils.default.isObject(props.toolbarConfig)) {
|
|
1708
|
+
(0, _log.errLog)('vxe.error.errProp', [`grid.toolbar-config=${props.toolbarConfig}`, 'grid.toolbar-config={}']);
|
|
1709
|
+
}
|
|
1710
|
+
if (proxyOpts.props) {
|
|
1711
|
+
(0, _log.warnLog)('vxe.error.delProp', ['proxy-config.props', 'proxy-config.response']);
|
|
1712
|
+
}
|
|
1713
|
+
$xeGrid.$nextTick(() => {
|
|
1714
|
+
if (props.formConfig) {
|
|
1715
|
+
if (!VxeUIFormComponent) {
|
|
1716
|
+
(0, _log.errLog)('vxe.error.reqComp', ['vxe-form']);
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
if (props.pagerConfig) {
|
|
1720
|
+
if (!VxeUIPagerComponent) {
|
|
1721
|
+
(0, _log.errLog)('vxe.error.reqComp', ['vxe-pager']);
|
|
1722
|
+
}
|
|
1723
|
+
}
|
|
1724
|
+
});
|
|
1725
|
+
$xeGrid.initPages();
|
|
1726
|
+
globalEvents.on($xeGrid, 'keydown', $xeGrid.handleGlobalKeydownEvent);
|
|
1727
|
+
},
|
|
1728
|
+
mounted() {
|
|
1729
|
+
const $xeGrid = this;
|
|
1730
|
+
const props = $xeGrid;
|
|
1731
|
+
const {
|
|
1732
|
+
columns
|
|
1733
|
+
} = props;
|
|
1734
|
+
if (columns && columns.length) {
|
|
1735
|
+
$xeGrid.loadColumn(columns);
|
|
1585
1736
|
}
|
|
1586
|
-
|
|
1587
|
-
|
|
1737
|
+
$xeGrid.initToolbar();
|
|
1738
|
+
$xeGrid.initProxy();
|
|
1739
|
+
},
|
|
1740
|
+
destroyed() {
|
|
1741
|
+
const $xeGrid = this;
|
|
1742
|
+
globalEvents.off($xeGrid, 'keydown');
|
|
1743
|
+
},
|
|
1744
|
+
render(h) {
|
|
1745
|
+
return this.renderVN(h);
|
|
1746
|
+
}
|
|
1747
|
+
});
|
|
1748
|
+
/* define-vxe-component end */
|