sea-chart 0.0.66-alpha.2 → 0.0.66-alpha.3
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.
|
@@ -31,7 +31,8 @@ class StatisticRecordDialog extends React.Component {
|
|
|
31
31
|
} = statisticRecord || {};
|
|
32
32
|
const {
|
|
33
33
|
table_id,
|
|
34
|
-
view_id
|
|
34
|
+
view_id,
|
|
35
|
+
filters
|
|
35
36
|
} = chart.config;
|
|
36
37
|
this.table = getTableById(tables, table_id);
|
|
37
38
|
if (view_id) {
|
|
@@ -41,17 +42,17 @@ class StatisticRecordDialog extends React.Component {
|
|
|
41
42
|
this.unShowColumnKeyList = this.getUnShowColumnKeyList(this.view);
|
|
42
43
|
this.renderedColumns = this.getRenderedColumns(this.table);
|
|
43
44
|
if (this.isArchiveView || !isCalculateByView || (rows === null || rows === void 0 ? void 0 : rows.length) === 0) {
|
|
44
|
-
var _context$api, _context$api2
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const detailFilterConditions =
|
|
54
|
-
filters:
|
|
45
|
+
var _context$api, _context$api2;
|
|
46
|
+
if ((_context$api = context.api) === null || _context$api === void 0 ? void 0 : _context$api.customQueryRows) {
|
|
47
|
+
const newFilters = (filters === null || filters === void 0 ? void 0 : filters.map(item => {
|
|
48
|
+
return {
|
|
49
|
+
...item,
|
|
50
|
+
column_key: (item === null || item === void 0 ? void 0 : item.column_key) || '',
|
|
51
|
+
value: (item === null || item === void 0 ? void 0 : item.filter_term) || ''
|
|
52
|
+
};
|
|
53
|
+
})) || [];
|
|
54
|
+
const detailFilterConditions = {
|
|
55
|
+
filters: newFilters
|
|
55
56
|
};
|
|
56
57
|
context.api.customQueryRows(detailFilterConditions).then(res => {
|
|
57
58
|
console.log('res', res);
|
|
@@ -70,7 +71,7 @@ class StatisticRecordDialog extends React.Component {
|
|
|
70
71
|
isColumn,
|
|
71
72
|
isRow
|
|
72
73
|
});
|
|
73
|
-
((_context$
|
|
74
|
+
((_context$api2 = context.api) === null || _context$api2 === void 0 ? void 0 : _context$api2.sqlQuery) && context.api.sqlQuery(sqlString).then(res => {
|
|
74
75
|
const {
|
|
75
76
|
results: rows
|
|
76
77
|
} = res.data;
|
|
@@ -13,7 +13,6 @@ class ChartDataSQL {
|
|
|
13
13
|
var _chart$config;
|
|
14
14
|
let {
|
|
15
15
|
table,
|
|
16
|
-
view,
|
|
17
16
|
chart,
|
|
18
17
|
username,
|
|
19
18
|
userId,
|
|
@@ -1073,7 +1072,7 @@ class ChartDataSQL {
|
|
|
1073
1072
|
Array.isArray(table.columns) && table.columns.forEach(column => {
|
|
1074
1073
|
this.column_key_map[column.key] = column;
|
|
1075
1074
|
});
|
|
1076
|
-
this.filter_sql = filter2SqlCondition(table,
|
|
1075
|
+
this.filter_sql = filter2SqlCondition(table, chart, username, userId, userDepartmentIdsMap);
|
|
1077
1076
|
}
|
|
1078
1077
|
}
|
|
1079
1078
|
export default ChartDataSQL;
|