@platox/pivot-table 0.0.34 → 0.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/dashboard-workbench/components/add-module-btn/index.js +14 -5
- package/es/dashboard-workbench/components/add-module-btn/index.js.map +1 -1
- package/es/dashboard-workbench/components/add-module-modal/add-calendar-modal/custome-data.d.ts +3 -3
- package/es/dashboard-workbench/components/add-module-modal/add-calendar-modal/custome-data.js +73 -82
- package/es/dashboard-workbench/components/add-module-modal/add-calendar-modal/custome-data.js.map +1 -1
- package/es/dashboard-workbench/components/add-module-modal/add-calendar-modal/index.d.ts +1 -5
- package/es/dashboard-workbench/components/add-module-modal/add-calendar-modal/index.js +13 -22
- package/es/dashboard-workbench/components/add-module-modal/add-calendar-modal/index.js.map +1 -1
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/components/CombinationChartOptionPicker.d.ts +18 -0
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/components/CombinationChartOptionPicker.js +103 -0
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/components/CombinationChartOptionPicker.js.map +1 -0
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/components/GroupFieldConfigPicker.d.ts +14 -0
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/components/GroupFieldConfigPicker.js +79 -0
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/components/GroupFieldConfigPicker.js.map +1 -0
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/components/index.module.less.js +11 -0
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/components/index.module.less.js.map +1 -0
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/config.d.ts +14 -0
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/config.js +153 -0
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/config.js.map +1 -0
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/custome-data.d.ts +1 -19
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/custome-data.js +132 -101
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/custome-data.js.map +1 -1
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/custome-styles.d.ts +0 -6
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/custome-styles.js +2 -4
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/custome-styles.js.map +1 -1
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/index.d.ts +1 -8
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/index.js +13 -22
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/index.js.map +1 -1
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/index.module.less.js +7 -0
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/index.module.less.js.map +1 -0
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/interface.d.ts +62 -0
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/interface.js +31 -0
- package/es/dashboard-workbench/components/add-module-modal/add-chart-modal/interface.js.map +1 -0
- package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/custome-data.d.ts +3 -3
- package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/custome-data.js +2 -2
- package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/custome-data.js.map +1 -1
- package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/custome-styles.js +16 -11
- package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/custome-styles.js.map +1 -1
- package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/index.d.ts +1 -7
- package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/index.js +13 -22
- package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/index.js.map +1 -1
- package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/config.d.ts +30 -0
- package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/config.js +132 -0
- package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/config.js.map +1 -0
- package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/debounce-select.js.map +1 -1
- package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/index.d.ts +4 -12
- package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/index.js +6 -200
- package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/index.js.map +1 -1
- package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/interface.d.ts +14 -0
- package/es/dashboard-workbench/components/global-filter-condition/ConditionRowItem.d.ts +9 -0
- package/es/dashboard-workbench/components/global-filter-condition/ConditionRowItem.js +90 -0
- package/es/dashboard-workbench/components/global-filter-condition/ConditionRowItem.js.map +1 -0
- package/es/dashboard-workbench/components/global-filter-condition/ConditionSymbolAndValuePicker.d.ts +15 -0
- package/es/dashboard-workbench/components/global-filter-condition/ConditionSymbolAndValuePicker.js +218 -0
- package/es/dashboard-workbench/components/global-filter-condition/ConditionSymbolAndValuePicker.js.map +1 -0
- package/es/dashboard-workbench/components/global-filter-condition/FieldPicker.d.ts +13 -0
- package/es/dashboard-workbench/components/global-filter-condition/FieldPicker.js +56 -0
- package/es/dashboard-workbench/components/global-filter-condition/FieldPicker.js.map +1 -0
- package/es/dashboard-workbench/components/global-filter-condition/index.d.ts +13 -0
- package/es/dashboard-workbench/components/global-filter-condition/index.js +311 -0
- package/es/dashboard-workbench/components/global-filter-condition/index.js.map +1 -0
- package/es/dashboard-workbench/components/global-filter-condition/index.module.less.js +8 -0
- package/es/dashboard-workbench/components/global-filter-condition/index.module.less.js.map +1 -0
- package/es/dashboard-workbench/components/global-filter-condition/interface.d.ts +9 -0
- package/es/dashboard-workbench/components/global-filter-condition/useContext.d.ts +13 -0
- package/es/dashboard-workbench/components/global-filter-condition/useContext.js +10 -0
- package/es/dashboard-workbench/components/global-filter-condition/useContext.js.map +1 -0
- package/es/dashboard-workbench/components/global-filter-condition/util.d.ts +1 -0
- package/es/dashboard-workbench/components/global-filter-condition/util.js +7 -0
- package/es/dashboard-workbench/components/global-filter-condition/util.js.map +1 -0
- package/es/dashboard-workbench/components/modal-editor-header/index.d.ts +12 -0
- package/es/dashboard-workbench/components/modal-editor-header/index.js +59 -0
- package/es/dashboard-workbench/components/modal-editor-header/index.js.map +1 -0
- package/es/dashboard-workbench/components/modal-editor-header/index.module.less.js +9 -0
- package/es/dashboard-workbench/components/modal-editor-header/index.module.less.js.map +1 -0
- package/es/dashboard-workbench/components/module-content/calendar-module/index.js +38 -26
- package/es/dashboard-workbench/components/module-content/calendar-module/index.js.map +1 -1
- package/es/dashboard-workbench/components/module-content/calendar-module/locales/en.d.ts +7 -0
- package/es/dashboard-workbench/components/module-content/calendar-module/locales/en.js +10 -0
- package/es/dashboard-workbench/components/module-content/calendar-module/locales/en.js.map +1 -0
- package/es/dashboard-workbench/components/module-content/calendar-module/locales/zh.d.ts +22 -0
- package/es/dashboard-workbench/components/module-content/calendar-module/locales/zh.js +29 -0
- package/es/dashboard-workbench/components/module-content/calendar-module/locales/zh.js.map +1 -0
- package/es/dashboard-workbench/components/module-content/chart-module/Empty.d.ts +5 -0
- package/es/dashboard-workbench/components/module-content/chart-module/Empty.js +30 -0
- package/es/dashboard-workbench/components/module-content/chart-module/Empty.js.map +1 -0
- package/es/dashboard-workbench/components/module-content/chart-module/base-chart/index.js +1 -1
- package/es/dashboard-workbench/components/module-content/chart-module/base-chart/index.js.map +1 -1
- package/es/dashboard-workbench/components/module-content/chart-module/index.d.ts +3 -4
- package/es/dashboard-workbench/components/module-content/chart-module/index.js +263 -160
- package/es/dashboard-workbench/components/module-content/chart-module/index.js.map +1 -1
- package/es/dashboard-workbench/components/module-content/chart-module/utils.d.ts +100 -2
- package/es/dashboard-workbench/components/module-content/chart-module/utils.js +66 -13
- package/es/dashboard-workbench/components/module-content/chart-module/utils.js.map +1 -1
- package/es/dashboard-workbench/components/module-content/index.js +3 -3
- package/es/dashboard-workbench/components/module-content/index.js.map +1 -1
- package/es/dashboard-workbench/components/module-content/statistics-module/index.d.ts +1 -1
- package/es/dashboard-workbench/components/module-content/statistics-module/index.js +17 -7
- package/es/dashboard-workbench/components/module-content/statistics-module/index.js.map +1 -1
- package/es/dashboard-workbench/components/module-content/text-module/editor/index.js +5 -5
- package/es/dashboard-workbench/components/module-content/text-module/editor/index.js.map +1 -1
- package/es/dashboard-workbench/components/module-content/utils.d.ts +2 -15
- package/es/dashboard-workbench/components/module-content/utils.js.map +1 -1
- package/es/dashboard-workbench/components/module-header/index.d.ts +1 -1
- package/es/dashboard-workbench/components/module-header/index.js +3 -3
- package/es/dashboard-workbench/components/module-header/index.js.map +1 -1
- package/es/dashboard-workbench/context.d.ts +21 -9
- package/es/dashboard-workbench/context.js +2 -9
- package/es/dashboard-workbench/context.js.map +1 -1
- package/es/dashboard-workbench/icon/icon-chart-combination.d.ts +3 -0
- package/es/dashboard-workbench/icon/icon-chart-combination.js +36 -0
- package/es/dashboard-workbench/icon/icon-chart-combination.js.map +1 -0
- package/es/dashboard-workbench/icon/icon-empty.d.ts +2 -0
- package/es/dashboard-workbench/icon/icon-empty.js +139 -0
- package/es/dashboard-workbench/icon/icon-empty.js.map +1 -0
- package/es/dashboard-workbench/index.d.ts +2 -2
- package/es/dashboard-workbench/index.js +92 -83
- package/es/dashboard-workbench/index.js.map +1 -1
- package/es/dashboard-workbench/lang/en-US.d.ts +38 -0
- package/es/dashboard-workbench/lang/en-US.js +32 -4
- package/es/dashboard-workbench/lang/en-US.js.map +1 -1
- package/es/dashboard-workbench/lang/index.js +2 -2
- package/es/dashboard-workbench/lang/index.js.map +1 -1
- package/es/dashboard-workbench/lang/zh-CN.d.ts +38 -0
- package/es/dashboard-workbench/lang/zh-CN.js +31 -3
- package/es/dashboard-workbench/lang/zh-CN.js.map +1 -1
- package/es/dashboard-workbench/types.d.ts +18 -5
- package/es/dashboard-workbench/utils/index.d.ts +6 -4
- package/es/dashboard-workbench/utils/index.js +24 -3
- package/es/dashboard-workbench/utils/index.js.map +1 -1
- package/es/style.css +1 -1
- package/package.json +28 -20
- package/umd/pivot-table.umd.cjs +74 -74
- package/umd/style.css +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custome-styles.js","sources":["../../../../../packages/dashboard-workbench/components/add-module-modal/add-statistics-modal/custome-styles.tsx"],"sourcesContent":["import { Form, Input, InputNumber, Select, Space } from 'antd'\nimport {
|
|
1
|
+
{"version":3,"file":"custome-styles.js","sources":["../../../../../packages/dashboard-workbench/components/add-module-modal/add-statistics-modal/custome-styles.tsx"],"sourcesContent":["import { useEffect, useMemo } from 'react'\nimport { Form, Input, InputNumber, Select, Space } from 'antd'\nimport { useTranslation } from 'react-i18next'\nimport { ModuleData } from '../../module-content'\nimport SelectColor from '../components/select-color'\n\nexport type StatisticsCustomeStylesTypes = {\n color?: string\n unit?: string\n precision?: number\n desc: string\n}\n\ninterface CustomeStylesProps {\n selectModuleData?: ModuleData\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onAllValuesChange?: ((values: any) => void) | undefined\n}\nconst CustomeStyles: React.FC<CustomeStylesProps> = ({ selectModuleData, onAllValuesChange }) => {\n const [form] = Form.useForm()\n const { t, i18n } = useTranslation()\n\n const UnitOptions = useMemo(() => {\n return [\n {\n // 数字 千分位\n value: '1',\n label: t('statistics.t5'),\n },\n {\n // 数字\n value: '2',\n label: t('statistics.t6'),\n },\n {\n // 百分比\n value: '3',\n label: t('statistics.t7'),\n },\n {\n //人民币\n value: '4',\n label: t('statistics.t8'),\n },\n {\n //美元\n value: '5',\n label: t('statistics.t9'),\n },\n {\n // 欧元\n value: '6',\n label: t('statistics.t11'),\n },\n {\n // 英镑\n value: '7',\n label: t('statistics.t12'),\n },\n {\n // 泰铢\n value: '9',\n label: t('statistics.t13'),\n },\n ]\n }, [i18n.language])\n\n const initialValues = {\n color: '#373c43',\n unit: '1',\n precision: '',\n desc: '',\n }\n\n const allValuesChange = () => {\n setTimeout(() => {\n onAllValuesChange?.(form.getFieldsValue())\n })\n }\n\n useEffect(() => {\n if (selectModuleData?.customeStyle) {\n let _initialValues = {\n ...initialValues,\n ...selectModuleData.customeStyle,\n unit: `${selectModuleData.customeStyle.unit ?? initialValues.unit}`,\n }\n form.setFieldsValue(_initialValues)\n } else {\n form.setFieldsValue(initialValues)\n }\n }, [selectModuleData])\n\n return (\n <Form form={form} name=\"customeStyle\" layout=\"vertical\" initialValues={initialValues}>\n <Form.Item label={t('statistics.t1')} name=\"color\">\n <SelectColor\n onChange={() => {\n allValuesChange()\n }}\n />\n </Form.Item>\n\n <Form.Item label={t('statistics.t2')} extra={t('statistics.t3')}>\n <Space.Compact>\n <Form.Item name=\"precision\" noStyle>\n <InputNumber\n min={1}\n max={10}\n style={{ width: '60%' }}\n placeholder={t('statistics.t4')}\n onChange={() => {\n allValuesChange()\n }}\n />\n </Form.Item>\n <Form.Item name=\"unit\" noStyle>\n <Select\n onChange={() => {\n allValuesChange()\n }}\n >\n {UnitOptions.map(v => {\n const { value, label } = v\n return (\n <Select.Option key={value} value={value}>\n {label}\n </Select.Option>\n )\n })}\n {/* <Select.Option value=\"1\">{t('statistics.t5')}</Select.Option>\n <Select.Option value=\"2\">{t('statistics.t6')}</Select.Option>\n <Select.Option value=\"3\">{t('statistics.t7')}</Select.Option>\n <Select.Option value=\"4\">{t('statistics.t8')}</Select.Option>\n <Select.Option value=\"5\">{t('statistics.t9')}</Select.Option>\n <Select.Option value=\"6\">{t('statistics.t11')}</Select.Option>\n <Select.Option value=\"7\">{t('statistics.t12')}</Select.Option>\n <Select.Option value=\"8\">{t('statistics.t13')}</Select.Option> */}\n </Select>\n </Form.Item>\n </Space.Compact>\n </Form.Item>\n\n <Form.Item label={t('statistics.t10')} name=\"desc\">\n <Input\n onChange={() => {\n allValuesChange()\n }}\n />\n </Form.Item>\n </Form>\n )\n}\nexport default CustomeStyles\n"],"names":["SelectColor"],"mappings":";;;;;AAkBA,MAAM,gBAA8C,CAAC,EAAE,kBAAkB,wBAAwB;AAC/F,QAAM,CAAC,IAAI,IAAI,KAAK,QA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
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { StatisticsCustomeDataTypes } from './custome-data';
|
|
3
|
-
import { StatisticsCustomeStylesTypes } from './custome-styles';
|
|
4
2
|
import { ModuleDataApi } from '../../../types';
|
|
5
3
|
import { ModuleData } from '../../module-content';
|
|
6
4
|
interface AddStatisticsModalProps {
|
|
7
5
|
open: boolean;
|
|
8
6
|
onClose?: () => void;
|
|
7
|
+
onOk?: (data: Partial<ModuleData>) => void;
|
|
9
8
|
selectModuleData?: ModuleData;
|
|
10
|
-
onOk?: ({ id, customData, customeStyle, }: {
|
|
11
|
-
id?: ModuleData['id'];
|
|
12
|
-
customData?: StatisticsCustomeDataTypes;
|
|
13
|
-
customeStyle?: StatisticsCustomeStylesTypes;
|
|
14
|
-
}) => void;
|
|
15
9
|
moduleDataApi?: ModuleDataApi;
|
|
16
10
|
enumDataApi?: any;
|
|
17
11
|
}
|
|
@@ -2,10 +2,11 @@ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
3
|
import { Modal, Tabs, Button } from "antd";
|
|
4
4
|
import { CloseOutlined } from "@ant-design/icons";
|
|
5
|
+
import { useTranslation } from "react-i18next";
|
|
6
|
+
import { EditorHeader } from "../../modal-editor-header/index.js";
|
|
7
|
+
import StatisticsModule from "../../module-content/statistics-module/index.js";
|
|
5
8
|
import CustomData from "./custome-data.js";
|
|
6
9
|
import CustomeStyles from "./custome-styles.js";
|
|
7
|
-
import StatisticsModule from "../../module-content/statistics-module/index.js";
|
|
8
|
-
import { useTranslation } from "react-i18next";
|
|
9
10
|
const AddStatisticsModal = ({
|
|
10
11
|
open,
|
|
11
12
|
onClose,
|
|
@@ -17,39 +18,28 @@ const AddStatisticsModal = ({
|
|
|
17
18
|
const { t } = useTranslation();
|
|
18
19
|
const [customData, setCustomData] = useState();
|
|
19
20
|
const [customeStyle, setCustomeStyle] = useState();
|
|
20
|
-
const handleOk = () => {
|
|
21
|
-
onClose == null ? void 0 : onClose();
|
|
22
|
-
};
|
|
23
21
|
useEffect(() => {
|
|
24
22
|
if (selectModuleData) {
|
|
25
23
|
setCustomData(selectModuleData == null ? void 0 : selectModuleData.customData);
|
|
26
24
|
setCustomeStyle(selectModuleData == null ? void 0 : selectModuleData.customeStyle);
|
|
27
25
|
}
|
|
28
26
|
}, [selectModuleData]);
|
|
27
|
+
const [title, setTitle] = useState("");
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (open) {
|
|
30
|
+
setTitle(!!(selectModuleData == null ? void 0 : selectModuleData.title) ? selectModuleData == null ? void 0 : selectModuleData.title : t("statisticsText"));
|
|
31
|
+
}
|
|
32
|
+
}, [open]);
|
|
29
33
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
30
34
|
Modal,
|
|
31
35
|
{
|
|
32
36
|
width: "65%",
|
|
33
|
-
title:
|
|
37
|
+
title: /* @__PURE__ */ jsx(EditorHeader, { value: title, onChange: setTitle }),
|
|
34
38
|
footer: null,
|
|
35
39
|
open,
|
|
36
|
-
onOk: handleOk,
|
|
37
40
|
onCancel: onClose,
|
|
38
41
|
closeIcon: /* @__PURE__ */ jsx(CloseOutlined, {}),
|
|
39
|
-
|
|
40
|
-
content: "ow"
|
|
41
|
-
},
|
|
42
|
-
styles: {
|
|
43
|
-
header: {
|
|
44
|
-
padding: "10px",
|
|
45
|
-
borderBottom: "1px solid #dee0e3",
|
|
46
|
-
marginBottom: "10px"
|
|
47
|
-
},
|
|
48
|
-
body: {
|
|
49
|
-
overflowY: "auto",
|
|
50
|
-
flex: 1
|
|
51
|
-
}
|
|
52
|
-
},
|
|
42
|
+
className: "ow",
|
|
53
43
|
children: /* @__PURE__ */ jsxs("div", { className: "config-widget-dialog-container", children: [
|
|
54
44
|
/* @__PURE__ */ jsx("div", { className: "config-widget-dialog-content", children: /* @__PURE__ */ jsx("div", { className: "config-widget-dialog-preview", children: /* @__PURE__ */ jsx(
|
|
55
45
|
StatisticsModule,
|
|
@@ -103,7 +93,8 @@ const AddStatisticsModal = ({
|
|
|
103
93
|
onOk == null ? void 0 : onOk({
|
|
104
94
|
id: selectModuleData == null ? void 0 : selectModuleData.id,
|
|
105
95
|
customData,
|
|
106
|
-
customeStyle
|
|
96
|
+
customeStyle,
|
|
97
|
+
title
|
|
107
98
|
});
|
|
108
99
|
},
|
|
109
100
|
children: t("confirm")
|
package/es/dashboard-workbench/components/add-module-modal/add-statistics-modal/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../packages/dashboard-workbench/components/add-module-modal/add-statistics-modal/index.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useEffect, useMemo, useState } from 'react'\nimport { Button, Modal, Tabs } from 'antd'\nimport { CloseOutlined } from '@ant-design/icons'\nimport
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../packages/dashboard-workbench/components/add-module-modal/add-statistics-modal/index.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useEffect, useMemo, useState } from 'react'\nimport { Button, Modal, Tabs } from 'antd'\nimport { CloseOutlined } from '@ant-design/icons'\nimport { useTranslation } from 'react-i18next'\nimport EditorHeader from '@platox/pivot-table/components/modal-editor-header'\nimport { ModuleDataApi } from '../../../types'\nimport { ModuleData } from '../../module-content'\nimport StatisticsModule from '../../module-content/statistics-module'\nimport CustomData, { StatisticsCustomeDataTypes } from './custome-data'\nimport CustomeStyles from './custome-styles'\n\ninterface AddStatisticsModalProps {\n open: boolean\n onClose?: () => void\n onOk?: (data: Partial<ModuleData>) => void\n\n selectModuleData?: ModuleData\n moduleDataApi?: ModuleDataApi\n enumDataApi?: any\n}\n\nconst AddStatisticsModal: React.FC<AddStatisticsModalProps> = ({\n open,\n onClose,\n onOk,\n\n moduleDataApi,\n selectModuleData,\n enumDataApi,\n}) => {\n const { t } = useTranslation()\n const [customData, setCustomData] = useState<StatisticsCustomeDataTypes>()\n const [customeStyle, setCustomeStyle] = useState<any>()\n\n useEffect(() => {\n if (selectModuleData) {\n setCustomData(selectModuleData?.customData)\n setCustomeStyle(selectModuleData?.customeStyle)\n }\n }, [selectModuleData])\n\n /* ============================== split =============================== */\n const [title, setTitle] = useState<string>('')\n useEffect(() => {\n if (open) {\n setTitle(!!selectModuleData?.title ? selectModuleData?.title : t('statisticsText'))\n }\n }, [open])\n\n return (\n <>\n <Modal\n width=\"65%\"\n title={<EditorHeader value={title} onChange={setTitle} />}\n footer={null}\n open={open}\n onCancel={onClose}\n closeIcon={<CloseOutlined />}\n className=\"ow\"\n >\n <div className=\"config-widget-dialog-container\">\n <div className=\"config-widget-dialog-content\">\n <div className=\"config-widget-dialog-preview\">\n <StatisticsModule\n customData={customData}\n customeStyle={customeStyle}\n moduleDataApi={moduleDataApi}\n />\n </div>\n </div>\n <div className=\"config-widget-dialog-panel\">\n <div className=\"bitable-dashboard edit-panel-container\">\n <Tabs\n defaultActiveKey=\"1\"\n items={[\n {\n key: '1',\n label: t('typeData'),\n children: (\n <CustomData\n selectModuleData={selectModuleData}\n enumDataApi={enumDataApi}\n onAllValuesChange={allVal => {\n setCustomData(allVal)\n }}\n />\n ),\n },\n {\n key: '2',\n label: t('customStyle'),\n children: (\n <CustomeStyles\n selectModuleData={selectModuleData}\n onAllValuesChange={allVal => {\n setCustomeStyle(allVal)\n }}\n />\n ),\n },\n ]}\n />\n </div>\n <div className=\"button-container\">\n <Button\n type=\"primary\"\n onClick={() => {\n onOk?.({\n id: selectModuleData?.id,\n customData,\n customeStyle,\n title,\n })\n }}\n >\n {t('confirm')}\n </Button>\n </div>\n </div>\n </div>\n </Modal>\n </>\n )\n}\n\nexport default AddStatisticsModal\n"],"names":[],"mappings":";;;;;;;;;AAsBA,MAAM,qBAAwD,CAAC;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AACF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A;AAAA,sBACA,mBAAmB,CAAU,WAAA;AAC3B,sCAAc,MAAM;AAAA,sBAAA;AAAA,oBACtB;AAAA,kBAAA;AAAA,gBAGN;AAAA,gBACA;AAAA,kBACE,KAAK;AAAA,kBACL,OAAO,EAAE,aAAa;AAAA,kBACtB,UACE;AAAA,oBAAC;AAAA,oBAAA;AAAA,sBACC;AAAA,sBACA,mBAAmB,CAAU,WAAA;AAC3B,wCAAgB,MAAM;AAAA,sBAAA;AAAA,oBACxB;AAAA,kBAAA;AAAA,gBACF;AAAA,cAEJ;AAAA,YACF;AAAA,UAAA,GAEJ;AAAA,UACA,oBAAC,OAAI,EAAA,WAAU,oBACb,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,SAAS,MAAM;AACN,6CAAA;AAAA,kBACL,IAAI,qDAAkB;AAAA,kBACtB;AAAA,kBACA;AAAA,kBACA;AAAA,gBAAA;AAAA,cAEJ;AAAA,cAEC,YAAE,SAAS;AAAA,YAAA;AAAA,UAAA,EAEhB,CAAA;AAAA,QAAA,EACF,CAAA;AAAA,MAAA,EACF,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/config.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const useConditionSymbolOptions: () => {
|
|
2
|
+
timeOptions: {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}[];
|
|
6
|
+
boolOptions: {
|
|
7
|
+
label: string;
|
|
8
|
+
value: string;
|
|
9
|
+
}[];
|
|
10
|
+
intOptions: {
|
|
11
|
+
label: string;
|
|
12
|
+
value: string;
|
|
13
|
+
}[];
|
|
14
|
+
stringOptions: {
|
|
15
|
+
label: string;
|
|
16
|
+
value: string;
|
|
17
|
+
}[];
|
|
18
|
+
rdateOptions: {
|
|
19
|
+
label: string;
|
|
20
|
+
value: string;
|
|
21
|
+
}[];
|
|
22
|
+
rdateOptions2: {
|
|
23
|
+
label: string;
|
|
24
|
+
value: string;
|
|
25
|
+
}[];
|
|
26
|
+
};
|
|
27
|
+
export declare const useConditionTypeOptions: () => {
|
|
28
|
+
label: string;
|
|
29
|
+
value: string;
|
|
30
|
+
}[];
|
package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/config.js
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { useTranslation } from "react-i18next";
|
|
3
|
+
const useConditionSymbolOptions = () => {
|
|
4
|
+
const { t, i18n } = useTranslation();
|
|
5
|
+
const timeOptions = useMemo(
|
|
6
|
+
() => [
|
|
7
|
+
{ label: t("add.add13"), value: "=" },
|
|
8
|
+
// "等于"
|
|
9
|
+
{ label: t("add.add14"), value: "<" },
|
|
10
|
+
// "早于"
|
|
11
|
+
{ label: t("add.add15"), value: ">" },
|
|
12
|
+
// "晚于"
|
|
13
|
+
{ label: t("add.add16"), value: "contain" },
|
|
14
|
+
// "范围内"
|
|
15
|
+
{ label: t("add.add17"), value: "null" },
|
|
16
|
+
// "为空"
|
|
17
|
+
{ label: t("add.add18"), value: "notnull" }
|
|
18
|
+
// "不为空"
|
|
19
|
+
],
|
|
20
|
+
[i18n.language]
|
|
21
|
+
);
|
|
22
|
+
const boolOptions = useMemo(
|
|
23
|
+
() => [
|
|
24
|
+
{ label: t("add.add13"), value: "=" }
|
|
25
|
+
// "等于"
|
|
26
|
+
],
|
|
27
|
+
[i18n.language]
|
|
28
|
+
);
|
|
29
|
+
const intOptions = useMemo(
|
|
30
|
+
() => [
|
|
31
|
+
{ label: t("add.add13"), value: "=" },
|
|
32
|
+
// "等于"
|
|
33
|
+
{ label: t("add.add19"), value: "!=" },
|
|
34
|
+
// "不等于"
|
|
35
|
+
{ label: t("add.add20"), value: ">" },
|
|
36
|
+
// "大于"
|
|
37
|
+
{ label: t("add.add21"), value: ">=" },
|
|
38
|
+
// "大于等于"
|
|
39
|
+
{ label: t("add.add22"), value: "<" },
|
|
40
|
+
// "小于"
|
|
41
|
+
{ label: t("add.add23"), value: "=<" },
|
|
42
|
+
// "小于等于"
|
|
43
|
+
{ label: t("add.add16"), value: "contain" },
|
|
44
|
+
// "范围内"
|
|
45
|
+
{ label: t("add.add17"), value: "null" },
|
|
46
|
+
// "为空"
|
|
47
|
+
{ label: t("add.add18"), value: "notnull" }
|
|
48
|
+
// "不为空"
|
|
49
|
+
],
|
|
50
|
+
[i18n.language]
|
|
51
|
+
);
|
|
52
|
+
const stringOptions = useMemo(
|
|
53
|
+
() => [
|
|
54
|
+
{ label: t("add.add13"), value: "=" },
|
|
55
|
+
// "等于"
|
|
56
|
+
{ label: t("add.add19"), value: "!=" },
|
|
57
|
+
// "不等于"
|
|
58
|
+
{ label: t("add.add24"), value: "include" },
|
|
59
|
+
// "包含"
|
|
60
|
+
{ label: t("add.add25"), value: "notinclude" },
|
|
61
|
+
// "不包含"
|
|
62
|
+
{ label: t("add.add17"), value: "null" },
|
|
63
|
+
// "为空"
|
|
64
|
+
{ label: t("add.add18"), value: "notnull" }
|
|
65
|
+
// "不为空"
|
|
66
|
+
],
|
|
67
|
+
[i18n.language]
|
|
68
|
+
);
|
|
69
|
+
const rdateOptions = useMemo(
|
|
70
|
+
() => [
|
|
71
|
+
{ label: t("add.add26"), value: "exactdate" },
|
|
72
|
+
// "具体日期"
|
|
73
|
+
{ label: t("add.add27"), value: "today" },
|
|
74
|
+
// "今天"
|
|
75
|
+
{ label: t("add.add28"), value: "yesterday" },
|
|
76
|
+
// "昨天"
|
|
77
|
+
{ label: t("add.add29"), value: "thisweek" },
|
|
78
|
+
// "本周"
|
|
79
|
+
{ label: t("add.add30"), value: "lastweek" },
|
|
80
|
+
// "上周"
|
|
81
|
+
{ label: t("add.add31"), value: "thismonth" },
|
|
82
|
+
// "本月"
|
|
83
|
+
{ label: t("add.add32"), value: "lastmonth" },
|
|
84
|
+
// "上月"
|
|
85
|
+
{ label: t("add.add33"), value: "last7days" },
|
|
86
|
+
// "过去7天"
|
|
87
|
+
{ label: t("add.add34"), value: "last30days" }
|
|
88
|
+
// "过去30天"
|
|
89
|
+
],
|
|
90
|
+
[i18n.language]
|
|
91
|
+
);
|
|
92
|
+
const rdateOptions2 = useMemo(
|
|
93
|
+
() => [
|
|
94
|
+
{ label: t("add.add26"), value: "exactdate" },
|
|
95
|
+
// "具体日期"
|
|
96
|
+
{ label: t("add.add27"), value: "today" },
|
|
97
|
+
// "今天"
|
|
98
|
+
{ label: t("add.add28"), value: "yesterday" }
|
|
99
|
+
// "昨天"
|
|
100
|
+
],
|
|
101
|
+
[i18n.language]
|
|
102
|
+
);
|
|
103
|
+
return {
|
|
104
|
+
timeOptions,
|
|
105
|
+
boolOptions,
|
|
106
|
+
intOptions,
|
|
107
|
+
stringOptions,
|
|
108
|
+
rdateOptions,
|
|
109
|
+
rdateOptions2
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
const useConditionTypeOptions = () => {
|
|
113
|
+
const { t, i18n } = useTranslation();
|
|
114
|
+
const options = useMemo(() => {
|
|
115
|
+
return [
|
|
116
|
+
{
|
|
117
|
+
label: t("all"),
|
|
118
|
+
value: "all"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
label: t("everyone"),
|
|
122
|
+
value: "any"
|
|
123
|
+
}
|
|
124
|
+
];
|
|
125
|
+
}, [i18n.language]);
|
|
126
|
+
return options;
|
|
127
|
+
};
|
|
128
|
+
export {
|
|
129
|
+
useConditionSymbolOptions,
|
|
130
|
+
useConditionTypeOptions
|
|
131
|
+
};
|
|
132
|
+
//# sourceMappingURL=config.js.map
|
package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/config.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../../../../../packages/dashboard-workbench/components/add-module-modal/components/condition-modal/config.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\n\nexport const useConditionSymbolOptions = () => {\n const { t, i18n } = useTranslation()\n\n const timeOptions = useMemo(\n () => [\n { label: t('add.add13'), value: '=' }, // \"等于\"\n { label: t('add.add14'), value: '<' }, // \"早于\"\n { label: t('add.add15'), value: '>' }, // \"晚于\"\n { label: t('add.add16'), value: 'contain' }, // \"范围内\"\n { label: t('add.add17'), value: 'null' }, // \"为空\"\n { label: t('add.add18'), value: 'notnull' }, // \"不为空\"\n ],\n [i18n.language]\n )\n\n const boolOptions = useMemo(\n () => [\n { label: t('add.add13'), value: '=' }, // \"等于\"\n ],\n [i18n.language]\n )\n\n const intOptions = useMemo(\n () => [\n { label: t('add.add13'), value: '=' }, // \"等于\"\n { label: t('add.add19'), value: '!=' }, // \"不等于\"\n { label: t('add.add20'), value: '>' }, // \"大于\"\n { label: t('add.add21'), value: '>=' }, // \"大于等于\"\n { label: t('add.add22'), value: '<' }, // \"小于\"\n { label: t('add.add23'), value: '=<' }, // \"小于等于\"\n { label: t('add.add16'), value: 'contain' }, // \"范围内\"\n { label: t('add.add17'), value: 'null' }, // \"为空\"\n { label: t('add.add18'), value: 'notnull' }, // \"不为空\"\n ],\n [i18n.language]\n )\n\n const stringOptions = useMemo(\n () => [\n { label: t('add.add13'), value: '=' }, // \"等于\"\n { label: t('add.add19'), value: '!=' }, // \"不等于\"\n { label: t('add.add24'), value: 'include' }, // \"包含\"\n { label: t('add.add25'), value: 'notinclude' }, // \"不包含\"\n { label: t('add.add17'), value: 'null' }, // \"为空\"\n { label: t('add.add18'), value: 'notnull' }, // \"不为空\"\n ],\n [i18n.language]\n )\n\n const rdateOptions = useMemo(\n () => [\n { label: t('add.add26'), value: 'exactdate' }, // \"具体日期\"\n { label: t('add.add27'), value: 'today' }, // \"今天\"\n { label: t('add.add28'), value: 'yesterday' }, // \"昨天\"\n { label: t('add.add29'), value: 'thisweek' }, // \"本周\"\n { label: t('add.add30'), value: 'lastweek' }, // \"上周\"\n { label: t('add.add31'), value: 'thismonth' }, // \"本月\"\n { label: t('add.add32'), value: 'lastmonth' }, // \"上月\"\n { label: t('add.add33'), value: 'last7days' }, // \"过去7天\"\n { label: t('add.add34'), value: 'last30days' }, // \"过去30天\"\n ],\n [i18n.language]\n )\n\n const rdateOptions2 = useMemo(\n () => [\n { label: t('add.add26'), value: 'exactdate' }, // \"具体日期\"\n { label: t('add.add27'), value: 'today' }, // \"今天\"\n { label: t('add.add28'), value: 'yesterday' }, // \"昨天\"\n ],\n [i18n.language]\n )\n\n return {\n timeOptions,\n boolOptions,\n intOptions,\n stringOptions,\n rdateOptions,\n rdateOptions2,\n }\n}\n\nexport const useConditionTypeOptions = () => {\n const { t, i18n } = useTranslation()\n\n const options = useMemo(() => {\n return [\n {\n label: t('all'),\n value: 'all',\n },\n {\n label: t('everyone'),\n value: 'any',\n },\n ]\n }, [i18n.language])\n\n return options\n}\n"],"names":[],"mappings":";;AAGO,MAAM,4BAA4B,MAAM;AAC7C,QAAM,EAAE,GAAG,KAAK,IAAI,eAAe;AAEnC,QAAM,cAAc;AAAA,IAClB,MAAM;AAAA,MACJ,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,IAAI;AAAA;AAAA,MACpC,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,IAAI;AAAA;AAAA,MACpC,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,IAAI;AAAA;AAAA,MACpC,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,UAAU;AAAA;AAAA,MAC1C,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,OAAO;AAAA;AAAA,MACvC,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,UAAU;AAAA;AAAA,IAC5C;AAAA,IACA,CAAC,KAAK,QAAQ;AAAA,EAChB;AAEA,QAAM,cAAc;AAAA,IAClB,MAAM;AAAA,MACJ,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,IAAI;AAAA;AAAA,IACtC;AAAA,IACA,CAAC,KAAK,QAAQ;AAAA,EAChB;AAEA,QAAM,aAAa;AAAA,IACjB,MAAM;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dashboard-workbench/components/add-module-modal/components/condition-modal/debounce-select.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useEffect, useMemo, useRef, useState } from 'react'\nimport { Select, Spin
|
|
1
|
+
{"version":3,"file":"debounce-select.js","sources":["../../../../../../packages/dashboard-workbench/components/add-module-modal/components/condition-modal/debounce-select.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useEffect, useMemo, useRef, useState } from 'react'\nimport { Select, Spin, type SelectProps } from 'antd'\nimport { debounce } from 'lodash-es'\n\nexport interface DebounceSelectProps<ValueType = any>\n extends Omit<SelectProps<ValueType | ValueType[]>, 'options' | 'children'> {\n fetchOptions: (search: string) => Promise<ValueType[]>\n debounceTimeout?: number\n}\n\nfunction DebounceSelect<\n ValueType extends {\n key?: string\n label: React.ReactNode\n value: string | number\n } = any,\n>({ fetchOptions, debounceTimeout = 800, ...props }: DebounceSelectProps<ValueType>) {\n const [fetching, setFetching] = useState(false)\n const [options, setOptions] = useState<ValueType[]>([])\n const fetchRef = useRef(0)\n\n const debounceFetcher = useMemo(() => {\n const loadOptions = (value: string) => {\n fetchRef.current += 1\n const fetchId = fetchRef.current\n setOptions([])\n setFetching(true)\n\n fetchOptions(value).then(newOptions => {\n if (fetchId !== fetchRef.current) {\n // for fetch callback order\n return\n }\n setOptions(newOptions)\n setFetching(false)\n })\n }\n\n return debounce(loadOptions, debounceTimeout)\n }, [fetchOptions, debounceTimeout])\n\n useEffect(() => {\n debounceFetcher('')\n }, [])\n\n return (\n <Select\n labelInValue\n showSearch\n filterOption={false}\n onSearch={debounceFetcher}\n notFoundContent={fetching ? <Spin size=\"small\" /> : null}\n {...props}\n options={options}\n />\n )\n}\n\nexport default DebounceSelect\n"],"names":[],"mappings":";;;;AAWA,SAAS,eAMP,EAAE,cAAc,kBAAkB,KAAK,GAAG,SAAyC;AACnF,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAC9C,QAAM,CAAC,SAAS,UAAU,IAAI,SAAsB,CAAA,CAAE;AAChD,QAAA,WAAW,OAAO,CAAC;AAEnB,QAAA,kBAAkB,QAAQ,MAAM;AAC9B,UAAA,cAAc,CAAC,UAAkB;AACrC,eAAS,WAAW;AACpB,YAAM,UAAU,SAAS;AACzB,iBAAW,CAAA,CAAE;AACb,kBAAY,IAAI;AAEH,mBAAA,KAAK,EAAE,KAAK,CAAc,eAAA;AACjC,YAAA,YAAY,SAAS,SAAS;AAEhC;AAAA,QAAA;AAEF,mBAAW,UAAU;AACrB,oBAAY,KAAK;AAAA,MAAA,CAClB;AAAA,IACH;AAEO,WAAA,SAAS,aAAa,eAAe;AAAA,EAAA,GAC3C,CAAC,cAAc,eAAe,CAAC;AAElC,YAAU,MAAM;AACd,oBAAgB,EAAE;AAAA,EACpB,GAAG,EAAE;AAGH,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,cAAY;AAAA,MACZ,YAAU;AAAA,MACV,cAAc;AAAA,MACd,UAAU;AAAA,MACV,iBAAiB,WAAW,oBAAC,MAAK,EAAA,MAAK,QAAQ,CAAA,IAAK;AAAA,MACnD,GAAG;AAAA,MACJ;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/index.d.ts
CHANGED
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
import { EnumDataApi,
|
|
2
|
-
|
|
3
|
-
field: string;
|
|
4
|
-
condition: '=' | '<' | '>' | 'contain' | 'null' | 'notnull' | '!=' | '>=' | '=<' | 'include' | 'notinclude';
|
|
5
|
-
val: any;
|
|
6
|
-
type: SourceDataFieldsTypes['type'];
|
|
7
|
-
}
|
|
1
|
+
import { EnumDataApi, FieldItem } from '../../../../types';
|
|
2
|
+
import { ConditionBlock } from './interface';
|
|
8
3
|
interface ConditionModalProps {
|
|
9
4
|
open?: boolean;
|
|
10
|
-
fieldOptions?:
|
|
5
|
+
fieldOptions?: FieldItem[];
|
|
11
6
|
onSubmit?: ((values: any) => void) | undefined;
|
|
12
7
|
onClose?: () => void;
|
|
13
8
|
onOk?: ((values: any) => void) | undefined;
|
|
14
9
|
enumDataApi?: EnumDataApi;
|
|
15
|
-
value?:
|
|
16
|
-
conditionList: ConditionListItemTypes[];
|
|
17
|
-
conditionType: 'all' | 'any';
|
|
18
|
-
};
|
|
10
|
+
value?: ConditionBlock;
|
|
19
11
|
}
|
|
20
12
|
declare const ConditionModal: React.FC<ConditionModalProps>;
|
|
21
13
|
export default ConditionModal;
|
package/es/dashboard-workbench/components/add-module-modal/components/condition-modal/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect } from "react";
|
|
2
3
|
import { Form, Modal, Flex, Select, Space, InputNumber, DatePicker, Input, Switch, Button } from "antd";
|
|
3
4
|
import { MinusCircleOutlined, PlusOutlined } from "@ant-design/icons";
|
|
4
|
-
import { useCallback, useEffect } from "react";
|
|
5
5
|
import { useTranslation } from "react-i18next";
|
|
6
6
|
import dayjs from "dayjs";
|
|
7
|
-
import DebounceSelect from "./debounce-select.js";
|
|
8
7
|
import { useAppContext } from "../../../../context.js";
|
|
8
|
+
import { useConditionTypeOptions, useConditionSymbolOptions } from "./config.js";
|
|
9
|
+
import DebounceSelect from "./debounce-select.js";
|
|
9
10
|
const ConditionModal = ({
|
|
10
11
|
open,
|
|
11
12
|
onClose,
|
|
@@ -17,188 +18,8 @@ const ConditionModal = ({
|
|
|
17
18
|
const [form] = Form.useForm();
|
|
18
19
|
const { t } = useTranslation();
|
|
19
20
|
const { globalData } = useAppContext();
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
label: t("add.add13"),
|
|
23
|
-
// "等于",
|
|
24
|
-
value: "="
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
label: t("add.add14"),
|
|
28
|
-
// "早于",
|
|
29
|
-
value: "<"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
label: t("add.add15"),
|
|
33
|
-
// "晚于",
|
|
34
|
-
value: ">"
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
label: t("add.add16"),
|
|
38
|
-
// "范围内",
|
|
39
|
-
value: "contain"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
label: t("add.add17"),
|
|
43
|
-
// "为空",
|
|
44
|
-
value: "null"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
label: t("add.add18"),
|
|
48
|
-
// "不为空",
|
|
49
|
-
value: "notnull"
|
|
50
|
-
}
|
|
51
|
-
];
|
|
52
|
-
const boolOptions = [
|
|
53
|
-
{
|
|
54
|
-
label: t("add.add13"),
|
|
55
|
-
//"等于",
|
|
56
|
-
value: "="
|
|
57
|
-
}
|
|
58
|
-
];
|
|
59
|
-
const intOptions = [
|
|
60
|
-
{
|
|
61
|
-
label: t("add.add13"),
|
|
62
|
-
//"等于",
|
|
63
|
-
value: "="
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
label: t("add.add19"),
|
|
67
|
-
//"不等于",
|
|
68
|
-
value: "!="
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
label: t("add.add20"),
|
|
72
|
-
//"大于",
|
|
73
|
-
value: ">"
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
label: t("add.add21"),
|
|
77
|
-
//"大于等于",
|
|
78
|
-
value: ">="
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
label: t("add.add22"),
|
|
82
|
-
//"小于",
|
|
83
|
-
value: "<"
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
label: t("add.add23"),
|
|
87
|
-
//"小于等于",
|
|
88
|
-
value: "=<"
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
label: t("add.add16"),
|
|
92
|
-
//"范围内",
|
|
93
|
-
value: "contain"
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
label: t("add.add17"),
|
|
97
|
-
//"为空",
|
|
98
|
-
value: "null"
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
label: t("add.add18"),
|
|
102
|
-
//"不为空",
|
|
103
|
-
value: "notnull"
|
|
104
|
-
}
|
|
105
|
-
];
|
|
106
|
-
const stringOptions = [
|
|
107
|
-
{
|
|
108
|
-
label: t("add.add13"),
|
|
109
|
-
//"等于",
|
|
110
|
-
value: "="
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
label: t("add.add19"),
|
|
114
|
-
//"不等于",
|
|
115
|
-
value: "!="
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
label: t("add.add24"),
|
|
119
|
-
//"包含",
|
|
120
|
-
value: "include"
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
label: t("add.add25"),
|
|
124
|
-
//"不包含",
|
|
125
|
-
value: "notinclude"
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
label: t("add.add17"),
|
|
129
|
-
//"为空",
|
|
130
|
-
value: "null"
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
label: t("add.add18"),
|
|
134
|
-
//"不为空",
|
|
135
|
-
value: "notnull"
|
|
136
|
-
}
|
|
137
|
-
];
|
|
138
|
-
const rdateOptions = [
|
|
139
|
-
{
|
|
140
|
-
label: t("add.add26"),
|
|
141
|
-
//"具体日期",
|
|
142
|
-
value: "exactdate"
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
label: t("add.add27"),
|
|
146
|
-
//"今天",
|
|
147
|
-
value: "today"
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
label: t("add.add28"),
|
|
151
|
-
//"昨天",
|
|
152
|
-
value: "yesterday"
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
label: t("add.add29"),
|
|
156
|
-
//"本周",
|
|
157
|
-
value: "thisweek"
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
label: t("add.add30"),
|
|
161
|
-
//"上周",
|
|
162
|
-
value: "lastweek"
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
label: t("add.add31"),
|
|
166
|
-
//"本月",
|
|
167
|
-
value: "thismonth"
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
label: t("add.add32"),
|
|
171
|
-
//"上月",
|
|
172
|
-
value: "lastmonth"
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
label: t("add.add33"),
|
|
176
|
-
//"过去7天",
|
|
177
|
-
value: "last7days"
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
label: t("add.add34"),
|
|
181
|
-
//"过去30天",
|
|
182
|
-
value: "last30days"
|
|
183
|
-
}
|
|
184
|
-
];
|
|
185
|
-
const rdateOptions2 = [
|
|
186
|
-
{
|
|
187
|
-
label: t("add.add26"),
|
|
188
|
-
//"具体日期",
|
|
189
|
-
value: "exactdate"
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
label: t("add.add27"),
|
|
193
|
-
//"今天",
|
|
194
|
-
value: "today"
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
label: t("add.add28"),
|
|
198
|
-
//"昨天",
|
|
199
|
-
value: "yesterday"
|
|
200
|
-
}
|
|
201
|
-
];
|
|
21
|
+
const conditionTypeOptions = useConditionTypeOptions();
|
|
22
|
+
const { timeOptions, boolOptions, intOptions, stringOptions, rdateOptions, rdateOptions2 } = useConditionSymbolOptions();
|
|
202
23
|
const conditionOptions = {
|
|
203
24
|
int: intOptions,
|
|
204
25
|
timestamp: timeOptions,
|
|
@@ -286,22 +107,7 @@ const ConditionModal = ({
|
|
|
286
107
|
var _a;
|
|
287
108
|
return ((_a = getFieldValue("conditionList")) == null ? void 0 : _a.length) > 1 ? /* @__PURE__ */ jsxs(Flex, { align: "center", gap: 5, style: { marginBottom: "20px" }, children: [
|
|
288
109
|
t("conformTo"),
|
|
289
|
-
/* @__PURE__ */ jsx(Form.Item, { name: "conditionType", noStyle: true, children: /* @__PURE__ */ jsx(
|
|
290
|
-
Select,
|
|
291
|
-
{
|
|
292
|
-
style: { width: "150px" },
|
|
293
|
-
options: [
|
|
294
|
-
{
|
|
295
|
-
label: t("all"),
|
|
296
|
-
value: "all"
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
label: t("everyone"),
|
|
300
|
-
value: "any"
|
|
301
|
-
}
|
|
302
|
-
]
|
|
303
|
-
}
|
|
304
|
-
) }),
|
|
110
|
+
/* @__PURE__ */ jsx(Form.Item, { name: "conditionType", noStyle: true, children: /* @__PURE__ */ jsx(Select, { style: { width: "150px" }, options: conditionTypeOptions }) }),
|
|
305
111
|
" ",
|
|
306
112
|
t("condition")
|
|
307
113
|
] }) : null;
|