vxe-gantt 4.0.24 → 4.0.26
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/gantt/src/gantt-chart.js +2 -1
- package/es/gantt/src/gantt.js +164 -38
- package/es/gantt/style.css +11 -0
- package/es/gantt/style.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-gantt/style.css +11 -0
- package/es/vxe-gantt/style.min.css +1 -1
- package/lib/gantt/src/gantt-chart.js +3 -1
- package/lib/gantt/src/gantt-chart.min.js +1 -1
- package/lib/gantt/src/gantt.js +181 -50
- package/lib/gantt/src/gantt.min.js +1 -1
- package/lib/gantt/style/style.css +11 -0
- package/lib/gantt/style/style.min.css +1 -1
- package/lib/index.umd.js +189 -54
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +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/lib/vxe-gantt/style/style.css +11 -0
- package/lib/vxe-gantt/style/style.min.css +1 -1
- package/package.json +3 -3
- package/packages/gantt/src/gantt-chart.ts +2 -1
- package/packages/gantt/src/gantt.ts +199 -72
- package/styles/components/gantt-module/gantt-chart.scss +6 -0
- package/styles/components/gantt.scss +3 -0
|
@@ -13,7 +13,7 @@ import { VxeTable as VxeTableComponent } from 'vxe-table'
|
|
|
13
13
|
|
|
14
14
|
import type { VxeGanttConstructor, VxeGanttEmits, GanttReactData, GanttInternalData, VxeGanttPropTypes, GanttMethods, GanttPrivateMethods, VxeGanttPrivateMethods, GanttPrivateRef, VxeGanttProps, VxeGanttPrivateComputed, VxeGanttViewInstance, VxeGanttDefines } from '../../../types'
|
|
15
15
|
import type { ValueOf, VxeFormEvents, VxeFormInstance, VxePagerEvents, VxeFormItemProps, VxePagerInstance, VxeComponentStyleType } from 'vxe-pc-ui'
|
|
16
|
-
import type { VxeTableMethods, VxeToolbarPropTypes, VxeTableProps, VxeTablePropTypes, VxeTableConstructor, VxeTablePrivateMethods, VxeTableEvents, VxeTableDefines, VxeTableEventProps, VxeToolbarInstance, VxeGridPropTypes } from 'vxe-table'
|
|
16
|
+
import type { VxeTableMethods, VxeToolbarPropTypes, VxeTableProps, VxeTablePropTypes, VxeTableConstructor, VxeTablePrivateMethods, VxeTableEvents, VxeTableDefines, VxeTableEventProps, VxeToolbarInstance, VxeGridPropTypes, VxeGridDefines } from 'vxe-table'
|
|
17
17
|
|
|
18
18
|
const { getConfig, getIcon, getI18n, commands, hooks, useFns, createEvent, globalEvents, GLOBAL_EVENT_KEYS, renderEmptyElement } = VxeUI
|
|
19
19
|
|
|
@@ -26,6 +26,7 @@ const defaultLayouts: VxeGanttPropTypes.Layouts = [['Form'], ['Toolbar', 'Top',
|
|
|
26
26
|
|
|
27
27
|
function createInternalData (): GanttInternalData {
|
|
28
28
|
return {
|
|
29
|
+
uFoot: false,
|
|
29
30
|
resizeTableWidth: 0
|
|
30
31
|
}
|
|
31
32
|
}
|
|
@@ -67,6 +68,7 @@ export default defineVxeComponent({
|
|
|
67
68
|
editRules: PropType<VxeTablePropTypes.EditRules>
|
|
68
69
|
animat: PropType<VxeTablePropTypes.Animat>
|
|
69
70
|
scrollbarConfig: PropType<VxeTablePropTypes.ScrollbarConfig>
|
|
71
|
+
showFooter: PropType<VxeTablePropTypes.ShowFooter>
|
|
70
72
|
params: PropType<VxeTablePropTypes.Params>
|
|
71
73
|
}),
|
|
72
74
|
|
|
@@ -83,8 +85,8 @@ export default defineVxeComponent({
|
|
|
83
85
|
taskViewConfig: Object as PropType<VxeGanttPropTypes.TaskViewConfig>,
|
|
84
86
|
taskBarConfig: Object as PropType<VxeGanttPropTypes.TaskBarConfig>,
|
|
85
87
|
taskSplitConfig: Object as PropType<VxeGanttPropTypes.TaskSplitConfig>,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
taskBarResizeConfig: Object as PropType<VxeGanttPropTypes.TaskBarResizeConfig>,
|
|
89
|
+
taskBarDragConfig: Object as PropType<VxeGanttPropTypes.TaskBarDragConfig>,
|
|
88
90
|
size: {
|
|
89
91
|
type: String as PropType<VxeGridPropTypes.Size>,
|
|
90
92
|
default: () => getConfig().gantt.size || getConfig().size
|
|
@@ -112,6 +114,7 @@ export default defineVxeComponent({
|
|
|
112
114
|
filterData: [],
|
|
113
115
|
formData: {},
|
|
114
116
|
sortData: [],
|
|
117
|
+
footerData: [],
|
|
115
118
|
tZindex: 0,
|
|
116
119
|
tablePage: {
|
|
117
120
|
total: 0,
|
|
@@ -216,6 +219,14 @@ export default defineVxeComponent({
|
|
|
216
219
|
return Object.assign({}, getConfig().gantt.taskBarConfig, props.taskBarConfig)
|
|
217
220
|
})
|
|
218
221
|
|
|
222
|
+
const computeTaskBarDragOpts = computed(() => {
|
|
223
|
+
return Object.assign({}, getConfig().gantt.taskBarDragConfig, props.taskBarDragConfig)
|
|
224
|
+
})
|
|
225
|
+
|
|
226
|
+
const computeTaskBarResizeOpts = computed(() => {
|
|
227
|
+
return Object.assign({}, getConfig().gantt.taskBarResizeConfig, props.taskBarResizeConfig)
|
|
228
|
+
})
|
|
229
|
+
|
|
219
230
|
const computeTaskSplitOpts = computed(() => {
|
|
220
231
|
return Object.assign({}, getConfig().gantt.taskSplitConfig, props.taskSplitConfig)
|
|
221
232
|
})
|
|
@@ -298,15 +309,18 @@ export default defineVxeComponent({
|
|
|
298
309
|
|
|
299
310
|
const computeTableExtendProps = computed(() => {
|
|
300
311
|
const rest: Record<string, any> = {}
|
|
312
|
+
const ganttProps: any = props
|
|
301
313
|
tableComponentPropKeys.forEach((key) => {
|
|
302
|
-
|
|
314
|
+
if (ganttProps[key] !== undefined) {
|
|
315
|
+
rest[key] = ganttProps[key]
|
|
316
|
+
}
|
|
303
317
|
})
|
|
304
318
|
return rest
|
|
305
319
|
})
|
|
306
320
|
|
|
307
321
|
const computeTableProps = computed(() => {
|
|
308
|
-
const { seqConfig, pagerConfig, editConfig, proxyConfig } = props
|
|
309
|
-
const { isZMax, tablePage } = reactData
|
|
322
|
+
const { showFooter, seqConfig, pagerConfig, editConfig, proxyConfig } = props
|
|
323
|
+
const { isZMax, tablePage, footerData } = reactData
|
|
310
324
|
const taskViewOpts = computeTaskViewOpts.value
|
|
311
325
|
const { tableStyle } = taskViewOpts
|
|
312
326
|
const tableExtendProps = computeTableExtendProps.value
|
|
@@ -325,8 +339,15 @@ export default defineVxeComponent({
|
|
|
325
339
|
tProps.border = border
|
|
326
340
|
}
|
|
327
341
|
}
|
|
342
|
+
if (showFooter && !tProps.footerData) {
|
|
343
|
+
// 如果未设置自己的标位数据,则使用代理的
|
|
344
|
+
tProps.footerData = footerData
|
|
345
|
+
} else if (proxyOpts.footer && footerData.length) {
|
|
346
|
+
// 如果代理标为数据,且未请求到数据,则用自己的
|
|
347
|
+
tProps.footerData = footerData
|
|
348
|
+
}
|
|
328
349
|
if (isZMax) {
|
|
329
|
-
if (
|
|
350
|
+
if (tProps.maxHeight) {
|
|
330
351
|
tProps.maxHeight = '100%'
|
|
331
352
|
} else {
|
|
332
353
|
tProps.height = '100%'
|
|
@@ -438,6 +459,8 @@ export default defineVxeComponent({
|
|
|
438
459
|
computeTaskViewScaleMapsOpts,
|
|
439
460
|
computeTaskViewOpts,
|
|
440
461
|
computeTaskBarOpts,
|
|
462
|
+
computeTaskBarDragOpts,
|
|
463
|
+
computeTaskBarResizeOpts,
|
|
441
464
|
computeTaskSplitOpts,
|
|
442
465
|
computeTaskScaleConfs,
|
|
443
466
|
computeTitleField,
|
|
@@ -659,9 +682,12 @@ export default defineVxeComponent({
|
|
|
659
682
|
reactData.filterData = params.filterList
|
|
660
683
|
if (proxyConfig && isEnableConf(proxyOpts)) {
|
|
661
684
|
reactData.tablePage.currentPage = 1
|
|
685
|
+
internalData.uFoot = true
|
|
662
686
|
$xeGantt.commitProxy('query').then((rest) => {
|
|
663
687
|
$xeGantt.dispatchEvent('proxy-query', rest, params.$event)
|
|
664
688
|
})
|
|
689
|
+
internalData.uFoot = false
|
|
690
|
+
updateQueryFooter()
|
|
665
691
|
}
|
|
666
692
|
}
|
|
667
693
|
}
|
|
@@ -683,9 +709,12 @@ export default defineVxeComponent({
|
|
|
683
709
|
return
|
|
684
710
|
}
|
|
685
711
|
if (proxyConfig && isEnableConf(proxyOpts)) {
|
|
712
|
+
internalData.uFoot = true
|
|
686
713
|
$xeGantt.commitProxy('reload').then((rest) => {
|
|
687
714
|
$xeGantt.dispatchEvent('proxy-query', { ...rest, isReload: true }, params.$event)
|
|
688
715
|
})
|
|
716
|
+
internalData.uFoot = false
|
|
717
|
+
updateQueryFooter()
|
|
689
718
|
}
|
|
690
719
|
$xeGantt.dispatchEvent('form-submit', params, params.$event)
|
|
691
720
|
}
|
|
@@ -699,9 +728,12 @@ export default defineVxeComponent({
|
|
|
699
728
|
if ($xeTable) {
|
|
700
729
|
$xeTable.clearScroll()
|
|
701
730
|
}
|
|
731
|
+
internalData.uFoot = true
|
|
702
732
|
$xeGantt.commitProxy('reload').then((rest) => {
|
|
703
733
|
$xeGantt.dispatchEvent('proxy-query', { ...rest, isReload: true }, $event)
|
|
704
734
|
})
|
|
735
|
+
internalData.uFoot = false
|
|
736
|
+
updateQueryFooter()
|
|
705
737
|
}
|
|
706
738
|
$xeGantt.dispatchEvent('form-reset', params, $event)
|
|
707
739
|
}
|
|
@@ -865,12 +897,16 @@ export default defineVxeComponent({
|
|
|
865
897
|
if (field) {
|
|
866
898
|
let itemValue: any = null
|
|
867
899
|
if (itemRender) {
|
|
868
|
-
const { defaultValue } = itemRender
|
|
900
|
+
const { startField, endField, defaultValue } = itemRender
|
|
869
901
|
if (XEUtils.isFunction(defaultValue)) {
|
|
870
902
|
itemValue = defaultValue({ item })
|
|
871
903
|
} else if (!XEUtils.isUndefined(defaultValue)) {
|
|
872
904
|
itemValue = defaultValue
|
|
873
905
|
}
|
|
906
|
+
if (startField && endField) {
|
|
907
|
+
XEUtils.set(fData, startField, null)
|
|
908
|
+
XEUtils.set(fData, endField, null)
|
|
909
|
+
}
|
|
874
910
|
}
|
|
875
911
|
fData[field] = itemValue
|
|
876
912
|
}
|
|
@@ -892,7 +928,13 @@ export default defineVxeComponent({
|
|
|
892
928
|
if (!proxyInited) {
|
|
893
929
|
reactData.proxyInited = true
|
|
894
930
|
if (proxyOpts.autoLoad !== false) {
|
|
895
|
-
nextTick().then(() =>
|
|
931
|
+
nextTick().then(() => {
|
|
932
|
+
internalData.uFoot = true
|
|
933
|
+
const rest = $xeGantt.commitProxy('initial')
|
|
934
|
+
internalData.uFoot = false
|
|
935
|
+
updateQueryFooter()
|
|
936
|
+
return rest
|
|
937
|
+
}).then((rest) => {
|
|
896
938
|
dispatchEvent('proxy-query', { ...rest, isInited: true }, new Event('initial'))
|
|
897
939
|
})
|
|
898
940
|
}
|
|
@@ -900,6 +942,14 @@ export default defineVxeComponent({
|
|
|
900
942
|
}
|
|
901
943
|
}
|
|
902
944
|
|
|
945
|
+
const updateQueryFooter = () => {
|
|
946
|
+
const proxyOpts = computeProxyOpts.value
|
|
947
|
+
const { ajax } = proxyOpts
|
|
948
|
+
if (ajax && ajax.queryFooter) {
|
|
949
|
+
return $xeGantt.commitProxy('queryFooter')
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
|
|
903
953
|
const handleGlobalKeydownEvent = (evnt: KeyboardEvent) => {
|
|
904
954
|
const zoomOpts = computeZoomOpts.value
|
|
905
955
|
const isEsc = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ESCAPE)
|
|
@@ -922,15 +972,15 @@ export default defineVxeComponent({
|
|
|
922
972
|
* @param {String/Object} code 字符串或对象
|
|
923
973
|
*/
|
|
924
974
|
commitProxy (proxyTarget: string | VxeToolbarPropTypes.ButtonConfig, ...args: any[]) {
|
|
925
|
-
const { proxyConfig, toolbarConfig, pagerConfig, editRules, validConfig } = props
|
|
975
|
+
const { showFooter, proxyConfig, toolbarConfig, pagerConfig, editRules, validConfig } = props
|
|
926
976
|
const { tablePage } = reactData
|
|
927
977
|
const isActiveMsg = computeIsActiveMsg.value
|
|
928
978
|
const isRespMsg = computeIsRespMsg.value
|
|
929
979
|
const proxyOpts = computeProxyOpts.value
|
|
930
980
|
const pagerOpts = computePagerOpts.value
|
|
931
981
|
const toolbarOpts = computeToolbarOpts.value
|
|
932
|
-
const { beforeQuery, afterQuery, beforeDelete, afterDelete, beforeSave, afterSave, ajax = {} } = proxyOpts
|
|
933
|
-
const resConfigs = proxyOpts.response || proxyOpts.props || {}
|
|
982
|
+
const { beforeQuery, afterQuery, beforeQueryFooter, afterQueryFooter, beforeDelete, afterDelete, beforeSave, afterSave, ajax = {} } = proxyOpts
|
|
983
|
+
const resConfigs = (proxyOpts.response || proxyOpts.props || {}) as VxeGridDefines.ProxyConfigResponseConfig
|
|
934
984
|
const $xeTable = refTable.value
|
|
935
985
|
if (!$xeTable) {
|
|
936
986
|
return nextTick()
|
|
@@ -981,15 +1031,16 @@ export default defineVxeComponent({
|
|
|
981
1031
|
case 'initial':
|
|
982
1032
|
case 'reload':
|
|
983
1033
|
case 'query': {
|
|
984
|
-
const
|
|
985
|
-
const
|
|
986
|
-
const
|
|
987
|
-
if (
|
|
1034
|
+
const qMethods = ajax.query
|
|
1035
|
+
const qsMethods = ajax.querySuccess
|
|
1036
|
+
const qeMethods = ajax.queryError
|
|
1037
|
+
if (qMethods) {
|
|
988
1038
|
const isInited = code === 'initial'
|
|
989
1039
|
const isReload = code === 'reload'
|
|
990
1040
|
if (!isInited && reactData.tableLoading) {
|
|
991
1041
|
return nextTick()
|
|
992
1042
|
}
|
|
1043
|
+
let operPromise = null
|
|
993
1044
|
let sortList: any[] = []
|
|
994
1045
|
let filterList: VxeTableDefines.FilterCheckedParams[] = []
|
|
995
1046
|
let pageParams: any = {}
|
|
@@ -1043,7 +1094,7 @@ export default defineVxeComponent({
|
|
|
1043
1094
|
} else {
|
|
1044
1095
|
if ($xeTable) {
|
|
1045
1096
|
if (isReload) {
|
|
1046
|
-
$xeTable.clearAll()
|
|
1097
|
+
operPromise = $xeTable.clearAll()
|
|
1047
1098
|
} else {
|
|
1048
1099
|
sortList = $xeTable.getSortColumns()
|
|
1049
1100
|
filterList = $xeTable.getCheckedFilters()
|
|
@@ -1063,65 +1114,119 @@ export default defineVxeComponent({
|
|
|
1063
1114
|
sorts: sortList,
|
|
1064
1115
|
filters: filterList,
|
|
1065
1116
|
form: formData,
|
|
1066
|
-
options:
|
|
1117
|
+
options: qMethods
|
|
1067
1118
|
}
|
|
1068
1119
|
reactData.sortData = sortList
|
|
1069
1120
|
reactData.filterData = filterList
|
|
1070
1121
|
reactData.tableLoading = true
|
|
1071
|
-
return Promise.
|
|
1072
|
-
.
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
tableData = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $table: $xeTable, $grid: null, $gantt: $xeGantt }) : XEUtils.get(rest, listProp)) : rest) || []
|
|
1122
|
+
return Promise.all([
|
|
1123
|
+
Promise.resolve((beforeQuery || qMethods)(commitParams, ...args)),
|
|
1124
|
+
operPromise
|
|
1125
|
+
]).then(([rest]) => {
|
|
1126
|
+
let tableData: any[] = []
|
|
1127
|
+
reactData.tableLoading = false
|
|
1128
|
+
if (rest) {
|
|
1129
|
+
const reParams = { data: rest, $table: $xeTable, $grid: null, $gantt: $xeGantt }
|
|
1130
|
+
if (pagerConfig && isEnableConf(pagerOpts)) {
|
|
1131
|
+
const totalProp = resConfigs.total
|
|
1132
|
+
const total = (XEUtils.isFunction(totalProp) ? totalProp(reParams) : XEUtils.get(rest, totalProp || 'page.total')) || 0
|
|
1133
|
+
tablePage.total = XEUtils.toNumber(total)
|
|
1134
|
+
const resultProp = resConfigs.result
|
|
1135
|
+
tableData = (XEUtils.isFunction(resultProp) ? resultProp(reParams) : XEUtils.get(rest, resultProp || 'result')) || []
|
|
1136
|
+
// 检验当前页码,不能超出当前最大页数
|
|
1137
|
+
const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1)
|
|
1138
|
+
if (tablePage.currentPage > pageCount) {
|
|
1139
|
+
tablePage.currentPage = pageCount
|
|
1090
1140
|
}
|
|
1091
|
-
}
|
|
1092
|
-
if ($xeTable as any) {
|
|
1093
|
-
$xeTable.loadData(tableData)
|
|
1094
1141
|
} else {
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
if (afterQuery) {
|
|
1102
|
-
afterQuery(commitParams, ...args)
|
|
1103
|
-
}
|
|
1104
|
-
if (querySuccessMethods) {
|
|
1105
|
-
querySuccessMethods({ ...commitParams, response: rest })
|
|
1142
|
+
const listProp = resConfigs.list
|
|
1143
|
+
if (XEUtils.isArray(rest)) {
|
|
1144
|
+
tableData = rest
|
|
1145
|
+
} else if (listProp) {
|
|
1146
|
+
tableData = (XEUtils.isFunction(listProp) ? listProp(reParams) : XEUtils.get(rest, listProp)) || []
|
|
1147
|
+
}
|
|
1106
1148
|
}
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1149
|
+
if (showFooter) {
|
|
1150
|
+
const fdProp = resConfigs.footerData
|
|
1151
|
+
const footerList = fdProp ? (XEUtils.isFunction(fdProp) ? fdProp(reParams) : XEUtils.get(rest, fdProp)) : []
|
|
1152
|
+
if (XEUtils.isArray(footerList)) {
|
|
1153
|
+
reactData.footerData = footerList
|
|
1154
|
+
}
|
|
1112
1155
|
}
|
|
1113
|
-
|
|
1114
|
-
|
|
1156
|
+
}
|
|
1157
|
+
if ($xeTable) {
|
|
1158
|
+
$xeTable.loadData(tableData)
|
|
1159
|
+
} else {
|
|
1160
|
+
nextTick(() => {
|
|
1161
|
+
const $xeTable = refTable.value
|
|
1162
|
+
if ($xeTable) {
|
|
1163
|
+
$xeTable.loadData(tableData)
|
|
1164
|
+
}
|
|
1165
|
+
})
|
|
1166
|
+
}
|
|
1167
|
+
if (afterQuery) {
|
|
1168
|
+
afterQuery(commitParams, ...args)
|
|
1169
|
+
}
|
|
1170
|
+
if (qsMethods) {
|
|
1171
|
+
qsMethods({ ...commitParams, response: rest })
|
|
1172
|
+
}
|
|
1173
|
+
return { status: true }
|
|
1174
|
+
}).catch((rest) => {
|
|
1175
|
+
reactData.tableLoading = false
|
|
1176
|
+
if (qeMethods) {
|
|
1177
|
+
qeMethods({ ...commitParams, response: rest })
|
|
1178
|
+
}
|
|
1179
|
+
return { status: false }
|
|
1180
|
+
})
|
|
1181
|
+
} else {
|
|
1182
|
+
errLog('vxe.error.notFunc', ['[gantt] proxy-config.ajax.query'])
|
|
1183
|
+
}
|
|
1184
|
+
break
|
|
1185
|
+
}
|
|
1186
|
+
case 'queryFooter': {
|
|
1187
|
+
const qfMethods = ajax.queryFooter
|
|
1188
|
+
const qfSuccessMethods = ajax.queryFooterSuccess
|
|
1189
|
+
const qfErrorMethods = ajax.queryFooterError
|
|
1190
|
+
if (qfMethods) {
|
|
1191
|
+
let filterList: VxeTableDefines.FilterCheckedParams[] = []
|
|
1192
|
+
if ($xeTable) {
|
|
1193
|
+
filterList = $xeTable.getCheckedFilters()
|
|
1194
|
+
}
|
|
1195
|
+
const commitParams = {
|
|
1196
|
+
$table: $xeTable,
|
|
1197
|
+
$grid: null,
|
|
1198
|
+
$gantt: $xeGantt,
|
|
1199
|
+
code,
|
|
1200
|
+
button,
|
|
1201
|
+
filters: filterList,
|
|
1202
|
+
form: formData,
|
|
1203
|
+
options: qfMethods
|
|
1204
|
+
}
|
|
1205
|
+
return Promise.resolve((beforeQueryFooter || qfMethods)(commitParams, ...args)).then(rest => {
|
|
1206
|
+
reactData.footerData = XEUtils.isArray(rest) ? rest : []
|
|
1207
|
+
if (afterQueryFooter) {
|
|
1208
|
+
afterQueryFooter(commitParams, ...args)
|
|
1209
|
+
}
|
|
1210
|
+
if (qfSuccessMethods) {
|
|
1211
|
+
qfSuccessMethods({ ...commitParams, response: rest })
|
|
1212
|
+
}
|
|
1213
|
+
return { status: true }
|
|
1214
|
+
}).catch((rest) => {
|
|
1215
|
+
if (qfErrorMethods) {
|
|
1216
|
+
qfErrorMethods({ ...commitParams, response: rest })
|
|
1217
|
+
}
|
|
1218
|
+
return { status: false }
|
|
1219
|
+
})
|
|
1115
1220
|
} else {
|
|
1116
|
-
errLog('vxe.error.notFunc', ['proxy-config.ajax.
|
|
1221
|
+
errLog('vxe.error.notFunc', ['[gantt] proxy-config.ajax.queryFooter'])
|
|
1117
1222
|
}
|
|
1118
1223
|
break
|
|
1119
1224
|
}
|
|
1120
1225
|
case 'delete': {
|
|
1121
|
-
const
|
|
1226
|
+
const dMethods = ajax.delete
|
|
1122
1227
|
const deleteSuccessMethods = ajax.deleteSuccess
|
|
1123
1228
|
const deleteErrorMethods = ajax.deleteError
|
|
1124
|
-
if (
|
|
1229
|
+
if (dMethods) {
|
|
1125
1230
|
const selectRecords = $xeGantt.getCheckboxRecords()
|
|
1126
1231
|
const removeRecords = selectRecords.filter(row => !$xeTable.isInsertByRow(row))
|
|
1127
1232
|
const body = { removeRecords }
|
|
@@ -1133,7 +1238,7 @@ export default defineVxeComponent({
|
|
|
1133
1238
|
button,
|
|
1134
1239
|
body,
|
|
1135
1240
|
form: formData,
|
|
1136
|
-
options:
|
|
1241
|
+
options: dMethods
|
|
1137
1242
|
}
|
|
1138
1243
|
if (selectRecords.length) {
|
|
1139
1244
|
return handleDeleteRow(code, 'vxe.grid.deleteSelectRecord', () => {
|
|
@@ -1141,7 +1246,7 @@ export default defineVxeComponent({
|
|
|
1141
1246
|
return $xeTable.remove(selectRecords)
|
|
1142
1247
|
}
|
|
1143
1248
|
reactData.tableLoading = true
|
|
1144
|
-
return Promise.resolve((beforeDelete ||
|
|
1249
|
+
return Promise.resolve((beforeDelete || dMethods)(commitParams, ...args))
|
|
1145
1250
|
.then(rest => {
|
|
1146
1251
|
reactData.tableLoading = false
|
|
1147
1252
|
$xeTable.setPendingRow(removeRecords, false)
|
|
@@ -1153,7 +1258,10 @@ export default defineVxeComponent({
|
|
|
1153
1258
|
if (afterDelete) {
|
|
1154
1259
|
afterDelete(commitParams, ...args)
|
|
1155
1260
|
} else {
|
|
1261
|
+
internalData.uFoot = true
|
|
1156
1262
|
$xeGantt.commitProxy('query')
|
|
1263
|
+
internalData.uFoot = false
|
|
1264
|
+
updateQueryFooter()
|
|
1157
1265
|
}
|
|
1158
1266
|
if (deleteSuccessMethods) {
|
|
1159
1267
|
deleteSuccessMethods({ ...commitParams, response: rest })
|
|
@@ -1181,7 +1289,7 @@ export default defineVxeComponent({
|
|
|
1181
1289
|
}
|
|
1182
1290
|
}
|
|
1183
1291
|
} else {
|
|
1184
|
-
errLog('vxe.error.notFunc', ['proxy-config.ajax.delete'])
|
|
1292
|
+
errLog('vxe.error.notFunc', ['[gantt] proxy-config.ajax.delete'])
|
|
1185
1293
|
}
|
|
1186
1294
|
break
|
|
1187
1295
|
}
|
|
@@ -1234,7 +1342,10 @@ export default defineVxeComponent({
|
|
|
1234
1342
|
if (afterSave) {
|
|
1235
1343
|
afterSave(commitParams, ...args)
|
|
1236
1344
|
} else {
|
|
1345
|
+
internalData.uFoot = true
|
|
1237
1346
|
$xeGantt.commitProxy('query')
|
|
1347
|
+
internalData.uFoot = false
|
|
1348
|
+
updateQueryFooter()
|
|
1238
1349
|
}
|
|
1239
1350
|
if (saveSuccessMethods) {
|
|
1240
1351
|
saveSuccessMethods({ ...commitParams, response: rest })
|
|
@@ -1262,7 +1373,7 @@ export default defineVxeComponent({
|
|
|
1262
1373
|
}
|
|
1263
1374
|
})
|
|
1264
1375
|
} else {
|
|
1265
|
-
errLog('vxe.error.notFunc', ['proxy-config.ajax.save'])
|
|
1376
|
+
errLog('vxe.error.notFunc', ['[gantt] proxy-config.ajax.save'])
|
|
1266
1377
|
}
|
|
1267
1378
|
break
|
|
1268
1379
|
}
|
|
@@ -1273,7 +1384,7 @@ export default defineVxeComponent({
|
|
|
1273
1384
|
if (tCommandMethod) {
|
|
1274
1385
|
tCommandMethod({ code, button, $table: $xeTable, $grid: null, $gantt: $xeGantt }, ...args)
|
|
1275
1386
|
} else {
|
|
1276
|
-
errLog('vxe.error.notCommands', [code])
|
|
1387
|
+
errLog('vxe.error.notCommands', [`[grid] ${code}`])
|
|
1277
1388
|
}
|
|
1278
1389
|
}
|
|
1279
1390
|
}
|
|
@@ -1473,6 +1584,7 @@ export default defineVxeComponent({
|
|
|
1473
1584
|
* 获取需要排除的高度
|
|
1474
1585
|
*/
|
|
1475
1586
|
getExcludeHeight () {
|
|
1587
|
+
const { height } = props
|
|
1476
1588
|
const { isZMax } = reactData
|
|
1477
1589
|
const el = refElem.value
|
|
1478
1590
|
if (el) {
|
|
@@ -1481,8 +1593,11 @@ export default defineVxeComponent({
|
|
|
1481
1593
|
const topWrapper = refTopWrapper.value
|
|
1482
1594
|
const bottomWrapper = refBottomWrapper.value
|
|
1483
1595
|
const pagerWrapper = refPagerWrapper.value
|
|
1484
|
-
const parentEl = el.parentElement
|
|
1485
|
-
|
|
1596
|
+
const parentEl = el.parentElement
|
|
1597
|
+
let parentPaddingSize = 0
|
|
1598
|
+
if (parentEl && (height === '100%' || height === 'auto')) {
|
|
1599
|
+
parentPaddingSize = isZMax ? 0 : getPaddingTopBottomSize(parentEl)
|
|
1600
|
+
}
|
|
1486
1601
|
return parentPaddingSize + getPaddingTopBottomSize(el) + getOffsetHeight(formWrapper) + getOffsetHeight(toolbarWrapper) + getOffsetHeight(topWrapper) + getOffsetHeight(bottomWrapper) + getOffsetHeight(pagerWrapper)
|
|
1487
1602
|
}
|
|
1488
1603
|
return 0
|
|
@@ -1497,11 +1612,23 @@ export default defineVxeComponent({
|
|
|
1497
1612
|
},
|
|
1498
1613
|
triggerToolbarCommitEvent (params, evnt) {
|
|
1499
1614
|
const { code } = params
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1615
|
+
if (code) {
|
|
1616
|
+
const isUf = ['reload', 'delete', 'save'].includes(code)
|
|
1617
|
+
if (isUf) {
|
|
1618
|
+
internalData.uFoot = true
|
|
1503
1619
|
}
|
|
1504
|
-
|
|
1620
|
+
const rest = $xeGantt.commitProxy(params, evnt).then((rest) => {
|
|
1621
|
+
if (rest && rest.status && ['query', 'reload', 'delete', 'save'].includes(code)) {
|
|
1622
|
+
$xeGantt.dispatchEvent(code === 'delete' || code === 'save' ? `proxy-${code as 'delete' | 'save'}` : 'proxy-query', { ...rest, isReload: code === 'reload' }, evnt)
|
|
1623
|
+
}
|
|
1624
|
+
})
|
|
1625
|
+
internalData.uFoot = false
|
|
1626
|
+
if (isUf) {
|
|
1627
|
+
updateQueryFooter()
|
|
1628
|
+
}
|
|
1629
|
+
return rest
|
|
1630
|
+
}
|
|
1631
|
+
return nextTick()
|
|
1505
1632
|
},
|
|
1506
1633
|
triggerToolbarBtnEvent (button, evnt) {
|
|
1507
1634
|
$xeGantt.triggerToolbarCommitEvent(button, evnt)
|