vxe-table 3.13.16 → 3.13.18
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 +68 -85
- package/es/style.css +1 -1
- package/es/table/module/custom/panel.js +25 -27
- package/es/table/module/edit/mixin.js +3 -5
- package/es/table/module/export/export-panel.js +22 -24
- package/es/table/module/export/import-panel.js +14 -16
- package/es/table/module/export/mixin.js +15 -31
- package/es/table/module/keyboard/mixin.js +3 -2
- package/es/table/module/validator/mixin.js +1 -3
- package/es/table/render/index.js +2 -4
- package/es/table/src/body.js +2 -2
- package/es/table/src/columnInfo.js +30 -32
- package/es/table/src/methods.js +113 -68
- package/es/table/src/table.js +16 -18
- package/es/table/src/util.js +5 -7
- package/es/toolbar/src/toolbar.js +18 -26
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +69 -98
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +356 -365
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/panel.js +31 -33
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/mixin.js +3 -5
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/export-panel.js +22 -24
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +14 -16
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/export/mixin.js +15 -31
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +3 -2
- package/lib/table/module/validator/mixin.js +1 -3
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/render/index.js +2 -4
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +2 -1
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/columnInfo.js +32 -34
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/methods.js +121 -65
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +13 -15
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +4 -6
- package/lib/table/src/util.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +18 -26
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/ui/index.js +1 -1
- 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 +2 -2
- package/packages/grid/src/grid.ts +70 -85
- package/packages/table/module/custom/panel.ts +25 -27
- package/packages/table/module/edit/mixin.ts +3 -5
- package/packages/table/module/export/export-panel.ts +22 -24
- package/packages/table/module/export/import-panel.ts +14 -16
- package/packages/table/module/export/mixin.ts +15 -31
- package/packages/table/module/keyboard/mixin.ts +6 -2
- package/packages/table/module/validator/mixin.ts +1 -3
- package/packages/table/render/index.ts +2 -4
- package/packages/table/src/body.ts +2 -2
- package/packages/table/src/columnInfo.ts +30 -32
- package/packages/table/src/methods.ts +115 -66
- package/packages/table/src/table.ts +13 -15
- package/packages/table/src/util.ts +4 -6
- package/packages/toolbar/src/toolbar.ts +18 -26
- /package/es/{iconfont.1740799948632.ttf → iconfont.1741140503645.ttf} +0 -0
- /package/es/{iconfont.1740799948632.woff → iconfont.1741140503645.woff} +0 -0
- /package/es/{iconfont.1740799948632.woff2 → iconfont.1741140503645.woff2} +0 -0
- /package/lib/{iconfont.1740799948632.ttf → iconfont.1741140503645.ttf} +0 -0
- /package/lib/{iconfont.1740799948632.woff → iconfont.1741140503645.woff} +0 -0
- /package/lib/{iconfont.1740799948632.woff2 → iconfont.1741140503645.woff2} +0 -0
|
@@ -76,9 +76,7 @@ function getFuncSlot ($xeGrid: any, optSlots: any, slotKey: any) {
|
|
|
76
76
|
if (slots[funcSlot]) {
|
|
77
77
|
return slots[funcSlot]
|
|
78
78
|
} else {
|
|
79
|
-
|
|
80
|
-
errLog('vxe.error.notSlot', [funcSlot])
|
|
81
|
-
}
|
|
79
|
+
errLog('vxe.error.notSlot', [funcSlot])
|
|
82
80
|
}
|
|
83
81
|
} else {
|
|
84
82
|
return funcSlot
|
|
@@ -163,7 +161,7 @@ function renderForm (h: CreateElement, _vm: any) {
|
|
|
163
161
|
if (hasForm) {
|
|
164
162
|
return h('div', {
|
|
165
163
|
key: 'form',
|
|
166
|
-
ref: '
|
|
164
|
+
ref: 'refFormWrapper',
|
|
167
165
|
class: 'vxe-grid--form-wrapper'
|
|
168
166
|
}, formSlot ? formSlot.call(_vm, { $grid: _vm }, h) : renderDefaultForm(h, _vm))
|
|
169
167
|
}
|
|
@@ -181,7 +179,7 @@ function renderToolbar (h: CreateElement, _vm: any) {
|
|
|
181
179
|
if (hasToolbar) {
|
|
182
180
|
return h('div', {
|
|
183
181
|
key: 'toolbar',
|
|
184
|
-
ref: '
|
|
182
|
+
ref: 'refToolbarWrapper',
|
|
185
183
|
class: 'vxe-grid--toolbar-wrapper'
|
|
186
184
|
}, toolbarSlot
|
|
187
185
|
? toolbarSlot.call(_vm, { $grid: _vm }, h)
|
|
@@ -207,7 +205,7 @@ function renderTop (h: CreateElement, _vm: any) {
|
|
|
207
205
|
return topSlot
|
|
208
206
|
? h('div', {
|
|
209
207
|
key: 'top',
|
|
210
|
-
ref: '
|
|
208
|
+
ref: 'refTopWrapper',
|
|
211
209
|
class: 'vxe-grid--top-wrapper'
|
|
212
210
|
}, topSlot.call(_vm, { $grid: _vm }, h))
|
|
213
211
|
: _e()
|
|
@@ -264,7 +262,7 @@ function renderBottom (h: CreateElement, _vm: any) {
|
|
|
264
262
|
return bottomSlot
|
|
265
263
|
? h('div', {
|
|
266
264
|
key: 'bottom',
|
|
267
|
-
ref: '
|
|
265
|
+
ref: 'refBottomWrapper',
|
|
268
266
|
class: 'vxe-grid--bottom-wrapper'
|
|
269
267
|
}, bottomSlot.call(_vm, { $grid: _vm }, h))
|
|
270
268
|
: _e()
|
|
@@ -285,7 +283,7 @@ function renderPager (h: CreateElement, $xeGrid: any) {
|
|
|
285
283
|
if (hasPager) {
|
|
286
284
|
return h('div', {
|
|
287
285
|
key: 'pager',
|
|
288
|
-
ref: '
|
|
286
|
+
ref: 'refPagerWrapper',
|
|
289
287
|
class: 'vxe-grid--pager-wrapper'
|
|
290
288
|
}, pagerSlot
|
|
291
289
|
? pagerSlot.call($xeGrid, { $grid: $xeGrid }, h)
|
|
@@ -580,36 +578,32 @@ export default {
|
|
|
580
578
|
// errLog('vxe.error.errConflicts', ['grid.data', 'grid.proxy-config'])
|
|
581
579
|
// }
|
|
582
580
|
|
|
583
|
-
if (
|
|
584
|
-
|
|
585
|
-
warnLog('vxe.error.delProp', ['grid.toolbar', 'grid.toolbar-config'])
|
|
586
|
-
}
|
|
587
|
-
if (this.toolbarConfig && !XEUtils.isObject(this.toolbarConfig)) {
|
|
588
|
-
warnLog('vxe.error.errProp', [`grid.toolbar-config=${this.toolbarConfig}`, 'grid.toolbar-config={}'])
|
|
589
|
-
}
|
|
590
|
-
// if (proxyOpts.props) {
|
|
591
|
-
// warnLog('vxe.error.delProp', ['proxy-config.props', 'proxy-config.response'])
|
|
592
|
-
// }
|
|
581
|
+
if (this.toolbar) {
|
|
582
|
+
warnLog('vxe.error.delProp', ['grid.toolbar', 'grid.toolbar-config'])
|
|
593
583
|
}
|
|
584
|
+
if (this.toolbarConfig && !XEUtils.isObject(this.toolbarConfig)) {
|
|
585
|
+
warnLog('vxe.error.errProp', [`grid.toolbar-config=${this.toolbarConfig}`, 'grid.toolbar-config={}'])
|
|
586
|
+
}
|
|
587
|
+
// if (proxyOpts.props) {
|
|
588
|
+
// warnLog('vxe.error.delProp', ['proxy-config.props', 'proxy-config.response'])
|
|
589
|
+
// }
|
|
594
590
|
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
const VxeUIPagerComponent = VxeUI.getComponent<VxePagerComponent>('VxePager')
|
|
591
|
+
// 使用已安装的组件,如果未安装则不渲染
|
|
592
|
+
const VxeUIFormComponent = VxeUI.getComponent<VxeFormComponent>('VxeForm')
|
|
593
|
+
const VxeUIPagerComponent = VxeUI.getComponent<VxePagerComponent>('VxePager')
|
|
599
594
|
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
}
|
|
595
|
+
$xeGrid.$nextTick(() => {
|
|
596
|
+
if (props.formConfig) {
|
|
597
|
+
if (!VxeUIFormComponent) {
|
|
598
|
+
errLog('vxe.error.reqComp', ['vxe-form'])
|
|
605
599
|
}
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
600
|
+
}
|
|
601
|
+
if (props.pagerConfig) {
|
|
602
|
+
if (!VxeUIPagerComponent) {
|
|
603
|
+
errLog('vxe.error.reqComp', ['vxe-pager'])
|
|
610
604
|
}
|
|
611
|
-
}
|
|
612
|
-
}
|
|
605
|
+
}
|
|
606
|
+
})
|
|
613
607
|
|
|
614
608
|
this.initPages()
|
|
615
609
|
globalEvents.on(this, 'keydown', this.handleGlobalKeydownEvent)
|
|
@@ -632,6 +626,7 @@ export default {
|
|
|
632
626
|
const vSize = $xeGrid.computeSize
|
|
633
627
|
const styles = $xeGrid.computeStyles
|
|
634
628
|
return h('div', {
|
|
629
|
+
ref: 'refElem',
|
|
635
630
|
class: ['vxe-grid', {
|
|
636
631
|
[`size--${vSize}`]: vSize,
|
|
637
632
|
'is--animat': !!this.animat,
|
|
@@ -656,18 +651,32 @@ export default {
|
|
|
656
651
|
}
|
|
657
652
|
return []
|
|
658
653
|
},
|
|
659
|
-
getParentHeight () {
|
|
660
|
-
const { $el, isZMax } = this
|
|
661
|
-
return (isZMax ? getDomNode().visibleHeight : XEUtils.toNumber(getComputedStyle($el.parentNode).height)) - this.getExcludeHeight()
|
|
662
|
-
},
|
|
663
654
|
/**
|
|
664
655
|
* 获取需要排除的高度
|
|
665
656
|
*/
|
|
666
657
|
getExcludeHeight () {
|
|
667
|
-
const
|
|
668
|
-
const
|
|
669
|
-
|
|
670
|
-
|
|
658
|
+
const $xeGrid = this
|
|
659
|
+
const reactData = $xeGrid as GridReactData
|
|
660
|
+
|
|
661
|
+
const { isZMax } = reactData
|
|
662
|
+
const el = $xeGrid.$refs.refElem as HTMLDivElement
|
|
663
|
+
const formWrapper = $xeGrid.$refs.refFormWrapper as HTMLDivElement
|
|
664
|
+
const toolbarWrapper = $xeGrid.$refs.refToolbarWrapper as HTMLDivElement
|
|
665
|
+
const topWrapper = $xeGrid.$refs.refTopWrapper as HTMLDivElement
|
|
666
|
+
const bottomWrapper = $xeGrid.$refs.refBottomWrapper as HTMLDivElement
|
|
667
|
+
const pagerWrapper = $xeGrid.$refs.refPagerWrapper as HTMLDivElement
|
|
668
|
+
const parentPaddingSize = isZMax ? 0 : getPaddingTopBottomSize(el.parentNode as HTMLElement)
|
|
669
|
+
return parentPaddingSize + getPaddingTopBottomSize(el) + getOffsetHeight(formWrapper) + getOffsetHeight(toolbarWrapper) + getOffsetHeight(topWrapper) + getOffsetHeight(bottomWrapper) + getOffsetHeight(pagerWrapper)
|
|
670
|
+
},
|
|
671
|
+
getParentHeight () {
|
|
672
|
+
const $xeGrid = this
|
|
673
|
+
const reactData = $xeGrid as GridReactData
|
|
674
|
+
|
|
675
|
+
const el = $xeGrid.$refs.refElem as HTMLDivElement
|
|
676
|
+
if (el) {
|
|
677
|
+
return (reactData.isZMax ? getDomNode().visibleHeight : XEUtils.toNumber(getComputedStyle(el.parentNode as HTMLElement).height)) - $xeGrid.getExcludeHeight()
|
|
678
|
+
}
|
|
679
|
+
return 0
|
|
671
680
|
},
|
|
672
681
|
initToolbar () {
|
|
673
682
|
this.$nextTick(() => {
|
|
@@ -883,9 +892,7 @@ export default {
|
|
|
883
892
|
return { status: false }
|
|
884
893
|
})
|
|
885
894
|
} else {
|
|
886
|
-
|
|
887
|
-
errLog('vxe.error.notFunc', ['proxy-config.ajax.query'])
|
|
888
|
-
}
|
|
895
|
+
errLog('vxe.error.notFunc', ['proxy-config.ajax.query'])
|
|
889
896
|
}
|
|
890
897
|
break
|
|
891
898
|
}
|
|
@@ -911,10 +918,8 @@ export default {
|
|
|
911
918
|
$xetable.setPendingRow(removeRecords, false)
|
|
912
919
|
if (isRespMsg) {
|
|
913
920
|
// 检测弹窗模块
|
|
914
|
-
if (
|
|
915
|
-
|
|
916
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
917
|
-
}
|
|
921
|
+
if (!VxeUI.modal) {
|
|
922
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
918
923
|
}
|
|
919
924
|
VxeUI.modal.message({ content: this.getRespMsg(rest, 'vxe.grid.delSuccess'), status: 'success' })
|
|
920
925
|
}
|
|
@@ -932,10 +937,8 @@ export default {
|
|
|
932
937
|
this.tableLoading = false
|
|
933
938
|
if (isRespMsg) {
|
|
934
939
|
// 检测弹窗模块
|
|
935
|
-
if (
|
|
936
|
-
|
|
937
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
938
|
-
}
|
|
940
|
+
if (!VxeUI.modal) {
|
|
941
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
939
942
|
}
|
|
940
943
|
VxeUI.modal.message({ id: code, content: this.getRespMsg(rest, 'vxe.grid.operError'), status: 'error' })
|
|
941
944
|
}
|
|
@@ -948,18 +951,14 @@ export default {
|
|
|
948
951
|
} else {
|
|
949
952
|
if (isActiveMsg) {
|
|
950
953
|
// 检测弹窗模块
|
|
951
|
-
if (
|
|
952
|
-
|
|
953
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
954
|
-
}
|
|
954
|
+
if (!VxeUI.modal) {
|
|
955
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
955
956
|
}
|
|
956
957
|
VxeUI.modal.message({ id: code, content: getI18n('vxe.grid.selectOneRecord'), status: 'warning' })
|
|
957
958
|
}
|
|
958
959
|
}
|
|
959
960
|
} else {
|
|
960
|
-
|
|
961
|
-
errLog('vxe.error.notFunc', ['proxy-config.ajax.delete'])
|
|
962
|
-
}
|
|
961
|
+
errLog('vxe.error.notFunc', ['proxy-config.ajax.delete'])
|
|
963
962
|
}
|
|
964
963
|
break
|
|
965
964
|
}
|
|
@@ -998,10 +997,8 @@ export default {
|
|
|
998
997
|
$xetable.clearPendingRow()
|
|
999
998
|
if (isRespMsg) {
|
|
1000
999
|
// 检测弹窗模块
|
|
1001
|
-
if (
|
|
1002
|
-
|
|
1003
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
1004
|
-
}
|
|
1000
|
+
if (!VxeUI.modal) {
|
|
1001
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
1005
1002
|
}
|
|
1006
1003
|
VxeUI.modal.message({ content: this.getRespMsg(rest, 'vxe.grid.saveSuccess'), status: 'success' })
|
|
1007
1004
|
}
|
|
@@ -1019,10 +1016,8 @@ export default {
|
|
|
1019
1016
|
this.tableLoading = false
|
|
1020
1017
|
if (isRespMsg) {
|
|
1021
1018
|
// 检测弹窗模块
|
|
1022
|
-
if (
|
|
1023
|
-
|
|
1024
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
1025
|
-
}
|
|
1019
|
+
if (!VxeUI.modal) {
|
|
1020
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
1026
1021
|
}
|
|
1027
1022
|
VxeUI.modal.message({ id: code, content: this.getRespMsg(rest, 'vxe.grid.operError'), status: 'error' })
|
|
1028
1023
|
}
|
|
@@ -1034,19 +1029,15 @@ export default {
|
|
|
1034
1029
|
} else {
|
|
1035
1030
|
if (isActiveMsg) {
|
|
1036
1031
|
// 检测弹窗模块
|
|
1037
|
-
if (
|
|
1038
|
-
|
|
1039
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
1040
|
-
}
|
|
1032
|
+
if (!VxeUI.modal) {
|
|
1033
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
1041
1034
|
}
|
|
1042
1035
|
VxeUI.modal.message({ id: code, content: getI18n('vxe.grid.dataUnchanged'), status: 'info' })
|
|
1043
1036
|
}
|
|
1044
1037
|
}
|
|
1045
1038
|
})
|
|
1046
1039
|
} else {
|
|
1047
|
-
|
|
1048
|
-
errLog('vxe.error.notFunc', ['proxy-config.ajax.save'])
|
|
1049
|
-
}
|
|
1040
|
+
errLog('vxe.error.notFunc', ['proxy-config.ajax.save'])
|
|
1050
1041
|
}
|
|
1051
1042
|
break
|
|
1052
1043
|
}
|
|
@@ -1056,9 +1047,7 @@ export default {
|
|
|
1056
1047
|
if (gCommandOpts.commandMethod) {
|
|
1057
1048
|
gCommandOpts.commandMethod({ code, button, $grid: this, $table: $xetable }, ...args)
|
|
1058
1049
|
} else {
|
|
1059
|
-
|
|
1060
|
-
errLog('vxe.error.notCommands', [code])
|
|
1061
|
-
}
|
|
1050
|
+
errLog('vxe.error.notCommands', [code])
|
|
1062
1051
|
}
|
|
1063
1052
|
}
|
|
1064
1053
|
}
|
|
@@ -1085,10 +1074,8 @@ export default {
|
|
|
1085
1074
|
})
|
|
1086
1075
|
} else {
|
|
1087
1076
|
// 检测弹窗模块
|
|
1088
|
-
if (
|
|
1089
|
-
|
|
1090
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
1091
|
-
}
|
|
1077
|
+
if (!VxeUI.modal) {
|
|
1078
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
1092
1079
|
}
|
|
1093
1080
|
VxeUI.modal.message({ id: `msg_${code}`, content: getI18n('vxe.grid.selectOneRecord'), status: 'warning' })
|
|
1094
1081
|
}
|
|
@@ -1136,10 +1123,8 @@ export default {
|
|
|
1136
1123
|
} else {
|
|
1137
1124
|
if (isActiveMsg) {
|
|
1138
1125
|
// 检测弹窗模块
|
|
1139
|
-
if (
|
|
1140
|
-
|
|
1141
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
1142
|
-
}
|
|
1126
|
+
if (!VxeUI.modal) {
|
|
1127
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
1143
1128
|
}
|
|
1144
1129
|
VxeUI.modal.message({ id: code, content: getI18n('vxe.grid.selectOneRecord'), status: 'warning' })
|
|
1145
1130
|
}
|
|
@@ -844,34 +844,32 @@ export default {
|
|
|
844
844
|
computed: {
|
|
845
845
|
},
|
|
846
846
|
created (this: any) {
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
const VxeUIRadioGroupComponent = VxeUI.getComponent<VxeRadioGroupComponent>('VxeRadioGroup')
|
|
847
|
+
const VxeUIModalComponent = VxeUI.getComponent<VxeModalComponent>('VxeModal')
|
|
848
|
+
const VxeUIDrawerComponent = VxeUI.getComponent<VxeDrawerComponent>('VxeDrawer')
|
|
849
|
+
const VxeUIButtonComponent = VxeUI.getComponent<VxeButtonComponent>('VxeButton')
|
|
850
|
+
const VxeUINumberInputComponent = VxeUI.getComponent<VxeInputComponent>('VxeNumberInput')
|
|
851
|
+
const VxeUIRadioGroupComponent = VxeUI.getComponent<VxeRadioGroupComponent>('VxeRadioGroup')
|
|
853
852
|
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
}
|
|
853
|
+
this.$nextTick(() => {
|
|
854
|
+
const { $xetable } = this
|
|
855
|
+
const { customOpts } = $xetable
|
|
856
|
+
const { mode } = customOpts
|
|
857
|
+
if (!VxeUIModalComponent) {
|
|
858
|
+
errLog('vxe.error.reqComp', ['vxe-modal'])
|
|
859
|
+
}
|
|
860
|
+
if (!VxeUIDrawerComponent && (mode === 'drawer')) {
|
|
861
|
+
errLog('vxe.error.reqComp', ['vxe-drawer'])
|
|
862
|
+
}
|
|
863
|
+
if (!VxeUIButtonComponent) {
|
|
864
|
+
errLog('vxe.error.reqComp', ['vxe-button'])
|
|
865
|
+
}
|
|
866
|
+
if (!VxeUINumberInputComponent) {
|
|
867
|
+
errLog('vxe.error.reqComp', ['vxe-input'])
|
|
868
|
+
}
|
|
869
|
+
if (!VxeUIRadioGroupComponent) {
|
|
870
|
+
errLog('vxe.error.reqComp', ['vxe-radio-group'])
|
|
871
|
+
}
|
|
872
|
+
})
|
|
875
873
|
},
|
|
876
874
|
render (this: any, h: CreateElement) {
|
|
877
875
|
const $xeTable = this.$xeTable
|
|
@@ -162,11 +162,9 @@ function handleInsertRowAt ($xeTable: any, records: any[], targetRow: any, isIns
|
|
|
162
162
|
const parentLevel = parentRest ? parentRest.level : 0
|
|
163
163
|
newRecords.forEach((item: any, i: any) => {
|
|
164
164
|
const rowid = getRowid($xeTable, item)
|
|
165
|
-
if (
|
|
166
|
-
if (item[treeOpts.parentField]) {
|
|
167
|
-
|
|
168
|
-
errLog('vxe.error.errProp', [`${treeOpts.parentField}=${item[treeOpts.parentField]}`, `${treeOpts.parentField}=${parentRow[rowField]}`])
|
|
169
|
-
}
|
|
165
|
+
if (item[treeOpts.parentField]) {
|
|
166
|
+
if (parentRow && item[treeOpts.parentField] !== parentRow[rowField]) {
|
|
167
|
+
errLog('vxe.error.errProp', [`${treeOpts.parentField}=${item[treeOpts.parentField]}`, `${treeOpts.parentField}=${parentRow[rowField]}`])
|
|
170
168
|
}
|
|
171
169
|
}
|
|
172
170
|
if (parentRow) {
|
|
@@ -59,31 +59,29 @@ export default {
|
|
|
59
59
|
created (this: any) {
|
|
60
60
|
const $xeTableExportPanel = this
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const VxeUICheckboxComponent = VxeUI.getComponent<VxeCheckboxComponent>('VxeCheckbox')
|
|
62
|
+
const VxeUIModalComponent = VxeUI.getComponent<VxeModalComponent>('VxeModal')
|
|
63
|
+
const VxeUIButtonComponent = VxeUI.getComponent<VxeButtonComponent>('VxeButton')
|
|
64
|
+
const VxeUISelectComponent = VxeUI.getComponent<VxeSelectComponent>('VxeSelect')
|
|
65
|
+
const VxeUIInputComponent = VxeUI.getComponent<VxeInputComponent>('VxeInput')
|
|
66
|
+
const VxeUICheckboxComponent = VxeUI.getComponent<VxeCheckboxComponent>('VxeCheckbox')
|
|
68
67
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
68
|
+
$xeTableExportPanel.$nextTick(() => {
|
|
69
|
+
if (!VxeUIModalComponent) {
|
|
70
|
+
errLog('vxe.error.reqComp', ['vxe-modal'])
|
|
71
|
+
}
|
|
72
|
+
if (!VxeUIButtonComponent) {
|
|
73
|
+
errLog('vxe.error.reqComp', ['vxe-button'])
|
|
74
|
+
}
|
|
75
|
+
if (!VxeUISelectComponent) {
|
|
76
|
+
errLog('vxe.error.reqComp', ['vxe-select'])
|
|
77
|
+
}
|
|
78
|
+
if (!VxeUIInputComponent) {
|
|
79
|
+
errLog('vxe.error.reqComp', ['vxe-input'])
|
|
80
|
+
}
|
|
81
|
+
if (!VxeUICheckboxComponent) {
|
|
82
|
+
errLog('vxe.error.reqComp', ['vxe-checkbox'])
|
|
83
|
+
}
|
|
84
|
+
})
|
|
87
85
|
},
|
|
88
86
|
render (this: any, h: CreateElement) {
|
|
89
87
|
const $xeTable = this.$xeTable
|
|
@@ -51,23 +51,21 @@ export default {
|
|
|
51
51
|
created (this: any) {
|
|
52
52
|
const $xeTableImportPanel = this
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const VxeUISelectComponent = VxeUI.getComponent<VxeSelectComponent>('VxeSelect')
|
|
54
|
+
const VxeUIModalComponent = VxeUI.getComponent<VxeModalComponent>('VxeModal')
|
|
55
|
+
const VxeUIButtonComponent = VxeUI.getComponent<VxeButtonComponent>('VxeButton')
|
|
56
|
+
const VxeUISelectComponent = VxeUI.getComponent<VxeSelectComponent>('VxeSelect')
|
|
58
57
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
58
|
+
$xeTableImportPanel.$nextTick(() => {
|
|
59
|
+
if (!VxeUIModalComponent) {
|
|
60
|
+
errLog('vxe.error.reqComp', ['vxe-modal'])
|
|
61
|
+
}
|
|
62
|
+
if (!VxeUIButtonComponent) {
|
|
63
|
+
errLog('vxe.error.reqComp', ['vxe-button'])
|
|
64
|
+
}
|
|
65
|
+
if (!VxeUISelectComponent) {
|
|
66
|
+
errLog('vxe.error.reqComp', ['vxe-select'])
|
|
67
|
+
}
|
|
68
|
+
})
|
|
71
69
|
},
|
|
72
70
|
render (this: any, h: CreateElement) {
|
|
73
71
|
const $xeTable = this.$xeTable
|
|
@@ -599,10 +599,8 @@ function downloadFile ($xetable: any, opts: any, content: any) {
|
|
|
599
599
|
saveLocalFile({ filename, type, content }).then(() => {
|
|
600
600
|
if (opts.message !== false) {
|
|
601
601
|
// 检测弹窗模块
|
|
602
|
-
if (
|
|
603
|
-
|
|
604
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
605
|
-
}
|
|
602
|
+
if (!VxeUI.modal) {
|
|
603
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
606
604
|
}
|
|
607
605
|
VxeUI.modal.message({ content: getI18n('vxe.table.expSuccess'), status: 'success' })
|
|
608
606
|
}
|
|
@@ -865,10 +863,8 @@ function handleImport ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, c
|
|
|
865
863
|
}
|
|
866
864
|
if (opts.message !== false) {
|
|
867
865
|
// 检测弹窗模块
|
|
868
|
-
if (
|
|
869
|
-
|
|
870
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
871
|
-
}
|
|
866
|
+
if (!VxeUI.modal) {
|
|
867
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
872
868
|
}
|
|
873
869
|
VxeUI.modal.message({ content: getI18n('vxe.table.impSuccess', [rows.length]), status: 'success' })
|
|
874
870
|
}
|
|
@@ -880,10 +876,8 @@ function handleImport ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, c
|
|
|
880
876
|
})
|
|
881
877
|
} else if (opts.message !== false) {
|
|
882
878
|
// 检测弹窗模块
|
|
883
|
-
if (
|
|
884
|
-
|
|
885
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
886
|
-
}
|
|
879
|
+
if (!VxeUI.modal) {
|
|
880
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
887
881
|
}
|
|
888
882
|
VxeUI.modal.message({ content: getI18n('vxe.error.impFields'), status: 'error' })
|
|
889
883
|
if (_importReject) {
|
|
@@ -901,10 +895,8 @@ function handleFileImport ($xetable: any, file: any, opts: any) {
|
|
|
901
895
|
if (!importMethod && !XEUtils.includes(XEUtils.keys(importOpts._typeMaps), type)) {
|
|
902
896
|
if (opts.message !== false) {
|
|
903
897
|
// 检测弹窗模块
|
|
904
|
-
if (
|
|
905
|
-
|
|
906
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
907
|
-
}
|
|
898
|
+
if (!VxeUI.modal) {
|
|
899
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
908
900
|
}
|
|
909
901
|
VxeUI.modal.message({ content: getI18n('vxe.error.notType', [type]), status: 'error' })
|
|
910
902
|
}
|
|
@@ -952,9 +944,7 @@ function handleFileImport ($xetable: any, file: any, opts: any) {
|
|
|
952
944
|
}
|
|
953
945
|
} else {
|
|
954
946
|
// 不支持的浏览器
|
|
955
|
-
|
|
956
|
-
errLog('vxe.error.notExp')
|
|
957
|
-
}
|
|
947
|
+
errLog('vxe.error.notExp')
|
|
958
948
|
_importResolve({ status: true })
|
|
959
949
|
}
|
|
960
950
|
})
|
|
@@ -1016,10 +1006,8 @@ export function readLocalFile (options: any = {}) {
|
|
|
1016
1006
|
} else {
|
|
1017
1007
|
if (options.message !== false) {
|
|
1018
1008
|
// 检测弹窗模块
|
|
1019
|
-
if (
|
|
1020
|
-
|
|
1021
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
1022
|
-
}
|
|
1009
|
+
if (!VxeUI.modal) {
|
|
1010
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
1023
1011
|
}
|
|
1024
1012
|
VxeUI.modal.message({ content: getI18n('vxe.error.notType', [errType]), status: 'error' })
|
|
1025
1013
|
}
|
|
@@ -1688,20 +1676,16 @@ export default {
|
|
|
1688
1676
|
_closeExport: handleCloseExport,
|
|
1689
1677
|
_openExport (options: any) {
|
|
1690
1678
|
const { exportOpts } = this
|
|
1691
|
-
if (
|
|
1692
|
-
|
|
1693
|
-
errLog('vxe.error.reqProp', ['export-config'])
|
|
1694
|
-
}
|
|
1679
|
+
if (!this.exportConfig) {
|
|
1680
|
+
errLog('vxe.error.reqProp', ['export-config'])
|
|
1695
1681
|
}
|
|
1696
1682
|
return handleExportAndPrint(this, Object.assign({}, exportOpts, options))
|
|
1697
1683
|
},
|
|
1698
1684
|
_closePrint: handleCloseExport,
|
|
1699
1685
|
_openPrint (options: any) {
|
|
1700
1686
|
const { printOpts } = this
|
|
1701
|
-
if (
|
|
1702
|
-
|
|
1703
|
-
errLog('vxe.error.reqProp', ['print-config'])
|
|
1704
|
-
}
|
|
1687
|
+
if (!this.printConfig) {
|
|
1688
|
+
errLog('vxe.error.reqProp', ['print-config'])
|
|
1705
1689
|
}
|
|
1706
1690
|
return handleExportAndPrint(this, Object.assign({}, printOpts, options), true)
|
|
1707
1691
|
}
|
|
@@ -2,6 +2,8 @@ import XEUtils from 'xe-utils'
|
|
|
2
2
|
import { getRefElem } from '../../src/util'
|
|
3
3
|
import { browse, hasClass, getAbsolutePos, addClass, removeClass } from '../../../ui/src/dom'
|
|
4
4
|
|
|
5
|
+
import type { VxeTableConstructor, VxeTablePrivateMethods } from '../../../../types'
|
|
6
|
+
|
|
5
7
|
function getTargetOffset (target: any, container: any) {
|
|
6
8
|
let offsetTop = 0
|
|
7
9
|
let offsetLeft = 0
|
|
@@ -217,9 +219,11 @@ export default {
|
|
|
217
219
|
})
|
|
218
220
|
},
|
|
219
221
|
handleCellMousedownEvent (evnt: any, params: any) {
|
|
222
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
223
|
+
|
|
220
224
|
const { editConfig, editOpts, handleSelected, checkboxConfig, checkboxOpts, mouseConfig, mouseOpts } = this
|
|
221
|
-
if (mouseConfig && mouseOpts.area &&
|
|
222
|
-
return
|
|
225
|
+
if (mouseConfig && mouseOpts.area && ($xeTable as any).handleMousedownCellAreaEvent) {
|
|
226
|
+
return ($xeTable as any).handleMousedownCellAreaEvent(evnt, params)
|
|
223
227
|
} else {
|
|
224
228
|
if (checkboxConfig && checkboxOpts.range) {
|
|
225
229
|
this.handleCheckboxRangeEvent(evnt, params)
|
|
@@ -356,9 +356,7 @@ export default {
|
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
358
|
} else {
|
|
359
|
-
|
|
360
|
-
errLog('vxe.error.notValidators', [validator])
|
|
361
|
-
}
|
|
359
|
+
errLog('vxe.error.notValidators', [validator])
|
|
362
360
|
}
|
|
363
361
|
} else {
|
|
364
362
|
customValid = validator(validParams)
|
|
@@ -184,10 +184,8 @@ function getComponentOns (renderOpts: any, params: any, eFns?: {
|
|
|
184
184
|
const ons: any = {}
|
|
185
185
|
XEUtils.objectEach(events, (func, key: any) => {
|
|
186
186
|
ons[getOnName(key)] = function (...args: any[]) {
|
|
187
|
-
if (
|
|
188
|
-
|
|
189
|
-
errLog('vxe.error.errFunc', [func])
|
|
190
|
-
}
|
|
187
|
+
if (!XEUtils.isFunction(func)) {
|
|
188
|
+
errLog('vxe.error.errFunc', [func])
|
|
191
189
|
}
|
|
192
190
|
func(params, ...args)
|
|
193
191
|
}
|
|
@@ -91,7 +91,7 @@ function renderTdColumn (
|
|
|
91
91
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
92
92
|
|
|
93
93
|
const { fullAllDataRowIdData } = tableInternalData
|
|
94
|
-
const { columnKey, resizable: allResizable, border, height, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps
|
|
94
|
+
const { columnKey, resizable: allResizable, showOverflow: allShowOverflow, border, height, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps
|
|
95
95
|
const { tableData, dragRow, overflowX, currentColumn, scrollXLoad, scrollYLoad, calcCellHeightFlag, resizeHeightFlag, mergeList, editStore, isAllOverflow, validErrorMaps } = tableReactData
|
|
96
96
|
const { afterFullData, scrollXStore, scrollYStore } = tableInternalData
|
|
97
97
|
const cellOpts = $xeTable.computeCellOpts
|
|
@@ -125,7 +125,7 @@ function renderTdColumn (
|
|
|
125
125
|
const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0
|
|
126
126
|
let fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX
|
|
127
127
|
const isCellPadding = XEUtils.eqNull(padding) ? (allPadding === null ? cellOpts.padding : allPadding) : padding
|
|
128
|
-
const cellOverflow = XEUtils.eqNull(showOverflow) ?
|
|
128
|
+
const cellOverflow = XEUtils.eqNull(showOverflow) ? allShowOverflow : showOverflow
|
|
129
129
|
const showEllipsis = cellOverflow === 'ellipsis'
|
|
130
130
|
const showTitle = cellOverflow === 'title'
|
|
131
131
|
const showTooltip = cellOverflow === true || cellOverflow === 'tooltip'
|