vxe-table 4.4.6 → 4.5.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/edit/src/hook.js +2 -2
- package/es/export/src/hook.js +21 -12
- package/es/icon/style/{iconfont.1688790429861.ttf → iconfont.1689121467376.ttf} +0 -0
- package/es/icon/style/iconfont.1689121467376.woff +0 -0
- package/es/icon/style/iconfont.1689121467376.woff2 +0 -0
- package/es/icon/style.css +25 -1
- package/{lib/icon/style/iconfont.1688790429861.ttf → es/iconfont.1689121467376.ttf} +0 -0
- package/es/iconfont.1689121467376.woff +0 -0
- package/es/iconfont.1689121467376.woff2 +0 -0
- package/es/locale/lang/en-US.js +6 -2
- package/es/locale/lang/es-ES.js +9 -5
- package/es/locale/lang/ja-JP.js +5 -2
- package/es/locale/lang/zh-CN.js +6 -2
- package/es/locale/lang/zh-TC.js +6 -2
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/src/body.js +7 -7
- package/es/table/src/columnInfo.js +7 -0
- package/es/table/src/table.js +121 -65
- package/es/table/src/util.js +16 -0
- package/es/table/style.css +6 -12
- package/es/toolbar/src/toolbar.js +86 -39
- package/es/toolbar/style.css +45 -14
- package/es/tools/log.js +1 -1
- package/es/v-x-e-table/index.js +1 -1
- package/es/v-x-e-table/src/conf.js +19 -11
- package/es/v-x-e-table/style.css +25 -1
- package/es/validator/src/hook.js +61 -31
- package/es/vxe-icon/style.css +25 -1
- package/es/vxe-table/style.css +6 -12
- package/es/vxe-toolbar/style.css +45 -14
- package/helper/vetur/attributes.json +57 -13
- package/helper/vetur/tags.json +12 -1
- package/lib/edit/src/hook.js +2 -2
- package/lib/edit/src/hook.min.js +1 -1
- package/lib/export/src/hook.js +23 -12
- package/lib/export/src/hook.min.js +1 -1
- package/lib/{iconfont.1688790429861.ttf → icon/style/iconfont.1689121467376.ttf} +0 -0
- package/lib/icon/style/iconfont.1689121467376.woff +0 -0
- package/lib/icon/style/iconfont.1689121467376.woff2 +0 -0
- package/lib/icon/style/style.css +25 -1
- package/lib/icon/style/style.min.css +25 -1
- package/{es/iconfont.1688790429861.ttf → lib/iconfont.1689121467376.ttf} +0 -0
- package/lib/iconfont.1689121467376.woff +0 -0
- package/lib/iconfont.1689121467376.woff2 +0 -0
- package/lib/index.umd.js +314 -147
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +6 -2
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +6 -2
- package/lib/locale/lang/es-ES.js +9 -5
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +9 -5
- package/lib/locale/lang/ja-JP.js +5 -2
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +5 -2
- package/lib/locale/lang/zh-CN.js +6 -2
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +6 -2
- package/lib/locale/lang/zh-HK.min.js +1 -1
- package/lib/locale/lang/zh-HK.umd.js +6 -2
- package/lib/locale/lang/zh-MO.min.js +1 -1
- package/lib/locale/lang/zh-MO.umd.js +6 -2
- package/lib/locale/lang/zh-TC.js +6 -2
- package/lib/locale/lang/zh-TC.min.js +1 -1
- package/lib/locale/lang/zh-TC.umd.js +6 -2
- package/lib/locale/lang/zh-TW.min.js +1 -1
- package/lib/locale/lang/zh-TW.umd.js +6 -2
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/body.js +8 -8
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/columnInfo.js +7 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/table.js +122 -73
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +17 -0
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +6 -12
- package/lib/table/style/style.min.css +1 -1
- package/lib/toolbar/src/toolbar.js +54 -14
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/toolbar/style/style.css +45 -14
- package/lib/toolbar/style/style.min.css +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/v-x-e-table/index.js +1 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/v-x-e-table/src/conf.js +12 -3
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/lib/v-x-e-table/style/style.css +25 -1
- package/lib/v-x-e-table/style/style.min.css +1 -1
- package/lib/validator/src/hook.js +62 -33
- package/lib/validator/src/hook.min.js +1 -1
- package/lib/vxe-icon/style/style.css +25 -1
- package/lib/vxe-icon/style/style.min.css +1 -1
- package/lib/vxe-table/style/style.css +6 -12
- package/lib/vxe-table/style/style.min.css +1 -1
- package/lib/vxe-toolbar/style/style.css +45 -14
- package/lib/vxe-toolbar/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/edit/src/hook.ts +2 -2
- package/packages/export/src/hook.ts +21 -12
- package/packages/locale/lang/en-US.ts +6 -2
- package/packages/locale/lang/es-ES.ts +9 -5
- package/packages/locale/lang/ja-JP.ts +5 -2
- package/packages/locale/lang/zh-CN.ts +6 -2
- package/packages/locale/lang/zh-TC.ts +6 -2
- package/packages/table/src/body.ts +7 -7
- package/packages/table/src/columnInfo.ts +8 -1
- package/packages/table/src/table.ts +113 -53
- package/packages/table/src/util.ts +17 -0
- package/packages/toolbar/src/toolbar.ts +87 -40
- package/packages/v-x-e-table/src/conf.ts +11 -3
- package/packages/validator/src/hook.ts +71 -30
- package/styles/icon/iconfont.ttf +0 -0
- package/styles/icon/iconfont.woff +0 -0
- package/styles/icon/iconfont.woff2 +0 -0
- package/styles/icon.scss +25 -1
- package/styles/table.scss +7 -21
- package/styles/toolbar.scss +36 -9
- package/types/column.d.ts +1 -0
- package/types/table.d.ts +23 -6
- package/types/toolbar.d.ts +9 -1
- package/types/validator.d.ts +2 -3
- package/es/icon/style/iconfont.1688790429861.woff +0 -0
- package/es/icon/style/iconfont.1688790429861.woff2 +0 -0
- package/es/iconfont.1688790429861.woff +0 -0
- package/es/iconfont.1688790429861.woff2 +0 -0
- package/lib/icon/style/iconfont.1688790429861.woff +0 -0
- package/lib/icon/style/iconfont.1688790429861.woff2 +0 -0
- package/lib/iconfont.1688790429861.woff +0 -0
- package/lib/iconfont.1688790429861.woff2 +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -1952,6 +1952,9 @@ const GlobalConfig = {
|
|
|
1952
1952
|
showMessage: true,
|
|
1953
1953
|
message: 'default'
|
|
1954
1954
|
},
|
|
1955
|
+
columnConfig: {
|
|
1956
|
+
maxFixedSize: 4
|
|
1957
|
+
},
|
|
1955
1958
|
// menuConfig: {
|
|
1956
1959
|
// visibleMethod () {}
|
|
1957
1960
|
// },
|
|
@@ -2093,6 +2096,10 @@ const GlobalConfig = {
|
|
|
2093
2096
|
TOOLBAR_TOOLS_FULLSCREEN: iconPrefix + 'fullscreen',
|
|
2094
2097
|
TOOLBAR_TOOLS_MINIMIZE: iconPrefix + 'minimize',
|
|
2095
2098
|
TOOLBAR_TOOLS_CUSTOM: iconPrefix + 'custom-column',
|
|
2099
|
+
TOOLBAR_TOOLS_FIXED_LEFT: iconPrefix + 'fixed-left',
|
|
2100
|
+
TOOLBAR_TOOLS_FIXED_LEFT_ACTIVED: iconPrefix + 'fixed-left-fill',
|
|
2101
|
+
TOOLBAR_TOOLS_FIXED_RIGHT: iconPrefix + 'fixed-right',
|
|
2102
|
+
TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVED: iconPrefix + 'fixed-right-fill',
|
|
2096
2103
|
// form
|
|
2097
2104
|
FORM_PREFIX: iconPrefix + 'question-circle-fill',
|
|
2098
2105
|
FORM_SUFFIX: iconPrefix + 'question-circle-fill',
|
|
@@ -2203,11 +2210,13 @@ const GlobalConfig = {
|
|
|
2203
2210
|
// export: {
|
|
2204
2211
|
// types: ['csv', 'html', 'xml', 'txt']
|
|
2205
2212
|
// },
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2213
|
+
custom: {
|
|
2214
|
+
allowFixed: true,
|
|
2215
|
+
showFooter: true
|
|
2216
|
+
}
|
|
2209
2217
|
// buttons: []
|
|
2210
2218
|
},
|
|
2219
|
+
|
|
2211
2220
|
button: {
|
|
2212
2221
|
// size: null,
|
|
2213
2222
|
// transfer: false
|
|
@@ -2263,7 +2272,7 @@ const GlobalConfig = {
|
|
|
2263
2272
|
;// CONCATENATED MODULE: ./packages/tools/log.ts
|
|
2264
2273
|
|
|
2265
2274
|
function getLog(message, params) {
|
|
2266
|
-
return `[vxe-table v${"4.
|
|
2275
|
+
return `[vxe-table v${"4.5.0-beta.1"}] ${conf.i18n(message, params)}`;
|
|
2267
2276
|
}
|
|
2268
2277
|
function outLog(type) {
|
|
2269
2278
|
return function (message, params) {
|
|
@@ -2398,7 +2407,7 @@ class ColumnInfo {
|
|
|
2398
2407
|
} = {}) {
|
|
2399
2408
|
_defineProperty(this, "title", void 0);
|
|
2400
2409
|
_defineProperty(this, "type", void 0);
|
|
2401
|
-
_defineProperty(this, "
|
|
2410
|
+
_defineProperty(this, "field", void 0);
|
|
2402
2411
|
const $xegrid = $xetable.xegrid;
|
|
2403
2412
|
const formatter = _vm.formatter;
|
|
2404
2413
|
const visible = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(_vm.visible) ? _vm.visible : true;
|
|
@@ -2498,11 +2507,18 @@ class ColumnInfo {
|
|
|
2498
2507
|
checked: false,
|
|
2499
2508
|
halfChecked: false,
|
|
2500
2509
|
disabled: false,
|
|
2510
|
+
// 分组层级
|
|
2501
2511
|
level: 1,
|
|
2512
|
+
// 跨行
|
|
2502
2513
|
rowSpan: 1,
|
|
2514
|
+
// 跨列
|
|
2503
2515
|
colSpan: 1,
|
|
2516
|
+
// 数据排序-自定义排序
|
|
2504
2517
|
order: null,
|
|
2518
|
+
// 数据排序-用于多列的先后顺序
|
|
2505
2519
|
sortTime: 0,
|
|
2520
|
+
// 列排序
|
|
2521
|
+
customOrder: 0,
|
|
2506
2522
|
renderWidth: 0,
|
|
2507
2523
|
renderHeight: 0,
|
|
2508
2524
|
resizeWidth: 0,
|
|
@@ -2966,6 +2982,26 @@ function destroyColumn($xetable, column) {
|
|
|
2966
2982
|
}
|
|
2967
2983
|
reactData.staticColumns = staticColumns.slice(0);
|
|
2968
2984
|
}
|
|
2985
|
+
function getRootColumn($xetable, column) {
|
|
2986
|
+
const {
|
|
2987
|
+
internalData
|
|
2988
|
+
} = $xetable;
|
|
2989
|
+
const {
|
|
2990
|
+
fullColumnIdData
|
|
2991
|
+
} = internalData;
|
|
2992
|
+
if (!column) {
|
|
2993
|
+
return null;
|
|
2994
|
+
}
|
|
2995
|
+
let parentColId = column.parentId;
|
|
2996
|
+
while (fullColumnIdData[parentColId]) {
|
|
2997
|
+
const column = fullColumnIdData[parentColId].column;
|
|
2998
|
+
parentColId = column.parentId;
|
|
2999
|
+
if (!parentColId) {
|
|
3000
|
+
return column;
|
|
3001
|
+
}
|
|
3002
|
+
}
|
|
3003
|
+
return column;
|
|
3004
|
+
}
|
|
2969
3005
|
function mergeBodyMethod(mergeList, _rowIndex, _columnIndex) {
|
|
2970
3006
|
for (let mIndex = 0; mIndex < mergeList.length; mIndex++) {
|
|
2971
3007
|
const {
|
|
@@ -4070,7 +4106,7 @@ const config = new VXETableConfig();
|
|
|
4070
4106
|
const v = 'v4';
|
|
4071
4107
|
const VXETable = {
|
|
4072
4108
|
v,
|
|
4073
|
-
version: "4.
|
|
4109
|
+
version: "4.5.0-beta.1",
|
|
4074
4110
|
setup: setup,
|
|
4075
4111
|
interceptor: interceptor,
|
|
4076
4112
|
renderer: renderer,
|
|
@@ -5937,7 +5973,7 @@ const editHook = {
|
|
|
5937
5973
|
$columnIndex: $xetable.getVMColumnIndex(column)
|
|
5938
5974
|
}, evnt || null);
|
|
5939
5975
|
}
|
|
5940
|
-
return
|
|
5976
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
5941
5977
|
},
|
|
5942
5978
|
/**
|
|
5943
5979
|
* 清除所选中源状态
|
|
@@ -6137,7 +6173,7 @@ const editHook = {
|
|
|
6137
6173
|
setCellValue(row, oldColumn, oldModel.value);
|
|
6138
6174
|
}
|
|
6139
6175
|
if ($xetable.clearValidate) {
|
|
6140
|
-
$xetable.clearValidate();
|
|
6176
|
+
$xetable.clearValidate(row, column);
|
|
6141
6177
|
}
|
|
6142
6178
|
}
|
|
6143
6179
|
column.renderHeight = cell.offsetHeight;
|
|
@@ -12832,7 +12868,8 @@ const tableExportHook = {
|
|
|
12832
12868
|
computeCustomOpts,
|
|
12833
12869
|
computeSeqOpts,
|
|
12834
12870
|
computeRadioOpts,
|
|
12835
|
-
computeCheckboxOpts
|
|
12871
|
+
computeCheckboxOpts,
|
|
12872
|
+
computeColumnOpts
|
|
12836
12873
|
} = $xetable.getComputeMaps();
|
|
12837
12874
|
const $xegrid = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xegrid', null);
|
|
12838
12875
|
const hasTreeChildren = row => {
|
|
@@ -12855,11 +12892,11 @@ const tableExportHook = {
|
|
|
12855
12892
|
return $xetable.getRowSeq(row);
|
|
12856
12893
|
};
|
|
12857
12894
|
function getHeaderTitle(opts, column) {
|
|
12858
|
-
const
|
|
12859
|
-
|
|
12860
|
-
|
|
12861
|
-
return headerExportMethod ? headerExportMethod({
|
|
12895
|
+
const columnOpts = computeColumnOpts.value;
|
|
12896
|
+
const headExportMethod = column.headerExportMethod || columnOpts.headerExportMethod;
|
|
12897
|
+
return headExportMethod ? headExportMethod({
|
|
12862
12898
|
column,
|
|
12899
|
+
options: opts,
|
|
12863
12900
|
$table: $xetable
|
|
12864
12901
|
}) : (opts.original ? column.property : column.getTitle()) || '';
|
|
12865
12902
|
}
|
|
@@ -12877,6 +12914,7 @@ const tableExportHook = {
|
|
|
12877
12914
|
const radioOpts = computeRadioOpts.value;
|
|
12878
12915
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
12879
12916
|
const treeOpts = computeTreeOpts.value;
|
|
12917
|
+
const columnOpts = computeColumnOpts.value;
|
|
12880
12918
|
if (!htmlCellElem) {
|
|
12881
12919
|
htmlCellElem = document.createElement('div');
|
|
12882
12920
|
}
|
|
@@ -12898,15 +12936,18 @@ const tableExportHook = {
|
|
|
12898
12936
|
columns.forEach((column, $columnIndex) => {
|
|
12899
12937
|
let cellValue = '';
|
|
12900
12938
|
const renderOpts = column.editRender || column.cellRender;
|
|
12901
|
-
let
|
|
12902
|
-
if (!
|
|
12939
|
+
let bodyExportMethod = column.exportMethod;
|
|
12940
|
+
if (!bodyExportMethod && renderOpts && renderOpts.name) {
|
|
12903
12941
|
const compConf = VXETable.renderer.get(renderOpts.name);
|
|
12904
12942
|
if (compConf) {
|
|
12905
|
-
|
|
12943
|
+
bodyExportMethod = compConf.exportMethod;
|
|
12906
12944
|
}
|
|
12907
12945
|
}
|
|
12908
|
-
if (
|
|
12909
|
-
|
|
12946
|
+
if (!bodyExportMethod) {
|
|
12947
|
+
bodyExportMethod = columnOpts.exportMethod;
|
|
12948
|
+
}
|
|
12949
|
+
if (bodyExportMethod) {
|
|
12950
|
+
cellValue = bodyExportMethod({
|
|
12910
12951
|
$table: $xetable,
|
|
12911
12952
|
row,
|
|
12912
12953
|
column,
|
|
@@ -13033,16 +13074,20 @@ const tableExportHook = {
|
|
|
13033
13074
|
return getLabelData(opts, columns, datas);
|
|
13034
13075
|
};
|
|
13035
13076
|
const getFooterCellValue = (opts, items, column) => {
|
|
13077
|
+
const columnOpts = computeColumnOpts.value;
|
|
13036
13078
|
const renderOpts = column.editRender || column.cellRender;
|
|
13037
|
-
let
|
|
13038
|
-
if (!
|
|
13079
|
+
let footLabelMethod = column.footerExportMethod;
|
|
13080
|
+
if (!footLabelMethod && renderOpts && renderOpts.name) {
|
|
13039
13081
|
const compConf = VXETable.renderer.get(renderOpts.name);
|
|
13040
13082
|
if (compConf) {
|
|
13041
|
-
|
|
13083
|
+
footLabelMethod = compConf.footerExportMethod;
|
|
13042
13084
|
}
|
|
13043
13085
|
}
|
|
13086
|
+
if (!footLabelMethod) {
|
|
13087
|
+
footLabelMethod = columnOpts.footerExportMethod;
|
|
13088
|
+
}
|
|
13044
13089
|
const _columnIndex = $xetable.getVTColumnIndex(column);
|
|
13045
|
-
const cellValue =
|
|
13090
|
+
const cellValue = footLabelMethod ? footLabelMethod({
|
|
13046
13091
|
$table: $xetable,
|
|
13047
13092
|
items,
|
|
13048
13093
|
itemIndex: _columnIndex,
|
|
@@ -14580,6 +14625,7 @@ const Keyboard = VxeModuleKeyboard;
|
|
|
14580
14625
|
|
|
14581
14626
|
|
|
14582
14627
|
|
|
14628
|
+
|
|
14583
14629
|
/**
|
|
14584
14630
|
* 校验规则
|
|
14585
14631
|
*/
|
|
@@ -14638,9 +14684,7 @@ const validatorHook = {
|
|
|
14638
14684
|
type: 'valid-error',
|
|
14639
14685
|
trigger: 'call'
|
|
14640
14686
|
}).then(() => {
|
|
14641
|
-
|
|
14642
|
-
resolve(validatorPrivateMethods.showValidTooltip(params));
|
|
14643
|
-
}, 10);
|
|
14687
|
+
resolve(validatorPrivateMethods.showValidTooltip(params));
|
|
14644
14688
|
});
|
|
14645
14689
|
}
|
|
14646
14690
|
});
|
|
@@ -14686,6 +14730,7 @@ const validatorHook = {
|
|
|
14686
14730
|
internalData._lastCallTime = Date.now();
|
|
14687
14731
|
validRuleErr = false; // 如果为快速校验,当存在某列校验不通过时将终止执行
|
|
14688
14732
|
validatorMethods.clearValidate();
|
|
14733
|
+
const validErrMaps = {};
|
|
14689
14734
|
if (editRules) {
|
|
14690
14735
|
const columns = $xetable.getColumns();
|
|
14691
14736
|
const handleVaild = row => {
|
|
@@ -14710,6 +14755,12 @@ const validatorHook = {
|
|
|
14710
14755
|
if (!validRest[column.property]) {
|
|
14711
14756
|
validRest[column.property] = [];
|
|
14712
14757
|
}
|
|
14758
|
+
validErrMaps[`${getRowid($xetable, row)}:${column.id}`] = {
|
|
14759
|
+
column,
|
|
14760
|
+
row,
|
|
14761
|
+
rule,
|
|
14762
|
+
content: rule.content
|
|
14763
|
+
};
|
|
14713
14764
|
validRest[column.property].push(rest);
|
|
14714
14765
|
if (!isFull) {
|
|
14715
14766
|
validRuleErr = true;
|
|
@@ -14728,6 +14779,7 @@ const validatorHook = {
|
|
|
14728
14779
|
}
|
|
14729
14780
|
return Promise.all(rowValids).then(() => {
|
|
14730
14781
|
const ruleProps = Object.keys(validRest);
|
|
14782
|
+
reactData.validErrorMaps = validErrMaps;
|
|
14731
14783
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
14732
14784
|
if (ruleProps.length) {
|
|
14733
14785
|
return Promise.reject(validRest[ruleProps[0]][0]);
|
|
@@ -14766,6 +14818,7 @@ const validatorHook = {
|
|
|
14766
14818
|
const row = firstErrParams.row;
|
|
14767
14819
|
const rowIndex = afterFullData.indexOf(row);
|
|
14768
14820
|
const locatRow = rowIndex > 0 ? afterFullData[rowIndex - 1] : row;
|
|
14821
|
+
reactData.validErrorMaps = validErrMaps;
|
|
14769
14822
|
if (validOpts.autoPos === false) {
|
|
14770
14823
|
finish();
|
|
14771
14824
|
} else {
|
|
@@ -14778,6 +14831,7 @@ const validatorHook = {
|
|
|
14778
14831
|
});
|
|
14779
14832
|
});
|
|
14780
14833
|
}
|
|
14834
|
+
// reactData.validErrorMaps = validErrMaps
|
|
14781
14835
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
14782
14836
|
if (cb) {
|
|
14783
14837
|
cb();
|
|
@@ -14797,17 +14851,36 @@ const validatorHook = {
|
|
|
14797
14851
|
validate(rows, cb) {
|
|
14798
14852
|
return beginValidate(rows, cb);
|
|
14799
14853
|
},
|
|
14800
|
-
clearValidate() {
|
|
14801
|
-
const
|
|
14802
|
-
|
|
14803
|
-
|
|
14804
|
-
|
|
14805
|
-
|
|
14806
|
-
row
|
|
14807
|
-
|
|
14808
|
-
|
|
14809
|
-
|
|
14810
|
-
|
|
14854
|
+
clearValidate(rows, fieldOrColumn) {
|
|
14855
|
+
const rowList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows) ? rows : rows ? [rows] : [];
|
|
14856
|
+
const colList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : (fieldOrColumn ? [fieldOrColumn] : []).map(column => handleFieldOrColumn($xetable, column));
|
|
14857
|
+
let validErrMaps = {};
|
|
14858
|
+
if (rowList.length && colList.length) {
|
|
14859
|
+
validErrMaps = Object.assign({}, reactData.validErrorMaps);
|
|
14860
|
+
rowList.forEach(row => {
|
|
14861
|
+
colList.forEach(column => {
|
|
14862
|
+
const vaildKey = `${getRowid($xetable, row)}:${column.id}`;
|
|
14863
|
+
if (validErrMaps[vaildKey]) {
|
|
14864
|
+
delete validErrMaps[vaildKey];
|
|
14865
|
+
}
|
|
14866
|
+
});
|
|
14867
|
+
});
|
|
14868
|
+
} else if (rowList.length) {
|
|
14869
|
+
const rowidList = rowList.map(row => `${getRowid($xetable, row)}`);
|
|
14870
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(reactData.validErrorMaps, (item, key) => {
|
|
14871
|
+
if (rowidList.indexOf(key.split(':')[0]) > -1) {
|
|
14872
|
+
validErrMaps[key] = item;
|
|
14873
|
+
}
|
|
14874
|
+
});
|
|
14875
|
+
} else if (colList.length) {
|
|
14876
|
+
const colidList = colList.map(column => `${column.id}`);
|
|
14877
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(reactData.validErrorMaps, (item, key) => {
|
|
14878
|
+
if (colidList.indexOf(key.split(':')[1]) > -1) {
|
|
14879
|
+
validErrMaps[key] = item;
|
|
14880
|
+
}
|
|
14881
|
+
});
|
|
14882
|
+
}
|
|
14883
|
+
reactData.validErrorMaps = validErrMaps;
|
|
14811
14884
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
14812
14885
|
}
|
|
14813
14886
|
};
|
|
@@ -14942,10 +15015,10 @@ const validatorHook = {
|
|
|
14942
15015
|
editRules
|
|
14943
15016
|
} = props;
|
|
14944
15017
|
const {
|
|
14945
|
-
|
|
15018
|
+
field
|
|
14946
15019
|
} = column;
|
|
14947
|
-
if (
|
|
14948
|
-
const rules = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(editRules,
|
|
15020
|
+
if (field && editRules) {
|
|
15021
|
+
const rules = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(editRules, field);
|
|
14949
15022
|
return rules && !!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().find(rules, rule => type === 'all' || !rule.trigger || type === rule.trigger);
|
|
14950
15023
|
}
|
|
14951
15024
|
return false;
|
|
@@ -14959,8 +15032,7 @@ const validatorHook = {
|
|
|
14959
15032
|
editRules
|
|
14960
15033
|
} = props;
|
|
14961
15034
|
const {
|
|
14962
|
-
editStore
|
|
14963
|
-
validStore
|
|
15035
|
+
editStore
|
|
14964
15036
|
} = reactData;
|
|
14965
15037
|
const {
|
|
14966
15038
|
actived
|
|
@@ -14975,9 +15047,7 @@ const validatorHook = {
|
|
|
14975
15047
|
if (validatorPrivateMethods.hasCellRules(type, row, column)) {
|
|
14976
15048
|
return validatorPrivateMethods.validCellRules(type, row, column).then(() => {
|
|
14977
15049
|
if (editOpts.mode === 'row') {
|
|
14978
|
-
|
|
14979
|
-
validatorMethods.clearValidate();
|
|
14980
|
-
}
|
|
15050
|
+
validatorMethods.clearValidate(row, column);
|
|
14981
15051
|
}
|
|
14982
15052
|
}).catch(({
|
|
14983
15053
|
rule
|
|
@@ -15006,22 +15076,17 @@ const validatorHook = {
|
|
|
15006
15076
|
const {
|
|
15007
15077
|
validStore
|
|
15008
15078
|
} = reactData;
|
|
15009
|
-
|
|
15010
|
-
|
|
15011
|
-
row
|
|
15012
|
-
|
|
15013
|
-
|
|
15014
|
-
|
|
15015
|
-
|
|
15016
|
-
|
|
15017
|
-
row,
|
|
15018
|
-
column,
|
|
15019
|
-
rule,
|
|
15020
|
-
content,
|
|
15021
|
-
visible: true
|
|
15022
|
-
});
|
|
15023
|
-
$xetable.dispatchEvent('valid-error', params, null);
|
|
15079
|
+
validStore.visible = true;
|
|
15080
|
+
reactData.validErrorMaps = Object.assign({}, reactData.validErrorMaps, {
|
|
15081
|
+
[`${getRowid($xetable, params.row)}:${params.column.id}`]: {
|
|
15082
|
+
column: params.column,
|
|
15083
|
+
row: params.row,
|
|
15084
|
+
rule: params.rule,
|
|
15085
|
+
content: params.rule.content
|
|
15086
|
+
}
|
|
15024
15087
|
});
|
|
15088
|
+
$xetable.dispatchEvent('valid-error', params, null);
|
|
15089
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
15025
15090
|
}
|
|
15026
15091
|
};
|
|
15027
15092
|
return {
|
|
@@ -18093,7 +18158,7 @@ dynamicApp.component(grid.name, grid);
|
|
|
18093
18158
|
}
|
|
18094
18159
|
}
|
|
18095
18160
|
};
|
|
18096
|
-
const
|
|
18161
|
+
const changeCheckboxOption = column => {
|
|
18097
18162
|
const isChecked = !column.visible;
|
|
18098
18163
|
const customOpts = computeCustomOpts.value;
|
|
18099
18164
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([column], item => {
|
|
@@ -18106,6 +18171,19 @@ dynamicApp.component(grid.name, grid);
|
|
|
18106
18171
|
}
|
|
18107
18172
|
checkCustomStatus();
|
|
18108
18173
|
};
|
|
18174
|
+
const changeFixedOption = (column, colFixed) => {
|
|
18175
|
+
const {
|
|
18176
|
+
computeIsMaxFixedColumn
|
|
18177
|
+
} = $xetable.getComputeMaps();
|
|
18178
|
+
const isMaxFixedColumn = computeIsMaxFixedColumn.value;
|
|
18179
|
+
if (column.fixed === colFixed) {
|
|
18180
|
+
$xetable.clearColumnFixed(column);
|
|
18181
|
+
} else {
|
|
18182
|
+
if (!isMaxFixedColumn || column.fixed) {
|
|
18183
|
+
$xetable.setColumnFixed(column, colFixed);
|
|
18184
|
+
}
|
|
18185
|
+
}
|
|
18186
|
+
};
|
|
18109
18187
|
const allCustomEvent = () => {
|
|
18110
18188
|
const {
|
|
18111
18189
|
columns
|
|
@@ -18404,16 +18482,19 @@ dynamicApp.component(grid.name, grid);
|
|
|
18404
18482
|
columns
|
|
18405
18483
|
} = reactData;
|
|
18406
18484
|
const customOpts = computeCustomOpts.value;
|
|
18485
|
+
let isMaxFixedColumn = true;
|
|
18407
18486
|
const colVNs = [];
|
|
18408
18487
|
const customBtnOns = {};
|
|
18409
18488
|
const customWrapperOns = {};
|
|
18410
18489
|
let checkMethod;
|
|
18411
18490
|
if ($xetable) {
|
|
18412
18491
|
const {
|
|
18413
|
-
computeCustomOpts: computeTableCustomOpts
|
|
18492
|
+
computeCustomOpts: computeTableCustomOpts,
|
|
18493
|
+
computeIsMaxFixedColumn
|
|
18414
18494
|
} = $xetable.getComputeMaps();
|
|
18415
18495
|
const tableCustomOpts = computeTableCustomOpts.value;
|
|
18416
18496
|
checkMethod = tableCustomOpts.checkMethod;
|
|
18497
|
+
isMaxFixedColumn = computeIsMaxFixedColumn.value;
|
|
18417
18498
|
}
|
|
18418
18499
|
if (customOpts.trigger === 'manual') {
|
|
18419
18500
|
// 手动触发
|
|
@@ -18427,7 +18508,7 @@ dynamicApp.component(grid.name, grid);
|
|
|
18427
18508
|
// 点击触发
|
|
18428
18509
|
customBtnOns.onClick = handleClickSettingEvent;
|
|
18429
18510
|
}
|
|
18430
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(columns, column => {
|
|
18511
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(columns, (column, index, items, path, parent) => {
|
|
18431
18512
|
const colTitle = formatText(column.getTitle(), 1);
|
|
18432
18513
|
const colKey = column.getKey();
|
|
18433
18514
|
const isColGroup = column.children && column.children.length;
|
|
@@ -18439,22 +18520,45 @@ dynamicApp.component(grid.name, grid);
|
|
|
18439
18520
|
const isIndeterminate = column.halfVisible;
|
|
18440
18521
|
colVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('li', {
|
|
18441
18522
|
class: ['vxe-custom--option', `level--${column.level}`, {
|
|
18442
|
-
'is--group': isColGroup
|
|
18523
|
+
'is--group': isColGroup
|
|
18524
|
+
}]
|
|
18525
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
18526
|
+
title: colTitle,
|
|
18527
|
+
class: ['vxe-custom--checkbox-option', {
|
|
18443
18528
|
'is--checked': isChecked,
|
|
18444
18529
|
'is--indeterminate': isIndeterminate,
|
|
18445
18530
|
'is--disabled': isDisabled
|
|
18446
18531
|
}],
|
|
18447
|
-
title: colTitle,
|
|
18448
18532
|
onClick: () => {
|
|
18449
18533
|
if (!isDisabled) {
|
|
18450
|
-
|
|
18534
|
+
changeCheckboxOption(column);
|
|
18451
18535
|
}
|
|
18452
18536
|
}
|
|
18453
18537
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
18454
18538
|
class: ['vxe-checkbox--icon', isIndeterminate ? conf.icon.TABLE_CHECKBOX_INDETERMINATE : isChecked ? conf.icon.TABLE_CHECKBOX_CHECKED : conf.icon.TABLE_CHECKBOX_UNCHECKED]
|
|
18455
18539
|
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
18456
18540
|
class: 'vxe-checkbox--label'
|
|
18457
|
-
}, colTitle)]))
|
|
18541
|
+
}, colTitle)]), !parent && customOpts.allowFixed ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
18542
|
+
class: 'vxe-custom--fixed-option'
|
|
18543
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
18544
|
+
class: ['vxe-custom--fixed-left-option', column.fixed === 'left' ? conf.icon.TOOLBAR_TOOLS_FIXED_LEFT_ACTIVED : conf.icon.TOOLBAR_TOOLS_FIXED_LEFT, {
|
|
18545
|
+
'is--checked': column.fixed === 'left',
|
|
18546
|
+
'is--disabled': isMaxFixedColumn && !column.fixed
|
|
18547
|
+
}],
|
|
18548
|
+
title: conf.i18n(column.fixed === 'left' ? 'vxe.toolbar.cancelfixed' : 'vxe.toolbar.fixedLeft'),
|
|
18549
|
+
onClick: () => {
|
|
18550
|
+
changeFixedOption(column, 'left');
|
|
18551
|
+
}
|
|
18552
|
+
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
18553
|
+
class: ['vxe-custom--fixed-right-option', column.fixed === 'right' ? conf.icon.TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVED : conf.icon.TOOLBAR_TOOLS_FIXED_RIGHT, {
|
|
18554
|
+
'is--checked': column.fixed === 'right',
|
|
18555
|
+
'is--disabled': isMaxFixedColumn && !column.fixed
|
|
18556
|
+
}],
|
|
18557
|
+
title: conf.i18n(column.fixed === 'right' ? 'vxe.toolbar.cancelfixed' : 'vxe.toolbar.fixedRight'),
|
|
18558
|
+
onClick: () => {
|
|
18559
|
+
changeFixedOption(column, 'right');
|
|
18560
|
+
}
|
|
18561
|
+
})]) : null]));
|
|
18458
18562
|
}
|
|
18459
18563
|
});
|
|
18460
18564
|
const isAllChecked = customStore.isAll;
|
|
@@ -18474,7 +18578,9 @@ dynamicApp.component(grid.name, grid);
|
|
|
18474
18578
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('ul', {
|
|
18475
18579
|
class: 'vxe-custom--header'
|
|
18476
18580
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('li', {
|
|
18477
|
-
class:
|
|
18581
|
+
class: 'vxe-custom--option'
|
|
18582
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
18583
|
+
class: ['vxe-custom--checkbox-option', {
|
|
18478
18584
|
'is--checked': isAllChecked,
|
|
18479
18585
|
'is--indeterminate': isAllIndeterminate
|
|
18480
18586
|
}],
|
|
@@ -18484,18 +18590,18 @@ dynamicApp.component(grid.name, grid);
|
|
|
18484
18590
|
class: ['vxe-checkbox--icon', isAllIndeterminate ? conf.icon.TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? conf.icon.TABLE_CHECKBOX_CHECKED : conf.icon.TABLE_CHECKBOX_UNCHECKED]
|
|
18485
18591
|
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
18486
18592
|
class: 'vxe-checkbox--label'
|
|
18487
|
-
}, conf.i18n('vxe.toolbar.customAll'))])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('ul', {
|
|
18593
|
+
}, conf.i18n('vxe.toolbar.customAll'))])])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('ul', {
|
|
18488
18594
|
class: 'vxe-custom--body',
|
|
18489
18595
|
...customWrapperOns
|
|
18490
|
-
}, colVNs), customOpts.
|
|
18596
|
+
}, colVNs), customOpts.showFooter || customOpts.isFooter ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
18491
18597
|
class: 'vxe-custom--footer'
|
|
18492
18598
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('button', {
|
|
18493
|
-
class: 'btn--confirm',
|
|
18494
|
-
onClick: confirmCustomEvent
|
|
18495
|
-
}, conf.i18n('vxe.toolbar.customConfirm')), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('button', {
|
|
18496
18599
|
class: 'btn--reset',
|
|
18497
18600
|
onClick: resetCustomEvent
|
|
18498
|
-
}, conf.i18n('vxe.toolbar.customRestore'))
|
|
18601
|
+
}, customOpts.resetButtonText || conf.i18n('vxe.toolbar.customRestore')), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('button', {
|
|
18602
|
+
class: 'btn--confirm',
|
|
18603
|
+
onClick: confirmCustomEvent
|
|
18604
|
+
}, customOpts.confirmButtonText || conf.i18n('vxe.toolbar.customConfirm'))]) : null])]);
|
|
18499
18605
|
};
|
|
18500
18606
|
toolbarMethods = {
|
|
18501
18607
|
dispatchEvent(type, params, evnt) {
|
|
@@ -23048,8 +23154,8 @@ const lineOffsetSizes = {
|
|
|
23048
23154
|
currentColumn,
|
|
23049
23155
|
mergeList,
|
|
23050
23156
|
editStore,
|
|
23051
|
-
|
|
23052
|
-
|
|
23157
|
+
isAllOverflow,
|
|
23158
|
+
validErrorMaps
|
|
23053
23159
|
} = tableReactData;
|
|
23054
23160
|
const {
|
|
23055
23161
|
afterFullData
|
|
@@ -23096,7 +23202,7 @@ const lineOffsetSizes = {
|
|
|
23096
23202
|
let isDirty;
|
|
23097
23203
|
const tdOns = {};
|
|
23098
23204
|
const cellAlign = align || allAlign;
|
|
23099
|
-
const
|
|
23205
|
+
const errorValidItem = validErrorMaps[`${rowid}:${column.id}`];
|
|
23100
23206
|
const showValidTip = editRules && validOpts.showMessage;
|
|
23101
23207
|
const attrs = {
|
|
23102
23208
|
colid: column.id
|
|
@@ -23240,15 +23346,15 @@ const lineOffsetSizes = {
|
|
|
23240
23346
|
},
|
|
23241
23347
|
title: showTitle ? $xetable.getCellLabel(row, column) : null
|
|
23242
23348
|
}, column.renderCell(params)));
|
|
23243
|
-
if (showValidTip &&
|
|
23349
|
+
if (showValidTip && errorValidItem) {
|
|
23244
23350
|
tdVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
23245
23351
|
class: 'vxe-cell--valid',
|
|
23246
|
-
style:
|
|
23247
|
-
width: `${
|
|
23352
|
+
style: errorValidItem.rule && errorValidItem.rule.maxWidth ? {
|
|
23353
|
+
width: `${errorValidItem.rule.maxWidth}px`
|
|
23248
23354
|
} : null
|
|
23249
23355
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
23250
23356
|
class: 'vxe-cell--valid-msg'
|
|
23251
|
-
},
|
|
23357
|
+
}, errorValidItem.content)]));
|
|
23252
23358
|
}
|
|
23253
23359
|
}
|
|
23254
23360
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
|
|
@@ -23262,7 +23368,7 @@ const lineOffsetSizes = {
|
|
|
23262
23368
|
'fixed--hidden': fixedHiddenColumn,
|
|
23263
23369
|
'col--dirty': isDirty,
|
|
23264
23370
|
'col--actived': editConfig && isEdit && actived.row === row && (actived.column === column || editOpts.mode === 'row'),
|
|
23265
|
-
'col--valid-error':
|
|
23371
|
+
'col--valid-error': !!errorValidItem,
|
|
23266
23372
|
'col--current': currentColumn === column
|
|
23267
23373
|
}, getPropClass(compCellClassName, params), getPropClass(className, params), getPropClass(allCellClassName, params)],
|
|
23268
23374
|
key: columnKey || columnOpts.useKey ? column.id : $columnIndex,
|
|
@@ -24870,13 +24976,9 @@ const orderStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_ORDER';
|
|
|
24870
24976
|
},
|
|
24871
24977
|
// 存放数据校验相关信息
|
|
24872
24978
|
validStore: {
|
|
24873
|
-
visible: false
|
|
24874
|
-
row: null,
|
|
24875
|
-
column: null,
|
|
24876
|
-
content: '',
|
|
24877
|
-
rule: null,
|
|
24878
|
-
isArrow: false
|
|
24979
|
+
visible: false
|
|
24879
24980
|
},
|
|
24981
|
+
validErrorMaps: {},
|
|
24880
24982
|
// 导入相关信息
|
|
24881
24983
|
importStore: {
|
|
24882
24984
|
inited: false,
|
|
@@ -24980,6 +25082,7 @@ const orderStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_ORDER';
|
|
|
24980
25082
|
// 总的缓存数据集
|
|
24981
25083
|
fullAllDataRowIdData: {},
|
|
24982
25084
|
// 渲染中缓存数据
|
|
25085
|
+
sourceDataRowIdData: {},
|
|
24983
25086
|
fullDataRowIdData: {},
|
|
24984
25087
|
fullColumnIdData: {},
|
|
24985
25088
|
fullColumnFieldData: {},
|
|
@@ -25154,6 +25257,29 @@ const orderStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_ORDER';
|
|
|
25154
25257
|
const computeCustomOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
25155
25258
|
return Object.assign({}, conf.table.customConfig, props.customConfig);
|
|
25156
25259
|
});
|
|
25260
|
+
const computeFixedColumnSize = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
25261
|
+
const {
|
|
25262
|
+
tableFullColumn
|
|
25263
|
+
} = internalData;
|
|
25264
|
+
let fixedSize = 0;
|
|
25265
|
+
tableFullColumn.forEach(column => {
|
|
25266
|
+
if (column.fixed) {
|
|
25267
|
+
fixedSize++;
|
|
25268
|
+
}
|
|
25269
|
+
});
|
|
25270
|
+
return fixedSize;
|
|
25271
|
+
});
|
|
25272
|
+
const computeIsMaxFixedColumn = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
25273
|
+
const fixedColumnSize = computeFixedColumnSize.value;
|
|
25274
|
+
const columnOpts = computeColumnOpts.value;
|
|
25275
|
+
const {
|
|
25276
|
+
maxFixedSize
|
|
25277
|
+
} = columnOpts;
|
|
25278
|
+
if (maxFixedSize) {
|
|
25279
|
+
return fixedColumnSize >= maxFixedSize;
|
|
25280
|
+
}
|
|
25281
|
+
return false;
|
|
25282
|
+
});
|
|
25157
25283
|
const computeTableBorder = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
25158
25284
|
const {
|
|
25159
25285
|
border
|
|
@@ -25250,6 +25376,8 @@ const orderStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_ORDER';
|
|
|
25250
25376
|
computeEmptyOpts,
|
|
25251
25377
|
computeLoadingOpts,
|
|
25252
25378
|
computeCustomOpts,
|
|
25379
|
+
computeFixedColumnSize,
|
|
25380
|
+
computeIsMaxFixedColumn,
|
|
25253
25381
|
computeIsAllCheckboxDisabled
|
|
25254
25382
|
};
|
|
25255
25383
|
const $xetable = {
|
|
@@ -25550,9 +25678,8 @@ const orderStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_ORDER';
|
|
|
25550
25678
|
if (isCustomResizable) {
|
|
25551
25679
|
const columnWidthStorage = getCustomStorageMap(resizableStorageKey)[id];
|
|
25552
25680
|
if (columnWidthStorage) {
|
|
25553
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(columnWidthStorage, (resizeWidth,
|
|
25554
|
-
customMap[
|
|
25555
|
-
field,
|
|
25681
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(columnWidthStorage, (resizeWidth, colKey) => {
|
|
25682
|
+
customMap[colKey] = {
|
|
25556
25683
|
resizeWidth
|
|
25557
25684
|
};
|
|
25558
25685
|
});
|
|
@@ -25564,12 +25691,11 @@ const orderStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_ORDER';
|
|
|
25564
25691
|
if (columnFixedStorage) {
|
|
25565
25692
|
const colFixeds = columnFixedStorage.split(',');
|
|
25566
25693
|
colFixeds.forEach(fixConf => {
|
|
25567
|
-
const [
|
|
25568
|
-
if (customMap[
|
|
25569
|
-
customMap[
|
|
25694
|
+
const [colKey, fixed] = fixConf.split('|');
|
|
25695
|
+
if (customMap[colKey]) {
|
|
25696
|
+
customMap[colKey].fixed = fixed;
|
|
25570
25697
|
} else {
|
|
25571
|
-
customMap[
|
|
25572
|
-
field,
|
|
25698
|
+
customMap[colKey] = {
|
|
25573
25699
|
fixed
|
|
25574
25700
|
};
|
|
25575
25701
|
}
|
|
@@ -25580,7 +25706,15 @@ const orderStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_ORDER';
|
|
|
25580
25706
|
if (isCustomOrder) {
|
|
25581
25707
|
const columnOrderStorage = getCustomStorageMap(orderStorageKey)[id];
|
|
25582
25708
|
if (columnOrderStorage) {
|
|
25583
|
-
//
|
|
25709
|
+
// const colOrderSeqs = columnOrderStorage.split(',')
|
|
25710
|
+
// colOrderSeqs.forEach((orderConf: any) => {
|
|
25711
|
+
// const [colKey, order] = orderConf.split('|')
|
|
25712
|
+
// if (customMap[colKey]) {
|
|
25713
|
+
// customMap[colKey].order = order
|
|
25714
|
+
// } else {
|
|
25715
|
+
// customMap[colKey] = { order }
|
|
25716
|
+
// }
|
|
25717
|
+
// })
|
|
25584
25718
|
}
|
|
25585
25719
|
}
|
|
25586
25720
|
// 自定义隐藏列
|
|
@@ -25590,22 +25724,20 @@ const orderStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_ORDER';
|
|
|
25590
25724
|
const colVisibles = columnVisibleStorage.split('|');
|
|
25591
25725
|
const colHides = colVisibles[0] ? colVisibles[0].split(',') : [];
|
|
25592
25726
|
const colShows = colVisibles[1] ? colVisibles[1].split(',') : [];
|
|
25593
|
-
colHides.forEach(
|
|
25594
|
-
if (customMap[
|
|
25595
|
-
customMap[
|
|
25727
|
+
colHides.forEach(colKey => {
|
|
25728
|
+
if (customMap[colKey]) {
|
|
25729
|
+
customMap[colKey].visible = false;
|
|
25596
25730
|
} else {
|
|
25597
|
-
customMap[
|
|
25598
|
-
field,
|
|
25731
|
+
customMap[colKey] = {
|
|
25599
25732
|
visible: false
|
|
25600
25733
|
};
|
|
25601
25734
|
}
|
|
25602
25735
|
});
|
|
25603
|
-
colShows.forEach(
|
|
25604
|
-
if (customMap[
|
|
25605
|
-
customMap[
|
|
25736
|
+
colShows.forEach(colKey => {
|
|
25737
|
+
if (customMap[colKey]) {
|
|
25738
|
+
customMap[colKey].visible = true;
|
|
25606
25739
|
} else {
|
|
25607
|
-
customMap[
|
|
25608
|
-
field,
|
|
25740
|
+
customMap[colKey] = {
|
|
25609
25741
|
visible: true
|
|
25610
25742
|
};
|
|
25611
25743
|
}
|
|
@@ -25622,9 +25754,10 @@ const orderStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_ORDER';
|
|
|
25622
25754
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(customMap, ({
|
|
25623
25755
|
visible,
|
|
25624
25756
|
resizeWidth,
|
|
25625
|
-
fixed
|
|
25626
|
-
|
|
25627
|
-
|
|
25757
|
+
fixed,
|
|
25758
|
+
order
|
|
25759
|
+
}, colKey) => {
|
|
25760
|
+
const column = keyMap[colKey];
|
|
25628
25761
|
if (column) {
|
|
25629
25762
|
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(resizeWidth)) {
|
|
25630
25763
|
column.resizeWidth = resizeWidth;
|
|
@@ -25635,6 +25768,9 @@ const orderStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_ORDER';
|
|
|
25635
25768
|
if (fixed) {
|
|
25636
25769
|
column.fixed = fixed;
|
|
25637
25770
|
}
|
|
25771
|
+
if (order) {
|
|
25772
|
+
column.customOrder = order;
|
|
25773
|
+
}
|
|
25638
25774
|
}
|
|
25639
25775
|
});
|
|
25640
25776
|
}
|
|
@@ -27145,7 +27281,7 @@ const orderStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_ORDER';
|
|
|
27145
27281
|
internalData.tableSynchData = datas;
|
|
27146
27282
|
// 克隆原数据,用于显示编辑状态,与编辑值做对比
|
|
27147
27283
|
if (keepSource) {
|
|
27148
|
-
|
|
27284
|
+
tablePrivateMethods.cacheSourceMap(fullData);
|
|
27149
27285
|
}
|
|
27150
27286
|
if (true) {
|
|
27151
27287
|
if (sYLoad) {
|
|
@@ -28028,43 +28164,27 @@ const orderStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_ORDER';
|
|
|
28028
28164
|
*/
|
|
28029
28165
|
isUpdateByRow(row, field) {
|
|
28030
28166
|
const {
|
|
28031
|
-
keepSource
|
|
28032
|
-
treeConfig
|
|
28167
|
+
keepSource
|
|
28033
28168
|
} = props;
|
|
28034
28169
|
const {
|
|
28035
|
-
|
|
28036
|
-
|
|
28037
|
-
|
|
28170
|
+
tableFullColumn,
|
|
28171
|
+
fullDataRowIdData,
|
|
28172
|
+
sourceDataRowIdData
|
|
28038
28173
|
} = internalData;
|
|
28039
|
-
const treeOpts = computeTreeOpts.value;
|
|
28040
28174
|
if (keepSource) {
|
|
28041
|
-
let oRow, property;
|
|
28042
28175
|
const rowid = getRowid($xetable, row);
|
|
28043
28176
|
// 新增的数据不需要检测
|
|
28044
28177
|
if (!fullDataRowIdData[rowid]) {
|
|
28045
28178
|
return false;
|
|
28046
28179
|
}
|
|
28047
|
-
|
|
28048
|
-
|
|
28049
|
-
const
|
|
28050
|
-
row = Object.assign({}, row, {
|
|
28051
|
-
[children]: null
|
|
28052
|
-
});
|
|
28053
|
-
if (matchObj) {
|
|
28054
|
-
oRow = Object.assign({}, matchObj.item, {
|
|
28055
|
-
[children]: null
|
|
28056
|
-
});
|
|
28057
|
-
}
|
|
28058
|
-
} else {
|
|
28059
|
-
const oRowIndex = fullDataRowIdData[rowid].index;
|
|
28060
|
-
oRow = tableSourceData[oRowIndex];
|
|
28061
|
-
}
|
|
28062
|
-
if (oRow) {
|
|
28180
|
+
const oldRest = sourceDataRowIdData[rowid];
|
|
28181
|
+
if (oldRest) {
|
|
28182
|
+
const oRow = oldRest.row;
|
|
28063
28183
|
if (arguments.length > 1) {
|
|
28064
28184
|
return !eqCellValue(oRow, row, field);
|
|
28065
28185
|
}
|
|
28066
|
-
for (let index = 0, len =
|
|
28067
|
-
property =
|
|
28186
|
+
for (let index = 0, len = tableFullColumn.length; index < len; index++) {
|
|
28187
|
+
const property = tableFullColumn[index].field;
|
|
28068
28188
|
if (property && !eqCellValue(oRow, row, property)) {
|
|
28069
28189
|
return true;
|
|
28070
28190
|
}
|
|
@@ -28230,8 +28350,20 @@ const orderStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_ORDER';
|
|
|
28230
28350
|
*/
|
|
28231
28351
|
setColumnFixed(fieldOrColumn, fixed) {
|
|
28232
28352
|
const column = handleFieldOrColumn($xetable, fieldOrColumn);
|
|
28233
|
-
|
|
28234
|
-
|
|
28353
|
+
const targetColumn = getRootColumn($xetable, column);
|
|
28354
|
+
const isMaxFixedColumn = computeIsMaxFixedColumn.value;
|
|
28355
|
+
if (targetColumn && targetColumn.fixed !== fixed) {
|
|
28356
|
+
// 是否超过最大固定列数量
|
|
28357
|
+
if (!targetColumn.fixed && isMaxFixedColumn) {
|
|
28358
|
+
if (VXETable.modal) {
|
|
28359
|
+
VXETable.modal.message({
|
|
28360
|
+
status: 'error',
|
|
28361
|
+
content: conf.i18n('vxe.table.maxFixedCol')
|
|
28362
|
+
});
|
|
28363
|
+
}
|
|
28364
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
28365
|
+
}
|
|
28366
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([targetColumn], column => {
|
|
28235
28367
|
column.fixed = fixed;
|
|
28236
28368
|
});
|
|
28237
28369
|
tablePrivateMethods.saveCustomFixed();
|
|
@@ -28244,8 +28376,9 @@ const orderStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_ORDER';
|
|
|
28244
28376
|
*/
|
|
28245
28377
|
clearColumnFixed(fieldOrColumn) {
|
|
28246
28378
|
const column = handleFieldOrColumn($xetable, fieldOrColumn);
|
|
28247
|
-
|
|
28248
|
-
|
|
28379
|
+
const targetColumn = getRootColumn($xetable, column);
|
|
28380
|
+
if (targetColumn && targetColumn.fixed) {
|
|
28381
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([targetColumn], column => {
|
|
28249
28382
|
column.fixed = null;
|
|
28250
28383
|
});
|
|
28251
28384
|
tablePrivateMethods.saveCustomFixed();
|
|
@@ -28304,7 +28437,7 @@ const orderStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_ORDER';
|
|
|
28304
28437
|
*/
|
|
28305
28438
|
resetColumn(options) {
|
|
28306
28439
|
const {
|
|
28307
|
-
|
|
28440
|
+
collectColumn
|
|
28308
28441
|
} = internalData;
|
|
28309
28442
|
const customOpts = computeCustomOpts.value;
|
|
28310
28443
|
const {
|
|
@@ -28315,7 +28448,7 @@ const orderStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_ORDER';
|
|
|
28315
28448
|
resizable: options === true,
|
|
28316
28449
|
fixed: options === true
|
|
28317
28450
|
}, options);
|
|
28318
|
-
|
|
28451
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, column => {
|
|
28319
28452
|
if (opts.resizable) {
|
|
28320
28453
|
column.resizeWidth = 0;
|
|
28321
28454
|
}
|
|
@@ -29412,7 +29545,7 @@ const orderStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_ORDER';
|
|
|
29412
29545
|
if (customVal && validStore.visible) {
|
|
29413
29546
|
setCellValue(row, column, cellValue);
|
|
29414
29547
|
}
|
|
29415
|
-
$xetable.clearValidate();
|
|
29548
|
+
$xetable.clearValidate(row, column);
|
|
29416
29549
|
}).catch(({
|
|
29417
29550
|
rule
|
|
29418
29551
|
}) => {
|
|
@@ -30238,7 +30371,7 @@ const orderStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_ORDER';
|
|
|
30238
30371
|
} = internalData;
|
|
30239
30372
|
const rowkey = getRowkey($xetable);
|
|
30240
30373
|
const isLazy = treeConfig && treeOpts.lazy;
|
|
30241
|
-
const
|
|
30374
|
+
const handleRow = (row, index, items, path, parent, nodes) => {
|
|
30242
30375
|
let rowid = getRowid($xetable, row);
|
|
30243
30376
|
const seq = treeConfig && path ? toTreePathSeq(path) : index + 1;
|
|
30244
30377
|
const level = nodes ? nodes.length - 1 : 0;
|
|
@@ -30270,10 +30403,40 @@ const orderStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_ORDER';
|
|
|
30270
30403
|
}
|
|
30271
30404
|
fullAllDataRowIdData = internalData.fullAllDataRowIdData = {};
|
|
30272
30405
|
if (treeConfig) {
|
|
30273
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData,
|
|
30406
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData, handleRow, treeOpts);
|
|
30407
|
+
} else {
|
|
30408
|
+
tableFullData.forEach(handleRow);
|
|
30409
|
+
}
|
|
30410
|
+
},
|
|
30411
|
+
cacheSourceMap(fullData) {
|
|
30412
|
+
const {
|
|
30413
|
+
treeConfig
|
|
30414
|
+
} = props;
|
|
30415
|
+
const treeOpts = computeTreeOpts.value;
|
|
30416
|
+
let {
|
|
30417
|
+
sourceDataRowIdData
|
|
30418
|
+
} = internalData;
|
|
30419
|
+
const sourceData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(fullData, true);
|
|
30420
|
+
const rowkey = getRowkey($xetable);
|
|
30421
|
+
sourceDataRowIdData = internalData.sourceDataRowIdData = {};
|
|
30422
|
+
const handleSourceRow = row => {
|
|
30423
|
+
let rowid = getRowid($xetable, row);
|
|
30424
|
+
if (eqEmptyValue(rowid)) {
|
|
30425
|
+
rowid = getRowUniqueId();
|
|
30426
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, rowkey, rowid);
|
|
30427
|
+
}
|
|
30428
|
+
sourceDataRowIdData[rowid] = {
|
|
30429
|
+
row,
|
|
30430
|
+
rowid
|
|
30431
|
+
};
|
|
30432
|
+
};
|
|
30433
|
+
// 源数据缓存
|
|
30434
|
+
if (treeConfig && !treeOpts.transform) {
|
|
30435
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(sourceData, handleSourceRow, treeOpts);
|
|
30274
30436
|
} else {
|
|
30275
|
-
|
|
30437
|
+
sourceData.forEach(handleSourceRow);
|
|
30276
30438
|
}
|
|
30439
|
+
internalData.tableSourceData = sourceData;
|
|
30277
30440
|
},
|
|
30278
30441
|
/**
|
|
30279
30442
|
* 指定列宽的列进行拆分
|
|
@@ -32220,7 +32383,8 @@ dynamicApp.component(table.name, table);
|
|
|
32220
32383
|
customTitle: '列设置',
|
|
32221
32384
|
customAll: '全部',
|
|
32222
32385
|
customConfirm: '确认',
|
|
32223
|
-
customRestore: '
|
|
32386
|
+
customRestore: '重置',
|
|
32387
|
+
maxFixedCol: '最大固定列的数量不能超过 {0} 个'
|
|
32224
32388
|
},
|
|
32225
32389
|
grid: {
|
|
32226
32390
|
selectOneRecord: '请至少选择一条记录!',
|
|
@@ -32329,7 +32493,10 @@ dynamicApp.component(table.name, table);
|
|
|
32329
32493
|
custom: '列设置',
|
|
32330
32494
|
customAll: '全部',
|
|
32331
32495
|
customConfirm: '确认',
|
|
32332
|
-
customRestore: '重置'
|
|
32496
|
+
customRestore: '重置',
|
|
32497
|
+
fixedLeft: '固定在左侧',
|
|
32498
|
+
fixedRight: '固定在右侧',
|
|
32499
|
+
cancelfixed: '取消固定'
|
|
32333
32500
|
},
|
|
32334
32501
|
input: {
|
|
32335
32502
|
date: {
|