vxe-table 4.14.0-beta.0 → 4.14.0-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/es/grid/src/grid.js +100 -76
- package/es/style.css +1 -1
- package/es/table/module/keyboard/hook.js +2 -2
- package/es/table/src/table.js +1 -1
- package/es/ui/index.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +113 -80
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +119 -86
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/keyboard/hook.js +2 -2
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/src/table.js +1 -1
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +2 -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/package.json +1 -1
- package/packages/grid/src/grid.ts +107 -82
- package/packages/table/module/keyboard/hook.ts +2 -2
- package/packages/table/src/table.ts +1 -1
- package/packages/ui/index.ts +1 -1
- /package/es/{iconfont.1750770364548.ttf → iconfont.1750910518778.ttf} +0 -0
- /package/es/{iconfont.1750770364548.woff → iconfont.1750910518778.woff} +0 -0
- /package/es/{iconfont.1750770364548.woff2 → iconfont.1750910518778.woff2} +0 -0
- /package/lib/{iconfont.1750770364548.ttf → iconfont.1750910518778.ttf} +0 -0
- /package/lib/{iconfont.1750770364548.woff → iconfont.1750910518778.woff} +0 -0
- /package/lib/{iconfont.1750770364548.woff2 → iconfont.1750910518778.woff2} +0 -0
package/lib/ui/index.js
CHANGED
|
@@ -13,7 +13,7 @@ Object.defineProperty(exports, "VxeUI", {
|
|
|
13
13
|
exports.version = exports.validators = exports.use = exports.t = exports.setup = exports.setTheme = exports.setLanguage = exports.setIcon = exports.setI18n = exports.setConfig = exports.saveFile = exports.renderer = exports.readFile = exports.print = exports.modal = exports.menus = exports.log = exports.interceptor = exports.hooks = exports.globalResize = exports.globalEvents = exports.getTheme = exports.getIcon = exports.getI18n = exports.getConfig = exports.formats = exports.default = exports.config = exports.commands = exports.clipboard = exports._t = void 0;
|
|
14
14
|
var _core = require("@vxe-ui/core");
|
|
15
15
|
var _utils = require("./src/utils");
|
|
16
|
-
const version = exports.version = "4.14.0-beta.
|
|
16
|
+
const version = exports.version = "4.14.0-beta.1";
|
|
17
17
|
_core.VxeUI.version = version;
|
|
18
18
|
_core.VxeUI.tableVersion = version;
|
|
19
19
|
_core.VxeUI.setConfig({
|
|
@@ -265,7 +265,7 @@ _core.VxeUI.setConfig({
|
|
|
265
265
|
autoLoad: true,
|
|
266
266
|
showResponseMsg: true,
|
|
267
267
|
showActiveMsg: true,
|
|
268
|
-
|
|
268
|
+
response: {
|
|
269
269
|
list: null,
|
|
270
270
|
result: 'result',
|
|
271
271
|
total: 'page.total',
|
package/lib/ui/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.VXETable=void 0,Object.defineProperty(exports,"VxeUI",{enumerable:!0,get:function(){return _core.VxeUI}}),exports.version=exports.validators=exports.use=exports.t=exports.setup=exports.setTheme=exports.setLanguage=exports.setIcon=exports.setI18n=exports.setConfig=exports.saveFile=exports.renderer=exports.readFile=exports.print=exports.modal=exports.menus=exports.log=exports.interceptor=exports.hooks=exports.globalResize=exports.globalEvents=exports.getTheme=exports.getIcon=exports.getI18n=exports.getConfig=exports.formats=exports.default=exports.config=exports.commands=exports.clipboard=exports._t=void 0;var _core=require("@vxe-ui/core"),_utils=require("./src/utils");let version=exports.version="4.14.0-beta.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.VXETable=void 0,Object.defineProperty(exports,"VxeUI",{enumerable:!0,get:function(){return _core.VxeUI}}),exports.version=exports.validators=exports.use=exports.t=exports.setup=exports.setTheme=exports.setLanguage=exports.setIcon=exports.setI18n=exports.setConfig=exports.saveFile=exports.renderer=exports.readFile=exports.print=exports.modal=exports.menus=exports.log=exports.interceptor=exports.hooks=exports.globalResize=exports.globalEvents=exports.getTheme=exports.getIcon=exports.getI18n=exports.getConfig=exports.formats=exports.default=exports.config=exports.commands=exports.clipboard=exports._t=void 0;var _core=require("@vxe-ui/core"),_utils=require("./src/utils");let version=exports.version="4.14.0-beta.1",iconPrefix=(_core.VxeUI.version=version,_core.VxeUI.tableVersion=version,_core.VxeUI.setConfig({emptyCell:" ",table:{fit:!0,showHeader:!0,animat:!0,delayHover:250,autoResize:!0,minHeight:144,resizeConfig:{},resizableConfig:{dragMode:"auto",showDragTip:!0,isSyncAutoHeight:!0,isSyncAutoWidth:!0,minHeight:18},radioConfig:{strict:!0},rowDragConfig:{showIcon:!0,animation:!0,showGuidesStatus:!0,showDragTip:!0},columnDragConfig:{showIcon:!0,animation:!0,showGuidesStatus:!0,showDragTip:!0},checkboxConfig:{strict:!0},tooltipConfig:{enterable:!0},validConfig:{showMessage:!0,autoClear:!0,autoPos:!0,message:"inline",msgMode:"single",theme:"beautify"},columnConfig:{maxFixedSize:4},cellConfig:{padding:!0},headerCellConfig:{height:"unset"},footerCellConfig:{height:"unset"},customConfig:{allowVisible:!0,allowResizable:!0,allowFixed:!0,allowSort:!0,showFooter:!0,placement:"top-right",storeOptions:{visible:!0,resizable:!0,sort:!0,fixed:!0},modalOptions:{showMaximize:!0,mask:!0,lockView:!0,resize:!0,escClosable:!0},drawerOptions:{mask:!0,lockView:!0,escClosable:!0,resize:!0}},sortConfig:{showIcon:!0,allowClear:!0,allowBtn:!0,iconLayout:"vertical"},filterConfig:{showIcon:!0},aggregateConfig:{padding:!0,rowField:"id",parentField:"_X_ROW_PARENT_KEY",childrenField:"_X_ROW_CHILDREN",mapChildrenField:"_X_ROW_CHILD_LIST",indent:20,showIcon:!0,maxGroupSize:4,showAggFuncTitle:!0},treeConfig:{padding:!0,rowField:"id",parentField:"parentId",childrenField:"children",hasChildField:"hasChild",mapChildrenField:"_X_ROW_CHILD",indent:20,showIcon:!0},expandConfig:{showIcon:!0,mode:"fixed"},editConfig:{showIcon:!0,showAsterisk:!0,autoFocus:!0},importConfig:{_typeMaps:{csv:1,html:1,xml:1,txt:1}},exportConfig:{_typeMaps:{csv:1,html:1,xml:1,txt:1}},printConfig:{},mouseConfig:{extension:!0},keyboardConfig:{isAll:!0,isEsc:!0},areaConfig:{autoClear:!0,selectCellByHeader:!0,selectCellByBody:!0,extendDirection:{top:!0,left:!0,bottom:!0,right:!0}},clipConfig:{isCopy:!0,isCut:!0,isPaste:!0},fnrConfig:{isFind:!0,isReplace:!0},virtualXConfig:{gt:24,preSize:1,oSize:0},virtualYConfig:{gt:100,preSize:1,oSize:0},scrollbarConfig:{}},grid:{formConfig:{enabled:!0},pagerConfig:{enabled:!0},toolbarConfig:{enabled:!0},proxyConfig:{enabled:!0,autoLoad:!0,showResponseMsg:!0,showActiveMsg:!0,response:{list:null,result:"result",total:"page.total",message:"message"}}},toolbar:{}}),"vxe-table-icon-"),setTheme=(_core.VxeUI.setIcon({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-fill",TABLE_CHECKBOX_UNCHECKED:iconPrefix+"checkbox-unchecked",TABLE_CHECKBOX_INDETERMINATE:iconPrefix+"checkbox-indeterminate-fill",TABLE_CHECKBOX_DISABLED_UNCHECKED:iconPrefix+"checkbox-unchecked-fill",TABLE_RADIO_CHECKED:iconPrefix+"radio-checked-fill",TABLE_RADIO_UNCHECKED:iconPrefix+"radio-unchecked",TABLE_RADIO_DISABLED_UNCHECKED:iconPrefix+"radio-unchecked-fill",TABLE_CUSTOM_SORT:iconPrefix+"drag-handle",TABLE_MENU_OPTIONS:iconPrefix+"arrow-right",TABLE_DRAG_ROW:iconPrefix+"drag-handle",TABLE_DRAG_COLUMN:iconPrefix+"drag-handle",TABLE_DRAG_STATUS_ROW:iconPrefix+"sort",TABLE_DRAG_STATUS_SUB_ROW:iconPrefix+"add-sub",TABLE_DRAG_STATUS_AGG_GROUP:iconPrefix+"grouping",TABLE_DRAG_STATUS_AGG_VALUES:iconPrefix+"values",TABLE_DRAG_STATUS_COLUMN:iconPrefix+"swap",TABLE_DRAG_DISABLED:iconPrefix+"no-drop",TABLE_ROW_GROUP_OPEN:iconPrefix+"arrow-right rotate90",TABLE_ROW_GROUP_CLOSE:iconPrefix+"arrow-right",TABLE_AGGREGATE_GROUPING:iconPrefix+"grouping",TABLE_AGGREGATE_VALUES:iconPrefix+"values",TABLE_AGGREGATE_SORT:iconPrefix+"drag-handle",TABLE_AGGREGATE_DELETE:iconPrefix+"close",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_ACTIVE:iconPrefix+"fixed-left-fill",TOOLBAR_TOOLS_FIXED_RIGHT:iconPrefix+"fixed-right",TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE:iconPrefix+"fixed-right-fill"}),exports.setTheme=_core.VxeUI.setTheme),getTheme=exports.getTheme=_core.VxeUI.getTheme,setConfig=exports.setConfig=_core.VxeUI.setConfig,getConfig=exports.getConfig=_core.VxeUI.getConfig,setIcon=exports.setIcon=_core.VxeUI.setIcon,getIcon=exports.getIcon=_core.VxeUI.getIcon,setLanguage=exports.setLanguage=_core.VxeUI.setLanguage,setI18n=exports.setI18n=_core.VxeUI.setI18n,getI18n=exports.getI18n=_core.VxeUI.getI18n,globalEvents=exports.globalEvents=_core.VxeUI.globalEvents,globalResize=exports.globalResize=_core.VxeUI.globalResize,renderer=exports.renderer=_core.VxeUI.renderer,validators=exports.validators=_core.VxeUI.validators,menus=exports.menus=_core.VxeUI.menus,formats=exports.formats=_core.VxeUI.formats,commands=exports.commands=_core.VxeUI.commands,interceptor=exports.interceptor=_core.VxeUI.interceptor,clipboard=exports.clipboard=_core.VxeUI.clipboard,log=exports.log=_core.VxeUI.log,hooks=exports.hooks=_core.VxeUI.hooks,use=exports.use=_core.VxeUI.use,setup=e=>_core.VxeUI.setConfig(e),config=(exports.setup=setup,_core.VxeUI.setup=setup,e=>_core.VxeUI.setConfig(e)),t=(exports.config=config,_core.VxeUI.config=config,(e,o)=>_core.VxeUI.getI18n(e,o)),_t=(exports.t=t,_core.VxeUI.t=t,(e,o)=>(0,_utils.getFuncText)(e,o)),VXETable=(exports._t=_t,_core.VxeUI._t=_t,exports.VXETable=_core.VxeUI),saveFile=e=>_core.VxeUI.saveFile(e),readFile=(exports.saveFile=saveFile,e=>_core.VxeUI.readFile(e)),print=(exports.readFile=readFile,e=>_core.VxeUI.print(e)),modal=(exports.print=print,exports.modal={get(e){return _core.VxeUI.modal.get(e)},close(e){return _core.VxeUI.modal.close(e)},open(e){return _core.VxeUI.modal.open(e)},alert(e,o,r){return _core.VxeUI.modal.alert(e,o,r)},confirm(e,o,r){return _core.VxeUI.modal.confirm(e,o,r)},message(e,o){return _core.VxeUI.modal.message(e,o)},notification(e,o,r){return _core.VxeUI.modal.notification(e,o,r)}});var _default=exports.default=_core.VxeUI;
|
package/lib/ui/src/log.js
CHANGED
|
@@ -8,6 +8,6 @@ var _core = require("@vxe-ui/core");
|
|
|
8
8
|
const {
|
|
9
9
|
log
|
|
10
10
|
} = _core.VxeUI;
|
|
11
|
-
const version = `table v${"4.14.0-beta.
|
|
11
|
+
const version = `table v${"4.14.0-beta.1"}`;
|
|
12
12
|
const warnLog = exports.warnLog = log.create('warn', version);
|
|
13
13
|
const errLog = exports.errLog = log.create('error', version);
|
package/lib/ui/src/log.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");let log=_core.VxeUI.log,version="table v4.14.0-beta.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");let log=_core.VxeUI.log,version="table v4.14.0-beta.1",warnLog=exports.warnLog=log.create("warn",version),errLog=exports.errLog=log.create("error",version);
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@ import VxeToolbarComponent from '../../toolbar/src/toolbar'
|
|
|
9
9
|
import tableComponentProps from '../../table/src/props'
|
|
10
10
|
import tableComponentEmits from '../../table/src/emits'
|
|
11
11
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
12
|
-
import { errLog } from '../../ui/src/log'
|
|
12
|
+
import { warnLog, errLog } from '../../ui/src/log'
|
|
13
13
|
|
|
14
14
|
import type { ValueOf, VxePagerComponent, VxeFormComponent, VxeFormEvents, VxeFormInstance, VxePagerEvents, VxeFormItemProps, VxePagerInstance, VxeComponentStyleType } from 'vxe-pc-ui'
|
|
15
15
|
import type { VxeTableMethods, VxeGridConstructor, VxeGridEmits, GridReactData, VxeGridPropTypes, VxeToolbarPropTypes, GridMethods, GridPrivateMethods, VxeGridPrivateComputed, VxeGridPrivateMethods, VxeToolbarInstance, GridPrivateRef, VxeTableProps, VxeTableConstructor, VxeTablePrivateMethods, VxeTableEvents, VxeTableDefines, VxeTableEventProps, VxeGridProps } from '../../../types'
|
|
@@ -119,29 +119,29 @@ export default defineVxeComponent({
|
|
|
119
119
|
})
|
|
120
120
|
|
|
121
121
|
const computeProxyOpts = computed(() => {
|
|
122
|
-
return XEUtils.merge({}, XEUtils.clone(getConfig().grid.proxyConfig, true), props.proxyConfig)
|
|
122
|
+
return XEUtils.merge({}, XEUtils.clone(getConfig().grid.proxyConfig, true), props.proxyConfig)
|
|
123
123
|
})
|
|
124
124
|
|
|
125
125
|
const computeIsRespMsg = computed(() => {
|
|
126
126
|
const proxyOpts = computeProxyOpts.value
|
|
127
|
-
return XEUtils.isBoolean(proxyOpts.message) ? proxyOpts.message : proxyOpts.showResponseMsg
|
|
127
|
+
return !!(XEUtils.isBoolean(proxyOpts.message) ? proxyOpts.message : proxyOpts.showResponseMsg)
|
|
128
128
|
})
|
|
129
129
|
|
|
130
130
|
const computeIsActiveMsg = computed(() => {
|
|
131
131
|
const proxyOpts = computeProxyOpts.value
|
|
132
|
-
return proxyOpts.showActiveMsg
|
|
132
|
+
return !!proxyOpts.showActiveMsg
|
|
133
133
|
})
|
|
134
134
|
|
|
135
135
|
const computePagerOpts = computed(() => {
|
|
136
|
-
return Object.assign({}, getConfig().grid.pagerConfig, props.pagerConfig)
|
|
136
|
+
return Object.assign({}, getConfig().grid.pagerConfig, props.pagerConfig)
|
|
137
137
|
})
|
|
138
138
|
|
|
139
139
|
const computeFormOpts = computed(() => {
|
|
140
|
-
return Object.assign({}, getConfig().grid.formConfig, props.formConfig)
|
|
140
|
+
return Object.assign({}, getConfig().grid.formConfig, props.formConfig)
|
|
141
141
|
})
|
|
142
142
|
|
|
143
143
|
const computeToolbarOpts = computed(() => {
|
|
144
|
-
return Object.assign({}, getConfig().grid.toolbarConfig, props.toolbarConfig)
|
|
144
|
+
return Object.assign({}, getConfig().grid.toolbarConfig, props.toolbarConfig)
|
|
145
145
|
})
|
|
146
146
|
|
|
147
147
|
const computeZoomOpts = computed(() => {
|
|
@@ -390,12 +390,12 @@ export default defineVxeComponent({
|
|
|
390
390
|
reactData.sortData = params.sortList
|
|
391
391
|
if (proxyConfig && isEnableConf(proxyOpts)) {
|
|
392
392
|
reactData.tablePage.currentPage = 1
|
|
393
|
-
|
|
394
|
-
|
|
393
|
+
$xeGrid.commitProxy('query').then((rest) => {
|
|
394
|
+
$xeGrid.dispatchEvent('proxy-query', rest, params.$event)
|
|
395
395
|
})
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
|
-
|
|
398
|
+
$xeGrid.dispatchEvent('sort-change', params, params.$event)
|
|
399
399
|
}
|
|
400
400
|
|
|
401
401
|
const filterChangeEvent: VxeTableEvents.FilterChange = (params) => {
|
|
@@ -409,12 +409,12 @@ export default defineVxeComponent({
|
|
|
409
409
|
reactData.filterData = params.filterList
|
|
410
410
|
if (proxyConfig && isEnableConf(proxyOpts)) {
|
|
411
411
|
reactData.tablePage.currentPage = 1
|
|
412
|
-
|
|
413
|
-
|
|
412
|
+
$xeGrid.commitProxy('query').then((rest) => {
|
|
413
|
+
$xeGrid.dispatchEvent('proxy-query', rest, params.$event)
|
|
414
414
|
})
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
-
|
|
417
|
+
$xeGrid.dispatchEvent('filter-change', params, params.$event)
|
|
418
418
|
}
|
|
419
419
|
|
|
420
420
|
const submitFormEvent: VxeFormEvents.Submit = (params) => {
|
|
@@ -424,35 +424,35 @@ export default defineVxeComponent({
|
|
|
424
424
|
return
|
|
425
425
|
}
|
|
426
426
|
if (proxyConfig && isEnableConf(proxyOpts)) {
|
|
427
|
-
|
|
428
|
-
|
|
427
|
+
$xeGrid.commitProxy('reload').then((rest) => {
|
|
428
|
+
$xeGrid.dispatchEvent('proxy-query', { ...rest, isReload: true }, params.$event)
|
|
429
429
|
})
|
|
430
430
|
}
|
|
431
|
-
|
|
431
|
+
$xeGrid.dispatchEvent('form-submit', params, params.$event)
|
|
432
432
|
}
|
|
433
433
|
|
|
434
434
|
const resetFormEvent: VxeFormEvents.Reset = (params) => {
|
|
435
|
+
const $xeTable = refTable.value
|
|
435
436
|
const { proxyConfig } = props
|
|
436
437
|
const { $event } = params
|
|
437
438
|
const proxyOpts = computeProxyOpts.value
|
|
438
|
-
const $xeTable = refTable.value
|
|
439
439
|
if (proxyConfig && isEnableConf(proxyOpts)) {
|
|
440
440
|
$xeTable.clearScroll()
|
|
441
|
-
|
|
442
|
-
|
|
441
|
+
$xeGrid.commitProxy('reload').then((rest) => {
|
|
442
|
+
$xeGrid.dispatchEvent('proxy-query', { ...rest, isReload: true }, $event)
|
|
443
443
|
})
|
|
444
444
|
}
|
|
445
|
-
|
|
445
|
+
$xeGrid.dispatchEvent('form-reset', params, $event)
|
|
446
446
|
}
|
|
447
447
|
|
|
448
448
|
const submitInvalidEvent: VxeFormEvents.SubmitInvalid = (params) => {
|
|
449
|
-
|
|
449
|
+
$xeGrid.dispatchEvent('form-submit-invalid', params, params.$event)
|
|
450
450
|
}
|
|
451
451
|
|
|
452
452
|
const collapseEvent: VxeFormEvents.Collapse = (params) => {
|
|
453
453
|
const { $event } = params
|
|
454
|
-
|
|
455
|
-
|
|
454
|
+
$xeGrid.dispatchEvent('form-toggle-collapse', params, $event)
|
|
455
|
+
$xeGrid.dispatchEvent('form-collapse', params, $event)
|
|
456
456
|
}
|
|
457
457
|
|
|
458
458
|
const handleZoom = (isMax?: boolean) => {
|
|
@@ -464,9 +464,9 @@ export default defineVxeComponent({
|
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
466
|
return nextTick()
|
|
467
|
-
.then(() =>
|
|
467
|
+
.then(() => $xeGrid.recalculate(true))
|
|
468
468
|
.then(() => {
|
|
469
|
-
setTimeout(() =>
|
|
469
|
+
setTimeout(() => $xeGrid.recalculate(true), 15)
|
|
470
470
|
return reactData.isZMax
|
|
471
471
|
})
|
|
472
472
|
}
|
|
@@ -520,8 +520,8 @@ export default defineVxeComponent({
|
|
|
520
520
|
} else {
|
|
521
521
|
if (formOpts.items) {
|
|
522
522
|
const formSlots: { [key: string]: () => VNode[] } = {}
|
|
523
|
-
if (!formOpts.inited) {
|
|
524
|
-
formOpts.inited = true
|
|
523
|
+
if (!(formOpts as any).inited) {
|
|
524
|
+
(formOpts as any).inited = true
|
|
525
525
|
const beforeItem = proxyOpts.beforeItem
|
|
526
526
|
if (proxyOpts && beforeItem) {
|
|
527
527
|
formOpts.items.forEach((item) => {
|
|
@@ -631,12 +631,13 @@ export default defineVxeComponent({
|
|
|
631
631
|
* 渲染表格顶部区域
|
|
632
632
|
*/
|
|
633
633
|
const renderTop = () => {
|
|
634
|
-
|
|
634
|
+
const topSlot = slots.top
|
|
635
|
+
if (topSlot) {
|
|
635
636
|
return h('div', {
|
|
636
637
|
ref: refTopWrapper,
|
|
637
638
|
key: 'top',
|
|
638
639
|
class: 'vxe-grid--top-wrapper'
|
|
639
|
-
},
|
|
640
|
+
}, topSlot({ $grid: $xeGrid }))
|
|
640
641
|
}
|
|
641
642
|
return renderEmptyElement($xeGrid)
|
|
642
643
|
}
|
|
@@ -830,6 +831,30 @@ export default defineVxeComponent({
|
|
|
830
831
|
tableCompEvents[type] = (...args: any[]) => emit(name, ...args)
|
|
831
832
|
})
|
|
832
833
|
|
|
834
|
+
const getDefaultFormData = () => {
|
|
835
|
+
const formOpts = computeFormOpts.value
|
|
836
|
+
if (formOpts.items) {
|
|
837
|
+
const fData: any = {}
|
|
838
|
+
formOpts.items.forEach(item => {
|
|
839
|
+
const { field, itemRender } = item
|
|
840
|
+
if (field) {
|
|
841
|
+
let itemValue: any = null
|
|
842
|
+
if (itemRender) {
|
|
843
|
+
const { defaultValue } = itemRender
|
|
844
|
+
if (XEUtils.isFunction(defaultValue)) {
|
|
845
|
+
itemValue = defaultValue({ item })
|
|
846
|
+
} else if (!XEUtils.isUndefined(defaultValue)) {
|
|
847
|
+
itemValue = defaultValue
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
fData[field] = itemValue
|
|
851
|
+
}
|
|
852
|
+
})
|
|
853
|
+
return fData
|
|
854
|
+
}
|
|
855
|
+
return {}
|
|
856
|
+
}
|
|
857
|
+
|
|
833
858
|
const initProxy = () => {
|
|
834
859
|
const { proxyConfig, formConfig } = props
|
|
835
860
|
const { proxyInited } = reactData
|
|
@@ -837,40 +862,24 @@ export default defineVxeComponent({
|
|
|
837
862
|
const formOpts = computeFormOpts.value
|
|
838
863
|
if (proxyConfig && isEnableConf(proxyOpts)) {
|
|
839
864
|
if (formConfig && isEnableConf(formOpts) && proxyOpts.form && formOpts.items) {
|
|
840
|
-
|
|
841
|
-
formOpts.items.forEach(item => {
|
|
842
|
-
const { field, itemRender } = item
|
|
843
|
-
if (field) {
|
|
844
|
-
let itemValue: any = null
|
|
845
|
-
if (itemRender) {
|
|
846
|
-
const { defaultValue } = itemRender
|
|
847
|
-
if (XEUtils.isFunction(defaultValue)) {
|
|
848
|
-
itemValue = defaultValue({ item })
|
|
849
|
-
} else if (!XEUtils.isUndefined(defaultValue)) {
|
|
850
|
-
itemValue = defaultValue
|
|
851
|
-
}
|
|
852
|
-
}
|
|
853
|
-
fData[field] = itemValue
|
|
854
|
-
}
|
|
855
|
-
})
|
|
856
|
-
reactData.formData = fData
|
|
865
|
+
reactData.formData = getDefaultFormData()
|
|
857
866
|
}
|
|
858
867
|
if (!proxyInited) {
|
|
859
868
|
reactData.proxyInited = true
|
|
860
869
|
if (proxyOpts.autoLoad !== false) {
|
|
861
|
-
nextTick().then(() => gridMethods.commitProxy('
|
|
862
|
-
gridMethods.dispatchEvent('proxy-query', { ...rest, isInited: true }, new Event('
|
|
870
|
+
nextTick().then(() => gridMethods.commitProxy('initial')).then((rest) => {
|
|
871
|
+
gridMethods.dispatchEvent('proxy-query', { ...rest, isInited: true }, new Event('initial'))
|
|
863
872
|
})
|
|
864
873
|
}
|
|
865
874
|
}
|
|
866
875
|
}
|
|
867
876
|
}
|
|
868
877
|
|
|
869
|
-
const handleGlobalKeydownEvent = (evnt:
|
|
878
|
+
const handleGlobalKeydownEvent = (evnt: KeyboardEvent) => {
|
|
870
879
|
const zoomOpts = computeZoomOpts.value
|
|
871
880
|
const isEsc = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ESCAPE)
|
|
872
881
|
if (isEsc && reactData.isZMax && zoomOpts.escRestore !== false) {
|
|
873
|
-
|
|
882
|
+
$xeGrid.triggerZoomEvent(evnt)
|
|
874
883
|
}
|
|
875
884
|
}
|
|
876
885
|
|
|
@@ -888,7 +897,7 @@ export default defineVxeComponent({
|
|
|
888
897
|
* @param {String/Object} code 字符串或对象
|
|
889
898
|
*/
|
|
890
899
|
commitProxy (proxyTarget: string | VxeToolbarPropTypes.ButtonConfig, ...args: any[]) {
|
|
891
|
-
const { toolbarConfig, pagerConfig, editRules, validConfig } = props
|
|
900
|
+
const { proxyConfig, toolbarConfig, pagerConfig, editRules, validConfig } = props
|
|
892
901
|
const { tablePage } = reactData
|
|
893
902
|
const isActiveMsg = computeIsActiveMsg.value
|
|
894
903
|
const isRespMsg = computeIsRespMsg.value
|
|
@@ -898,7 +907,7 @@ export default defineVxeComponent({
|
|
|
898
907
|
const { beforeQuery, afterQuery, beforeDelete, afterDelete, beforeSave, afterSave, ajax = {} } = proxyOpts
|
|
899
908
|
const resConfigs = proxyOpts.response || proxyOpts.props || {}
|
|
900
909
|
const $xeTable = refTable.value
|
|
901
|
-
|
|
910
|
+
let formData = getFormData()
|
|
902
911
|
let button: VxeToolbarPropTypes.ButtonConfig | null = null
|
|
903
912
|
let code: string | null = null
|
|
904
913
|
if (XEUtils.isString(proxyTarget)) {
|
|
@@ -941,14 +950,14 @@ export default defineVxeComponent({
|
|
|
941
950
|
break
|
|
942
951
|
case 'reset_custom':
|
|
943
952
|
return $xeTable.resetCustom(true)
|
|
944
|
-
case '
|
|
953
|
+
case 'initial':
|
|
945
954
|
case 'reload':
|
|
946
955
|
case 'query': {
|
|
947
956
|
const ajaxMethods = ajax.query
|
|
948
957
|
const querySuccessMethods = ajax.querySuccess
|
|
949
958
|
const queryErrorMethods = ajax.queryError
|
|
950
959
|
if (ajaxMethods) {
|
|
951
|
-
const isInited = code === '
|
|
960
|
+
const isInited = code === 'initial'
|
|
952
961
|
const isReload = code === 'reload'
|
|
953
962
|
if (!isInited && reactData.tableLoading) {
|
|
954
963
|
return nextTick()
|
|
@@ -958,6 +967,7 @@ export default defineVxeComponent({
|
|
|
958
967
|
let pageParams: any = {}
|
|
959
968
|
if (pagerConfig) {
|
|
960
969
|
if (isInited || isReload) {
|
|
970
|
+
// 重置分页
|
|
961
971
|
tablePage.currentPage = 1
|
|
962
972
|
}
|
|
963
973
|
if (isEnableConf(pagerOpts)) {
|
|
@@ -965,26 +975,41 @@ export default defineVxeComponent({
|
|
|
965
975
|
}
|
|
966
976
|
}
|
|
967
977
|
if (isInited) {
|
|
968
|
-
|
|
978
|
+
// 重置代理表单数据
|
|
979
|
+
if (proxyConfig && isEnableConf(proxyOpts) && proxyOpts.form) {
|
|
980
|
+
formData = getDefaultFormData()
|
|
981
|
+
reactData.formData = formData
|
|
982
|
+
}
|
|
969
983
|
if ($xeTable) {
|
|
984
|
+
const { internalData: tableInternalData } = $xeTable
|
|
985
|
+
const { tableFullColumn, fullColumnFieldData } = tableInternalData
|
|
970
986
|
const { computeSortOpts } = $xeTable.getComputeMaps()
|
|
971
987
|
const sortOpts = computeSortOpts.value
|
|
972
|
-
defaultSort = sortOpts.defaultSort
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
if (defaultSort) {
|
|
976
|
-
if (!XEUtils.isArray(defaultSort)) {
|
|
977
|
-
defaultSort = [defaultSort]
|
|
978
|
-
}
|
|
979
|
-
sortList = defaultSort.map((item) => {
|
|
980
|
-
return {
|
|
981
|
-
field: item.field,
|
|
982
|
-
property: item.field,
|
|
983
|
-
order: item.order
|
|
984
|
-
}
|
|
988
|
+
let defaultSort = sortOpts.defaultSort
|
|
989
|
+
tableFullColumn.forEach((column) => {
|
|
990
|
+
column.order = null
|
|
985
991
|
})
|
|
986
|
-
|
|
987
|
-
|
|
992
|
+
// 如果使用默认排序
|
|
993
|
+
if (defaultSort) {
|
|
994
|
+
if (!XEUtils.isArray(defaultSort)) {
|
|
995
|
+
defaultSort = [defaultSort]
|
|
996
|
+
}
|
|
997
|
+
sortList = defaultSort.map((item) => {
|
|
998
|
+
const { field, order } = item
|
|
999
|
+
const colRest = fullColumnFieldData[field]
|
|
1000
|
+
if (colRest) {
|
|
1001
|
+
const column = colRest.column
|
|
1002
|
+
if (column) {
|
|
1003
|
+
column.order = order
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
return {
|
|
1007
|
+
field,
|
|
1008
|
+
property: field,
|
|
1009
|
+
order
|
|
1010
|
+
}
|
|
1011
|
+
})
|
|
1012
|
+
}
|
|
988
1013
|
filterList = $xeTable.getCheckedFilters()
|
|
989
1014
|
}
|
|
990
1015
|
} else {
|
|
@@ -1310,23 +1335,23 @@ export default defineVxeComponent({
|
|
|
1310
1335
|
},
|
|
1311
1336
|
triggerToolbarCommitEvent (params, evnt) {
|
|
1312
1337
|
const { code } = params
|
|
1313
|
-
return
|
|
1338
|
+
return $xeGrid.commitProxy(params, evnt).then((rest) => {
|
|
1314
1339
|
if (code && rest && rest.status && ['query', 'reload', 'delete', 'save'].includes(code)) {
|
|
1315
|
-
|
|
1340
|
+
$xeGrid.dispatchEvent(code === 'delete' || code === 'save' ? `proxy-${code as 'delete' | 'save'}` : 'proxy-query', { ...rest, isReload: code === 'reload' }, evnt)
|
|
1316
1341
|
}
|
|
1317
1342
|
})
|
|
1318
1343
|
},
|
|
1319
1344
|
triggerToolbarBtnEvent (button, evnt) {
|
|
1320
|
-
|
|
1321
|
-
|
|
1345
|
+
$xeGrid.triggerToolbarCommitEvent(button, evnt)
|
|
1346
|
+
$xeGrid.dispatchEvent('toolbar-button-click', { code: button.code, button }, evnt)
|
|
1322
1347
|
},
|
|
1323
1348
|
triggerToolbarTolEvent (tool, evnt) {
|
|
1324
|
-
|
|
1325
|
-
|
|
1349
|
+
$xeGrid.triggerToolbarCommitEvent(tool, evnt)
|
|
1350
|
+
$xeGrid.dispatchEvent('toolbar-tool-click', { code: tool.code, tool }, evnt)
|
|
1326
1351
|
},
|
|
1327
1352
|
triggerZoomEvent (evnt) {
|
|
1328
|
-
|
|
1329
|
-
|
|
1353
|
+
$xeGrid.zoom()
|
|
1354
|
+
$xeGrid.dispatchEvent('zoom', { type: reactData.isZMax ? 'max' : 'revert' }, evnt)
|
|
1330
1355
|
}
|
|
1331
1356
|
}
|
|
1332
1357
|
|
|
@@ -1402,6 +1427,7 @@ export default defineVxeComponent({
|
|
|
1402
1427
|
onMounted(() => {
|
|
1403
1428
|
nextTick(() => {
|
|
1404
1429
|
const { columns } = props
|
|
1430
|
+
const proxyOpts = computeProxyOpts.value
|
|
1405
1431
|
|
|
1406
1432
|
if (props.formConfig) {
|
|
1407
1433
|
if (!VxeUIFormComponent) {
|
|
@@ -1415,15 +1441,14 @@ export default defineVxeComponent({
|
|
|
1415
1441
|
}
|
|
1416
1442
|
|
|
1417
1443
|
// const { data, columns, proxyConfig } = props
|
|
1418
|
-
// const proxyOpts = computeProxyOpts.value
|
|
1419
1444
|
// const formOpts = computeFormOpts.value
|
|
1420
1445
|
// if (isEnableConf(proxyConfig) && (data || (proxyOpts.form && formOpts.data))) {
|
|
1421
1446
|
// errLog('vxe.error.errConflicts', ['grid.data', 'grid.proxy-config'])
|
|
1422
1447
|
// }
|
|
1423
1448
|
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1449
|
+
if (proxyOpts.props) {
|
|
1450
|
+
warnLog('vxe.error.delProp', ['proxy-config.props', 'proxy-config.response'])
|
|
1451
|
+
}
|
|
1427
1452
|
|
|
1428
1453
|
if (columns && columns.length) {
|
|
1429
1454
|
$xeGrid.loadColumn(columns)
|
|
@@ -268,8 +268,8 @@ hooks.add('tableKeyboardModule', {
|
|
|
268
268
|
const checkboxOpts = computeCheckboxOpts.value
|
|
269
269
|
const mouseOpts = computeMouseOpts.value
|
|
270
270
|
const editOpts = computeEditOpts.value
|
|
271
|
-
if (mouseConfig && mouseOpts.area && $xeTable.
|
|
272
|
-
return $xeTable.
|
|
271
|
+
if (mouseConfig && mouseOpts.area && $xeTable.triggerCellAreaMousednEvent) {
|
|
272
|
+
return $xeTable.triggerCellAreaMousednEvent(evnt, params)
|
|
273
273
|
} else {
|
|
274
274
|
if (checkboxConfig && checkboxOpts.range) {
|
|
275
275
|
handleCheckboxRangeEvent(evnt, params)
|
|
@@ -11665,7 +11665,7 @@ export default defineVxeComponent({
|
|
|
11665
11665
|
if (rowOpts.height && !props.showOverflow) {
|
|
11666
11666
|
warnLog('vxe.error.notProp', ['table.show-overflow'])
|
|
11667
11667
|
}
|
|
11668
|
-
if (!$xeTable.
|
|
11668
|
+
if (!$xeTable.triggerCellAreaMousednEvent) {
|
|
11669
11669
|
if (props.areaConfig) {
|
|
11670
11670
|
warnLog('vxe.error.notProp', ['area-config'])
|
|
11671
11671
|
}
|
package/packages/ui/index.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|