@fecp/designer 5.4.108 → 5.4.110
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/designer/package.json.mjs +1 -1
- package/es/designer/src/packages/dialog/useDialogDialog.mjs +1 -1
- package/es/designer/src/packages/dialogGlobal/useDialogGlobalDialog.mjs +1 -1
- package/es/designer/src/packages/form/property/widgets.vue.mjs +2 -2
- package/es/designer.css +5 -5
- package/es/node_modules/vxe-table/es/grid/src/grid.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/module/custom/hook.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/module/custom/panel.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/module/edit/hook.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/module/export/export-panel.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/module/export/hook.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/module/export/import-panel.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/module/filter/hook.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/module/filter/panel.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/module/keyboard/hook.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/module/menu/hook.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/module/menu/panel.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/module/validator/hook.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/render/index.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/src/body.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/src/cell.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/src/columnInfo.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/src/footer.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/src/header.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/src/table.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/src/use/cell-view.mjs +1 -1
- package/es/node_modules/vxe-table/es/table/src/util.mjs +1 -1
- package/es/node_modules/vxe-table/es/toolbar/src/toolbar.mjs +1 -1
- package/es/node_modules/vxe-table/es/ui/src/anime.mjs +1 -1
- package/es/node_modules/vxe-table/es/ui/src/dom.mjs +1 -1
- package/es/node_modules/vxe-table/es/ui/src/utils.mjs +1 -1
- package/es/node_modules/vxe-table/es/ui/src/vn.mjs +1 -1
- package/es/packages/mobile/src/components/base/card/Card.vue.mjs +2 -2
- package/es/packages/mobile/src/components/dataDisplay/table/Table.vue.mjs +2 -1
- package/es/packages/mobile/src/components/form/field/Field.vue.mjs +0 -1
- package/es/packages/mobile/src/utils/optionUtil.mjs +2 -3
- package/es/packages/vue/src/components/forms/form/FormProxy.vue.mjs +13 -0
- package/es/packages/vue/src/components/forms/subForm/SubForm.vue.mjs +2 -2
- package/es/packages/vue/src/components/table/CustomButtons.vue.mjs +2 -1
- package/es/packages/vue/src/components/table/DynamicQuery.vue.mjs +2 -1
- package/es/packages/vue/src/components/table/Table.vue.mjs +2 -1
- package/es/packages/vue/src/components/table/TableColumn.vue.mjs +2 -1
- package/lib/designer/package.json.js +1 -1
- package/lib/designer/src/packages/dialog/useDialogDialog.js +1 -1
- package/lib/designer/src/packages/dialogGlobal/useDialogGlobalDialog.js +1 -1
- package/lib/designer/src/packages/form/property/widgets.vue.js +2 -2
- package/lib/designer.css +5 -5
- package/lib/node_modules/vxe-table/es/grid/src/grid.js +41 -41
- package/lib/node_modules/vxe-table/es/table/module/custom/hook.js +9 -9
- package/lib/node_modules/vxe-table/es/table/module/custom/panel.js +23 -23
- package/lib/node_modules/vxe-table/es/table/module/edit/hook.js +28 -28
- package/lib/node_modules/vxe-table/es/table/module/export/export-panel.js +6 -6
- package/lib/node_modules/vxe-table/es/table/module/export/hook.js +50 -50
- package/lib/node_modules/vxe-table/es/table/module/export/import-panel.js +2 -2
- package/lib/node_modules/vxe-table/es/table/module/filter/hook.js +2 -2
- package/lib/node_modules/vxe-table/es/table/module/filter/panel.js +3 -3
- package/lib/node_modules/vxe-table/es/table/module/keyboard/hook.js +6 -6
- package/lib/node_modules/vxe-table/es/table/module/menu/hook.js +7 -7
- package/lib/node_modules/vxe-table/es/table/module/menu/panel.js +9 -9
- package/lib/node_modules/vxe-table/es/table/module/validator/hook.js +26 -26
- package/lib/node_modules/vxe-table/es/table/render/index.js +65 -65
- package/lib/node_modules/vxe-table/es/table/src/body.js +10 -10
- package/lib/node_modules/vxe-table/es/table/src/cell.js +15 -15
- package/lib/node_modules/vxe-table/es/table/src/columnInfo.js +12 -12
- package/lib/node_modules/vxe-table/es/table/src/footer.js +7 -7
- package/lib/node_modules/vxe-table/es/table/src/header.js +12 -12
- package/lib/node_modules/vxe-table/es/table/src/table.js +342 -342
- package/lib/node_modules/vxe-table/es/table/src/use/cell-view.js +3 -3
- package/lib/node_modules/vxe-table/es/table/src/util.js +24 -24
- package/lib/node_modules/vxe-table/es/toolbar/src/toolbar.js +23 -23
- package/lib/node_modules/vxe-table/es/ui/src/anime.js +7 -7
- package/lib/node_modules/vxe-table/es/ui/src/dom.js +5 -5
- package/lib/node_modules/vxe-table/es/ui/src/utils.js +4 -4
- package/lib/node_modules/vxe-table/es/ui/src/vn.js +2 -2
- package/lib/packages/mobile/src/components/base/card/Card.vue.js +2 -2
- package/lib/packages/mobile/src/components/dataDisplay/table/Table.vue.js +3 -2
- package/lib/packages/mobile/src/components/form/field/Field.vue.js +0 -1
- package/lib/packages/mobile/src/utils/optionUtil.js +2 -3
- package/lib/packages/vue/src/components/forms/form/FormProxy.vue.js +13 -0
- package/lib/packages/vue/src/components/forms/subForm/SubForm.vue.js +2 -2
- package/lib/packages/vue/src/components/table/CustomButtons.vue.js +5 -4
- package/lib/packages/vue/src/components/table/DynamicQuery.vue.js +27 -26
- package/lib/packages/vue/src/components/table/Table.vue.js +5 -4
- package/lib/packages/vue/src/components/table/TableColumn.vue.js +17 -16
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const vue = require("vue");
|
|
3
|
-
const
|
|
3
|
+
const XEUtils = require("xe-utils");
|
|
4
4
|
require("../../ui/index.js");
|
|
5
5
|
const util = require("../src/util.js");
|
|
6
6
|
const utils = require("../../ui/src/utils.js");
|
|
@@ -11,14 +11,14 @@ const { getConfig, renderer, getI18n, getComponent } = index_esm.VxeUI;
|
|
|
11
11
|
const componentDefaultModelProp = "modelValue";
|
|
12
12
|
const defaultCompProps = {};
|
|
13
13
|
function handleDefaultValue(value, defaultVal, initVal) {
|
|
14
|
-
return
|
|
14
|
+
return XEUtils.eqNull(value) ? XEUtils.eqNull(defaultVal) ? initVal : defaultVal : value;
|
|
15
15
|
}
|
|
16
16
|
function parseDate(value, props) {
|
|
17
|
-
return value && props.valueFormat ?
|
|
17
|
+
return value && props.valueFormat ? XEUtils.toStringDate(value, props.valueFormat) : value;
|
|
18
18
|
}
|
|
19
19
|
function getFormatDate(value, props, defaultFormat) {
|
|
20
20
|
const { dateConfig = {} } = props;
|
|
21
|
-
return
|
|
21
|
+
return XEUtils.toDateString(parseDate(value, props), dateConfig.labelFormat || defaultFormat);
|
|
22
22
|
}
|
|
23
23
|
function getLabelFormatDate(value, props) {
|
|
24
24
|
return getFormatDate(value, props, getI18n(`vxe.input.date.labelFormat.${props.type || "date"}`));
|
|
@@ -62,10 +62,10 @@ function getInputImmediateModel(renderOpts) {
|
|
|
62
62
|
return immediate;
|
|
63
63
|
}
|
|
64
64
|
function getCellEditProps(renderOpts, params, value, defaultProps) {
|
|
65
|
-
return
|
|
65
|
+
return XEUtils.assign({ immediate: getInputImmediateModel(renderOpts) }, defaultCompProps, defaultProps, renderOpts.props, { [componentDefaultModelProp]: value });
|
|
66
66
|
}
|
|
67
67
|
function getCellEditFilterProps(renderOpts, params, value, defaultProps) {
|
|
68
|
-
return
|
|
68
|
+
return XEUtils.assign({}, defaultCompProps, defaultProps, renderOpts.props, { [componentDefaultModelProp]: value });
|
|
69
69
|
}
|
|
70
70
|
function isImmediateCell(renderOpts, params) {
|
|
71
71
|
return params.$type === "cell" || getInputImmediateModel(renderOpts);
|
|
@@ -90,7 +90,7 @@ function getNativeElementOns(renderOpts, params, eFns) {
|
|
|
90
90
|
const isSameEvent = changeEvent === modelEvent;
|
|
91
91
|
const ons = {};
|
|
92
92
|
if (events) {
|
|
93
|
-
|
|
93
|
+
XEUtils.objectEach(events, (func, key) => {
|
|
94
94
|
ons[vn.getOnName(key)] = function(...args) {
|
|
95
95
|
func(params, ...args);
|
|
96
96
|
};
|
|
@@ -133,9 +133,9 @@ function getComponentOns(renderOpts, params, eFns, eventOns) {
|
|
|
133
133
|
const changeEvent = vn.getChangeEvent(renderOpts);
|
|
134
134
|
const { model: modelFunc, change: changeFunc, blur: blurFunc, clear: clearFunc } = eFns || {};
|
|
135
135
|
const ons = {};
|
|
136
|
-
|
|
136
|
+
XEUtils.objectEach(events, (func, key) => {
|
|
137
137
|
ons[vn.getOnName(key)] = function(...args) {
|
|
138
|
-
if (!
|
|
138
|
+
if (!XEUtils.isFunction(func)) {
|
|
139
139
|
log.errLog("vxe.error.errFunc", [func]);
|
|
140
140
|
}
|
|
141
141
|
func(params, ...args);
|
|
@@ -303,10 +303,10 @@ function getNativeFilterOns(renderOpts, params, option) {
|
|
|
303
303
|
}
|
|
304
304
|
},
|
|
305
305
|
change() {
|
|
306
|
-
updateFilterChangeOption(params, !
|
|
306
|
+
updateFilterChangeOption(params, !XEUtils.eqNull(option.data), option);
|
|
307
307
|
},
|
|
308
308
|
blur() {
|
|
309
|
-
updateFilterChangeOption(params, !
|
|
309
|
+
updateFilterChangeOption(params, !XEUtils.eqNull(option.data), option);
|
|
310
310
|
}
|
|
311
311
|
});
|
|
312
312
|
}
|
|
@@ -431,13 +431,13 @@ function oldFilterRender(renderOpts, params) {
|
|
|
431
431
|
}
|
|
432
432
|
function handleFilterMethod({ option, row, column }) {
|
|
433
433
|
const { data } = option;
|
|
434
|
-
const cellValue =
|
|
434
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
435
435
|
return cellValue == data;
|
|
436
436
|
}
|
|
437
437
|
function handleInputFilterMethod({ option, row, column }) {
|
|
438
438
|
const { data } = option;
|
|
439
|
-
const cellValue =
|
|
440
|
-
return
|
|
439
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
440
|
+
return XEUtils.toValueString(cellValue).indexOf(data) > -1;
|
|
441
441
|
}
|
|
442
442
|
function nativeSelectEditRender(renderOpts, params) {
|
|
443
443
|
return [
|
|
@@ -475,7 +475,7 @@ function handleSelectCellValue(cellValue, renderOpts) {
|
|
|
475
475
|
const valueProp = optionProps.value || "value";
|
|
476
476
|
if (!(cellValue === null || cellValue === void 0)) {
|
|
477
477
|
let vals = [];
|
|
478
|
-
if (
|
|
478
|
+
if (XEUtils.isArray(cellValue)) {
|
|
479
479
|
vals = cellValue;
|
|
480
480
|
} else {
|
|
481
481
|
if (props.multiple && `${cellValue}`.indexOf(",") > -1) {
|
|
@@ -484,24 +484,24 @@ function handleSelectCellValue(cellValue, renderOpts) {
|
|
|
484
484
|
vals = [cellValue];
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
|
-
return
|
|
487
|
+
return XEUtils.map(vals, optionGroups ? (value) => {
|
|
488
488
|
const groupOptions = optionGroupProps.options || "options";
|
|
489
|
-
for (let index
|
|
490
|
-
selectItem =
|
|
489
|
+
for (let index = 0; index < optionGroups.length; index++) {
|
|
490
|
+
selectItem = XEUtils.find(optionGroups[index][groupOptions], (item) => item[valueProp] == value);
|
|
491
491
|
if (selectItem) {
|
|
492
492
|
break;
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
495
|
return selectItem ? selectItem[labelProp] : value;
|
|
496
496
|
} : (value) => {
|
|
497
|
-
selectItem =
|
|
497
|
+
selectItem = XEUtils.find(options, (item) => item[valueProp] == value);
|
|
498
498
|
return selectItem ? selectItem[labelProp] : value;
|
|
499
499
|
}).join(", ");
|
|
500
500
|
}
|
|
501
501
|
return "";
|
|
502
502
|
}
|
|
503
503
|
function getSelectCellValue(renderOpts, { row, column }) {
|
|
504
|
-
const cellValue =
|
|
504
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
505
505
|
return handleSelectCellValue(cellValue, renderOpts);
|
|
506
506
|
}
|
|
507
507
|
function handleExportSelectMethod(params) {
|
|
@@ -515,18 +515,18 @@ function handleTreeSelectCellValue(cellValue, renderOpts) {
|
|
|
515
515
|
const childrenProp = optionProps.children || "children";
|
|
516
516
|
if (!(cellValue === null || cellValue === void 0)) {
|
|
517
517
|
const keyMaps = {};
|
|
518
|
-
|
|
519
|
-
keyMaps[
|
|
518
|
+
XEUtils.eachTree(options, (item) => {
|
|
519
|
+
keyMaps[XEUtils.get(item, valueProp)] = item;
|
|
520
520
|
}, { children: childrenProp });
|
|
521
|
-
return
|
|
521
|
+
return XEUtils.map(XEUtils.isArray(cellValue) ? cellValue : [cellValue], (value) => {
|
|
522
522
|
const item = keyMaps[value];
|
|
523
|
-
return item ?
|
|
523
|
+
return item ? XEUtils.get(item, labelProp) : item;
|
|
524
524
|
}).join(", ");
|
|
525
525
|
}
|
|
526
526
|
return "";
|
|
527
527
|
}
|
|
528
528
|
function getTreeSelectCellValue(renderOpts, { row, column }) {
|
|
529
|
-
const cellValue =
|
|
529
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
530
530
|
return handleTreeSelectCellValue(cellValue, renderOpts);
|
|
531
531
|
}
|
|
532
532
|
function handleExportTreeSelectMethod(params) {
|
|
@@ -537,16 +537,16 @@ function handleNumberCell(renderOpts, params) {
|
|
|
537
537
|
const { props = {}, showNegativeStatus } = renderOpts;
|
|
538
538
|
const { row, column } = params;
|
|
539
539
|
const { type } = props;
|
|
540
|
-
let cellValue =
|
|
540
|
+
let cellValue = XEUtils.get(row, column.field);
|
|
541
541
|
let isNegative = false;
|
|
542
542
|
if (!utils.isEmptyValue(cellValue)) {
|
|
543
543
|
const numberInputConfig = getConfig().numberInput || {};
|
|
544
544
|
if (type === "float") {
|
|
545
545
|
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
546
546
|
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
|
|
547
|
-
cellValue =
|
|
547
|
+
cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits);
|
|
548
548
|
if (!autoFill) {
|
|
549
|
-
cellValue =
|
|
549
|
+
cellValue = XEUtils.toNumber(cellValue);
|
|
550
550
|
}
|
|
551
551
|
if (showNegativeStatus) {
|
|
552
552
|
if (cellValue < 0) {
|
|
@@ -557,13 +557,13 @@ function handleNumberCell(renderOpts, params) {
|
|
|
557
557
|
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
558
558
|
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
|
|
559
559
|
const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
|
|
560
|
-
cellValue =
|
|
560
|
+
cellValue = XEUtils.toNumber(cellValue);
|
|
561
561
|
if (showNegativeStatus) {
|
|
562
562
|
if (cellValue < 0) {
|
|
563
563
|
isNegative = true;
|
|
564
564
|
}
|
|
565
565
|
}
|
|
566
|
-
cellValue =
|
|
566
|
+
cellValue = XEUtils.commafy(cellValue, { digits });
|
|
567
567
|
if (!autoFill) {
|
|
568
568
|
const [iStr, dStr] = cellValue.split(".");
|
|
569
569
|
if (dStr) {
|
|
@@ -576,10 +576,10 @@ function handleNumberCell(renderOpts, params) {
|
|
|
576
576
|
}
|
|
577
577
|
} else {
|
|
578
578
|
if (type === "integer") {
|
|
579
|
-
cellValue =
|
|
579
|
+
cellValue = XEUtils.toInteger(cellValue);
|
|
580
580
|
}
|
|
581
581
|
if (showNegativeStatus) {
|
|
582
|
-
if (
|
|
582
|
+
if (XEUtils.toNumber(cellValue) < 0) {
|
|
583
583
|
isNegative = true;
|
|
584
584
|
}
|
|
585
585
|
}
|
|
@@ -609,10 +609,10 @@ function handleSetSelectValue(renderOpts, params) {
|
|
|
609
609
|
if (field) {
|
|
610
610
|
const { options, optionGroups, optionProps = {}, optionGroupProps = {}, props } = renderOpts;
|
|
611
611
|
if (utils.isEmptyValue(cellValue)) {
|
|
612
|
-
|
|
612
|
+
XEUtils.set(row, field, props && props.multiple ? [] : null);
|
|
613
613
|
return;
|
|
614
614
|
}
|
|
615
|
-
const isMultiVal =
|
|
615
|
+
const isMultiVal = XEUtils.indexOf(`${cellValue}`, ",") > -1;
|
|
616
616
|
const labelProp = optionProps.label || "label";
|
|
617
617
|
const valueProp = optionProps.value || "value";
|
|
618
618
|
const labelMpas = {};
|
|
@@ -625,7 +625,7 @@ function handleSetSelectValue(renderOpts, params) {
|
|
|
625
625
|
if (isMultiVal) {
|
|
626
626
|
labelMpas[item[labelProp]] = item;
|
|
627
627
|
} else if (item[labelProp] == cellValue) {
|
|
628
|
-
|
|
628
|
+
XEUtils.set(row, field, item[valueProp]);
|
|
629
629
|
return;
|
|
630
630
|
}
|
|
631
631
|
}
|
|
@@ -637,19 +637,19 @@ function handleSetSelectValue(renderOpts, params) {
|
|
|
637
637
|
if (isMultiVal) {
|
|
638
638
|
labelMpas[item[labelProp]] = item;
|
|
639
639
|
} else if (item[labelProp] == cellValue) {
|
|
640
|
-
|
|
640
|
+
XEUtils.set(row, field, item[valueProp]);
|
|
641
641
|
return;
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
644
|
}
|
|
645
645
|
}
|
|
646
646
|
if (isMultiVal) {
|
|
647
|
-
|
|
647
|
+
XEUtils.set(row, field, (isMultiVal ? cellValue.split(",") : [cellValue]).map((label) => {
|
|
648
648
|
const item = labelMpas[label];
|
|
649
649
|
return item ? item[valueProp] : label;
|
|
650
650
|
}));
|
|
651
651
|
} else {
|
|
652
|
-
|
|
652
|
+
XEUtils.set(row, field, cellValue);
|
|
653
653
|
}
|
|
654
654
|
}
|
|
655
655
|
}
|
|
@@ -665,15 +665,15 @@ function handleSetTreeSelectValue(renderOpts, params) {
|
|
|
665
665
|
const labelProp = optionProps.label || "label";
|
|
666
666
|
const valueProp = optionProps.value || "value";
|
|
667
667
|
const childrenProp = optionProps.children || "children";
|
|
668
|
-
const matchRest =
|
|
668
|
+
const matchRest = XEUtils.findTree(options || [], (item) => XEUtils.get(item, labelProp) === cellValue, { children: childrenProp });
|
|
669
669
|
if (matchRest) {
|
|
670
670
|
const selectItem = matchRest.item;
|
|
671
671
|
if (selectItem) {
|
|
672
|
-
|
|
672
|
+
XEUtils.set(row, field, selectItem[valueProp]);
|
|
673
673
|
return;
|
|
674
674
|
}
|
|
675
675
|
}
|
|
676
|
-
|
|
676
|
+
XEUtils.set(row, field, cellValue);
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
679
|
renderer.mixin({
|
|
@@ -716,7 +716,7 @@ renderer.mixin({
|
|
|
716
716
|
const { row, column } = params;
|
|
717
717
|
const inputConfig = getConfig().input || {};
|
|
718
718
|
const digits = props.digits || inputConfig.digits || 2;
|
|
719
|
-
let cellValue =
|
|
719
|
+
let cellValue = XEUtils.get(row, column.field);
|
|
720
720
|
if (cellValue) {
|
|
721
721
|
switch (props.type) {
|
|
722
722
|
case "date":
|
|
@@ -727,7 +727,7 @@ renderer.mixin({
|
|
|
727
727
|
cellValue = getLabelFormatDate(cellValue, props);
|
|
728
728
|
break;
|
|
729
729
|
case "float":
|
|
730
|
-
cellValue =
|
|
730
|
+
cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits);
|
|
731
731
|
break;
|
|
732
732
|
}
|
|
733
733
|
}
|
|
@@ -744,7 +744,7 @@ renderer.mixin({
|
|
|
744
744
|
tableFilterDefaultMethod: handleInputFilterMethod,
|
|
745
745
|
tableExportMethod(params) {
|
|
746
746
|
const { row, column } = params;
|
|
747
|
-
const cellValue =
|
|
747
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
748
748
|
return cellValue;
|
|
749
749
|
}
|
|
750
750
|
},
|
|
@@ -756,22 +756,22 @@ renderer.mixin({
|
|
|
756
756
|
const { props = {} } = renderOpts;
|
|
757
757
|
const { row, column, _columnIndex } = params;
|
|
758
758
|
const { type } = props;
|
|
759
|
-
const itemValue =
|
|
760
|
-
if (
|
|
759
|
+
const itemValue = XEUtils.isArray(row) ? row[_columnIndex] : XEUtils.get(row, column.field);
|
|
760
|
+
if (XEUtils.isNumber(itemValue)) {
|
|
761
761
|
const numberInputConfig = getConfig().numberInput || {};
|
|
762
762
|
if (type === "float") {
|
|
763
763
|
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
764
764
|
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
|
|
765
|
-
let amountLabel =
|
|
765
|
+
let amountLabel = XEUtils.toFixed(XEUtils.floor(itemValue, digits), digits);
|
|
766
766
|
if (!autoFill) {
|
|
767
|
-
amountLabel =
|
|
767
|
+
amountLabel = XEUtils.toNumber(amountLabel);
|
|
768
768
|
}
|
|
769
769
|
return amountLabel;
|
|
770
770
|
} else if (type === "amount") {
|
|
771
771
|
const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
|
|
772
772
|
const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
|
|
773
773
|
const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
|
|
774
|
-
let amountLabel =
|
|
774
|
+
let amountLabel = XEUtils.commafy(XEUtils.toNumber(itemValue), { digits });
|
|
775
775
|
if (!autoFill) {
|
|
776
776
|
const [iStr, dStr] = amountLabel.split(".");
|
|
777
777
|
if (dStr) {
|
|
@@ -794,7 +794,7 @@ renderer.mixin({
|
|
|
794
794
|
tableFilterDefaultMethod: handleInputFilterMethod,
|
|
795
795
|
tableExportMethod(params) {
|
|
796
796
|
const { row, column } = params;
|
|
797
|
-
const cellValue =
|
|
797
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
798
798
|
return cellValue;
|
|
799
799
|
}
|
|
800
800
|
},
|
|
@@ -804,7 +804,7 @@ renderer.mixin({
|
|
|
804
804
|
renderTableCell(renderOpts, params) {
|
|
805
805
|
const { props = {} } = renderOpts;
|
|
806
806
|
const { row, column } = params;
|
|
807
|
-
let cellValue =
|
|
807
|
+
let cellValue = XEUtils.get(row, column.field);
|
|
808
808
|
if (cellValue) {
|
|
809
809
|
if (props.type !== "time") {
|
|
810
810
|
cellValue = getLabelFormatDate(cellValue, props);
|
|
@@ -829,16 +829,16 @@ renderer.mixin({
|
|
|
829
829
|
const seProps = {};
|
|
830
830
|
const seOs = {};
|
|
831
831
|
if (startField && endField) {
|
|
832
|
-
seProps.startValue =
|
|
833
|
-
seProps.endValue =
|
|
832
|
+
seProps.startValue = XEUtils.get(row, startField);
|
|
833
|
+
seProps.endValue = XEUtils.get(row, endField);
|
|
834
834
|
seOs["onUpdate:startValue"] = (value) => {
|
|
835
835
|
if (startField) {
|
|
836
|
-
|
|
836
|
+
XEUtils.set(row, startField, value);
|
|
837
837
|
}
|
|
838
838
|
};
|
|
839
839
|
seOs["onUpdate:endValue"] = (value) => {
|
|
840
840
|
if (endField) {
|
|
841
|
-
|
|
841
|
+
XEUtils.set(row, endField, value);
|
|
842
842
|
}
|
|
843
843
|
};
|
|
844
844
|
}
|
|
@@ -864,12 +864,12 @@ renderer.mixin({
|
|
|
864
864
|
let startValue = "";
|
|
865
865
|
let endValue = "";
|
|
866
866
|
if (startField && endField) {
|
|
867
|
-
startValue =
|
|
868
|
-
endValue =
|
|
867
|
+
startValue = XEUtils.get(row, startField);
|
|
868
|
+
endValue = XEUtils.get(row, endField);
|
|
869
869
|
} else {
|
|
870
|
-
const cellValue =
|
|
870
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
871
871
|
if (cellValue) {
|
|
872
|
-
if (
|
|
872
|
+
if (XEUtils.isArray(cellValue)) {
|
|
873
873
|
startValue = cellValue[0];
|
|
874
874
|
endValue = cellValue[1];
|
|
875
875
|
} else {
|
|
@@ -891,7 +891,7 @@ renderer.mixin({
|
|
|
891
891
|
renderTableEdit: defaultEditRender,
|
|
892
892
|
renderTableCell(renderOpts, params) {
|
|
893
893
|
const { row, column } = params;
|
|
894
|
-
const cellValue =
|
|
894
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
895
895
|
return getCellLabelVNs(renderOpts, params, cellValue);
|
|
896
896
|
}
|
|
897
897
|
},
|
|
@@ -951,7 +951,7 @@ renderer.mixin({
|
|
|
951
951
|
const { href } = props || {};
|
|
952
952
|
const cellLabel = $table.getCellLabel(row, column);
|
|
953
953
|
return [
|
|
954
|
-
vue.h(getDefaultComponent(renderOpts), Object.assign(Object.assign(Object.assign({}, props || {}), { content: cellLabel, href:
|
|
954
|
+
vue.h(getDefaultComponent(renderOpts), Object.assign(Object.assign(Object.assign({}, props || {}), { content: cellLabel, href: XEUtils.toFormatString(href, params) }), getComponentOns(renderOpts, params)))
|
|
955
955
|
];
|
|
956
956
|
}
|
|
957
957
|
},
|
|
@@ -1026,7 +1026,7 @@ renderer.mixin({
|
|
|
1026
1026
|
},
|
|
1027
1027
|
renderTableCell(renderOpts, params) {
|
|
1028
1028
|
const { row, column } = params;
|
|
1029
|
-
const cellValue =
|
|
1029
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
1030
1030
|
return vue.h("span", {
|
|
1031
1031
|
class: "vxe-color-picker--readonly"
|
|
1032
1032
|
}, [
|
|
@@ -1051,7 +1051,7 @@ renderer.mixin({
|
|
|
1051
1051
|
},
|
|
1052
1052
|
renderTableCell(renderOpts, params) {
|
|
1053
1053
|
const { row, column } = params;
|
|
1054
|
-
const cellValue =
|
|
1054
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
1055
1055
|
return vue.h("i", {
|
|
1056
1056
|
class: cellValue
|
|
1057
1057
|
});
|
|
@@ -1121,7 +1121,7 @@ renderer.mixin({
|
|
|
1121
1121
|
const { props = {} } = renderOpts;
|
|
1122
1122
|
const { row, column } = params;
|
|
1123
1123
|
const digits = props.digits || ((_a = getConfig().input) === null || _a === void 0 ? void 0 : _a.digits) || 2;
|
|
1124
|
-
let cellValue =
|
|
1124
|
+
let cellValue = XEUtils.get(row, column.field);
|
|
1125
1125
|
if (cellValue) {
|
|
1126
1126
|
switch (props.type) {
|
|
1127
1127
|
case "date":
|
|
@@ -1131,7 +1131,7 @@ renderer.mixin({
|
|
|
1131
1131
|
cellValue = getLabelFormatDate(cellValue, props);
|
|
1132
1132
|
break;
|
|
1133
1133
|
case "float":
|
|
1134
|
-
cellValue =
|
|
1134
|
+
cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits);
|
|
1135
1135
|
break;
|
|
1136
1136
|
}
|
|
1137
1137
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const vue = require("vue");
|
|
4
4
|
const comp = require("../../ui/src/comp.js");
|
|
5
|
-
const
|
|
5
|
+
const XEUtils = require("xe-utils");
|
|
6
6
|
require("../../ui/index.js");
|
|
7
7
|
const util = require("./util.js");
|
|
8
8
|
const dom = require("../../ui/src/dom.js");
|
|
@@ -132,19 +132,19 @@ const TableBodyComponent = comp.defineVxeComponent({
|
|
|
132
132
|
const isEdit = utils.isEnableConf(editRender);
|
|
133
133
|
const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0;
|
|
134
134
|
let fixedHiddenColumn = overflowX && (fixedType ? column.fixed !== fixedType : !!column.fixed);
|
|
135
|
-
const isCellPadding =
|
|
136
|
-
const cellOverflow =
|
|
135
|
+
const isCellPadding = XEUtils.eqNull(padding) ? allPadding === null ? cellOpts.padding : allPadding : padding;
|
|
136
|
+
const cellOverflow = XEUtils.eqNull(showOverflow) ? allShowOverflow : showOverflow;
|
|
137
137
|
const showEllipsis = cellOverflow === "ellipsis";
|
|
138
138
|
const showTitle = cellOverflow === "title";
|
|
139
139
|
const showTooltip = cellOverflow === true || cellOverflow === "tooltip";
|
|
140
140
|
const hasEllipsis = isAllOverflow || showTitle || showTooltip || showEllipsis;
|
|
141
|
-
const showResizable =
|
|
141
|
+
const showResizable = XEUtils.isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable;
|
|
142
142
|
const isCsHeight = !!customCellHeight;
|
|
143
143
|
const isRsHeight = resizeHeight > 0;
|
|
144
144
|
let isDirty;
|
|
145
145
|
const tdOns = {};
|
|
146
146
|
const cellAlign = align || (compConf ? compConf.tableCellAlign : "") || allAlign;
|
|
147
|
-
const cellVerticalAlign =
|
|
147
|
+
const cellVerticalAlign = XEUtils.eqNull(verticalAlign) ? allVerticalAlign : verticalAlign;
|
|
148
148
|
const errorValidItem = validErrorMaps[`${rowid}:${colid}`];
|
|
149
149
|
const showValidTip = editRules && validOpts.showMessage && (validOpts.message === "default" ? height || tableData.length > 1 : validOpts.message === "inline");
|
|
150
150
|
const tdAttrs = { colid };
|
|
@@ -288,8 +288,8 @@ const TableBodyComponent = comp.defineVxeComponent({
|
|
|
288
288
|
if (hasEllipsis && resizeWidthFlag) {
|
|
289
289
|
let mergeColWidth = 0;
|
|
290
290
|
if (mergeColspan > 1) {
|
|
291
|
-
for (let
|
|
292
|
-
const nextColumn = visibleColumn[columnIndex +
|
|
291
|
+
for (let index = 1; index < mergeColspan; index++) {
|
|
292
|
+
const nextColumn = visibleColumn[columnIndex + index];
|
|
293
293
|
if (nextColumn) {
|
|
294
294
|
mergeColWidth += nextColumn.renderWidth;
|
|
295
295
|
}
|
|
@@ -407,7 +407,7 @@ const TableBodyComponent = comp.defineVxeComponent({
|
|
|
407
407
|
dom.getPropClass(compCellClassName, cellParams),
|
|
408
408
|
dom.getPropClass(className, cellParams),
|
|
409
409
|
dom.getPropClass(allCellClassName, cellParams)
|
|
410
|
-
], key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? colid : $columnIndex }, tdAttrs), { style: Object.assign({},
|
|
410
|
+
], key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? colid : $columnIndex }, tdAttrs), { style: Object.assign({}, XEUtils.isFunction(compCellStyle) ? compCellStyle(cellParams) : compCellStyle, XEUtils.isFunction(cellStyle) ? cellStyle(cellParams) : cellStyle) }), tdOns), isOptimizeMode && fixedHiddenColumn ? [] : tdVNs);
|
|
411
411
|
};
|
|
412
412
|
const renderRows = (fixedType, isOptimizeMode, tableData, tableColumn) => {
|
|
413
413
|
const $xeGrid = $xeTable.xeGrid;
|
|
@@ -507,7 +507,7 @@ const TableBodyComponent = comp.defineVxeComponent({
|
|
|
507
507
|
const tdVNs = tableColumn.map((column, $columnIndex) => {
|
|
508
508
|
return renderTdColumn(seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
|
|
509
509
|
});
|
|
510
|
-
rows.push(vue.h("tr", Object.assign({ class: trClass, rowid, style: rowStyle ?
|
|
510
|
+
rows.push(vue.h("tr", Object.assign({ class: trClass, rowid, style: rowStyle ? XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle : null, key: rowKey || scrollXLoad || scrollYLoad || rowOpts.useKey || rowOpts.drag || columnOpts.drag || isRowGroupStatus || treeConfig ? rowid : $rowIndex }, trOn), tdVNs));
|
|
511
511
|
if (isExpandRow) {
|
|
512
512
|
const expandOpts = computeExpandOpts.value;
|
|
513
513
|
const { height: expandHeight, padding, mode: expandMode } = expandOpts;
|
|
@@ -536,7 +536,7 @@ const TableBodyComponent = comp.defineVxeComponent({
|
|
|
536
536
|
const { showOverflow } = expandColumn || {};
|
|
537
537
|
const colid = expandColumn.id;
|
|
538
538
|
const colRest = fullColumnIdData[colid] || {};
|
|
539
|
-
const hasEllipsis =
|
|
539
|
+
const hasEllipsis = XEUtils.eqNull(showOverflow) ? isAllOverflow : showOverflow;
|
|
540
540
|
let columnIndex = -1;
|
|
541
541
|
let $columnIndex = -1;
|
|
542
542
|
let _columnIndex = -1;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const vue = require("vue");
|
|
4
|
-
const
|
|
4
|
+
const XEUtils = require("xe-utils");
|
|
5
5
|
require("../../ui/index.js");
|
|
6
6
|
const utils = require("../../ui/src/utils.js");
|
|
7
7
|
const dom = require("../../ui/src/dom.js");
|
|
@@ -100,7 +100,7 @@ function renderCellBaseVNs(params, content) {
|
|
|
100
100
|
vns.push(renderCellDragIcon(params));
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
return vns.concat(
|
|
103
|
+
return vns.concat(XEUtils.isArray(content) ? content : [content]);
|
|
104
104
|
}
|
|
105
105
|
function renderHeaderCellDragIcon(params) {
|
|
106
106
|
const { $table, column } = params;
|
|
@@ -139,13 +139,13 @@ function renderHeaderCellBaseVNs(params, content) {
|
|
|
139
139
|
const vns = [
|
|
140
140
|
renderTitlePrefixIcon(params),
|
|
141
141
|
renderHeaderCellDragIcon(params),
|
|
142
|
-
...
|
|
142
|
+
...XEUtils.isArray(content) ? content : [content],
|
|
143
143
|
renderTitleSuffixIcon(params)
|
|
144
144
|
];
|
|
145
145
|
return vns;
|
|
146
146
|
}
|
|
147
147
|
function getRenderDefaultColumnTitle(column, content) {
|
|
148
|
-
if (column.type === "html" &&
|
|
148
|
+
if (column.type === "html" && XEUtils.isString(content)) {
|
|
149
149
|
return vue.h("span", {
|
|
150
150
|
key: "ch",
|
|
151
151
|
innerHTML: content
|
|
@@ -166,7 +166,7 @@ function renderTitleContent(params, content) {
|
|
|
166
166
|
const titleSlot = slots ? slots.title : null;
|
|
167
167
|
const headerTooltipOpts = computeHeaderTooltipOpts.value;
|
|
168
168
|
const showAllTip = headerTooltipOpts.showAll;
|
|
169
|
-
const headOverflow =
|
|
169
|
+
const headOverflow = XEUtils.eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
|
|
170
170
|
const showTitle = headOverflow === "title";
|
|
171
171
|
const showTooltip = headOverflow === true || headOverflow === "tooltip";
|
|
172
172
|
const ons = {};
|
|
@@ -660,7 +660,7 @@ const Cell = {
|
|
|
660
660
|
if (defaultSlot || labelField) {
|
|
661
661
|
radioVNs.push(vue.h("span", {
|
|
662
662
|
class: "vxe-radio--label"
|
|
663
|
-
}, defaultSlot ? $table.callSlot(defaultSlot, radioParams) :
|
|
663
|
+
}, defaultSlot ? $table.callSlot(defaultSlot, radioParams) : XEUtils.get(row, labelField)));
|
|
664
664
|
}
|
|
665
665
|
return renderCellBaseVNs(params, [
|
|
666
666
|
vue.h("span", Object.assign({ class: ["vxe-cell--radio", {
|
|
@@ -711,7 +711,7 @@ const Cell = {
|
|
|
711
711
|
"is--checked": isAllCheckboxSelected,
|
|
712
712
|
"is--disabled": isAllCheckboxDisabled,
|
|
713
713
|
"is--indeterminate": isAllCheckboxIndeterminate
|
|
714
|
-
}], title:
|
|
714
|
+
}], title: XEUtils.eqNull(headerTitle) ? getI18n("vxe.table.allTitle") : `${headerTitle || ""}` }, ons), [
|
|
715
715
|
vue.h("span", {
|
|
716
716
|
class: ["vxe-checkbox--icon", isAllCheckboxIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllCheckboxSelected ? getIcon().TABLE_CHECKBOX_CHECKED : isAllCheckboxDisabled ? getIcon().TABLE_CHECKBOX_DISABLED_UNCHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
717
717
|
})
|
|
@@ -777,7 +777,7 @@ const Cell = {
|
|
|
777
777
|
if (defaultSlot || labelField) {
|
|
778
778
|
checkVNs.push(vue.h("span", {
|
|
779
779
|
class: "vxe-checkbox--label"
|
|
780
|
-
}, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams) :
|
|
780
|
+
}, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams) : XEUtils.get(row, labelField)));
|
|
781
781
|
}
|
|
782
782
|
return renderCellBaseVNs(params, [
|
|
783
783
|
vue.h("span", Object.assign({ class: ["vxe-cell--checkbox", {
|
|
@@ -815,7 +815,7 @@ const Cell = {
|
|
|
815
815
|
const ons = {};
|
|
816
816
|
if (!isHidden) {
|
|
817
817
|
const rowid = util.getRowid($table, row);
|
|
818
|
-
isChecked = !!updateCheckboxFlag &&
|
|
818
|
+
isChecked = !!updateCheckboxFlag && XEUtils.get(row, checkField);
|
|
819
819
|
if (checkMethod && isRowGroupStatus && $table.isAggregateRecord(row)) {
|
|
820
820
|
const childList = row[mapChildrenField || ""];
|
|
821
821
|
if (!childList || !childList.length || childList.every((item) => !checkMethod({ $table, row: item }))) {
|
|
@@ -846,7 +846,7 @@ const Cell = {
|
|
|
846
846
|
if (defaultSlot || labelField) {
|
|
847
847
|
checkVNs.push(vue.h("span", {
|
|
848
848
|
class: "vxe-checkbox--label"
|
|
849
|
-
}, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams) :
|
|
849
|
+
}, defaultSlot ? $table.callSlot(defaultSlot, checkboxParams) : XEUtils.get(row, labelField)));
|
|
850
850
|
}
|
|
851
851
|
}
|
|
852
852
|
return renderCellBaseVNs(params, [
|
|
@@ -909,7 +909,7 @@ const Cell = {
|
|
|
909
909
|
]) : renderEmptyElement($table),
|
|
910
910
|
defaultSlot || labelField ? vue.h("span", {
|
|
911
911
|
class: "vxe-table--expand-label"
|
|
912
|
-
}, defaultSlot ? $table.callSlot(defaultSlot, params) :
|
|
912
|
+
}, defaultSlot ? $table.callSlot(defaultSlot, params) : XEUtils.get(row, labelField)) : renderEmptyElement($table)
|
|
913
913
|
]);
|
|
914
914
|
},
|
|
915
915
|
renderExpandData(params) {
|
|
@@ -978,7 +978,7 @@ const Cell = {
|
|
|
978
978
|
class: ["vxe-sort--asc-btn", iconAsc || getIcon().TABLE_SORT_ASC, {
|
|
979
979
|
"sort--active": order === "asc"
|
|
980
980
|
}],
|
|
981
|
-
title:
|
|
981
|
+
title: XEUtils.eqNull(ascTitle) ? getI18n("vxe.table.sortAsc") : `${ascTitle || ""}`,
|
|
982
982
|
onClick: allowBtn ? (evnt) => {
|
|
983
983
|
evnt.stopPropagation();
|
|
984
984
|
$table.triggerSortEvent(evnt, column, "asc");
|
|
@@ -988,7 +988,7 @@ const Cell = {
|
|
|
988
988
|
class: ["vxe-sort--desc-btn", iconDesc || getIcon().TABLE_SORT_DESC, {
|
|
989
989
|
"sort--active": order === "desc"
|
|
990
990
|
}],
|
|
991
|
-
title:
|
|
991
|
+
title: XEUtils.eqNull(descTitle) ? getI18n("vxe.table.sortDesc") : `${descTitle || ""}`,
|
|
992
992
|
onClick: allowBtn ? (evnt) => {
|
|
993
993
|
evnt.stopPropagation();
|
|
994
994
|
$table.triggerSortEvent(evnt, column, "desc");
|
|
@@ -1047,7 +1047,7 @@ const Cell = {
|
|
|
1047
1047
|
const editRenderOpts = isEnableEdit && utils.isEnableConf(editRender) ? editRender : null;
|
|
1048
1048
|
let isRequired = false;
|
|
1049
1049
|
if (editRules) {
|
|
1050
|
-
const columnRules =
|
|
1050
|
+
const columnRules = XEUtils.get(editRules, column.field);
|
|
1051
1051
|
if (columnRules) {
|
|
1052
1052
|
isRequired = columnRules.some((rule) => rule.required);
|
|
1053
1053
|
}
|
|
@@ -1063,7 +1063,7 @@ const Cell = {
|
|
|
1063
1063
|
]) : renderEmptyElement($table),
|
|
1064
1064
|
editRenderOpts && showIcon ? vue.h("span", {
|
|
1065
1065
|
class: "vxe-cell--edit-icon"
|
|
1066
|
-
},
|
|
1066
|
+
}, XEUtils.isFunction(icon) ? vn.getSlotVNs(icon({})) : [
|
|
1067
1067
|
vue.h("i", {
|
|
1068
1068
|
class: icon || getIcon().TABLE_EDIT
|
|
1069
1069
|
})
|