sea-chart 2.0.4 → 2.0.5
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/dist/context.js +14 -3
- package/dist/utils/chart-utils/index.js +1 -0
- package/dist/view/index.js +4 -2
- package/package.json +2 -2
package/dist/context.js
CHANGED
|
@@ -15,6 +15,7 @@ class Context {
|
|
|
15
15
|
let {
|
|
16
16
|
chart,
|
|
17
17
|
tables,
|
|
18
|
+
isCalculateByView,
|
|
18
19
|
onSuccess,
|
|
19
20
|
onFail
|
|
20
21
|
} = _ref;
|
|
@@ -30,11 +31,21 @@ class Context {
|
|
|
30
31
|
|
|
31
32
|
// use default api to get chart result data
|
|
32
33
|
const table = (0, _dtableUtils.getTableById)(tables, chart.config.table_id);
|
|
33
|
-
const
|
|
34
|
-
|
|
34
|
+
const {
|
|
35
|
+
view_id = '0000',
|
|
36
|
+
filter_conjunction = '',
|
|
37
|
+
filters = []
|
|
38
|
+
} = chart.config;
|
|
39
|
+
let view = {
|
|
40
|
+
filter_conjunction,
|
|
41
|
+
filters
|
|
42
|
+
};
|
|
43
|
+
if (isCalculateByView) {
|
|
44
|
+
view = table.views.find(view => view._id === view_id);
|
|
45
|
+
}
|
|
35
46
|
const chartDataSQL = new _utils.ChartDataSQL({
|
|
36
47
|
table,
|
|
37
|
-
view
|
|
48
|
+
view,
|
|
38
49
|
chart
|
|
39
50
|
});
|
|
40
51
|
const {
|
|
@@ -31,6 +31,7 @@ ChartUtils.calculateChart = async (chart, value, callback) => {
|
|
|
31
31
|
_context.default.queryChartResult({
|
|
32
32
|
chart,
|
|
33
33
|
tables: value.tables,
|
|
34
|
+
isCalculateByView: value.isCalculateByView,
|
|
34
35
|
onSuccess: async function (res) {
|
|
35
36
|
var _res$data;
|
|
36
37
|
let dataSources = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _sqlStatisticsUtils.default.DATA_SOURCE;
|
package/dist/view/index.js
CHANGED
|
@@ -97,7 +97,8 @@ class View extends _react.default.PureComponent {
|
|
|
97
97
|
if (_chartUtils.BaseUtils.isArchiveView(chart.config, tables)) {
|
|
98
98
|
_chartUtils.ChartUtils.calculateChart(chart, {
|
|
99
99
|
tables,
|
|
100
|
-
collaborators
|
|
100
|
+
collaborators,
|
|
101
|
+
isCalculateByView
|
|
101
102
|
}, _this.callback);
|
|
102
103
|
} else {
|
|
103
104
|
_chartUtils.ChartUtils.calculateStaticChart(chart, {
|
|
@@ -122,7 +123,8 @@ class View extends _react.default.PureComponent {
|
|
|
122
123
|
} else {
|
|
123
124
|
_chartUtils.ChartUtils.calculateChart(chart, {
|
|
124
125
|
tables,
|
|
125
|
-
collaborators
|
|
126
|
+
collaborators,
|
|
127
|
+
isCalculateByView
|
|
126
128
|
}, _this.callback);
|
|
127
129
|
}
|
|
128
130
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sea-chart",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@dnd-kit/core": "^6.1.0",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"slugid": "~5.0.1"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"dtable-ui-component": "6.0.
|
|
24
|
+
"dtable-ui-component": "6.0.9",
|
|
25
25
|
"dtable-utils": "~5.0.*",
|
|
26
26
|
"prop-types": "15.8.1",
|
|
27
27
|
"react": "18.3.1",
|