@gingkoo/pandora-metabase 0.0.27 → 0.0.29
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/es/index.js +276 -54
- package/lib/es/index.js.map +1 -1
- package/lib/es/store/types.d.ts +5 -0
- package/package.json +1 -1
package/lib/es/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @gingkoo/pandora-metabase v0.0.
|
|
2
|
+
* @gingkoo/pandora-metabase v0.0.29
|
|
3
3
|
*/
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import React__default, { useContext, createContext, useState, useRef, useMemo, forwardRef, useImperativeHandle, useEffect } from 'react';
|
|
7
7
|
import cx from 'classnames';
|
|
8
|
-
import { Button, Tooltip, Input, Modal2, Toast } from '@gingkoo/pandora';
|
|
9
|
-
import { DatePicker, Dropdown, Tooltip as Tooltip$1, InputNumber, Button as Button$1 } from 'antd';
|
|
8
|
+
import { Button, Tooltip, InputNumber, Input, Select, Modal2, Toast } from '@gingkoo/pandora';
|
|
9
|
+
import { DatePicker, Dropdown, Tooltip as Tooltip$1, InputNumber as InputNumber$1, Button as Button$1 } from 'antd';
|
|
10
10
|
import { DownOutlined, LoadingOutlined } from '@ant-design/icons';
|
|
11
11
|
import Styled from 'styled-components';
|
|
12
12
|
import _$2 from 'underscore';
|
|
13
13
|
import ReactDOM from 'react-dom';
|
|
14
14
|
import ReactDOMServer from 'react-dom/server';
|
|
15
15
|
import cloneDeep from 'lodash/cloneDeep';
|
|
16
|
-
import { Repeat, RelatedWork, FfPlus, FfLine } from '@gingkoo/pandora-icons';
|
|
16
|
+
import { Repeat, Function, RelatedWork, FfPlus, FfLine } from '@gingkoo/pandora-icons';
|
|
17
17
|
import moment from 'dayjs';
|
|
18
18
|
import isEqual from 'lodash/isEqual';
|
|
19
19
|
|
|
@@ -1105,6 +1105,8 @@ register('en', {
|
|
|
1105
1105
|
'filter.contain': 'contain',
|
|
1106
1106
|
'filter.notInclude': 'not include',
|
|
1107
1107
|
'filter.startWith': 'start with',
|
|
1108
|
+
'filter.within': 'IN',
|
|
1109
|
+
'filter.withnotin': 'NOT IN',
|
|
1108
1110
|
'filter.endWith': 'end with',
|
|
1109
1111
|
'filter.earlierThan': 'earlier than',
|
|
1110
1112
|
'filter.laterThan': 'later than',
|
|
@@ -1233,6 +1235,8 @@ register('zh', {
|
|
|
1233
1235
|
'filter.contain': '包含',
|
|
1234
1236
|
'filter.notInclude': '不包含',
|
|
1235
1237
|
'filter.startWith': '以...开始',
|
|
1238
|
+
'filter.within': 'IN',
|
|
1239
|
+
'filter.withnotin': 'NOT IN',
|
|
1236
1240
|
'filter.endWith': '以...结束',
|
|
1237
1241
|
'filter.earlierThan': '早于',
|
|
1238
1242
|
'filter.laterThan': '晚于',
|
|
@@ -1334,7 +1338,7 @@ const Loading = ({
|
|
|
1334
1338
|
});
|
|
1335
1339
|
};
|
|
1336
1340
|
|
|
1337
|
-
var css_248z$b = ".mx-4 {\n margin-left: 1rem;\n margin-right: 1rem;\n}\n.m-2 {\n margin: 0.5rem;\n}\n.mx-2 {\n margin-left: 0.5rem;\n margin-right: 0.5rem;\n}\n.ml-2 {\n margin-left: 0.5rem;\n}\n.mt-2 {\n margin-top: 0.5rem;\n}\n.mb-2 {\n margin-bottom: 0.5rem;\n}\n.mt-4 {\n margin-top: 1rem;\n}\n.ml-4 {\n margin-left: 1rem;\n}\n.mr-4 {\n margin-right: 1rem;\n}\n.mr-2 {\n margin-right: 0.5rem;\n}\n.pt-2 {\n padding-top: 0.5rem;\n}\n.pb-2 {\n padding-bottom: 0.5rem;\n}\n.px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n.p-4 {\n padding: 1rem;\n}\n.p-2 {\n padding: 0.5rem;\n}\n.px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n.pb-4 {\n padding-bottom: 1rem;\n}\n.pt-4 {\n padding-top: 1rem;\n}\n.block {\n display: block;\n}\n.w-full {\n width: 100%;\n}\n.font-bold {\n font-weight: 700;\n}\n.uppercase {\n text-transform: uppercase;\n}\n.tracking-wider {\n letter-spacing: 0.05em;\n}\n.relative {\n position: relative;\n}\n.absolute {\n position: absolute;\n}\n.top-0 {\n top: 0px;\n}\n.left-0 {\n left: 0;\n}\n.rounded-lg {\n border-radius: 0.5rem;\n}\n.text-gray-500 {\n color: #6b7280;\n}\n.flex {\n display: flex;\n}\n.items-center {\n align-items: center;\n}\n.justify-center {\n justify-content: center;\n}\n.visual-box {\n position: relative;\n width: 100%;\n height: 100%;\n overflow-y: scroll;\n overflow-x: hidden;\n transition: all 0.3s;\n z-index: 3;\n background-color: #fff;\n}\n.Sqb {\n padding: 0 20px 50px;\n}\n.Sqb-list {\n padding-top: 1.5rem;\n}\n.Sqb-hover-parent {\n margin-bottom: 16px;\n padding-bottom: 16px;\n}\n.Sqb-item {\n font-size: 14px;\n}\n.Sqb-item--text {\n color: #509ee3;\n width: 66.6667%;\n box-sizing: border-box;\n margin-bottom: 8px;\n display: flex;\n align-items: center;\n font-weight: 600;\n}\n.Sqb-item--text.purple-text {\n color: #7172ad;\n}\n.Sqb-item--text.gray-text {\n color: #93a1ab;\n}\n.Sqb-item--text.green-text {\n color: #88bf4d;\n}\n.Sqb-item-close {\n width: 16px;\n height: 16px;\n color: #b8bbc3;\n margin-left: auto;\n visibility: hidden;\n cursor: pointer;\n}\n.Sqb-item--content {\n width: 66.6667%;\n box-sizing: border-box;\n}\n.Sqb-item--content .Sqb-NotebookCell {\n box-sizing: border-box;\n padding: 16px 16px 8px;\n color: #509ee3;\n display: flex;\n flex-wrap: wrap;\n -webkit-box-align: center;\n align-items: center;\n border-radius: 8px;\n background-color: rgba(80, 158, 227, 0.1);\n}\n.Sqb-item--content .Sqb-NotebookCell.gray-bg {\n background-color: rgba(147, 161, 171, 0.1);\n}\n.Sqb-item--content .Sqb-NotebookCell.green-bg {\n background-color: rgba(136, 191, 77, 0.1);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName {\n border: 2px solid transparent;\n border-radius: 6px;\n color: white;\n background-color: #509ee3;\n transition: background 300ms linear 0s,\n border 300ms linear 0s;\n box-sizing: border-box;\n margin-bottom: 8px;\n margin-right: 8px;\n padding: 8px;\n display: flex;\n -webkit-box-align: center;\n align-items: center;\n cursor: pointer;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName-input {\n margin-bottom: 9px;\n margin-right: 8px;\n padding: 9px;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName::selection {\n color: #ffffff;\n background-color: #d489ac;\n text-shadow: none;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName:hover {\n background-color: rgba(80, 158, 227, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.noClick {\n cursor: default;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.noClick:hover {\n background-color: #509ee3;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.notSelected {\n border: 2px solid rgba(80, 158, 227, 0.25);\n color: #509ee3;\n background-color: transparent;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.notSelected:hover {\n border-color: rgba(80, 158, 227, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.purple-name {\n color: white;\n background-color: #7172ad;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.purple-name:hover {\n background-color: rgba(113, 114, 173, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.purple-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.purple-name.notSelected {\n border: 2px solid rgba(113, 114, 173, 0.25);\n color: #7172ad;\n background-color: transparent;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.purple-name.notSelected:hover {\n border-color: rgba(113, 114, 173, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.gray-name {\n color: white;\n background-color: #93a1ab;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.gray-name:hover {\n background-color: rgba(147, 161, 171, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.gray-name svg.sort-arrow {\n margin-right: 0.5rem;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.gray-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.green-name {\n color: white;\n background-color: #88bf4d;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.green-name:hover {\n background-color: rgba(136, 191, 77, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.green-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.green-name.notSelected {\n border: 2px solid rgba(136, 191, 77, 0.25);\n color: #88bf4d;\n background-color: transparent;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.green-name.notSelected:hover {\n border-color: rgba(136, 191, 77, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .ant-input-number {\n margin-bottom: 0.5rem;\n}\n.Sqb-item--content .Sqb-NotebookCell .ant-input-number .ant-input-number-input {\n height: 32px;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-where {\n box-sizing: border-box;\n display: flex;\n -webkit-box-align: center;\n align-items: center;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-where.block {\n width: 100%;\n}\n.Sqb-item--content .Sqb-NotebookCell .operator-icon,\n.Sqb-item--content .Sqb-NotebookCell .operator-icon button {\n font-size: 18px !important;\n border: none !important;\n}\n.Sqb-item--content .Sqb-NotebookCell .subquery-icon {\n color: #93a1ab;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableColumns {\n font-weight: 600;\n margin-bottom: 0.5rem;\n margin-left: auto;\n cursor: pointer;\n}\n.Sqb-item--content .flex-row {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n align-items: center;\n flex-direction: row;\n}\n.Sqb-item--content .flex-row .Sqb-NotebookCell {\n width: 50%;\n}\n.Sqb-item--content .flex-row .pass {\n color: #88bf4d;\n margin: 4px 16px;\n font-size: 600;\n}\n.Sqb-item--func {\n box-sizing: border-box;\n margin-top: 8px;\n}\n.Sqb-item--func .Sqb-button {\n display: inline-block;\n box-sizing: border-box;\n text-decoration: none;\n cursor: pointer;\n font-weight: bold;\n padding: 12px 16px;\n border-radius: 6px;\n margin-right: 16px;\n margin-top: 16px;\n border: none;\n transition: background 300ms ease 0s;\n flex-shrink: 0;\n color: #93a1ab;\n background-color: #ffffff;\n}\n.Sqb-item--func .Sqb-button:hover {\n color: #7e8f9b;\n background-color: #eceff0;\n}\n.Sqb-item--func .Sqb-button > div {\n min-width: 60px;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n display: flex;\n}\n.Sqb-item--func .Sqb-button > div svg {\n flex-shrink: 0;\n}\n.Sqb-item--func .Sqb-button > div div {\n margin-top: 0.5rem;\n}\n.Sqb-item--func .Sqb-button.filter {\n color: #7172ad;\n background-color: #e0e0ed;\n}\n.Sqb-item--func .Sqb-button.filter:hover {\n color: #5d5ea0;\n background-color: #cccce1;\n}\n.Sqb-item--func .Sqb-button.summarize {\n color: #88bf4d;\n background-color: #d8eac5;\n}\n.Sqb-item--func .Sqb-button.summarize:hover {\n color: #79ae3f;\n background-color: #cae2af;\n}\n.Sqb-item--func .Sqb-button.joinData {\n color: #509ee3;\n background-color: #f1f7fd;\n}\n.Sqb-item--func .Sqb-button.joinData:hover {\n color: #328dde;\n background-color: #d4e7f8;\n}\n.Sqb-item--func .Sqb-button.small {\n margin-right: 8px;\n margin-top: 0;\n padding: 0.5rem;\n}\n.Sqb-item--func .Sqb-button.small > div {\n min-width: 0;\n}\n.Sqb-item--func .Sqb-button.small > div svg {\n width: 14px;\n height: 14px;\n}\n.Sqb-item--func .Sqb-button.small > div div {\n display: none;\n}\n.Sqb-item:hover .Sqb-item-close {\n visibility: visible;\n}\n.Sqb > .Sqb-btn {\n min-width: 220px;\n height: 36px;\n border-radius: 6px;\n color: #ffffff;\n background: #509ee3;\n border: 1px solid #509ee3;\n}\n.Sqb > .Sqb-btn:hover {\n background-color: rgba(80, 158, 227, 0.8) !important;\n}\n";
|
|
1341
|
+
var css_248z$b = ".mx-4 {\n margin-left: 1rem;\n margin-right: 1rem;\n}\n.m-2 {\n margin: 0.5rem;\n}\n.mx-2 {\n margin-left: 0.5rem;\n margin-right: 0.5rem;\n}\n.ml-2 {\n margin-left: 0.5rem;\n}\n.mt-2 {\n margin-top: 0.5rem;\n}\n.mb-2 {\n margin-bottom: 0.5rem;\n}\n.mt-4 {\n margin-top: 1rem;\n}\n.ml-4 {\n margin-left: 1rem;\n}\n.mr-4 {\n margin-right: 1rem;\n}\n.mr-2 {\n margin-right: 0.5rem;\n}\n.pt-2 {\n padding-top: 0.5rem;\n}\n.pb-2 {\n padding-bottom: 0.5rem;\n}\n.px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n.p-4 {\n padding: 1rem;\n}\n.p-2 {\n padding: 0.5rem;\n}\n.px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n.pb-4 {\n padding-bottom: 1rem;\n}\n.pt-4 {\n padding-top: 1rem;\n}\n.block {\n display: block;\n}\n.w-full {\n width: 100%;\n}\n.font-bold {\n font-weight: 700;\n}\n.uppercase {\n text-transform: uppercase;\n}\n.tracking-wider {\n letter-spacing: 0.05em;\n}\n.relative {\n position: relative;\n}\n.absolute {\n position: absolute;\n}\n.top-0 {\n top: 0px;\n}\n.left-0 {\n left: 0;\n}\n.rounded-lg {\n border-radius: 0.5rem;\n}\n.text-gray-500 {\n color: #6b7280;\n}\n.flex {\n display: flex;\n}\n.items-center {\n align-items: center;\n}\n.justify-center {\n justify-content: center;\n}\n.visual-box {\n position: relative;\n width: 100%;\n height: 100%;\n overflow-y: scroll;\n overflow-x: hidden;\n transition: all 0.3s;\n z-index: 3;\n background-color: #fff;\n}\n.Sqb {\n padding: 0 20px 50px;\n}\n.Sqb-list {\n padding-top: 1.5rem;\n}\n.Sqb-hover-parent {\n margin-bottom: 16px;\n padding-bottom: 16px;\n}\n.Sqb-item {\n font-size: 14px;\n}\n.Sqb-item--text {\n color: #509ee3;\n width: 66.6667%;\n box-sizing: border-box;\n margin-bottom: 8px;\n display: flex;\n align-items: center;\n font-weight: 600;\n}\n.Sqb-item--text.purple-text {\n color: #7172ad;\n}\n.Sqb-item--text.gray-text {\n color: #93a1ab;\n}\n.Sqb-item--text.green-text {\n color: #88bf4d;\n}\n.Sqb-item-close {\n width: 16px;\n height: 16px;\n color: #b8bbc3;\n margin-left: auto;\n visibility: hidden;\n cursor: pointer;\n}\n.Sqb-item--content {\n width: 66.6667%;\n box-sizing: border-box;\n}\n.Sqb-item--content .Sqb-Filter-item {\n position: relative;\n margin: 0 10px;\n}\n.Sqb-item--content .Sqb-Filter-item .right-arrow,\n.Sqb-item--content .Sqb-Filter-item .left-arrow {\n position: absolute;\n top: 0;\n height: 40px;\n width: 30px;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0.4;\n cursor: pointer;\n transform: scale(0);\n transition: all 0.3s;\n}\n.Sqb-item--content .Sqb-Filter-item .right-arrow img,\n.Sqb-item--content .Sqb-Filter-item .left-arrow img {\n transform: scale(0.8);\n}\n.Sqb-item--content .Sqb-Filter-item .right-arrow:hover,\n.Sqb-item--content .Sqb-Filter-item .left-arrow:hover {\n opacity: 1;\n}\n.Sqb-item--content .Sqb-Filter-item .left-arrow {\n transform: rotate(180deg) scale(0);\n transform-origin: 50% 50%;\n left: -30px;\n}\n.Sqb-item--content .Sqb-Filter-item .right-arrow {\n right: -20px;\n}\n.Sqb-item--content .Sqb-Filter-item.hover .left-arrow {\n transform: rotate(180deg) scale(1);\n}\n.Sqb-item--content .Sqb-Filter-item.hover .right-arrow {\n transform: scale(1);\n}\n.Sqb-item--content .Sqb-NotebookCell {\n box-sizing: border-box;\n padding: 16px 16px 8px;\n color: #509ee3;\n display: flex;\n flex-wrap: wrap;\n -webkit-box-align: center;\n align-items: center;\n border-radius: 8px;\n background-color: rgba(80, 158, 227, 0.1);\n}\n.Sqb-item--content .Sqb-NotebookCell-preview {\n flex-shrink: 0;\n width: 100%;\n}\n.Sqb-item--content .Sqb-NotebookCell.gray-bg {\n background-color: rgba(147, 161, 171, 0.1);\n}\n.Sqb-item--content .Sqb-NotebookCell.green-bg {\n background-color: rgba(136, 191, 77, 0.1);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName {\n border: 2px solid transparent;\n border-radius: 6px;\n color: white;\n background-color: #509ee3;\n transition: background 300ms linear 0s,\n border 300ms linear 0s;\n box-sizing: border-box;\n margin-bottom: 8px;\n margin-right: 8px;\n padding: 8px;\n display: flex;\n -webkit-box-align: center;\n align-items: center;\n cursor: pointer;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName-input {\n margin-bottom: 9px;\n margin-right: 8px;\n padding: 9px;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName::selection {\n color: #ffffff;\n background-color: #d489ac;\n text-shadow: none;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName:hover {\n background-color: rgba(80, 158, 227, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.noClick {\n cursor: default;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.noClick:hover {\n background-color: #509ee3;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.notSelected {\n border: 2px solid rgba(80, 158, 227, 0.25);\n color: #509ee3;\n background-color: transparent;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.notSelected:hover {\n border-color: rgba(80, 158, 227, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.purple-name {\n color: white;\n background-color: #7172ad;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.purple-name:hover {\n background-color: rgba(113, 114, 173, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.purple-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.purple-name.notSelected {\n border: 2px solid rgba(113, 114, 173, 0.25);\n color: #7172ad;\n background-color: transparent;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.purple-name.notSelected:hover {\n border-color: rgba(113, 114, 173, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.gray-name {\n color: white;\n background-color: #93a1ab;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.gray-name:hover {\n background-color: rgba(147, 161, 171, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.gray-name svg.sort-arrow {\n margin-right: 0.5rem;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.gray-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.green-name {\n color: white;\n background-color: #88bf4d;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.green-name:hover {\n background-color: rgba(136, 191, 77, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.green-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.green-name.notSelected {\n border: 2px solid rgba(136, 191, 77, 0.25);\n color: #88bf4d;\n background-color: transparent;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableName.green-name.notSelected:hover {\n border-color: rgba(136, 191, 77, 0.8);\n}\n.Sqb-item--content .Sqb-NotebookCell .ant-input-number {\n margin-bottom: 0.5rem;\n}\n.Sqb-item--content .Sqb-NotebookCell .ant-input-number .ant-input-number-input {\n height: 32px;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-where {\n box-sizing: border-box;\n display: flex;\n -webkit-box-align: center;\n align-items: center;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-where.block {\n width: 100%;\n}\n.Sqb-item--content .Sqb-NotebookCell .operator-icon,\n.Sqb-item--content .Sqb-NotebookCell .operator-icon button {\n font-size: 18px !important;\n border: none !important;\n}\n.Sqb-item--content .Sqb-NotebookCell .subquery-icon {\n color: #93a1ab;\n}\n.Sqb-item--content .Sqb-NotebookCell .Sqb-TableColumns {\n font-weight: 600;\n margin-bottom: 0.5rem;\n margin-left: auto;\n cursor: pointer;\n}\n.Sqb-item--content .flex-row {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n align-items: center;\n flex-direction: row;\n}\n.Sqb-item--content .flex-row .Sqb-NotebookCell {\n width: 50%;\n}\n.Sqb-item--content .flex-row .pass {\n color: #88bf4d;\n margin: 4px 16px;\n font-size: 600;\n}\n.Sqb-item--func {\n box-sizing: border-box;\n margin-top: 8px;\n}\n.Sqb-item--func .Sqb-button {\n display: inline-block;\n box-sizing: border-box;\n text-decoration: none;\n cursor: pointer;\n font-weight: bold;\n padding: 12px 16px;\n border-radius: 6px;\n margin-right: 16px;\n margin-top: 16px;\n border: none;\n transition: background 300ms ease 0s;\n flex-shrink: 0;\n color: #93a1ab;\n background-color: #ffffff;\n}\n.Sqb-item--func .Sqb-button:hover {\n color: #7e8f9b;\n background-color: #eceff0;\n}\n.Sqb-item--func .Sqb-button > div {\n min-width: 60px;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n display: flex;\n}\n.Sqb-item--func .Sqb-button > div svg {\n flex-shrink: 0;\n}\n.Sqb-item--func .Sqb-button > div div {\n margin-top: 0.5rem;\n}\n.Sqb-item--func .Sqb-button.filter {\n color: #7172ad;\n background-color: #e0e0ed;\n}\n.Sqb-item--func .Sqb-button.filter:hover {\n color: #5d5ea0;\n background-color: #cccce1;\n}\n.Sqb-item--func .Sqb-button.summarize {\n color: #88bf4d;\n background-color: #d8eac5;\n}\n.Sqb-item--func .Sqb-button.summarize:hover {\n color: #79ae3f;\n background-color: #cae2af;\n}\n.Sqb-item--func .Sqb-button.joinData {\n color: #509ee3;\n background-color: #f1f7fd;\n}\n.Sqb-item--func .Sqb-button.joinData:hover {\n color: #328dde;\n background-color: #d4e7f8;\n}\n.Sqb-item--func .Sqb-button.small {\n margin-right: 8px;\n margin-top: 0;\n padding: 0.5rem;\n}\n.Sqb-item--func .Sqb-button.small > div {\n min-width: 0;\n}\n.Sqb-item--func .Sqb-button.small > div svg {\n width: 14px;\n height: 14px;\n}\n.Sqb-item--func .Sqb-button.small > div div {\n display: none;\n}\n.Sqb-item:hover .Sqb-item-close {\n visibility: visible;\n}\n.Sqb > .Sqb-btn {\n min-width: 220px;\n height: 36px;\n border-radius: 6px;\n color: #ffffff;\n background: #509ee3;\n border: 1px solid #509ee3;\n}\n.Sqb > .Sqb-btn:hover {\n background-color: rgba(80, 158, 227, 0.8) !important;\n}\n";
|
|
1338
1342
|
styleInject(css_248z$b);
|
|
1339
1343
|
|
|
1340
1344
|
var css_248z$a = ".Sqb-CustomColumn--box {\n box-sizing: border-box;\n min-width: 1em;\n max-width: 500px;\n background-color: #ffffff;\n overflow: hidden;\n}\n.Sqb-CustomColumn--box .input {\n color: #4c5773;\n font-size: 1.12em;\n padding: 0.75rem 0.75rem;\n border: 1px solid #f0f0f0;\n border-radius: 4px;\n transition: border 0.3s linear;\n font-family: Monaco, monospace;\n font-weight: 700;\n -webkit-font-smoothing: antialiased;\n}\n.Sqb-CustomColumn--box .input:focus {\n outline: none;\n border: 1px solid #509ee3;\n transition: border 0.3s linear;\n color: #4c5773;\n}\n.Sqb-CustomColumn--box .input::-webkit-input-placeholder {\n color: #949aab;\n}\n.Sqb-CustomColumn--box .input::-ms-input-placeholder {\n color: #949aab;\n}\n.Sqb-CustomColumn--box .input.border-error {\n border-color: #ed6e6e !important;\n}\n.Sqb-CustomColumn--box .text-error {\n color: #ed6e6e;\n}\n.Sqb-CustomColumn--box .btns {\n flex-direction: row;\n align-items: center;\n display: flex;\n border-top: 1px solid #f0f0f0;\n}\n.Sqb-CustomColumn--box .btns .btn {\n padding: 0.75rem 1rem;\n display: inline-block;\n box-sizing: border-box;\n background: transparent;\n border: 1px solid #e4e4e4;\n color: #4c5773;\n cursor: pointer;\n text-decoration: none;\n font-weight: bold;\n font-family: 'Lato', sans-serif;\n border-radius: 6px;\n outline: none;\n}\n.Sqb-CustomColumn--box .btns .btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n.Sqb-CustomColumn--box .btns .btn:not(:disabled):hover {\n color: #509ee3;\n border-color: #d6d6d6;\n background: #f9fbfc;\n transition: all 200ms linear;\n}\n.Sqb-CustomColumn--box .btns .btn.usable {\n color: #ffffff;\n background: #509ee3;\n border: 1px solid #509ee3;\n}\n.Sqb-CustomColumn--box .btns .btn.usable:hover {\n color: #ffffff;\n border-color: #509ee3;\n background-color: rgba(80, 158, 227, 0.88);\n}\n";
|
|
@@ -4026,14 +4030,14 @@ const SelectJoinColumn = ({
|
|
|
4026
4030
|
});
|
|
4027
4031
|
};
|
|
4028
4032
|
|
|
4029
|
-
var css_248z$4 = ".filter-page {\n min-width: 300px;\n}\n.filter-page .header {\n margin-bottom: 0.5rem;\n padding: 0.5rem;\n display: flex;\n align-items: center;\n color: #949aab;\n border-bottom: 1px solid #f0f0f0;\n}\n.filter-page .header .left-info {\n padding: 0.5rem 0.5rem 0.5rem 0;\n display: flex;\n align-items: center;\n}\n.filter-page .header .left-info span {\n font-weight: 900;\n font-size: 16px;\n color: #4c5773;\n display: flex;\n align-items: center;\n cursor: pointer;\n font-family: 'Lato', sans-serif;\n}\n.filter-page .header .left-info span svg {\n margin-right: 0.5rem;\n}\n.filter-page .header .left-info span:hover {\n color: #509ee3;\n}\n.filter-page .header .right-info {\n
|
|
4033
|
+
var css_248z$4 = ".filter-page {\n min-width: 300px;\n}\n.filter-page .header {\n margin-bottom: 0.5rem;\n padding: 0.5rem;\n display: flex;\n align-items: center;\n color: #949aab;\n border-bottom: 1px solid #f0f0f0;\n}\n.filter-page .header .left-info {\n padding: 0.5rem 0.5rem 0.5rem 0;\n display: flex;\n align-items: center;\n flex: 1;\n}\n.filter-page .header .left-info-formula {\n display: flex;\n margin: 0 5px;\n gap: 5px;\n}\n.filter-page .header .left-info-formula .operator-icon {\n font-size: 18px !important;\n}\n.filter-page .header .left-info-formula-input {\n width: 25px;\n margin: 0 5px;\n}\n.filter-page .header .left-info-formula-input .pd-Input-inner-wrapper {\n border-top: 0;\n border-left: 0;\n border-right: 0;\n border-radius: 0;\n padding: 0 3px;\n}\n.filter-page .header .left-info-formula-input .pd-Input-inner-wrapper input {\n text-align: center;\n}\n.filter-page .header .left-info .span-name {\n font-weight: 900;\n font-size: 16px;\n color: #4c5773;\n flex-grow: 1;\n display: flex;\n align-items: center;\n cursor: pointer;\n font-family: 'Lato', sans-serif;\n}\n.filter-page .header .left-info .span-name svg {\n margin-right: 0.5rem;\n}\n.filter-page .header .left-info .span-name:hover {\n color: #509ee3;\n}\n.filter-page .header .right-info {\n display: flex;\n align-items: center;\n}\n.filter-page .content {\n padding: 0.5rem;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.filter-page .content_l {\n flex: 1;\n}\n.filter-page .content .operator-icon {\n font-size: 18px !important;\n}\n.filter-page .content .Sqb-TableName {\n border: 2px solid transparent;\n border-radius: 6px;\n color: white;\n background-color: #509ee3;\n transition: background 300ms linear 0s;\n box-sizing: border-box;\n padding: 8px;\n display: flex;\n -webkit-box-align: center;\n align-items: center;\n cursor: pointer;\n}\n.filter-page .content .Sqb-TableName-input {\n margin-bottom: 9px;\n margin-right: 8px;\n padding: 9px;\n}\n.filter-page .content .Sqb-TableName::selection {\n color: #ffffff;\n background-color: #d489ac;\n text-shadow: none;\n}\n.filter-page .content .Sqb-TableName:hover {\n background-color: rgba(80, 158, 227, 0.8);\n}\n.filter-page .content .Sqb-TableName.noClick {\n cursor: default;\n}\n.filter-page .content .Sqb-TableName.noClick:hover {\n background-color: #509ee3;\n}\n.filter-page .content .Sqb-TableName.notSelected {\n border: 2px solid rgba(80, 158, 227, 0.25);\n color: #509ee3;\n background-color: transparent;\n}\n.filter-page .content .Sqb-TableName.notSelected:hover {\n border-color: rgba(80, 158, 227, 0.8);\n}\n.filter-page .content .Sqb-TableName.purple-name {\n color: white;\n background-color: #7172ad;\n}\n.filter-page .content .Sqb-TableName.purple-name:hover {\n background-color: rgba(113, 114, 173, 0.8);\n}\n.filter-page .content .Sqb-TableName.purple-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.filter-page .content .Sqb-TableName.purple-name.notSelected {\n border: 2px solid rgba(113, 114, 173, 0.25);\n color: #7172ad;\n background-color: transparent;\n}\n.filter-page .content .Sqb-TableName.purple-name.notSelected:hover {\n border-color: rgba(113, 114, 173, 0.8);\n}\n.filter-page .content .Sqb-TableName.gray-name {\n color: white;\n background-color: #93a1ab;\n}\n.filter-page .content .Sqb-TableName.gray-name:hover {\n background-color: rgba(147, 161, 171, 0.8);\n}\n.filter-page .content .Sqb-TableName.gray-name svg.sort-arrow {\n margin-right: 0.5rem;\n}\n.filter-page .content .Sqb-TableName.gray-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.filter-page .content .Sqb-TableName.green-name {\n color: white;\n background-color: #88bf4d;\n}\n.filter-page .content .Sqb-TableName.green-name:hover {\n background-color: rgba(136, 191, 77, 0.8);\n}\n.filter-page .content .Sqb-TableName.green-name svg.closeIcon {\n opacity: 0.6;\n margin-left: 8px;\n}\n.filter-page .content .Sqb-TableName.green-name.notSelected {\n border: 2px solid rgba(136, 191, 77, 0.25);\n color: #88bf4d;\n background-color: transparent;\n}\n.filter-page .content .Sqb-TableName.green-name.notSelected:hover {\n border-color: rgba(136, 191, 77, 0.8);\n}\n.filter-page .content .w_300 {\n width: 300px;\n}\n.filter-page .content .input {\n border: 1px solid #f0f0f0;\n font-size: 16px;\n color: #4c5773;\n border-radius: 4px;\n transition: border 0.3s linear;\n padding: 9px 20px;\n height: 40px;\n outline: none;\n}\n.filter-page .content .input::placeholder {\n color: #ccc;\n}\n.filter-page .content .input + .input {\n margin-top: 10px;\n}\n.filter-page .content .input.inline {\n display: inline-block;\n flex: 1;\n margin-right: 15px;\n padding: 5px 20px;\n}\n.filter-page .footer {\n padding: 0 0.5rem 0.5rem;\n display: flex;\n align-items: center;\n}\n.filter-page .footer .button--purple {\n margin-left: auto;\n flex-shrink: 0;\n color: white;\n background-color: #7172ad;\n border: 1px solid #7172ad;\n padding: 6px 14px;\n font-size: 14px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 6px;\n cursor: pointer;\n}\n.filter-page .footer .button--purple.disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n.filter-page .footer .button--purple:hover {\n color: white;\n background-color: rgba(113, 114, 173, 0.88);\n border-color: rgba(113, 114, 173, 0.88);\n}\n.operator-btn {\n height: 38px !important;\n padding: 8px !important;\n text-align: left !important;\n display: flex !important;\n align-items: center !important;\n}\n.operator-btn > .anticon {\n margin-left: auto !important;\n}\n";
|
|
4030
4034
|
styleInject(css_248z$4);
|
|
4031
4035
|
|
|
4032
4036
|
const {
|
|
4033
4037
|
RangePicker
|
|
4034
4038
|
} = DatePicker;
|
|
4035
|
-
const NUMBER_LIST = ['等于', '不等于', '大于', '小于', '介于之间', '大于或等于', '小于或等于', '为空', '不为空'];
|
|
4036
|
-
const STRING_LIST = ['
|
|
4039
|
+
const NUMBER_LIST = ['等于', '不等于', '大于', '小于', '介于之间', '大于或等于', '小于或等于', '为空', '不为空', 'In', 'Not In'];
|
|
4040
|
+
const STRING_LIST = ['等于', '不等于', '包含', '不包含', '为空', '不为空', '以...开始', '以...结束', 'In', 'Not In'];
|
|
4037
4041
|
const DATE_LIST = [
|
|
4038
4042
|
// '前', '下一个', '当前',
|
|
4039
4043
|
'早于', '晚于',
|
|
@@ -4049,11 +4053,12 @@ const SelectFilterColumn = ({
|
|
|
4049
4053
|
const [condition, setCondition] = useState(value.condition);
|
|
4050
4054
|
const [isField, setIsField] = useState(value.isField || false);
|
|
4051
4055
|
const [curVal, setVal] = useState(value.val);
|
|
4056
|
+
const [formula, setFormula] = useState(value.formula || {});
|
|
4052
4057
|
const store = useStore$1();
|
|
4053
4058
|
let table2Selected = Boolean(curColumn.table2?.name);
|
|
4054
4059
|
const disabled = useMemo(() => {
|
|
4055
4060
|
if (!condition) return true;
|
|
4056
|
-
if (curColumn.table2?.id && ~['
|
|
4061
|
+
if (curColumn.table2?.id && ~['等于', '不等于'].indexOf(condition)) {
|
|
4057
4062
|
return false;
|
|
4058
4063
|
}
|
|
4059
4064
|
if (~['为空', '不为空', '是空的', '不是空的'].indexOf(condition)) {
|
|
@@ -4070,71 +4075,86 @@ const SelectFilterColumn = ({
|
|
|
4070
4075
|
useEffect(() => {
|
|
4071
4076
|
didUpdate?.();
|
|
4072
4077
|
}, [condition]);
|
|
4078
|
+
const getQuotesName = name => {
|
|
4079
|
+
switch (formula.type) {
|
|
4080
|
+
case 'SUBSTR':
|
|
4081
|
+
// let str = formula.params?.join(',');
|
|
4082
|
+
return `SUBSTR(${name},${formula?.params?.[1]},${formula?.params?.[2]})`;
|
|
4083
|
+
default:
|
|
4084
|
+
return name;
|
|
4085
|
+
}
|
|
4086
|
+
};
|
|
4073
4087
|
function generateQuotes(val, curColumn) {
|
|
4074
4088
|
let [firstVal = '', secondVal = ''] = val;
|
|
4075
4089
|
let quotes = '';
|
|
4076
4090
|
if (condition === '以...开始') {
|
|
4077
4091
|
if (isEn) {
|
|
4078
|
-
quotes = curColumn.name + ' ' + `startWith ${firstVal}`;
|
|
4092
|
+
quotes = getQuotesName(curColumn.name) + ' ' + `startWith ${firstVal}`;
|
|
4079
4093
|
} else {
|
|
4080
|
-
quotes = curColumn.name + ' ' + `以 ${firstVal} 开始`;
|
|
4094
|
+
quotes = getQuotesName(curColumn.name) + ' ' + `以 ${firstVal} 开始`;
|
|
4081
4095
|
}
|
|
4082
4096
|
} else if (condition === '以...结束') {
|
|
4083
4097
|
if (isEn) {
|
|
4084
|
-
quotes = curColumn.name + ' ' + `endWith ${firstVal}`;
|
|
4098
|
+
quotes = getQuotesName(curColumn.name) + ' ' + `endWith ${firstVal}`;
|
|
4085
4099
|
} else {
|
|
4086
|
-
quotes = curColumn.name + ' ' + `以 ${firstVal} 结束`;
|
|
4100
|
+
quotes = getQuotesName(curColumn.name) + ' ' + `以 ${firstVal} 结束`;
|
|
4087
4101
|
}
|
|
4088
4102
|
} else if (condition === '介于之间') {
|
|
4089
4103
|
if (isEn) {
|
|
4090
|
-
quotes = curColumn.name + ' ' + `Between ${firstVal} and ${secondVal}`;
|
|
4104
|
+
quotes = getQuotesName(curColumn.name) + ' ' + `Between ${firstVal} and ${secondVal}`;
|
|
4091
4105
|
} else {
|
|
4092
|
-
quotes = curColumn.name + ' ' + `介于${firstVal}和${secondVal}之间`;
|
|
4106
|
+
quotes = getQuotesName(curColumn.name) + ' ' + `介于${firstVal}和${secondVal}之间`;
|
|
4093
4107
|
}
|
|
4094
4108
|
} else if (condition === '前') {
|
|
4095
4109
|
if (isEn) {
|
|
4096
|
-
quotes = curColumn.name + ' ' + `previous ${firstVal}${secondVal}`;
|
|
4110
|
+
quotes = getQuotesName(curColumn.name) + ' ' + `previous ${firstVal}${secondVal}`;
|
|
4097
4111
|
} else {
|
|
4098
|
-
quotes = curColumn.name + ' ' + `上一个${firstVal}${secondVal}`;
|
|
4112
|
+
quotes = getQuotesName(curColumn.name) + ' ' + `上一个${firstVal}${secondVal}`;
|
|
4099
4113
|
}
|
|
4100
4114
|
} else if (condition === '下一个') {
|
|
4101
4115
|
if (isEn) {
|
|
4102
|
-
quotes = curColumn.name + ' ' + `next ${firstVal}${secondVal}`;
|
|
4116
|
+
quotes = getQuotesName(curColumn.name) + ' ' + `next ${firstVal}${secondVal}`;
|
|
4103
4117
|
} else {
|
|
4104
|
-
quotes = curColumn.name + ' ' + `下一个${firstVal}${secondVal}`;
|
|
4118
|
+
quotes = getQuotesName(curColumn.name) + ' ' + `下一个${firstVal}${secondVal}`;
|
|
4105
4119
|
}
|
|
4106
4120
|
} else if (condition === '在') {
|
|
4107
4121
|
if (isEn) {
|
|
4108
|
-
quotes = curColumn.name + ' is ' + firstVal;
|
|
4122
|
+
quotes = getQuotesName(curColumn.name) + ' is ' + firstVal;
|
|
4109
4123
|
} else {
|
|
4110
|
-
quotes = curColumn.name + ' 是 ' + firstVal;
|
|
4124
|
+
quotes = getQuotesName(curColumn.name) + ' 是 ' + firstVal;
|
|
4111
4125
|
}
|
|
4112
4126
|
} else if (condition === '是空的') {
|
|
4113
4127
|
if (isEn) {
|
|
4114
|
-
quotes = curColumn.name + ' is empty';
|
|
4128
|
+
quotes = getQuotesName(curColumn.name) + ' is empty';
|
|
4115
4129
|
} else {
|
|
4116
|
-
quotes = curColumn.name + ' 为空';
|
|
4130
|
+
quotes = getQuotesName(curColumn.name) + ' 为空';
|
|
4117
4131
|
}
|
|
4118
4132
|
} else if (condition === '不是空的') {
|
|
4119
4133
|
if (isEn) {
|
|
4120
|
-
quotes = curColumn.name + ' not empty';
|
|
4134
|
+
quotes = getQuotesName(curColumn.name) + ' not empty';
|
|
4121
4135
|
} else {
|
|
4122
|
-
quotes = curColumn.name + ' 不为空';
|
|
4136
|
+
quotes = getQuotesName(curColumn.name) + ' 不为空';
|
|
4123
4137
|
}
|
|
4124
4138
|
} else if (condition === '当前') {
|
|
4125
4139
|
if (firstVal === '天') {
|
|
4126
4140
|
if (isEn) {
|
|
4127
|
-
quotes = curColumn.name + ' ' + `today`;
|
|
4141
|
+
quotes = getQuotesName(curColumn.name) + ' ' + `today`;
|
|
4128
4142
|
} else {
|
|
4129
|
-
quotes = curColumn.name + ' ' + `今天`;
|
|
4143
|
+
quotes = getQuotesName(curColumn.name) + ' ' + `今天`;
|
|
4130
4144
|
}
|
|
4131
4145
|
} else {
|
|
4132
4146
|
if (isEn) {
|
|
4133
|
-
quotes = curColumn.name + ' ' + `this is ${firstVal}`;
|
|
4147
|
+
quotes = getQuotesName(curColumn.name) + ' ' + `this is ${firstVal}`;
|
|
4134
4148
|
} else {
|
|
4135
|
-
quotes = curColumn.name + ' ' + `这个${firstVal}`;
|
|
4149
|
+
quotes = getQuotesName(curColumn.name) + ' ' + `这个${firstVal}`;
|
|
4136
4150
|
}
|
|
4137
4151
|
}
|
|
4152
|
+
} else if (condition === 'In') {
|
|
4153
|
+
let cond = __('filter.within');
|
|
4154
|
+
quotes = getQuotesName(curColumn.name) + ' ' + cond + ' ' + `(${firstVal})`;
|
|
4155
|
+
} else if (condition === 'Not In') {
|
|
4156
|
+
let cond = __('filter.withnotin');
|
|
4157
|
+
quotes = getQuotesName(curColumn.name) + ' ' + cond + ' ' + `(${firstVal})`;
|
|
4138
4158
|
} else {
|
|
4139
4159
|
let cond = __({
|
|
4140
4160
|
等于: 'filter.equal',
|
|
@@ -4146,8 +4166,6 @@ const SelectFilterColumn = ({
|
|
|
4146
4166
|
小于或等于: 'filter.lessThanOrEqualTo',
|
|
4147
4167
|
为空: 'filter.empty',
|
|
4148
4168
|
不为空: 'filter.notEmpty',
|
|
4149
|
-
是: 'filter.is',
|
|
4150
|
-
不是: 'filter.isNo',
|
|
4151
4169
|
包含: 'filter.contain',
|
|
4152
4170
|
不包含: 'filter.notInclude',
|
|
4153
4171
|
'以...开始': 'filter.startWith',
|
|
@@ -4157,9 +4175,9 @@ const SelectFilterColumn = ({
|
|
|
4157
4175
|
是空的: 'filter.isEmpty'
|
|
4158
4176
|
}[condition]);
|
|
4159
4177
|
if (curColumn.table2?.id) {
|
|
4160
|
-
quotes = curColumn.name + ' ' + cond + ' ' + curColumn.table2.name;
|
|
4178
|
+
quotes = getQuotesName(curColumn.name) + ' ' + cond + ' ' + curColumn.table2.name;
|
|
4161
4179
|
} else {
|
|
4162
|
-
quotes = curColumn.name + ' ' + cond + ' ' + firstVal;
|
|
4180
|
+
quotes = getQuotesName(curColumn.name) + ' ' + cond + ' ' + firstVal;
|
|
4163
4181
|
}
|
|
4164
4182
|
}
|
|
4165
4183
|
return quotes;
|
|
@@ -4169,6 +4187,7 @@ const SelectFilterColumn = ({
|
|
|
4169
4187
|
let quotes = generateQuotes(curVal, curColumn);
|
|
4170
4188
|
typeof onChange === 'function' && onChange({
|
|
4171
4189
|
...curColumn,
|
|
4190
|
+
formula: formula,
|
|
4172
4191
|
val: curVal,
|
|
4173
4192
|
// 选择结果 如果有两个 长度就为2
|
|
4174
4193
|
isField: isField,
|
|
@@ -4198,6 +4217,7 @@ const SelectFilterColumn = ({
|
|
|
4198
4217
|
database_type: '' // 字段类型
|
|
4199
4218
|
});
|
|
4200
4219
|
setCondition('');
|
|
4220
|
+
setFormula({});
|
|
4201
4221
|
setVal([]);
|
|
4202
4222
|
}
|
|
4203
4223
|
function getData(data) {
|
|
@@ -4371,7 +4391,25 @@ const SelectFilterColumn = ({
|
|
|
4371
4391
|
}
|
|
4372
4392
|
})
|
|
4373
4393
|
});
|
|
4374
|
-
} else if (~['
|
|
4394
|
+
} else if (~['In', 'Not In'].indexOf(conditionText)) {
|
|
4395
|
+
const options = firstVal?.split(',') || [];
|
|
4396
|
+
return jsx("div", {
|
|
4397
|
+
children: jsx(Select, {
|
|
4398
|
+
size: 'large',
|
|
4399
|
+
placeholder: '\u53EF\u8F93\u5165\u56DE\u8F66\u65B0\u589E\u4E0B\u62C9\u9009\u9879',
|
|
4400
|
+
allowCreate: true,
|
|
4401
|
+
multiple: true,
|
|
4402
|
+
value: options,
|
|
4403
|
+
onChange: val => {
|
|
4404
|
+
setVal([val.join(',')]);
|
|
4405
|
+
},
|
|
4406
|
+
children: options.map(option => jsx(Select.Option, {
|
|
4407
|
+
value: option,
|
|
4408
|
+
children: option
|
|
4409
|
+
}, option))
|
|
4410
|
+
})
|
|
4411
|
+
});
|
|
4412
|
+
} else if (~['等于', '不等于', '大于', '小于', '大于或等于', '小于或等于', '包含', '不包含', '以...开始', '以...结束'].indexOf(conditionText)) {
|
|
4375
4413
|
return jsx("div", {
|
|
4376
4414
|
children: jsx(Input, {
|
|
4377
4415
|
className: 'input',
|
|
@@ -4437,28 +4475,111 @@ const SelectFilterColumn = ({
|
|
|
4437
4475
|
小于或等于: 'filter.lessThanOrEqualTo',
|
|
4438
4476
|
为空: 'filter.empty',
|
|
4439
4477
|
不为空: 'filter.notEmpty',
|
|
4440
|
-
是: 'filter.is',
|
|
4441
|
-
不是: 'filter.isNo',
|
|
4442
4478
|
包含: 'filter.contain',
|
|
4443
4479
|
不包含: 'filter.notInclude',
|
|
4444
4480
|
'以...开始': 'filter.startWith',
|
|
4445
4481
|
'以...结束': 'filter.endWith',
|
|
4446
4482
|
早于: 'filter.earlierThan',
|
|
4447
4483
|
晚于: 'filter.laterThan',
|
|
4448
|
-
是空的: 'filter.isEmpty'
|
|
4484
|
+
是空的: 'filter.isEmpty',
|
|
4485
|
+
In: 'filter.within',
|
|
4486
|
+
'Not In': 'filter.withnotin'
|
|
4449
4487
|
}[v])
|
|
4450
4488
|
};
|
|
4451
4489
|
});
|
|
4490
|
+
const changeFormula = val => {
|
|
4491
|
+
let params = [];
|
|
4492
|
+
if (val === 'SUBSTR') {
|
|
4493
|
+
params[0] = curColumn.name;
|
|
4494
|
+
}
|
|
4495
|
+
setFormula({
|
|
4496
|
+
type: val,
|
|
4497
|
+
params: params
|
|
4498
|
+
});
|
|
4499
|
+
};
|
|
4500
|
+
const changeParams = (val, i) => {
|
|
4501
|
+
const _formula = {
|
|
4502
|
+
...formula
|
|
4503
|
+
};
|
|
4504
|
+
if (_formula.params) {
|
|
4505
|
+
_formula.params[i] = val;
|
|
4506
|
+
setFormula({
|
|
4507
|
+
..._formula
|
|
4508
|
+
});
|
|
4509
|
+
}
|
|
4510
|
+
};
|
|
4511
|
+
let formulas = [{
|
|
4512
|
+
key: 'SUBSTR',
|
|
4513
|
+
label: 'SUBSTR'
|
|
4514
|
+
}];
|
|
4515
|
+
const leftFormula = () => {
|
|
4516
|
+
return jsx("div", {
|
|
4517
|
+
className: 'left-info-formula',
|
|
4518
|
+
children: jsx(Dropdown, {
|
|
4519
|
+
menu: {
|
|
4520
|
+
items: formulas,
|
|
4521
|
+
onClick: ({
|
|
4522
|
+
key
|
|
4523
|
+
}) => {
|
|
4524
|
+
changeFormula(key);
|
|
4525
|
+
}
|
|
4526
|
+
},
|
|
4527
|
+
trigger: ['click'],
|
|
4528
|
+
children: jsx(Button, {
|
|
4529
|
+
className: 'operator-icon',
|
|
4530
|
+
icon: jsx(Function, {})
|
|
4531
|
+
})
|
|
4532
|
+
})
|
|
4533
|
+
});
|
|
4534
|
+
};
|
|
4535
|
+
const getName = name => {
|
|
4536
|
+
switch (formula.type) {
|
|
4537
|
+
case 'SUBSTR':
|
|
4538
|
+
return jsxs("div", {
|
|
4539
|
+
children: ["SUBSTR(", name, ",", jsx(InputNumber, {
|
|
4540
|
+
className: 'left-info-formula-input',
|
|
4541
|
+
hideControl: true,
|
|
4542
|
+
placeholder: '',
|
|
4543
|
+
onClick: e => {
|
|
4544
|
+
e.stopPropagation();
|
|
4545
|
+
return false;
|
|
4546
|
+
},
|
|
4547
|
+
size: 'small',
|
|
4548
|
+
value: formula?.params?.[1],
|
|
4549
|
+
onChange: val => {
|
|
4550
|
+
changeParams(val, 1);
|
|
4551
|
+
}
|
|
4552
|
+
}), ",", jsx(InputNumber, {
|
|
4553
|
+
className: 'left-info-formula-input',
|
|
4554
|
+
hideControl: true,
|
|
4555
|
+
quickEdit: true,
|
|
4556
|
+
placeholder: '',
|
|
4557
|
+
onClick: e => {
|
|
4558
|
+
e.stopPropagation();
|
|
4559
|
+
return false;
|
|
4560
|
+
},
|
|
4561
|
+
size: 'small',
|
|
4562
|
+
value: formula?.params?.[2],
|
|
4563
|
+
onChange: val => {
|
|
4564
|
+
changeParams(val, 2);
|
|
4565
|
+
}
|
|
4566
|
+
}), ")"]
|
|
4567
|
+
});
|
|
4568
|
+
default:
|
|
4569
|
+
return name;
|
|
4570
|
+
}
|
|
4571
|
+
};
|
|
4452
4572
|
return jsxs("div", {
|
|
4453
4573
|
className: 'filter-page',
|
|
4454
4574
|
children: [jsxs("div", {
|
|
4455
4575
|
className: 'header',
|
|
4456
|
-
children: [
|
|
4576
|
+
children: [jsxs("div", {
|
|
4457
4577
|
className: 'left-info',
|
|
4458
|
-
children: jsxs("span", {
|
|
4578
|
+
children: [jsxs("span", {
|
|
4579
|
+
className: 'span-name',
|
|
4459
4580
|
onClick: goPrevPage,
|
|
4460
|
-
children: [jsx(LeftArrowIcon, {}), curColumn.name]
|
|
4461
|
-
})
|
|
4581
|
+
children: [jsx(LeftArrowIcon, {}), getName(curColumn.name)]
|
|
4582
|
+
}), leftFormula()]
|
|
4462
4583
|
}), jsx("div", {
|
|
4463
4584
|
className: 'right-info',
|
|
4464
4585
|
children: jsx(Dropdown, {
|
|
@@ -4494,15 +4615,15 @@ const SelectFilterColumn = ({
|
|
|
4494
4615
|
小于或等于: 'filter.lessThanOrEqualTo',
|
|
4495
4616
|
为空: 'filter.empty',
|
|
4496
4617
|
不为空: 'filter.notEmpty',
|
|
4497
|
-
是: 'filter.is',
|
|
4498
|
-
不是: 'filter.isNo',
|
|
4499
4618
|
包含: 'filter.contain',
|
|
4500
4619
|
不包含: 'filter.notInclude',
|
|
4501
4620
|
'以...开始': 'filter.startWith',
|
|
4502
4621
|
'以...结束': 'filter.endWith',
|
|
4503
4622
|
早于: 'filter.earlierThan',
|
|
4504
4623
|
晚于: 'filter.laterThan',
|
|
4505
|
-
是空的: 'filter.isEmpty'
|
|
4624
|
+
是空的: 'filter.isEmpty',
|
|
4625
|
+
In: 'filter.within',
|
|
4626
|
+
'Not In': 'filter.withnotin'
|
|
4506
4627
|
}[condition]), jsx(DownOutlined, {})]
|
|
4507
4628
|
})
|
|
4508
4629
|
})
|
|
@@ -4518,7 +4639,7 @@ const SelectFilterColumn = ({
|
|
|
4518
4639
|
}) : jsx("div", {
|
|
4519
4640
|
className: 'content_l',
|
|
4520
4641
|
children: renderFilter(type, condition)
|
|
4521
|
-
}), ~['
|
|
4642
|
+
}), ~['等于', '不等于'].indexOf(condition) ? jsx(Tooltip, {
|
|
4522
4643
|
title: __('SqlQueryBuilder.switch'),
|
|
4523
4644
|
children: jsx(Button, {
|
|
4524
4645
|
primary: true,
|
|
@@ -6317,6 +6438,8 @@ const CustomColumn = props => {
|
|
|
6317
6438
|
});
|
|
6318
6439
|
};
|
|
6319
6440
|
|
|
6441
|
+
var img = "data:image/svg+xml,%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='26px' height='18px' version='1.1'%3e%3cpath d='m 1 6 L 14 6 L 14 1 L 26 9 L 14 18 L 14 12 L 1 12 z' stroke='white' fill='%2329b6f2'/%3e%3c/svg%3e";
|
|
6442
|
+
|
|
6320
6443
|
const Filter = props => {
|
|
6321
6444
|
const {
|
|
6322
6445
|
meta
|
|
@@ -6327,6 +6450,7 @@ const Filter = props => {
|
|
|
6327
6450
|
} = meta;
|
|
6328
6451
|
let index = findIndex(store.metaList, meta);
|
|
6329
6452
|
let notSelected = !meta.filter.length;
|
|
6453
|
+
const [ind, setInd] = useState(-1);
|
|
6330
6454
|
function getColumns() {
|
|
6331
6455
|
let {
|
|
6332
6456
|
ExistAboveGroupBy,
|
|
@@ -6439,8 +6563,11 @@ const Filter = props => {
|
|
|
6439
6563
|
});
|
|
6440
6564
|
}
|
|
6441
6565
|
function handleAdd(e) {
|
|
6566
|
+
let node = e.currentTarget;
|
|
6442
6567
|
let newMeta = store.metaList.slice();
|
|
6443
6568
|
let data = getColumns();
|
|
6569
|
+
let _index = node.getAttribute('v-index');
|
|
6570
|
+
let _type = node.getAttribute('v-type');
|
|
6444
6571
|
let value = {
|
|
6445
6572
|
table: '',
|
|
6446
6573
|
// 表名
|
|
@@ -6470,7 +6597,15 @@ const Filter = props => {
|
|
|
6470
6597
|
data: data,
|
|
6471
6598
|
value: value,
|
|
6472
6599
|
onChange: data => {
|
|
6473
|
-
|
|
6600
|
+
if (_type) {
|
|
6601
|
+
if (_type === 'before') {
|
|
6602
|
+
newMeta[index].filter.splice(_index, 0, data);
|
|
6603
|
+
} else {
|
|
6604
|
+
newMeta[index].filter.splice(_index + 1, 0, data);
|
|
6605
|
+
}
|
|
6606
|
+
} else {
|
|
6607
|
+
newMeta[index].filter.push(data);
|
|
6608
|
+
}
|
|
6474
6609
|
store.setMeta(newMeta);
|
|
6475
6610
|
closePopup();
|
|
6476
6611
|
}
|
|
@@ -6490,6 +6625,18 @@ const Filter = props => {
|
|
|
6490
6625
|
visible: false
|
|
6491
6626
|
});
|
|
6492
6627
|
}
|
|
6628
|
+
const options = ['(', ')', 'AND', 'OR'];
|
|
6629
|
+
const addOperator = (val, i, type) => {
|
|
6630
|
+
let newMeta = store.metaList.slice();
|
|
6631
|
+
let _filter = filter.slice();
|
|
6632
|
+
if (type === 'before') {
|
|
6633
|
+
_filter.splice(i, 0, val);
|
|
6634
|
+
} else {
|
|
6635
|
+
_filter.splice(i + 1, 0, val);
|
|
6636
|
+
}
|
|
6637
|
+
newMeta[index].filter = [..._filter];
|
|
6638
|
+
setInd(-1);
|
|
6639
|
+
};
|
|
6493
6640
|
return jsx(Wrapper, {
|
|
6494
6641
|
className: `Sqb-item`,
|
|
6495
6642
|
children: jsxs("div", {
|
|
@@ -6507,14 +6654,80 @@ const Filter = props => {
|
|
|
6507
6654
|
className: `Sqb-NotebookCell gray-bg`,
|
|
6508
6655
|
children: [filter.map((v, i) => {
|
|
6509
6656
|
return jsxs("div", {
|
|
6510
|
-
className:
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6657
|
+
className: cx('Sqb-Filter-item', {
|
|
6658
|
+
hover: ind === i
|
|
6659
|
+
}),
|
|
6660
|
+
onMouseEnter: e => {
|
|
6661
|
+
setInd(i);
|
|
6662
|
+
},
|
|
6663
|
+
onMouseLeave: () => {
|
|
6664
|
+
setInd(-1);
|
|
6665
|
+
},
|
|
6666
|
+
children: [jsx(Select, {
|
|
6667
|
+
trigger: 'hover',
|
|
6668
|
+
triggerProps: {
|
|
6669
|
+
clickToClose: true
|
|
6515
6670
|
},
|
|
6516
|
-
|
|
6517
|
-
|
|
6671
|
+
triggerElement: () => {
|
|
6672
|
+
return jsx("div", {
|
|
6673
|
+
className: 'left-arrow',
|
|
6674
|
+
onClick: handleAdd,
|
|
6675
|
+
"v-index": i,
|
|
6676
|
+
"v-type": 'before',
|
|
6677
|
+
children: jsx("img", {
|
|
6678
|
+
src: img
|
|
6679
|
+
})
|
|
6680
|
+
});
|
|
6681
|
+
},
|
|
6682
|
+
onChange: val => {
|
|
6683
|
+
addOperator(val, i, 'before');
|
|
6684
|
+
},
|
|
6685
|
+
children: options.map(option => jsx(Select.Option, {
|
|
6686
|
+
value: option,
|
|
6687
|
+
children: option
|
|
6688
|
+
}, option))
|
|
6689
|
+
}), typeof v === 'string' ? jsxs("div", {
|
|
6690
|
+
className: `Sqb-TableName purple-name`,
|
|
6691
|
+
children: [v, jsx("span", {
|
|
6692
|
+
style: {
|
|
6693
|
+
fontSize: 0
|
|
6694
|
+
},
|
|
6695
|
+
onClick: e => handleDel(e, i),
|
|
6696
|
+
children: jsx(CloseIcon, {})
|
|
6697
|
+
})]
|
|
6698
|
+
}, i) : jsxs("div", {
|
|
6699
|
+
className: `Sqb-TableName purple-name`,
|
|
6700
|
+
onClick: e => handleUpdate(e, i),
|
|
6701
|
+
children: [v.quotes, jsx("span", {
|
|
6702
|
+
style: {
|
|
6703
|
+
fontSize: 0
|
|
6704
|
+
},
|
|
6705
|
+
onClick: e => handleDel(e, i),
|
|
6706
|
+
children: jsx(CloseIcon, {})
|
|
6707
|
+
})]
|
|
6708
|
+
}, i), jsx(Select, {
|
|
6709
|
+
trigger: 'hover',
|
|
6710
|
+
triggerProps: {
|
|
6711
|
+
clickToClose: true
|
|
6712
|
+
},
|
|
6713
|
+
triggerElement: value => {
|
|
6714
|
+
return jsx("div", {
|
|
6715
|
+
className: 'right-arrow',
|
|
6716
|
+
onClick: handleAdd,
|
|
6717
|
+
"v-index": i,
|
|
6718
|
+
"v-type": 'after',
|
|
6719
|
+
children: jsx("img", {
|
|
6720
|
+
src: img
|
|
6721
|
+
})
|
|
6722
|
+
});
|
|
6723
|
+
},
|
|
6724
|
+
onChange: val => {
|
|
6725
|
+
addOperator(val, i, 'after');
|
|
6726
|
+
},
|
|
6727
|
+
children: options.map(option => jsx(Select.Option, {
|
|
6728
|
+
value: option,
|
|
6729
|
+
children: option
|
|
6730
|
+
}, option))
|
|
6518
6731
|
})]
|
|
6519
6732
|
}, i);
|
|
6520
6733
|
}), jsx("div", {
|
|
@@ -6523,6 +6736,15 @@ const Filter = props => {
|
|
|
6523
6736
|
}),
|
|
6524
6737
|
onClick: handleAdd,
|
|
6525
6738
|
children: notSelected ? __('filter.addFiltersToNarrowDownYourAnswers') : jsx(AddIcon, {})
|
|
6739
|
+
}), Array.from(filter).length > 0 && jsxs("p", {
|
|
6740
|
+
className: 'Sqb-NotebookCell-preview',
|
|
6741
|
+
children: ["\u9884\u89C8\uFF1A", filter.map((v, i) => {
|
|
6742
|
+
if (typeof v === 'string') {
|
|
6743
|
+
return v;
|
|
6744
|
+
} else {
|
|
6745
|
+
return v.quotes;
|
|
6746
|
+
}
|
|
6747
|
+
}).join(' ')]
|
|
6526
6748
|
})]
|
|
6527
6749
|
})
|
|
6528
6750
|
}), jsx(NextDom, {
|
|
@@ -7229,7 +7451,7 @@ const RowLimit = props => {
|
|
|
7229
7451
|
className: cx(`Sqb-item--content`),
|
|
7230
7452
|
children: jsx("div", {
|
|
7231
7453
|
className: cx(`Sqb-NotebookCell gray-bg`),
|
|
7232
|
-
children: jsx(InputNumber, {
|
|
7454
|
+
children: jsx(InputNumber$1, {
|
|
7233
7455
|
value: meta.limit,
|
|
7234
7456
|
min: 1,
|
|
7235
7457
|
style: {
|