aldehyde 0.2.438 → 0.2.439
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/controls/2dEditor/components/card.d.ts.map +1 -1
- package/lib/controls/2dEditor/components/card.js +2 -1
- package/lib/controls/2dEditor/components/card.js.map +1 -1
- package/lib/controls/2dEditor/components/html-box.js +1 -1
- package/lib/controls/date-picker/index.d.ts.map +1 -1
- package/lib/controls/date-picker/index.js +3 -1
- package/lib/controls/date-picker/index.js.map +1 -1
- package/lib/controls/direct-upload/index.js +2 -2
- package/lib/controls/direct-upload/index.js.map +1 -1
- package/lib/controls/qr-code/index.d.ts.map +1 -1
- package/lib/controls/qr-code/index.js +3 -1
- package/lib/controls/qr-code/index.js.map +1 -1
- package/lib/layout2/main.d.ts +2 -0
- package/lib/layout2/main.d.ts.map +1 -1
- package/lib/layout2/main.js +2 -2
- package/lib/layout2/main.js.map +1 -1
- package/lib/layout2/page.js +1 -1
- package/lib/layout2/page.js.map +1 -1
- package/lib/layout2/tabs/tabs-layout.d.ts +5 -1
- package/lib/layout2/tabs/tabs-layout.d.ts.map +1 -1
- package/lib/layout2/tabs/tabs-layout.js +5 -2
- package/lib/layout2/tabs/tabs-layout.js.map +1 -1
- package/lib/layout3/components/tabs-layout.d.ts +5 -1
- package/lib/layout3/components/tabs-layout.d.ts.map +1 -1
- package/lib/layout3/components/tabs-layout.js +6 -2
- package/lib/layout3/components/tabs-layout.js.map +1 -1
- package/lib/layout3/main.d.ts +2 -0
- package/lib/layout3/main.d.ts.map +1 -1
- package/lib/layout3/main.js +2 -2
- package/lib/layout3/main.js.map +1 -1
- package/lib/layout3/page.js +1 -1
- package/lib/layout3/page.js.map +1 -1
- package/lib/layout4/components/tabs-layout.d.ts +5 -1
- package/lib/layout4/components/tabs-layout.d.ts.map +1 -1
- package/lib/layout4/components/tabs-layout.js +6 -2
- package/lib/layout4/components/tabs-layout.js.map +1 -1
- package/lib/layout4/main.d.ts +2 -0
- package/lib/layout4/main.d.ts.map +1 -1
- package/lib/layout4/main.js +2 -2
- package/lib/layout4/main.js.map +1 -1
- package/lib/layout4/page.js +1 -1
- package/lib/layout4/page.js.map +1 -1
- package/lib/layout5/page.js +1 -1
- package/lib/layout5/page.js.map +1 -1
- package/lib/lowcode-components/act-table/index.d.ts +1 -0
- package/lib/lowcode-components/act-table/index.d.ts.map +1 -1
- package/lib/lowcode-components/act-table/index.js +5 -3
- package/lib/lowcode-components/act-table/index.js.map +1 -1
- package/lib/lowcode-components/bar-chart/index.d.ts +1 -1
- package/lib/lowcode-components/bar-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/bar-chart/index.js +4 -1
- package/lib/lowcode-components/bar-chart/index.js.map +1 -1
- package/lib/lowcode-components/base-button/index.d.ts.map +1 -1
- package/lib/lowcode-components/base-button/index.js +3 -1
- package/lib/lowcode-components/base-button/index.js.map +1 -1
- package/lib/lowcode-components/base-radio/index.d.ts.map +1 -1
- package/lib/lowcode-components/base-radio/index.js +12 -2
- package/lib/lowcode-components/base-radio/index.js.map +1 -1
- package/lib/lowcode-components/base-table/index.d.ts +1 -0
- package/lib/lowcode-components/base-table/index.d.ts.map +1 -1
- package/lib/lowcode-components/base-table/index.js +5 -4
- package/lib/lowcode-components/base-table/index.js.map +1 -1
- package/lib/lowcode-components/base-tabs/index.d.ts.map +1 -1
- package/lib/lowcode-components/base-tabs/index.js +3 -1
- package/lib/lowcode-components/base-tabs/index.js.map +1 -1
- package/lib/lowcode-components/base-text/index.d.ts.map +1 -1
- package/lib/lowcode-components/base-text/index.js +3 -1
- package/lib/lowcode-components/base-text/index.js.map +1 -1
- package/lib/lowcode-components/capsule-bar-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/capsule-bar-chart/index.js +3 -0
- package/lib/lowcode-components/capsule-bar-chart/index.js.map +1 -1
- package/lib/lowcode-components/carousel/index.d.ts.map +1 -1
- package/lib/lowcode-components/carousel/index.js +6 -5
- package/lib/lowcode-components/carousel/index.js.map +1 -1
- package/lib/lowcode-components/column-3d-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/column-3d-chart/index.js +3 -0
- package/lib/lowcode-components/column-3d-chart/index.js.map +1 -1
- package/lib/lowcode-components/column-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/column-chart/index.js +3 -0
- package/lib/lowcode-components/column-chart/index.js.map +1 -1
- package/lib/lowcode-components/data-number/index.d.ts.map +1 -1
- package/lib/lowcode-components/data-number/index.js +4 -2
- package/lib/lowcode-components/data-number/index.js.map +1 -1
- package/lib/lowcode-components/line-bar-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/line-bar-chart/index.js +3 -0
- package/lib/lowcode-components/line-bar-chart/index.js.map +1 -1
- package/lib/lowcode-components/line-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/line-chart/index.js +3 -0
- package/lib/lowcode-components/line-chart/index.js.map +1 -1
- package/lib/lowcode-components/pie-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/pie-chart/index.js +3 -0
- package/lib/lowcode-components/pie-chart/index.js.map +1 -1
- package/lib/lowcode-components/search-form/index.d.ts.map +1 -1
- package/lib/lowcode-components/search-form/index.js +4 -2
- package/lib/lowcode-components/search-form/index.js.map +1 -1
- package/lib/lowcode-components/stroke-animation/index.d.ts.map +1 -1
- package/lib/lowcode-components/stroke-animation/index.js +3 -1
- package/lib/lowcode-components/stroke-animation/index.js.map +1 -1
- package/lib/lowcode-components/text-scroller/index.d.ts.map +1 -1
- package/lib/lowcode-components/text-scroller/index.js +3 -1
- package/lib/lowcode-components/text-scroller/index.js.map +1 -1
- package/lib/table/act-table.d.ts +2 -0
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js +6 -5
- package/lib/table/act-table.js.map +1 -1
- package/lib/table/page-config-button.d.ts.map +1 -1
- package/lib/table/page-config-button.js +8 -7
- package/lib/table/page-config-button.js.map +1 -1
- package/lib/table/query-table.d.ts +1 -0
- package/lib/table/query-table.d.ts.map +1 -1
- package/lib/table/query-table.js +3 -2
- package/lib/table/query-table.js.map +1 -1
- package/lib/table/report-table.d.ts.map +1 -1
- package/lib/table/report-table.js +2 -1
- package/lib/table/report-table.js.map +1 -1
- package/lib/table/resizable-table.js +3 -3
- package/lib/table/resizable-table.js.map +1 -1
- package/lib/tmpl/interface.d.ts +2 -0
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/2dEditor/components/card.tsx +2 -1
- package/src/aldehyde/controls/2dEditor/components/html-box.tsx +1 -1
- package/src/aldehyde/controls/date-picker/index.tsx +4 -1
- package/src/aldehyde/controls/direct-upload/index.tsx +2 -2
- package/src/aldehyde/controls/qr-code/index.tsx +3 -1
- package/src/aldehyde/layout2/main.tsx +4 -2
- package/src/aldehyde/layout2/page.tsx +1 -1
- package/src/aldehyde/layout2/tabs/tabs-layout.tsx +10 -2
- package/src/aldehyde/layout3/components/tabs-layout.tsx +12 -2
- package/src/aldehyde/layout3/main.tsx +4 -2
- package/src/aldehyde/layout3/page.tsx +1 -1
- package/src/aldehyde/layout4/components/tabs-layout.tsx +11 -2
- package/src/aldehyde/layout4/main.tsx +4 -2
- package/src/aldehyde/layout4/page.tsx +1 -1
- package/src/aldehyde/layout5/page.tsx +1 -1
- package/src/aldehyde/lowcode-components/act-table/index.tsx +5 -1
- package/src/aldehyde/lowcode-components/bar-chart/index.tsx +5 -2
- package/src/aldehyde/lowcode-components/base-button/index.tsx +3 -1
- package/src/aldehyde/lowcode-components/base-radio/index.tsx +12 -2
- package/src/aldehyde/lowcode-components/base-table/index.tsx +6 -3
- package/src/aldehyde/lowcode-components/base-tabs/index.tsx +3 -1
- package/src/aldehyde/lowcode-components/base-text/index.tsx +3 -1
- package/src/aldehyde/lowcode-components/capsule-bar-chart/index.tsx +3 -0
- package/src/aldehyde/lowcode-components/carousel/index.tsx +6 -5
- package/src/aldehyde/lowcode-components/column-3d-chart/index.tsx +3 -0
- package/src/aldehyde/lowcode-components/column-chart/index.tsx +3 -0
- package/src/aldehyde/lowcode-components/data-number/index.tsx +4 -2
- package/src/aldehyde/lowcode-components/line-bar-chart/index.tsx +3 -0
- package/src/aldehyde/lowcode-components/line-chart/index.tsx +3 -0
- package/src/aldehyde/lowcode-components/pie-chart/index.tsx +3 -0
- package/src/aldehyde/lowcode-components/search-form/index.tsx +4 -3
- package/src/aldehyde/lowcode-components/stroke-animation/index.tsx +3 -1
- package/src/aldehyde/lowcode-components/text-scroller/index.tsx +3 -1
- package/src/aldehyde/table/act-table.tsx +7 -3
- package/src/aldehyde/table/page-config-button.tsx +7 -3
- package/src/aldehyde/table/query-table.tsx +4 -1
- package/src/aldehyde/table/report-table.tsx +2 -0
- package/src/aldehyde/table/resizable-table.tsx +2 -2
- package/src/aldehyde/tmpl/interface.tsx +2 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import React, { ForwardedRef, forwardRef, useEffect, useImperativeHandle, useState } from 'react';
|
|
3
3
|
import { Radio, ConfigProvider } from 'antd';
|
|
4
4
|
import dayjs from 'dayjs';
|
|
5
|
+
import { useLocale } from "../../locale/useLocale";
|
|
5
6
|
import "./index.less";
|
|
6
7
|
|
|
7
8
|
const handleTimes = (type: string) => {
|
|
@@ -34,6 +35,14 @@ const handleTimes = (type: string) => {
|
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
|
|
38
|
+
// 翻译
|
|
39
|
+
const handleTranslate = (arr: { label: string, value: string }[], translate: any) => {
|
|
40
|
+
if (!arr) {
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
43
|
+
const temArr = arr.map(r => ({ value: r.value, label: translate("${" + r.label + "}") }));
|
|
44
|
+
return temArr;
|
|
45
|
+
}
|
|
37
46
|
|
|
38
47
|
export interface ComponentStyle {
|
|
39
48
|
optionType?: "default" | "button",
|
|
@@ -68,8 +77,9 @@ export interface ComponentRef {
|
|
|
68
77
|
|
|
69
78
|
const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>) => {
|
|
70
79
|
const { style, setSearchParams } = props;
|
|
80
|
+
const { translate } = useLocale();
|
|
71
81
|
const [config, setConfig] = useState<ComponentStyle>({ ...style });
|
|
72
|
-
const [options, setOptions] = useState<{ label: string, value: string }[]>(style?.searchConfig?.options
|
|
82
|
+
const [options, setOptions] = useState<{ label: string, value: string }[]>(handleTranslate(style?.searchConfig?.options, translate));
|
|
73
83
|
const [currentValue, setCurrentValue] = useState<string>(style?.searchConfig?.defaultValue || "");
|
|
74
84
|
|
|
75
85
|
useImperativeHandle(ref, () => ({
|
|
@@ -77,7 +87,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
77
87
|
const { style: newStyle } = newConfig;
|
|
78
88
|
const { searchConfig } = newStyle;
|
|
79
89
|
setConfig({ ...newStyle });
|
|
80
|
-
setOptions(searchConfig?.options
|
|
90
|
+
setOptions(handleTranslate(searchConfig?.options, translate));
|
|
81
91
|
setCurrentValue(searchConfig?.defaultValue || "");
|
|
82
92
|
},
|
|
83
93
|
}));
|
|
@@ -4,6 +4,7 @@ import { ConfigProvider, Empty } from "antd";
|
|
|
4
4
|
import HcserviceV3 from "../../tmpl/hcservice-v3";
|
|
5
5
|
import { DataConfigProps } from "../data";
|
|
6
6
|
import { ViewControl } from "../../index";
|
|
7
|
+
import { useLocale } from "../../locale/useLocale";
|
|
7
8
|
import './index.less';
|
|
8
9
|
|
|
9
10
|
const defColumns = [
|
|
@@ -42,6 +43,7 @@ export interface ITableBodyStyle {
|
|
|
42
43
|
fontWeight?: number;
|
|
43
44
|
fontFamily?: string;
|
|
44
45
|
pageSize?: number;
|
|
46
|
+
showEmpty?: boolean; // 空状态显隐
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
export interface ComponentStyle {
|
|
@@ -68,8 +70,8 @@ export interface ComponentRef {
|
|
|
68
70
|
|
|
69
71
|
const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>) => {
|
|
70
72
|
const { style, isDesignMode, data: propsData, request } = props;
|
|
71
|
-
const [headerStyle, setHeaderStyle] = useState<ITableHeaderStyle>({ ...style?.header });
|
|
72
|
-
const [bodyStyle, setBodyStyle] = useState<ITableBodyStyle>({ ...style?.body });
|
|
73
|
+
const [headerStyle, setHeaderStyle] = useState<ITableHeaderStyle>({ ...(style?.header || {}) });
|
|
74
|
+
const [bodyStyle, setBodyStyle] = useState<ITableBodyStyle>({ ...(style?.body || {}) });
|
|
73
75
|
const [borderStyle, setBorderStyle] = useState<{ show?: boolean, color?: string }>({ ...(style?.border || {}) });
|
|
74
76
|
const [carousel, setCarousel] = useState<{ speed: number, enable: boolean }>({ ...style?.carousel });
|
|
75
77
|
const [dataConfig, setDataConfig] = useState<DataConfigProps>({ ...propsData });
|
|
@@ -81,6 +83,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
81
83
|
const resizeObserverRef = useRef<ResizeObserver | null>(null);
|
|
82
84
|
const contentHeightRef = useRef<number>(0);
|
|
83
85
|
const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
|
|
86
|
+
const { translate } = useLocale();
|
|
84
87
|
|
|
85
88
|
const handleDestroy = () => {
|
|
86
89
|
resizeObserverRef.current && resizeObserverRef.current.disconnect();
|
|
@@ -202,7 +205,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
202
205
|
}
|
|
203
206
|
}, [dataConfig?.sourceType, dataConfig?.sourceId, initSearchParams]);
|
|
204
207
|
|
|
205
|
-
const renderEmpty = () => <div className={'base-table-empty'} style={{ ...bodyStyle }}
|
|
208
|
+
const renderEmpty = () => <div className={'base-table-empty'} style={{ ...bodyStyle }}>{bodyStyle?.showEmpty !== false ? <Empty styles={{ description: { color: bodyStyle.color || "#000000" } }} image={Empty.PRESENTED_IMAGE_SIMPLE} description={translate("${暂无数据}")} /> : ""}</div>;
|
|
206
209
|
|
|
207
210
|
return (
|
|
208
211
|
<div className={'base-table'} ref={tableRef} style={carousel.enable ? { overflowX: "auto" } : { overflow: "auto" }}>
|
|
@@ -4,6 +4,7 @@ import { Button, Space } from "antd";
|
|
|
4
4
|
import HydrocarbonService from "../../tmpl/hcservice-v3";
|
|
5
5
|
import ProgramConfig from "../../units";
|
|
6
6
|
import LowcodeConstant from "../assets/lowcode-constant";
|
|
7
|
+
import { useLocale } from "../../locale/useLocale";
|
|
7
8
|
import './index.less';
|
|
8
9
|
|
|
9
10
|
const { serverKey, sourceId } = LowcodeConstant.fileUpload;
|
|
@@ -111,6 +112,7 @@ const ButtonComponent = forwardRef((props: ComponentProps, ref: ForwardedRef<Com
|
|
|
111
112
|
const [defaultStyle, setDefaultStyle] = useState<ItemStyle>({ ...style.defaultStyle });
|
|
112
113
|
const [activeStyle, setActiveStyle] = useState<ItemStyle>({ ...style.activeStyle });
|
|
113
114
|
const [localImgDel, setLocalImgDel] = useState<{ active: boolean, default: boolean }>({ active: false, default: false });
|
|
115
|
+
const { translate } = useLocale();
|
|
114
116
|
|
|
115
117
|
useImperativeHandle(ref, () => ({
|
|
116
118
|
updateConfig: (newConfig) => { // 组件更新配置
|
|
@@ -173,7 +175,7 @@ const ButtonComponent = forwardRef((props: ComponentProps, ref: ForwardedRef<Com
|
|
|
173
175
|
onClick={() => onClick({ ...item, key: `key${index}` })}
|
|
174
176
|
>
|
|
175
177
|
{isDesignMode && (activeKey === `key${index}` ? localImgDel.active : localImgDel.default) ? <div style={{ position: "absolute", width: "100%", height: "100%", backgroundColor: "rgba(0,0,0,0.5)", display: "flex", justifyContent: "center", alignItems: "center", color: "red" }}>背景图片已删除,请重新上传</div> : null}
|
|
176
|
-
{item.text
|
|
178
|
+
{item.text ? translate("${" + item.text + "}") : ""}
|
|
177
179
|
</Button>)}
|
|
178
180
|
</Space>
|
|
179
181
|
);
|
|
@@ -6,6 +6,7 @@ import React, {
|
|
|
6
6
|
useImperativeHandle,
|
|
7
7
|
useState
|
|
8
8
|
} from 'react';
|
|
9
|
+
import { useLocale } from "../../locale/useLocale";
|
|
9
10
|
import './index.less';
|
|
10
11
|
|
|
11
12
|
export interface BaseTextComponentStyle {
|
|
@@ -32,6 +33,7 @@ export interface BaseTextComponentRef {
|
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
const BaseTextComponent = forwardRef((props: BaseTextComponentProps, ref: ForwardedRef<BaseTextComponentRef>) => {
|
|
36
|
+
const { translate } = useLocale();
|
|
35
37
|
const [config, setConfig] = useState<BaseTextComponentProps>({ ...props });
|
|
36
38
|
const { style, data } = config;
|
|
37
39
|
|
|
@@ -49,7 +51,7 @@ const BaseTextComponent = forwardRef((props: BaseTextComponentProps, ref: Forwar
|
|
|
49
51
|
className={'base-text-component'}
|
|
50
52
|
style={{ ...style, ...strokeStyle }}
|
|
51
53
|
>
|
|
52
|
-
{data?.staticData}
|
|
54
|
+
{data?.staticData ? translate("${" + data.staticData + "}") : ""}
|
|
53
55
|
</div>
|
|
54
56
|
);
|
|
55
57
|
});
|
|
@@ -2,6 +2,7 @@ import * as echarts from 'echarts';
|
|
|
2
2
|
import React, { useEffect, useRef, useState, ForwardedRef, forwardRef, useImperativeHandle } from 'react';
|
|
3
3
|
import _ from 'lodash';
|
|
4
4
|
import { Spin } from "antd";
|
|
5
|
+
import { useLocale } from "../../locale/useLocale";
|
|
5
6
|
import HydrocarbonService from "../../tmpl/hcservice-v3";
|
|
6
7
|
import { DataConfigProps } from "../data";
|
|
7
8
|
|
|
@@ -122,6 +123,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
122
123
|
const chartRef = useRef<HTMLDivElement>(null);
|
|
123
124
|
const chart = useRef<any>(null);
|
|
124
125
|
const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
|
|
126
|
+
const { translate } = useLocale();
|
|
125
127
|
|
|
126
128
|
const handleDestroy = () => {
|
|
127
129
|
pollingIntervalRef.current && clearInterval(pollingIntervalRef.current);
|
|
@@ -240,6 +242,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
240
242
|
option.xAxis = { ...option.xAxis, ...xAxis, axisTick: { show: xAxis?.axisLine?.show } };
|
|
241
243
|
option.yAxis = { ...option.yAxis, ...yAxis, axisTick: { show: yAxis?.axisLine?.show } };
|
|
242
244
|
option.dataZoom = dataZoom ? [{ type: "inside", disabled: false, orient: "vertical" }] : [];
|
|
245
|
+
option.title.text = translate("${暂无数据}");
|
|
243
246
|
option.title.show = !temData?.length;
|
|
244
247
|
option.series = temData.map((r) => ({
|
|
245
248
|
type: "bar",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React, { ForwardedRef, forwardRef, useImperativeHandle, useState, useEffect, useRef } from 'react';
|
|
2
2
|
import { Carousel, Image } from 'antd';
|
|
3
3
|
import HydrocarbonService from "../../tmpl/hcservice-v3";
|
|
4
|
+
import { useLocale } from "../../locale/useLocale";
|
|
4
5
|
import ProgramConfig from "../../units";
|
|
5
6
|
import { DataConfigProps, OssConfig } from "../data";
|
|
6
|
-
import Units from "../../units";
|
|
7
7
|
|
|
8
8
|
const defServerKey = "LowCodeOss";
|
|
9
9
|
|
|
10
|
-
const renderEmpty = (height) => <div style={{
|
|
10
|
+
const renderEmpty = (height, translate) => <div style={{
|
|
11
11
|
color: '#9a9a9a',
|
|
12
12
|
height,
|
|
13
13
|
width: '100%',
|
|
@@ -15,7 +15,7 @@ const renderEmpty = (height) => <div style={{
|
|
|
15
15
|
justifyContent: 'center',
|
|
16
16
|
alignItems: 'center'
|
|
17
17
|
}}>
|
|
18
|
-
<div
|
|
18
|
+
<div>{translate("${暂无数据}")}</div>
|
|
19
19
|
</div>;
|
|
20
20
|
|
|
21
21
|
// 处理本地图片地址
|
|
@@ -101,9 +101,10 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
101
101
|
const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
|
|
102
102
|
const [size, setSize] = useState<{ width: number, height: number }>(propsBase);
|
|
103
103
|
const [initSearchParams, setInitSearchParams] = useState<{ [key: string]: any }>();
|
|
104
|
+
const { translate } = useLocale();
|
|
104
105
|
|
|
105
106
|
const getOssConfig = (serverKey: string) => {
|
|
106
|
-
const { accessKeyId, accessKeySecret, bucket, endpoint } =
|
|
107
|
+
const { accessKeyId, accessKeySecret, bucket, endpoint } = ProgramConfig.getExtendServers(serverKey) || {};
|
|
107
108
|
const temObj = { accessKeyId, accessKeySecret, bucket, endpoint }
|
|
108
109
|
return temObj;
|
|
109
110
|
}
|
|
@@ -200,7 +201,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
200
201
|
|
|
201
202
|
return <Carousel adaptiveHeight={true} {...config} autoplaySpeed={(config.autoplaySpeed || 3) * 1000}>
|
|
202
203
|
{data.length && data.map((r, index) => <div key={index}> <Image style={{ width: size.width, height: size.height }} src={r} preview={isDesignMode ? false : config.preview} /></div>)}
|
|
203
|
-
{!data.length && <div>{renderEmpty(size.height)}</div>}
|
|
204
|
+
{!data.length && <div>{renderEmpty(size.height, translate)}</div>}
|
|
204
205
|
</Carousel>;
|
|
205
206
|
});
|
|
206
207
|
|
|
@@ -2,6 +2,7 @@ import * as echarts from 'echarts';
|
|
|
2
2
|
import React, { useEffect, useRef, useState, ForwardedRef, forwardRef, useImperativeHandle } from 'react';
|
|
3
3
|
import _ from 'lodash';
|
|
4
4
|
import { Spin } from "antd";
|
|
5
|
+
import { useLocale } from "../../locale/useLocale";
|
|
5
6
|
import HydrocarbonService from "../../tmpl/hcservice-v3";
|
|
6
7
|
import { DataConfigProps } from "../data";
|
|
7
8
|
|
|
@@ -158,6 +159,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
158
159
|
const chartRef = useRef<HTMLDivElement>(null);
|
|
159
160
|
const chart = useRef<any>(null);
|
|
160
161
|
const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
|
|
162
|
+
const { translate } = useLocale();
|
|
161
163
|
|
|
162
164
|
const handleDestroy = () => {
|
|
163
165
|
pollingIntervalRef.current && clearInterval(pollingIntervalRef.current);
|
|
@@ -285,6 +287,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
285
287
|
option.xAxis = { ...option.xAxis, ...xAxis, axisTick: { show: xAxis?.axisLine?.show } };
|
|
286
288
|
option.yAxis = { ...option.yAxis, ...yAxis };
|
|
287
289
|
option.dataZoom = dataZoom ? [{ type: "inside", disabled: false }] : [];
|
|
290
|
+
option.title.text = translate("${暂无数据}");
|
|
288
291
|
option.title.show = !temData?.length;
|
|
289
292
|
option.series = [{
|
|
290
293
|
type: 'custom',
|
|
@@ -2,6 +2,7 @@ import * as echarts from 'echarts';
|
|
|
2
2
|
import React, { useEffect, useRef, useState, ForwardedRef, forwardRef, useImperativeHandle } from 'react';
|
|
3
3
|
import _ from 'lodash';
|
|
4
4
|
import { Spin } from "antd";
|
|
5
|
+
import { useLocale } from "../../locale/useLocale";
|
|
5
6
|
import HydrocarbonService from "../../tmpl/hcservice-v3";
|
|
6
7
|
import { DataConfigProps } from "../data";
|
|
7
8
|
|
|
@@ -126,6 +127,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
126
127
|
const chartRef = useRef<HTMLDivElement>(null);
|
|
127
128
|
const chart = useRef<any>(null);
|
|
128
129
|
const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
|
|
130
|
+
const { translate } = useLocale();
|
|
129
131
|
|
|
130
132
|
// 组件销毁
|
|
131
133
|
const handleDestroy = () => {
|
|
@@ -244,6 +246,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
244
246
|
option.xAxis = { ...option.xAxis, ...xAxis, axisTick: { show: xAxis?.axisLine?.show } };
|
|
245
247
|
option.yAxis = { ...option.yAxis, ...yAxis };
|
|
246
248
|
option.dataZoom = dataZoom ? [{ type: "inside", disabled: false }] : [];
|
|
249
|
+
option.title.text = translate("${暂无数据}");
|
|
247
250
|
option.title.show = !temData?.length;
|
|
248
251
|
option.series = temData.map((r, index) => ({
|
|
249
252
|
type: "bar",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import React, { ForwardedRef, forwardRef, useEffect, useImperativeHandle, useMemo, useState, useRef } from 'react';
|
|
3
|
+
import { useLocale } from "../../locale/useLocale";
|
|
3
4
|
import HydrocarbonService from "../../tmpl/hcservice-v3";
|
|
4
5
|
import { DataConfigProps } from "../data";
|
|
5
6
|
import './index.less';
|
|
@@ -90,6 +91,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
90
91
|
const [searchParams, setSearchParams] = useState<{ [key: string]: any }>();
|
|
91
92
|
const [initSearchParams, setInitSearchParams] = useState<{ [key: string]: any }>();
|
|
92
93
|
const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
|
|
94
|
+
const { translate } = useLocale();
|
|
93
95
|
|
|
94
96
|
// 组件销毁
|
|
95
97
|
const handleDestroy = () => {
|
|
@@ -184,9 +186,9 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
184
186
|
if (enume?.length > 0) { // 枚举
|
|
185
187
|
const temEnume = enume.filter(item => item.rule && (item.num || item.num === 0));
|
|
186
188
|
const item = temEnume.find((item) => eval(`${Number(data)} ${rules[item.rule]} ${item.num}`));
|
|
187
|
-
return item ? { data: processString(item.value, data), color: item.color || config?.color } : { data, color: config?.color };
|
|
189
|
+
return item ? { data: translate("${" + processString(item.value, data) + "}"), color: item.color || config?.color } : { data: translate("${" + data + "}"), color: config?.color };
|
|
188
190
|
} else {
|
|
189
|
-
return { data, color: config?.color };
|
|
191
|
+
return { data: translate("${" + data + "}"), color: config?.color };
|
|
190
192
|
}
|
|
191
193
|
}, [data, enume]);
|
|
192
194
|
|
|
@@ -2,6 +2,7 @@ import * as echarts from 'echarts';
|
|
|
2
2
|
import React, { useEffect, useRef, useState, ForwardedRef, forwardRef, useImperativeHandle } from 'react';
|
|
3
3
|
import _ from 'lodash';
|
|
4
4
|
import { Spin } from "antd";
|
|
5
|
+
import { useLocale } from "../../locale/useLocale";
|
|
5
6
|
import HydrocarbonService from "../../tmpl/hcservice-v3";
|
|
6
7
|
import { DataConfigProps } from "../data";
|
|
7
8
|
|
|
@@ -117,6 +118,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
117
118
|
const chartRef = useRef<HTMLDivElement>(null);
|
|
118
119
|
const chart = useRef<any>(null);
|
|
119
120
|
const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
|
|
121
|
+
const { translate } = useLocale();
|
|
120
122
|
|
|
121
123
|
const handleDestroy = () => {
|
|
122
124
|
pollingIntervalRef.current && clearInterval(pollingIntervalRef.current);
|
|
@@ -234,6 +236,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
234
236
|
option.xAxis = { ...option.xAxis, ...xAxis, axisTick: { show: xAxis?.axisLine?.show } };
|
|
235
237
|
option.yAxis = { ...option.yAxis, ...yAxis };
|
|
236
238
|
option.dataZoom = dataZoom ? [{ type: "inside", disabled: false }] : [];
|
|
239
|
+
option.title.text = translate("${暂无数据}");
|
|
237
240
|
option.title.show = !temData?.length;
|
|
238
241
|
option.series = temData.map((r, index) => (index === 0 ? {
|
|
239
242
|
type: "line",
|
|
@@ -2,6 +2,7 @@ import * as echarts from 'echarts';
|
|
|
2
2
|
import React, { useEffect, useRef, useState, ForwardedRef, forwardRef, useImperativeHandle } from 'react';
|
|
3
3
|
import _ from 'lodash';
|
|
4
4
|
import { Spin } from "antd";
|
|
5
|
+
import { useLocale } from "../../locale/useLocale";
|
|
5
6
|
import HydrocarbonService from "../../tmpl/hcservice-v3";
|
|
6
7
|
import { DataConfigProps } from "../data";
|
|
7
8
|
|
|
@@ -112,6 +113,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
112
113
|
const chartRef = useRef<HTMLDivElement>(null);
|
|
113
114
|
const chart = useRef<any>(null);
|
|
114
115
|
const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
|
|
116
|
+
const { translate } = useLocale();
|
|
115
117
|
|
|
116
118
|
const handleDestroy = () => {
|
|
117
119
|
pollingIntervalRef.current && clearInterval(pollingIntervalRef.current);
|
|
@@ -228,6 +230,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
228
230
|
option.xAxis = { ...option.xAxis, ...xAxis, axisTick: { show: xAxis?.axisLine?.show } };
|
|
229
231
|
option.yAxis = { ...option.yAxis, ...yAxis };
|
|
230
232
|
option.dataZoom = dataZoom ? [{ type: "inside", disabled: false }] : [];
|
|
233
|
+
option.title.text = translate("${暂无数据}");
|
|
231
234
|
option.title.show = !temData?.length;
|
|
232
235
|
option.series = temData.map((r, index) => ({
|
|
233
236
|
type: "line",
|
|
@@ -2,6 +2,7 @@ import * as echarts from 'echarts';
|
|
|
2
2
|
import React, { useEffect, useRef, useState, ForwardedRef, forwardRef, useImperativeHandle } from 'react';
|
|
3
3
|
import _ from 'lodash';
|
|
4
4
|
import { Spin } from "antd";
|
|
5
|
+
import { useLocale } from "../../locale/useLocale";
|
|
5
6
|
import HydrocarbonService from "../../tmpl/hcservice-v3";
|
|
6
7
|
import { DataConfigProps } from "../data";
|
|
7
8
|
|
|
@@ -153,6 +154,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
153
154
|
const chartRef = useRef<HTMLDivElement>(null);
|
|
154
155
|
const chart = useRef<any>(null);
|
|
155
156
|
const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
|
|
157
|
+
const { translate } = useLocale();
|
|
156
158
|
|
|
157
159
|
const handleDestroy = () => {
|
|
158
160
|
pollingIntervalRef.current && clearInterval(pollingIntervalRef.current);
|
|
@@ -296,6 +298,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
296
298
|
option.legend = { ...legend, textStyle: temTextStyle, ...legends[position], formatter: (name) => legendFormatter({ name, formatter, unit }) };
|
|
297
299
|
option.tooltip = { trigger: "item", ...tooltip };
|
|
298
300
|
option.color = color;
|
|
301
|
+
option.title.text = translate("${暂无数据}");
|
|
299
302
|
option.title.show = !temData?.length;
|
|
300
303
|
option.series = temData.map(r => ({
|
|
301
304
|
...r,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import React, { ForwardedRef, forwardRef, useEffect, useImperativeHandle, useState } from 'react';
|
|
3
3
|
import CriteriaForm from "../../form/criteria-form";
|
|
4
4
|
import { Button, Modal, ConfigProvider, theme as antdTheme } from 'antd';
|
|
5
|
+
import { useLocale } from "../../locale/useLocale";
|
|
5
6
|
import { LtmplConfigRes, LtmplConfig } from "../../tmpl/interface";
|
|
6
7
|
import HCDataSource from "../../tmpl/hc-data-source";
|
|
7
8
|
import "./index.less";
|
|
@@ -38,7 +39,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
38
39
|
const [sourceId, setSourceId] = useState<string>(style?.sourceId); // 搜索表单的sourceId
|
|
39
40
|
const [ltmplConfig, setLtmplConfig] = useState<LtmplConfig>();
|
|
40
41
|
const [searchData, setSearchData] = useState<{ [key: string]: any }>({});
|
|
41
|
-
|
|
42
|
+
const { translate } = useLocale();
|
|
42
43
|
|
|
43
44
|
useImperativeHandle(ref, () => ({
|
|
44
45
|
updateConfig: (newConfig) => {
|
|
@@ -91,7 +92,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
91
92
|
|
|
92
93
|
const renderCriteriaForm = () => {
|
|
93
94
|
if (!ltmplConfig) {
|
|
94
|
-
return <div className='search-form-empty'
|
|
95
|
+
return <div className='search-form-empty'>{translate("${暂无数据}")}</div>;
|
|
95
96
|
}
|
|
96
97
|
const { form } = config;
|
|
97
98
|
return <ConfigProvider
|
|
@@ -113,7 +114,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
113
114
|
return (
|
|
114
115
|
<div className="search-form-component">
|
|
115
116
|
{type === "default" ? renderCriteriaForm() : renderModalBtn()}
|
|
116
|
-
{visible && <Modal width={config?.modalWidth || 520} title="
|
|
117
|
+
{visible && <Modal width={config?.modalWidth || 520} title={translate("${查询}")} open={visible} footer={null} onCancel={() => setVisible(false)}>{renderCriteriaForm()}</Modal>}
|
|
117
118
|
</div>
|
|
118
119
|
);
|
|
119
120
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as echarts from 'echarts';
|
|
2
2
|
import React, { useEffect, useRef, useState, ForwardedRef, forwardRef, useImperativeHandle } from 'react';
|
|
3
|
+
import { useLocale } from "../../locale/useLocale";
|
|
3
4
|
import HydrocarbonService from "../../tmpl/hcservice-v3";
|
|
4
5
|
import { DataConfigProps } from "../data";
|
|
5
6
|
|
|
@@ -43,6 +44,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
43
44
|
const chartRef = useRef<HTMLDivElement>(null);
|
|
44
45
|
const chart = useRef<any>(null);
|
|
45
46
|
const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
|
|
47
|
+
const { translate } = useLocale();
|
|
46
48
|
|
|
47
49
|
const handleDestroy = () => {
|
|
48
50
|
pollingIntervalRef.current && clearInterval(pollingIntervalRef.current);
|
|
@@ -152,7 +154,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
152
154
|
left: 'center',
|
|
153
155
|
top: 'center',
|
|
154
156
|
style: {
|
|
155
|
-
text: data,
|
|
157
|
+
text: translate("${" + data + "}"),
|
|
156
158
|
fontSize,
|
|
157
159
|
fontWeight,
|
|
158
160
|
lineDash: [0, 200],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { forwardRef, ForwardedRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
2
2
|
import './index.less';
|
|
3
3
|
import _ from "lodash";
|
|
4
|
+
import { useLocale } from "../../locale/useLocale";
|
|
4
5
|
import HydrocarbonService from "../../tmpl/hcservice-v3";
|
|
5
6
|
import { DataConfigProps } from "../data";
|
|
6
7
|
|
|
@@ -43,6 +44,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
43
44
|
const textContainerRef = useRef<HTMLDivElement>(null);
|
|
44
45
|
const resizeObserverRef = useRef<ResizeObserver | null>(null);
|
|
45
46
|
const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
|
|
47
|
+
const { translate } = useLocale();
|
|
46
48
|
|
|
47
49
|
const handleDestroy = () => {
|
|
48
50
|
resizeObserverRef.current && resizeObserverRef.current.disconnect();
|
|
@@ -153,7 +155,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
153
155
|
return (
|
|
154
156
|
<div className="text-scroller-container" ref={textContainerRef}>
|
|
155
157
|
<div className="text-scroller" style={{ ...config }} ref={textScrollerRef}>
|
|
156
|
-
{data}
|
|
158
|
+
{translate("${" + data + "}")}
|
|
157
159
|
</div>
|
|
158
160
|
</div>
|
|
159
161
|
);
|
|
@@ -81,6 +81,7 @@ interface ActTableProps extends TmplBaseProps {
|
|
|
81
81
|
allowUserConfig?: boolean; // 是否可用户自定义配置
|
|
82
82
|
deleteCallback?: (val: object) => void; // 删除回调
|
|
83
83
|
onUpdatePageSizeOptions?: (val: number[]) => void; // 更新分页数数组
|
|
84
|
+
showEmpty?: boolean; // 空数据是否显示空状态,默认显示
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
interface ActTableStat {
|
|
@@ -164,6 +165,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
164
165
|
operatable: true,
|
|
165
166
|
showPagination: true,
|
|
166
167
|
showAggregates: true,
|
|
168
|
+
showEmpty: true,
|
|
167
169
|
};
|
|
168
170
|
|
|
169
171
|
// 获取标签选项
|
|
@@ -1496,7 +1498,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1496
1498
|
let {
|
|
1497
1499
|
mainCode, sourceId, ltmplConfig, funcMode, operatable,
|
|
1498
1500
|
title, collapsible,
|
|
1499
|
-
onChangePage, serverKey, criteriaData,
|
|
1501
|
+
onChangePage, serverKey, criteriaData, showEmpty,
|
|
1500
1502
|
showView, doEdit, doRAction, customEditable, readOnly, tableType, showPagination, showAggregates, userPageConfig
|
|
1501
1503
|
} = this.props;
|
|
1502
1504
|
const { translate } = this.context;
|
|
@@ -1563,6 +1565,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1563
1565
|
onChangeRowSelection={this.changeRowSelection}
|
|
1564
1566
|
leftFixedCols={ltmplConfig.leftFixedCols}
|
|
1565
1567
|
onChangeResize={this.onChangeResize}
|
|
1568
|
+
showEmpty={showEmpty}
|
|
1566
1569
|
/> :
|
|
1567
1570
|
<QueryTable key={"querytable" + sourceId} sourceId={sourceId}
|
|
1568
1571
|
// queryTotal={this.queryTotal}
|
|
@@ -1594,6 +1597,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1594
1597
|
onChangeAggregateVO={(val) => this.setState({ aggregateVO: val })}
|
|
1595
1598
|
onChangeResize={this.onChangeResize}
|
|
1596
1599
|
pageSizeOptions={pageSizeOptions}
|
|
1600
|
+
showEmpty={showEmpty}
|
|
1597
1601
|
/>);
|
|
1598
1602
|
|
|
1599
1603
|
// tab拆解条件渲染
|
|
@@ -1793,8 +1797,8 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1793
1797
|
label={<div>{translate("${请手动输入}")}<span style={{ color: "#ff4d4f" }}> “ {translate("${" + strongDeleteConfirmText + "}")} ” </span>{translate("${完成验证}")}</div>}
|
|
1794
1798
|
name="rule"
|
|
1795
1799
|
rules={[
|
|
1796
|
-
{ required: true, message: translate("${请输入" + strongDeleteConfirmText + "}") },
|
|
1797
|
-
{ validator: (_, value) => value && value !== translate("${" + strongDeleteConfirmText + "}") ? Promise.reject(new Error(translate("${请输入" + strongDeleteConfirmText + "}"))) : Promise.resolve() }
|
|
1800
|
+
{ required: true, message: translate("${请输入}" + "${" + strongDeleteConfirmText + "}") },
|
|
1801
|
+
{ validator: (_, value) => value && value !== translate("${" + strongDeleteConfirmText + "}") ? Promise.reject(new Error(translate("${请输入}" + "${" + strongDeleteConfirmText + "}"))) : Promise.resolve() }
|
|
1798
1802
|
]}
|
|
1799
1803
|
>
|
|
1800
1804
|
<Input placeholder={translate("${" + strongDeleteConfirmText + "}")} />
|
|
@@ -28,6 +28,7 @@ const Index = (props: Props) => {
|
|
|
28
28
|
const { translate } = useLocale();
|
|
29
29
|
const { token } = useToken();
|
|
30
30
|
const [form] = Form.useForm();
|
|
31
|
+
const menuRef = useRef(null);
|
|
31
32
|
|
|
32
33
|
// 设置默认配置
|
|
33
34
|
const setPageConfigDefault = async () => {
|
|
@@ -78,6 +79,7 @@ const Index = (props: Props) => {
|
|
|
78
79
|
okText={translate("${确定}")}
|
|
79
80
|
cancelText={translate("${取消}")}
|
|
80
81
|
okType={"danger"}
|
|
82
|
+
getPopupContainer={() => menuRef.current}
|
|
81
83
|
>
|
|
82
84
|
<Tooltip title={translate("${更新}")}><UploadOutlined onClick={(e) => onClickOperation(e, item)} className="page-config-menu-item-icon" style={{ color: token.colorPrimary }} /></Tooltip>
|
|
83
85
|
</Popconfirm>
|
|
@@ -91,12 +93,13 @@ const Index = (props: Props) => {
|
|
|
91
93
|
okText={translate("${确定}")}
|
|
92
94
|
cancelText={translate("${取消}")}
|
|
93
95
|
okType={"danger"}
|
|
96
|
+
getPopupContainer={() => menuRef.current}
|
|
94
97
|
>
|
|
95
98
|
<Tooltip title={translate("${拉取云端默认配置}")}><DownloadOutlined onClick={(e) => onClickOperation(e, item)} className="page-config-menu-item-icon" style={{ color: token.colorPrimary }} /></Tooltip>
|
|
96
99
|
</Popconfirm> : ""}
|
|
97
100
|
{key !== "default" ?
|
|
98
101
|
<>
|
|
99
|
-
<Popover placement="bottom" open={editOpen && currentKey === item.key} destroyOnHidden={true} onOpenChange={(val) => { setEditOpen(val); form.setFieldValue("name",
|
|
102
|
+
<Popover placement="bottom" open={editOpen && currentKey === item.key} destroyOnHidden={true} onOpenChange={(val) => { setEditOpen(val); val ? form.setFieldValue("name", item.name) : form.resetFields(); }} zIndex={9999} content={renderAddForm} trigger="click" getPopupContainer={() => menuRef.current} >
|
|
100
103
|
<Tooltip title={translate("${编辑}")}>
|
|
101
104
|
<EditOutlined onClick={(e) => onClickOperation(e, item)} className="page-config-menu-item-icon" style={{ color: token.colorPrimary }} />
|
|
102
105
|
</Tooltip>
|
|
@@ -111,6 +114,7 @@ const Index = (props: Props) => {
|
|
|
111
114
|
okText={translate("${确定}")}
|
|
112
115
|
cancelText={translate("${取消}")}
|
|
113
116
|
okType={"danger"}
|
|
117
|
+
getPopupContainer={() => menuRef.current}
|
|
114
118
|
>
|
|
115
119
|
<Tooltip title={translate("${删除}")}><DeleteOutlined onClick={(e) => onClickOperation(e, item)} className="page-config-menu-item-icon" style={{ color: token.colorError }} /></Tooltip>
|
|
116
120
|
</Popconfirm>
|
|
@@ -177,14 +181,14 @@ const Index = (props: Props) => {
|
|
|
177
181
|
</Form>;
|
|
178
182
|
|
|
179
183
|
return <Dropdown trigger={["click"]} menu={{ items: [renderMenuItem({ key: "default", name: "默认" }), ...menus.map(r => renderMenuItem({ ...r, key: r.recordCode }))].filter(Boolean) }} popupRender={(menu) => (
|
|
180
|
-
<div style={contentStyle}>
|
|
184
|
+
<div style={contentStyle} ref={menuRef}>
|
|
181
185
|
{React.cloneElement(menu as any, { style: { boxShadow: 'none' } },)}
|
|
182
186
|
<Divider style={{ margin: 0 }} />
|
|
183
187
|
<div style={{ padding: "4px", display: "flex", justifyContent: "space-between", alignItems: "center" }}>
|
|
184
188
|
<Tooltip title={translate("${重置}")}>
|
|
185
189
|
<Button onClick={handleResetUserPageConfig} icon={<SyncOutlined />} />
|
|
186
190
|
</Tooltip>
|
|
187
|
-
<Popover placement="bottomRight" destroyOnHidden={true} open={addOpen} onOpenChange={setAddOpen} getPopupContainer={(val) => val} zIndex={9999} content={renderAddForm} trigger="click">
|
|
191
|
+
<Popover placement="bottomRight" destroyOnHidden={true} open={addOpen} onOpenChange={(val => { setCurrentKey(undefined); setAddOpen(val); })} getPopupContainer={(val) => val} zIndex={9999} content={renderAddForm} trigger="click">
|
|
188
192
|
<Tooltip title={translate("${添加我的菜单}")}><Button disabled={menus?.length > 4} icon={<PlusOutlined />} /></Tooltip>
|
|
189
193
|
</Popover>
|
|
190
194
|
</div>
|
|
@@ -64,6 +64,7 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
64
64
|
cardListConfig: {},
|
|
65
65
|
ltmplConfig: {},
|
|
66
66
|
showPagination: true,
|
|
67
|
+
showEmpty: true,
|
|
67
68
|
};
|
|
68
69
|
|
|
69
70
|
defaultAggregateShowSize = 7;
|
|
@@ -436,7 +437,8 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
436
437
|
showPagination,
|
|
437
438
|
onChangeResize,
|
|
438
439
|
pageSizeOptions,
|
|
439
|
-
onChangePage
|
|
440
|
+
onChangePage,
|
|
441
|
+
showEmpty
|
|
440
442
|
} = this.props;
|
|
441
443
|
//debugger
|
|
442
444
|
const { touchEnd, aggregateVO, loading, virtualEndPageNo, dataSource, errorText } = this.state;
|
|
@@ -596,6 +598,7 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
596
598
|
}
|
|
597
599
|
} : undefined}
|
|
598
600
|
onChangeResize={onChangeResize}
|
|
601
|
+
showEmpty={showEmpty}
|
|
599
602
|
/>
|
|
600
603
|
) : (
|
|
601
604
|
""
|
|
@@ -7,6 +7,7 @@ import ColumnBuilder from "./column/column-builder";
|
|
|
7
7
|
import ResizableTable from "./resizable-table";
|
|
8
8
|
|
|
9
9
|
const ReportTable = (props: ReportTableProps) => {
|
|
10
|
+
const { showEmpty = true } = props;
|
|
10
11
|
const [loading, setLoading] = useState<boolean>(false);
|
|
11
12
|
const [dataSource, setDataSource] = useState<object[]>(undefined);
|
|
12
13
|
const [reportData, setReportData] = useState<ReportData>(undefined);
|
|
@@ -118,6 +119,7 @@ const ReportTable = (props: ReportTableProps) => {
|
|
|
118
119
|
pagination={false}
|
|
119
120
|
style={{ display: columns ? "block" : "none", marginBottom: "12px" }}
|
|
120
121
|
onChangeResize={onChangeResize}
|
|
122
|
+
showEmpty={showEmpty}
|
|
121
123
|
/>
|
|
122
124
|
}
|
|
123
125
|
|
|
@@ -43,7 +43,7 @@ const ResizableTitle = props => {
|
|
|
43
43
|
|
|
44
44
|
const ResizableTable = props => {
|
|
45
45
|
|
|
46
|
-
const { columns: columns_, components: components_, onChangeResize, ...other } = props
|
|
46
|
+
const { columns: columns_, components: components_, onChangeResize, showEmpty, ...other } = props
|
|
47
47
|
// const [columns, setColumns] = useState(columns_.map((col) => {
|
|
48
48
|
// col['onHeaderCell']=(col) => ({
|
|
49
49
|
// ...col['onHeaderCell'],
|
|
@@ -90,7 +90,7 @@ const ResizableTable = props => {
|
|
|
90
90
|
header: { cell: ResizableTitle }
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
return <Table components={components} columns={columns} {...other} size="small" />;
|
|
93
|
+
return <Table components={components} columns={columns} {...other} locale={showEmpty !== false ? undefined : { emptyText: false }} size="small" />;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
export default ResizableTable;
|
|
@@ -47,6 +47,7 @@ export interface ReportTableProps {
|
|
|
47
47
|
) => void;
|
|
48
48
|
queryKey: QueryKey;
|
|
49
49
|
onChangeResize?: (value: { [key: string]: number }) => void; // 表格列尺寸更新
|
|
50
|
+
showEmpty?: boolean;
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
export interface CardListConfig {
|
|
@@ -94,6 +95,7 @@ export interface QueryTableProps extends ReportTableProps {
|
|
|
94
95
|
onChangeAggregateVO?: (aggregateVO: AggregateVO) => void;
|
|
95
96
|
onChangeResize?: (value: { [key: string]: number }) => void; // 表格列尺寸更新
|
|
96
97
|
pageSizeOptions?: number[]; // 分页数配置
|
|
98
|
+
showEmpty?: boolean; // 是否显示空状态
|
|
97
99
|
}
|
|
98
100
|
|
|
99
101
|
export interface AggregateVO {
|