dtable-statistic 5.0.32 → 5.0.34
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/assets/css/dashboard.css +6 -9
- package/es/index.js +56 -0
- package/package.json +2 -2
|
@@ -153,14 +153,7 @@
|
|
|
153
153
|
align-items: center;
|
|
154
154
|
overflow: hidden;
|
|
155
155
|
position: relative;
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
.statistic-list .statistic-chart-preview-container .sea-chart-table-formatter-container {
|
|
159
|
-
padding-right: 15px;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.statistic-list .statistic-chart-preview-container .sea-chart-table-formatter-container .sea-chart-one-table-wrapper {
|
|
163
|
-
padding-left: 15px;
|
|
156
|
+
padding: 0px 20px 20px 20px
|
|
164
157
|
}
|
|
165
158
|
|
|
166
159
|
.statistic-list .statistic-chart-preview-container .sea-chart-formatter-tip {
|
|
@@ -191,6 +184,11 @@
|
|
|
191
184
|
height: 100%;
|
|
192
185
|
}
|
|
193
186
|
|
|
187
|
+
.statistic-chart-container .sea-chart-formatter .sea-chart-container {
|
|
188
|
+
left: 0;
|
|
189
|
+
top: 0;
|
|
190
|
+
}
|
|
191
|
+
|
|
194
192
|
.statistic-chart-container.map {
|
|
195
193
|
padding: 20px;
|
|
196
194
|
}
|
|
@@ -262,7 +260,6 @@
|
|
|
262
260
|
|
|
263
261
|
.statistic-list .statistic-chart-preview-name {
|
|
264
262
|
color: var(--common-font-color);
|
|
265
|
-
font-size: 18px;
|
|
266
263
|
}
|
|
267
264
|
|
|
268
265
|
.statistic-list .statistic-chart-preview-microscope {
|
package/es/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
var _react = _interopRequireDefault(require("react"));
|
|
5
5
|
var _dtableStore = require("dtable-store");
|
|
6
|
+
var _seaChart = require("sea-chart");
|
|
6
7
|
var _dashboard = _interopRequireDefault(require("./dashboard"));
|
|
7
8
|
var _converStatItem = require("./model/conver-statItem");
|
|
8
9
|
class Statistic {
|
|
@@ -36,6 +37,7 @@ class Statistic {
|
|
|
36
37
|
static convertStatistics(value) {
|
|
37
38
|
value.statistics.forEach(dashboard => {
|
|
38
39
|
const new_stat_items = dashboard.stat_items.map(item => {
|
|
40
|
+
var _item$config, _item$config2, _item$config3;
|
|
39
41
|
if (!item.config) {
|
|
40
42
|
const newItem = {
|
|
41
43
|
config: {
|
|
@@ -52,6 +54,60 @@ class Statistic {
|
|
|
52
54
|
};
|
|
53
55
|
return newItem;
|
|
54
56
|
}
|
|
57
|
+
const {
|
|
58
|
+
summary_columns
|
|
59
|
+
} = item.config || {};
|
|
60
|
+
if ((item === null || item === void 0 ? void 0 : (_item$config = item.config) === null || _item$config === void 0 ? void 0 : _item$config.type) === _seaChart.CHART_TYPE.TABLE && summary_columns && (summary_columns === null || summary_columns === void 0 ? void 0 : summary_columns.length) !== 0) {
|
|
61
|
+
item.config.summary_columns = item.config.summary_columns.map(item => {
|
|
62
|
+
return {
|
|
63
|
+
...item,
|
|
64
|
+
column_key: item.key,
|
|
65
|
+
summary_method: item.method
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
if ((item === null || item === void 0 ? void 0 : (_item$config2 = item.config) === null || _item$config2 === void 0 ? void 0 : _item$config2.type) === _seaChart.CHART_TYPE.BASIC_NUMBER_CARD) {
|
|
70
|
+
const {
|
|
71
|
+
font_size,
|
|
72
|
+
font_weight,
|
|
73
|
+
font_color,
|
|
74
|
+
text_align,
|
|
75
|
+
card_label_font_size,
|
|
76
|
+
label_font_color,
|
|
77
|
+
label_font_weight,
|
|
78
|
+
label_text_align
|
|
79
|
+
} = item.config || {};
|
|
80
|
+
if (!font_size && !font_weight && !font_color && !text_align && !card_label_font_size && !label_font_color && !label_font_weight && !label_text_align) {
|
|
81
|
+
item.config = {
|
|
82
|
+
...item.config,
|
|
83
|
+
font_size: 34,
|
|
84
|
+
font_weight: 700,
|
|
85
|
+
card_label_font_size: 14,
|
|
86
|
+
label_font_weight: 400
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if ((item === null || item === void 0 ? void 0 : (_item$config3 = item.config) === null || _item$config3 === void 0 ? void 0 : _item$config3.type) === _seaChart.CHART_TYPE.TREND) {
|
|
91
|
+
const {
|
|
92
|
+
num_font_size,
|
|
93
|
+
num_font_weight,
|
|
94
|
+
num_font_color,
|
|
95
|
+
num_text_align,
|
|
96
|
+
card_label_font_size,
|
|
97
|
+
label_font_color,
|
|
98
|
+
label_font_weight,
|
|
99
|
+
label_text_align
|
|
100
|
+
} = item.config || {};
|
|
101
|
+
if (!num_font_size && !num_font_weight && !num_font_color && !num_text_align && !card_label_font_size && !label_font_color && !label_font_weight && !label_text_align) {
|
|
102
|
+
item.config = {
|
|
103
|
+
...item.config,
|
|
104
|
+
num_font_size: 34,
|
|
105
|
+
num_font_weight: 700,
|
|
106
|
+
card_label_font_size: 14,
|
|
107
|
+
label_font_weight: 400
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
55
111
|
return item;
|
|
56
112
|
});
|
|
57
113
|
dashboard.stat_items = new_stat_items;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dtable-statistic",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.34",
|
|
4
4
|
"description": "statistics",
|
|
5
5
|
"main": "dist/dtable-statistic.js",
|
|
6
6
|
"author": "seafile",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"react-grid-layout": "^1.2.5",
|
|
19
19
|
"react-intl-universal": "^2.4.8",
|
|
20
20
|
"reactstrap": "8.9.0",
|
|
21
|
-
"sea-chart": "~0.0.
|
|
21
|
+
"sea-chart": "~0.0.81"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"dtable-ui-component": "~5.0.*",
|