vxe-table 3.14.0-beta.0 → 3.14.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/grid/src/grid.js +60 -75
- package/es/style.css +1 -1
- package/es/table/module/custom/panel.js +25 -27
- package/es/table/module/edit/mixin.js +1 -1
- 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/column.js +2 -2
- package/es/table/src/columnInfo.js +30 -32
- package/es/table/src/group.js +2 -2
- package/es/table/src/methods.js +128 -97
- package/es/table/src/table.js +17 -19
- package/es/table/src/util.js +5 -7
- package/es/toolbar/src/toolbar.js +20 -28
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +61 -88
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +372 -380
- 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 +1 -1
- 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/keyboard/mixin.min.js +1 -1
- 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/column.js +3 -2
- package/lib/table/src/columnInfo.js +32 -34
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/group.js +3 -2
- package/lib/table/src/methods.js +138 -94
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +14 -16
- 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 +21 -28
- 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 +62 -75
- package/packages/table/module/custom/panel.ts +25 -27
- package/packages/table/module/edit/mixin.ts +1 -1
- 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/column.ts +2 -2
- package/packages/table/src/columnInfo.ts +30 -32
- package/packages/table/src/group.ts +2 -2
- package/packages/table/src/methods.ts +140 -104
- package/packages/table/src/table.ts +14 -16
- package/packages/table/src/util.ts +4 -6
- package/packages/toolbar/src/toolbar.ts +20 -28
- /package/es/{iconfont.1740732119954.ttf → iconfont.1741079977180.ttf} +0 -0
- /package/es/{iconfont.1740732119954.woff → iconfont.1741079977180.woff} +0 -0
- /package/es/{iconfont.1740732119954.woff2 → iconfont.1741079977180.woff2} +0 -0
- /package/lib/{iconfont.1740732119954.ttf → iconfont.1741079977180.ttf} +0 -0
- /package/lib/{iconfont.1740732119954.woff → iconfont.1741079977180.woff} +0 -0
- /package/lib/{iconfont.1740732119954.woff2 → iconfont.1741079977180.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)
|
|
@@ -594,24 +592,22 @@ export default {
|
|
|
594
592
|
// }
|
|
595
593
|
}
|
|
596
594
|
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
const VxeUIPagerComponent = VxeUI.getComponent<VxePagerComponent>('VxePager')
|
|
595
|
+
// 使用已安装的组件,如果未安装则不渲染
|
|
596
|
+
const VxeUIFormComponent = VxeUI.getComponent<VxeFormComponent>('VxeForm')
|
|
597
|
+
const VxeUIPagerComponent = VxeUI.getComponent<VxePagerComponent>('VxePager')
|
|
601
598
|
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
}
|
|
599
|
+
$xeGrid.$nextTick(() => {
|
|
600
|
+
if (props.formConfig) {
|
|
601
|
+
if (!VxeUIFormComponent) {
|
|
602
|
+
errLog('vxe.error.reqComp', ['vxe-form'])
|
|
607
603
|
}
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
604
|
+
}
|
|
605
|
+
if (props.pagerConfig) {
|
|
606
|
+
if (!VxeUIPagerComponent) {
|
|
607
|
+
errLog('vxe.error.reqComp', ['vxe-pager'])
|
|
612
608
|
}
|
|
613
|
-
}
|
|
614
|
-
}
|
|
609
|
+
}
|
|
610
|
+
})
|
|
615
611
|
|
|
616
612
|
this.initPages()
|
|
617
613
|
globalEvents.on(this, 'keydown', this.handleGlobalKeydownEvent)
|
|
@@ -634,6 +630,7 @@ export default {
|
|
|
634
630
|
const vSize = $xeGrid.computeSize
|
|
635
631
|
const styles = $xeGrid.computeStyles
|
|
636
632
|
return h('div', {
|
|
633
|
+
ref: 'refElem',
|
|
637
634
|
class: ['vxe-grid', {
|
|
638
635
|
[`size--${vSize}`]: vSize,
|
|
639
636
|
'is--animat': !!this.animat,
|
|
@@ -658,18 +655,32 @@ export default {
|
|
|
658
655
|
}
|
|
659
656
|
return []
|
|
660
657
|
},
|
|
661
|
-
getParentHeight () {
|
|
662
|
-
const { $el, isZMax } = this
|
|
663
|
-
return (isZMax ? getDomNode().visibleHeight : XEUtils.toNumber(getComputedStyle($el.parentNode).height)) - this.getExcludeHeight()
|
|
664
|
-
},
|
|
665
658
|
/**
|
|
666
659
|
* 获取需要排除的高度
|
|
667
660
|
*/
|
|
668
661
|
getExcludeHeight () {
|
|
669
|
-
const
|
|
670
|
-
const
|
|
671
|
-
|
|
672
|
-
|
|
662
|
+
const $xeGrid = this
|
|
663
|
+
const reactData = $xeGrid as GridReactData
|
|
664
|
+
|
|
665
|
+
const { isZMax } = reactData
|
|
666
|
+
const el = $xeGrid.$refs.refElem as HTMLDivElement
|
|
667
|
+
const formWrapper = $xeGrid.$refs.refFormWrapper as HTMLDivElement
|
|
668
|
+
const toolbarWrapper = $xeGrid.$refs.refToolbarWrapper as HTMLDivElement
|
|
669
|
+
const topWrapper = $xeGrid.$refs.refTopWrapper as HTMLDivElement
|
|
670
|
+
const bottomWrapper = $xeGrid.$refs.refBottomWrapper as HTMLDivElement
|
|
671
|
+
const pagerWrapper = $xeGrid.$refs.refPagerWrapper as HTMLDivElement
|
|
672
|
+
const parentPaddingSize = isZMax ? 0 : getPaddingTopBottomSize(el.parentNode as HTMLElement)
|
|
673
|
+
return parentPaddingSize + getPaddingTopBottomSize(el) + getOffsetHeight(formWrapper) + getOffsetHeight(toolbarWrapper) + getOffsetHeight(topWrapper) + getOffsetHeight(bottomWrapper) + getOffsetHeight(pagerWrapper)
|
|
674
|
+
},
|
|
675
|
+
getParentHeight () {
|
|
676
|
+
const $xeGrid = this
|
|
677
|
+
const reactData = $xeGrid as GridReactData
|
|
678
|
+
|
|
679
|
+
const el = $xeGrid.$refs.refElem as HTMLDivElement
|
|
680
|
+
if (el) {
|
|
681
|
+
return (reactData.isZMax ? getDomNode().visibleHeight : XEUtils.toNumber(getComputedStyle(el.parentNode as HTMLElement).height)) - $xeGrid.getExcludeHeight()
|
|
682
|
+
}
|
|
683
|
+
return 0
|
|
673
684
|
},
|
|
674
685
|
initToolbar () {
|
|
675
686
|
this.$nextTick(() => {
|
|
@@ -893,9 +904,7 @@ export default {
|
|
|
893
904
|
return { status: false }
|
|
894
905
|
})
|
|
895
906
|
} else {
|
|
896
|
-
|
|
897
|
-
errLog('vxe.error.notFunc', ['proxy-config.ajax.query'])
|
|
898
|
-
}
|
|
907
|
+
errLog('vxe.error.notFunc', ['proxy-config.ajax.query'])
|
|
899
908
|
}
|
|
900
909
|
break
|
|
901
910
|
}
|
|
@@ -921,10 +930,8 @@ export default {
|
|
|
921
930
|
$xeTable.setPendingRow(removeRecords, false)
|
|
922
931
|
if (isRespMsg) {
|
|
923
932
|
// 检测弹窗模块
|
|
924
|
-
if (
|
|
925
|
-
|
|
926
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
927
|
-
}
|
|
933
|
+
if (!VxeUI.modal) {
|
|
934
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
928
935
|
}
|
|
929
936
|
VxeUI.modal.message({ content: this.getRespMsg(rest, 'vxe.grid.delSuccess'), status: 'success' })
|
|
930
937
|
}
|
|
@@ -942,10 +949,8 @@ export default {
|
|
|
942
949
|
this.tableLoading = false
|
|
943
950
|
if (isRespMsg) {
|
|
944
951
|
// 检测弹窗模块
|
|
945
|
-
if (
|
|
946
|
-
|
|
947
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
948
|
-
}
|
|
952
|
+
if (!VxeUI.modal) {
|
|
953
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
949
954
|
}
|
|
950
955
|
VxeUI.modal.message({ id: code, content: this.getRespMsg(rest, 'vxe.grid.operError'), status: 'error' })
|
|
951
956
|
}
|
|
@@ -958,18 +963,14 @@ export default {
|
|
|
958
963
|
} else {
|
|
959
964
|
if (isActiveMsg) {
|
|
960
965
|
// 检测弹窗模块
|
|
961
|
-
if (
|
|
962
|
-
|
|
963
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
964
|
-
}
|
|
966
|
+
if (!VxeUI.modal) {
|
|
967
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
965
968
|
}
|
|
966
969
|
VxeUI.modal.message({ id: code, content: getI18n('vxe.grid.selectOneRecord'), status: 'warning' })
|
|
967
970
|
}
|
|
968
971
|
}
|
|
969
972
|
} else {
|
|
970
|
-
|
|
971
|
-
errLog('vxe.error.notFunc', ['proxy-config.ajax.delete'])
|
|
972
|
-
}
|
|
973
|
+
errLog('vxe.error.notFunc', ['proxy-config.ajax.delete'])
|
|
973
974
|
}
|
|
974
975
|
break
|
|
975
976
|
}
|
|
@@ -1008,10 +1009,8 @@ export default {
|
|
|
1008
1009
|
$xeTable.clearPendingRow()
|
|
1009
1010
|
if (isRespMsg) {
|
|
1010
1011
|
// 检测弹窗模块
|
|
1011
|
-
if (
|
|
1012
|
-
|
|
1013
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
1014
|
-
}
|
|
1012
|
+
if (!VxeUI.modal) {
|
|
1013
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
1015
1014
|
}
|
|
1016
1015
|
VxeUI.modal.message({ content: this.getRespMsg(rest, 'vxe.grid.saveSuccess'), status: 'success' })
|
|
1017
1016
|
}
|
|
@@ -1029,10 +1028,8 @@ export default {
|
|
|
1029
1028
|
this.tableLoading = false
|
|
1030
1029
|
if (isRespMsg) {
|
|
1031
1030
|
// 检测弹窗模块
|
|
1032
|
-
if (
|
|
1033
|
-
|
|
1034
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
1035
|
-
}
|
|
1031
|
+
if (!VxeUI.modal) {
|
|
1032
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
1036
1033
|
}
|
|
1037
1034
|
VxeUI.modal.message({ id: code, content: this.getRespMsg(rest, 'vxe.grid.operError'), status: 'error' })
|
|
1038
1035
|
}
|
|
@@ -1044,19 +1041,15 @@ export default {
|
|
|
1044
1041
|
} else {
|
|
1045
1042
|
if (isActiveMsg) {
|
|
1046
1043
|
// 检测弹窗模块
|
|
1047
|
-
if (
|
|
1048
|
-
|
|
1049
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
1050
|
-
}
|
|
1044
|
+
if (!VxeUI.modal) {
|
|
1045
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
1051
1046
|
}
|
|
1052
1047
|
VxeUI.modal.message({ id: code, content: getI18n('vxe.grid.dataUnchanged'), status: 'info' })
|
|
1053
1048
|
}
|
|
1054
1049
|
}
|
|
1055
1050
|
})
|
|
1056
1051
|
} else {
|
|
1057
|
-
|
|
1058
|
-
errLog('vxe.error.notFunc', ['proxy-config.ajax.save'])
|
|
1059
|
-
}
|
|
1052
|
+
errLog('vxe.error.notFunc', ['proxy-config.ajax.save'])
|
|
1060
1053
|
}
|
|
1061
1054
|
break
|
|
1062
1055
|
}
|
|
@@ -1066,9 +1059,7 @@ export default {
|
|
|
1066
1059
|
if (gCommandOpts.commandMethod) {
|
|
1067
1060
|
gCommandOpts.commandMethod({ code, button, $grid: this, $table: $xeTable }, ...args)
|
|
1068
1061
|
} else {
|
|
1069
|
-
|
|
1070
|
-
errLog('vxe.error.notCommands', [code])
|
|
1071
|
-
}
|
|
1062
|
+
errLog('vxe.error.notCommands', [code])
|
|
1072
1063
|
}
|
|
1073
1064
|
}
|
|
1074
1065
|
}
|
|
@@ -1095,10 +1086,8 @@ export default {
|
|
|
1095
1086
|
})
|
|
1096
1087
|
} else {
|
|
1097
1088
|
// 检测弹窗模块
|
|
1098
|
-
if (
|
|
1099
|
-
|
|
1100
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
1101
|
-
}
|
|
1089
|
+
if (!VxeUI.modal) {
|
|
1090
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
1102
1091
|
}
|
|
1103
1092
|
VxeUI.modal.message({ id: `msg_${code}`, content: getI18n('vxe.grid.selectOneRecord'), status: 'warning' })
|
|
1104
1093
|
}
|
|
@@ -1146,10 +1135,8 @@ export default {
|
|
|
1146
1135
|
} else {
|
|
1147
1136
|
if (isActiveMsg) {
|
|
1148
1137
|
// 检测弹窗模块
|
|
1149
|
-
if (
|
|
1150
|
-
|
|
1151
|
-
errLog('vxe.error.reqModule', ['Modal'])
|
|
1152
|
-
}
|
|
1138
|
+
if (!VxeUI.modal) {
|
|
1139
|
+
errLog('vxe.error.reqModule', ['Modal'])
|
|
1153
1140
|
}
|
|
1154
1141
|
VxeUI.modal.message({ id: code, content: getI18n('vxe.grid.selectOneRecord'), status: 'warning' })
|
|
1155
1142
|
}
|
|
@@ -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
|
|
@@ -278,7 +278,7 @@ function handleInsertChildRowAt ($xeTable: VxeTableConstructor, records: any, pa
|
|
|
278
278
|
}
|
|
279
279
|
return handleInsertRowAt($xeTable, records.map((item: any) => Object.assign({}, item, { [parentField]: parentRow[rowField] })), targetRow, isInsertNextRow)
|
|
280
280
|
} else {
|
|
281
|
-
errLog('vxe.error.errProp', ['tree-config.
|
|
281
|
+
errLog('vxe.error.errProp', ['tree-config.transform=false', 'tree-config.transform=true'])
|
|
282
282
|
}
|
|
283
283
|
return Promise.resolve({ row: null, rows: [] })
|
|
284
284
|
}
|
|
@@ -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.handleCellAreaMousedownEvent) {
|
|
226
|
+
return $xeTable.handleCellAreaMousedownEvent(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'
|
|
@@ -148,7 +148,7 @@ Object.keys(columnProps).forEach(name => {
|
|
|
148
148
|
}
|
|
149
149
|
})
|
|
150
150
|
|
|
151
|
-
export default defineVxeComponent({
|
|
151
|
+
export default /* define-vxe-component start */ defineVxeComponent({
|
|
152
152
|
name: 'VxeColumn',
|
|
153
153
|
props: columnProps,
|
|
154
154
|
provide () {
|
|
@@ -180,4 +180,4 @@ export default defineVxeComponent({
|
|
|
180
180
|
return h('div', this.$slots.default)
|
|
181
181
|
},
|
|
182
182
|
methods: Cell
|
|
183
|
-
})
|
|
183
|
+
}) /* define-vxe-component end */
|