vxe-table 4.15.8 → 4.16.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.
Files changed (206) hide show
  1. package/es/grid/src/grid.js +5 -3
  2. package/es/index.css +1 -1
  3. package/es/index.min.css +1 -1
  4. package/es/locale/lang/ar-EG.js +3 -1
  5. package/es/locale/lang/de-DE.js +3 -1
  6. package/es/locale/lang/en-US.js +3 -1
  7. package/es/locale/lang/es-ES.js +3 -1
  8. package/es/locale/lang/fr-FR.js +3 -1
  9. package/es/locale/lang/hu-HU.js +3 -1
  10. package/es/locale/lang/hy-AM.js +3 -1
  11. package/es/locale/lang/id-ID.js +3 -1
  12. package/es/locale/lang/it-IT.js +3 -1
  13. package/es/locale/lang/ja-JP.js +3 -1
  14. package/es/locale/lang/ko-KR.js +3 -1
  15. package/es/locale/lang/ms-MY.js +3 -1
  16. package/es/locale/lang/nb-NO.js +3 -1
  17. package/es/locale/lang/pt-BR.js +3 -1
  18. package/es/locale/lang/ru-RU.js +3 -1
  19. package/es/locale/lang/th-TH.js +3 -1
  20. package/es/locale/lang/ug-CN.js +3 -1
  21. package/es/locale/lang/uk-UA.js +3 -1
  22. package/es/locale/lang/uz-UZ.js +3 -1
  23. package/es/locale/lang/vi-VN.js +3 -1
  24. package/es/locale/lang/zh-CHT.js +3 -1
  25. package/es/locale/lang/zh-CN.js +3 -1
  26. package/es/style.css +1 -1
  27. package/es/style.min.css +1 -1
  28. package/es/table/module/custom/hook.js +2 -1
  29. package/es/table/module/custom/panel.js +4 -0
  30. package/es/table/module/edit/hook.js +3 -2
  31. package/es/table/module/export/export-panel.js +3 -0
  32. package/es/table/module/export/hook.js +45 -24
  33. package/es/table/module/export/import-panel.js +3 -0
  34. package/es/table/module/menu/hook.js +2 -1
  35. package/es/table/module/validator/hook.js +3 -1
  36. package/es/table/src/body.js +7 -2
  37. package/es/table/src/column.js +1 -0
  38. package/es/table/src/columnInfo.js +5 -3
  39. package/es/table/src/footer.js +2 -0
  40. package/es/table/src/group.js +1 -0
  41. package/es/table/src/header.js +2 -0
  42. package/es/table/src/table.js +49 -24
  43. package/es/table/style.css +3 -3
  44. package/es/table/style.min.css +1 -1
  45. package/es/ui/index.js +1 -1
  46. package/es/ui/src/log.js +1 -1
  47. package/es/vxe-table/style.css +3 -3
  48. package/es/vxe-table/style.min.css +1 -1
  49. package/lib/grid/src/grid.js +5 -3
  50. package/lib/grid/src/grid.min.js +1 -1
  51. package/lib/index.css +1 -1
  52. package/lib/index.min.css +1 -1
  53. package/lib/index.umd.js +125 -54
  54. package/lib/index.umd.min.js +1 -1
  55. package/lib/locale/lang/ar-EG.js +3 -1
  56. package/lib/locale/lang/ar-EG.min.js +1 -1
  57. package/lib/locale/lang/ar-EG.umd.js +3 -1
  58. package/lib/locale/lang/de-DE.js +3 -1
  59. package/lib/locale/lang/de-DE.min.js +1 -1
  60. package/lib/locale/lang/de-DE.umd.js +3 -1
  61. package/lib/locale/lang/en-US.js +3 -1
  62. package/lib/locale/lang/en-US.min.js +1 -1
  63. package/lib/locale/lang/en-US.umd.js +3 -1
  64. package/lib/locale/lang/es-ES.js +3 -1
  65. package/lib/locale/lang/es-ES.min.js +1 -1
  66. package/lib/locale/lang/es-ES.umd.js +3 -1
  67. package/lib/locale/lang/fr-FR.js +3 -1
  68. package/lib/locale/lang/fr-FR.min.js +1 -1
  69. package/lib/locale/lang/fr-FR.umd.js +3 -1
  70. package/lib/locale/lang/hu-HU.js +3 -1
  71. package/lib/locale/lang/hu-HU.min.js +1 -1
  72. package/lib/locale/lang/hu-HU.umd.js +3 -1
  73. package/lib/locale/lang/hy-AM.js +3 -1
  74. package/lib/locale/lang/hy-AM.min.js +1 -1
  75. package/lib/locale/lang/hy-AM.umd.js +3 -1
  76. package/lib/locale/lang/id-ID.js +3 -1
  77. package/lib/locale/lang/id-ID.min.js +1 -1
  78. package/lib/locale/lang/id-ID.umd.js +3 -1
  79. package/lib/locale/lang/it-IT.js +3 -1
  80. package/lib/locale/lang/it-IT.min.js +1 -1
  81. package/lib/locale/lang/it-IT.umd.js +3 -1
  82. package/lib/locale/lang/ja-JP.js +3 -1
  83. package/lib/locale/lang/ja-JP.min.js +1 -1
  84. package/lib/locale/lang/ja-JP.umd.js +3 -1
  85. package/lib/locale/lang/ko-KR.js +3 -1
  86. package/lib/locale/lang/ko-KR.min.js +1 -1
  87. package/lib/locale/lang/ko-KR.umd.js +3 -1
  88. package/lib/locale/lang/ms-MY.js +3 -1
  89. package/lib/locale/lang/ms-MY.min.js +1 -1
  90. package/lib/locale/lang/ms-MY.umd.js +3 -1
  91. package/lib/locale/lang/nb-NO.js +3 -1
  92. package/lib/locale/lang/nb-NO.min.js +1 -1
  93. package/lib/locale/lang/nb-NO.umd.js +3 -1
  94. package/lib/locale/lang/pt-BR.js +3 -1
  95. package/lib/locale/lang/pt-BR.min.js +1 -1
  96. package/lib/locale/lang/pt-BR.umd.js +3 -1
  97. package/lib/locale/lang/ru-RU.js +3 -1
  98. package/lib/locale/lang/ru-RU.min.js +1 -1
  99. package/lib/locale/lang/ru-RU.umd.js +3 -1
  100. package/lib/locale/lang/th-TH.js +3 -1
  101. package/lib/locale/lang/th-TH.min.js +1 -1
  102. package/lib/locale/lang/th-TH.umd.js +3 -1
  103. package/lib/locale/lang/ug-CN.js +3 -1
  104. package/lib/locale/lang/ug-CN.min.js +1 -1
  105. package/lib/locale/lang/ug-CN.umd.js +3 -1
  106. package/lib/locale/lang/uk-UA.js +3 -1
  107. package/lib/locale/lang/uk-UA.min.js +1 -1
  108. package/lib/locale/lang/uk-UA.umd.js +3 -1
  109. package/lib/locale/lang/uz-UZ.js +3 -1
  110. package/lib/locale/lang/uz-UZ.min.js +1 -1
  111. package/lib/locale/lang/uz-UZ.umd.js +3 -1
  112. package/lib/locale/lang/vi-VN.js +3 -1
  113. package/lib/locale/lang/vi-VN.min.js +1 -1
  114. package/lib/locale/lang/vi-VN.umd.js +3 -1
  115. package/lib/locale/lang/zh-CHT.js +3 -1
  116. package/lib/locale/lang/zh-CHT.min.js +1 -1
  117. package/lib/locale/lang/zh-CHT.umd.js +3 -1
  118. package/lib/locale/lang/zh-CN.js +3 -1
  119. package/lib/locale/lang/zh-CN.min.js +1 -1
  120. package/lib/locale/lang/zh-CN.umd.js +3 -1
  121. package/lib/style.css +1 -1
  122. package/lib/style.min.css +1 -1
  123. package/lib/table/module/custom/hook.js +2 -1
  124. package/lib/table/module/custom/hook.min.js +1 -1
  125. package/lib/table/module/custom/panel.js +4 -0
  126. package/lib/table/module/custom/panel.min.js +1 -1
  127. package/lib/table/module/edit/hook.js +5 -2
  128. package/lib/table/module/edit/hook.min.js +1 -1
  129. package/lib/table/module/export/export-panel.js +3 -0
  130. package/lib/table/module/export/export-panel.min.js +1 -1
  131. package/lib/table/module/export/hook.js +52 -19
  132. package/lib/table/module/export/hook.min.js +1 -1
  133. package/lib/table/module/export/import-panel.js +3 -0
  134. package/lib/table/module/export/import-panel.min.js +1 -1
  135. package/lib/table/module/menu/hook.js +2 -0
  136. package/lib/table/module/menu/hook.min.js +1 -1
  137. package/lib/table/module/validator/hook.js +3 -1
  138. package/lib/table/module/validator/hook.min.js +1 -1
  139. package/lib/table/src/body.js +8 -2
  140. package/lib/table/src/body.min.js +1 -1
  141. package/lib/table/src/column.js +1 -0
  142. package/lib/table/src/column.min.js +1 -1
  143. package/lib/table/src/columnInfo.js +6 -2
  144. package/lib/table/src/columnInfo.min.js +1 -1
  145. package/lib/table/src/footer.js +2 -0
  146. package/lib/table/src/footer.min.js +1 -1
  147. package/lib/table/src/group.js +1 -0
  148. package/lib/table/src/group.min.js +1 -1
  149. package/lib/table/src/header.js +2 -0
  150. package/lib/table/src/header.min.js +1 -1
  151. package/lib/table/src/table.js +21 -21
  152. package/lib/table/src/table.min.js +1 -1
  153. package/lib/table/style/style.css +3 -3
  154. package/lib/table/style/style.min.css +1 -1
  155. package/lib/ui/index.js +1 -1
  156. package/lib/ui/index.min.js +1 -1
  157. package/lib/ui/src/log.js +1 -1
  158. package/lib/ui/src/log.min.js +1 -1
  159. package/lib/vxe-table/style/style.css +3 -3
  160. package/lib/vxe-table/style/style.min.css +1 -1
  161. package/package.json +1 -1
  162. package/packages/grid/src/grid.ts +5 -3
  163. package/packages/locale/lang/ar-EG.ts +3 -1
  164. package/packages/locale/lang/de-DE.ts +3 -1
  165. package/packages/locale/lang/en-US.ts +3 -1
  166. package/packages/locale/lang/es-ES.ts +3 -1
  167. package/packages/locale/lang/fr-FR.ts +3 -1
  168. package/packages/locale/lang/hu-HU.ts +3 -1
  169. package/packages/locale/lang/hy-AM.ts +3 -1
  170. package/packages/locale/lang/id-ID.ts +3 -1
  171. package/packages/locale/lang/it-IT.ts +3 -1
  172. package/packages/locale/lang/ja-JP.ts +3 -1
  173. package/packages/locale/lang/ko-KR.ts +3 -1
  174. package/packages/locale/lang/ms-MY.ts +3 -1
  175. package/packages/locale/lang/nb-NO.ts +3 -1
  176. package/packages/locale/lang/pt-BR.ts +3 -1
  177. package/packages/locale/lang/ru-RU.ts +3 -1
  178. package/packages/locale/lang/th-TH.ts +3 -1
  179. package/packages/locale/lang/ug-CN.ts +3 -1
  180. package/packages/locale/lang/uk-UA.ts +3 -1
  181. package/packages/locale/lang/uz-UZ.ts +3 -1
  182. package/packages/locale/lang/vi-VN.ts +3 -1
  183. package/packages/locale/lang/zh-CHT.ts +3 -1
  184. package/packages/locale/lang/zh-CN.ts +3 -1
  185. package/packages/table/module/custom/hook.ts +2 -1
  186. package/packages/table/module/custom/panel.ts +4 -0
  187. package/packages/table/module/edit/hook.ts +3 -2
  188. package/packages/table/module/export/export-panel.ts +3 -0
  189. package/packages/table/module/export/hook.ts +52 -26
  190. package/packages/table/module/export/import-panel.ts +3 -0
  191. package/packages/table/module/menu/hook.ts +2 -1
  192. package/packages/table/module/validator/hook.ts +3 -1
  193. package/packages/table/src/body.ts +7 -2
  194. package/packages/table/src/column.ts +1 -0
  195. package/packages/table/src/columnInfo.ts +5 -3
  196. package/packages/table/src/footer.ts +2 -0
  197. package/packages/table/src/group.ts +1 -0
  198. package/packages/table/src/header.ts +2 -0
  199. package/packages/table/src/table.ts +50 -24
  200. package/styles/components/table.scss +7 -3
  201. /package/es/{iconfont.1755133696364.ttf → iconfont.1755232625112.ttf} +0 -0
  202. /package/es/{iconfont.1755133696364.woff → iconfont.1755232625112.woff} +0 -0
  203. /package/es/{iconfont.1755133696364.woff2 → iconfont.1755232625112.woff2} +0 -0
  204. /package/lib/{iconfont.1755133696364.ttf → iconfont.1755232625112.ttf} +0 -0
  205. /package/lib/{iconfont.1755133696364.woff → iconfont.1755232625112.woff} +0 -0
  206. /package/lib/{iconfont.1755133696364.woff2 → iconfont.1755232625112.woff2} +0 -0
@@ -1,4 +1,4 @@
1
- import { inject, nextTick } from 'vue'
1
+ import { nextTick } from 'vue'
2
2
  import XEUtils from 'xe-utils'
3
3
  import { VxeUI } from '../../../ui'
4
4
  import { isColumnInfo, getCellValue, createHandleGetRowId } from '../../src/util'
@@ -7,7 +7,7 @@ import { hasClass } from '../../../ui/src/dom'
7
7
  import { createHtmlPage, getExportBlobByContent } from './util'
8
8
  import { warnLog, errLog } from '../../../ui/src/log'
9
9
 
10
- import type { VxeGridConstructor, VxeTablePropTypes, VxeColumnPropTypes, TableExportMethods, VxeGridPropTypes, VxeTableDefines, VxeTableConstructor, VxeTablePrivateMethods } from '../../../../types'
10
+ import type { VxeTablePropTypes, VxeColumnPropTypes, TableExportMethods, VxeGridPropTypes, VxeTableDefines, VxeTableConstructor, VxeTablePrivateMethods } from '../../../../types'
11
11
 
12
12
  const { getI18n, hooks, renderer } = VxeUI
13
13
 
@@ -93,8 +93,11 @@ function getBooleanValue (cellValue: any) {
93
93
  }
94
94
 
95
95
  function getFooterData ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, opts: VxeTablePropTypes.ExportHandleOptions, footerTableData: any[]) {
96
+ const $xeGrid = $xeTable.xeGrid
97
+ const $xeGantt = $xeTable.xeGantt
98
+
96
99
  const { footerFilterMethod } = opts
97
- return footerFilterMethod ? footerTableData.filter((items, index) => footerFilterMethod({ $table: $xeTable, items, $rowIndex: index })) : footerTableData
100
+ return footerFilterMethod ? footerTableData.filter((items, index) => footerFilterMethod({ $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, items, $rowIndex: index })) : footerTableData
98
101
  }
99
102
 
100
103
  function getCsvCellTypeLabel (column: any, cellValue: any) {
@@ -301,9 +304,6 @@ hooks.add('tableExportModule', {
301
304
  const { props, reactData, internalData } = $xeTable
302
305
  const { computeTreeOpts, computePrintOpts, computeExportOpts, computeImportOpts, computeCustomOpts, computeSeqOpts, computeRadioOpts, computeCheckboxOpts, computeColumnOpts } = $xeTable.getComputeMaps()
303
306
 
304
- const $xeGrid = inject<VxeGridConstructor | null>('$xeGrid', null)
305
- const $xeGantt = inject('$xeGantt', null)
306
-
307
307
  const hasTreeChildren = (row: any) => {
308
308
  const treeOpts = computeTreeOpts.value
309
309
  const childrenField = treeOpts.children || treeOpts.childrenField
@@ -491,10 +491,13 @@ hooks.add('tableExportModule', {
491
491
  }
492
492
 
493
493
  const getExportData = (opts: VxeTablePropTypes.ExportHandleOptions) => {
494
+ const $xeGrid = $xeTable.xeGrid
495
+ const $xeGantt = $xeTable.xeGantt
496
+
494
497
  const { columns, dataFilterMethod } = opts
495
498
  let datas = opts.data
496
499
  if (dataFilterMethod) {
497
- datas = datas.filter((row, index) => dataFilterMethod({ $table: $xeTable, row, $rowIndex: index }))
500
+ datas = datas.filter((row, index) => dataFilterMethod({ $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, row, $rowIndex: index }))
498
501
  }
499
502
  return getBodyLabelData(opts, columns, datas)
500
503
  }
@@ -810,10 +813,13 @@ hooks.add('tableExportModule', {
810
813
  }
811
814
 
812
815
  const handleExport = (opts: VxeTablePropTypes.ExportHandleOptions) => {
816
+ const $xeGrid = $xeTable.xeGrid
817
+ const $xeGantt = $xeTable.xeGantt
818
+
813
819
  const { remote, columns, colgroups, exportMethod, afterExportMethod } = opts
814
820
  return new Promise(resolve => {
815
821
  if (remote) {
816
- const params = { options: opts, $table: $xeTable, $grid: $xeGrid }
822
+ const params = { options: opts, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt }
817
823
  resolve(exportMethod ? exportMethod(params) : params)
818
824
  } else {
819
825
  const datas = getExportData(opts)
@@ -827,7 +833,7 @@ hooks.add('tableExportModule', {
827
833
  clearColumnConvert(columns)
828
834
  if (!opts.print) {
829
835
  if (afterExportMethod) {
830
- afterExportMethod({ status: true, options: opts, $table: $xeTable, $grid: $xeGrid })
836
+ afterExportMethod({ status: true, options: opts, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt })
831
837
  }
832
838
  }
833
839
  return Object.assign({ status: true }, params)
@@ -835,7 +841,7 @@ hooks.add('tableExportModule', {
835
841
  clearColumnConvert(columns)
836
842
  if (!opts.print) {
837
843
  if (afterExportMethod) {
838
- afterExportMethod({ status: false, options: opts, $table: $xeTable, $grid: $xeGrid })
844
+ afterExportMethod({ status: false, options: opts, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt })
839
845
  }
840
846
  }
841
847
  const params = { status: false }
@@ -1027,6 +1033,10 @@ hooks.add('tableExportModule', {
1027
1033
  }
1028
1034
 
1029
1035
  const handleExportAndPrint = (options: VxeTablePropTypes.ExportOpts | VxeTablePropTypes.ExportConfig, isPrint?: boolean) => {
1036
+ const $xeGrid = $xeTable.xeGrid
1037
+ const $xeGantt = $xeTable.xeGantt
1038
+ const $xeGGWrapper = $xeGrid || $xeGantt
1039
+
1030
1040
  const { treeConfig, showHeader, showFooter } = props
1031
1041
  const { initStore, isGroup, footerTableData, exportStore, exportParams } = reactData
1032
1042
  const { collectColumn, mergeBodyList, mergeFooterList } = internalData
@@ -1034,7 +1044,7 @@ hooks.add('tableExportModule', {
1034
1044
  const hasTree = treeConfig
1035
1045
  const customOpts = computeCustomOpts.value
1036
1046
  const selectRecords = $xeTable.getCheckboxRecords()
1037
- const proxyOpts = $xeGrid ? $xeGrid.getComputeMaps().computeProxyOpts.value : {} as VxeGridPropTypes.ProxyOpts
1047
+ const proxyOpts = $xeGGWrapper ? $xeGGWrapper.getComputeMaps().computeProxyOpts.value : {} as VxeGridPropTypes.ProxyOpts
1038
1048
  const hasFooter = !!footerTableData.length
1039
1049
  const hasMerge = !!(mergeBodyList.length || mergeFooterList.length)
1040
1050
  const defOpts = Object.assign({
@@ -1109,7 +1119,8 @@ hooks.add('tableExportModule', {
1109
1119
  exportParams.filename = filename({
1110
1120
  options: defOpts,
1111
1121
  $table: $xeTable,
1112
- $grid: $xeGrid
1122
+ $grid: $xeGrid,
1123
+ $gantt: $xeGantt
1113
1124
  })
1114
1125
  } else {
1115
1126
  exportParams.filename = `${filename}`
@@ -1120,7 +1131,8 @@ hooks.add('tableExportModule', {
1120
1131
  exportParams.sheetName = sheetName({
1121
1132
  options: defOpts,
1122
1133
  $table: $xeTable,
1123
- $grid: $xeGrid
1134
+ $grid: $xeGrid,
1135
+ $gantt: $xeGantt
1124
1136
  })
1125
1137
  } else {
1126
1138
  exportParams.sheetName = `${sheetName}`
@@ -1151,12 +1163,16 @@ hooks.add('tableExportModule', {
1151
1163
  * @param {Object} options 参数
1152
1164
  */
1153
1165
  exportData (options) {
1166
+ const $xeGrid = $xeTable.xeGrid
1167
+ const $xeGantt = $xeTable.xeGantt
1168
+ const $xeGGWrapper = $xeGrid || $xeGantt
1169
+
1154
1170
  const { treeConfig, showHeader, showFooter } = props
1155
1171
  const { isGroup } = reactData
1156
1172
  const { tableFullColumn, afterFullData, afterTreeFullData, collectColumn, mergeBodyList, mergeFooterList } = internalData
1157
1173
  const exportOpts = computeExportOpts.value
1158
1174
  const treeOpts = computeTreeOpts.value
1159
- const proxyOpts = $xeGrid ? $xeGrid.getComputeMaps().computeProxyOpts.value : {} as VxeGridPropTypes.ProxyOpts
1175
+ const proxyOpts = $xeGGWrapper ? $xeGGWrapper.getComputeMaps().computeProxyOpts.value : {} as VxeGridPropTypes.ProxyOpts
1160
1176
  const hasMerge = !!(mergeBodyList.length || mergeFooterList.length)
1161
1177
  const opts = Object.assign({
1162
1178
  message: true,
@@ -1257,7 +1273,7 @@ hooks.add('tableExportModule', {
1257
1273
  children: 'childNodes',
1258
1274
  mapChildren: '_children'
1259
1275
  }),
1260
- (column, index) => isColumnInfo(column) && (!columnFilterMethod || columnFilterMethod({ $table: $xeTable, column: column as any, $columnIndex: index })),
1276
+ (column, index) => isColumnInfo(column) && (!columnFilterMethod || columnFilterMethod({ $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, column: column as any, $columnIndex: index })),
1261
1277
  {
1262
1278
  children: '_children',
1263
1279
  mapChildren: 'childNodes',
@@ -1265,7 +1281,7 @@ hooks.add('tableExportModule', {
1265
1281
  }
1266
1282
  )
1267
1283
  } else {
1268
- groups = XEUtils.searchTree(isGroup ? collectColumn : tableFullColumn, (column, index) => column.visible && (!columnFilterMethod || columnFilterMethod({ $table: $xeTable, column, $columnIndex: index })), { children: 'children', mapChildren: 'childNodes', original: true })
1284
+ groups = XEUtils.searchTree(isGroup ? collectColumn : tableFullColumn, (column, index) => column.visible && (!columnFilterMethod || columnFilterMethod({ $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, column, $columnIndex: index })), { children: 'children', mapChildren: 'childNodes', original: true })
1269
1285
  }
1270
1286
  // 获取所有列
1271
1287
  const cols: VxeTableDefines.ColumnInfo[] = []
@@ -1283,7 +1299,8 @@ hooks.add('tableExportModule', {
1283
1299
  handleOptions.filename = filename({
1284
1300
  options: opts,
1285
1301
  $table: $xeTable,
1286
- $grid: $xeGrid
1302
+ $grid: $xeGrid,
1303
+ $gantt: $xeGantt
1287
1304
  })
1288
1305
  } else {
1289
1306
  handleOptions.filename = `${filename}`
@@ -1298,7 +1315,8 @@ hooks.add('tableExportModule', {
1298
1315
  handleOptions.sheetName = sheetName({
1299
1316
  options: opts,
1300
1317
  $table: $xeTable,
1301
- $grid: $xeGrid
1318
+ $grid: $xeGrid,
1319
+ $gantt: $xeGantt
1302
1320
  })
1303
1321
  } else {
1304
1322
  handleOptions.sheetName = `${sheetName}`
@@ -1320,7 +1338,7 @@ hooks.add('tableExportModule', {
1320
1338
 
1321
1339
  if (!handleOptions.print) {
1322
1340
  if (beforeExportMethod) {
1323
- beforeExportMethod({ options: handleOptions, $table: $xeTable, $grid: $xeGrid })
1341
+ beforeExportMethod({ options: handleOptions, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt })
1324
1342
  }
1325
1343
  }
1326
1344
  if (!handleOptions.data) {
@@ -1332,13 +1350,13 @@ hooks.add('tableExportModule', {
1332
1350
  handleOptions.data = selectRecords
1333
1351
  }
1334
1352
  } else if (mode === 'all') {
1335
- if (!$xeGrid) {
1353
+ if (!$xeGGWrapper) {
1336
1354
  errLog('vxe.error.errProp', ['all', 'mode=current,selected'])
1337
1355
  }
1338
1356
 
1339
- if ($xeGrid && !handleOptions.remote) {
1340
- const gridReactData = $xeGrid.reactData
1341
- const { computeProxyOpts } = $xeGrid.getComputeMaps()
1357
+ if ($xeGGWrapper && !handleOptions.remote) {
1358
+ const gridReactData = $xeGGWrapper.reactData
1359
+ const { computeProxyOpts } = $xeGGWrapper.getComputeMaps()
1342
1360
  const proxyOpts = computeProxyOpts.value
1343
1361
  const { sortData } = gridReactData
1344
1362
  const { beforeQueryAll, afterQueryAll, ajax = {} } = proxyOpts
@@ -1425,6 +1443,9 @@ hooks.add('tableExportModule', {
1425
1443
  return VxeUI.readFile(options)
1426
1444
  },
1427
1445
  print (options) {
1446
+ const $xeGrid = $xeTable.xeGrid
1447
+ const $xeGantt = $xeTable.xeGantt
1448
+
1428
1449
  const printOpts = computePrintOpts.value
1429
1450
  const opts = Object.assign({
1430
1451
  original: false
@@ -1442,7 +1463,8 @@ hooks.add('tableExportModule', {
1442
1463
  printTitle = sheetName({
1443
1464
  options: opts,
1444
1465
  $table: $xeTable,
1445
- $grid: $xeGrid
1466
+ $grid: $xeGrid,
1467
+ $gantt: $xeGantt
1446
1468
  })
1447
1469
  } else {
1448
1470
  printTitle = `${sheetName}`
@@ -1468,7 +1490,9 @@ hooks.add('tableExportModule', {
1468
1490
  html,
1469
1491
  content: html,
1470
1492
  options: opts,
1471
- $table: $xeTable
1493
+ $table: $xeTable,
1494
+ $grid: $xeGrid,
1495
+ $gantt: $xeGantt
1472
1496
  })
1473
1497
  }
1474
1498
  : undefined
@@ -1487,7 +1511,9 @@ hooks.add('tableExportModule', {
1487
1511
  html,
1488
1512
  content: html,
1489
1513
  options: opts,
1490
- $table: $xeTable
1514
+ $table: $xeTable,
1515
+ $grid: $xeGrid,
1516
+ $gantt: $xeGantt
1491
1517
  })
1492
1518
  }
1493
1519
  : undefined
@@ -94,6 +94,7 @@ export default defineVxeComponent({
94
94
 
95
95
  const renderVN = () => {
96
96
  const $xeGrid = $xeTable.xeGrid
97
+ const $xeGantt = $xeTable.xeGantt
97
98
 
98
99
  const { defaultOptions, storeData } = props
99
100
  const selectName = computeSelectName.value
@@ -130,6 +131,7 @@ export default defineVxeComponent({
130
131
  const params = {
131
132
  $table: $xeTable,
132
133
  $grid: $xeGrid,
134
+ $gantt: $xeGantt,
133
135
  options: defaultOptions,
134
136
  params: defaultOptions.params as any
135
137
  }
@@ -207,6 +209,7 @@ export default defineVxeComponent({
207
209
  const params = {
208
210
  $table: $xeTable,
209
211
  $grid: $xeGrid,
212
+ $gantt: $xeGantt,
210
213
  options: defaultOptions,
211
214
  params: defaultOptions.params as any
212
215
  }
@@ -280,11 +280,12 @@ hooks.add('tableMenuModule', {
280
280
  */
281
281
  ctxMenuLinkEvent (evnt, menu) {
282
282
  const $xeGrid = $xeTable.xeGrid
283
+ const $xeGantt = $xeTable.xeGantt
283
284
 
284
285
  // 如果一级菜单有配置 code 则允许点击,否则不能点击
285
286
  if (!menu.disabled && (menu.code || !menu.children || !menu.children.length)) {
286
287
  const gMenuOpts = menus.get(menu.code)
287
- const params = Object.assign({}, internalData._currMenuParams, { menu, $table: $xeTable, $grid: $xeGrid, $event: evnt })
288
+ const params = Object.assign({}, internalData._currMenuParams, { menu, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, $event: evnt })
288
289
  const tmMethod = gMenuOpts ? (gMenuOpts.tableMenuMethod || gMenuOpts.menuMethod) : null
289
290
  if (tmMethod) {
290
291
  tmMethod(params, evnt)
@@ -463,6 +463,7 @@ hooks.add('tableValidatorModule', {
463
463
  */
464
464
  validCellRules (validType, row, column, val) {
465
465
  const $xeGrid = $xeTable.xeGrid
466
+ const $xeGantt = $xeTable.xeGantt
466
467
 
467
468
  const { editRules } = props
468
469
  const { field } = column
@@ -486,7 +487,8 @@ hooks.add('tableValidatorModule', {
486
487
  columnIndex: $xeTable.getColumnIndex(column),
487
488
  field: column.field,
488
489
  $table: $xeTable,
489
- $grid: $xeGrid
490
+ $grid: $xeGrid,
491
+ $gantt: $xeGantt
490
492
  }
491
493
  let customValid: any
492
494
  if (XEUtils.isString(validator)) {
@@ -102,6 +102,7 @@ export default defineVxeComponent({
102
102
  items: any[]
103
103
  ) => {
104
104
  const $xeGrid = $xeTable.xeGrid
105
+ const $xeGantt = $xeTable.xeGantt
105
106
 
106
107
  const { columnKey, resizable: allResizable, showOverflow: allShowOverflow, border, height, treeConfig, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps
107
108
  const { tableData, tableColumn, dragRow, overflowX, overflowY, currentColumn, scrollXLoad, scrollYLoad, mergeBodyFlag, calcCellHeightFlag, resizeHeightFlag, resizeWidthFlag, editStore, isAllOverflow, validErrorMaps } = tableReactData
@@ -162,6 +163,7 @@ export default defineVxeComponent({
162
163
  } = {
163
164
  $table: $xeTable,
164
165
  $grid: $xeGrid,
166
+ $gantt: $xeGantt,
165
167
  isEdit: false,
166
168
  seq,
167
169
  rowid,
@@ -469,6 +471,7 @@ export default defineVxeComponent({
469
471
 
470
472
  const renderRows = (fixedType: 'left' | 'right' | '', isOptimizeMode: boolean, tableData: any[], tableColumn: VxeTableDefines.ColumnInfo[]) => {
471
473
  const $xeGrid = $xeTable.xeGrid
474
+ const $xeGantt = $xeTable.xeGantt
472
475
 
473
476
  const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps
474
477
  const { hasFixedColumn, treeExpandedFlag, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedFlag, expandColumn, selectRadioRow, pendingRowFlag, rowExpandHeightFlag, isRowGroupStatus } = tableReactData
@@ -608,8 +611,9 @@ export default defineVxeComponent({
608
611
  _columnIndex = colRest._index
609
612
  }
610
613
  const expandParams: VxeTableDefines.CellRenderDataParams = {
611
- $grid: $xeGrid,
612
614
  $table: $xeTable,
615
+ $grid: $xeGrid,
616
+ $gantt: $xeGantt,
613
617
  seq,
614
618
  column: expandColumn as VxeTableDefines.ColumnInfo,
615
619
  columnIndex,
@@ -697,6 +701,7 @@ export default defineVxeComponent({
697
701
  const renderVN = () => {
698
702
  const { slots } = tableContext
699
703
  const $xeGrid = $xeTable.xeGrid
704
+ const $xeGantt = $xeTable.xeGantt
700
705
 
701
706
  const { fixedColumn, fixedType, tableColumn } = props
702
707
  const { spanMethod, footerSpanMethod, mouseConfig } = tableProps
@@ -778,7 +783,7 @@ export default defineVxeComponent({
778
783
 
779
784
  let emptyContent: string | VxeComponentSlotType | VxeComponentSlotType[]
780
785
  const emptySlot = slots ? slots.empty : null
781
- const emptyParams = { $table: $xeTable, $grid: $xeGrid }
786
+ const emptyParams = { $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt }
782
787
  if (emptySlot) {
783
788
  emptyContent = $xeTable.callSlot(emptySlot, emptyParams)
784
789
  } else {
@@ -171,6 +171,7 @@ export default defineVxeComponent({
171
171
 
172
172
  provide('$xeColumn', $xeColumn)
173
173
  provide('$xeGrid', null)
174
+ provide('$xeGantt', null)
174
175
 
175
176
  return renderVN
176
177
  }
@@ -12,6 +12,8 @@ export class ColumnInfo {
12
12
  constructor ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, _vm: any, { renderHeader, renderCell, renderFooter, renderData }: any = {}) {
13
13
  const tableProps = $xeTable.props
14
14
  const $xeGrid = $xeTable.xeGrid
15
+ const $xeGantt = $xeTable.xeGantt
16
+ const $xeGGWrapper = $xeGrid || $xeGantt
15
17
 
16
18
  const { field, editRender } = _vm
17
19
 
@@ -166,11 +168,11 @@ export class ColumnInfo {
166
168
  // 单元格插槽,只对 grid 有效
167
169
  slots: _vm.slots
168
170
  })
169
- if ($xeGrid) {
170
- const { computeProxyOpts } = $xeGrid.getComputeMaps()
171
+ if ($xeGGWrapper) {
172
+ const { computeProxyOpts } = $xeGGWrapper.getComputeMaps()
171
173
  const proxyOpts = computeProxyOpts.value
172
174
  if (proxyOpts.beforeColumn) {
173
- proxyOpts.beforeColumn({ $grid: $xeGrid, column: this })
175
+ proxyOpts.beforeColumn({ $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt, column: this })
174
176
  }
175
177
  }
176
178
  }
@@ -46,6 +46,7 @@ export default defineVxeComponent({
46
46
 
47
47
  const renderRows = (isOptimizeMode: boolean, tableColumn: VxeTableDefines.ColumnInfo[], footerTableData: any[], row: any, $rowIndex: number, _rowIndex: number) => {
48
48
  const $xeGrid = $xeTable.xeGrid
49
+ const $xeGantt = $xeTable.xeGantt
49
50
 
50
51
  const { fixedType } = props
51
52
  const { resizable: allResizable, border, footerCellClassName, footerCellStyle, footerAlign: allFooterAlign, footerSpanMethod, align: allAlign, columnKey, showFooterOverflow: allColumnFooterOverflow } = tableProps
@@ -87,6 +88,7 @@ export default defineVxeComponent({
87
88
  } = {
88
89
  $table: $xeTable,
89
90
  $grid: $xeGrid,
91
+ $gantt: $xeGantt,
90
92
  row,
91
93
  rowIndex: _rowIndex,
92
94
  _rowIndex,
@@ -51,6 +51,7 @@ export default defineVxeComponent({
51
51
 
52
52
  provide('$xeColgroup', $xeColgroup)
53
53
  provide('$xeGrid', null)
54
+ provide('$xeGantt', null)
54
55
 
55
56
  return renderVN
56
57
  }
@@ -45,6 +45,7 @@ export default defineVxeComponent({
45
45
 
46
46
  const renderRows = (isGroup: boolean, isOptimizeMode: boolean, cols: VxeTableDefines.ColumnInfo[], $rowIndex: number) => {
47
47
  const $xeGrid = $xeTable.xeGrid
48
+ const $xeGantt = $xeTable.xeGantt
48
49
 
49
50
  const { fixedType } = props
50
51
  const { resizable: allResizable, columnKey, headerCellClassName, headerCellStyle, showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign, mouseConfig } = tableProps
@@ -87,6 +88,7 @@ export default defineVxeComponent({
87
88
  } = {
88
89
  $table: $xeTable,
89
90
  $grid: $xeGrid,
91
+ $gantt: $xeGantt,
90
92
  $rowIndex,
91
93
  column,
92
94
  columnIndex,