vxe-table 3.7.8 → 3.7.9-beta.1
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/README.md +2 -2
- package/helper/vetur/attributes.json +8 -0
- package/helper/vetur/tags.json +3 -1
- package/lib/edit/src/mixin.js +2 -2
- package/lib/edit/src/mixin.min.js +1 -1
- package/lib/grid/src/grid.js +151 -70
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/icon/style/style.css +9 -1
- package/lib/icon/style/style.min.css +9 -1
- package/lib/index.css +1 -1
- package/lib/index.umd.js +260 -93
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +9 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +9 -1
- package/lib/locale/lang/ja-JP.js +9 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +9 -1
- package/lib/locale/lang/zh-CN.js +9 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +9 -1
- package/lib/locale/lang/zh-HK.min.js +1 -1
- package/lib/locale/lang/zh-HK.umd.js +9 -1
- package/lib/locale/lang/zh-MO.min.js +1 -1
- package/lib/locale/lang/zh-MO.umd.js +9 -1
- package/lib/locale/lang/zh-TC.js +9 -1
- package/lib/locale/lang/zh-TC.min.js +1 -1
- package/lib/locale/lang/zh-TC.umd.js +9 -1
- package/lib/locale/lang/zh-TW.min.js +1 -1
- package/lib/locale/lang/zh-TW.umd.js +9 -1
- package/lib/pager/src/pager.js +62 -6
- package/lib/pager/src/pager.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/body.js +11 -5
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/methods.js +28 -11
- package/lib/table/src/methods.min.js +1 -1
- package/lib/tools/dom.js +4 -2
- package/lib/tools/dom.min.js +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/v-x-e-table/index.js +1 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/v-x-e-table/src/conf.js +2 -0
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/lib/v-x-e-table/style/style.css +9 -1
- package/lib/v-x-e-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/edit/src/mixin.js +2 -2
- package/packages/grid/src/grid.js +147 -73
- package/packages/locale/lang/en-US.js +9 -1
- package/packages/locale/lang/ja-JP.js +9 -1
- package/packages/locale/lang/zh-CN.js +9 -1
- package/packages/locale/lang/zh-TC.js +9 -1
- package/packages/pager/src/pager.js +65 -6
- package/packages/table/src/body.js +8 -5
- package/packages/table/src/methods.js +24 -10
- package/packages/tools/dom.js +4 -2
- package/packages/v-x-e-table/src/conf.js +2 -0
- package/styles/icon.scss +10 -1
- package/types/pager.d.ts +1 -1
- /package/lib/icon/style/{iconfont.1705365451437.ttf → iconfont.1708907653537.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1705365451437.woff → iconfont.1708907653537.woff} +0 -0
- /package/lib/icon/style/{iconfont.1705365451437.woff2 → iconfont.1708907653537.woff2} +0 -0
- /package/lib/{iconfont.1705365451437.ttf → iconfont.1708907653537.ttf} +0 -0
- /package/lib/{iconfont.1705365451437.woff → iconfont.1708907653537.woff} +0 -0
- /package/lib/{iconfont.1705365451437.woff2 → iconfont.1708907653537.woff2} +0 -0
|
@@ -137,6 +137,150 @@ function getTableOns (_vm) {
|
|
|
137
137
|
return ons
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
+
/**
|
|
141
|
+
* 渲染表单
|
|
142
|
+
*/
|
|
143
|
+
function renderForms (h, _vm) {
|
|
144
|
+
const { _e, $scopedSlots, formConfig } = _vm
|
|
145
|
+
const formSlot = $scopedSlots.form
|
|
146
|
+
const hasForm = !!(formSlot || isEnableConf(formConfig))
|
|
147
|
+
|
|
148
|
+
return hasForm ? h('div', {
|
|
149
|
+
key: 'form',
|
|
150
|
+
ref: 'formWrapper',
|
|
151
|
+
class: 'vxe-grid--form-wrapper'
|
|
152
|
+
}, formSlot ? formSlot.call(_vm, { $grid: _vm }, h) : renderDefaultForm(h, _vm)) : _e()
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* 渲染工具栏
|
|
157
|
+
*/
|
|
158
|
+
function renderToolbars (h, _vm) {
|
|
159
|
+
const { _e, $scopedSlots, toolbarConfig, toolbar } = _vm
|
|
160
|
+
const toolbarSlot = $scopedSlots.toolbar
|
|
161
|
+
const hasToolbar = !!(toolbarSlot || isEnableConf(toolbarConfig) || toolbar)
|
|
162
|
+
|
|
163
|
+
return hasToolbar ? h('div', {
|
|
164
|
+
key: 'toolbar',
|
|
165
|
+
ref: 'toolbarWrapper',
|
|
166
|
+
class: 'vxe-grid--toolbar-wrapper'
|
|
167
|
+
}, toolbarSlot
|
|
168
|
+
? toolbarSlot.call(_vm, { $grid: _vm }, h)
|
|
169
|
+
: [
|
|
170
|
+
h('vxe-toolbar', {
|
|
171
|
+
props: _vm.toolbarOpts,
|
|
172
|
+
ref: 'xToolbar',
|
|
173
|
+
scopedSlots: getToolbarSlots(_vm)
|
|
174
|
+
})
|
|
175
|
+
]
|
|
176
|
+
) : _e()
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* 渲染表格顶部区域
|
|
181
|
+
*/
|
|
182
|
+
function renderTops (h, _vm) {
|
|
183
|
+
const { _e, $scopedSlots } = _vm
|
|
184
|
+
const topSlot = $scopedSlots.top
|
|
185
|
+
|
|
186
|
+
return topSlot ? h('div', {
|
|
187
|
+
key: 'top',
|
|
188
|
+
ref: 'topWrapper',
|
|
189
|
+
class: 'vxe-grid--top-wrapper'
|
|
190
|
+
}, topSlot.call(_vm, { $grid: _vm }, h)) : _e()
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* 渲染表格
|
|
195
|
+
*/
|
|
196
|
+
function renderTables (h, _vm) {
|
|
197
|
+
const { $scopedSlots, tableProps } = _vm
|
|
198
|
+
|
|
199
|
+
return h('vxe-table', {
|
|
200
|
+
key: 'table',
|
|
201
|
+
props: tableProps,
|
|
202
|
+
on: getTableOns(_vm),
|
|
203
|
+
scopedSlots: $scopedSlots,
|
|
204
|
+
ref: 'xTable'
|
|
205
|
+
})
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* 渲染表格底部区域
|
|
210
|
+
*/
|
|
211
|
+
function renderBottoms (h, _vm) {
|
|
212
|
+
const { _e, $scopedSlots } = _vm
|
|
213
|
+
const bottomSlot = $scopedSlots.bottom
|
|
214
|
+
|
|
215
|
+
return bottomSlot ? h('div', {
|
|
216
|
+
key: 'bottom',
|
|
217
|
+
ref: 'bottomWrapper',
|
|
218
|
+
class: 'vxe-grid--bottom-wrapper'
|
|
219
|
+
}, bottomSlot.call(_vm, { $grid: _vm }, h)) : _e()
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* 渲染分页
|
|
224
|
+
*/
|
|
225
|
+
function renderPagers (h, _vm) {
|
|
226
|
+
const { _e, $scopedSlots, pagerConfig, proxyConfig, tablePage } = _vm
|
|
227
|
+
const pagerSlot = $scopedSlots.pager
|
|
228
|
+
const hasPager = !!(pagerSlot || isEnableConf(pagerConfig))
|
|
229
|
+
|
|
230
|
+
return hasPager ? h('div', {
|
|
231
|
+
key: 'pager',
|
|
232
|
+
ref: 'pagerWrapper',
|
|
233
|
+
class: 'vxe-grid--pager-wrapper'
|
|
234
|
+
}, pagerSlot
|
|
235
|
+
? pagerSlot.call(_vm, { $grid: _vm }, h)
|
|
236
|
+
: [
|
|
237
|
+
h('vxe-pager', {
|
|
238
|
+
props: { ..._vm.pagerOpts, ...(proxyConfig ? tablePage : {}) },
|
|
239
|
+
on: {
|
|
240
|
+
'page-change': _vm.pageChangeEvent
|
|
241
|
+
},
|
|
242
|
+
scopedSlots: getPagerSlots(_vm)
|
|
243
|
+
})
|
|
244
|
+
]
|
|
245
|
+
) : _e()
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
const defaultLayouts = ['Form', 'Toolbar', 'Top', 'Table', 'Bottom', 'Pager']
|
|
249
|
+
|
|
250
|
+
function renderLayout (h, _vm) {
|
|
251
|
+
const { layouts } = _vm
|
|
252
|
+
const vns = []
|
|
253
|
+
const currLayouts = (layouts && layouts.length ? layouts : (GlobalConfig.grid.layouts || defaultLayouts))
|
|
254
|
+
currLayouts.forEach(name => {
|
|
255
|
+
switch (name) {
|
|
256
|
+
case 'Form':
|
|
257
|
+
vns.push(renderForms(h, _vm))
|
|
258
|
+
break
|
|
259
|
+
case 'Toolbar':
|
|
260
|
+
vns.push(renderToolbars(h, _vm))
|
|
261
|
+
break
|
|
262
|
+
case 'Top':
|
|
263
|
+
vns.push(renderTops(h, _vm))
|
|
264
|
+
break
|
|
265
|
+
case 'Table':
|
|
266
|
+
vns.push(renderTables(h, _vm))
|
|
267
|
+
break
|
|
268
|
+
case 'Bottom':
|
|
269
|
+
vns.push(renderBottoms(h, _vm))
|
|
270
|
+
break
|
|
271
|
+
case 'Pager':
|
|
272
|
+
vns.push(renderPagers(h, _vm))
|
|
273
|
+
break
|
|
274
|
+
default:
|
|
275
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
276
|
+
errLog('vxe.error.notProp', [`layouts -> ${name}`])
|
|
277
|
+
}
|
|
278
|
+
break
|
|
279
|
+
}
|
|
280
|
+
})
|
|
281
|
+
return vns
|
|
282
|
+
}
|
|
283
|
+
|
|
140
284
|
Object.keys(Table.methods).forEach(name => {
|
|
141
285
|
methods[name] = function (...args) {
|
|
142
286
|
return this.$refs.xTable && this.$refs.xTable[name](...args)
|
|
@@ -148,6 +292,7 @@ export default {
|
|
|
148
292
|
mixins: [vSize],
|
|
149
293
|
props: {
|
|
150
294
|
...Table.props,
|
|
295
|
+
layouts: Array,
|
|
151
296
|
columns: Array,
|
|
152
297
|
pagerConfig: [Boolean, Object],
|
|
153
298
|
proxyConfig: Object,
|
|
@@ -279,10 +424,7 @@ export default {
|
|
|
279
424
|
GlobalEvent.off(this, 'keydown')
|
|
280
425
|
},
|
|
281
426
|
render (h) {
|
|
282
|
-
const {
|
|
283
|
-
const hasForm = !!($scopedSlots.form || isEnableConf(this.formConfig))
|
|
284
|
-
const hasToolbar = !!($scopedSlots.toolbar || isEnableConf(this.toolbarConfig) || this.toolbar)
|
|
285
|
-
const hasPager = !!($scopedSlots.pager || isEnableConf(this.pagerConfig))
|
|
427
|
+
const { vSize, isZMax } = this
|
|
286
428
|
return h('div', {
|
|
287
429
|
class: ['vxe-grid', {
|
|
288
430
|
[`size--${vSize}`]: vSize,
|
|
@@ -292,75 +434,7 @@ export default {
|
|
|
292
434
|
'is--loading': this.loading || this.tableLoading
|
|
293
435
|
}],
|
|
294
436
|
style: this.renderStyle
|
|
295
|
-
},
|
|
296
|
-
/**
|
|
297
|
-
* 渲染表单
|
|
298
|
-
*/
|
|
299
|
-
hasForm ? h('div', {
|
|
300
|
-
ref: 'formWrapper',
|
|
301
|
-
class: 'vxe-grid--form-wrapper'
|
|
302
|
-
}, $scopedSlots.form
|
|
303
|
-
? $scopedSlots.form.call(this, { $grid: this }, h)
|
|
304
|
-
: renderDefaultForm(h, this)
|
|
305
|
-
) : null,
|
|
306
|
-
/**
|
|
307
|
-
* 渲染工具栏
|
|
308
|
-
*/
|
|
309
|
-
hasToolbar ? h('div', {
|
|
310
|
-
ref: 'toolbarWrapper',
|
|
311
|
-
class: 'vxe-grid--toolbar-wrapper'
|
|
312
|
-
}, $scopedSlots.toolbar
|
|
313
|
-
? $scopedSlots.toolbar.call(this, { $grid: this }, h)
|
|
314
|
-
: [
|
|
315
|
-
h('vxe-toolbar', {
|
|
316
|
-
props: this.toolbarOpts,
|
|
317
|
-
ref: 'xToolbar',
|
|
318
|
-
scopedSlots: getToolbarSlots(this)
|
|
319
|
-
})
|
|
320
|
-
]
|
|
321
|
-
) : null,
|
|
322
|
-
/**
|
|
323
|
-
* 渲染表格顶部区域
|
|
324
|
-
*/
|
|
325
|
-
$scopedSlots.top ? h('div', {
|
|
326
|
-
ref: 'topWrapper',
|
|
327
|
-
class: 'vxe-grid--top-wrapper'
|
|
328
|
-
}, $scopedSlots.top.call(this, { $grid: this }, h)) : null,
|
|
329
|
-
/**
|
|
330
|
-
* 渲染表格
|
|
331
|
-
*/
|
|
332
|
-
h('vxe-table', {
|
|
333
|
-
props: this.tableProps,
|
|
334
|
-
on: getTableOns(this),
|
|
335
|
-
scopedSlots: $scopedSlots,
|
|
336
|
-
ref: 'xTable'
|
|
337
|
-
}),
|
|
338
|
-
/**
|
|
339
|
-
* 渲染表格底部区域
|
|
340
|
-
*/
|
|
341
|
-
$scopedSlots.bottom ? h('div', {
|
|
342
|
-
ref: 'bottomWrapper',
|
|
343
|
-
class: 'vxe-grid--bottom-wrapper'
|
|
344
|
-
}, $scopedSlots.bottom.call(this, { $grid: this }, h)) : null,
|
|
345
|
-
/**
|
|
346
|
-
* 渲染分页
|
|
347
|
-
*/
|
|
348
|
-
hasPager ? h('div', {
|
|
349
|
-
ref: 'pagerWrapper',
|
|
350
|
-
class: 'vxe-grid--pager-wrapper'
|
|
351
|
-
}, $scopedSlots.pager
|
|
352
|
-
? $scopedSlots.pager.call(this, { $grid: this }, h)
|
|
353
|
-
: [
|
|
354
|
-
h('vxe-pager', {
|
|
355
|
-
props: { ...this.pagerOpts, ...(this.proxyConfig ? this.tablePage : {}) },
|
|
356
|
-
on: {
|
|
357
|
-
'page-change': this.pageChangeEvent
|
|
358
|
-
},
|
|
359
|
-
scopedSlots: getPagerSlots(this)
|
|
360
|
-
})
|
|
361
|
-
]
|
|
362
|
-
) : null
|
|
363
|
-
])
|
|
437
|
+
}, renderLayout(h, this))
|
|
364
438
|
},
|
|
365
439
|
methods: {
|
|
366
440
|
...methods,
|
|
@@ -168,10 +168,18 @@ export default {
|
|
|
168
168
|
pagesize: '{0}/page',
|
|
169
169
|
total: 'Total {0} record',
|
|
170
170
|
pageClassifier: '',
|
|
171
|
+
homePage: 'Home',
|
|
172
|
+
homePageTitle: 'Home page',
|
|
171
173
|
prevPage: 'Previous page',
|
|
174
|
+
prevPageTitle: 'Previous page',
|
|
172
175
|
nextPage: 'next page',
|
|
176
|
+
nextPageTitle: 'next page',
|
|
173
177
|
prevJump: 'Jump previous page',
|
|
174
|
-
|
|
178
|
+
prevJumpTitle: 'Jump previous page',
|
|
179
|
+
nextJump: 'Jump next page',
|
|
180
|
+
nextJumpTitle: 'Jump next page',
|
|
181
|
+
endPage: 'End page',
|
|
182
|
+
endPageTitle: 'End'
|
|
175
183
|
},
|
|
176
184
|
alert: {
|
|
177
185
|
title: 'Message notification'
|
|
@@ -168,10 +168,18 @@ export default {
|
|
|
168
168
|
pagesize: '{0}件/ページ',
|
|
169
169
|
total: '全 {0} 件',
|
|
170
170
|
pageClassifier: '',
|
|
171
|
+
homePage: 'Home',
|
|
172
|
+
homePageTitle: 'Home page',
|
|
171
173
|
prevPage: '前のページ',
|
|
174
|
+
prevPageTitle: '前のページ',
|
|
172
175
|
nextPage: '次のページ',
|
|
176
|
+
nextPageTitle: '次のページ',
|
|
173
177
|
prevJump: '前のページに移動',
|
|
174
|
-
|
|
178
|
+
prevJumpTitle: '前のページに移動',
|
|
179
|
+
nextJump: '次のページに移動',
|
|
180
|
+
nextJumpTitle: '次のページに移動',
|
|
181
|
+
endPage: 'End',
|
|
182
|
+
endPageTitle: 'End page'
|
|
175
183
|
},
|
|
176
184
|
alert: {
|
|
177
185
|
title: 'メッセージ'
|
|
@@ -168,10 +168,18 @@ export default {
|
|
|
168
168
|
pagesize: '{0}条/页',
|
|
169
169
|
total: '共 {0} 条记录',
|
|
170
170
|
pageClassifier: '页',
|
|
171
|
+
homePage: '首页',
|
|
172
|
+
homePageTitle: '首页',
|
|
171
173
|
prevPage: '上一页',
|
|
174
|
+
prevPageTitle: '上一页',
|
|
172
175
|
nextPage: '下一页',
|
|
176
|
+
nextPageTitle: '下一页',
|
|
173
177
|
prevJump: '向上跳页',
|
|
174
|
-
|
|
178
|
+
prevJumpTitle: '向上跳页',
|
|
179
|
+
nextJump: '向下跳页',
|
|
180
|
+
nextJumpTitle: '向下跳页',
|
|
181
|
+
endPage: '末页',
|
|
182
|
+
endPageTitle: '末页'
|
|
175
183
|
},
|
|
176
184
|
alert: {
|
|
177
185
|
title: '消息提示'
|
|
@@ -168,10 +168,18 @@ export default {
|
|
|
168
168
|
pagesize: '{0}項/頁',
|
|
169
169
|
total: '共 {0} 項記錄',
|
|
170
170
|
pageClassifier: '頁',
|
|
171
|
+
homePage: '首頁',
|
|
172
|
+
homePageTitle: '首頁',
|
|
171
173
|
prevPage: '上一頁',
|
|
174
|
+
prevPageTitle: '上一頁',
|
|
172
175
|
nextPage: '下一頁',
|
|
176
|
+
nextPageTitle: '下一頁',
|
|
173
177
|
prevJump: '向上跳頁',
|
|
174
|
-
|
|
178
|
+
prevJumpTitle: '向上跳頁',
|
|
179
|
+
nextJump: '向下跳頁',
|
|
180
|
+
nextJumpTitle: '向下跳頁',
|
|
181
|
+
endPage: '末頁',
|
|
182
|
+
endPageTitle: '末頁'
|
|
175
183
|
},
|
|
176
184
|
alert: {
|
|
177
185
|
title: '訊息提示'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
2
|
import GlobalConfig from '../../v-x-e-table/src/conf'
|
|
3
3
|
import vSize from '../../mixins/size'
|
|
4
|
+
import { errLog } from '../../tools/log'
|
|
4
5
|
|
|
5
6
|
export default {
|
|
6
7
|
name: 'VxePager',
|
|
@@ -38,7 +39,9 @@ export default {
|
|
|
38
39
|
iconJumpPrev: String,
|
|
39
40
|
iconJumpNext: String,
|
|
40
41
|
iconNextPage: String,
|
|
41
|
-
iconJumpMore: String
|
|
42
|
+
iconJumpMore: String,
|
|
43
|
+
iconHomePage: String,
|
|
44
|
+
iconEndPage: String
|
|
42
45
|
},
|
|
43
46
|
inject: {
|
|
44
47
|
$xegrid: {
|
|
@@ -96,7 +99,13 @@ export default {
|
|
|
96
99
|
)
|
|
97
100
|
}
|
|
98
101
|
this.layouts.forEach(name => {
|
|
99
|
-
|
|
102
|
+
if (this[`render${name}`](h)) {
|
|
103
|
+
childNodes.push(this[`render${name}`](h))
|
|
104
|
+
} else {
|
|
105
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
106
|
+
errLog('vxe.error.notProp', [`layouts -> ${name}`])
|
|
107
|
+
}
|
|
108
|
+
}
|
|
100
109
|
})
|
|
101
110
|
if ($scopedSlots.right) {
|
|
102
111
|
childNodes.push(
|
|
@@ -122,6 +131,44 @@ export default {
|
|
|
122
131
|
])
|
|
123
132
|
},
|
|
124
133
|
methods: {
|
|
134
|
+
// 首页
|
|
135
|
+
renderHome (h) {
|
|
136
|
+
return h('button', {
|
|
137
|
+
class: ['vxe-pager--prev-btn', {
|
|
138
|
+
'is--disabled': this.currentPage <= 1
|
|
139
|
+
}],
|
|
140
|
+
attrs: {
|
|
141
|
+
type: 'button',
|
|
142
|
+
title: GlobalConfig.i18n('vxe.pager.homePageTitle')
|
|
143
|
+
},
|
|
144
|
+
on: {
|
|
145
|
+
click: this.homePage
|
|
146
|
+
}
|
|
147
|
+
}, [
|
|
148
|
+
h('i', {
|
|
149
|
+
class: ['vxe-pager--btn-icon', this.iconHomePage || GlobalConfig.icon.PAGER_HOME]
|
|
150
|
+
})
|
|
151
|
+
])
|
|
152
|
+
},
|
|
153
|
+
// 末页
|
|
154
|
+
renderEnd (h) {
|
|
155
|
+
return h('button', {
|
|
156
|
+
class: ['vxe-pager--prev-btn', {
|
|
157
|
+
'is--disabled': this.currentPage <= 1
|
|
158
|
+
}],
|
|
159
|
+
attrs: {
|
|
160
|
+
type: 'button',
|
|
161
|
+
title: GlobalConfig.i18n('vxe.pager.endPageTitle')
|
|
162
|
+
},
|
|
163
|
+
on: {
|
|
164
|
+
click: this.endPage
|
|
165
|
+
}
|
|
166
|
+
}, [
|
|
167
|
+
h('i', {
|
|
168
|
+
class: ['vxe-pager--btn-icon', this.iconEndPage || GlobalConfig.icon.PAGER_END]
|
|
169
|
+
})
|
|
170
|
+
])
|
|
171
|
+
},
|
|
125
172
|
// 上一页
|
|
126
173
|
renderPrevPage (h) {
|
|
127
174
|
return h('button', {
|
|
@@ -130,7 +177,7 @@ export default {
|
|
|
130
177
|
}],
|
|
131
178
|
attrs: {
|
|
132
179
|
type: 'button',
|
|
133
|
-
title: GlobalConfig.i18n('vxe.pager.
|
|
180
|
+
title: GlobalConfig.i18n('vxe.pager.prevPageTitle')
|
|
134
181
|
},
|
|
135
182
|
on: {
|
|
136
183
|
click: this.prevPage
|
|
@@ -150,7 +197,7 @@ export default {
|
|
|
150
197
|
}],
|
|
151
198
|
attrs: {
|
|
152
199
|
type: 'button',
|
|
153
|
-
title: GlobalConfig.i18n('vxe.pager.
|
|
200
|
+
title: GlobalConfig.i18n('vxe.pager.prevJumpTitle')
|
|
154
201
|
},
|
|
155
202
|
on: {
|
|
156
203
|
click: this.prevJump
|
|
@@ -185,7 +232,7 @@ export default {
|
|
|
185
232
|
}],
|
|
186
233
|
attrs: {
|
|
187
234
|
type: 'button',
|
|
188
|
-
title: GlobalConfig.i18n('vxe.pager.
|
|
235
|
+
title: GlobalConfig.i18n('vxe.pager.nextJumpTitle')
|
|
189
236
|
},
|
|
190
237
|
on: {
|
|
191
238
|
click: this.nextJump
|
|
@@ -207,7 +254,7 @@ export default {
|
|
|
207
254
|
}],
|
|
208
255
|
attrs: {
|
|
209
256
|
type: 'button',
|
|
210
|
-
title: GlobalConfig.i18n('vxe.pager.
|
|
257
|
+
title: GlobalConfig.i18n('vxe.pager.nextPageTitle')
|
|
211
258
|
},
|
|
212
259
|
on: {
|
|
213
260
|
click: this.nextPage
|
|
@@ -351,6 +398,18 @@ export default {
|
|
|
351
398
|
getPageCount (total, size) {
|
|
352
399
|
return Math.max(Math.ceil(total / size), 1)
|
|
353
400
|
},
|
|
401
|
+
homePage () {
|
|
402
|
+
const { currentPage } = this
|
|
403
|
+
if (currentPage > 1) {
|
|
404
|
+
this.jumpPage(1)
|
|
405
|
+
}
|
|
406
|
+
},
|
|
407
|
+
endPage () {
|
|
408
|
+
const { currentPage, pageCount } = this
|
|
409
|
+
if (currentPage < pageCount) {
|
|
410
|
+
this.jumpPage(pageCount)
|
|
411
|
+
}
|
|
412
|
+
},
|
|
354
413
|
prevPage () {
|
|
355
414
|
const { currentPage, pageCount } = this
|
|
356
415
|
if (currentPage > 1) {
|
|
@@ -87,7 +87,7 @@ function renderColumn (h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, r
|
|
|
87
87
|
columnOpts,
|
|
88
88
|
validErrorMaps
|
|
89
89
|
} = $xetable
|
|
90
|
-
const { type, cellRender, editRender, align, showOverflow, className, treeNode } = column
|
|
90
|
+
const { type, cellRender, editRender, align, showOverflow, className, treeNode, slots } = column
|
|
91
91
|
const { actived } = editStore
|
|
92
92
|
const { rHeight: scrollYRHeight } = sYOpts
|
|
93
93
|
const { height: rowHeight } = rowOpts
|
|
@@ -245,13 +245,16 @@ function renderColumn (h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, r
|
|
|
245
245
|
}, column.renderCell(h, params))
|
|
246
246
|
)
|
|
247
247
|
if (showValidTip && errorValidItem) {
|
|
248
|
+
const errRule = errorValidItem.rule
|
|
249
|
+
const validSlot = slots ? slots.valid : null
|
|
250
|
+
const validParams = { ...params, ...errorValidItem }
|
|
248
251
|
tdVNs.push(
|
|
249
252
|
h('div', {
|
|
250
|
-
class: 'vxe-cell--valid-error-hint',
|
|
251
|
-
style:
|
|
252
|
-
width: `${
|
|
253
|
+
class: ['vxe-cell--valid-error-hint', UtilTools.getClass(validOpts.className, errorValidItem)],
|
|
254
|
+
style: errRule && errRule.maxWidth ? {
|
|
255
|
+
width: `${errRule.maxWidth}px`
|
|
253
256
|
} : null
|
|
254
|
-
}, [
|
|
257
|
+
}, validSlot ? $xetable.callSlot(validSlot, validParams, h) : [
|
|
255
258
|
h('span', {
|
|
256
259
|
class: 'vxe-cell--valid-error-msg'
|
|
257
260
|
}, errorValidItem.content)
|
|
@@ -680,7 +680,8 @@ const Methods = {
|
|
|
680
680
|
}
|
|
681
681
|
XEUtils.eachTree(rows, (childRow, index, items, path, parent, nodes) => {
|
|
682
682
|
const rowid = getRowid(this, childRow)
|
|
683
|
-
const
|
|
683
|
+
const parentRow = parent || row
|
|
684
|
+
const rest = { row: childRow, rowid, seq: -1, index, _index: -1, $index: -1, items, parent: parentRow, level: parentLevel + nodes.length }
|
|
684
685
|
fullDataRowIdData[rowid] = rest
|
|
685
686
|
fullDataRowMap.set(childRow, rest)
|
|
686
687
|
fullAllDataRowIdData[rowid] = rest
|
|
@@ -1382,7 +1383,8 @@ const Methods = {
|
|
|
1382
1383
|
rowid = getRowid(this, rowOrRowid)
|
|
1383
1384
|
}
|
|
1384
1385
|
if (rowid) {
|
|
1385
|
-
|
|
1386
|
+
const rest = fullDataRowIdData[rowid]
|
|
1387
|
+
return rest ? rest.parent : null
|
|
1386
1388
|
}
|
|
1387
1389
|
}
|
|
1388
1390
|
return null
|
|
@@ -1410,9 +1412,9 @@ const Methods = {
|
|
|
1410
1412
|
* 如果存在排序,继续处理
|
|
1411
1413
|
*/
|
|
1412
1414
|
getTableData () {
|
|
1413
|
-
const { tableFullData, afterFullData, tableData, footerTableData } = this
|
|
1415
|
+
const { treeConfig, tableFullData, afterFullData, tableData, footerTableData, tableFullTreeData } = this
|
|
1414
1416
|
return {
|
|
1415
|
-
fullData: tableFullData.slice(0),
|
|
1417
|
+
fullData: treeConfig ? tableFullTreeData.slice(0) : tableFullData.slice(0),
|
|
1416
1418
|
visibleData: afterFullData.slice(0),
|
|
1417
1419
|
tableData: tableData.slice(0),
|
|
1418
1420
|
footerData: footerTableData.slice(0)
|
|
@@ -1457,9 +1459,21 @@ const Methods = {
|
|
|
1457
1459
|
* 设置为固定列
|
|
1458
1460
|
*/
|
|
1459
1461
|
setColumnFixed (fieldOrColumn, fixed) {
|
|
1462
|
+
const { isMaxFixedColumn, columnOpts } = this
|
|
1463
|
+
const { maxFixedSize } = columnOpts
|
|
1460
1464
|
const column = handleFieldOrColumn(this, fieldOrColumn)
|
|
1461
1465
|
const targetColumn = getRootColumn(this, column)
|
|
1462
1466
|
if (targetColumn && targetColumn.fixed !== fixed) {
|
|
1467
|
+
// 是否超过最大固定列数量
|
|
1468
|
+
if (!targetColumn.fixed && isMaxFixedColumn) {
|
|
1469
|
+
if (VXETable.modal) {
|
|
1470
|
+
VXETable.modal.message({
|
|
1471
|
+
status: 'error',
|
|
1472
|
+
content: GlobalConfig.i18n('vxe.table.maxFixedCol', [maxFixedSize])
|
|
1473
|
+
})
|
|
1474
|
+
}
|
|
1475
|
+
return this.$nextTick()
|
|
1476
|
+
}
|
|
1463
1477
|
XEUtils.eachTree([targetColumn], (column) => {
|
|
1464
1478
|
column.fixed = fixed
|
|
1465
1479
|
})
|
|
@@ -1834,12 +1848,12 @@ const Methods = {
|
|
|
1834
1848
|
Object.assign(columnStore, { leftList, centerList, rightList })
|
|
1835
1849
|
if (scrollXLoad) {
|
|
1836
1850
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
1837
|
-
if (this.showHeader && !this.showHeaderOverflow) {
|
|
1838
|
-
|
|
1839
|
-
}
|
|
1840
|
-
if (this.showFooter && !this.showFooterOverflow) {
|
|
1841
|
-
|
|
1842
|
-
}
|
|
1851
|
+
// if (this.showHeader && !this.showHeaderOverflow) {
|
|
1852
|
+
// warnLog('vxe.error.reqProp', ['show-header-overflow'])
|
|
1853
|
+
// }
|
|
1854
|
+
// if (this.showFooter && !this.showFooterOverflow) {
|
|
1855
|
+
// warnLog('vxe.error.reqProp', ['show-footer-overflow'])
|
|
1856
|
+
// }
|
|
1843
1857
|
if (this.spanMethod) {
|
|
1844
1858
|
warnLog('vxe.error.scrollErrProp', ['span-method'])
|
|
1845
1859
|
}
|
package/packages/tools/dom.js
CHANGED
|
@@ -132,9 +132,11 @@ export const DomTools = {
|
|
|
132
132
|
return getNodeOffset(elem, container, { left: 0, top: 0 })
|
|
133
133
|
},
|
|
134
134
|
getAbsolutePos (elem) {
|
|
135
|
+
// 当主页面嵌套在iframe时,elem.getBoundingClientRect()仅计算在当前body内的边界距离,忽略了body所在的边界距离
|
|
136
|
+
const bodyBounding = document.body.getBoundingClientRect()
|
|
135
137
|
const bounding = elem.getBoundingClientRect()
|
|
136
|
-
const boundingTop = bounding.top
|
|
137
|
-
const boundingLeft = bounding.left
|
|
138
|
+
const boundingTop = bounding.top - bodyBounding.top
|
|
139
|
+
const boundingLeft = bounding.left - bodyBounding.left
|
|
138
140
|
const { scrollTop, scrollLeft, visibleHeight, visibleWidth } = getDomNode()
|
|
139
141
|
return { boundingTop, top: scrollTop + boundingTop, boundingLeft, left: scrollLeft + boundingLeft, visibleHeight, visibleWidth }
|
|
140
142
|
},
|
|
@@ -165,6 +165,8 @@ export default {
|
|
|
165
165
|
SELECT_CLOSE: iconPrefix + 'caret-down',
|
|
166
166
|
|
|
167
167
|
// pager
|
|
168
|
+
PAGER_HOME: iconPrefix + 'home-page',
|
|
169
|
+
PAGER_END: iconPrefix + 'end-page',
|
|
168
170
|
PAGER_JUMP_PREV: iconPrefix + 'arrow-double-left',
|
|
169
171
|
PAGER_JUMP_NEXT: iconPrefix + 'arrow-double-right',
|
|
170
172
|
PAGER_PREV_PAGE: iconPrefix + 'arrow-left',
|