sea-chart 2.0.57 → 2.0.58-alpha.1
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/view/index.js +25 -20
- package/package.json +1 -6
package/dist/view/index.js
CHANGED
|
@@ -146,7 +146,10 @@ class View extends _react.default.PureComponent {
|
|
|
146
146
|
isCalculateByView,
|
|
147
147
|
autoRefresh,
|
|
148
148
|
refreshInterval,
|
|
149
|
-
pageId
|
|
149
|
+
pageId,
|
|
150
|
+
hasUnSaved,
|
|
151
|
+
chart,
|
|
152
|
+
tables
|
|
150
153
|
} = this.props;
|
|
151
154
|
this.unsubscribeReFreshChart = _eventBus.default.subscribe(_commonConstants.CommonEventTypes.REFRESH_CHARTS, this.refreshChart);
|
|
152
155
|
|
|
@@ -167,10 +170,7 @@ class View extends _react.default.PureComponent {
|
|
|
167
170
|
this.calculateStatistic();
|
|
168
171
|
}, refreshInterval * 60000);
|
|
169
172
|
}
|
|
170
|
-
|
|
171
|
-
hasUnSaved
|
|
172
|
-
} = this.props;
|
|
173
|
-
if (!hasUnSaved) {
|
|
173
|
+
if (!hasUnSaved || !_chartUtils.BaseUtils.isValidExistChart(tables, chart)) {
|
|
174
174
|
this.calculateStatistic();
|
|
175
175
|
}
|
|
176
176
|
}
|
|
@@ -178,20 +178,20 @@ class View extends _react.default.PureComponent {
|
|
|
178
178
|
this.unsubscribeReFreshChart();
|
|
179
179
|
this.refreshTimer && clearInterval(this.refreshTimer);
|
|
180
180
|
}
|
|
181
|
-
componentDidUpdate(
|
|
182
|
-
const {
|
|
183
|
-
chart: oldChart,
|
|
184
|
-
hasUnSaved,
|
|
185
|
-
version
|
|
186
|
-
} = this.props;
|
|
181
|
+
componentDidUpdate(prevProps) {
|
|
187
182
|
const {
|
|
188
183
|
chart,
|
|
189
|
-
hasUnSaved
|
|
190
|
-
version
|
|
184
|
+
hasUnSaved,
|
|
185
|
+
version,
|
|
191
186
|
autoRefresh,
|
|
192
187
|
refreshInterval,
|
|
193
188
|
pageId
|
|
194
|
-
} =
|
|
189
|
+
} = this.props;
|
|
190
|
+
const {
|
|
191
|
+
chart: oldChart,
|
|
192
|
+
hasUnSaved: prevHasUnSaved,
|
|
193
|
+
version: prevVersion
|
|
194
|
+
} = prevProps;
|
|
195
195
|
const {
|
|
196
196
|
data
|
|
197
197
|
} = this.state;
|
|
@@ -216,32 +216,32 @@ class View extends _react.default.PureComponent {
|
|
|
216
216
|
|
|
217
217
|
// universal-apps will not trigger calculation of the chart before the chart config saved
|
|
218
218
|
// after saving, hasUnSaved was set to false, then start calculation
|
|
219
|
-
const needCalc =
|
|
219
|
+
const needCalc = prevHasUnSaved === true && hasUnSaved === false;
|
|
220
220
|
if (needCalc && !data) {
|
|
221
221
|
this.calculateStatistic();
|
|
222
222
|
return;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
// version was used to dectect table change in big screen plugin
|
|
226
|
-
if ((0, _shallowequal.default)(chart, oldChart) && version ===
|
|
226
|
+
if ((0, _shallowequal.default)(chart, oldChart) && version === prevVersion) return;
|
|
227
227
|
this.setState({
|
|
228
228
|
isCalculated: false
|
|
229
229
|
}, () => {
|
|
230
|
-
if (_chartUtils.BaseUtils.isChartTypeChange(
|
|
230
|
+
if (_chartUtils.BaseUtils.isChartTypeChange(oldChart, chart)) {
|
|
231
231
|
this.calculateStatistic();
|
|
232
232
|
return;
|
|
233
233
|
}
|
|
234
|
-
if (_chartUtils.BaseUtils.isChartViewChange(
|
|
234
|
+
if (_chartUtils.BaseUtils.isChartViewChange(oldChart, chart)) {
|
|
235
235
|
this.calculateStatistic();
|
|
236
236
|
return;
|
|
237
237
|
}
|
|
238
|
-
if (_chartUtils.BaseUtils.isChartStyleChange(
|
|
238
|
+
if (_chartUtils.BaseUtils.isChartStyleChange(oldChart, chart)) {
|
|
239
239
|
this.setState({
|
|
240
240
|
isCalculated: true
|
|
241
241
|
});
|
|
242
242
|
return;
|
|
243
243
|
}
|
|
244
|
-
if (_chartUtils.BaseUtils.isChartSortChange(
|
|
244
|
+
if (_chartUtils.BaseUtils.isChartSortChange(oldChart, chart)) {
|
|
245
245
|
this.calculateStatistic(false);
|
|
246
246
|
return;
|
|
247
247
|
}
|
|
@@ -365,6 +365,11 @@ const propTypes = exports.propTypes = {
|
|
|
365
365
|
departments: _propTypes.default.array,
|
|
366
366
|
dtableStoreValue: _propTypes.default.object,
|
|
367
367
|
isCalculateByView: _propTypes.default.bool,
|
|
368
|
+
hasUnSaved: _propTypes.default.bool,
|
|
369
|
+
pageId: _propTypes.default.string,
|
|
370
|
+
version: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
371
|
+
autoRefresh: _propTypes.default.bool,
|
|
372
|
+
refreshInterval: _propTypes.default.number,
|
|
368
373
|
// event
|
|
369
374
|
integratedEventTypes: _propTypes.default.object,
|
|
370
375
|
integratedEventBus: _propTypes.default.object,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sea-chart",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.58-alpha.1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@dnd-kit/core": "^6.1.0",
|
|
@@ -158,10 +158,5 @@
|
|
|
158
158
|
},
|
|
159
159
|
"publishConfig": {
|
|
160
160
|
"access": "public"
|
|
161
|
-
},
|
|
162
|
-
"overrides": {
|
|
163
|
-
"slugid": {
|
|
164
|
-
"uuid": "11.1.1"
|
|
165
|
-
}
|
|
166
161
|
}
|
|
167
162
|
}
|