dtable-statistic 4.4.24-alpha.10 → 4.4.24-alpha.12

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/dashboard.js CHANGED
@@ -453,8 +453,6 @@ class DashBoard extends _react.Component {
453
453
  labelColorConfigs: this.labelColorConfigs,
454
454
  eventBus: eventBus,
455
455
  onCloseDashboard: this.props.onCloseStatistic,
456
- getViewRows: this.props.getViewRows,
457
- getTableFormulaResults: this.props.getTableFormulaResults,
458
456
  selectDashboard: this.selectDashboard,
459
457
  addDashboard: this.addDashboard,
460
458
  renameDashboard: this.renameDashboard,
@@ -473,8 +471,6 @@ class DashBoard extends _react.Component {
473
471
  getActiveTable: this.getActiveTable,
474
472
  getActiveView: this.getActiveView,
475
473
  onCloseDashboard: this.props.onCloseStatistic,
476
- getViewRows: this.props.getViewRows,
477
- getTableFormulaResults: this.props.getTableFormulaResults,
478
474
  selectDashboard: this.selectDashboard,
479
475
  modifyColorTheme: this.modifyColorTheme,
480
476
  addDashboard: this.addDashboard,
@@ -10,6 +10,7 @@ var _react = _interopRequireWildcard(require("react"));
10
10
  var _classnames = _interopRequireDefault(require("classnames"));
11
11
  var _reactstrap = require("reactstrap");
12
12
  var _reactIntlUniversal = _interopRequireDefault(require("react-intl-universal"));
13
+ var _dtableStore = require("dtable-store");
13
14
  var _seaChart = require("sea-chart");
14
15
  var _tabs = _interopRequireDefault(require("./tabs"));
15
16
  var _statList = _interopRequireDefault(require("./stat-list"));
@@ -155,16 +156,37 @@ class DesktopDashboard extends _react.Component {
155
156
  };
156
157
  this.api = {
157
158
  sqlQuery: this.sqlQuery,
158
- getViewRows: () => {
159
- console.log('3333');
160
- },
161
- getTableFormulaResults: this.props.getTableFormulaResults,
159
+ getViewRows: this.getViewRows,
160
+ getTableFormulaResults: this.getTableFormulaResults,
162
161
  queryUsers: window.app.queryUsers || (() => {})
163
162
  };
164
163
  }
165
164
  async sqlQuery(sql) {
166
165
  return _dtableDbApi.default.sqlQuery(sql);
167
166
  }
167
+ async getViewRows(view, table) {
168
+ console.log('getViewRows');
169
+ const {
170
+ username = null,
171
+ userId = null,
172
+ userDepartmentIdsMap = null
173
+ } = this.dtableStore.dtableSettings;
174
+ return _dtableStore.Views.getViewRows(view, table, this.dtableStore.value, username, userId, userDepartmentIdsMap);
175
+ }
176
+ async getTableFormulaResults(table, rows) {
177
+ console.log('getTableFormulaResults');
178
+ const {
179
+ username = null,
180
+ userId = null,
181
+ userDepartmentIdsMap = null
182
+ } = this.dtableStore.dtableSettings;
183
+ const formulaColumns = _dtableStore.Views.getFormulaColumnsContainLinks(table);
184
+ return _dtableStore.Views.getTableFormulaResults(table, rows, this.dtableStore.value, formulaColumns, {
185
+ username,
186
+ userId,
187
+ userDepartmentIdsMap
188
+ });
189
+ }
168
190
  render() {
169
191
  const {
170
192
  getTableById,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-statistic",
3
- "version": "4.4.24-alpha.10",
3
+ "version": "4.4.24-alpha.12",
4
4
  "description": "statistics",
5
5
  "main": "dist/dtable-statistic.js",
6
6
  "author": "seafile",