vxe-table 3.8.6-beta.1 → 3.8.6-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/all.js +3 -1
- package/lib/all.min.js +1 -1
- package/lib/custom/src/panel.js +4 -4
- package/lib/grid/src/grid.js +27 -12
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.umd.js +61 -34
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/body.js +4 -2
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/methods.js +8 -5
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +3 -3
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/v-x-e-table/index.js +5 -4
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/v-x-e-table/src/conf.js +1 -0
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/lib/v-x-e-table/src/config.js +8 -4
- package/lib/v-x-e-table/src/config.min.js +1 -1
- package/package.json +1 -1
- package/packages/all.js +3 -1
- package/packages/custom/src/panel.js +4 -4
- package/packages/grid/src/grid.js +17 -9
- package/packages/table/src/body.js +3 -2
- package/packages/table/src/methods.js +8 -6
- package/packages/table/src/table.js +3 -3
- package/packages/v-x-e-table/index.js +5 -4
- package/packages/v-x-e-table/src/conf.js +1 -0
- package/packages/v-x-e-table/src/config.js +6 -2
- package/types/grid.d.ts +32 -5
- package/types/v-x-e-table/index.d.ts +3 -3
- /package/lib/icon/style/{iconfont.1715224576202.ttf → iconfont.1715582622932.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1715224576202.woff → iconfont.1715582622932.woff} +0 -0
- /package/lib/icon/style/{iconfont.1715224576202.woff2 → iconfont.1715582622932.woff2} +0 -0
- /package/lib/{iconfont.1715224576202.ttf → iconfont.1715582622932.ttf} +0 -0
- /package/lib/{iconfont.1715224576202.woff → iconfont.1715582622932.woff} +0 -0
- /package/lib/{iconfont.1715224576202.woff2 → iconfont.1715582622932.woff2} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var iconPrefix="vxe-icon-",_default=exports.default={size:null,zIndex:999,version:0,emptyCell:" ",table:{fit:!0,showHeader:!0,animat:!0,delayHover:250,autoResize:!0,minHeight:144,resizeConfig:{refreshDelay:250},radioConfig:{strict:!0},checkboxConfig:{strict:!0},tooltipConfig:{enterable:!0},validConfig:{showMessage:!0,autoClear:!0,message:"inline",msgMode:"single"},columnConfig:{maxFixedSize:4},customConfig:{allowFixed:!0,showFooter:!0},sortConfig:{showIcon:!0,iconLayout:"vertical"},filterConfig:{showIcon:!0},treeConfig:{rowField:"id",parentField:"parentId",childrenField:"children",hasChildField:"hasChild",mapChildrenField:"_X_ROW_CHILD",indent:20,showIcon:!0},expandConfig:{showIcon:!0},editConfig:{showIcon:!0,showAsterisk:!0},importConfig:{modes:["insert","covering"]},exportConfig:{modes:["current","selected"]},printConfig:{modes:["current","selected"]},mouseConfig:{extension:!0},keyboardConfig:{isEsc:!0},areaConfig:{selectCellByHeader:!0},clipConfig:{isCopy:!0,isCut:!0,isPaste:!0},fnrConfig:{isFind:!0,isReplace:!0},scrollX:{gt:60},scrollY:{gt:100}},export:{types:{}},icon:{LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",TABLE_SORT_ASC:iconPrefix+"caret-up",TABLE_SORT_DESC:iconPrefix+"caret-down",TABLE_FILTER_NONE:iconPrefix+"funnel",TABLE_FILTER_MATCH:iconPrefix+"funnel",TABLE_EDIT:iconPrefix+"edit",TABLE_TITLE_PREFIX:iconPrefix+"question-circle-fill",TABLE_TITLE_SUFFIX:iconPrefix+"question-circle-fill",TABLE_TREE_LOADED:iconPrefix+"spinner roll",TABLE_TREE_OPEN:iconPrefix+"caret-right rotate90",TABLE_TREE_CLOSE:iconPrefix+"caret-right",TABLE_EXPAND_LOADED:iconPrefix+"spinner roll",TABLE_EXPAND_OPEN:iconPrefix+"arrow-right rotate90",TABLE_EXPAND_CLOSE:iconPrefix+"arrow-right",TABLE_CHECKBOX_CHECKED:iconPrefix+"checkbox-checked",TABLE_CHECKBOX_UNCHECKED:iconPrefix+"checkbox-unchecked",TABLE_CHECKBOX_INDETERMINATE:iconPrefix+"checkbox-indeterminate",TABLE_RADIO_CHECKED:iconPrefix+"radio-checked",TABLE_RADIO_UNCHECKED:iconPrefix+"radio-unchecked",BUTTON_DROPDOWN:iconPrefix+"arrow-down",BUTTON_LOADING:iconPrefix+"spinner roll",SELECT_LOADED:iconPrefix+"spinner roll",SELECT_OPEN:iconPrefix+"caret-down rotate180",SELECT_CLOSE:iconPrefix+"caret-down",PAGER_HOME:iconPrefix+"home-page",PAGER_END:iconPrefix+"end-page",PAGER_JUMP_PREV:iconPrefix+"arrow-double-left",PAGER_JUMP_NEXT:iconPrefix+"arrow-double-right",PAGER_PREV_PAGE:iconPrefix+"arrow-left",PAGER_NEXT_PAGE:iconPrefix+"arrow-right",PAGER_JUMP_MORE:iconPrefix+"ellipsis-h",INPUT_CLEAR:iconPrefix+"error-circle-fill",INPUT_PWD:iconPrefix+"eye-fill",INPUT_SHOW_PWD:iconPrefix+"eye-fill-close",INPUT_PREV_NUM:iconPrefix+"caret-up",INPUT_NEXT_NUM:iconPrefix+"caret-down",INPUT_DATE:iconPrefix+"calendar",INPUT_SEARCH:iconPrefix+"search",MODAL_ZOOM_IN:iconPrefix+"square",MODAL_ZOOM_OUT:iconPrefix+"maximize",MODAL_CLOSE:iconPrefix+"close",MODAL_INFO:iconPrefix+"info-circle-fill",MODAL_SUCCESS:iconPrefix+"success-circle-fill",MODAL_WARNING:iconPrefix+"warnion-circle-fill",MODAL_ERROR:iconPrefix+"error-circle-fill",MODAL_QUESTION:iconPrefix+"question-circle-fill",MODAL_LOADING:iconPrefix+"spinner roll",TOOLBAR_TOOLS_REFRESH:iconPrefix+"repeat",TOOLBAR_TOOLS_REFRESH_LOADING:iconPrefix+"repeat roll",TOOLBAR_TOOLS_IMPORT:iconPrefix+"upload",TOOLBAR_TOOLS_EXPORT:iconPrefix+"download",TOOLBAR_TOOLS_PRINT:iconPrefix+"print",TOOLBAR_TOOLS_FULLSCREEN:iconPrefix+"fullscreen",TOOLBAR_TOOLS_MINIMIZE:iconPrefix+"minimize",TOOLBAR_TOOLS_CUSTOM:iconPrefix+"custom-column",TOOLBAR_TOOLS_FIXED_LEFT:iconPrefix+"fixed-left",TOOLBAR_TOOLS_FIXED_LEFT_ACTIVED:iconPrefix+"fixed-left-fill",TOOLBAR_TOOLS_FIXED_RIGHT:iconPrefix+"fixed-right",TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVED:iconPrefix+"fixed-right-fill",FORM_PREFIX:iconPrefix+"question-circle-fill",FORM_SUFFIX:iconPrefix+"question-circle-fill",FORM_FOLDING:iconPrefix+"arrow-up rotate180",FORM_UNFOLDING:iconPrefix+"arrow-up"},grid:{formConfig:{enabled:!0},pagerConfig:{enabled:!0},toolbarConfig:{enabled:!0},proxyConfig:{enabled:!0,autoLoad:!0,message:!0,props:{list:null,result:"result",total:"page.total",message:"message"}}},tooltip:{trigger:"hover",theme:"dark",enterDelay:500,leaveDelay:300},pager:{},form:{validConfig:{showMessage:!0,autoPos:!0},tooltipConfig:{enterable:!0},titleAsterisk:!0},input:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1,digits:2,controls:!0},textarea:{},select:{multiCharOverflow:8},toolbar:{},button:{},buttonGroup:{},radio:{strict:!0},radioButton:{strict:!0},radioGroup:{strict:!0},checkbox:{},checkboxGroup:{},switch:{},modal:{top:15,showHeader:!0,minWidth:340,minHeight:140,lockView:!0,mask:!0,duration:3e3,marginSize:0,dblclickZoom:!0,showTitleOverflow:!0,animat:!0,showClose:!0,draggable:!0,storageKey:"VXE_MODAL_POSITION"},list:{scrollY:{enabled:!0,gt:100}},i18n:function(e){return e}};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var iconPrefix="vxe-icon-",_default=exports.default={size:null,zIndex:999,version:0,emptyCell:" ",table:{fit:!0,showHeader:!0,animat:!0,delayHover:250,autoResize:!0,minHeight:144,resizeConfig:{refreshDelay:250},radioConfig:{strict:!0},checkboxConfig:{strict:!0},tooltipConfig:{enterable:!0},validConfig:{showMessage:!0,autoClear:!0,message:"inline",msgMode:"single"},columnConfig:{maxFixedSize:4},customConfig:{allowFixed:!0,showFooter:!0},sortConfig:{showIcon:!0,iconLayout:"vertical"},filterConfig:{showIcon:!0},treeConfig:{rowField:"id",parentField:"parentId",childrenField:"children",hasChildField:"hasChild",mapChildrenField:"_X_ROW_CHILD",indent:20,showIcon:!0},expandConfig:{showIcon:!0},editConfig:{showIcon:!0,showAsterisk:!0},importConfig:{modes:["insert","covering"]},exportConfig:{modes:["current","selected"]},printConfig:{modes:["current","selected"]},mouseConfig:{extension:!0},keyboardConfig:{isEsc:!0},areaConfig:{autoClear:!0,selectCellByHeader:!0},clipConfig:{isCopy:!0,isCut:!0,isPaste:!0},fnrConfig:{isFind:!0,isReplace:!0},scrollX:{gt:60},scrollY:{gt:100}},export:{types:{}},icon:{LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",TABLE_SORT_ASC:iconPrefix+"caret-up",TABLE_SORT_DESC:iconPrefix+"caret-down",TABLE_FILTER_NONE:iconPrefix+"funnel",TABLE_FILTER_MATCH:iconPrefix+"funnel",TABLE_EDIT:iconPrefix+"edit",TABLE_TITLE_PREFIX:iconPrefix+"question-circle-fill",TABLE_TITLE_SUFFIX:iconPrefix+"question-circle-fill",TABLE_TREE_LOADED:iconPrefix+"spinner roll",TABLE_TREE_OPEN:iconPrefix+"caret-right rotate90",TABLE_TREE_CLOSE:iconPrefix+"caret-right",TABLE_EXPAND_LOADED:iconPrefix+"spinner roll",TABLE_EXPAND_OPEN:iconPrefix+"arrow-right rotate90",TABLE_EXPAND_CLOSE:iconPrefix+"arrow-right",TABLE_CHECKBOX_CHECKED:iconPrefix+"checkbox-checked",TABLE_CHECKBOX_UNCHECKED:iconPrefix+"checkbox-unchecked",TABLE_CHECKBOX_INDETERMINATE:iconPrefix+"checkbox-indeterminate",TABLE_RADIO_CHECKED:iconPrefix+"radio-checked",TABLE_RADIO_UNCHECKED:iconPrefix+"radio-unchecked",BUTTON_DROPDOWN:iconPrefix+"arrow-down",BUTTON_LOADING:iconPrefix+"spinner roll",SELECT_LOADED:iconPrefix+"spinner roll",SELECT_OPEN:iconPrefix+"caret-down rotate180",SELECT_CLOSE:iconPrefix+"caret-down",PAGER_HOME:iconPrefix+"home-page",PAGER_END:iconPrefix+"end-page",PAGER_JUMP_PREV:iconPrefix+"arrow-double-left",PAGER_JUMP_NEXT:iconPrefix+"arrow-double-right",PAGER_PREV_PAGE:iconPrefix+"arrow-left",PAGER_NEXT_PAGE:iconPrefix+"arrow-right",PAGER_JUMP_MORE:iconPrefix+"ellipsis-h",INPUT_CLEAR:iconPrefix+"error-circle-fill",INPUT_PWD:iconPrefix+"eye-fill",INPUT_SHOW_PWD:iconPrefix+"eye-fill-close",INPUT_PREV_NUM:iconPrefix+"caret-up",INPUT_NEXT_NUM:iconPrefix+"caret-down",INPUT_DATE:iconPrefix+"calendar",INPUT_SEARCH:iconPrefix+"search",MODAL_ZOOM_IN:iconPrefix+"square",MODAL_ZOOM_OUT:iconPrefix+"maximize",MODAL_CLOSE:iconPrefix+"close",MODAL_INFO:iconPrefix+"info-circle-fill",MODAL_SUCCESS:iconPrefix+"success-circle-fill",MODAL_WARNING:iconPrefix+"warnion-circle-fill",MODAL_ERROR:iconPrefix+"error-circle-fill",MODAL_QUESTION:iconPrefix+"question-circle-fill",MODAL_LOADING:iconPrefix+"spinner roll",TOOLBAR_TOOLS_REFRESH:iconPrefix+"repeat",TOOLBAR_TOOLS_REFRESH_LOADING:iconPrefix+"repeat roll",TOOLBAR_TOOLS_IMPORT:iconPrefix+"upload",TOOLBAR_TOOLS_EXPORT:iconPrefix+"download",TOOLBAR_TOOLS_PRINT:iconPrefix+"print",TOOLBAR_TOOLS_FULLSCREEN:iconPrefix+"fullscreen",TOOLBAR_TOOLS_MINIMIZE:iconPrefix+"minimize",TOOLBAR_TOOLS_CUSTOM:iconPrefix+"custom-column",TOOLBAR_TOOLS_FIXED_LEFT:iconPrefix+"fixed-left",TOOLBAR_TOOLS_FIXED_LEFT_ACTIVED:iconPrefix+"fixed-left-fill",TOOLBAR_TOOLS_FIXED_RIGHT:iconPrefix+"fixed-right",TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVED:iconPrefix+"fixed-right-fill",FORM_PREFIX:iconPrefix+"question-circle-fill",FORM_SUFFIX:iconPrefix+"question-circle-fill",FORM_FOLDING:iconPrefix+"arrow-up rotate180",FORM_UNFOLDING:iconPrefix+"arrow-up"},grid:{formConfig:{enabled:!0},pagerConfig:{enabled:!0},toolbarConfig:{enabled:!0},proxyConfig:{enabled:!0,autoLoad:!0,message:!0,props:{list:null,result:"result",total:"page.total",message:"message"}}},tooltip:{trigger:"hover",theme:"dark",enterDelay:500,leaveDelay:300},pager:{},form:{validConfig:{showMessage:!0,autoPos:!0},tooltipConfig:{enterable:!0},titleAsterisk:!0},input:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1,digits:2,controls:!0},textarea:{},select:{multiCharOverflow:8},toolbar:{},button:{},buttonGroup:{},radio:{strict:!0},radioButton:{strict:!0},radioGroup:{strict:!0},checkbox:{},checkboxGroup:{},switch:{},modal:{top:15,showHeader:!0,minWidth:340,minHeight:140,lockView:!0,mask:!0,duration:3e3,marginSize:0,dblclickZoom:!0,showTitleOverflow:!0,animat:!0,showClose:!0,draggable:!0,storageKey:"VXE_MODAL_POSITION"},list:{scrollY:{enabled:!0,gt:100}},i18n:function(e){return e}};
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.config =
|
|
6
|
+
exports.config = void 0;
|
|
7
|
+
exports.setConfig = setConfig;
|
|
7
8
|
var _conf = _interopRequireDefault(require("./conf"));
|
|
8
9
|
var _domZindex = _interopRequireDefault(require("dom-zindex"));
|
|
9
10
|
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
@@ -12,12 +13,15 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
12
13
|
/**
|
|
13
14
|
* 全局参数设置
|
|
14
15
|
*/
|
|
15
|
-
function
|
|
16
|
+
function setConfig(options) {
|
|
16
17
|
if (options) {
|
|
17
|
-
|
|
18
|
+
if (options.theme) {
|
|
19
|
+
(0, _theme.setTheme)(options);
|
|
20
|
+
}
|
|
18
21
|
if (options.zIndex) {
|
|
19
22
|
_domZindex.default.setCurrent(options.zIndex);
|
|
20
23
|
}
|
|
21
24
|
}
|
|
22
25
|
return _xeUtils.default.merge(_conf.default, options);
|
|
23
|
-
}
|
|
26
|
+
}
|
|
27
|
+
var config = exports.config = setConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.config=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.config=void 0,exports.setConfig=setConfig;var _conf=_interopRequireDefault(require("./conf")),_domZindex=_interopRequireDefault(require("dom-zindex")),_xeUtils=_interopRequireDefault(require("xe-utils")),_theme=require("./theme");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function setConfig(e){return e&&(e.theme&&(0,_theme.setTheme)(e),e.zIndex)&&_domZindex.default.setCurrent(e.zIndex),_xeUtils.default.merge(_conf.default,e)}var config=exports.config=setConfig;
|
package/package.json
CHANGED
package/packages/all.js
CHANGED
|
@@ -85,7 +85,9 @@ const components = [
|
|
|
85
85
|
export function install (Vue, options) {
|
|
86
86
|
if (XEUtils.isPlainObject(options)) {
|
|
87
87
|
VXETable.config(options)
|
|
88
|
-
|
|
88
|
+
if (options.theme) {
|
|
89
|
+
setTheme(options)
|
|
90
|
+
}
|
|
89
91
|
}
|
|
90
92
|
components.map(component => component.install(Vue))
|
|
91
93
|
}
|
|
@@ -15,11 +15,11 @@ function updateDropHint (_vm, evnt) {
|
|
|
15
15
|
return
|
|
16
16
|
}
|
|
17
17
|
if (dragHintEl) {
|
|
18
|
-
const
|
|
19
|
-
const
|
|
18
|
+
const wrapperEl = bodyEl.parentNode
|
|
19
|
+
const wrapperRect = wrapperEl.getBoundingClientRect()
|
|
20
20
|
dragHintEl.style.display = 'block'
|
|
21
|
-
dragHintEl.style.top = `${Math.min(
|
|
22
|
-
dragHintEl.style.left = `${Math.min(
|
|
21
|
+
dragHintEl.style.top = `${Math.min(wrapperEl.clientHeight - wrapperEl.scrollTop - dragHintEl.clientHeight, evnt.clientY - wrapperRect.y)}px`
|
|
22
|
+
dragHintEl.style.left = `${Math.min(wrapperEl.clientWidth - wrapperEl.scrollLeft - dragHintEl.clientWidth - 16, evnt.clientX - wrapperRect.x)}px`
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -409,6 +409,9 @@ export default {
|
|
|
409
409
|
if (this.toolbarConfig && !XEUtils.isObject(this.toolbarConfig)) {
|
|
410
410
|
warnLog('vxe.error.errProp', [`grid.toolbar-config=${this.toolbarConfig}`, 'grid.toolbar-config={}'])
|
|
411
411
|
}
|
|
412
|
+
// if (proxyOpts.props) {
|
|
413
|
+
// warnLog('vxe.error.delProp', ['proxy-config.props', 'proxy-config.response'])
|
|
414
|
+
// }
|
|
412
415
|
}
|
|
413
416
|
this.initPages()
|
|
414
417
|
GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent)
|
|
@@ -524,8 +527,9 @@ export default {
|
|
|
524
527
|
* @param {String/Object} code 字符串或对象
|
|
525
528
|
*/
|
|
526
529
|
commitProxy (proxyTarget, ...args) {
|
|
527
|
-
const { $refs, toolbar, toolbarConfig, toolbarOpts, proxyOpts, tablePage, pagerConfig, editRules, formData, isMsg, validConfig } = this
|
|
528
|
-
const { beforeQuery, afterQuery, beforeDelete, afterDelete, beforeSave, afterSave, ajax = {}
|
|
530
|
+
const { $refs, toolbar, toolbarConfig, toolbarOpts, proxyOpts, tablePage, pagerConfig, editRules, formData, isMsg, validConfig, pagerOpts } = this
|
|
531
|
+
const { beforeQuery, afterQuery, beforeDelete, afterDelete, beforeSave, afterSave, ajax = {} } = proxyOpts
|
|
532
|
+
const resConfigs = proxyOpts.response || proxyOpts.props || {}
|
|
529
533
|
const $xetable = $refs.xTable
|
|
530
534
|
let button
|
|
531
535
|
let code
|
|
@@ -633,17 +637,20 @@ export default {
|
|
|
633
637
|
.then(rest => {
|
|
634
638
|
this.tableLoading = false
|
|
635
639
|
if (rest) {
|
|
636
|
-
if (isEnableConf(
|
|
637
|
-
const
|
|
640
|
+
if (pagerConfig && isEnableConf(pagerOpts)) {
|
|
641
|
+
const totalProp = resConfigs.total
|
|
642
|
+
const total = (XEUtils.isFunction(totalProp) ? totalProp({ data: rest, $grid: this }) : XEUtils.get(rest, totalProp || 'page.total')) || 0
|
|
638
643
|
tablePage.total = XEUtils.toNumber(total)
|
|
639
|
-
|
|
644
|
+
const resultProp = resConfigs.result
|
|
645
|
+
this.tableData = (XEUtils.isFunction(resultProp) ? resultProp({ data: rest, $grid: this }) : XEUtils.get(rest, resultProp || 'result')) || []
|
|
640
646
|
// 检验当前页码,不能超出当前最大页数
|
|
641
647
|
const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1)
|
|
642
648
|
if (tablePage.currentPage > pageCount) {
|
|
643
649
|
tablePage.currentPage = pageCount
|
|
644
650
|
}
|
|
645
651
|
} else {
|
|
646
|
-
|
|
652
|
+
const listProp = resConfigs.list
|
|
653
|
+
this.tableData = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $grid: this }) : XEUtils.get(rest, listProp)) : rest) || []
|
|
647
654
|
}
|
|
648
655
|
} else {
|
|
649
656
|
this.tableData = []
|
|
@@ -822,10 +829,11 @@ export default {
|
|
|
822
829
|
return this.$nextTick()
|
|
823
830
|
},
|
|
824
831
|
getRespMsg (rest, defaultMsg) {
|
|
825
|
-
const {
|
|
832
|
+
const { proxyOpts } = this
|
|
833
|
+
const resConfigs = proxyOpts.response || proxyOpts.props || {}
|
|
826
834
|
let msg
|
|
827
|
-
if (rest &&
|
|
828
|
-
msg = XEUtils.get(rest,
|
|
835
|
+
if (rest && resConfigs.message) {
|
|
836
|
+
msg = XEUtils.get(rest, resConfigs.message)
|
|
829
837
|
}
|
|
830
838
|
return msg || GlobalConfig.i18n(defaultMsg)
|
|
831
839
|
},
|
|
@@ -15,7 +15,7 @@ function isVMScrollProcess ($xetable) {
|
|
|
15
15
|
|
|
16
16
|
function renderLine (h, _vm, $xetable, params) {
|
|
17
17
|
const { row, column } = params
|
|
18
|
-
const { treeOpts, treeConfig, fullAllDataRowIdData } = $xetable
|
|
18
|
+
const { afterFullData, treeOpts, treeConfig, fullAllDataRowIdData } = $xetable
|
|
19
19
|
const { slots, treeNode } = column
|
|
20
20
|
const rowid = getRowid($xetable, row)
|
|
21
21
|
const rest = fullAllDataRowIdData[rowid]
|
|
@@ -30,6 +30,7 @@ function renderLine (h, _vm, $xetable, params) {
|
|
|
30
30
|
if (slots && slots.line) {
|
|
31
31
|
return $xetable.callSlot(slots.line, params, h)
|
|
32
32
|
}
|
|
33
|
+
const isFirstRow = $xetable.eqRow(afterFullData[0], row)
|
|
33
34
|
if (treeConfig && treeNode && (treeOpts.showLine || treeOpts.line)) {
|
|
34
35
|
return [
|
|
35
36
|
h('div', {
|
|
@@ -38,7 +39,7 @@ function renderLine (h, _vm, $xetable, params) {
|
|
|
38
39
|
h('div', {
|
|
39
40
|
class: 'vxe-tree--line',
|
|
40
41
|
style: {
|
|
41
|
-
height: `${calcTreeLine(params, items, rIndex)}px`,
|
|
42
|
+
height: `${isFirstRow ? 1 : calcTreeLine(params, items, rIndex)}px`,
|
|
42
43
|
left: `${(rLevel * treeOpts.indent) + (rLevel ? 2 - getOffsetSize($xetable) : 0) + 16}px`
|
|
43
44
|
}
|
|
44
45
|
})
|
|
@@ -2491,7 +2491,7 @@ const Methods = {
|
|
|
2491
2491
|
* 全局按下事件处理
|
|
2492
2492
|
*/
|
|
2493
2493
|
handleGlobalMousedownEvent (evnt) {
|
|
2494
|
-
const { $el, $refs, $xegrid, $toolbar, mouseConfig, editStore, ctxMenuStore, editRules, editOpts, validOpts, filterStore, customStore, getRowNode } = this
|
|
2494
|
+
const { $el, $refs, $xegrid, $toolbar, mouseConfig, editStore, ctxMenuStore, editRules, editOpts, validOpts, areaOpts, filterStore, customStore, getRowNode } = this
|
|
2495
2495
|
const { actived } = editStore
|
|
2496
2496
|
const { ctxWrapper, filterWrapper, customWrapper, validTip } = $refs
|
|
2497
2497
|
// 筛选
|
|
@@ -2572,11 +2572,13 @@ const Methods = {
|
|
|
2572
2572
|
if (this.clearSelected) {
|
|
2573
2573
|
this.clearSelected()
|
|
2574
2574
|
}
|
|
2575
|
-
if (
|
|
2576
|
-
|
|
2577
|
-
this.
|
|
2578
|
-
|
|
2579
|
-
|
|
2575
|
+
if (areaOpts.autoClear) {
|
|
2576
|
+
if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-areas-clear').flag) {
|
|
2577
|
+
this.preventEvent(evnt, 'event.clearAreas', {}, () => {
|
|
2578
|
+
this.clearCellAreas()
|
|
2579
|
+
this.clearCopyCellArea()
|
|
2580
|
+
})
|
|
2581
|
+
}
|
|
2580
2582
|
}
|
|
2581
2583
|
}
|
|
2582
2584
|
}
|
|
@@ -969,10 +969,10 @@ export default {
|
|
|
969
969
|
}
|
|
970
970
|
}
|
|
971
971
|
if (this.autoResize) {
|
|
972
|
-
const
|
|
973
|
-
const resizeObserver = createResizeEvent(
|
|
972
|
+
const handleWrapperResize = this.resizeOpts.refreshDelay ? XEUtils.throttle(() => this.recalculate(true), this.resizeOpts.refreshDelay, { leading: true, trailing: true }) : null
|
|
973
|
+
const resizeObserver = createResizeEvent(handleWrapperResize ? () => {
|
|
974
974
|
if (this.autoResize) {
|
|
975
|
-
requestAnimationFrame(
|
|
975
|
+
requestAnimationFrame(handleWrapperResize)
|
|
976
976
|
}
|
|
977
977
|
} : () => {
|
|
978
978
|
if (this.autoResize) {
|
|
@@ -6,7 +6,7 @@ import { commands } from './src/commands'
|
|
|
6
6
|
import { menus } from './src/menus'
|
|
7
7
|
import { formats } from './src/formats'
|
|
8
8
|
import { validators } from './src/validators'
|
|
9
|
-
import {
|
|
9
|
+
import { setConfig } from './src/config'
|
|
10
10
|
import { setTheme } from './src/theme'
|
|
11
11
|
import { UtilTools } from '../tools/utils'
|
|
12
12
|
import { errLog } from '../tools/log'
|
|
@@ -90,7 +90,7 @@ export function _t (key, args) {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
export const v = 'v3'
|
|
93
|
-
export const setup =
|
|
93
|
+
export const setup = setConfig
|
|
94
94
|
|
|
95
95
|
export const globalStore = {}
|
|
96
96
|
|
|
@@ -99,7 +99,7 @@ export const VXETable = {
|
|
|
99
99
|
version: process.env.VUE_APP_VXE_TABLE_VERSION,
|
|
100
100
|
reg,
|
|
101
101
|
use,
|
|
102
|
-
|
|
102
|
+
setConfig,
|
|
103
103
|
globalStore,
|
|
104
104
|
interceptor,
|
|
105
105
|
renderer,
|
|
@@ -111,7 +111,8 @@ export const VXETable = {
|
|
|
111
111
|
_t,
|
|
112
112
|
|
|
113
113
|
// 已废弃
|
|
114
|
-
config,
|
|
114
|
+
config: setConfig,
|
|
115
|
+
setup,
|
|
115
116
|
globalConfs
|
|
116
117
|
}
|
|
117
118
|
|
|
@@ -6,12 +6,16 @@ import { setTheme } from './theme'
|
|
|
6
6
|
/**
|
|
7
7
|
* 全局参数设置
|
|
8
8
|
*/
|
|
9
|
-
export function
|
|
9
|
+
export function setConfig (options) {
|
|
10
10
|
if (options) {
|
|
11
|
-
|
|
11
|
+
if (options.theme) {
|
|
12
|
+
setTheme(options)
|
|
13
|
+
}
|
|
12
14
|
if (options.zIndex) {
|
|
13
15
|
DomZIndex.setCurrent(options.zIndex)
|
|
14
16
|
}
|
|
15
17
|
}
|
|
16
18
|
return XEUtils.merge(GlobalConfig, options)
|
|
17
19
|
}
|
|
20
|
+
|
|
21
|
+
export const config = setConfig
|
package/types/grid.d.ts
CHANGED
|
@@ -103,11 +103,11 @@ export interface GridProxyConfig {
|
|
|
103
103
|
sort?: boolean;
|
|
104
104
|
filter?: boolean;
|
|
105
105
|
form?: boolean;
|
|
106
|
-
|
|
107
|
-
list?: string
|
|
108
|
-
result?: string
|
|
109
|
-
total?: string
|
|
110
|
-
message?: string
|
|
106
|
+
response?: {
|
|
107
|
+
list?: string | null | ((params: { data: any }) => any[])
|
|
108
|
+
result?: string | ((params: { data: any }) => any[])
|
|
109
|
+
total?: string | ((params: { data: any }) => number)
|
|
110
|
+
message?: string | ((params: { data: any }) => string)
|
|
111
111
|
};
|
|
112
112
|
ajax?: {
|
|
113
113
|
query?(params: { page: GridProxyQueryPageParams, sort: GridProxyQuerySortParams, filters: GridProxyQueryFiltersParams[], form: any }, ...args: any[]): Promise<any>;
|
|
@@ -115,6 +115,33 @@ export interface GridProxyConfig {
|
|
|
115
115
|
save?(params: { body: { insertRecords: any[], updateRecords: any[], removeRecords: any[], pendingRecords: any[] } }, ...args: any[]): Promise<any>;
|
|
116
116
|
}
|
|
117
117
|
[key: string]: any;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* 已废弃,请使用 proxy-config.response
|
|
121
|
+
* @deprecated
|
|
122
|
+
*/
|
|
123
|
+
props?: {
|
|
124
|
+
/**
|
|
125
|
+
* 已废弃,请使用 proxy-config.response.list
|
|
126
|
+
* @deprecated
|
|
127
|
+
*/
|
|
128
|
+
list?: string | null
|
|
129
|
+
/**
|
|
130
|
+
* 已废弃,请使用 proxy-config.response.result
|
|
131
|
+
* @deprecated
|
|
132
|
+
*/
|
|
133
|
+
result?: string
|
|
134
|
+
/**
|
|
135
|
+
* 已废弃,请使用 proxy-config.response.total
|
|
136
|
+
* @deprecated
|
|
137
|
+
*/
|
|
138
|
+
total?: string
|
|
139
|
+
/**
|
|
140
|
+
* 已废弃,请使用 proxy-config.response.message
|
|
141
|
+
* @deprecated
|
|
142
|
+
*/
|
|
143
|
+
message?: string
|
|
144
|
+
}
|
|
118
145
|
}
|
|
119
146
|
|
|
120
147
|
export interface GridPagerConfig extends PagerOptions {
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import Vue from 'vue'
|
|
2
|
-
|
|
3
1
|
import { ModalController } from '../modal'
|
|
4
2
|
import { SaveFileFunction, ReadFileFunction, PrintFunction } from '../module/export'
|
|
5
3
|
|
|
@@ -27,6 +25,7 @@ export interface VxeGlobalStore {
|
|
|
27
25
|
export const globalStore: VxeGlobalStore
|
|
28
26
|
|
|
29
27
|
export const config: VxeGlobalConfigMethod
|
|
28
|
+
export const setConfig: VxeGlobalConfigMethod
|
|
30
29
|
export const interceptor: VxeGlobalInterceptor
|
|
31
30
|
export const renderer: VxeGlobalRenderer
|
|
32
31
|
export const commands: VxeGlobalCommands
|
|
@@ -63,7 +62,7 @@ export interface VXETableCore {
|
|
|
63
62
|
/**
|
|
64
63
|
* 设置全局参数/获取所有参数
|
|
65
64
|
*/
|
|
66
|
-
|
|
65
|
+
setConfig: VxeGlobalConfigMethod;
|
|
67
66
|
/**
|
|
68
67
|
* 读取内部数据
|
|
69
68
|
*/
|
|
@@ -120,6 +119,7 @@ export interface VXETableCore {
|
|
|
120
119
|
t: VxeGlobalI18n;
|
|
121
120
|
_t: VxeGlobalTranslate;
|
|
122
121
|
|
|
122
|
+
config: VxeGlobalConfigMethod;
|
|
123
123
|
/**
|
|
124
124
|
* 已被 version 替换
|
|
125
125
|
* @deprecated
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|