vxe-gantt 4.0.23 → 4.0.25
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-body.js +29 -10
- package/es/gantt/src/gantt-view.js +94 -4
- package/es/gantt/src/gantt.js +155 -37
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/ui/src/utils.js +3 -0
- package/lib/gantt/src/gantt-body.js +34 -6
- package/lib/gantt/src/gantt-body.min.js +1 -1
- package/lib/gantt/src/gantt-view.js +98 -4
- package/lib/gantt/src/gantt-view.min.js +1 -1
- package/lib/gantt/src/gantt.js +171 -48
- package/lib/gantt/src/gantt.min.js +1 -1
- package/lib/index.umd.js +310 -60
- package/lib/index.umd.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/lib/ui/src/utils.js +4 -0
- package/lib/ui/src/utils.min.js +1 -1
- package/package.json +3 -3
- package/packages/gantt/src/gantt-body.ts +38 -17
- package/packages/gantt/src/gantt-view.ts +95 -4
- package/packages/gantt/src/gantt.ts +187 -70
- package/packages/ui/src/utils.ts +4 -0
package/lib/index.umd.js
CHANGED
|
@@ -2780,7 +2780,7 @@ var core_ = __webpack_require__(4345);
|
|
|
2780
2780
|
const {
|
|
2781
2781
|
log
|
|
2782
2782
|
} = core_.VxeUI;
|
|
2783
|
-
const version = `gantt v${"4.0.
|
|
2783
|
+
const version = `gantt v${"4.0.25"}`;
|
|
2784
2784
|
const warnLog = log.create('warn', version);
|
|
2785
2785
|
const errLog = log.create('error', version);
|
|
2786
2786
|
;// ./packages/ui/index.ts
|
|
@@ -2791,7 +2791,7 @@ const {
|
|
|
2791
2791
|
setIcon,
|
|
2792
2792
|
checkVersion
|
|
2793
2793
|
} = core_.VxeUI;
|
|
2794
|
-
core_.VxeUI.ganttVersion = "4.0.
|
|
2794
|
+
core_.VxeUI.ganttVersion = "4.0.25";
|
|
2795
2795
|
setConfig({
|
|
2796
2796
|
gantt: {
|
|
2797
2797
|
// size: null,
|
|
@@ -3088,6 +3088,9 @@ function eqEmptyValue(cellValue) {
|
|
|
3088
3088
|
function getStringValue(cellValue) {
|
|
3089
3089
|
return eqEmptyValue(cellValue) ? '' : cellValue;
|
|
3090
3090
|
}
|
|
3091
|
+
function getClass(property, params) {
|
|
3092
|
+
return property ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(property) ? property(params) : property : '';
|
|
3093
|
+
}
|
|
3091
3094
|
;// ./packages/ui/src/dom.ts
|
|
3092
3095
|
|
|
3093
3096
|
const reClsMap = {};
|
|
@@ -3691,6 +3694,8 @@ const gantt_chart_viewType = 'chart';
|
|
|
3691
3694
|
|
|
3692
3695
|
|
|
3693
3696
|
|
|
3697
|
+
|
|
3698
|
+
|
|
3694
3699
|
const gantt_body_sourceType = 'gantt';
|
|
3695
3700
|
const gantt_body_viewType = 'body';
|
|
3696
3701
|
/* harmony default export */ var gantt_body = (defineVxeComponent({
|
|
@@ -3741,14 +3746,20 @@ const gantt_body_viewType = 'body';
|
|
|
3741
3746
|
} = internalData;
|
|
3742
3747
|
const taskViewOpts = computeTaskViewOpts.value;
|
|
3743
3748
|
const {
|
|
3744
|
-
showNowLine
|
|
3749
|
+
showNowLine,
|
|
3750
|
+
viewStyle
|
|
3745
3751
|
} = taskViewOpts;
|
|
3746
3752
|
const {
|
|
3747
3753
|
scaleItem
|
|
3748
3754
|
} = headerGroups[headerGroups.length - 1] || {};
|
|
3749
3755
|
const {
|
|
3750
|
-
field
|
|
3756
|
+
field,
|
|
3757
|
+
dateObj
|
|
3751
3758
|
} = column;
|
|
3759
|
+
const {
|
|
3760
|
+
cellClassName,
|
|
3761
|
+
cellStyle
|
|
3762
|
+
} = viewStyle || {};
|
|
3752
3763
|
const todayValue = showNowLine && scaleItem ? todayDateMaps[scaleItem.type] : null;
|
|
3753
3764
|
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
3754
3765
|
const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0;
|
|
@@ -3790,6 +3801,7 @@ const gantt_body_viewType = 'body';
|
|
|
3790
3801
|
const ctParams = {
|
|
3791
3802
|
source: gantt_body_sourceType,
|
|
3792
3803
|
type: gantt_body_viewType,
|
|
3804
|
+
dateObj,
|
|
3793
3805
|
row,
|
|
3794
3806
|
column,
|
|
3795
3807
|
$rowIndex,
|
|
@@ -3801,8 +3813,10 @@ const gantt_body_viewType = 'body';
|
|
|
3801
3813
|
class: ['vxe-gantt-view--body-column', {
|
|
3802
3814
|
'is--now': showNowLine && todayValue === field,
|
|
3803
3815
|
'col--rs-height': isRsHeight
|
|
3804
|
-
}],
|
|
3805
|
-
style: {
|
|
3816
|
+
}, getClass(cellClassName, ctParams)],
|
|
3817
|
+
style: cellStyle ? Object.assign({}, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(cellStyle) ? cellStyle(ctParams) : cellStyle, {
|
|
3818
|
+
height: `${cellHeight}px`
|
|
3819
|
+
}) : {
|
|
3806
3820
|
height: `${cellHeight}px`
|
|
3807
3821
|
},
|
|
3808
3822
|
onClick(evnt) {
|
|
@@ -3857,6 +3871,14 @@ const gantt_body_viewType = 'body';
|
|
|
3857
3871
|
transform
|
|
3858
3872
|
} = treeOpts;
|
|
3859
3873
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
3874
|
+
const taskViewOpts = computeTaskViewOpts.value;
|
|
3875
|
+
const {
|
|
3876
|
+
viewStyle
|
|
3877
|
+
} = taskViewOpts;
|
|
3878
|
+
const {
|
|
3879
|
+
rowClassName,
|
|
3880
|
+
rowStyle
|
|
3881
|
+
} = viewStyle || {};
|
|
3860
3882
|
const {
|
|
3861
3883
|
tableColumn,
|
|
3862
3884
|
scrollYLoad
|
|
@@ -3895,6 +3917,14 @@ const gantt_body_viewType = 'body';
|
|
|
3895
3917
|
trOns.onDragend = $xeTable.handleRowDragDragendEvent;
|
|
3896
3918
|
trOns.onDragover = $xeTable.handleRowDragDragoverEvent;
|
|
3897
3919
|
}
|
|
3920
|
+
const rowParams = {
|
|
3921
|
+
source: gantt_body_sourceType,
|
|
3922
|
+
type: gantt_body_viewType,
|
|
3923
|
+
row,
|
|
3924
|
+
rowIndex,
|
|
3925
|
+
$rowIndex,
|
|
3926
|
+
_rowIndex
|
|
3927
|
+
};
|
|
3898
3928
|
trVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', {
|
|
3899
3929
|
key: treeConfig ? rowid : $rowIndex,
|
|
3900
3930
|
class: ['vxe-gantt-view--body-row', {
|
|
@@ -3903,8 +3933,9 @@ const gantt_body_viewType = 'body';
|
|
|
3903
3933
|
'row--radio': radioOpts.highlight && $xeTable.eqRow(selectRadioRow, row),
|
|
3904
3934
|
'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
|
|
3905
3935
|
'row--pending': !!pendingRowFlag && !!pendingRowMaps[rowid]
|
|
3906
|
-
}],
|
|
3936
|
+
}, getClass(rowClassName, rowParams)],
|
|
3907
3937
|
rowid,
|
|
3938
|
+
style: rowStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(rowStyle) ? rowStyle(rowParams) : rowStyle : undefined,
|
|
3908
3939
|
...trOns
|
|
3909
3940
|
}, tableColumn.map((column, $columnIndex) => renderColumn($xeTable, row, rowid, rowIndex, $rowIndex, _rowIndex, column, $columnIndex))));
|
|
3910
3941
|
let isExpandTree = false;
|
|
@@ -4053,6 +4084,7 @@ const gantt_footer_viewType = 'footer';
|
|
|
4053
4084
|
const {
|
|
4054
4085
|
globalEvents
|
|
4055
4086
|
} = core_.VxeUI;
|
|
4087
|
+
const gantt_view_sourceType = 'gantt';
|
|
4056
4088
|
function createInternalData() {
|
|
4057
4089
|
return {
|
|
4058
4090
|
xeTable: null,
|
|
@@ -4955,8 +4987,7 @@ const maxYHeight = 5e6;
|
|
|
4955
4987
|
reactData.lazScrollLoading = false;
|
|
4956
4988
|
}, 200);
|
|
4957
4989
|
};
|
|
4958
|
-
|
|
4959
|
-
const handleScrollEvent = (evnt, isRollY, isRollX, scrollTop, scrollLeft) => {
|
|
4990
|
+
const handleScrollData = (isRollY, isRollX, scrollTop, scrollLeft) => {
|
|
4960
4991
|
if (isRollX) {
|
|
4961
4992
|
internalData.lastScrollLeft = scrollLeft;
|
|
4962
4993
|
}
|
|
@@ -4966,6 +4997,95 @@ const maxYHeight = 5e6;
|
|
|
4966
4997
|
reactData.lastScrollTime = Date.now();
|
|
4967
4998
|
checkLastSyncScroll(isRollX, isRollY);
|
|
4968
4999
|
};
|
|
5000
|
+
const handleScrollEvent = (evnt, isRollY, isRollX, scrollTop, scrollLeft) => {
|
|
5001
|
+
const $xeTable = internalData.xeTable;
|
|
5002
|
+
const {
|
|
5003
|
+
lastScrollLeft,
|
|
5004
|
+
lastScrollTop
|
|
5005
|
+
} = internalData;
|
|
5006
|
+
const xHandleEl = refScrollXHandleElem.value;
|
|
5007
|
+
const yHandleEl = refScrollYHandleElem.value;
|
|
5008
|
+
if (!xHandleEl || !yHandleEl) {
|
|
5009
|
+
return;
|
|
5010
|
+
}
|
|
5011
|
+
if (!$xeTable) {
|
|
5012
|
+
return;
|
|
5013
|
+
}
|
|
5014
|
+
const {
|
|
5015
|
+
computeScrollXThreshold,
|
|
5016
|
+
computeScrollYThreshold
|
|
5017
|
+
} = $xeTable.getComputeMaps();
|
|
5018
|
+
const bodyHeight = yHandleEl.clientHeight;
|
|
5019
|
+
const bodyWidth = xHandleEl.clientWidth;
|
|
5020
|
+
const scrollHeight = yHandleEl.scrollHeight;
|
|
5021
|
+
const scrollWidth = xHandleEl.scrollWidth;
|
|
5022
|
+
let isTop = false;
|
|
5023
|
+
let isBottom = false;
|
|
5024
|
+
let isLeft = false;
|
|
5025
|
+
let isRight = false;
|
|
5026
|
+
let direction = '';
|
|
5027
|
+
let isTopBoundary = false;
|
|
5028
|
+
let isBottomBoundary = false;
|
|
5029
|
+
let isLeftBoundary = false;
|
|
5030
|
+
let isRightBoundary = false;
|
|
5031
|
+
if (isRollX) {
|
|
5032
|
+
const xThreshold = computeScrollXThreshold.value;
|
|
5033
|
+
isLeft = scrollLeft <= 0;
|
|
5034
|
+
if (!isLeft) {
|
|
5035
|
+
isRight = scrollLeft + bodyWidth >= scrollWidth - 1;
|
|
5036
|
+
}
|
|
5037
|
+
if (scrollLeft > lastScrollLeft) {
|
|
5038
|
+
direction = 'right';
|
|
5039
|
+
if (scrollLeft + bodyWidth >= scrollWidth - xThreshold) {
|
|
5040
|
+
isRightBoundary = true;
|
|
5041
|
+
}
|
|
5042
|
+
} else {
|
|
5043
|
+
direction = 'left';
|
|
5044
|
+
if (scrollLeft <= xThreshold) {
|
|
5045
|
+
isLeftBoundary = true;
|
|
5046
|
+
}
|
|
5047
|
+
}
|
|
5048
|
+
}
|
|
5049
|
+
if (isRollY) {
|
|
5050
|
+
const yThreshold = computeScrollYThreshold.value;
|
|
5051
|
+
isTop = scrollTop <= 0;
|
|
5052
|
+
if (!isTop) {
|
|
5053
|
+
isBottom = scrollTop + bodyHeight >= scrollHeight - 1;
|
|
5054
|
+
}
|
|
5055
|
+
if (scrollTop > lastScrollTop) {
|
|
5056
|
+
direction = 'bottom';
|
|
5057
|
+
if (scrollTop + bodyHeight >= scrollHeight - yThreshold) {
|
|
5058
|
+
isBottomBoundary = true;
|
|
5059
|
+
}
|
|
5060
|
+
} else {
|
|
5061
|
+
direction = 'top';
|
|
5062
|
+
if (scrollTop <= yThreshold) {
|
|
5063
|
+
isTopBoundary = true;
|
|
5064
|
+
}
|
|
5065
|
+
}
|
|
5066
|
+
}
|
|
5067
|
+
handleScrollData(isRollY, isRollX, scrollTop, scrollLeft);
|
|
5068
|
+
const evntParams = {
|
|
5069
|
+
source: gantt_view_sourceType,
|
|
5070
|
+
scrollTop,
|
|
5071
|
+
scrollLeft,
|
|
5072
|
+
bodyHeight,
|
|
5073
|
+
bodyWidth,
|
|
5074
|
+
scrollHeight,
|
|
5075
|
+
scrollWidth,
|
|
5076
|
+
isX: isRollX,
|
|
5077
|
+
isY: isRollY,
|
|
5078
|
+
isTop,
|
|
5079
|
+
isBottom,
|
|
5080
|
+
isLeft,
|
|
5081
|
+
isRight,
|
|
5082
|
+
direction
|
|
5083
|
+
};
|
|
5084
|
+
if (isBottomBoundary || isTopBoundary || isRightBoundary || isLeftBoundary) {
|
|
5085
|
+
$xeGantt.dispatchEvent('scroll-boundary', evntParams, evnt);
|
|
5086
|
+
}
|
|
5087
|
+
$xeGantt.dispatchEvent('scroll', evntParams, evnt);
|
|
5088
|
+
};
|
|
4969
5089
|
const ganttViewMethods = {
|
|
4970
5090
|
refreshData() {
|
|
4971
5091
|
handleUpdateData();
|
|
@@ -5105,7 +5225,12 @@ const maxYHeight = 5e6;
|
|
|
5105
5225
|
triggerScrollXEvent();
|
|
5106
5226
|
}
|
|
5107
5227
|
}
|
|
5108
|
-
|
|
5228
|
+
if (isRollY) {
|
|
5229
|
+
handleScrollData(isRollY, isRollX, wrapperEl.scrollTop, scrollLeft);
|
|
5230
|
+
}
|
|
5231
|
+
if (isRollX) {
|
|
5232
|
+
handleScrollEvent(evnt, isRollY, isRollX, wrapperEl.scrollTop, scrollLeft);
|
|
5233
|
+
}
|
|
5109
5234
|
},
|
|
5110
5235
|
// triggerFooterScrollEvent (evnt) {
|
|
5111
5236
|
// const { inVirtualScroll, inHeaderScroll, inBodyScroll } = internalData
|
|
@@ -5169,7 +5294,7 @@ const maxYHeight = 5e6;
|
|
|
5169
5294
|
internalData.inVirtualScroll = true;
|
|
5170
5295
|
setScrollTop(bodyScrollElem, currTopNum);
|
|
5171
5296
|
syncTableScrollTop(currTopNum);
|
|
5172
|
-
|
|
5297
|
+
handleScrollData(isRollY, isRollX, currTopNum, wrapperEl.scrollLeft);
|
|
5173
5298
|
}
|
|
5174
5299
|
},
|
|
5175
5300
|
handleUpdateSXSpace() {
|
|
@@ -5334,6 +5459,7 @@ const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadDat
|
|
|
5334
5459
|
const defaultLayouts = [['Form'], ['Toolbar', 'Top', 'Gantt', 'Bottom', 'Pager']];
|
|
5335
5460
|
function gantt_createInternalData() {
|
|
5336
5461
|
return {
|
|
5462
|
+
uFoot: false,
|
|
5337
5463
|
resizeTableWidth: 0
|
|
5338
5464
|
};
|
|
5339
5465
|
}
|
|
@@ -5398,6 +5524,7 @@ function getViewTypeLevel(type) {
|
|
|
5398
5524
|
filterData: [],
|
|
5399
5525
|
formData: {},
|
|
5400
5526
|
sortData: [],
|
|
5527
|
+
footerData: [],
|
|
5401
5528
|
tZindex: 0,
|
|
5402
5529
|
tablePage: {
|
|
5403
5530
|
total: 0,
|
|
@@ -5571,13 +5698,17 @@ function getViewTypeLevel(type) {
|
|
|
5571
5698
|
});
|
|
5572
5699
|
const computeTableExtendProps = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
5573
5700
|
const rest = {};
|
|
5701
|
+
const ganttProps = props;
|
|
5574
5702
|
tableComponentPropKeys.forEach(key => {
|
|
5575
|
-
|
|
5703
|
+
if (ganttProps[key] !== undefined) {
|
|
5704
|
+
rest[key] = ganttProps[key];
|
|
5705
|
+
}
|
|
5576
5706
|
});
|
|
5577
5707
|
return rest;
|
|
5578
5708
|
});
|
|
5579
5709
|
const computeTableProps = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
5580
5710
|
const {
|
|
5711
|
+
showFooter,
|
|
5581
5712
|
seqConfig,
|
|
5582
5713
|
pagerConfig,
|
|
5583
5714
|
editConfig,
|
|
@@ -5585,7 +5716,8 @@ function getViewTypeLevel(type) {
|
|
|
5585
5716
|
} = props;
|
|
5586
5717
|
const {
|
|
5587
5718
|
isZMax,
|
|
5588
|
-
tablePage
|
|
5719
|
+
tablePage,
|
|
5720
|
+
footerData
|
|
5589
5721
|
} = reactData;
|
|
5590
5722
|
const taskViewOpts = computeTaskViewOpts.value;
|
|
5591
5723
|
const {
|
|
@@ -5609,8 +5741,15 @@ function getViewTypeLevel(type) {
|
|
|
5609
5741
|
tProps.border = border;
|
|
5610
5742
|
}
|
|
5611
5743
|
}
|
|
5744
|
+
if (showFooter && !tProps.footerData) {
|
|
5745
|
+
// 如果未设置自己的标位数据,则使用代理的
|
|
5746
|
+
tProps.footerData = footerData;
|
|
5747
|
+
} else if (proxyOpts.footer && footerData.length) {
|
|
5748
|
+
// 如果代理标为数据,且未请求到数据,则用自己的
|
|
5749
|
+
tProps.footerData = footerData;
|
|
5750
|
+
}
|
|
5612
5751
|
if (isZMax) {
|
|
5613
|
-
if (
|
|
5752
|
+
if (tProps.maxHeight) {
|
|
5614
5753
|
tProps.maxHeight = '100%';
|
|
5615
5754
|
} else {
|
|
5616
5755
|
tProps.height = '100%';
|
|
@@ -5992,9 +6131,12 @@ function getViewTypeLevel(type) {
|
|
|
5992
6131
|
reactData.filterData = params.filterList;
|
|
5993
6132
|
if (proxyConfig && isEnableConf(proxyOpts)) {
|
|
5994
6133
|
reactData.tablePage.currentPage = 1;
|
|
6134
|
+
internalData.uFoot = true;
|
|
5995
6135
|
$xeGantt.commitProxy('query').then(rest => {
|
|
5996
6136
|
$xeGantt.dispatchEvent('proxy-query', rest, params.$event);
|
|
5997
6137
|
});
|
|
6138
|
+
internalData.uFoot = false;
|
|
6139
|
+
updateQueryFooter();
|
|
5998
6140
|
}
|
|
5999
6141
|
}
|
|
6000
6142
|
};
|
|
@@ -6015,12 +6157,15 @@ function getViewTypeLevel(type) {
|
|
|
6015
6157
|
return;
|
|
6016
6158
|
}
|
|
6017
6159
|
if (proxyConfig && isEnableConf(proxyOpts)) {
|
|
6160
|
+
internalData.uFoot = true;
|
|
6018
6161
|
$xeGantt.commitProxy('reload').then(rest => {
|
|
6019
6162
|
$xeGantt.dispatchEvent('proxy-query', {
|
|
6020
6163
|
...rest,
|
|
6021
6164
|
isReload: true
|
|
6022
6165
|
}, params.$event);
|
|
6023
6166
|
});
|
|
6167
|
+
internalData.uFoot = false;
|
|
6168
|
+
updateQueryFooter();
|
|
6024
6169
|
}
|
|
6025
6170
|
$xeGantt.dispatchEvent('form-submit', params, params.$event);
|
|
6026
6171
|
};
|
|
@@ -6037,12 +6182,15 @@ function getViewTypeLevel(type) {
|
|
|
6037
6182
|
if ($xeTable) {
|
|
6038
6183
|
$xeTable.clearScroll();
|
|
6039
6184
|
}
|
|
6185
|
+
internalData.uFoot = true;
|
|
6040
6186
|
$xeGantt.commitProxy('reload').then(rest => {
|
|
6041
6187
|
$xeGantt.dispatchEvent('proxy-query', {
|
|
6042
6188
|
...rest,
|
|
6043
6189
|
isReload: true
|
|
6044
6190
|
}, $event);
|
|
6045
6191
|
});
|
|
6192
|
+
internalData.uFoot = false;
|
|
6193
|
+
updateQueryFooter();
|
|
6046
6194
|
}
|
|
6047
6195
|
$xeGantt.dispatchEvent('form-reset', params, $event);
|
|
6048
6196
|
};
|
|
@@ -6200,6 +6348,8 @@ function getViewTypeLevel(type) {
|
|
|
6200
6348
|
let itemValue = null;
|
|
6201
6349
|
if (itemRender) {
|
|
6202
6350
|
const {
|
|
6351
|
+
startField,
|
|
6352
|
+
endField,
|
|
6203
6353
|
defaultValue
|
|
6204
6354
|
} = itemRender;
|
|
6205
6355
|
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(defaultValue)) {
|
|
@@ -6209,6 +6359,10 @@ function getViewTypeLevel(type) {
|
|
|
6209
6359
|
} else if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(defaultValue)) {
|
|
6210
6360
|
itemValue = defaultValue;
|
|
6211
6361
|
}
|
|
6362
|
+
if (startField && endField) {
|
|
6363
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(fData, startField, null);
|
|
6364
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(fData, endField, null);
|
|
6365
|
+
}
|
|
6212
6366
|
}
|
|
6213
6367
|
fData[field] = itemValue;
|
|
6214
6368
|
}
|
|
@@ -6234,7 +6388,13 @@ function getViewTypeLevel(type) {
|
|
|
6234
6388
|
if (!proxyInited) {
|
|
6235
6389
|
reactData.proxyInited = true;
|
|
6236
6390
|
if (proxyOpts.autoLoad !== false) {
|
|
6237
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() =>
|
|
6391
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
6392
|
+
internalData.uFoot = true;
|
|
6393
|
+
const rest = $xeGantt.commitProxy('initial');
|
|
6394
|
+
internalData.uFoot = false;
|
|
6395
|
+
updateQueryFooter();
|
|
6396
|
+
return rest;
|
|
6397
|
+
}).then(rest => {
|
|
6238
6398
|
dispatchEvent('proxy-query', {
|
|
6239
6399
|
...rest,
|
|
6240
6400
|
isInited: true
|
|
@@ -6244,6 +6404,15 @@ function getViewTypeLevel(type) {
|
|
|
6244
6404
|
}
|
|
6245
6405
|
}
|
|
6246
6406
|
};
|
|
6407
|
+
const updateQueryFooter = () => {
|
|
6408
|
+
const proxyOpts = computeProxyOpts.value;
|
|
6409
|
+
const {
|
|
6410
|
+
ajax
|
|
6411
|
+
} = proxyOpts;
|
|
6412
|
+
if (ajax && ajax.queryFooter) {
|
|
6413
|
+
return $xeGantt.commitProxy('queryFooter');
|
|
6414
|
+
}
|
|
6415
|
+
};
|
|
6247
6416
|
const handleGlobalKeydownEvent = evnt => {
|
|
6248
6417
|
const zoomOpts = computeZoomOpts.value;
|
|
6249
6418
|
const isEsc = gantt_globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ESCAPE);
|
|
@@ -6268,6 +6437,7 @@ function getViewTypeLevel(type) {
|
|
|
6268
6437
|
*/
|
|
6269
6438
|
commitProxy(proxyTarget, ...args) {
|
|
6270
6439
|
const {
|
|
6440
|
+
showFooter,
|
|
6271
6441
|
proxyConfig,
|
|
6272
6442
|
toolbarConfig,
|
|
6273
6443
|
pagerConfig,
|
|
@@ -6285,6 +6455,8 @@ function getViewTypeLevel(type) {
|
|
|
6285
6455
|
const {
|
|
6286
6456
|
beforeQuery,
|
|
6287
6457
|
afterQuery,
|
|
6458
|
+
beforeQueryFooter,
|
|
6459
|
+
afterQueryFooter,
|
|
6288
6460
|
beforeDelete,
|
|
6289
6461
|
afterDelete,
|
|
6290
6462
|
beforeSave,
|
|
@@ -6349,15 +6521,16 @@ function getViewTypeLevel(type) {
|
|
|
6349
6521
|
case 'reload':
|
|
6350
6522
|
case 'query':
|
|
6351
6523
|
{
|
|
6352
|
-
const
|
|
6353
|
-
const
|
|
6354
|
-
const
|
|
6355
|
-
if (
|
|
6524
|
+
const qMethods = ajax.query;
|
|
6525
|
+
const qsMethods = ajax.querySuccess;
|
|
6526
|
+
const qeMethods = ajax.queryError;
|
|
6527
|
+
if (qMethods) {
|
|
6356
6528
|
const isInited = code === 'initial';
|
|
6357
6529
|
const isReload = code === 'reload';
|
|
6358
6530
|
if (!isInited && reactData.tableLoading) {
|
|
6359
6531
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
6360
6532
|
}
|
|
6533
|
+
let operPromise = null;
|
|
6361
6534
|
let sortList = [];
|
|
6362
6535
|
let filterList = [];
|
|
6363
6536
|
let pageParams = {};
|
|
@@ -6421,7 +6594,7 @@ function getViewTypeLevel(type) {
|
|
|
6421
6594
|
} else {
|
|
6422
6595
|
if ($xeTable) {
|
|
6423
6596
|
if (isReload) {
|
|
6424
|
-
$xeTable.clearAll();
|
|
6597
|
+
operPromise = $xeTable.clearAll();
|
|
6425
6598
|
} else {
|
|
6426
6599
|
sortList = $xeTable.getSortColumns();
|
|
6427
6600
|
filterList = $xeTable.getCheckedFilters();
|
|
@@ -6441,31 +6614,27 @@ function getViewTypeLevel(type) {
|
|
|
6441
6614
|
sorts: sortList,
|
|
6442
6615
|
filters: filterList,
|
|
6443
6616
|
form: formData,
|
|
6444
|
-
options:
|
|
6617
|
+
options: qMethods
|
|
6445
6618
|
};
|
|
6446
6619
|
reactData.sortData = sortList;
|
|
6447
6620
|
reactData.filterData = filterList;
|
|
6448
6621
|
reactData.tableLoading = true;
|
|
6449
|
-
return Promise.resolve((beforeQuery ||
|
|
6622
|
+
return Promise.all([Promise.resolve((beforeQuery || qMethods)(commitParams, ...args)), operPromise]).then(([rest]) => {
|
|
6450
6623
|
let tableData = [];
|
|
6451
6624
|
reactData.tableLoading = false;
|
|
6452
6625
|
if (rest) {
|
|
6626
|
+
const reParams = {
|
|
6627
|
+
data: rest,
|
|
6628
|
+
$table: $xeTable,
|
|
6629
|
+
$grid: null,
|
|
6630
|
+
$gantt: $xeGantt
|
|
6631
|
+
};
|
|
6453
6632
|
if (pagerConfig && isEnableConf(pagerOpts)) {
|
|
6454
6633
|
const totalProp = resConfigs.total;
|
|
6455
|
-
const total = (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(totalProp) ? totalProp(
|
|
6456
|
-
data: rest,
|
|
6457
|
-
$table: $xeTable,
|
|
6458
|
-
$grid: null,
|
|
6459
|
-
$gantt: $xeGantt
|
|
6460
|
-
}) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(rest, totalProp || 'page.total')) || 0;
|
|
6634
|
+
const total = (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(totalProp) ? totalProp(reParams) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(rest, totalProp || 'page.total')) || 0;
|
|
6461
6635
|
tablePage.total = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(total);
|
|
6462
6636
|
const resultProp = resConfigs.result;
|
|
6463
|
-
tableData = (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(resultProp) ? resultProp(
|
|
6464
|
-
data: rest,
|
|
6465
|
-
$table: $xeTable,
|
|
6466
|
-
$grid: null,
|
|
6467
|
-
$gantt: $xeGantt
|
|
6468
|
-
}) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(rest, resultProp || 'result')) || [];
|
|
6637
|
+
tableData = (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(resultProp) ? resultProp(reParams) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(rest, resultProp || 'result')) || [];
|
|
6469
6638
|
// 检验当前页码,不能超出当前最大页数
|
|
6470
6639
|
const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
|
|
6471
6640
|
if (tablePage.currentPage > pageCount) {
|
|
@@ -6473,18 +6642,25 @@ function getViewTypeLevel(type) {
|
|
|
6473
6642
|
}
|
|
6474
6643
|
} else {
|
|
6475
6644
|
const listProp = resConfigs.list;
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
|
|
6481
|
-
|
|
6645
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rest)) {
|
|
6646
|
+
tableData = rest;
|
|
6647
|
+
} else if (listProp) {
|
|
6648
|
+
tableData = (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(listProp) ? listProp(reParams) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(rest, listProp)) || [];
|
|
6649
|
+
}
|
|
6650
|
+
}
|
|
6651
|
+
if (showFooter) {
|
|
6652
|
+
const fdProp = resConfigs.footerData;
|
|
6653
|
+
const footerList = fdProp ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(fdProp) ? fdProp(reParams) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(rest, fdProp) : [];
|
|
6654
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(footerList)) {
|
|
6655
|
+
reactData.footerData = footerList;
|
|
6656
|
+
}
|
|
6482
6657
|
}
|
|
6483
6658
|
}
|
|
6484
6659
|
if ($xeTable) {
|
|
6485
6660
|
$xeTable.loadData(tableData);
|
|
6486
6661
|
} else {
|
|
6487
6662
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
6663
|
+
const $xeTable = refTable.value;
|
|
6488
6664
|
if ($xeTable) {
|
|
6489
6665
|
$xeTable.loadData(tableData);
|
|
6490
6666
|
}
|
|
@@ -6493,8 +6669,8 @@ function getViewTypeLevel(type) {
|
|
|
6493
6669
|
if (afterQuery) {
|
|
6494
6670
|
afterQuery(commitParams, ...args);
|
|
6495
6671
|
}
|
|
6496
|
-
if (
|
|
6497
|
-
|
|
6672
|
+
if (qsMethods) {
|
|
6673
|
+
qsMethods({
|
|
6498
6674
|
...commitParams,
|
|
6499
6675
|
response: rest
|
|
6500
6676
|
});
|
|
@@ -6504,8 +6680,58 @@ function getViewTypeLevel(type) {
|
|
|
6504
6680
|
};
|
|
6505
6681
|
}).catch(rest => {
|
|
6506
6682
|
reactData.tableLoading = false;
|
|
6507
|
-
if (
|
|
6508
|
-
|
|
6683
|
+
if (qeMethods) {
|
|
6684
|
+
qeMethods({
|
|
6685
|
+
...commitParams,
|
|
6686
|
+
response: rest
|
|
6687
|
+
});
|
|
6688
|
+
}
|
|
6689
|
+
return {
|
|
6690
|
+
status: false
|
|
6691
|
+
};
|
|
6692
|
+
});
|
|
6693
|
+
} else {
|
|
6694
|
+
errLog('vxe.error.notFunc', ['[gantt] proxy-config.ajax.query']);
|
|
6695
|
+
}
|
|
6696
|
+
break;
|
|
6697
|
+
}
|
|
6698
|
+
case 'queryFooter':
|
|
6699
|
+
{
|
|
6700
|
+
const qfMethods = ajax.queryFooter;
|
|
6701
|
+
const qfSuccessMethods = ajax.queryFooterSuccess;
|
|
6702
|
+
const qfErrorMethods = ajax.queryFooterError;
|
|
6703
|
+
if (qfMethods) {
|
|
6704
|
+
let filterList = [];
|
|
6705
|
+
if ($xeTable) {
|
|
6706
|
+
filterList = $xeTable.getCheckedFilters();
|
|
6707
|
+
}
|
|
6708
|
+
const commitParams = {
|
|
6709
|
+
$table: $xeTable,
|
|
6710
|
+
$grid: null,
|
|
6711
|
+
$gantt: $xeGantt,
|
|
6712
|
+
code,
|
|
6713
|
+
button,
|
|
6714
|
+
filters: filterList,
|
|
6715
|
+
form: formData,
|
|
6716
|
+
options: qfMethods
|
|
6717
|
+
};
|
|
6718
|
+
return Promise.resolve((beforeQueryFooter || qfMethods)(commitParams, ...args)).then(rest => {
|
|
6719
|
+
reactData.footerData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rest) ? rest : [];
|
|
6720
|
+
if (afterQueryFooter) {
|
|
6721
|
+
afterQueryFooter(commitParams, ...args);
|
|
6722
|
+
}
|
|
6723
|
+
if (qfSuccessMethods) {
|
|
6724
|
+
qfSuccessMethods({
|
|
6725
|
+
...commitParams,
|
|
6726
|
+
response: rest
|
|
6727
|
+
});
|
|
6728
|
+
}
|
|
6729
|
+
return {
|
|
6730
|
+
status: true
|
|
6731
|
+
};
|
|
6732
|
+
}).catch(rest => {
|
|
6733
|
+
if (qfErrorMethods) {
|
|
6734
|
+
qfErrorMethods({
|
|
6509
6735
|
...commitParams,
|
|
6510
6736
|
response: rest
|
|
6511
6737
|
});
|
|
@@ -6515,16 +6741,16 @@ function getViewTypeLevel(type) {
|
|
|
6515
6741
|
};
|
|
6516
6742
|
});
|
|
6517
6743
|
} else {
|
|
6518
|
-
errLog('vxe.error.notFunc', ['proxy-config.ajax.
|
|
6744
|
+
errLog('vxe.error.notFunc', ['[gantt] proxy-config.ajax.queryFooter']);
|
|
6519
6745
|
}
|
|
6520
6746
|
break;
|
|
6521
6747
|
}
|
|
6522
6748
|
case 'delete':
|
|
6523
6749
|
{
|
|
6524
|
-
const
|
|
6750
|
+
const dMethods = ajax.delete;
|
|
6525
6751
|
const deleteSuccessMethods = ajax.deleteSuccess;
|
|
6526
6752
|
const deleteErrorMethods = ajax.deleteError;
|
|
6527
|
-
if (
|
|
6753
|
+
if (dMethods) {
|
|
6528
6754
|
const selectRecords = $xeGantt.getCheckboxRecords();
|
|
6529
6755
|
const removeRecords = selectRecords.filter(row => !$xeTable.isInsertByRow(row));
|
|
6530
6756
|
const body = {
|
|
@@ -6538,7 +6764,7 @@ function getViewTypeLevel(type) {
|
|
|
6538
6764
|
button,
|
|
6539
6765
|
body,
|
|
6540
6766
|
form: formData,
|
|
6541
|
-
options:
|
|
6767
|
+
options: dMethods
|
|
6542
6768
|
};
|
|
6543
6769
|
if (selectRecords.length) {
|
|
6544
6770
|
return handleDeleteRow(code, 'vxe.grid.deleteSelectRecord', () => {
|
|
@@ -6546,7 +6772,7 @@ function getViewTypeLevel(type) {
|
|
|
6546
6772
|
return $xeTable.remove(selectRecords);
|
|
6547
6773
|
}
|
|
6548
6774
|
reactData.tableLoading = true;
|
|
6549
|
-
return Promise.resolve((beforeDelete ||
|
|
6775
|
+
return Promise.resolve((beforeDelete || dMethods)(commitParams, ...args)).then(rest => {
|
|
6550
6776
|
reactData.tableLoading = false;
|
|
6551
6777
|
$xeTable.setPendingRow(removeRecords, false);
|
|
6552
6778
|
if (isRespMsg) {
|
|
@@ -6560,7 +6786,10 @@ function getViewTypeLevel(type) {
|
|
|
6560
6786
|
if (afterDelete) {
|
|
6561
6787
|
afterDelete(commitParams, ...args);
|
|
6562
6788
|
} else {
|
|
6789
|
+
internalData.uFoot = true;
|
|
6563
6790
|
$xeGantt.commitProxy('query');
|
|
6791
|
+
internalData.uFoot = false;
|
|
6792
|
+
updateQueryFooter();
|
|
6564
6793
|
}
|
|
6565
6794
|
if (deleteSuccessMethods) {
|
|
6566
6795
|
deleteSuccessMethods({
|
|
@@ -6605,7 +6834,7 @@ function getViewTypeLevel(type) {
|
|
|
6605
6834
|
}
|
|
6606
6835
|
}
|
|
6607
6836
|
} else {
|
|
6608
|
-
errLog('vxe.error.notFunc', ['proxy-config.ajax.delete']);
|
|
6837
|
+
errLog('vxe.error.notFunc', ['[gantt] proxy-config.ajax.delete']);
|
|
6609
6838
|
}
|
|
6610
6839
|
break;
|
|
6611
6840
|
}
|
|
@@ -6666,7 +6895,10 @@ function getViewTypeLevel(type) {
|
|
|
6666
6895
|
if (afterSave) {
|
|
6667
6896
|
afterSave(commitParams, ...args);
|
|
6668
6897
|
} else {
|
|
6898
|
+
internalData.uFoot = true;
|
|
6669
6899
|
$xeGantt.commitProxy('query');
|
|
6900
|
+
internalData.uFoot = false;
|
|
6901
|
+
updateQueryFooter();
|
|
6670
6902
|
}
|
|
6671
6903
|
if (saveSuccessMethods) {
|
|
6672
6904
|
saveSuccessMethods({
|
|
@@ -6711,7 +6943,7 @@ function getViewTypeLevel(type) {
|
|
|
6711
6943
|
}
|
|
6712
6944
|
});
|
|
6713
6945
|
} else {
|
|
6714
|
-
errLog('vxe.error.notFunc', ['proxy-config.ajax.save']);
|
|
6946
|
+
errLog('vxe.error.notFunc', ['[gantt] proxy-config.ajax.save']);
|
|
6715
6947
|
}
|
|
6716
6948
|
break;
|
|
6717
6949
|
}
|
|
@@ -6729,7 +6961,7 @@ function getViewTypeLevel(type) {
|
|
|
6729
6961
|
$gantt: $xeGantt
|
|
6730
6962
|
}, ...args);
|
|
6731
6963
|
} else {
|
|
6732
|
-
errLog('vxe.error.notCommands', [code]);
|
|
6964
|
+
errLog('vxe.error.notCommands', [`[grid] ${code}`]);
|
|
6733
6965
|
}
|
|
6734
6966
|
}
|
|
6735
6967
|
}
|
|
@@ -6948,6 +7180,9 @@ function getViewTypeLevel(type) {
|
|
|
6948
7180
|
* 获取需要排除的高度
|
|
6949
7181
|
*/
|
|
6950
7182
|
getExcludeHeight() {
|
|
7183
|
+
const {
|
|
7184
|
+
height
|
|
7185
|
+
} = props;
|
|
6951
7186
|
const {
|
|
6952
7187
|
isZMax
|
|
6953
7188
|
} = reactData;
|
|
@@ -6959,7 +7194,10 @@ function getViewTypeLevel(type) {
|
|
|
6959
7194
|
const bottomWrapper = refBottomWrapper.value;
|
|
6960
7195
|
const pagerWrapper = refPagerWrapper.value;
|
|
6961
7196
|
const parentEl = el.parentElement;
|
|
6962
|
-
|
|
7197
|
+
let parentPaddingSize = 0;
|
|
7198
|
+
if (parentEl && (height === '100%' || height === 'auto')) {
|
|
7199
|
+
parentPaddingSize = isZMax ? 0 : getPaddingTopBottomSize(parentEl);
|
|
7200
|
+
}
|
|
6963
7201
|
return parentPaddingSize + getPaddingTopBottomSize(el) + getOffsetHeight(formWrapper) + getOffsetHeight(toolbarWrapper) + getOffsetHeight(topWrapper) + getOffsetHeight(bottomWrapper) + getOffsetHeight(pagerWrapper);
|
|
6964
7202
|
}
|
|
6965
7203
|
return 0;
|
|
@@ -6976,14 +7214,26 @@ function getViewTypeLevel(type) {
|
|
|
6976
7214
|
const {
|
|
6977
7215
|
code
|
|
6978
7216
|
} = params;
|
|
6979
|
-
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
isReload: code === 'reload'
|
|
6984
|
-
}, evnt);
|
|
7217
|
+
if (code) {
|
|
7218
|
+
const isUf = ['reload', 'delete', 'save'].includes(code);
|
|
7219
|
+
if (isUf) {
|
|
7220
|
+
internalData.uFoot = true;
|
|
6985
7221
|
}
|
|
6986
|
-
|
|
7222
|
+
const rest = $xeGantt.commitProxy(params, evnt).then(rest => {
|
|
7223
|
+
if (rest && rest.status && ['query', 'reload', 'delete', 'save'].includes(code)) {
|
|
7224
|
+
$xeGantt.dispatchEvent(code === 'delete' || code === 'save' ? `proxy-${code}` : 'proxy-query', {
|
|
7225
|
+
...rest,
|
|
7226
|
+
isReload: code === 'reload'
|
|
7227
|
+
}, evnt);
|
|
7228
|
+
}
|
|
7229
|
+
});
|
|
7230
|
+
internalData.uFoot = false;
|
|
7231
|
+
if (isUf) {
|
|
7232
|
+
updateQueryFooter();
|
|
7233
|
+
}
|
|
7234
|
+
return rest;
|
|
7235
|
+
}
|
|
7236
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
6987
7237
|
},
|
|
6988
7238
|
triggerToolbarBtnEvent(button, evnt) {
|
|
6989
7239
|
$xeGantt.triggerToolbarCommitEvent(button, evnt);
|