@gingkoo/pandora-metabase 1.0.14 → 1.0.16

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.
Files changed (96) hide show
  1. package/lib/cjs/common/SplitView/index.js +11 -12
  2. package/lib/cjs/components/dialog/custom-column/expression-editor.js +1 -2
  3. package/lib/cjs/components/dialog/custom-column/expressions/suggest.js +1 -1
  4. package/lib/cjs/components/dialog/custom-column/tokenizedI-input.js +1 -2
  5. package/lib/cjs/components/dialog/{select-filter → expression}/index.d.ts +4 -4
  6. package/lib/cjs/components/dialog/{select-filter → expression}/index.js +345 -206
  7. package/lib/cjs/components/dialog/formula-list/enum.d.ts +9 -13
  8. package/lib/cjs/components/dialog/formula-list/enum.js +83 -39
  9. package/lib/cjs/components/dialog/formula-list/index.d.ts +4 -1
  10. package/lib/cjs/components/dialog/formula-list/index.js +110 -126
  11. package/lib/cjs/components/dialog/formula-list/utils.js +77 -46
  12. package/lib/cjs/components/dialog/index.d.ts +2 -2
  13. package/lib/cjs/components/dialog/index.js +20 -20
  14. package/lib/cjs/components/dialog/select-column/index.js +43 -12
  15. package/lib/cjs/components/dialog/select-column-multiple/index.d.ts +54 -0
  16. package/lib/cjs/components/dialog/select-column-multiple/index.js +341 -0
  17. package/lib/cjs/components/dialog/select-column-multiple/index.less +246 -0
  18. package/lib/cjs/components/dialog/select-table/index.js +9 -7
  19. package/lib/cjs/components/icons.js +36 -36
  20. package/lib/cjs/components/metabase/index.js +6 -6
  21. package/lib/cjs/components/metabase/index.less +12 -1
  22. package/lib/cjs/components/modules/components/Wrapper.js +6 -6
  23. package/lib/cjs/components/modules/custom-column.js +12 -14
  24. package/lib/cjs/components/modules/enum/filter-enum.d.ts +34 -0
  25. package/lib/cjs/components/modules/enum/filter-enum.js +137 -0
  26. package/lib/cjs/components/modules/filter.js +43 -460
  27. package/lib/cjs/components/modules/join-data.js +863 -525
  28. package/lib/cjs/components/modules/permission-table.js +4 -0
  29. package/lib/cjs/components/modules/sort.js +102 -91
  30. package/lib/cjs/components/modules/summarize/group-by.js +47 -16
  31. package/lib/cjs/components/modules/summarize/select-index.js +48 -17
  32. package/lib/cjs/components/modules/table-data.js +13 -4
  33. package/lib/cjs/components/popup.js +1 -2
  34. package/lib/cjs/hooks/patch.d.ts +4 -0
  35. package/lib/cjs/hooks/patch.js +464 -0
  36. package/lib/cjs/hooks/use-state.js +73 -138
  37. package/lib/cjs/index.d.ts +0 -1
  38. package/lib/cjs/index.js +3 -21
  39. package/lib/cjs/locale/en.js +9 -2
  40. package/lib/cjs/locale/zh.js +11 -4
  41. package/lib/cjs/store/helper.d.ts +2 -3
  42. package/lib/cjs/store/helper.js +288 -233
  43. package/lib/cjs/store/types.d.ts +94 -71
  44. package/lib/cjs/store/types.js +17 -12
  45. package/lib/cjs/utils.d.ts +3 -3
  46. package/lib/cjs/utils.js +152 -187
  47. package/lib/es/common/SplitView/index.js +10 -10
  48. package/lib/es/components/dialog/custom-column/expressions/suggest.js +1 -1
  49. package/lib/es/components/dialog/{select-filter → expression}/index.d.ts +4 -4
  50. package/lib/es/components/dialog/{select-filter → expression}/index.js +343 -206
  51. package/lib/es/components/dialog/formula-list/enum.d.ts +9 -13
  52. package/lib/es/components/dialog/formula-list/enum.js +82 -38
  53. package/lib/es/components/dialog/formula-list/index.d.ts +4 -1
  54. package/lib/es/components/dialog/formula-list/index.js +115 -131
  55. package/lib/es/components/dialog/formula-list/utils.js +77 -46
  56. package/lib/es/components/dialog/index.d.ts +2 -2
  57. package/lib/es/components/dialog/index.js +3 -3
  58. package/lib/es/components/dialog/select-column/index.js +44 -13
  59. package/lib/es/components/dialog/select-column-multiple/index.d.ts +54 -0
  60. package/lib/es/components/dialog/select-column-multiple/index.js +335 -0
  61. package/lib/es/components/dialog/select-column-multiple/index.less +246 -0
  62. package/lib/es/components/dialog/select-table/index.js +9 -7
  63. package/lib/es/components/icons.js +36 -36
  64. package/lib/es/components/metabase/index.js +6 -6
  65. package/lib/es/components/metabase/index.less +12 -1
  66. package/lib/es/components/modules/components/Wrapper.js +6 -6
  67. package/lib/es/components/modules/custom-column.js +12 -14
  68. package/lib/es/components/modules/enum/filter-enum.d.ts +34 -0
  69. package/lib/es/components/modules/enum/filter-enum.js +131 -0
  70. package/lib/es/components/modules/filter.js +45 -463
  71. package/lib/es/components/modules/join-data.js +865 -527
  72. package/lib/es/components/modules/permission-table.js +4 -0
  73. package/lib/es/components/modules/sort.js +102 -91
  74. package/lib/es/components/modules/summarize/group-by.js +48 -17
  75. package/lib/es/components/modules/summarize/select-index.js +49 -18
  76. package/lib/es/components/modules/table-data.js +13 -4
  77. package/lib/es/hooks/patch.d.ts +4 -0
  78. package/lib/es/hooks/patch.js +457 -0
  79. package/lib/es/hooks/use-state.js +73 -138
  80. package/lib/es/index.d.ts +0 -1
  81. package/lib/es/index.js +1 -1
  82. package/lib/es/locale/en.js +9 -2
  83. package/lib/es/locale/zh.js +11 -4
  84. package/lib/es/store/helper.d.ts +2 -3
  85. package/lib/es/store/helper.js +288 -233
  86. package/lib/es/store/types.d.ts +94 -71
  87. package/lib/es/store/types.js +16 -11
  88. package/lib/es/utils.d.ts +3 -3
  89. package/lib/es/utils.js +154 -190
  90. package/package.json +1 -1
  91. package/lib/cjs/components/modules/filter copy.d.ts +0 -7
  92. package/lib/cjs/components/modules/filter copy.js +0 -178
  93. package/lib/es/components/modules/filter copy.d.ts +0 -7
  94. package/lib/es/components/modules/filter copy.js +0 -171
  95. /package/lib/cjs/components/dialog/{select-filter → expression}/index.less +0 -0
  96. /package/lib/es/components/dialog/{select-filter → expression}/index.less +0 -0
@@ -6,7 +6,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
6
  * 关联模块 选择表字段
7
7
  */
8
8
  import './index.less';
9
- import { useEffect, useMemo, useState } from 'react';
9
+ import React, { useEffect, useMemo, useState } from 'react';
10
10
  import { Repeat, Function } from '@gingkoo/pandora-icons';
11
11
  import { Button, Tooltip, Input, Select, InputNumber, Dropdown, DatePicker } from '@gingkoo/pandora';
12
12
  import cx from 'classnames';
@@ -14,10 +14,10 @@ import { ChevronODown } from '@gingkoo/pandora-icons';
14
14
  import moment from 'dayjs';
15
15
  import { __, isEn } from '../../../locale';
16
16
  import { ColumnsPopupThemeEnum, SQL_COLUMN_TYPE, SQL_GROUP_TYPE } from '../../../store/enum';
17
- import { SummarizeAlias } from '../../../store/helper';
17
+ import { AtomsTypeEnum } from '../../../store/types';
18
18
  import { NUMBER_GROUP, DATE_GROUP } from '../const';
19
19
  import SelectList from '../select-list';
20
- import { SelectJoinColumn } from '../index';
20
+ import SelectColumnMultiple from '../select-column-multiple';
21
21
  import { LeftArrowIcon } from '../../icons';
22
22
  import { useStore } from '../../../hooks/use-provider';
23
23
  var RangePicker = DatePicker.RangePicker;
@@ -33,7 +33,7 @@ var typeList = [{
33
33
  label: SQL_COLUMN_TYPE.STRING
34
34
  }, {
35
35
  key: SQL_COLUMN_TYPE.FLOAT,
36
- label: SQL_COLUMN_TYPE.FLOAT
36
+ label: 'NUMBER'
37
37
  }, {
38
38
  key: SQL_COLUMN_TYPE.DATE,
39
39
  label: SQL_COLUMN_TYPE.DATE
@@ -45,7 +45,7 @@ var typeList = [{
45
45
  // };
46
46
  // });
47
47
  var SelectFilterColumn = function SelectFilterColumn(_ref) {
48
- var _curColumn$table;
48
+ var _value$lhs;
49
49
  var _ref$data = _ref.data,
50
50
  data = _ref$data === void 0 ? [] : _ref$data,
51
51
  value = _ref.value,
@@ -61,67 +61,95 @@ var SelectFilterColumn = function SelectFilterColumn(_ref) {
61
61
  _useState2 = _slicedToArray(_useState, 2),
62
62
  curColumn = _useState2[0],
63
63
  setCurColumn = _useState2[1];
64
- var _useState3 = useState(value.condition),
64
+ var _useState3 = useState(value.condition || ''),
65
65
  _useState4 = _slicedToArray(_useState3, 2),
66
66
  condition = _useState4[0],
67
67
  setCondition = _useState4[1];
68
- var _useState5 = useState(value.valType || 'string'),
68
+ var _useState5 = useState(value.rhs || []),
69
69
  _useState6 = _slicedToArray(_useState5, 2),
70
- valType = _useState6[0],
71
- setValType = _useState6[1];
72
- var _useState7 = useState(value.val),
70
+ rhsVal = _useState6[0],
71
+ setRhsVal = _useState6[1];
72
+ // const [valType, setValType] = useState<'string' | 'constant' | 'field' | ''>(
73
+ // value.valType || 'string',
74
+ // );
75
+ // const [constantName, setConstantName] = useState<string>(value.constantName || '');
76
+ var _useState7 = useState((value === null || value === void 0 ? void 0 : value.database_type) || SQL_COLUMN_TYPE.STRING),
73
77
  _useState8 = _slicedToArray(_useState7, 2),
74
- curVal = _useState8[0],
75
- setVal = _useState8[1];
76
- var _useState9 = useState(value.constantName || ''),
77
- _useState10 = _slicedToArray(_useState9, 2),
78
- constantName = _useState10[0],
79
- setConstantName = _useState10[1];
80
- var _useState11 = useState(value.database_type || SQL_COLUMN_TYPE.STRING),
81
- _useState12 = _slicedToArray(_useState11, 2),
82
- special_type = _useState12[0],
83
- setSpecial_type = _useState12[1];
84
- var _useState13 = useState(value.formula || {}),
85
- _useState14 = _slicedToArray(_useState13, 2),
86
- formula = _useState14[0],
87
- setFormula = _useState14[1];
78
+ special_type = _useState8[0],
79
+ setSpecial_type = _useState8[1];
80
+ var _useState9 = useState(value.formula || {}),
81
+ _useState0 = _slicedToArray(_useState9, 2),
82
+ formula = _useState0[0],
83
+ setFormula = _useState0[1];
88
84
  var store = useStore();
89
- var _useState15 = useState(false),
90
- _useState16 = _slicedToArray(_useState15, 2),
91
- popupVisible = _useState16[0],
92
- setPopupVisible = _useState16[1];
93
- var table2Selected = Boolean((_curColumn$table = curColumn.table2) === null || _curColumn$table === void 0 ? void 0 : _curColumn$table.name);
85
+ var _useState1 = useState(false),
86
+ _useState10 = _slicedToArray(_useState1, 2),
87
+ popupVisible = _useState10[0],
88
+ setPopupVisible = _useState10[1];
89
+ var _useState11 = useState((value === null || value === void 0 || (_value$lhs = value.lhs) === null || _value$lhs === void 0 ? void 0 : _value$lhs.length) > 0 || false),
90
+ _useState12 = _slicedToArray(_useState11, 2),
91
+ isNext = _useState12[0],
92
+ setIsNext = _useState12[1];
93
+ var table2Selected = Boolean(rhsVal && (rhsVal === null || rhsVal === void 0 ? void 0 : rhsVal.length) > 0);
94
94
  var disabled = useMemo(function () {
95
- var _curColumn$table2;
96
95
  if (!condition) return true;
97
96
  if (~['无需结果'].indexOf(condition)) {
98
97
  return false;
99
98
  }
100
- if ((_curColumn$table2 = curColumn.table2) !== null && _curColumn$table2 !== void 0 && _curColumn$table2.id && ~['等于', '不等于', '早于', '晚于'].indexOf(condition)) {
101
- return false;
102
- }
103
99
  if (~['为空', '不为空', '是空的', '不是空的'].indexOf(condition)) {
104
100
  return false;
105
- } else if (~['前', '下一个', '介于之间'].indexOf(condition)) {
106
- if (curVal[0] && curVal[1]) {
107
- return false;
108
- }
109
- } else if (curVal.length && curVal.join(',')) {
110
- return false;
111
101
  }
102
+ var isOk = rhsVal.every(function (v) {
103
+ if (v.type === AtomsTypeEnum.INPUT_STRING || v.type === AtomsTypeEnum.CONSTANT) {
104
+ return v.val;
105
+ }
106
+ if (v.type === AtomsTypeEnum.INPUT_STRING_LIST) {
107
+ return v.val.every(function (vv) {
108
+ return vv;
109
+ });
110
+ }
111
+ if (v.type === AtomsTypeEnum.FIELD) {
112
+ return v.fieldName;
113
+ }
114
+ });
115
+ return !isOk;
116
+ // console.log('🚀 ~ disabled ~ a:', a);
117
+ // if ((rhsVal[0] as AtomsString).val && ~['等于', '不等于', '早于', '晚于'].indexOf(condition)) {
118
+ // return false;
119
+ // }
120
+ // if (~['为空', '不为空', '是空的', '不是空的'].indexOf(condition)) {
121
+ // return false;
122
+ // }
123
+ // else if (~['前', '下一个', '介于之间'].indexOf(condition)) {
124
+ // if ((rhsVal[0] as AtomsStringList).val[0] && (rhsVal[0] as AtomsStringList).val[1]) {
125
+ // return false;
126
+ // }
127
+ // } else if (rhsVal.length && (rhsVal as AtomsString[]).map((v) => v.val).join(',')) {
128
+ // return false;
129
+ // }
112
130
  return true;
113
- }, [curVal, condition, curColumn, isCustom]);
131
+ }, [rhsVal, condition, curColumn]);
114
132
  useEffect(function () {
115
133
  didUpdate === null || didUpdate === void 0 || didUpdate();
116
134
  }, [condition]);
117
- var getQuotesName = function getQuotesName(name) {
135
+ var getAtomsQuotesName = function getAtomsQuotesName(items) {
136
+ var names = items.map(function (v) {
137
+ if ((v === null || v === void 0 ? void 0 : v.type) === AtomsTypeEnum.FIELD) {
138
+ return v.fieldName;
139
+ } else {
140
+ return v.val;
141
+ }
142
+ });
143
+ return names.join(' || ');
144
+ };
145
+ var getQuotesName = function getQuotesName(items) {
118
146
  var _formula$params, _formula$params2;
147
+ var names = getAtomsQuotesName(items);
119
148
  switch (formula.type) {
120
149
  case 'SUBSTR':
121
- // let str = formula.params?.join(',');
122
- return "SUBSTR(".concat(name, ",").concat(formula === null || formula === void 0 || (_formula$params = formula.params) === null || _formula$params === void 0 ? void 0 : _formula$params[1], ",").concat(formula === null || formula === void 0 || (_formula$params2 = formula.params) === null || _formula$params2 === void 0 ? void 0 : _formula$params2[2], ")");
150
+ return "SUBSTR(".concat(names, ",").concat(formula === null || formula === void 0 || (_formula$params = formula.params) === null || _formula$params === void 0 ? void 0 : _formula$params[1], ",").concat(formula === null || formula === void 0 || (_formula$params2 = formula.params) === null || _formula$params2 === void 0 ? void 0 : _formula$params2[2], ")");
123
151
  default:
124
- return name;
152
+ return names;
125
153
  }
126
154
  };
127
155
  var getText = function getText(v) {
@@ -151,151 +179,147 @@ var SelectFilterColumn = function SelectFilterColumn(_ref) {
151
179
  }[v];
152
180
  };
153
181
  function generateQuotes(val, curColumn) {
154
- var _val = _slicedToArray(val, 2),
155
- _val$ = _val[0],
156
- firstVal = _val$ === void 0 ? '' : _val$,
157
- _val$2 = _val[1],
158
- secondVal = _val$2 === void 0 ? '' : _val$2;
182
+ var _val = val[0];
183
+ var firstVal = '',
184
+ secondVal = '';
185
+ if (_val.type === AtomsTypeEnum.INPUT_STRING) {
186
+ firstVal = _val.val;
187
+ }
188
+ if (_val.type === AtomsTypeEnum.INPUT_STRING_LIST) {
189
+ firstVal = _val.val[0] || '';
190
+ secondVal = _val.val[1] || '';
191
+ }
192
+ // let [first = { val: '', type: AtomsTypeEnum.INPUT }] = val as AtomsString[];
193
+ // let firstVal = first.val || '';
194
+ // let secondVal = second.val || '';
159
195
  var quotes = '';
160
196
  if (condition === '以...开始') {
161
197
  if (isEn) {
162
- quotes = getQuotesName(curColumn.name) + ' ' + "startWith ".concat(firstVal);
198
+ quotes = getQuotesName(curColumn.lhs) + ' ' + "startWith ".concat(firstVal);
163
199
  } else {
164
- quotes = getQuotesName(curColumn.name) + ' ' + "\u4EE5 ".concat(firstVal, " \u5F00\u59CB");
200
+ quotes = getQuotesName(curColumn.lhs) + ' ' + "\u4EE5 ".concat(firstVal, " \u5F00\u59CB");
165
201
  }
166
202
  } else if (condition === '不以...开始') {
167
203
  if (isEn) {
168
- quotes = getQuotesName(curColumn.name) + ' ' + "not startWith ".concat(firstVal);
204
+ quotes = getQuotesName(curColumn.lhs) + ' ' + "not startWith ".concat(firstVal);
169
205
  } else {
170
- quotes = getQuotesName(curColumn.name) + ' ' + "\u4E0D\u4EE5 ".concat(firstVal, " \u5F00\u59CB");
206
+ quotes = getQuotesName(curColumn.lhs) + ' ' + "\u4E0D\u4EE5 ".concat(firstVal, " \u5F00\u59CB");
171
207
  }
172
208
  } else if (condition === '以...结束') {
173
209
  if (isEn) {
174
- quotes = getQuotesName(curColumn.name) + ' ' + "endWith ".concat(firstVal);
210
+ quotes = getQuotesName(curColumn.lhs) + ' ' + "endWith ".concat(firstVal);
175
211
  } else {
176
- quotes = getQuotesName(curColumn.name) + ' ' + "\u4EE5 ".concat(firstVal, " \u7ED3\u675F");
212
+ quotes = getQuotesName(curColumn.lhs) + ' ' + "\u4EE5 ".concat(firstVal, " \u7ED3\u675F");
177
213
  }
178
214
  } else if (condition === '不以...结束') {
179
215
  if (isEn) {
180
- quotes = getQuotesName(curColumn.name) + ' ' + "not endWith ".concat(firstVal);
216
+ quotes = getQuotesName(curColumn.lhs) + ' ' + "not endWith ".concat(firstVal);
181
217
  } else {
182
- quotes = getQuotesName(curColumn.name) + ' ' + "\u4E0D\u4EE5 ".concat(firstVal, " \u7ED3\u675F");
218
+ quotes = getQuotesName(curColumn.lhs) + ' ' + "\u4E0D\u4EE5 ".concat(firstVal, " \u7ED3\u675F");
183
219
  }
184
220
  } else if (condition === '介于之间') {
185
221
  if (isEn) {
186
- quotes = getQuotesName(curColumn.name) + ' ' + "Between ".concat(firstVal, " and ").concat(secondVal);
222
+ quotes = getQuotesName(curColumn.lhs) + ' ' + "Between ".concat(firstVal, " and ").concat(secondVal);
187
223
  } else {
188
- quotes = getQuotesName(curColumn.name) + ' ' + "\u4ECB\u4E8E".concat(firstVal, "\u548C").concat(secondVal, "\u4E4B\u95F4");
224
+ quotes = getQuotesName(curColumn.lhs) + ' ' + "\u4ECB\u4E8E".concat(firstVal, "\u548C").concat(secondVal, "\u4E4B\u95F4");
189
225
  }
190
226
  } else if (condition === '前') {
191
227
  if (isEn) {
192
- quotes = getQuotesName(curColumn.name) + ' ' + "previous ".concat(firstVal).concat(secondVal);
228
+ quotes = getQuotesName(curColumn.lhs) + ' ' + "previous ".concat(firstVal).concat(secondVal);
193
229
  } else {
194
- quotes = getQuotesName(curColumn.name) + ' ' + "\u4E0A\u4E00\u4E2A".concat(firstVal).concat(secondVal);
230
+ quotes = getQuotesName(curColumn.lhs) + ' ' + "\u4E0A\u4E00\u4E2A".concat(firstVal).concat(secondVal);
195
231
  }
196
232
  } else if (condition === '下一个') {
197
233
  if (isEn) {
198
- quotes = getQuotesName(curColumn.name) + ' ' + "next ".concat(firstVal).concat(secondVal);
234
+ quotes = getQuotesName(curColumn.lhs) + ' ' + "next ".concat(firstVal).concat(secondVal);
199
235
  } else {
200
- quotes = getQuotesName(curColumn.name) + ' ' + "\u4E0B\u4E00\u4E2A".concat(firstVal).concat(secondVal);
236
+ quotes = getQuotesName(curColumn.lhs) + ' ' + "\u4E0B\u4E00\u4E2A".concat(firstVal).concat(secondVal);
201
237
  }
202
238
  } else if (condition === '在') {
203
239
  if (isEn) {
204
- quotes = getQuotesName(curColumn.name) + ' is ' + firstVal;
240
+ quotes = getQuotesName(curColumn.lhs) + ' is ' + firstVal;
205
241
  } else {
206
- quotes = getQuotesName(curColumn.name) + ' 是 ' + firstVal;
242
+ quotes = getQuotesName(curColumn.lhs) + ' 是 ' + firstVal;
207
243
  }
208
244
  } else if (condition === '是空的') {
209
245
  if (isEn) {
210
- quotes = getQuotesName(curColumn.name) + ' is empty';
246
+ quotes = getQuotesName(curColumn.lhs) + ' is empty';
211
247
  } else {
212
- quotes = getQuotesName(curColumn.name) + ' 为空';
248
+ quotes = getQuotesName(curColumn.lhs) + ' 为空';
213
249
  }
214
250
  } else if (condition === '不是空的') {
215
251
  if (isEn) {
216
- quotes = getQuotesName(curColumn.name) + ' not empty';
252
+ quotes = getQuotesName(curColumn.lhs) + ' not empty';
217
253
  } else {
218
- quotes = getQuotesName(curColumn.name) + ' 不为空';
254
+ quotes = getQuotesName(curColumn.lhs) + ' 不为空';
219
255
  }
220
256
  } else if (condition === '当前') {
221
257
  if (firstVal === '天') {
222
258
  if (isEn) {
223
- quotes = getQuotesName(curColumn.name) + ' ' + "today";
259
+ quotes = getQuotesName(curColumn.lhs) + ' ' + "today";
224
260
  } else {
225
- quotes = getQuotesName(curColumn.name) + ' ' + "\u4ECA\u5929";
261
+ quotes = getQuotesName(curColumn.lhs) + ' ' + "\u4ECA\u5929";
226
262
  }
227
263
  } else {
228
264
  if (isEn) {
229
- quotes = getQuotesName(curColumn.name) + ' ' + "this is ".concat(firstVal);
265
+ quotes = getQuotesName(curColumn.lhs) + ' ' + "this is ".concat(firstVal);
230
266
  } else {
231
- quotes = getQuotesName(curColumn.name) + ' ' + "\u8FD9\u4E2A".concat(firstVal);
267
+ quotes = getQuotesName(curColumn.lhs) + ' ' + "\u8FD9\u4E2A".concat(firstVal);
232
268
  }
233
269
  }
234
270
  } else if (condition === 'In') {
235
271
  var cond = __('filter.within');
236
- quotes = getQuotesName(curColumn.name) + ' ' + cond + ' ' + "(".concat(firstVal, ")");
272
+ quotes = getQuotesName(curColumn.lhs) + ' ' + cond + ' ' + "(".concat(firstVal, ")");
237
273
  } else if (condition === 'Not In') {
238
274
  var _cond = __('filter.withnotin');
239
- quotes = getQuotesName(curColumn.name) + ' ' + _cond + ' ' + "(".concat(firstVal, ")");
275
+ quotes = getQuotesName(curColumn.lhs) + ' ' + _cond + ' ' + "(".concat(firstVal, ")");
240
276
  } else {
241
- var _curColumn$table3;
242
277
  var _cond2 = __(getText(condition));
243
- if ((_curColumn$table3 = curColumn.table2) !== null && _curColumn$table3 !== void 0 && _curColumn$table3.id) {
244
- quotes = getQuotesName(curColumn.name) + ' ' + _cond2 + ' ' + curColumn.table2.name;
278
+ if (rhsVal !== null && rhsVal !== void 0 && rhsVal.length) {
279
+ quotes = getQuotesName(curColumn.lhs) + ' ' + _cond2 + ' ' + getQuotesName(rhsVal);
245
280
  } else {
246
- quotes = getQuotesName(curColumn.name) + ' ' + _cond2 + ' ' + firstVal;
281
+ quotes = getQuotesName(curColumn.lhs) + ' ' + _cond2 + ' ' + firstVal;
247
282
  }
248
283
  }
249
284
  return quotes;
250
285
  }
251
286
  function addFilter() {
252
287
  if (disabled) return void 0;
253
- var quotes = generateQuotes(curVal, curColumn);
288
+ var quotes = generateQuotes(rhsVal, curColumn);
254
289
  typeof onChange === 'function' && onChange(_objectSpread(_objectSpread({}, curColumn), {}, {
255
290
  formula: formula,
256
- val: curVal,
257
- // 选择结果 如果有两个 长度就为2
258
- constantName: constantName,
259
- //变量字段
260
- valType: valType,
261
- //是否是选择字段
291
+ rhs: rhsVal,
262
292
  condition: condition,
263
293
  // 选择条件
264
294
  quotes: quotes,
265
295
  // 前端显示用户看的文字
266
- database_type: filterCustomType ? special_type : '',
267
- // 自定义类型
268
- groupSql: curColumn.alias === SummarizeAlias ? curColumn.sql : ''
296
+ database_type: filterCustomType ? special_type : '' // 自定义类型
297
+ // groupSql: curColumn.alias === SummarizeAlias ? curColumn.sql : '',
269
298
  }));
270
299
  }
271
300
  function goPrevPage() {
272
- setCurColumn({
273
- table: '',
274
- // 表名
275
- tableId: '',
276
- // 表名
277
- tableUuid: '',
278
- // 表名
279
- fieldAlias: '',
280
- fieldUuid: '',
281
- alias: '',
282
- // 表的别名
283
- name: '',
284
- // 字段名
285
- id: '',
286
- // 字段名
287
- sql: '',
288
- datasourceId: '',
289
- datasourceName: '',
290
- database_type: '' // 字段类型
291
- });
292
- setCondition('');
293
- setFormula({});
294
- setVal([]);
301
+ // setCurColumn({
302
+ // lhs: [],
303
+ // rhs: [],
304
+ // database_type: '', // 字段类型
305
+ // condition: '', // 条件 聚合by过来的会有这个
306
+ // quotes: '', // 展示用户看的 组装的文字
307
+ // type: AtomsTypeEnum.EXPRESSION, // 连接类型
308
+ // });
309
+ setIsNext(false);
310
+ // setCondition('');
311
+ // setFormula({});
312
+ // setRhsVal([
313
+ // {
314
+ // val: '',
315
+ // type: AtomsTypeEnum.INPUT,
316
+ // },
317
+ // ]);
295
318
  }
296
319
  function getData(data) {
297
- var database_type = data.database_type;
298
- var columnType = filterCustomType ? special_type : database_type.toUpperCase();
320
+ var _data$database_type = data.database_type,
321
+ database_type = _data$database_type === void 0 ? '' : _data$database_type;
322
+ var columnType = filterCustomType ? special_type : database_type === null || database_type === void 0 ? void 0 : database_type.toUpperCase();
299
323
  var conditions = STRING_LIST;
300
324
  var type = SQL_GROUP_TYPE.STRING;
301
325
  if (NUMBER_GROUP.includes(columnType)) {
@@ -318,9 +342,16 @@ var SelectFilterColumn = function SelectFilterColumn(_ref) {
318
342
  };
319
343
  }
320
344
  function renderFilter(type, conditionText) {
321
- var _curVal = _slicedToArray(curVal, 2),
322
- firstVal = _curVal[0],
323
- secondVal = _curVal[1];
345
+ var _val = rhsVal[0];
346
+ var firstVal = '',
347
+ secondVal = '';
348
+ if (_val.type === AtomsTypeEnum.INPUT_STRING) {
349
+ firstVal = _val.val;
350
+ }
351
+ if (_val.type === AtomsTypeEnum.INPUT_STRING_LIST) {
352
+ firstVal = _val.val[0] || '';
353
+ secondVal = _val.val[1] || '';
354
+ }
324
355
  if (~['为空', '不为空', '是空的', '不是空的'].indexOf(conditionText)) {
325
356
  return null;
326
357
  } else if (conditionText === '介于之间') {
@@ -335,18 +366,18 @@ var SelectFilterColumn = function SelectFilterColumn(_ref) {
335
366
  placeholder: __('filter.enterANumber'),
336
367
  value: firstVal || '',
337
368
  onInput: function onInput(e) {
338
- var newVal = curVal.slice();
339
- newVal[0] = e.target.value;
340
- setVal(newVal);
369
+ var newVal = rhsVal.slice();
370
+ newVal[0].val[0] = e.target.value;
371
+ setRhsVal(newVal);
341
372
  }
342
373
  }), _jsx(Input, {
343
374
  className: 'input',
344
375
  placeholder: __('filter.enterANumber'),
345
376
  value: secondVal || '',
346
377
  onInput: function onInput(e) {
347
- var newVal = curVal.slice();
348
- newVal[1] = e.target.value;
349
- setVal(newVal);
378
+ var newVal = rhsVal.slice();
379
+ newVal[0].val[1] = e.target.value;
380
+ setRhsVal(newVal);
350
381
  }
351
382
  })]
352
383
  });
@@ -363,7 +394,10 @@ var SelectFilterColumn = function SelectFilterColumn(_ref) {
363
394
  value: firstVal ? [moment(firstVal !== null && firstVal !== void 0 ? firstVal : undefined), moment(secondVal !== null && secondVal !== void 0 ? secondVal : undefined)] : [],
364
395
  onChange: function onChange(val) {
365
396
  // @ts-ignore
366
- val && setVal([moment(val[0]).format('YYYY-MM-DD HH:mm'), moment(val[1]).format('YYYY-MM-DD HH:mm')]);
397
+ val && setRhsVal([{
398
+ type: AtomsTypeEnum.INPUT_STRING_LIST,
399
+ val: [moment(val[0]).format('YYYY-MM-DD HH:mm'), moment(val[1]).format('YYYY-MM-DD HH:mm')]
400
+ }]);
367
401
  }
368
402
  })
369
403
  });
@@ -373,7 +407,10 @@ var SelectFilterColumn = function SelectFilterColumn(_ref) {
373
407
  children: _jsx(Dropdown, {
374
408
  trigger: ['click'],
375
409
  onChange: function onChange(key) {
376
- setVal([key]);
410
+ setRhsVal([{
411
+ type: AtomsTypeEnum.INPUT_STRING,
412
+ val: key
413
+ }]);
377
414
  },
378
415
  droplist: [{
379
416
  key: '天',
@@ -405,9 +442,10 @@ var SelectFilterColumn = function SelectFilterColumn(_ref) {
405
442
  placeholder: __('filter.enterANumber'),
406
443
  value: firstVal || '',
407
444
  onInput: function onInput(e) {
408
- var newVal = curVal.slice();
409
- newVal[0] = e.target.value;
410
- setVal(newVal);
445
+ var newVal = rhsVal.slice();
446
+ // (newVal as AtomsStringList[])[0].val[0] = e.target.value;
447
+ newVal[0].val = e.target.value;
448
+ setRhsVal(newVal);
411
449
  }
412
450
  }), _jsx(Dropdown, {
413
451
  trigger: ['click'],
@@ -431,9 +469,10 @@ var SelectFilterColumn = function SelectFilterColumn(_ref) {
431
469
  label: __('filter.year')
432
470
  }],
433
471
  onChange: function onChange(key) {
434
- var newVal = curVal.slice();
435
- newVal[1] = key;
436
- setVal(newVal);
472
+ var newVal = rhsVal.slice();
473
+ newVal[1].val = key;
474
+ // (newVal as AtomsStringList[])[0].val[1] = key;
475
+ setRhsVal(newVal);
437
476
  },
438
477
  children: _jsxs(Button, {
439
478
  className: 'operator-btn',
@@ -455,9 +494,19 @@ var SelectFilterColumn = function SelectFilterColumn(_ref) {
455
494
  value: firstVal ? moment(firstVal) : '',
456
495
  onChange: function onChange(val) {
457
496
  if (val) {
458
- setVal([moment(val).format('YYYY-MM-DD HH:mm')]);
497
+ setRhsVal([{
498
+ type: AtomsTypeEnum.INPUT_STRING,
499
+ val: moment(val).format('YYYY-MM-DD HH:mm')
500
+ }, {
501
+ type: AtomsTypeEnum.INPUT_STRING,
502
+ val: moment(val).format('YYYY-MM-DD HH:mm')
503
+ }]);
459
504
  } else {
460
- setVal([]);
505
+ setRhsVal([{
506
+ val: '',
507
+ type: AtomsTypeEnum.INPUT_STRING
508
+ }]);
509
+ // setVal([]);
461
510
  }
462
511
  }
463
512
  })
@@ -473,9 +522,15 @@ var SelectFilterColumn = function SelectFilterColumn(_ref) {
473
522
  value: firstVal ? moment(firstVal) : '',
474
523
  onChange: function onChange(val) {
475
524
  if (val) {
476
- setVal([moment(val).format('YYYY-MM-DD HH:mm')]);
525
+ setRhsVal([{
526
+ type: AtomsTypeEnum.INPUT_STRING,
527
+ val: moment(val).format('YYYY-MM-DD HH:mm')
528
+ }]);
477
529
  } else {
478
- setVal([]);
530
+ setRhsVal([{
531
+ val: '',
532
+ type: AtomsTypeEnum.INPUT_STRING
533
+ }]);
479
534
  }
480
535
  }
481
536
  })
@@ -490,7 +545,10 @@ var SelectFilterColumn = function SelectFilterColumn(_ref) {
490
545
  multiple: true,
491
546
  value: options,
492
547
  onChange: function onChange(val) {
493
- setVal([val.join(',')]);
548
+ setRhsVal([{
549
+ type: AtomsTypeEnum.INPUT_STRING,
550
+ val: val.join(',')
551
+ }]);
494
552
  },
495
553
  popupVisible: popupVisible,
496
554
  onBlur: function onBlur() {
@@ -514,9 +572,9 @@ var SelectFilterColumn = function SelectFilterColumn(_ref) {
514
572
  placeholder: __('filter.pleaseEnter'),
515
573
  value: firstVal || '',
516
574
  onInput: function onInput(e) {
517
- var newVal = curVal.slice();
518
- newVal[0] = e.target.value;
519
- setVal(newVal);
575
+ var newVal = rhsVal.slice();
576
+ newVal[0].val = e.target.value;
577
+ setRhsVal(newVal);
520
578
  }
521
579
  })
522
580
  });
@@ -531,25 +589,22 @@ var SelectFilterColumn = function SelectFilterColumn(_ref) {
531
589
  // 选择变量
532
590
  var selectConstant = function selectConstant(e) {
533
591
  store.setClosable(false);
592
+ var node = e.currentTarget;
593
+ var _type = Number(node.getAttribute('v-type'));
534
594
  store.setPopup2({
535
595
  visible: true,
536
596
  node: e.currentTarget,
537
597
  container: container,
538
598
  content: _jsx(SelectList, {
539
- value: valType,
599
+ value: _type,
540
600
  list: store.constantList || [],
541
601
  onChange: function onChange(val) {
542
602
  closePopup2();
543
- var curObj = store.constantList.filter(function (v) {
544
- return v.value === val;
545
- })[0];
546
- var newVal = curVal.slice();
547
- newVal[0] = val;
548
- setVal(newVal);
549
- setConstantName(curObj.label);
603
+ // let curObj = store.constantList.filter((v: any) => v.value === val)[0];
604
+ var newVal = rhsVal.slice();
605
+ newVal[0].val = val;
606
+ setRhsVal(newVal);
550
607
  store.setClosable(true);
551
- // (newMeta[index] as MetaJoin).expressions[_ind][`${position}_type`] = type;
552
- // store.setMeta(newMeta, groupIndex);
553
608
  }
554
609
  })
555
610
  });
@@ -561,48 +616,85 @@ var SelectFilterColumn = function SelectFilterColumn(_ref) {
561
616
  node: e.currentTarget,
562
617
  container: container,
563
618
  content: _jsx(SelectList, {
564
- value: valType,
619
+ value: '',
565
620
  list: [{
566
- value: 'string',
621
+ value: AtomsTypeEnum.INPUT_STRING,
567
622
  label: __('SqlQueryBuilder.input')
568
623
  }, {
569
- value: 'constant',
624
+ value: AtomsTypeEnum.CONSTANT,
570
625
  label: __('customColumn.constant')
571
626
  }, {
572
- value: 'field',
627
+ value: AtomsTypeEnum.FIELD,
573
628
  label: __('SqlQueryBuilder.columns')
574
629
  }],
575
630
  onChange: function onChange(type) {
576
631
  closePopup2();
577
- setConstantName('');
578
- setValType(type);
579
- setVal([]);
580
- setCurColumn(_objectSpread(_objectSpread({}, curColumn), {}, {
581
- table2: null
582
- }));
632
+ if (type === AtomsTypeEnum.INPUT_STRING || type === AtomsTypeEnum.CONSTANT) {
633
+ setRhsVal([{
634
+ val: '',
635
+ type: type
636
+ }]);
637
+ }
638
+ if (type === AtomsTypeEnum.FIELD) {
639
+ setRhsVal([{
640
+ fieldName: '',
641
+ // 字段名
642
+ fieldNameZh: '',
643
+ // 字段中文名
644
+ fieldAlias: '',
645
+ // 别名
646
+ fieldUuid: '',
647
+ // uuid
648
+ fieldId: '',
649
+ // 字段id
650
+ // quotes?: string; // 字段展示的 不知道有没有用
651
+ tableName: '',
652
+ // 表名
653
+ tableNameZh: '',
654
+ tableId: '',
655
+ // 表名
656
+ tableAlias: '',
657
+ // 别名
658
+ tableUuid: '',
659
+ // 表唯一标识
660
+ datasourceName: '',
661
+ // 数据源名
662
+ datasourceId: '',
663
+ // 数据源id
664
+ type: AtomsTypeEnum.FIELD
665
+ }]);
666
+ }
583
667
  store.setClosable(true);
584
- // (newMeta[index] as MetaJoin).expressions[_ind][`${position}_type`] = type;
585
- // store.setMeta(newMeta, groupIndex);
586
668
  }
587
669
  })
588
670
  });
589
671
  };
590
- var nextPage = !!curColumn.name;
591
672
  var selectTable = function selectTable(e) {
592
673
  store.setClosable(false);
674
+ var node = e.currentTarget;
675
+ var _index = Number(node.getAttribute('v-index'));
593
676
  store.setPopup2({
594
677
  visible: true,
595
678
  node: e.currentTarget,
596
679
  container: container,
597
- content: _jsx(SelectJoinColumn, {
680
+ content: _jsx(SelectColumnMultiple, {
598
681
  data: _toConsumableArray(data),
599
- value: value,
682
+ multiple: false,
683
+ value: rhsVal,
600
684
  theme: ColumnsPopupThemeEnum.purple,
601
685
  didUpdate: didUpdate,
602
- onSelect: function onSelect(record) {
603
- setCurColumn(_objectSpread(_objectSpread({}, curColumn), {}, {
604
- table2: record
605
- }));
686
+ showNextBtn: true,
687
+ nextBtnText: __('metabase.nextOk'),
688
+ onNextStep: function onNextStep() {
689
+ store.setPopup2({
690
+ visible: false
691
+ });
692
+ },
693
+ onSelect: function onSelect(fields, quotes) {
694
+ var newR = _toConsumableArray(rhsVal);
695
+ newR = fields;
696
+ // (newR[_index] as AtomsField).quotes = quotes;
697
+ setRhsVal(newR);
606
698
  store.setPopup2({
607
699
  visible: false
608
700
  });
@@ -611,10 +703,10 @@ var SelectFilterColumn = function SelectFilterColumn(_ref) {
611
703
  })
612
704
  });
613
705
  };
614
- if (nextPage) {
615
- var _curColumn$table4;
706
+ if (isNext) {
707
+ // SQL_GROUP_TYPE
616
708
  var _getData = getData(curColumn),
617
- type = _getData.type,
709
+ fieldType = _getData.type,
618
710
  conditions = _getData.conditions;
619
711
  var menu = conditions.map(function (v) {
620
712
  return {
@@ -625,7 +717,13 @@ var SelectFilterColumn = function SelectFilterColumn(_ref) {
625
717
  var changeFormula = function changeFormula(val) {
626
718
  var params = [];
627
719
  if (val === 'SUBSTR') {
628
- params[0] = curColumn.name;
720
+ var names = [];
721
+ curColumn.lhs.filter(function (v) {
722
+ return v.type === AtomsTypeEnum.FIELD;
723
+ }).map(function (v) {
724
+ names.push(v.fieldName);
725
+ });
726
+ params[0] = names.join(' || ');
629
727
  }
630
728
  setFormula({
631
729
  type: val,
@@ -659,12 +757,13 @@ var SelectFilterColumn = function SelectFilterColumn(_ref) {
659
757
  })
660
758
  });
661
759
  };
662
- var getName = function getName(name) {
760
+ var getName = function getName(items) {
663
761
  var _formula$params3, _formula$params4;
762
+ var names = getAtomsQuotesName(items);
664
763
  switch (formula.type) {
665
764
  case 'SUBSTR':
666
765
  return _jsxs("div", {
667
- children: ["SUBSTR(", name, ",", _jsx(InputNumber, {
766
+ children: ["SUBSTR(", names, ",", _jsx(InputNumber, {
668
767
  className: 'left-info-formula-input',
669
768
  hideControl: true,
670
769
  placeholder: '',
@@ -694,7 +793,7 @@ var SelectFilterColumn = function SelectFilterColumn(_ref) {
694
793
  }), ")"]
695
794
  });
696
795
  default:
697
- return name;
796
+ return names;
698
797
  }
699
798
  };
700
799
  return _jsxs("div", {
@@ -706,7 +805,7 @@ var SelectFilterColumn = function SelectFilterColumn(_ref) {
706
805
  children: [_jsxs("span", {
707
806
  className: 'span-name',
708
807
  onClick: goPrevPage,
709
- children: [_jsx(LeftArrowIcon, {}), getName(curColumn.name)]
808
+ children: [_jsx(LeftArrowIcon, {}), getName(curColumn.lhs)]
710
809
  }), leftFormula()]
711
810
  }), _jsxs("div", {
712
811
  className: 'right-info',
@@ -714,7 +813,12 @@ var SelectFilterColumn = function SelectFilterColumn(_ref) {
714
813
  trigger: ['click'],
715
814
  onChange: function onChange(key) {
716
815
  setCondition('');
717
- setValType('string');
816
+ setCurColumn(_objectSpread(_objectSpread({}, curColumn), {}, {
817
+ rhs: [{
818
+ val: '',
819
+ type: AtomsTypeEnum.INPUT_STRING
820
+ }]
821
+ }));
718
822
  setTimeout(function () {
719
823
  setSpecial_type(key);
720
824
  }, 0);
@@ -726,15 +830,12 @@ var SelectFilterColumn = function SelectFilterColumn(_ref) {
726
830
  width: 104,
727
831
  marginRight: 8
728
832
  },
729
- children: [special_type || __('filter.selectType'), _jsx(ChevronODown, {})]
833
+ children: [(special_type === SQL_COLUMN_TYPE.FLOAT ? 'NUMBER' : special_type) || __('filter.selectType'), _jsx(ChevronODown, {})]
730
834
  })
731
835
  }), _jsx(Dropdown, {
732
836
  trigger: ['click'],
733
837
  onChange: function onChange(key) {
734
- setValType('string');
735
- setCurColumn(_objectSpread(_objectSpread({}, curColumn), {}, {
736
- table2: null
737
- }));
838
+ setCurColumn(_objectSpread({}, curColumn));
738
839
  setDefaultVal(key);
739
840
  },
740
841
  droplist: menu,
@@ -749,21 +850,32 @@ var SelectFilterColumn = function SelectFilterColumn(_ref) {
749
850
  })]
750
851
  }), _jsxs("div", {
751
852
  className: 'content',
752
- children: [(valType === 'field' || !valType) && _jsx("div", {
753
- className: cx("Sqb-TableName purple-name", {
754
- notSelected: !table2Selected
755
- }),
756
- onClick: selectTable,
757
- children: table2Selected ? "".concat((_curColumn$table4 = curColumn.table2) === null || _curColumn$table4 === void 0 ? void 0 : _curColumn$table4.name) : __('SqlQueryBuilder.pickTable')
758
- }), valType === 'constant' && _jsx("div", {
759
- className: cx("Sqb-TableName purple-name", {
760
- notSelected: !curVal[0]
761
- }),
762
- onClick: selectConstant,
763
- children: constantName ? "".concat(constantName) : __('SqlQueryBuilder.pickConstant')
764
- }), valType === 'string' && _jsx("div", {
765
- className: 'content_l',
766
- children: renderFilter(type, condition)
853
+ children: [rhsVal === null || rhsVal === void 0 ? void 0 : rhsVal.map(function (v, i) {
854
+ if (v.type === AtomsTypeEnum.FIELD) {
855
+ return _jsx("div", {
856
+ className: cx("Sqb-TableName purple-name", {
857
+ notSelected: !v.fieldName
858
+ }),
859
+ "v-index": i,
860
+ onClick: selectTable,
861
+ children: v.fieldName || __('SqlQueryBuilder.pickTable')
862
+ }, i);
863
+ }
864
+ if (v.type === AtomsTypeEnum.CONSTANT) {
865
+ return _jsx("div", {
866
+ className: cx("Sqb-TableName purple-name", {
867
+ notSelected: !v.val
868
+ }),
869
+ "v-type": v.type,
870
+ onClick: selectConstant,
871
+ children: v.val ? "".concat(v.val) : __('SqlQueryBuilder.pickConstant')
872
+ }, i);
873
+ }
874
+ if (v.type === AtomsTypeEnum.INPUT_STRING || v.type === AtomsTypeEnum.INPUT_STRING_LIST) {
875
+ return _jsx(React.Fragment, {
876
+ children: renderFilter(fieldType, condition)
877
+ }, i);
878
+ }
767
879
  }), ~['等于', '不等于', '早于', '晚于'].indexOf(condition) ? _jsx(Tooltip, {
768
880
  title: __('SqlQueryBuilder.switch'),
769
881
  children: _jsx(Button, {
@@ -791,29 +903,54 @@ var SelectFilterColumn = function SelectFilterColumn(_ref) {
791
903
  function setDefaultVal(_condition) {
792
904
  setCondition(_condition);
793
905
  if (~['前', '下一个'].indexOf(_condition)) {
794
- setVal(['30', '天']);
906
+ setRhsVal([{
907
+ val: ['30', '天'],
908
+ type: AtomsTypeEnum.INPUT_STRING_LIST
909
+ }]);
910
+ } else if (~['介于之间'].indexOf(_condition)) {
911
+ setRhsVal([{
912
+ val: ['', ''],
913
+ type: AtomsTypeEnum.INPUT_STRING_LIST
914
+ }]);
795
915
  } else if (~['当前'].indexOf(_condition)) {
796
- setVal(['天']);
916
+ setRhsVal([{
917
+ val: '天',
918
+ type: AtomsTypeEnum.INPUT_STRING
919
+ }]);
797
920
  } else if (~['早于', '晚于', '在'].indexOf(_condition)) {
798
- setVal([moment().format('YYYY-MM-DD HH:mm')]);
921
+ setRhsVal([{
922
+ val: moment().format('YYYY-MM-DD HH:mm'),
923
+ type: AtomsTypeEnum.INPUT_STRING
924
+ }]);
799
925
  } else {
800
- setVal([]);
926
+ setRhsVal([{
927
+ val: '',
928
+ type: AtomsTypeEnum.INPUT_STRING
929
+ }]);
801
930
  }
802
931
  }
803
932
  return _jsx("div", {
804
- children: _jsx(SelectJoinColumn, {
933
+ children: _jsx(SelectColumnMultiple, {
805
934
  data: data,
806
- value: value,
935
+ value: curColumn === null || curColumn === void 0 ? void 0 : curColumn.lhs,
807
936
  theme: ColumnsPopupThemeEnum.purple,
808
937
  didUpdate: didUpdate,
809
- onSelect: function onSelect(record) {
810
- setCurColumn(record);
938
+ showNextBtn: true,
939
+ onNextStep: function onNextStep() {
940
+ setIsNext(true);
941
+ },
942
+ onSelect: function onSelect(fields, quotes) {
943
+ // const { columns, ...other } = tableInfo;
944
+ setCurColumn(_objectSpread(_objectSpread({}, curColumn), {}, {
945
+ lhs: fields
946
+ }));
947
+ // setCurColumn(record);
811
948
  /**
812
949
  * 这里默认帮用户选好一部分数据
813
950
  * 不至于让用户每一个都自己选、
814
951
  * 比如说:条件字段 默认我们帮他选好第一个...
815
952
  */
816
- var _getData2 = getData(record),
953
+ var _getData2 = getData(curColumn),
817
954
  conditions = _getData2.conditions;
818
955
  setDefaultVal(conditions[0]);
819
956
  }