aldehyde 0.2.438 → 0.2.440
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 +3 -2
- 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/module/ltmpl-table.d.ts +1 -0
- package/lib/module/ltmpl-table.d.ts.map +1 -1
- package/lib/module/ltmpl-table.js +4 -3
- package/lib/module/ltmpl-table.js.map +1 -1
- package/lib/table/act-table.d.ts +3 -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 +7 -3
- 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 +3 -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 +3 -2
- package/src/aldehyde/controls/2dEditor/components/data.d.ts +1 -0
- 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/module/ltmpl-table.tsx +6 -2
- package/src/aldehyde/table/act-table.tsx +9 -3
- package/src/aldehyde/table/page-config-button.tsx +7 -3
- package/src/aldehyde/table/query-table.tsx +9 -2
- package/src/aldehyde/table/report-table.tsx +2 -0
- package/src/aldehyde/table/resizable-table.tsx +2 -2
- package/src/aldehyde/tmpl/interface.tsx +3 -0
|
@@ -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
|
|
|
@@ -13,7 +14,7 @@ const defOption = {
|
|
|
13
14
|
show: false, // 无数据时显示
|
|
14
15
|
},
|
|
15
16
|
tooltip: { trigger: "axis" },
|
|
16
|
-
grid: { top: 30,
|
|
17
|
+
grid: { top: 30, left: 30, right: 20, bottom: 30 },
|
|
17
18
|
yAxis: {
|
|
18
19
|
type: 'category',
|
|
19
20
|
boundaryGap: true,
|
|
@@ -69,7 +70,7 @@ const handleData = (data: { config: { [key: string]: string }, value: { [key: st
|
|
|
69
70
|
export interface ComponentStyle {
|
|
70
71
|
tooltip?: { show: boolean };
|
|
71
72
|
color?: string[];
|
|
72
|
-
grid?: { top: number,
|
|
73
|
+
grid?: { top: number, left: number, right: number, bottom: number };
|
|
73
74
|
xAxis?: { [key: string]: any };
|
|
74
75
|
yAxis?: { [key: string]: any };
|
|
75
76
|
legend?: { [key: string]: any };
|
|
@@ -104,6 +105,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
104
105
|
const chartRef = useRef<HTMLDivElement>(null);
|
|
105
106
|
const chart = useRef<any>(null);
|
|
106
107
|
const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
|
|
108
|
+
const { translate } = useLocale();
|
|
107
109
|
|
|
108
110
|
const handleDestroy = () => {
|
|
109
111
|
pollingIntervalRef.current && clearInterval(pollingIntervalRef.current);
|
|
@@ -222,6 +224,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
222
224
|
option.xAxis = { ...option.xAxis, ...xAxis, axisTick: { show: xAxis?.axisLine?.show } };
|
|
223
225
|
option.yAxis = { ...option.yAxis, ...yAxis };
|
|
224
226
|
option.dataZoom = dataZoom ? [{ type: "inside", disabled: false, orient: "vertical" }] : [];
|
|
227
|
+
option.title.text = translate("${暂无数据}");
|
|
225
228
|
option.title.show = !temData?.length;
|
|
226
229
|
option.series = temData.map((r, index) => ({
|
|
227
230
|
type: "bar",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import React, { ForwardedRef, forwardRef, useImperativeHandle, useState, useMemo, useEffect } from 'react';
|
|
3
3
|
import { Button } from "antd";
|
|
4
|
+
import { useLocale } from "../../locale/useLocale";
|
|
4
5
|
import HydrocarbonService from "../../tmpl/hcservice-v3";
|
|
5
6
|
import ProgramConfig from "../../units";
|
|
6
7
|
import LowcodeConstant from "../assets/lowcode-constant";
|
|
@@ -112,6 +113,7 @@ const ButtonComponent = forwardRef((props: ComponentProps, ref: ForwardedRef<Com
|
|
|
112
113
|
const { style, navigate, isDesignMode } = props;
|
|
113
114
|
const [config, setConfig] = useState<ComponentStyle>(style || {});
|
|
114
115
|
const [localImgDel, setLocalImgDel] = useState<boolean>(false);
|
|
116
|
+
const { translate } = useLocale();
|
|
115
117
|
|
|
116
118
|
useImperativeHandle(ref, () => ({
|
|
117
119
|
updateConfig: (newConfig) => { // 组件更新配置
|
|
@@ -188,7 +190,7 @@ const ButtonComponent = forwardRef((props: ComponentProps, ref: ForwardedRef<Com
|
|
|
188
190
|
onClick={onClick}
|
|
189
191
|
>
|
|
190
192
|
{isDesignMode && localImgDel ? <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}
|
|
191
|
-
{config.text
|
|
193
|
+
{config.text ? translate("${" + config.text + "}") : ""}
|
|
192
194
|
</Button>
|
|
193
195
|
);
|
|
194
196
|
});
|
|
@@ -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
|
);
|
|
@@ -37,6 +37,7 @@ export interface LtmplTableProps {
|
|
|
37
37
|
showPagination?: boolean; // 是否显示分页
|
|
38
38
|
showAggregates?: boolean; // 是否显示统计卡片数据
|
|
39
39
|
deleteCallback?: (val: object) => void; // 删除回调
|
|
40
|
+
loadDataCallback?: (val: object[]) => void; // 请求数据回调函数
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
export interface LtmplTableState {
|
|
@@ -205,7 +206,8 @@ class LtmplTable extends React.PureComponent<LtmplTableProps, LtmplTableState> {
|
|
|
205
206
|
|
|
206
207
|
doSearch = (params_) => {
|
|
207
208
|
const { sourceId, mainCode, collapsible } = this.props;
|
|
208
|
-
|
|
209
|
+
const { criteriaData } = this.state;
|
|
210
|
+
let params = { ...criteriaData, ...params_ };
|
|
209
211
|
//追加过滤条件,hiddenColIds,innerQueryKey
|
|
210
212
|
if (mainCode) {
|
|
211
213
|
params["mainCode"] = mainCode;
|
|
@@ -258,7 +260,8 @@ class LtmplTable extends React.PureComponent<LtmplTableProps, LtmplTableState> {
|
|
|
258
260
|
doRAction, funcMode,
|
|
259
261
|
tip, title, collapsible,
|
|
260
262
|
initCollapse, doCustomEdit, doCustomCreate,
|
|
261
|
-
serverKey, rowOperatable, readOnly, defShowType, showPagination, showAggregates, deleteCallback
|
|
263
|
+
serverKey, rowOperatable, readOnly, defShowType, showPagination, showAggregates, deleteCallback,
|
|
264
|
+
loadDataCallback
|
|
262
265
|
} = this.props;
|
|
263
266
|
const { translate } = this.context;
|
|
264
267
|
|
|
@@ -286,6 +289,7 @@ class LtmplTable extends React.PureComponent<LtmplTableProps, LtmplTableState> {
|
|
|
286
289
|
showPagination={showPagination}
|
|
287
290
|
showAggregates={showAggregates}
|
|
288
291
|
deleteCallback={deleteCallback}
|
|
292
|
+
loadDataCallback={loadDataCallback}
|
|
289
293
|
/>
|
|
290
294
|
{buttons.includes("detail") && showDtmplView ? (
|
|
291
295
|
<ModalDtmplView
|
|
@@ -81,6 +81,8 @@ interface ActTableProps extends TmplBaseProps {
|
|
|
81
81
|
allowUserConfig?: boolean; // 是否可用户自定义配置
|
|
82
82
|
deleteCallback?: (val: object) => void; // 删除回调
|
|
83
83
|
onUpdatePageSizeOptions?: (val: number[]) => void; // 更新分页数数组
|
|
84
|
+
showEmpty?: boolean; // 空数据是否显示空状态,默认显示
|
|
85
|
+
loadDataCallback?: (val: object[]) => void; // 请求数据回调函数
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
interface ActTableStat {
|
|
@@ -164,6 +166,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
164
166
|
operatable: true,
|
|
165
167
|
showPagination: true,
|
|
166
168
|
showAggregates: true,
|
|
169
|
+
showEmpty: true,
|
|
167
170
|
};
|
|
168
171
|
|
|
169
172
|
// 获取标签选项
|
|
@@ -1496,7 +1499,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1496
1499
|
let {
|
|
1497
1500
|
mainCode, sourceId, ltmplConfig, funcMode, operatable,
|
|
1498
1501
|
title, collapsible,
|
|
1499
|
-
onChangePage, serverKey, criteriaData,
|
|
1502
|
+
onChangePage, serverKey, criteriaData, showEmpty, loadDataCallback,
|
|
1500
1503
|
showView, doEdit, doRAction, customEditable, readOnly, tableType, showPagination, showAggregates, userPageConfig
|
|
1501
1504
|
} = this.props;
|
|
1502
1505
|
const { translate } = this.context;
|
|
@@ -1563,6 +1566,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1563
1566
|
onChangeRowSelection={this.changeRowSelection}
|
|
1564
1567
|
leftFixedCols={ltmplConfig.leftFixedCols}
|
|
1565
1568
|
onChangeResize={this.onChangeResize}
|
|
1569
|
+
showEmpty={showEmpty}
|
|
1566
1570
|
/> :
|
|
1567
1571
|
<QueryTable key={"querytable" + sourceId} sourceId={sourceId}
|
|
1568
1572
|
// queryTotal={this.queryTotal}
|
|
@@ -1594,6 +1598,8 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1594
1598
|
onChangeAggregateVO={(val) => this.setState({ aggregateVO: val })}
|
|
1595
1599
|
onChangeResize={this.onChangeResize}
|
|
1596
1600
|
pageSizeOptions={pageSizeOptions}
|
|
1601
|
+
showEmpty={showEmpty}
|
|
1602
|
+
loadDataCallback={loadDataCallback}
|
|
1597
1603
|
/>);
|
|
1598
1604
|
|
|
1599
1605
|
// tab拆解条件渲染
|
|
@@ -1793,8 +1799,8 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1793
1799
|
label={<div>{translate("${请手动输入}")}<span style={{ color: "#ff4d4f" }}> “ {translate("${" + strongDeleteConfirmText + "}")} ” </span>{translate("${完成验证}")}</div>}
|
|
1794
1800
|
name="rule"
|
|
1795
1801
|
rules={[
|
|
1796
|
-
{ required: true, message: translate("${请输入" + strongDeleteConfirmText + "}") },
|
|
1797
|
-
{ validator: (_, value) => value && value !== translate("${" + strongDeleteConfirmText + "}") ? Promise.reject(new Error(translate("${请输入" + strongDeleteConfirmText + "}"))) : Promise.resolve() }
|
|
1802
|
+
{ required: true, message: translate("${请输入}" + "${" + strongDeleteConfirmText + "}") },
|
|
1803
|
+
{ validator: (_, value) => value && value !== translate("${" + strongDeleteConfirmText + "}") ? Promise.reject(new Error(translate("${请输入}" + "${" + strongDeleteConfirmText + "}"))) : Promise.resolve() }
|
|
1798
1804
|
]}
|
|
1799
1805
|
>
|
|
1800
1806
|
<Input placeholder={translate("${" + strongDeleteConfirmText + "}")} />
|