dtable-statistic 5.1.18-alpha.1 → 5.1.18-alpha.2

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/index.js CHANGED
@@ -35,17 +35,17 @@ class Statistic {
35
35
  deletePluginSettings: this.deletePluginSettings.bind(this, dtableStore)
36
36
  };
37
37
  }
38
- static async getViewRows(view, table) {
38
+ static async getViewRows(view, table, refreshCache) {
39
39
  const dtableStore = window.app.dtableStore || {};
40
40
  const {
41
41
  username = null,
42
42
  userId = null,
43
43
  userDepartmentIdsMap = null
44
44
  } = dtableStore.dtableSettings;
45
- const rows = await (0, _calcWithWorker.calcViewRowsWithWorker)(view, table, dtableStore.value, username, userId, userDepartmentIdsMap);
45
+ const rows = await (0, _calcWithWorker.calcViewRowsWithWorker)(view, table, dtableStore.value, username, userId, userDepartmentIdsMap, refreshCache);
46
46
  return rows;
47
47
  }
48
- static async getTableFormulaResults(table, rows, value, viewId) {
48
+ static async getTableFormulaResults(table, rows, value, viewId, refreshCache) {
49
49
  const dtableStore = window.app.dtableStore || {};
50
50
  const {
51
51
  username = null,
@@ -53,7 +53,7 @@ class Statistic {
53
53
  userDepartmentIdsMap = null
54
54
  } = dtableStore.dtableSettings;
55
55
  const formulaColumns = _dtableStore.Views.getFormulaColumnsContainLinks(table);
56
- const res = await (0, _calcWithWorker.calcFormulaResultsWithWorker)(table, rows, dtableStore.value, formulaColumns, username, userId, userDepartmentIdsMap, viewId);
56
+ const res = await (0, _calcWithWorker.calcFormulaResultsWithWorker)(table, rows, dtableStore.value, formulaColumns, username, userId, userDepartmentIdsMap, viewId, refreshCache);
57
57
  return res;
58
58
  }
59
59
  static updateStatistics(dtableStore, statistics) {
@@ -15,10 +15,10 @@ var _lodashEs = require("lodash-es");
15
15
  function uuid() {
16
16
  return Math.random().toString(36).slice(2, 9);
17
17
  }
18
- async function calcViewRowsWithWorker(view, table, value, username, userId, userDepartmentIdsMap) {
18
+ async function calcViewRowsWithWorker(view, table, value, username, userId, userDepartmentIdsMap, refreshCache) {
19
19
  const key = view._id + table._id;
20
20
  const cachedRows = _resultCacheManager.viewRowsCacheManager.get(key);
21
- if (cachedRows) {
21
+ if (cachedRows && !refreshCache) {
22
22
  return cachedRows;
23
23
  }
24
24
  if (!_resultCacheManager.cachedBase) {
@@ -46,10 +46,10 @@ async function calcViewRowsWithWorker(view, table, value, username, userId, user
46
46
  _threadManager.default.removeThread(workerId);
47
47
  return rows;
48
48
  }
49
- async function calcFormulaResultsWithWorker(table, rows, value, formulaColumns, username, userId, userDepartmentIdsMap, viewId) {
49
+ async function calcFormulaResultsWithWorker(table, rows, value, formulaColumns, username, userId, userDepartmentIdsMap, viewId, refreshCache) {
50
50
  const key = viewId + table._id;
51
51
  const cachedResults = _resultCacheManager.formulaResultsCacheManager.get(key);
52
- if (cachedResults) {
52
+ if (cachedResults && !refreshCache) {
53
53
  return cachedResults;
54
54
  }
55
55
  if (!_resultCacheManager.cachedBase) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-statistic",
3
- "version": "5.1.18-alpha.1",
3
+ "version": "5.1.18-alpha.2",
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": "^1.1.22-alpha.2"
21
+ "sea-chart": "^1.1.22-alpha.3"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "dtable-ui-component": "~5.1.*",