linkmore-design 1.1.27-beta.3 → 1.1.27-beta.4
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.
|
@@ -21,14 +21,18 @@ var dfs = function dfs(dataSource, dataIndex, expression) {
|
|
|
21
21
|
}
|
|
22
22
|
calc(item, [[dataIndex, expression]], history);
|
|
23
23
|
});
|
|
24
|
-
console.log(history);
|
|
25
24
|
if (history && history.length) {
|
|
26
25
|
var sum = 0;
|
|
27
26
|
history.forEach(function (h) {
|
|
28
27
|
sum += h.sum;
|
|
29
28
|
});
|
|
30
29
|
history.forEach(function (h) {
|
|
31
|
-
|
|
30
|
+
if (sum < 0.000001) {
|
|
31
|
+
sum = 0;
|
|
32
|
+
h.item[h.dataIndex] = '0%';
|
|
33
|
+
} else {
|
|
34
|
+
h.item[h.dataIndex] = (h.sum / sum * 100).toFixed(2) + '%';
|
|
35
|
+
}
|
|
32
36
|
h.item["".concat(h.dataIndex, "_sum")] = sum;
|
|
33
37
|
});
|
|
34
38
|
}
|
|
@@ -85,12 +89,12 @@ var CalcExpression = function CalcExpression(props) {
|
|
|
85
89
|
}
|
|
86
90
|
};
|
|
87
91
|
if (record && record._group && isShowSelect && (col === null || col === void 0 ? void 0 : col.dataIndex)) {
|
|
88
|
-
return /*#__PURE__*/React.createElement("td", Object.assign({}, rest, {
|
|
92
|
+
return /*#__PURE__*/React.createElement("td", Object.assign({}, rest), /*#__PURE__*/React.createElement("div", {
|
|
89
93
|
style: {
|
|
90
94
|
display: 'flex',
|
|
91
95
|
alignItems: 'center'
|
|
92
96
|
}
|
|
93
|
-
}
|
|
97
|
+
}, /*#__PURE__*/React.createElement("span", null, record[col.dataIndex]), /*#__PURE__*/React.createElement(Select, {
|
|
94
98
|
className: "calc-select",
|
|
95
99
|
value: record["".concat(col.dataIndex, "_exp")],
|
|
96
100
|
size: "small",
|
|
@@ -104,7 +108,7 @@ var CalcExpression = function CalcExpression(props) {
|
|
|
104
108
|
value: item.value,
|
|
105
109
|
key: item.value
|
|
106
110
|
}, item.label);
|
|
107
|
-
})));
|
|
111
|
+
}))));
|
|
108
112
|
}
|
|
109
113
|
return /*#__PURE__*/React.createElement("td", Object.assign({}, rest), children);
|
|
110
114
|
};
|
|
@@ -29,14 +29,18 @@ var dfs = function dfs(dataSource, dataIndex, expression) {
|
|
|
29
29
|
}
|
|
30
30
|
(0, _expression.default)(item, [[dataIndex, expression]], history);
|
|
31
31
|
});
|
|
32
|
-
console.log(history);
|
|
33
32
|
if (history && history.length) {
|
|
34
33
|
var sum = 0;
|
|
35
34
|
history.forEach(function (h) {
|
|
36
35
|
sum += h.sum;
|
|
37
36
|
});
|
|
38
37
|
history.forEach(function (h) {
|
|
39
|
-
|
|
38
|
+
if (sum < 0.000001) {
|
|
39
|
+
sum = 0;
|
|
40
|
+
h.item[h.dataIndex] = '0%';
|
|
41
|
+
} else {
|
|
42
|
+
h.item[h.dataIndex] = (h.sum / sum * 100).toFixed(2) + '%';
|
|
43
|
+
}
|
|
40
44
|
h.item["".concat(h.dataIndex, "_sum")] = sum;
|
|
41
45
|
});
|
|
42
46
|
}
|
|
@@ -93,12 +97,12 @@ var CalcExpression = function CalcExpression(props) {
|
|
|
93
97
|
}
|
|
94
98
|
};
|
|
95
99
|
if (record && record._group && isShowSelect && (col === null || col === void 0 ? void 0 : col.dataIndex)) {
|
|
96
|
-
return /*#__PURE__*/_react.default.createElement("td", Object.assign({}, rest, {
|
|
100
|
+
return /*#__PURE__*/_react.default.createElement("td", Object.assign({}, rest), /*#__PURE__*/_react.default.createElement("div", {
|
|
97
101
|
style: {
|
|
98
102
|
display: 'flex',
|
|
99
103
|
alignItems: 'center'
|
|
100
104
|
}
|
|
101
|
-
}
|
|
105
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, record[col.dataIndex]), /*#__PURE__*/_react.default.createElement(_Select.default, {
|
|
102
106
|
className: "calc-select",
|
|
103
107
|
value: record["".concat(col.dataIndex, "_exp")],
|
|
104
108
|
size: "small",
|
|
@@ -112,7 +116,7 @@ var CalcExpression = function CalcExpression(props) {
|
|
|
112
116
|
value: item.value,
|
|
113
117
|
key: item.value
|
|
114
118
|
}, item.label);
|
|
115
|
-
})));
|
|
119
|
+
}))));
|
|
116
120
|
}
|
|
117
121
|
return /*#__PURE__*/_react.default.createElement("td", Object.assign({}, rest), children);
|
|
118
122
|
};
|