vxe-table 3.13.18 → 3.13.19
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/style.css +1 -1
- package/es/table/render/index.js +88 -57
- package/es/table/src/methods.js +40 -24
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +136 -88
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/render/index.js +96 -62
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/methods.js +38 -24
- package/lib/table/src/methods.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/table/render/index.ts +87 -55
- package/packages/table/src/methods.ts +40 -24
- /package/es/{iconfont.1741140503645.ttf → iconfont.1741224103306.ttf} +0 -0
- /package/es/{iconfont.1741140503645.woff → iconfont.1741224103306.woff} +0 -0
- /package/es/{iconfont.1741140503645.woff2 → iconfont.1741224103306.woff2} +0 -0
- /package/lib/{iconfont.1741140503645.ttf → iconfont.1741224103306.ttf} +0 -0
- /package/lib/{iconfont.1741140503645.woff → iconfont.1741224103306.woff} +0 -0
- /package/lib/{iconfont.1741140503645.woff2 → iconfont.1741224103306.woff2} +0 -0
package/es/table/render/index.js
CHANGED
|
@@ -556,6 +556,63 @@ function handleExportTreeSelectMethod(params) {
|
|
|
556
556
|
const { row, column, options } = params;
|
|
557
557
|
return options.original ? getCellValue(row, column) : getTreeSelectCellValue(column.editRender || column.cellRender, params);
|
|
558
558
|
}
|
|
559
|
+
function handleNumberCell(h, renderOpts, params) {
|
|
560
|
+
const { props = {}, showNegativeStatus } = renderOpts;
|
|
561
|
+
const { row, column } = params;
|
|
562
|
+
const { type } = props;
|
|
563
|
+
let cellValue = XEUtils.get(row, column.field);
|
|
564
|
+
let isNegative = false;
|
|
565
|
+
if (!isEmptyValue(cellValue)) {
|
|
566
|
+
const numberInputConfig = getConfig().numberInput || {};
|
|
567
|
+
if (type === 'float') {
|
|
568
|
+
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
569
|
+
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
|
|
570
|
+
cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits);
|
|
571
|
+
if (!autoFill) {
|
|
572
|
+
cellValue = XEUtils.toNumber(cellValue);
|
|
573
|
+
}
|
|
574
|
+
if (showNegativeStatus) {
|
|
575
|
+
if (cellValue < 0) {
|
|
576
|
+
isNegative = true;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
else if (type === 'amount') {
|
|
581
|
+
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
582
|
+
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
|
|
583
|
+
const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
|
|
584
|
+
cellValue = XEUtils.toNumber(cellValue);
|
|
585
|
+
if (showNegativeStatus) {
|
|
586
|
+
if (cellValue < 0) {
|
|
587
|
+
isNegative = true;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
cellValue = XEUtils.commafy(cellValue, { digits });
|
|
591
|
+
if (!autoFill) {
|
|
592
|
+
const [iStr, dStr] = cellValue.split('.');
|
|
593
|
+
if (dStr) {
|
|
594
|
+
const dRest = dStr.replace(/0+$/, '');
|
|
595
|
+
cellValue = dRest ? [iStr, '.', dRest].join('') : iStr;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
if (showCurrency) {
|
|
599
|
+
cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`;
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
else {
|
|
603
|
+
if (showNegativeStatus) {
|
|
604
|
+
if (XEUtils.toNumber(cellValue) < 0) {
|
|
605
|
+
isNegative = true;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
return getCellLabelVNs(h, renderOpts, params, cellValue, isNegative
|
|
611
|
+
? {
|
|
612
|
+
class: 'is--negative'
|
|
613
|
+
}
|
|
614
|
+
: {});
|
|
615
|
+
}
|
|
559
616
|
/**
|
|
560
617
|
* 表格 - 渲染器
|
|
561
618
|
*/
|
|
@@ -620,66 +677,19 @@ renderer.mixin({
|
|
|
620
677
|
renderTableFilter: defaultFilterRender,
|
|
621
678
|
tableFilterDefaultMethod: handleInputFilterMethod
|
|
622
679
|
},
|
|
680
|
+
FormatNumberInput: {
|
|
681
|
+
renderTableDefault: handleNumberCell,
|
|
682
|
+
tableFilterDefaultMethod: handleInputFilterMethod,
|
|
683
|
+
tableExportMethod(params) {
|
|
684
|
+
const { row, column } = params;
|
|
685
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
686
|
+
return cellValue;
|
|
687
|
+
}
|
|
688
|
+
},
|
|
623
689
|
VxeNumberInput: {
|
|
624
690
|
tableAutoFocus: 'input',
|
|
625
691
|
renderTableEdit: defaultEditRender,
|
|
626
|
-
renderTableCell
|
|
627
|
-
const { props = {}, showNegativeStatus } = renderOpts;
|
|
628
|
-
const { row, column } = params;
|
|
629
|
-
const { type } = props;
|
|
630
|
-
let cellValue = XEUtils.get(row, column.field);
|
|
631
|
-
let isNegative = false;
|
|
632
|
-
if (!isEmptyValue(cellValue)) {
|
|
633
|
-
const numberInputConfig = getConfig().numberInput || {};
|
|
634
|
-
if (type === 'float') {
|
|
635
|
-
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
636
|
-
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
|
|
637
|
-
cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits);
|
|
638
|
-
if (!autoFill) {
|
|
639
|
-
cellValue = XEUtils.toNumber(cellValue);
|
|
640
|
-
}
|
|
641
|
-
if (showNegativeStatus) {
|
|
642
|
-
if (cellValue < 0) {
|
|
643
|
-
isNegative = true;
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
else if (type === 'amount') {
|
|
648
|
-
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
649
|
-
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
|
|
650
|
-
const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
|
|
651
|
-
cellValue = XEUtils.toNumber(cellValue);
|
|
652
|
-
if (showNegativeStatus) {
|
|
653
|
-
if (cellValue < 0) {
|
|
654
|
-
isNegative = true;
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
cellValue = XEUtils.commafy(cellValue, { digits });
|
|
658
|
-
if (!autoFill) {
|
|
659
|
-
const [iStr, dStr] = cellValue.split('.');
|
|
660
|
-
if (dStr) {
|
|
661
|
-
const dRest = dStr.replace(/0+$/, '');
|
|
662
|
-
cellValue = dRest ? [iStr, '.', dRest].join('') : iStr;
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
if (showCurrency) {
|
|
666
|
-
cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`;
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
else {
|
|
670
|
-
if (showNegativeStatus) {
|
|
671
|
-
if (XEUtils.toNumber(cellValue) < 0) {
|
|
672
|
-
isNegative = true;
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
return getCellLabelVNs(h, renderOpts, params, cellValue, isNegative
|
|
678
|
-
? {
|
|
679
|
-
class: 'is--negative'
|
|
680
|
-
}
|
|
681
|
-
: {});
|
|
682
|
-
},
|
|
692
|
+
renderTableCell: handleNumberCell,
|
|
683
693
|
renderTableFooter(h, renderOpts, params) {
|
|
684
694
|
const { props = {} } = renderOpts;
|
|
685
695
|
const { row, column, _columnIndex } = params;
|
|
@@ -784,11 +794,22 @@ renderer.mixin({
|
|
|
784
794
|
tableFilterDefaultMethod: handleFilterMethod,
|
|
785
795
|
tableExportMethod: handleExportSelectMethod
|
|
786
796
|
},
|
|
797
|
+
/**
|
|
798
|
+
* 已废弃,被 FormatSelect 替换
|
|
799
|
+
* @deprecated
|
|
800
|
+
*/
|
|
787
801
|
formatOption: {
|
|
788
802
|
renderTableDefault(h, renderOpts, params) {
|
|
789
803
|
return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
|
|
790
804
|
}
|
|
791
805
|
},
|
|
806
|
+
FormatSelect: {
|
|
807
|
+
renderTableDefault(h, renderOpts, params) {
|
|
808
|
+
return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
|
|
809
|
+
},
|
|
810
|
+
tableFilterDefaultMethod: handleFilterMethod,
|
|
811
|
+
tableExportMethod: handleExportSelectMethod
|
|
812
|
+
},
|
|
792
813
|
VxeTreeSelect: {
|
|
793
814
|
tableAutoFocus: 'input',
|
|
794
815
|
renderTableEdit: defaultTableOrTreeSelectEditRender,
|
|
@@ -805,11 +826,21 @@ renderer.mixin({
|
|
|
805
826
|
},
|
|
806
827
|
tableExportMethod: handleExportTreeSelectMethod
|
|
807
828
|
},
|
|
829
|
+
/**
|
|
830
|
+
* 已废弃,被 FormatTreeSelect 替换
|
|
831
|
+
* @deprecated
|
|
832
|
+
*/
|
|
808
833
|
formatTree: {
|
|
809
834
|
renderTableDefault(h, renderOpts, params) {
|
|
810
835
|
return getCellLabelVNs(h, renderOpts, params, getTreeSelectCellValue(renderOpts, params));
|
|
811
836
|
}
|
|
812
837
|
},
|
|
838
|
+
FormatTreeSelect: {
|
|
839
|
+
renderTableDefault(h, renderOpts, params) {
|
|
840
|
+
return getCellLabelVNs(h, renderOpts, params, getTreeSelectCellValue(renderOpts, params));
|
|
841
|
+
},
|
|
842
|
+
tableExportMethod: handleExportTreeSelectMethod
|
|
843
|
+
},
|
|
813
844
|
VxeColorPicker: {
|
|
814
845
|
tableAutoFocus: 'input',
|
|
815
846
|
renderTableEdit(h, renderOpts, params) {
|
package/es/table/src/methods.js
CHANGED
|
@@ -2201,10 +2201,26 @@ const Methods = {
|
|
|
2201
2201
|
* 获取父容器的高度
|
|
2202
2202
|
*/
|
|
2203
2203
|
getParentHeight() {
|
|
2204
|
-
const
|
|
2205
|
-
const
|
|
2206
|
-
const
|
|
2207
|
-
|
|
2204
|
+
const $xeTable = this;
|
|
2205
|
+
const $xeGrid = $xeTable.$xeGrid;
|
|
2206
|
+
const props = $xeTable;
|
|
2207
|
+
const { height } = props;
|
|
2208
|
+
const el = $xeTable.$refs.refElem;
|
|
2209
|
+
if (el) {
|
|
2210
|
+
const parentElem = el.parentNode;
|
|
2211
|
+
const parentPaddingSize = height === '100%' || height === 'auto' ? getPaddingTopBottomSize(parentElem) : 0;
|
|
2212
|
+
let parentWrapperHeight = 0;
|
|
2213
|
+
if (parentElem) {
|
|
2214
|
+
if ($xeGrid && hasClass(parentElem, 'vxe-grid--table-wrapper')) {
|
|
2215
|
+
parentWrapperHeight = $xeGrid.getParentHeight();
|
|
2216
|
+
}
|
|
2217
|
+
else {
|
|
2218
|
+
parentWrapperHeight = parentElem.clientHeight;
|
|
2219
|
+
}
|
|
2220
|
+
}
|
|
2221
|
+
return Math.floor(parentWrapperHeight - parentPaddingSize);
|
|
2222
|
+
}
|
|
2223
|
+
return 0;
|
|
2208
2224
|
},
|
|
2209
2225
|
/**
|
|
2210
2226
|
* 获取需要排除的高度
|
|
@@ -2386,7 +2402,7 @@ const Methods = {
|
|
|
2386
2402
|
// warnLog('vxe.error.reqProp', ['table.show-overflow'])
|
|
2387
2403
|
// }
|
|
2388
2404
|
if (this.spanMethod) {
|
|
2389
|
-
|
|
2405
|
+
errLog('vxe.error.scrollErrProp', ['table.span-method']);
|
|
2390
2406
|
}
|
|
2391
2407
|
}
|
|
2392
2408
|
handleReserveStatus($xeTable);
|
|
@@ -2926,12 +2942,12 @@ const Methods = {
|
|
|
2926
2942
|
const reactData = $xeTable;
|
|
2927
2943
|
const internalData = $xeTable;
|
|
2928
2944
|
const { keepSource, treeConfig } = props;
|
|
2929
|
-
const { fullAllDataRowIdData, tableSourceData, sourceDataRowIdData, tableFullData, afterFullData } = internalData;
|
|
2945
|
+
const { fullAllDataRowIdData, fullDataRowIdData, tableSourceData, sourceDataRowIdData, tableFullData, afterFullData } = internalData;
|
|
2930
2946
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
2931
2947
|
const { transform } = treeOpts;
|
|
2932
2948
|
if (!keepSource) {
|
|
2933
2949
|
if (process.env.NODE_ENV === 'development') {
|
|
2934
|
-
|
|
2950
|
+
errLog('vxe.error.reqProp', ['keep-source']);
|
|
2935
2951
|
}
|
|
2936
2952
|
return $xeTable.$nextTick();
|
|
2937
2953
|
}
|
|
@@ -2946,23 +2962,23 @@ const Methods = {
|
|
|
2946
2962
|
}
|
|
2947
2963
|
let reDelFlag = false;
|
|
2948
2964
|
if (targetRows.length) {
|
|
2949
|
-
targetRows.forEach((
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
tableFullData.unshift(
|
|
2965
|
-
afterFullData.unshift(
|
|
2965
|
+
targetRows.forEach((item) => {
|
|
2966
|
+
const rowid = getRowid($xeTable, item);
|
|
2967
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
2968
|
+
if (rowRest) {
|
|
2969
|
+
const row = rowRest.row;
|
|
2970
|
+
if (!$xeTable.isInsertByRow(row)) {
|
|
2971
|
+
const oRow = sourceDataRowIdData[rowid];
|
|
2972
|
+
if (oRow && row) {
|
|
2973
|
+
if (field) {
|
|
2974
|
+
XEUtils.set(row, field, XEUtils.clone(XEUtils.get(oRow, field), true));
|
|
2975
|
+
}
|
|
2976
|
+
else {
|
|
2977
|
+
XEUtils.destructuring(row, XEUtils.clone(oRow, true));
|
|
2978
|
+
}
|
|
2979
|
+
if (!fullDataRowIdData[rowid] && $xeTable.isRemoveByRow(row)) {
|
|
2980
|
+
tableFullData.unshift(row);
|
|
2981
|
+
afterFullData.unshift(row);
|
|
2966
2982
|
reDelFlag = true;
|
|
2967
2983
|
}
|
|
2968
2984
|
}
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED
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.19";
|
|
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.19"}`;
|
|
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
|
|
@@ -8627,14 +8627,27 @@ const Methods = {
|
|
|
8627
8627
|
* 获取父容器的高度
|
|
8628
8628
|
*/
|
|
8629
8629
|
getParentHeight() {
|
|
8630
|
+
const $xeTable = this;
|
|
8631
|
+
const $xeGrid = $xeTable.$xeGrid;
|
|
8632
|
+
const props = $xeTable;
|
|
8630
8633
|
const {
|
|
8631
|
-
$el,
|
|
8632
|
-
$xegrid,
|
|
8633
8634
|
height
|
|
8634
|
-
} =
|
|
8635
|
-
const
|
|
8636
|
-
|
|
8637
|
-
|
|
8635
|
+
} = props;
|
|
8636
|
+
const el = $xeTable.$refs.refElem;
|
|
8637
|
+
if (el) {
|
|
8638
|
+
const parentElem = el.parentNode;
|
|
8639
|
+
const parentPaddingSize = height === '100%' || height === 'auto' ? getPaddingTopBottomSize(parentElem) : 0;
|
|
8640
|
+
let parentWrapperHeight = 0;
|
|
8641
|
+
if (parentElem) {
|
|
8642
|
+
if ($xeGrid && hasClass(parentElem, 'vxe-grid--table-wrapper')) {
|
|
8643
|
+
parentWrapperHeight = $xeGrid.getParentHeight();
|
|
8644
|
+
} else {
|
|
8645
|
+
parentWrapperHeight = parentElem.clientHeight;
|
|
8646
|
+
}
|
|
8647
|
+
}
|
|
8648
|
+
return Math.floor(parentWrapperHeight - parentPaddingSize);
|
|
8649
|
+
}
|
|
8650
|
+
return 0;
|
|
8638
8651
|
},
|
|
8639
8652
|
/**
|
|
8640
8653
|
* 获取需要排除的高度
|
|
@@ -8837,7 +8850,7 @@ const Methods = {
|
|
|
8837
8850
|
// warnLog('vxe.error.reqProp', ['table.show-overflow'])
|
|
8838
8851
|
// }
|
|
8839
8852
|
if (this.spanMethod) {
|
|
8840
|
-
|
|
8853
|
+
errLog('vxe.error.scrollErrProp', ['table.span-method']);
|
|
8841
8854
|
}
|
|
8842
8855
|
}
|
|
8843
8856
|
handleReserveStatus($xeTable);
|
|
@@ -9475,6 +9488,7 @@ const Methods = {
|
|
|
9475
9488
|
} = props;
|
|
9476
9489
|
const {
|
|
9477
9490
|
fullAllDataRowIdData,
|
|
9491
|
+
fullDataRowIdData,
|
|
9478
9492
|
tableSourceData,
|
|
9479
9493
|
sourceDataRowIdData,
|
|
9480
9494
|
tableFullData,
|
|
@@ -9486,7 +9500,7 @@ const Methods = {
|
|
|
9486
9500
|
} = treeOpts;
|
|
9487
9501
|
if (!keepSource) {
|
|
9488
9502
|
if (true) {
|
|
9489
|
-
|
|
9503
|
+
errLog('vxe.error.reqProp', ['keep-source']);
|
|
9490
9504
|
}
|
|
9491
9505
|
return $xeTable.$nextTick();
|
|
9492
9506
|
}
|
|
@@ -9500,22 +9514,22 @@ const Methods = {
|
|
|
9500
9514
|
}
|
|
9501
9515
|
let reDelFlag = false;
|
|
9502
9516
|
if (targetRows.length) {
|
|
9503
|
-
targetRows.forEach(
|
|
9504
|
-
|
|
9505
|
-
|
|
9506
|
-
|
|
9507
|
-
|
|
9508
|
-
|
|
9509
|
-
|
|
9510
|
-
|
|
9511
|
-
|
|
9512
|
-
|
|
9513
|
-
|
|
9514
|
-
|
|
9515
|
-
|
|
9516
|
-
|
|
9517
|
-
tableFullData.unshift(
|
|
9518
|
-
afterFullData.unshift(
|
|
9517
|
+
targetRows.forEach(item => {
|
|
9518
|
+
const rowid = getRowid($xeTable, item);
|
|
9519
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
9520
|
+
if (rowRest) {
|
|
9521
|
+
const row = rowRest.row;
|
|
9522
|
+
if (!$xeTable.isInsertByRow(row)) {
|
|
9523
|
+
const oRow = sourceDataRowIdData[rowid];
|
|
9524
|
+
if (oRow && row) {
|
|
9525
|
+
if (field) {
|
|
9526
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, field, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(oRow, field), true));
|
|
9527
|
+
} else {
|
|
9528
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().destructuring(row, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(oRow, true));
|
|
9529
|
+
}
|
|
9530
|
+
if (!fullDataRowIdData[rowid] && $xeTable.isRemoveByRow(row)) {
|
|
9531
|
+
tableFullData.unshift(row);
|
|
9532
|
+
afterFullData.unshift(row);
|
|
9519
9533
|
reDelFlag = true;
|
|
9520
9534
|
}
|
|
9521
9535
|
}
|
|
@@ -31240,6 +31254,69 @@ function handleExportTreeSelectMethod(params) {
|
|
|
31240
31254
|
} = params;
|
|
31241
31255
|
return options.original ? getCellValue(row, column) : getTreeSelectCellValue(column.editRender || column.cellRender, params);
|
|
31242
31256
|
}
|
|
31257
|
+
function handleNumberCell(h, renderOpts, params) {
|
|
31258
|
+
const {
|
|
31259
|
+
props = {},
|
|
31260
|
+
showNegativeStatus
|
|
31261
|
+
} = renderOpts;
|
|
31262
|
+
const {
|
|
31263
|
+
row,
|
|
31264
|
+
column
|
|
31265
|
+
} = params;
|
|
31266
|
+
const {
|
|
31267
|
+
type
|
|
31268
|
+
} = props;
|
|
31269
|
+
let cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field);
|
|
31270
|
+
let isNegative = false;
|
|
31271
|
+
if (!isEmptyValue(cellValue)) {
|
|
31272
|
+
const numberInputConfig = render_getConfig().numberInput || {};
|
|
31273
|
+
if (type === 'float') {
|
|
31274
|
+
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
31275
|
+
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
|
|
31276
|
+
cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toFixed(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().floor(cellValue, digits), digits);
|
|
31277
|
+
if (!autoFill) {
|
|
31278
|
+
cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);
|
|
31279
|
+
}
|
|
31280
|
+
if (showNegativeStatus) {
|
|
31281
|
+
if (cellValue < 0) {
|
|
31282
|
+
isNegative = true;
|
|
31283
|
+
}
|
|
31284
|
+
}
|
|
31285
|
+
} else if (type === 'amount') {
|
|
31286
|
+
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
31287
|
+
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
|
|
31288
|
+
const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
|
|
31289
|
+
cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);
|
|
31290
|
+
if (showNegativeStatus) {
|
|
31291
|
+
if (cellValue < 0) {
|
|
31292
|
+
isNegative = true;
|
|
31293
|
+
}
|
|
31294
|
+
}
|
|
31295
|
+
cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().commafy(cellValue, {
|
|
31296
|
+
digits
|
|
31297
|
+
});
|
|
31298
|
+
if (!autoFill) {
|
|
31299
|
+
const [iStr, dStr] = cellValue.split('.');
|
|
31300
|
+
if (dStr) {
|
|
31301
|
+
const dRest = dStr.replace(/0+$/, '');
|
|
31302
|
+
cellValue = dRest ? [iStr, '.', dRest].join('') : iStr;
|
|
31303
|
+
}
|
|
31304
|
+
}
|
|
31305
|
+
if (showCurrency) {
|
|
31306
|
+
cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || render_getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`;
|
|
31307
|
+
}
|
|
31308
|
+
} else {
|
|
31309
|
+
if (showNegativeStatus) {
|
|
31310
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue) < 0) {
|
|
31311
|
+
isNegative = true;
|
|
31312
|
+
}
|
|
31313
|
+
}
|
|
31314
|
+
}
|
|
31315
|
+
}
|
|
31316
|
+
return getCellLabelVNs(h, renderOpts, params, cellValue, isNegative ? {
|
|
31317
|
+
class: 'is--negative'
|
|
31318
|
+
} : {});
|
|
31319
|
+
}
|
|
31243
31320
|
/**
|
|
31244
31321
|
* 表格 - 渲染器
|
|
31245
31322
|
*/
|
|
@@ -31311,72 +31388,22 @@ render_renderer.mixin({
|
|
|
31311
31388
|
renderTableFilter: defaultFilterRender,
|
|
31312
31389
|
tableFilterDefaultMethod: handleInputFilterMethod
|
|
31313
31390
|
},
|
|
31314
|
-
|
|
31315
|
-
|
|
31316
|
-
|
|
31317
|
-
|
|
31318
|
-
const {
|
|
31319
|
-
props = {},
|
|
31320
|
-
showNegativeStatus
|
|
31321
|
-
} = renderOpts;
|
|
31391
|
+
FormatNumberInput: {
|
|
31392
|
+
renderTableDefault: handleNumberCell,
|
|
31393
|
+
tableFilterDefaultMethod: handleInputFilterMethod,
|
|
31394
|
+
tableExportMethod(params) {
|
|
31322
31395
|
const {
|
|
31323
31396
|
row,
|
|
31324
31397
|
column
|
|
31325
31398
|
} = params;
|
|
31326
|
-
const
|
|
31327
|
-
|
|
31328
|
-
|
|
31329
|
-
|
|
31330
|
-
|
|
31331
|
-
|
|
31332
|
-
|
|
31333
|
-
|
|
31334
|
-
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
31335
|
-
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
|
|
31336
|
-
cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toFixed(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().floor(cellValue, digits), digits);
|
|
31337
|
-
if (!autoFill) {
|
|
31338
|
-
cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);
|
|
31339
|
-
}
|
|
31340
|
-
if (showNegativeStatus) {
|
|
31341
|
-
if (cellValue < 0) {
|
|
31342
|
-
isNegative = true;
|
|
31343
|
-
}
|
|
31344
|
-
}
|
|
31345
|
-
} else if (type === 'amount') {
|
|
31346
|
-
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
31347
|
-
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
|
|
31348
|
-
const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
|
|
31349
|
-
cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);
|
|
31350
|
-
if (showNegativeStatus) {
|
|
31351
|
-
if (cellValue < 0) {
|
|
31352
|
-
isNegative = true;
|
|
31353
|
-
}
|
|
31354
|
-
}
|
|
31355
|
-
cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().commafy(cellValue, {
|
|
31356
|
-
digits
|
|
31357
|
-
});
|
|
31358
|
-
if (!autoFill) {
|
|
31359
|
-
const [iStr, dStr] = cellValue.split('.');
|
|
31360
|
-
if (dStr) {
|
|
31361
|
-
const dRest = dStr.replace(/0+$/, '');
|
|
31362
|
-
cellValue = dRest ? [iStr, '.', dRest].join('') : iStr;
|
|
31363
|
-
}
|
|
31364
|
-
}
|
|
31365
|
-
if (showCurrency) {
|
|
31366
|
-
cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || render_getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`;
|
|
31367
|
-
}
|
|
31368
|
-
} else {
|
|
31369
|
-
if (showNegativeStatus) {
|
|
31370
|
-
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue) < 0) {
|
|
31371
|
-
isNegative = true;
|
|
31372
|
-
}
|
|
31373
|
-
}
|
|
31374
|
-
}
|
|
31375
|
-
}
|
|
31376
|
-
return getCellLabelVNs(h, renderOpts, params, cellValue, isNegative ? {
|
|
31377
|
-
class: 'is--negative'
|
|
31378
|
-
} : {});
|
|
31379
|
-
},
|
|
31399
|
+
const cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field);
|
|
31400
|
+
return cellValue;
|
|
31401
|
+
}
|
|
31402
|
+
},
|
|
31403
|
+
VxeNumberInput: {
|
|
31404
|
+
tableAutoFocus: 'input',
|
|
31405
|
+
renderTableEdit: defaultEditRender,
|
|
31406
|
+
renderTableCell: handleNumberCell,
|
|
31380
31407
|
renderTableFooter(h, renderOpts, params) {
|
|
31381
31408
|
const {
|
|
31382
31409
|
props = {}
|
|
@@ -31513,11 +31540,22 @@ render_renderer.mixin({
|
|
|
31513
31540
|
tableFilterDefaultMethod: handleFilterMethod,
|
|
31514
31541
|
tableExportMethod: handleExportSelectMethod
|
|
31515
31542
|
},
|
|
31543
|
+
/**
|
|
31544
|
+
* 已废弃,被 FormatSelect 替换
|
|
31545
|
+
* @deprecated
|
|
31546
|
+
*/
|
|
31516
31547
|
formatOption: {
|
|
31517
31548
|
renderTableDefault(h, renderOpts, params) {
|
|
31518
31549
|
return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
|
|
31519
31550
|
}
|
|
31520
31551
|
},
|
|
31552
|
+
FormatSelect: {
|
|
31553
|
+
renderTableDefault(h, renderOpts, params) {
|
|
31554
|
+
return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
|
|
31555
|
+
},
|
|
31556
|
+
tableFilterDefaultMethod: handleFilterMethod,
|
|
31557
|
+
tableExportMethod: handleExportSelectMethod
|
|
31558
|
+
},
|
|
31521
31559
|
VxeTreeSelect: {
|
|
31522
31560
|
tableAutoFocus: 'input',
|
|
31523
31561
|
renderTableEdit: defaultTableOrTreeSelectEditRender,
|
|
@@ -31534,11 +31572,21 @@ render_renderer.mixin({
|
|
|
31534
31572
|
},
|
|
31535
31573
|
tableExportMethod: handleExportTreeSelectMethod
|
|
31536
31574
|
},
|
|
31575
|
+
/**
|
|
31576
|
+
* 已废弃,被 FormatTreeSelect 替换
|
|
31577
|
+
* @deprecated
|
|
31578
|
+
*/
|
|
31537
31579
|
formatTree: {
|
|
31538
31580
|
renderTableDefault(h, renderOpts, params) {
|
|
31539
31581
|
return getCellLabelVNs(h, renderOpts, params, getTreeSelectCellValue(renderOpts, params));
|
|
31540
31582
|
}
|
|
31541
31583
|
},
|
|
31584
|
+
FormatTreeSelect: {
|
|
31585
|
+
renderTableDefault(h, renderOpts, params) {
|
|
31586
|
+
return getCellLabelVNs(h, renderOpts, params, getTreeSelectCellValue(renderOpts, params));
|
|
31587
|
+
},
|
|
31588
|
+
tableExportMethod: handleExportTreeSelectMethod
|
|
31589
|
+
},
|
|
31542
31590
|
VxeColorPicker: {
|
|
31543
31591
|
tableAutoFocus: 'input',
|
|
31544
31592
|
renderTableEdit(h, renderOpts, params) {
|