vxe-table 3.13.19 → 3.13.20
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 +4 -0
- package/es/style.css +1 -1
- package/es/table/src/body.js +11 -6
- package/es/table/src/footer.js +7 -2
- package/es/table/src/methods.js +182 -53
- package/es/table/src/util.js +18 -5
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +4 -0
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +250 -78
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/body.js +10 -5
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +7 -2
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/methods.js +209 -64
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/util.js +21 -5
- package/lib/table/src/util.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 +5 -0
- package/packages/table/src/body.ts +10 -5
- package/packages/table/src/footer.ts +7 -2
- package/packages/table/src/methods.ts +202 -60
- package/packages/table/src/util.ts +20 -5
- /package/es/{iconfont.1741224103306.ttf → iconfont.1741333380103.ttf} +0 -0
- /package/es/{iconfont.1741224103306.woff → iconfont.1741333380103.woff} +0 -0
- /package/es/{iconfont.1741224103306.woff2 → iconfont.1741333380103.woff2} +0 -0
- /package/lib/{iconfont.1741224103306.ttf → iconfont.1741333380103.ttf} +0 -0
- /package/lib/{iconfont.1741224103306.woff → iconfont.1741333380103.woff} +0 -0
- /package/lib/{iconfont.1741224103306.woff2 → iconfont.1741333380103.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -3201,7 +3201,7 @@ function getClass(property, params) {
|
|
|
3201
3201
|
;// ./packages/ui/index.ts
|
|
3202
3202
|
|
|
3203
3203
|
|
|
3204
|
-
const version = "3.13.
|
|
3204
|
+
const version = "3.13.20";
|
|
3205
3205
|
core_.VxeUI.version = version;
|
|
3206
3206
|
core_.VxeUI.tableVersion = version;
|
|
3207
3207
|
core_.VxeUI.setConfig({
|
|
@@ -3828,7 +3828,7 @@ var es_iterator_map = __webpack_require__(1701);
|
|
|
3828
3828
|
const {
|
|
3829
3829
|
log: log_log
|
|
3830
3830
|
} = core_.VxeUI;
|
|
3831
|
-
const log_version = `table v${"3.13.
|
|
3831
|
+
const log_version = `table v${"3.13.20"}`;
|
|
3832
3832
|
const warnLog = log_log.create('warn', log_version);
|
|
3833
3833
|
const errLog = log_log.create('error', log_version);
|
|
3834
3834
|
;// ./packages/table/src/columnInfo.ts
|
|
@@ -4100,13 +4100,19 @@ function getRowUniqueId() {
|
|
|
4100
4100
|
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId('row_');
|
|
4101
4101
|
}
|
|
4102
4102
|
// 行主键 key
|
|
4103
|
-
function getRowkey($
|
|
4104
|
-
|
|
4103
|
+
function getRowkey($xeTable) {
|
|
4104
|
+
const props = $xeTable;
|
|
4105
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
4106
|
+
return `${props.rowId || rowOpts.keyField || '_X_ROW_KEY'}`;
|
|
4105
4107
|
}
|
|
4106
4108
|
// 行主键 value
|
|
4107
4109
|
function getRowid($xetable, row) {
|
|
4108
4110
|
const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, getRowkey($xetable));
|
|
4109
|
-
return
|
|
4111
|
+
return encodeRowid(rowid);
|
|
4112
|
+
}
|
|
4113
|
+
// 编码行主键
|
|
4114
|
+
function encodeRowid(rowVal) {
|
|
4115
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(rowVal) ? '' : encodeURIComponent(rowVal);
|
|
4110
4116
|
}
|
|
4111
4117
|
function getPaddingLeftRightSize(elem) {
|
|
4112
4118
|
if (elem) {
|
|
@@ -4132,12 +4138,19 @@ function getCellHeight(height) {
|
|
|
4132
4138
|
}
|
|
4133
4139
|
return height || 0;
|
|
4134
4140
|
}
|
|
4135
|
-
function handleFieldOrColumn(
|
|
4141
|
+
function handleFieldOrColumn($xeTable, fieldOrColumn) {
|
|
4136
4142
|
if (fieldOrColumn) {
|
|
4137
|
-
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(fieldOrColumn) ?
|
|
4143
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(fieldOrColumn) ? $xeTable.getColumnByField(`${fieldOrColumn}`) : fieldOrColumn;
|
|
4138
4144
|
}
|
|
4139
4145
|
return null;
|
|
4140
4146
|
}
|
|
4147
|
+
const handleRowidOrRow = ($xeTable, rowidOrRow) => {
|
|
4148
|
+
if (rowidOrRow) {
|
|
4149
|
+
const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(rowidOrRow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(rowidOrRow) ? rowidOrRow : getRowid($xeTable, rowidOrRow);
|
|
4150
|
+
return $xeTable.getRowById(rowid);
|
|
4151
|
+
}
|
|
4152
|
+
return null;
|
|
4153
|
+
};
|
|
4141
4154
|
// 组装列配置
|
|
4142
4155
|
function assembleColumn(_vm) {
|
|
4143
4156
|
const {
|
|
@@ -8613,6 +8626,10 @@ const Methods = {
|
|
|
8613
8626
|
}
|
|
8614
8627
|
return [];
|
|
8615
8628
|
},
|
|
8629
|
+
getEl() {
|
|
8630
|
+
const $xeTable = this;
|
|
8631
|
+
return $xeTable.$refs.refElem;
|
|
8632
|
+
},
|
|
8616
8633
|
/**
|
|
8617
8634
|
* 获取父容器元素
|
|
8618
8635
|
*/
|
|
@@ -9717,25 +9734,31 @@ const Methods = {
|
|
|
9717
9734
|
},
|
|
9718
9735
|
/**
|
|
9719
9736
|
* 检查行或列数据是否发生改变
|
|
9720
|
-
* @param {Row}
|
|
9737
|
+
* @param {Row} rowOrId 行对象
|
|
9721
9738
|
* @param {String} field 字段名
|
|
9722
9739
|
*/
|
|
9723
|
-
isUpdateByRow(
|
|
9740
|
+
isUpdateByRow(rowOrId, field) {
|
|
9741
|
+
const $xeTable = this;
|
|
9742
|
+
const props = $xeTable;
|
|
9743
|
+
const internalData = $xeTable;
|
|
9744
|
+
const {
|
|
9745
|
+
keepSource
|
|
9746
|
+
} = props;
|
|
9724
9747
|
const {
|
|
9725
9748
|
tableFullColumn,
|
|
9726
|
-
|
|
9727
|
-
sourceDataRowIdData
|
|
9728
|
-
|
|
9729
|
-
} = this;
|
|
9749
|
+
fullDataRowIdData,
|
|
9750
|
+
sourceDataRowIdData
|
|
9751
|
+
} = internalData;
|
|
9730
9752
|
if (keepSource) {
|
|
9731
|
-
const rowid = getRowid(
|
|
9753
|
+
const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(rowOrId) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(rowOrId) ? rowOrId : getRowid($xeTable, rowOrId);
|
|
9754
|
+
const rowRest = fullDataRowIdData[rowid];
|
|
9732
9755
|
// 新增的数据不需要检测
|
|
9733
|
-
if (!
|
|
9756
|
+
if (!rowRest) {
|
|
9734
9757
|
return false;
|
|
9735
9758
|
}
|
|
9736
|
-
const
|
|
9737
|
-
|
|
9738
|
-
|
|
9759
|
+
const row = rowRest.row;
|
|
9760
|
+
const oRow = sourceDataRowIdData[rowid];
|
|
9761
|
+
if (oRow) {
|
|
9739
9762
|
if (arguments.length > 1) {
|
|
9740
9763
|
return !eqCellValue(oRow, row, field);
|
|
9741
9764
|
}
|
|
@@ -9797,6 +9820,113 @@ const Methods = {
|
|
|
9797
9820
|
tableColumn: this.tableColumn.slice(0)
|
|
9798
9821
|
};
|
|
9799
9822
|
},
|
|
9823
|
+
/**
|
|
9824
|
+
* 移动列到指定列的位置
|
|
9825
|
+
* @param fieldOrColumn
|
|
9826
|
+
* @param targetFieldOrColumn
|
|
9827
|
+
* @param options
|
|
9828
|
+
*/
|
|
9829
|
+
moveColumnTo(fieldOrColumn, targetFieldOrColumn, options) {
|
|
9830
|
+
const $xeTable = this;
|
|
9831
|
+
const internalData = $xeTable;
|
|
9832
|
+
const {
|
|
9833
|
+
fullColumnIdData,
|
|
9834
|
+
visibleColumn
|
|
9835
|
+
} = internalData;
|
|
9836
|
+
const {
|
|
9837
|
+
dragToChild,
|
|
9838
|
+
dragPos,
|
|
9839
|
+
isCrossDrag
|
|
9840
|
+
} = Object.assign({}, options);
|
|
9841
|
+
const dragCol = handleFieldOrColumn($xeTable, fieldOrColumn);
|
|
9842
|
+
let prevDragCol = null;
|
|
9843
|
+
const colRest = dragCol ? fullColumnIdData[dragCol.id] : null;
|
|
9844
|
+
let defPos = 'left';
|
|
9845
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(targetFieldOrColumn)) {
|
|
9846
|
+
if (colRest && targetFieldOrColumn) {
|
|
9847
|
+
let currList = colRest.items;
|
|
9848
|
+
let offsetIndex = colRest._index + targetFieldOrColumn;
|
|
9849
|
+
if (isCrossDrag) {
|
|
9850
|
+
currList = visibleColumn;
|
|
9851
|
+
offsetIndex = colRest._index + targetFieldOrColumn;
|
|
9852
|
+
}
|
|
9853
|
+
if (offsetIndex > 0 && offsetIndex < currList.length - 1) {
|
|
9854
|
+
prevDragCol = currList[offsetIndex];
|
|
9855
|
+
}
|
|
9856
|
+
if (targetFieldOrColumn > 0) {
|
|
9857
|
+
defPos = 'right';
|
|
9858
|
+
}
|
|
9859
|
+
}
|
|
9860
|
+
} else {
|
|
9861
|
+
prevDragCol = handleFieldOrColumn($xeTable, targetFieldOrColumn);
|
|
9862
|
+
const targetColRest = prevDragCol ? fullColumnIdData[prevDragCol.id] : null;
|
|
9863
|
+
if (colRest && targetColRest) {
|
|
9864
|
+
if (targetColRest._index > colRest._index) {
|
|
9865
|
+
defPos = 'right';
|
|
9866
|
+
}
|
|
9867
|
+
}
|
|
9868
|
+
}
|
|
9869
|
+
return $xeTable.handleColDragSwapEvent(null, true, dragCol, prevDragCol, dragPos || defPos, dragToChild === true);
|
|
9870
|
+
},
|
|
9871
|
+
/**
|
|
9872
|
+
* 移动行到指定行的位置
|
|
9873
|
+
* @param rowidOrRow
|
|
9874
|
+
* @param targetRowidOrRow
|
|
9875
|
+
* @param options
|
|
9876
|
+
*/
|
|
9877
|
+
moveRowTo(rowidOrRow, targetRowidOrRow, options) {
|
|
9878
|
+
const $xeTable = this;
|
|
9879
|
+
const props = $xeTable;
|
|
9880
|
+
const internalData = $xeTable;
|
|
9881
|
+
const {
|
|
9882
|
+
treeConfig
|
|
9883
|
+
} = props;
|
|
9884
|
+
const {
|
|
9885
|
+
fullAllDataRowIdData,
|
|
9886
|
+
afterFullData
|
|
9887
|
+
} = internalData;
|
|
9888
|
+
const {
|
|
9889
|
+
dragToChild,
|
|
9890
|
+
dragPos,
|
|
9891
|
+
isCrossDrag
|
|
9892
|
+
} = Object.assign({}, options);
|
|
9893
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
9894
|
+
const dragRow = handleRowidOrRow($xeTable, rowidOrRow);
|
|
9895
|
+
let prevDragRow = null;
|
|
9896
|
+
let defPos = 'top';
|
|
9897
|
+
const rowRest = dragRow ? fullAllDataRowIdData[getRowid($xeTable, dragRow)] : null;
|
|
9898
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(targetRowidOrRow)) {
|
|
9899
|
+
if (rowRest && targetRowidOrRow) {
|
|
9900
|
+
let currList = afterFullData;
|
|
9901
|
+
let offsetIndex = rowRest._index + targetRowidOrRow;
|
|
9902
|
+
if (treeConfig) {
|
|
9903
|
+
currList = rowRest.items;
|
|
9904
|
+
if (treeOpts.transform) {
|
|
9905
|
+
offsetIndex = rowRest.treeIndex + targetRowidOrRow;
|
|
9906
|
+
if (isCrossDrag) {
|
|
9907
|
+
currList = afterFullData;
|
|
9908
|
+
offsetIndex = rowRest._index + targetRowidOrRow;
|
|
9909
|
+
}
|
|
9910
|
+
}
|
|
9911
|
+
}
|
|
9912
|
+
if (offsetIndex >= 0 && offsetIndex <= currList.length - 1) {
|
|
9913
|
+
prevDragRow = currList[offsetIndex];
|
|
9914
|
+
}
|
|
9915
|
+
if (targetRowidOrRow > 0) {
|
|
9916
|
+
defPos = 'bottom';
|
|
9917
|
+
}
|
|
9918
|
+
}
|
|
9919
|
+
} else {
|
|
9920
|
+
prevDragRow = handleRowidOrRow($xeTable, targetRowidOrRow);
|
|
9921
|
+
const targetRowRest = prevDragRow ? fullAllDataRowIdData[getRowid($xeTable, prevDragRow)] : null;
|
|
9922
|
+
if (rowRest && targetRowRest) {
|
|
9923
|
+
if (targetRowRest._index > rowRest._index) {
|
|
9924
|
+
defPos = 'bottom';
|
|
9925
|
+
}
|
|
9926
|
+
}
|
|
9927
|
+
}
|
|
9928
|
+
return $xeTable.handleRowDragSwapEvent(null, true, dragRow, prevDragRow, dragPos || defPos, dragToChild === true);
|
|
9929
|
+
},
|
|
9800
9930
|
/**
|
|
9801
9931
|
* 获取表格的全量列
|
|
9802
9932
|
*/
|
|
@@ -9819,16 +9949,26 @@ const Methods = {
|
|
|
9819
9949
|
* 用于多选行,获取已选中的数据
|
|
9820
9950
|
*/
|
|
9821
9951
|
getCheckboxRecords(isFull) {
|
|
9952
|
+
const $xeTable = this;
|
|
9953
|
+
const props = $xeTable;
|
|
9954
|
+
const reactData = $xeTable;
|
|
9955
|
+
const internalData = $xeTable;
|
|
9956
|
+
const {
|
|
9957
|
+
treeConfig
|
|
9958
|
+
} = props;
|
|
9959
|
+
const {
|
|
9960
|
+
selectCheckboxMaps
|
|
9961
|
+
} = reactData;
|
|
9822
9962
|
const {
|
|
9823
9963
|
tableFullData,
|
|
9824
9964
|
afterFullData,
|
|
9825
|
-
treeConfig,
|
|
9826
|
-
treeOpts,
|
|
9827
|
-
checkboxOpts,
|
|
9828
|
-
tableFullTreeData,
|
|
9829
9965
|
afterTreeFullData,
|
|
9966
|
+
tableFullTreeData,
|
|
9967
|
+
fullDataRowIdData,
|
|
9830
9968
|
afterFullRowMaps
|
|
9831
|
-
} =
|
|
9969
|
+
} = internalData;
|
|
9970
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
9971
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
9832
9972
|
const {
|
|
9833
9973
|
transform,
|
|
9834
9974
|
mapChildrenField
|
|
@@ -9837,21 +9977,18 @@ const Methods = {
|
|
|
9837
9977
|
checkField
|
|
9838
9978
|
} = checkboxOpts;
|
|
9839
9979
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
9840
|
-
const currTableData = isFull ? transform ? tableFullTreeData : tableFullData : transform ? afterTreeFullData : afterFullData;
|
|
9841
9980
|
let rowList = [];
|
|
9842
9981
|
if (checkField) {
|
|
9843
9982
|
if (treeConfig) {
|
|
9983
|
+
const currTableData = isFull ? transform ? tableFullTreeData : tableFullData : transform ? afterTreeFullData : afterFullData;
|
|
9844
9984
|
rowList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().filterTree(currTableData, row => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField), {
|
|
9845
9985
|
children: transform ? mapChildrenField : childrenField
|
|
9846
9986
|
});
|
|
9847
9987
|
} else {
|
|
9988
|
+
const currTableData = isFull ? tableFullData : afterFullData;
|
|
9848
9989
|
rowList = currTableData.filter(row => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, checkField));
|
|
9849
9990
|
}
|
|
9850
9991
|
} else {
|
|
9851
|
-
const {
|
|
9852
|
-
selectCheckboxMaps,
|
|
9853
|
-
fullDataRowIdData
|
|
9854
|
-
} = this;
|
|
9855
9992
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(selectCheckboxMaps, (row, rowid) => {
|
|
9856
9993
|
if (isFull) {
|
|
9857
9994
|
if (fullDataRowIdData[rowid]) {
|
|
@@ -13623,6 +13760,9 @@ const Methods = {
|
|
|
13623
13760
|
} = internalData;
|
|
13624
13761
|
const dEndMethod = dragEndMethod || (dragConfig ? dragConfig.dragEndMethod : null);
|
|
13625
13762
|
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
|
|
13763
|
+
const errRest = {
|
|
13764
|
+
status: false
|
|
13765
|
+
};
|
|
13626
13766
|
if (prevDragRow && dragRow) {
|
|
13627
13767
|
// 判断是否有拖动
|
|
13628
13768
|
if (prevDragRow !== dragRow) {
|
|
@@ -13637,7 +13777,7 @@ const Methods = {
|
|
|
13637
13777
|
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
13638
13778
|
return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then(status => {
|
|
13639
13779
|
if (!status) {
|
|
13640
|
-
return;
|
|
13780
|
+
return errRest;
|
|
13641
13781
|
}
|
|
13642
13782
|
let oafIndex = -1;
|
|
13643
13783
|
let nafIndex = -1;
|
|
@@ -13668,11 +13808,11 @@ const Methods = {
|
|
|
13668
13808
|
if (isPeerDrag && !isCrossDrag) {
|
|
13669
13809
|
if (oldRest.row[parentField] !== newRest.row[parentField]) {
|
|
13670
13810
|
// 非同级
|
|
13671
|
-
return;
|
|
13811
|
+
return errRest;
|
|
13672
13812
|
}
|
|
13673
13813
|
} else {
|
|
13674
13814
|
if (!isCrossDrag) {
|
|
13675
|
-
return;
|
|
13815
|
+
return errRest;
|
|
13676
13816
|
}
|
|
13677
13817
|
if (oldAllMaps[newRowid]) {
|
|
13678
13818
|
isSelfToChildStatus = true;
|
|
@@ -13683,19 +13823,19 @@ const Methods = {
|
|
|
13683
13823
|
content: methods_getI18n('vxe.error.treeDragChild')
|
|
13684
13824
|
});
|
|
13685
13825
|
}
|
|
13686
|
-
return;
|
|
13826
|
+
return errRest;
|
|
13687
13827
|
}
|
|
13688
13828
|
}
|
|
13689
13829
|
}
|
|
13690
13830
|
} else if (oldLevel) {
|
|
13691
13831
|
// 子到根
|
|
13692
13832
|
if (!isCrossDrag) {
|
|
13693
|
-
return;
|
|
13833
|
+
return errRest;
|
|
13694
13834
|
}
|
|
13695
13835
|
} else if (newLevel) {
|
|
13696
13836
|
// 根到子
|
|
13697
13837
|
if (!isCrossDrag) {
|
|
13698
|
-
return;
|
|
13838
|
+
return errRest;
|
|
13699
13839
|
}
|
|
13700
13840
|
if (oldAllMaps[newRowid]) {
|
|
13701
13841
|
isSelfToChildStatus = true;
|
|
@@ -13706,7 +13846,7 @@ const Methods = {
|
|
|
13706
13846
|
content: methods_getI18n('vxe.error.treeDragChild')
|
|
13707
13847
|
});
|
|
13708
13848
|
}
|
|
13709
|
-
return;
|
|
13849
|
+
return errRest;
|
|
13710
13850
|
}
|
|
13711
13851
|
}
|
|
13712
13852
|
} else {
|
|
@@ -13764,26 +13904,34 @@ const Methods = {
|
|
|
13764
13904
|
if (reactData.scrollYLoad) {
|
|
13765
13905
|
$xeTable.updateScrollYSpace();
|
|
13766
13906
|
}
|
|
13767
|
-
|
|
13907
|
+
if (evnt) {
|
|
13908
|
+
$xeTable.dispatchEvent('row-dragend', {
|
|
13909
|
+
oldRow: dragRow,
|
|
13910
|
+
newRow: prevDragRow,
|
|
13911
|
+
dragRow,
|
|
13912
|
+
dragPos: prevDragPos,
|
|
13913
|
+
dragToChild: isDragToChildFlag,
|
|
13914
|
+
offsetIndex: dragOffsetIndex,
|
|
13915
|
+
_index: {
|
|
13916
|
+
newIndex: nafIndex,
|
|
13917
|
+
oldIndex: oafIndex
|
|
13918
|
+
}
|
|
13919
|
+
}, evnt);
|
|
13920
|
+
}
|
|
13921
|
+
return $xeTable.$nextTick().then(() => {
|
|
13768
13922
|
$xeTable.updateCellAreas();
|
|
13769
13923
|
$xeTable.recalculate();
|
|
13924
|
+
}).then(() => {
|
|
13925
|
+
return {
|
|
13926
|
+
status: true
|
|
13927
|
+
};
|
|
13770
13928
|
});
|
|
13771
|
-
|
|
13772
|
-
|
|
13773
|
-
|
|
13774
|
-
dragRow,
|
|
13775
|
-
dragPos: prevDragPos,
|
|
13776
|
-
dragToChild: isDragToChildFlag,
|
|
13777
|
-
offsetIndex: dragOffsetIndex,
|
|
13778
|
-
_index: {
|
|
13779
|
-
newIndex: nafIndex,
|
|
13780
|
-
oldIndex: oafIndex
|
|
13781
|
-
}
|
|
13782
|
-
}, evnt);
|
|
13783
|
-
}).catch(() => {});
|
|
13929
|
+
}).catch(() => {
|
|
13930
|
+
return errRest;
|
|
13931
|
+
});
|
|
13784
13932
|
}
|
|
13785
13933
|
}
|
|
13786
|
-
return Promise.resolve();
|
|
13934
|
+
return Promise.resolve(errRest);
|
|
13787
13935
|
},
|
|
13788
13936
|
handleRowDragDragendEvent(evnt) {
|
|
13789
13937
|
const $xeTable = this;
|
|
@@ -13969,6 +14117,9 @@ const Methods = {
|
|
|
13969
14117
|
collectColumn
|
|
13970
14118
|
} = internalData;
|
|
13971
14119
|
const dragOffsetIndex = prevDragPos === 'right' ? 1 : 0;
|
|
14120
|
+
const errRest = {
|
|
14121
|
+
status: false
|
|
14122
|
+
};
|
|
13972
14123
|
if (prevDragCol && dragCol) {
|
|
13973
14124
|
// 判断是否有拖动
|
|
13974
14125
|
if (prevDragCol !== dragCol) {
|
|
@@ -13985,7 +14136,7 @@ const Methods = {
|
|
|
13985
14136
|
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
13986
14137
|
return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then(status => {
|
|
13987
14138
|
if (!status) {
|
|
13988
|
-
return;
|
|
14139
|
+
return errRest;
|
|
13989
14140
|
}
|
|
13990
14141
|
let oafIndex = -1;
|
|
13991
14142
|
let nafIndex = -1;
|
|
@@ -13999,11 +14150,11 @@ const Methods = {
|
|
|
13999
14150
|
if (isPeerDrag && !isCrossDrag) {
|
|
14000
14151
|
if (dragColumn.parentId !== newColumn.parentId) {
|
|
14001
14152
|
// 非同级
|
|
14002
|
-
return;
|
|
14153
|
+
return errRest;
|
|
14003
14154
|
}
|
|
14004
14155
|
} else {
|
|
14005
14156
|
if (!isCrossDrag) {
|
|
14006
|
-
return;
|
|
14157
|
+
return errRest;
|
|
14007
14158
|
}
|
|
14008
14159
|
if (oldAllMaps[newColumn.id]) {
|
|
14009
14160
|
isSelfToChildStatus = true;
|
|
@@ -14014,19 +14165,19 @@ const Methods = {
|
|
|
14014
14165
|
content: methods_getI18n('vxe.error.treeDragChild')
|
|
14015
14166
|
});
|
|
14016
14167
|
}
|
|
14017
|
-
return;
|
|
14168
|
+
return errRest;
|
|
14018
14169
|
}
|
|
14019
14170
|
}
|
|
14020
14171
|
}
|
|
14021
14172
|
} else if (dragColumn.parentId) {
|
|
14022
14173
|
// 子到根
|
|
14023
14174
|
if (!isCrossDrag) {
|
|
14024
|
-
return;
|
|
14175
|
+
return errRest;
|
|
14025
14176
|
}
|
|
14026
14177
|
} else if (newColumn.parentId) {
|
|
14027
14178
|
// 根到子
|
|
14028
14179
|
if (!isCrossDrag) {
|
|
14029
|
-
return;
|
|
14180
|
+
return errRest;
|
|
14030
14181
|
}
|
|
14031
14182
|
if (oldAllMaps[newColumn.id]) {
|
|
14032
14183
|
isSelfToChildStatus = true;
|
|
@@ -14037,7 +14188,7 @@ const Methods = {
|
|
|
14037
14188
|
content: methods_getI18n('vxe.error.treeDragChild')
|
|
14038
14189
|
});
|
|
14039
14190
|
}
|
|
14040
|
-
return;
|
|
14191
|
+
return errRest;
|
|
14041
14192
|
}
|
|
14042
14193
|
}
|
|
14043
14194
|
} else {
|
|
@@ -14106,25 +14257,32 @@ const Methods = {
|
|
|
14106
14257
|
$xeTable.clearCopyCellArea();
|
|
14107
14258
|
}
|
|
14108
14259
|
}
|
|
14109
|
-
|
|
14110
|
-
|
|
14111
|
-
|
|
14112
|
-
|
|
14113
|
-
|
|
14114
|
-
|
|
14115
|
-
|
|
14116
|
-
|
|
14117
|
-
|
|
14118
|
-
|
|
14119
|
-
|
|
14120
|
-
|
|
14260
|
+
if (evnt) {
|
|
14261
|
+
$xeTable.dispatchEvent('column-dragend', {
|
|
14262
|
+
oldColumn: dragColumn,
|
|
14263
|
+
newColumn,
|
|
14264
|
+
dragColumn,
|
|
14265
|
+
dragPos: prevDragPos,
|
|
14266
|
+
dragToChild: isDragToChildFlag,
|
|
14267
|
+
offsetIndex: dragOffsetIndex,
|
|
14268
|
+
_index: {
|
|
14269
|
+
newIndex: nafIndex,
|
|
14270
|
+
oldIndex: oafIndex
|
|
14271
|
+
}
|
|
14272
|
+
}, evnt);
|
|
14273
|
+
}
|
|
14121
14274
|
if (isSyncColumn) {
|
|
14122
14275
|
$xeTable.handleColDragSwapColumn();
|
|
14123
14276
|
}
|
|
14124
|
-
|
|
14277
|
+
return {
|
|
14278
|
+
status: true
|
|
14279
|
+
};
|
|
14280
|
+
}).catch(() => {
|
|
14281
|
+
return errRest;
|
|
14282
|
+
});
|
|
14125
14283
|
}
|
|
14126
14284
|
}
|
|
14127
|
-
return Promise.resolve();
|
|
14285
|
+
return Promise.resolve(errRest);
|
|
14128
14286
|
},
|
|
14129
14287
|
handleHeaderCellDragDragendEvent(evnt) {
|
|
14130
14288
|
const $xeTable = this;
|
|
@@ -16790,6 +16948,7 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
16790
16948
|
tdOns.dblclick = evnt => {
|
|
16791
16949
|
$xeTable.triggerCellDblclickEvent(evnt, cellParams);
|
|
16792
16950
|
};
|
|
16951
|
+
let isMergeCell = false;
|
|
16793
16952
|
// 合并行或列
|
|
16794
16953
|
if (mergeList.length) {
|
|
16795
16954
|
const spanRest = mergeBodyMethod(mergeList, _rowIndex, _columnIndex);
|
|
@@ -16802,9 +16961,11 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
16802
16961
|
return null;
|
|
16803
16962
|
}
|
|
16804
16963
|
if (rowspan > 1) {
|
|
16964
|
+
isMergeCell = true;
|
|
16805
16965
|
tdAttrs.rowspan = rowspan;
|
|
16806
16966
|
}
|
|
16807
16967
|
if (colspan > 1) {
|
|
16968
|
+
isMergeCell = true;
|
|
16808
16969
|
tdAttrs.colspan = colspan;
|
|
16809
16970
|
}
|
|
16810
16971
|
}
|
|
@@ -16839,11 +17000,13 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
16839
17000
|
const isLastColumn = $columnIndex === columns.length - 1;
|
|
16840
17001
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
16841
17002
|
let isVNPreEmptyStatus = false;
|
|
16842
|
-
if (!
|
|
16843
|
-
if (
|
|
16844
|
-
|
|
16845
|
-
|
|
16846
|
-
|
|
17003
|
+
if (!isMergeCell) {
|
|
17004
|
+
if (!dragRow || getRowid($xeTable, dragRow) !== rowid) {
|
|
17005
|
+
if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
|
|
17006
|
+
isVNPreEmptyStatus = true;
|
|
17007
|
+
} else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
17008
|
+
isVNPreEmptyStatus = true;
|
|
17009
|
+
}
|
|
16847
17010
|
}
|
|
16848
17011
|
}
|
|
16849
17012
|
const tcStyle = {};
|
|
@@ -18064,6 +18227,7 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
|
|
|
18064
18227
|
cell: evnt.currentTarget
|
|
18065
18228
|
}, cellParams), evnt);
|
|
18066
18229
|
};
|
|
18230
|
+
let isMergeCell = false;
|
|
18067
18231
|
// 合并行或列
|
|
18068
18232
|
if (mergeFooterList.length) {
|
|
18069
18233
|
const spanRest = mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex);
|
|
@@ -18076,9 +18240,11 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
|
|
|
18076
18240
|
return null;
|
|
18077
18241
|
}
|
|
18078
18242
|
if (rowspan > 1) {
|
|
18243
|
+
isMergeCell = true;
|
|
18079
18244
|
attrs.rowspan = rowspan;
|
|
18080
18245
|
}
|
|
18081
18246
|
if (colspan > 1) {
|
|
18247
|
+
isMergeCell = true;
|
|
18082
18248
|
attrs.colspan = colspan;
|
|
18083
18249
|
}
|
|
18084
18250
|
}
|
|
@@ -18101,8 +18267,10 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
|
|
|
18101
18267
|
const isLastColumn = $columnIndex === tableColumn.length - 1;
|
|
18102
18268
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
18103
18269
|
let isVNPreEmptyStatus = false;
|
|
18104
|
-
if (
|
|
18105
|
-
|
|
18270
|
+
if (!isMergeCell) {
|
|
18271
|
+
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
18272
|
+
isVNPreEmptyStatus = true;
|
|
18273
|
+
}
|
|
18106
18274
|
}
|
|
18107
18275
|
const tcStyle = {};
|
|
18108
18276
|
if (hasEllipsis) {
|
|
@@ -29673,6 +29841,10 @@ Object.keys(table.methods).forEach(name => {
|
|
|
29673
29841
|
}
|
|
29674
29842
|
return [];
|
|
29675
29843
|
},
|
|
29844
|
+
getEl() {
|
|
29845
|
+
const $xeGrid = this;
|
|
29846
|
+
return $xeGrid.$refs.refElem;
|
|
29847
|
+
},
|
|
29676
29848
|
/**
|
|
29677
29849
|
* 获取需要排除的高度
|
|
29678
29850
|
*/
|