@gingkoo/pandora-metabase 1.0.118 → 1.0.119
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/lib/cjs/common/Portal/index.js +0 -2
- package/lib/cjs/common/SplitView/index.d.ts +0 -4
- package/lib/cjs/common/SplitView/index.js +0 -10
- package/lib/cjs/components/dialog/custom-column/config.js +4 -48
- package/lib/cjs/components/dialog/custom-column/expression-editor.js +3 -14
- package/lib/cjs/components/dialog/custom-column/expressions/suggest.d.ts +2 -34
- package/lib/cjs/components/dialog/custom-column/expressions/suggest.js +2 -43
- package/lib/cjs/components/dialog/custom-column/expressions/tokenizer.js +8 -65
- package/lib/cjs/components/dialog/custom-column/index.js +2 -4
- package/lib/cjs/components/dialog/custom-column/tokenized-expression.js +2 -3
- package/lib/cjs/components/dialog/custom-column/tokenizedI-input.js +1 -1
- package/lib/cjs/components/dialog/custom-editor/index.js +2 -7
- package/lib/cjs/components/dialog/diff-viewer/index copy.js +1 -16
- package/lib/cjs/components/dialog/expression/date-format-picker.js +2 -20
- package/lib/cjs/components/dialog/expression/date-format.js +2 -8
- package/lib/cjs/components/dialog/expression/index.d.ts +0 -3
- package/lib/cjs/components/dialog/expression/index.js +2 -83
- package/lib/cjs/components/dialog/formula/index.js +1 -30
- package/lib/cjs/components/dialog/formula/utils.js +2 -10
- package/lib/cjs/components/dialog/formula-list/CaseWhenGroup.d.ts +19 -0
- package/lib/cjs/components/dialog/formula-list/CaseWhenGroup.js +109 -0
- package/lib/cjs/components/dialog/formula-list/LogicGroup.d.ts +9 -0
- package/lib/cjs/components/dialog/formula-list/LogicGroup.js +43 -0
- package/lib/cjs/components/dialog/formula-list/index.d.ts +3 -0
- package/lib/cjs/components/dialog/formula-list/index.js +967 -503
- package/lib/cjs/components/dialog/formula-list/index.less +724 -0
- package/lib/cjs/components/dialog/formula-list/utils.d.ts +0 -7
- package/lib/cjs/components/dialog/formula-list/utils.js +117 -113
- package/lib/cjs/components/dialog/select-column/index.d.ts +0 -6
- package/lib/cjs/components/dialog/select-column/index.js +4 -15
- package/lib/cjs/components/dialog/select-column-multiple/index.d.ts +0 -8
- package/lib/cjs/components/dialog/select-column-multiple/index.js +6 -45
- package/lib/cjs/components/dialog/select-join/index.d.ts +0 -5
- package/lib/cjs/components/dialog/select-join/index.js +0 -6
- package/lib/cjs/components/dialog/select-join-column/index.d.ts +0 -8
- package/lib/cjs/components/dialog/select-join-column/index.js +7 -21
- package/lib/cjs/components/dialog/select-join-column-multiple/index.d.ts +0 -8
- package/lib/cjs/components/dialog/select-join-column-multiple/index.js +5 -35
- package/lib/cjs/components/dialog/select-permission-table/index.d.ts +0 -5
- package/lib/cjs/components/dialog/select-permission-table/index.js +0 -6
- package/lib/cjs/components/dialog/select-summarize/index.d.ts +3 -3
- package/lib/cjs/components/dialog/select-summarize/index.js +105 -18
- package/lib/cjs/components/dialog/select-summarize/index.less +23 -0
- package/lib/cjs/components/dialog/select-table/index.d.ts +0 -6
- package/lib/cjs/components/dialog/select-table/index.js +1 -9
- package/lib/cjs/components/metabase/index.js +72 -86
- package/lib/cjs/components/metabase/index.less +7 -7
- package/lib/cjs/components/modules/components/Wrapper.js +1 -1
- package/lib/cjs/components/modules/components/header.js +2 -2
- package/lib/cjs/components/modules/components/meta-icon.d.ts +0 -3
- package/lib/cjs/components/modules/components/meta-icon.js +2 -47
- package/lib/cjs/components/modules/custom-column.js +3 -29
- package/lib/cjs/components/modules/enum/filter-enum.js +9 -88
- package/lib/cjs/components/modules/filter.js +2 -20
- package/lib/cjs/components/modules/index.d.ts +4 -2
- package/lib/cjs/components/modules/index.js +24 -1
- package/lib/cjs/components/modules/join-data.js +13 -291
- package/lib/cjs/components/modules/row-limit.js +0 -1
- package/lib/cjs/components/modules/sort.js +1 -61
- package/lib/cjs/components/modules/summarize/group-by.d.ts +0 -5
- package/lib/cjs/components/modules/summarize/group-by.js +231 -76
- package/lib/cjs/components/modules/summarize/select-index.js +96 -46
- package/lib/cjs/components/modules/table-data.js +11 -64
- package/lib/cjs/components/popup.js +26 -32
- package/lib/cjs/hooks/patch.d.ts +1 -0
- package/lib/cjs/hooks/patch.js +104 -6
- package/lib/cjs/hooks/patch2.js +3 -165
- package/lib/cjs/hooks/use-provider.js +0 -3
- package/lib/cjs/hooks/use-state.js +55 -135
- package/lib/cjs/index.js +0 -15
- package/lib/cjs/locale/en.js +5 -0
- package/lib/cjs/locale/index.js +1 -4
- package/lib/cjs/locale/zh.js +5 -0
- package/lib/cjs/sql-formula.js +0 -1
- package/lib/cjs/store/enum.d.ts +6 -6
- package/lib/cjs/store/enum.js +0 -13
- package/lib/cjs/store/helper.d.ts +2 -1
- package/lib/cjs/store/helper.js +15 -225
- package/lib/cjs/store/types.d.ts +45 -67
- package/lib/cjs/store/types.js +3 -49
- package/lib/cjs/types.d.ts +1 -0
- package/lib/cjs/utils/cookies.js +0 -3
- package/lib/cjs/utils/event.js +1 -1
- package/lib/cjs/utils/helper-dom.d.ts +1 -0
- package/lib/cjs/utils/helper-dom.js +17 -10
- package/lib/cjs/utils/helper.js +1 -24
- package/lib/cjs/utils/keydown.js +4 -7
- package/lib/cjs/utils/platform.d.ts +0 -9
- package/lib/cjs/utils/platform.js +0 -10
- package/lib/cjs/utils/selection.js +0 -6
- package/lib/cjs/utils/storage.d.ts +0 -9
- package/lib/cjs/utils/storage.js +1 -11
- package/lib/cjs/utils/transformSql.d.ts +5 -0
- package/lib/cjs/utils/transformSql.js +42 -113
- package/lib/cjs/utils.d.ts +1 -6
- package/lib/cjs/utils.js +115 -255
- package/lib/es/common/Portal/index.js +0 -2
- package/lib/es/common/SplitView/index.d.ts +0 -4
- package/lib/es/common/SplitView/index.js +0 -10
- package/lib/es/components/dialog/custom-column/config.js +4 -48
- package/lib/es/components/dialog/custom-column/expression-editor.js +3 -14
- package/lib/es/components/dialog/custom-column/expressions/suggest.d.ts +2 -34
- package/lib/es/components/dialog/custom-column/expressions/suggest.js +2 -43
- package/lib/es/components/dialog/custom-column/expressions/tokenizer.js +8 -65
- package/lib/es/components/dialog/custom-column/index.js +2 -4
- package/lib/es/components/dialog/custom-column/tokenized-expression.js +1 -3
- package/lib/es/components/dialog/custom-column/tokenizedI-input.js +1 -1
- package/lib/es/components/dialog/custom-editor/index.js +1 -7
- package/lib/es/components/dialog/diff-viewer/index copy.js +1 -15
- package/lib/es/components/dialog/expression/date-format-picker.js +2 -20
- package/lib/es/components/dialog/expression/date-format.js +2 -8
- package/lib/es/components/dialog/expression/index.d.ts +0 -3
- package/lib/es/components/dialog/expression/index.js +2 -82
- package/lib/es/components/dialog/formula/index.js +0 -30
- package/lib/es/components/dialog/formula/utils.js +2 -10
- package/lib/es/components/dialog/formula-list/CaseWhenGroup.d.ts +19 -0
- package/lib/es/components/dialog/formula-list/CaseWhenGroup.js +102 -0
- package/lib/es/components/dialog/formula-list/LogicGroup.d.ts +9 -0
- package/lib/es/components/dialog/formula-list/LogicGroup.js +36 -0
- package/lib/es/components/dialog/formula-list/index.d.ts +3 -0
- package/lib/es/components/dialog/formula-list/index.js +966 -503
- package/lib/es/components/dialog/formula-list/index.less +724 -0
- package/lib/es/components/dialog/formula-list/utils.d.ts +0 -7
- package/lib/es/components/dialog/formula-list/utils.js +117 -113
- package/lib/es/components/dialog/index.js +3 -3
- package/lib/es/components/dialog/select-column/index.d.ts +0 -6
- package/lib/es/components/dialog/select-column/index.js +4 -14
- package/lib/es/components/dialog/select-column-multiple/index.d.ts +0 -8
- package/lib/es/components/dialog/select-column-multiple/index.js +7 -47
- package/lib/es/components/dialog/select-join/index.d.ts +0 -5
- package/lib/es/components/dialog/select-join/index.js +0 -5
- package/lib/es/components/dialog/select-join-column/index.d.ts +0 -8
- package/lib/es/components/dialog/select-join-column/index.js +7 -20
- package/lib/es/components/dialog/select-join-column-multiple/index.d.ts +0 -8
- package/lib/es/components/dialog/select-join-column-multiple/index.js +5 -34
- package/lib/es/components/dialog/select-permission-table/index.d.ts +0 -5
- package/lib/es/components/dialog/select-permission-table/index.js +0 -5
- package/lib/es/components/dialog/select-summarize/index.d.ts +3 -3
- package/lib/es/components/dialog/select-summarize/index.js +106 -18
- package/lib/es/components/dialog/select-summarize/index.less +23 -0
- package/lib/es/components/dialog/select-table/index.d.ts +0 -6
- package/lib/es/components/dialog/select-table/index.js +1 -8
- package/lib/es/components/metabase/index.js +72 -87
- package/lib/es/components/metabase/index.less +7 -7
- package/lib/es/components/modules/components/Wrapper.js +1 -1
- package/lib/es/components/modules/components/header.js +2 -2
- package/lib/es/components/modules/components/meta-icon.d.ts +0 -3
- package/lib/es/components/modules/components/meta-icon.js +2 -46
- package/lib/es/components/modules/custom-column.js +3 -29
- package/lib/es/components/modules/enum/filter-enum.js +9 -88
- package/lib/es/components/modules/filter.js +2 -19
- package/lib/es/components/modules/index.d.ts +4 -2
- package/lib/es/components/modules/index.js +24 -1
- package/lib/es/components/modules/join-data.js +13 -291
- package/lib/es/components/modules/row-limit.js +0 -1
- package/lib/es/components/modules/sort.js +1 -61
- package/lib/es/components/modules/summarize/group-by.d.ts +0 -5
- package/lib/es/components/modules/summarize/group-by.js +233 -78
- package/lib/es/components/modules/summarize/select-index.js +96 -46
- package/lib/es/components/modules/table-data.js +11 -64
- package/lib/es/components/popup.js +27 -33
- package/lib/es/hooks/patch.d.ts +1 -0
- package/lib/es/hooks/patch.js +103 -5
- package/lib/es/hooks/patch2.js +2 -164
- package/lib/es/hooks/use-provider.js +0 -3
- package/lib/es/hooks/use-state.js +55 -135
- package/lib/es/index.js +0 -14
- package/lib/es/locale/en.js +5 -0
- package/lib/es/locale/index.js +1 -4
- package/lib/es/locale/zh.js +5 -0
- package/lib/es/sql-formula.js +0 -1
- package/lib/es/store/enum.d.ts +6 -6
- package/lib/es/store/enum.js +0 -13
- package/lib/es/store/helper.d.ts +2 -1
- package/lib/es/store/helper.js +13 -224
- package/lib/es/store/types.d.ts +45 -67
- package/lib/es/store/types.js +3 -49
- package/lib/es/types.d.ts +1 -0
- package/lib/es/types.js +1 -18
- package/lib/es/utils/cookies.js +0 -3
- package/lib/es/utils/event.js +1 -1
- package/lib/es/utils/helper-dom.d.ts +1 -0
- package/lib/es/utils/helper-dom.js +16 -9
- package/lib/es/utils/helper.js +1 -24
- package/lib/es/utils/keydown.js +4 -7
- package/lib/es/utils/platform.d.ts +0 -9
- package/lib/es/utils/platform.js +0 -10
- package/lib/es/utils/selection.js +0 -6
- package/lib/es/utils/storage.d.ts +0 -9
- package/lib/es/utils/storage.js +1 -10
- package/lib/es/utils/transformSql.d.ts +5 -0
- package/lib/es/utils/transformSql.js +42 -112
- package/lib/es/utils.d.ts +1 -6
- package/lib/es/utils.js +116 -255
- package/package.json +1 -1
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
4
|
-
/**
|
|
5
|
-
* 选择表字段当条件
|
|
6
|
-
* 谁在用?
|
|
7
|
-
* 1、关联模块
|
|
8
|
-
* 2、过滤器模块
|
|
9
|
-
* 3、聚合模块
|
|
10
|
-
* 4、排序模块
|
|
11
|
-
*/
|
|
12
4
|
import './index.less';
|
|
13
5
|
import { useEffect, useState } from 'react';
|
|
14
6
|
import { Empty } from '@gingkoo/pandora';
|
|
@@ -17,9 +9,7 @@ import cloneDeep from 'lodash/cloneDeep';
|
|
|
17
9
|
import cx from 'classnames';
|
|
18
10
|
import { ColumnsPopupThemeEnum, SQL_GROUP_TYPE } from '../../../store/enum';
|
|
19
11
|
import { SummarizeAlias } from '../../../store/helper';
|
|
20
|
-
import {
|
|
21
|
-
// AtomsField,
|
|
22
|
-
AtomsTypeEnum } from '../../../store/types';
|
|
12
|
+
import { AtomsTypeEnum } from '../../../store/types';
|
|
23
13
|
import { __ } from '../../../locale';
|
|
24
14
|
import { NUMBER_GROUP, DATE_GROUP } from '../const';
|
|
25
15
|
import { useStore } from '../../../hooks/use-provider';
|
|
@@ -40,7 +30,7 @@ var IconMap = {
|
|
|
40
30
|
PK: _jsx(CircleIcon, {}),
|
|
41
31
|
FK: _jsx(ForeignKeyIcon, {})
|
|
42
32
|
};
|
|
43
|
-
var OPEN_GROUP = false;
|
|
33
|
+
var OPEN_GROUP = false;
|
|
44
34
|
var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
45
35
|
var _value$, _value$2;
|
|
46
36
|
var _ref$data = _ref.data,
|
|
@@ -63,7 +53,7 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
63
53
|
var _useState = useState(_value),
|
|
64
54
|
_useState2 = _slicedToArray(_useState, 2),
|
|
65
55
|
value = _useState2[0],
|
|
66
|
-
setValue = _useState2[1];
|
|
56
|
+
setValue = _useState2[1];
|
|
67
57
|
var _useState3 = useState((_value === null || _value === void 0 || (_value$ = _value[0]) === null || _value$ === void 0 ? void 0 : _value$.tableId) === SummarizeAlias ? '' : _value === null || _value === void 0 || (_value$2 = _value[0]) === null || _value$2 === void 0 ? void 0 : _value$2.tableUuid),
|
|
68
58
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
69
59
|
curTable = _useState4[0],
|
|
@@ -71,11 +61,9 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
71
61
|
var _useState5 = useState(''),
|
|
72
62
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
73
63
|
searchTableText = _useState6[0],
|
|
74
|
-
setSearchTableText = _useState6[1];
|
|
75
|
-
// 当前选择的表
|
|
76
|
-
// const [curColumn, setCurColumn] = useState(_value); // 当前选择的字段
|
|
64
|
+
setSearchTableText = _useState6[1];
|
|
77
65
|
var _useState7 = useState(data.map(function (v, i) {
|
|
78
|
-
var open = !i && !curTable ? true : v.tableUuid === curTable;
|
|
66
|
+
var open = !i && !curTable ? true : v.tableUuid === curTable;
|
|
79
67
|
return _objectSpread(_objectSpread({}, v), {}, {
|
|
80
68
|
open: open,
|
|
81
69
|
searchText: '',
|
|
@@ -90,7 +78,6 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
90
78
|
tableList = _useState8[0],
|
|
91
79
|
setTableList = _useState8[1];
|
|
92
80
|
useEffect(function () {
|
|
93
|
-
// setCurColumn(_value);
|
|
94
81
|
setValue(_value);
|
|
95
82
|
}, [_value]);
|
|
96
83
|
var isActive = function isActive(id_alias) {
|
|
@@ -108,7 +95,7 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
108
95
|
tableUuid = (data === null || data === void 0 || (_data$ = data[0]) === null || _data$ === void 0 ? void 0 : _data$.tableUuid) || '';
|
|
109
96
|
}
|
|
110
97
|
setTableList(data === null || data === void 0 ? void 0 : data.map(function (v, i) {
|
|
111
|
-
var open = !i && !tableUuid ? true : v.tableUuid === tableUuid;
|
|
98
|
+
var open = !i && !tableUuid ? true : v.tableUuid === tableUuid;
|
|
112
99
|
return _objectSpread(_objectSpread({}, v), {}, {
|
|
113
100
|
open: open,
|
|
114
101
|
searchText: '',
|
|
@@ -162,13 +149,11 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
162
149
|
return v.fieldId != (val === null || val === void 0 ? void 0 : val.fieldId);
|
|
163
150
|
});
|
|
164
151
|
}
|
|
165
|
-
// 当前选中的表字段
|
|
166
152
|
var curTableColumn = data.filter(function (v) {
|
|
167
153
|
return v.tableUuid === tableUuid;
|
|
168
154
|
}).flatMap(function (v) {
|
|
169
155
|
return v.columns;
|
|
170
156
|
});
|
|
171
|
-
// 过滤选中字段不在当前选中的表字段中,
|
|
172
157
|
_value = _value.filter(function (item2) {
|
|
173
158
|
return curTableColumn.some(function (item1) {
|
|
174
159
|
return item1.name === item2.fieldName;
|
|
@@ -186,7 +171,6 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
186
171
|
datasourceName = _v$datasourceName === void 0 ? '' : _v$datasourceName;
|
|
187
172
|
var fullName = datasourceName ? "".concat(datasourceName, ".").concat(mergeNameAlias(tableName, tableAlias, store.tableEnableAlias)) : mergeNameAlias(tableName, tableAlias, store.tableEnableAlias);
|
|
188
173
|
if (val === '' || ~fullName.toLocaleLowerCase().indexOf(val.toLocaleLowerCase())) {
|
|
189
|
-
// let open = tableList.filter((vv) => vv.tableUuid === v.tableUuid)?.[0]?.open || false;
|
|
190
174
|
return _objectSpread({}, v);
|
|
191
175
|
}
|
|
192
176
|
return null;
|
|
@@ -196,7 +180,6 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
196
180
|
setSearchTableText(val);
|
|
197
181
|
setTableList(newData);
|
|
198
182
|
};
|
|
199
|
-
// const _condition = value?.condition || '';
|
|
200
183
|
if (data.length < 1) {
|
|
201
184
|
return _jsx("div", {
|
|
202
185
|
className: 'Sqb-SelectColumns--box',
|
|
@@ -244,7 +227,6 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
244
227
|
_tableItem$tableUuid = tableItem.tableUuid,
|
|
245
228
|
tableUuid = _tableItem$tableUuid === void 0 ? '' : _tableItem$tableUuid;
|
|
246
229
|
var isMultiple = tableList.length > 1;
|
|
247
|
-
// 只有一张表时 展开
|
|
248
230
|
if (!isMultiple) {
|
|
249
231
|
open = true;
|
|
250
232
|
}
|
|
@@ -308,7 +290,6 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
308
290
|
}), _jsx("input", {
|
|
309
291
|
type: 'text',
|
|
310
292
|
className: 'p-2',
|
|
311
|
-
// autoFocus
|
|
312
293
|
value: searchText,
|
|
313
294
|
placeholder: __('joinData.search'),
|
|
314
295
|
onChange: function onChange() {},
|
|
@@ -326,16 +307,12 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
326
307
|
realName = _v$realName === void 0 ? '' : _v$realName,
|
|
327
308
|
fieldId = v.id;
|
|
328
309
|
var groupe = SQL_GROUP_TYPE.STRING;
|
|
329
|
-
// @ts-ignore
|
|
330
310
|
if (~NUMBER_GROUP.indexOf(database_type)) {
|
|
331
311
|
groupe = SQL_GROUP_TYPE.NUMBER;
|
|
332
312
|
}
|
|
333
|
-
// @ts-ignore
|
|
334
313
|
if (~DATE_GROUP.indexOf(database_type)) {
|
|
335
314
|
groupe = SQL_GROUP_TYPE.DATE;
|
|
336
315
|
}
|
|
337
|
-
// let showCondition =
|
|
338
|
-
// curColumn === name && curTable === tableUuid && _condition;
|
|
339
316
|
return _jsx("div", {
|
|
340
317
|
className: cx("Sqb-List-section"),
|
|
341
318
|
children: _jsx("div", {
|
|
@@ -343,9 +320,7 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
343
320
|
active: isActive((v.id || v.name) + (v.fieldAlias || ''))
|
|
344
321
|
}),
|
|
345
322
|
onClick: function onClick() {
|
|
346
|
-
if (isSummarize) {
|
|
347
|
-
// console.log(v, 'v');
|
|
348
|
-
}
|
|
323
|
+
if (isSummarize) {}
|
|
349
324
|
changeValue(tableUuid, {
|
|
350
325
|
tableName: tableItem.name || '',
|
|
351
326
|
tableId: tableItem.id || '',
|
|
@@ -360,22 +335,7 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
360
335
|
fieldAlias: v.fieldAlias || '',
|
|
361
336
|
fieldUuid: v.fieldUuid || '',
|
|
362
337
|
type: AtomsTypeEnum.FIELD
|
|
363
|
-
// quotes: v.fieldAlias || v.name,
|
|
364
338
|
});
|
|
365
|
-
// setCurTable(tableUuid);
|
|
366
|
-
// typeof onSelect === 'function' &&
|
|
367
|
-
// onSelect({
|
|
368
|
-
// ...v,
|
|
369
|
-
// table,
|
|
370
|
-
// tableId,
|
|
371
|
-
// alias: tableAlias,
|
|
372
|
-
// name,
|
|
373
|
-
// database_type,
|
|
374
|
-
// sql: v.sql || '',
|
|
375
|
-
// datasourceId,
|
|
376
|
-
// datasourceName,
|
|
377
|
-
// realName,
|
|
378
|
-
// });
|
|
379
339
|
},
|
|
380
340
|
children: _jsxs("div", {
|
|
381
341
|
className: 'p-2 List-item',
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 选择表字段当条件
|
|
3
|
-
* 谁在用?
|
|
4
|
-
* 1、关联模块
|
|
5
|
-
* 2、过滤器模块
|
|
6
|
-
* 3、聚合模块
|
|
7
|
-
* 4、排序模块
|
|
8
|
-
*/
|
|
9
1
|
import './index.less';
|
|
10
2
|
import { ColumnsPopupThemeEnum, SQL_COLUMN_TYPE } from '../../../store/enum';
|
|
11
3
|
import { MetaData_ColumnsType, MetaJoin_TalbeType } from '../../../store/types';
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
4
|
-
/**
|
|
5
|
-
* 选择表字段当条件
|
|
6
|
-
* 谁在用?
|
|
7
|
-
* 1、关联模块
|
|
8
|
-
* 2、过滤器模块
|
|
9
|
-
* 3、聚合模块
|
|
10
|
-
* 4、排序模块
|
|
11
|
-
*/
|
|
12
4
|
import './index.less';
|
|
13
5
|
import { useEffect, useState } from 'react';
|
|
14
6
|
import { Menu, Popover } from '@gingkoo/pandora';
|
|
@@ -35,7 +27,7 @@ var IconMap = {
|
|
|
35
27
|
PK: _jsx(CircleIcon, {}),
|
|
36
28
|
FK: _jsx(ForeignKeyIcon, {})
|
|
37
29
|
};
|
|
38
|
-
var OPEN_GROUP = false;
|
|
30
|
+
var OPEN_GROUP = false;
|
|
39
31
|
var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
40
32
|
var _ref$data = _ref.data,
|
|
41
33
|
data = _ref$data === void 0 ? [] : _ref$data,
|
|
@@ -52,21 +44,21 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
52
44
|
var _useState = useState(_value),
|
|
53
45
|
_useState2 = _slicedToArray(_useState, 2),
|
|
54
46
|
value = _useState2[0],
|
|
55
|
-
setValue = _useState2[1];
|
|
47
|
+
setValue = _useState2[1];
|
|
56
48
|
var _useState3 = useState(_value.tableUuid),
|
|
57
49
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
58
50
|
curTable = _useState4[0],
|
|
59
|
-
setCurTable = _useState4[1];
|
|
51
|
+
setCurTable = _useState4[1];
|
|
60
52
|
var _useState5 = useState(_value.name),
|
|
61
53
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
62
54
|
curColumn = _useState6[0],
|
|
63
|
-
setCurColumn = _useState6[1];
|
|
55
|
+
setCurColumn = _useState6[1];
|
|
64
56
|
var _useState7 = useState(''),
|
|
65
57
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
66
58
|
searchTableText = _useState8[0],
|
|
67
|
-
setSearchTableText = _useState8[1];
|
|
59
|
+
setSearchTableText = _useState8[1];
|
|
68
60
|
var _useState9 = useState(data.map(function (v, i) {
|
|
69
|
-
var open = !i && !_value.tableUuid ? true : v.tableUuid === _value.tableUuid;
|
|
61
|
+
var open = !i && !_value.tableUuid ? true : v.tableUuid === _value.tableUuid;
|
|
70
62
|
return _objectSpread(_objectSpread({}, v), {}, {
|
|
71
63
|
open: open,
|
|
72
64
|
searchText: '',
|
|
@@ -91,7 +83,7 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
91
83
|
}
|
|
92
84
|
setCurTable(tableUuid);
|
|
93
85
|
setTableList(data.map(function (v, i) {
|
|
94
|
-
var open = !i && !tableUuid ? true : v.tableUuid === tableUuid;
|
|
86
|
+
var open = !i && !tableUuid ? true : v.tableUuid === tableUuid;
|
|
95
87
|
return _objectSpread(_objectSpread({}, v), {}, {
|
|
96
88
|
open: open,
|
|
97
89
|
searchText: '',
|
|
@@ -125,7 +117,6 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
125
117
|
datasourceName = _v$datasourceName === void 0 ? '' : _v$datasourceName;
|
|
126
118
|
var fullName = datasourceName ? "".concat(datasourceName, ".").concat(mergeNameAlias(tableName, tableAlias, store.tableEnableAlias)) : mergeNameAlias(tableName, tableAlias, store.tableEnableAlias);
|
|
127
119
|
if (val === '' || ~fullName.toLocaleLowerCase().indexOf(val.toLocaleLowerCase())) {
|
|
128
|
-
// let open = tableList.filter((vv) => vv.tableUuid === v.tableUuid)?.[0]?.open || false;
|
|
129
120
|
return _objectSpread({}, v);
|
|
130
121
|
}
|
|
131
122
|
return null;
|
|
@@ -172,7 +163,6 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
172
163
|
_tableItem$tableUuid = tableItem.tableUuid,
|
|
173
164
|
tableUuid = _tableItem$tableUuid === void 0 ? '' : _tableItem$tableUuid;
|
|
174
165
|
var isMultiple = tableList.length > 1;
|
|
175
|
-
// 只有一张表时 展开
|
|
176
166
|
if (!isMultiple) {
|
|
177
167
|
open = true;
|
|
178
168
|
}
|
|
@@ -233,7 +223,6 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
233
223
|
}), _jsx("input", {
|
|
234
224
|
type: 'text',
|
|
235
225
|
className: 'p-2',
|
|
236
|
-
// autoFocus
|
|
237
226
|
value: searchText,
|
|
238
227
|
placeholder: __('joinData.search'),
|
|
239
228
|
onChange: function onChange() {},
|
|
@@ -249,11 +238,9 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
249
238
|
_v$realName = v.realName,
|
|
250
239
|
realName = _v$realName === void 0 ? '' : _v$realName;
|
|
251
240
|
var groupe = SQL_GROUP_TYPE.STRING;
|
|
252
|
-
// @ts-ignore
|
|
253
241
|
if (~NUMBER_GROUP.indexOf(database_type)) {
|
|
254
242
|
groupe = SQL_GROUP_TYPE.NUMBER;
|
|
255
243
|
}
|
|
256
|
-
// @ts-ignore
|
|
257
244
|
if (~DATE_GROUP.indexOf(database_type)) {
|
|
258
245
|
groupe = SQL_GROUP_TYPE.DATE;
|
|
259
246
|
}
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 选择表字段当条件
|
|
3
|
-
* 谁在用?
|
|
4
|
-
* 1、关联模块
|
|
5
|
-
* 2、过滤器模块
|
|
6
|
-
* 3、聚合模块
|
|
7
|
-
* 4、排序模块
|
|
8
|
-
*/
|
|
9
1
|
import './index.less';
|
|
10
2
|
import { ColumnsPopupThemeEnum, SQL_COLUMN_TYPE } from '../../../store/enum';
|
|
11
3
|
import { MetaData_ColumnsType, MetaJoin_TalbeType, MetaJoin_Field } from '../../../store/types';
|
|
@@ -2,14 +2,6 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
|
2
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
4
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
|
-
/**
|
|
6
|
-
* 选择表字段当条件
|
|
7
|
-
* 谁在用?
|
|
8
|
-
* 1、关联模块
|
|
9
|
-
* 2、过滤器模块
|
|
10
|
-
* 3、聚合模块
|
|
11
|
-
* 4、排序模块
|
|
12
|
-
*/
|
|
13
5
|
import './index.less';
|
|
14
6
|
import { useEffect, useState } from 'react';
|
|
15
7
|
import cloneDeep from 'lodash/cloneDeep';
|
|
@@ -35,7 +27,7 @@ var IconMap = {
|
|
|
35
27
|
PK: _jsx(CircleIcon, {}),
|
|
36
28
|
FK: _jsx(ForeignKeyIcon, {})
|
|
37
29
|
};
|
|
38
|
-
var OPEN_GROUP = false;
|
|
30
|
+
var OPEN_GROUP = false;
|
|
39
31
|
var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
40
32
|
var _ref$data = _ref.data,
|
|
41
33
|
data = _ref$data === void 0 ? [] : _ref$data,
|
|
@@ -53,14 +45,13 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
53
45
|
var _useState = useState(_value),
|
|
54
46
|
_useState2 = _slicedToArray(_useState, 2),
|
|
55
47
|
value = _useState2[0],
|
|
56
|
-
setValue = _useState2[1];
|
|
48
|
+
setValue = _useState2[1];
|
|
57
49
|
var _useState3 = useState(tableInfo),
|
|
58
50
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
59
51
|
curTable = _useState4[0],
|
|
60
|
-
setCurTable = _useState4[1];
|
|
61
|
-
// const [curColumn, setCurColumn] = useState(_value); // 当前选择的字段
|
|
52
|
+
setCurTable = _useState4[1];
|
|
62
53
|
var _useState5 = useState(data.map(function (v, i) {
|
|
63
|
-
var open = !i && !tableInfo.tableUuid ? true : v.tableUuid === tableInfo.tableUuid;
|
|
54
|
+
var open = !i && !tableInfo.tableUuid ? true : v.tableUuid === tableInfo.tableUuid;
|
|
64
55
|
return _objectSpread(_objectSpread({}, v), {}, {
|
|
65
56
|
open: open,
|
|
66
57
|
searchText: '',
|
|
@@ -74,7 +65,6 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
74
65
|
setCurTable(tableInfo);
|
|
75
66
|
}, [tableInfo]);
|
|
76
67
|
useEffect(function () {
|
|
77
|
-
// setCurColumn(_value);
|
|
78
68
|
setValue(_value);
|
|
79
69
|
}, [_value]);
|
|
80
70
|
var isActive = function isActive(fieldUuid) {
|
|
@@ -84,7 +74,7 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
84
74
|
};
|
|
85
75
|
useEffect(function () {
|
|
86
76
|
setTableList(data.map(function (v, i) {
|
|
87
|
-
var open = !i && !tableInfo.tableUuid ? true : v.tableUuid === tableInfo.tableUuid;
|
|
77
|
+
var open = !i && !tableInfo.tableUuid ? true : v.tableUuid === tableInfo.tableUuid;
|
|
88
78
|
return _objectSpread(_objectSpread({}, v), {}, {
|
|
89
79
|
open: open,
|
|
90
80
|
searchText: '',
|
|
@@ -129,7 +119,6 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
129
119
|
setCurTable(table);
|
|
130
120
|
onSelect === null || onSelect === void 0 || onSelect(table, _value);
|
|
131
121
|
};
|
|
132
|
-
// const _condition = value?.condition || '';
|
|
133
122
|
return _jsx("div", {
|
|
134
123
|
className: cx("Sqb-SelectColumns--box ".concat(theme)),
|
|
135
124
|
children: _jsx("div", {
|
|
@@ -224,16 +213,12 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
224
213
|
realName = _v$realName === void 0 ? '' : _v$realName,
|
|
225
214
|
fieldId = v.id;
|
|
226
215
|
var groupe = SQL_GROUP_TYPE.STRING;
|
|
227
|
-
// @ts-ignore
|
|
228
216
|
if (~NUMBER_GROUP.indexOf(database_type)) {
|
|
229
217
|
groupe = SQL_GROUP_TYPE.NUMBER;
|
|
230
218
|
}
|
|
231
|
-
// @ts-ignore
|
|
232
219
|
if (~DATE_GROUP.indexOf(database_type)) {
|
|
233
220
|
groupe = SQL_GROUP_TYPE.DATE;
|
|
234
221
|
}
|
|
235
|
-
// let showCondition =
|
|
236
|
-
// curColumn === name && curTable === tableUuid && _condition;
|
|
237
222
|
return _jsx("div", {
|
|
238
223
|
className: cx("Sqb-List-section"),
|
|
239
224
|
children: _jsx("div", {
|
|
@@ -247,20 +232,6 @@ var SelectJoinColumn = function SelectJoinColumn(_ref) {
|
|
|
247
232
|
fieldUuid: v.fieldUuid,
|
|
248
233
|
quotes: v.fieldAlias || v.name
|
|
249
234
|
});
|
|
250
|
-
// setCurTable(tableUuid);
|
|
251
|
-
// typeof onSelect === 'function' &&
|
|
252
|
-
// onSelect({
|
|
253
|
-
// ...v,
|
|
254
|
-
// table,
|
|
255
|
-
// tableId,
|
|
256
|
-
// alias: tableAlias,
|
|
257
|
-
// name,
|
|
258
|
-
// database_type,
|
|
259
|
-
// sql: v.sql || '',
|
|
260
|
-
// datasourceId,
|
|
261
|
-
// datasourceName,
|
|
262
|
-
// realName,
|
|
263
|
-
// });
|
|
264
235
|
},
|
|
265
236
|
children: _jsxs("div", {
|
|
266
237
|
className: 'p-2 List-item',
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
/**
|
|
4
|
-
* 选择表弹框
|
|
5
|
-
* 谁在用?
|
|
6
|
-
* 1、选择权限表
|
|
7
|
-
*/
|
|
8
3
|
import './index.less';
|
|
9
4
|
import { useState, useEffect } from 'react';
|
|
10
5
|
import cx from 'classnames';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 关联模块 选择表字段
|
|
3
|
-
*/
|
|
4
1
|
import './index.less';
|
|
5
2
|
import { DataType, ColumnType } from '../select-join-column';
|
|
3
|
+
import { AtomsItem } from '../../../store/types';
|
|
6
4
|
export type ValueType = Partial<ColumnType> & {
|
|
5
|
+
name_zh?: string;
|
|
7
6
|
condition: string;
|
|
8
7
|
quotes: string;
|
|
8
|
+
atoms?: AtomsItem[];
|
|
9
9
|
};
|
|
10
10
|
interface PropsType {
|
|
11
11
|
data: DataType[];
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
-
/**
|
|
5
|
-
* 关联模块 选择表字段
|
|
6
|
-
*/
|
|
7
4
|
import './index.less';
|
|
8
5
|
import { useState } from 'react';
|
|
9
|
-
import { Tooltip } from '@gingkoo/pandora';
|
|
6
|
+
import { Tooltip, Button } from '@gingkoo/pandora';
|
|
10
7
|
import cx from 'classnames';
|
|
11
8
|
import { ColumnsPopupThemeEnum } from '../../../store/enum';
|
|
12
9
|
import { NUMBER_GROUP, DATE_GROUP } from '../const';
|
|
13
10
|
import { __ } from '../../../locale';
|
|
14
11
|
import { TableIcon, LeftArrowIcon } from '../../icons';
|
|
15
|
-
import
|
|
12
|
+
import FormulaList from '../formula-list';
|
|
13
|
+
import { AtomsTypeEnum } from '../../../store/types';
|
|
14
|
+
import { uuidv4 } from '../../../utils/helper';
|
|
16
15
|
var theme = ColumnsPopupThemeEnum.greenGrass;
|
|
17
|
-
var
|
|
16
|
+
var metricOptions = [{
|
|
18
17
|
name: '总行数',
|
|
19
18
|
tip: '总的数据行数'
|
|
20
19
|
}, {
|
|
@@ -83,20 +82,78 @@ var SelectSummarize = function SelectSummarize(_ref) {
|
|
|
83
82
|
_useState2 = _slicedToArray(_useState, 2),
|
|
84
83
|
condition = _useState2[0],
|
|
85
84
|
setCondition = _useState2[1];
|
|
85
|
+
var _useState3 = useState(function () {
|
|
86
|
+
if (Array.isArray(value.atoms) && value.atoms.length) {
|
|
87
|
+
return value.atoms;
|
|
88
|
+
}
|
|
89
|
+
if (value.name) {
|
|
90
|
+
var fieldAtom = {
|
|
91
|
+
fieldName: value.name,
|
|
92
|
+
fieldNameZh: value.name_zh || '',
|
|
93
|
+
fieldAlias: '',
|
|
94
|
+
fieldUuid: uuidv4('field'),
|
|
95
|
+
fieldId: value.id || '',
|
|
96
|
+
tableName: value.table || '',
|
|
97
|
+
tableNameZh: '',
|
|
98
|
+
tableId: value.tableId || '',
|
|
99
|
+
tableAlias: value.alias || '',
|
|
100
|
+
tableUuid: value.tableUuid || '',
|
|
101
|
+
datasourceName: value.datasourceName || '',
|
|
102
|
+
datasourceId: value.datasourceId || '',
|
|
103
|
+
type: AtomsTypeEnum.FIELD
|
|
104
|
+
};
|
|
105
|
+
return [fieldAtom];
|
|
106
|
+
}
|
|
107
|
+
return [];
|
|
108
|
+
}),
|
|
109
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
110
|
+
atoms = _useState4[0],
|
|
111
|
+
setAtoms = _useState4[1];
|
|
86
112
|
function goPrevPage() {
|
|
87
113
|
setCondition('');
|
|
88
114
|
}
|
|
115
|
+
function getFormulaSummary() {
|
|
116
|
+
var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
117
|
+
var itemToText = function itemToText(item) {
|
|
118
|
+
if (!item) return '';
|
|
119
|
+
if (item.quotes) return item.quotes;
|
|
120
|
+
if (item.fieldName) return item.fieldName;
|
|
121
|
+
if (item.type === AtomsTypeEnum.FORMULA) {
|
|
122
|
+
var argsText = (item.args || []).map(function (arg) {
|
|
123
|
+
return getFormulaSummary((arg === null || arg === void 0 ? void 0 : arg.list) || []);
|
|
124
|
+
}).filter(Boolean).join(', ');
|
|
125
|
+
return "".concat(item.name || '').concat(argsText ? "(".concat(argsText, ")") : '').trim();
|
|
126
|
+
}
|
|
127
|
+
if (item.type === AtomsTypeEnum.EXPRESSION) {
|
|
128
|
+
var lhs = getFormulaSummary(item.lhs || []);
|
|
129
|
+
var rhs = getFormulaSummary(item.rhs || []);
|
|
130
|
+
return [lhs, item.condition, rhs].filter(Boolean).join(' ').trim();
|
|
131
|
+
}
|
|
132
|
+
if (item.type === AtomsTypeEnum.AND_OR) {
|
|
133
|
+
return "".concat(item.operator || 'and', " ( ").concat(getFormulaSummary(item.list || []), " )").replace(/\s+/g, ' ').trim();
|
|
134
|
+
}
|
|
135
|
+
if (item.type === AtomsTypeEnum.CASE_WHEN) {
|
|
136
|
+
return item.quotes || 'case when';
|
|
137
|
+
}
|
|
138
|
+
if (Array.isArray(item.val)) return item.val.join(', ');
|
|
139
|
+
return item.val || '';
|
|
140
|
+
};
|
|
141
|
+
return list.map(function (item) {
|
|
142
|
+
return itemToText(item);
|
|
143
|
+
}).filter(Boolean).join(' ').replace(/\s+/g, ' ').trim();
|
|
144
|
+
}
|
|
89
145
|
function handleSelect(condition, record) {
|
|
90
|
-
var
|
|
146
|
+
var quotesPrefix = __(localeMap[QuotesMap.get(condition)]);
|
|
147
|
+
var formulaSummary = getFormulaSummary(record.atoms || atoms);
|
|
148
|
+
var quotes = [quotesPrefix, formulaSummary].filter(Boolean).join(' ').trim();
|
|
91
149
|
onChange(_objectSpread(_objectSpread({}, record), {}, {
|
|
92
150
|
condition: condition,
|
|
93
151
|
quotes: quotes
|
|
94
152
|
}));
|
|
95
153
|
}
|
|
96
|
-
|
|
154
|
+
function getAvailableData() {
|
|
97
155
|
var availableData = data.slice();
|
|
98
156
|
if (condition !== '不重复值的总数' && !ignoreGroupByType) {
|
|
99
|
-
// 只能用数字类型做聚合
|
|
100
157
|
availableData = data.map(function (v) {
|
|
101
158
|
return _objectSpread(_objectSpread({}, v), {}, {
|
|
102
159
|
columns: v.columns.filter(function (o) {
|
|
@@ -107,7 +164,11 @@ var SelectSummarize = function SelectSummarize(_ref) {
|
|
|
107
164
|
return v.columns.length;
|
|
108
165
|
});
|
|
109
166
|
}
|
|
167
|
+
return availableData;
|
|
168
|
+
}
|
|
169
|
+
if (condition && !~Special.indexOf(condition)) {
|
|
110
170
|
return _jsxs("div", {
|
|
171
|
+
className: 'Sqb-SelectSummarize-formula',
|
|
111
172
|
children: [_jsx("div", {
|
|
112
173
|
className: 'back-title',
|
|
113
174
|
children: _jsxs("div", {
|
|
@@ -116,14 +177,37 @@ var SelectSummarize = function SelectSummarize(_ref) {
|
|
|
116
177
|
children: [" ", __(localeMap[condition]), " "]
|
|
117
178
|
})]
|
|
118
179
|
})
|
|
119
|
-
}), _jsx(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
180
|
+
}), _jsx("div", {
|
|
181
|
+
className: 'Sqb-SelectSummarize-formula-body',
|
|
182
|
+
children: _jsx("div", {
|
|
183
|
+
className: 'Sqb-item',
|
|
184
|
+
children: _jsx("div", {
|
|
185
|
+
className: 'Sqb-item--content',
|
|
186
|
+
children: _jsx(FormulaList, {
|
|
187
|
+
value: atoms,
|
|
188
|
+
data: getAvailableData(),
|
|
189
|
+
exitData: getAvailableData(),
|
|
190
|
+
enableCopy: false,
|
|
191
|
+
parentPopupChannel: 'secondary',
|
|
192
|
+
onChange: function onChange(nextValue) {
|
|
193
|
+
setAtoms(nextValue);
|
|
194
|
+
didUpdate === null || didUpdate === void 0 || didUpdate();
|
|
195
|
+
}
|
|
196
|
+
})
|
|
197
|
+
})
|
|
198
|
+
})
|
|
199
|
+
}), _jsx("div", {
|
|
200
|
+
className: 'Sqb-SelectSummarize-formula-footer',
|
|
201
|
+
children: _jsx(Button, {
|
|
202
|
+
primary: true,
|
|
203
|
+
disabled: !atoms.length,
|
|
204
|
+
onClick: function onClick() {
|
|
205
|
+
handleSelect(condition, {
|
|
206
|
+
atoms: atoms
|
|
207
|
+
});
|
|
208
|
+
},
|
|
209
|
+
children: "\u786E\u5B9A"
|
|
210
|
+
})
|
|
127
211
|
})]
|
|
128
212
|
});
|
|
129
213
|
}
|
|
@@ -150,7 +234,7 @@ var SelectSummarize = function SelectSummarize(_ref) {
|
|
|
150
234
|
})]
|
|
151
235
|
})
|
|
152
236
|
})
|
|
153
|
-
}),
|
|
237
|
+
}), metricOptions.map(function (v, i) {
|
|
154
238
|
return _jsx("div", {
|
|
155
239
|
className: cx("Sqb-List-section"),
|
|
156
240
|
children: _jsx("div", {
|
|
@@ -161,6 +245,10 @@ var SelectSummarize = function SelectSummarize(_ref) {
|
|
|
161
245
|
if (~Special.indexOf(v.name)) {
|
|
162
246
|
handleSelect(v.name, {});
|
|
163
247
|
} else {
|
|
248
|
+
var _value$atoms;
|
|
249
|
+
if (!((_value$atoms = value.atoms) !== null && _value$atoms !== void 0 && _value$atoms.length) && !atoms.length) {
|
|
250
|
+
setAtoms([]);
|
|
251
|
+
}
|
|
164
252
|
setCondition(v.name);
|
|
165
253
|
}
|
|
166
254
|
},
|
|
@@ -151,3 +151,26 @@
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
+
|
|
155
|
+
.Sqb-SelectSummarize-formula {
|
|
156
|
+
width: min(760px, calc(100vw - 64px));
|
|
157
|
+
max-width: 100%;
|
|
158
|
+
background: #fff;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.Sqb-SelectSummarize-formula-body {
|
|
162
|
+
max-height: 420px;
|
|
163
|
+
overflow: auto;
|
|
164
|
+
padding: 16px 16px 8px;
|
|
165
|
+
|
|
166
|
+
.Sqb-item,
|
|
167
|
+
.Sqb-item--content {
|
|
168
|
+
width: 100%;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.Sqb-SelectSummarize-formula-footer {
|
|
173
|
+
display: flex;
|
|
174
|
+
justify-content: flex-end;
|
|
175
|
+
padding: 0 16px 16px;
|
|
176
|
+
}
|