aldehyde 0.2.437 → 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/entity-select/popover-entity-select.d.ts +4 -1
- package/lib/controls/entity-select/popover-entity-select.d.ts.map +1 -1
- package/lib/controls/entity-select/popover-entity-select.js +7 -7
- package/lib/controls/entity-select/popover-entity-select.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 +5 -2
- 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 +4 -1
- 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 +4 -1
- 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 +4 -1
- 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 +4 -1
- 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 +5 -1
- 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 +4 -1
- 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/table/select-table.d.ts.map +1 -1
- package/lib/table/select-table.js +5 -2
- package/lib/table/select-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 +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/entity-select/popover-entity-select.tsx +13 -7
- 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 +6 -3
- 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 +4 -1
- package/src/aldehyde/lowcode-components/carousel/index.tsx +6 -5
- package/src/aldehyde/lowcode-components/column-3d-chart/index.tsx +4 -1
- package/src/aldehyde/lowcode-components/column-chart/index.tsx +4 -1
- package/src/aldehyde/lowcode-components/data-number/index.tsx +4 -2
- package/src/aldehyde/lowcode-components/line-bar-chart/index.tsx +4 -1
- package/src/aldehyde/lowcode-components/line-chart/index.tsx +5 -1
- package/src/aldehyde/lowcode-components/pie-chart/index.tsx +4 -1
- 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/table/select-table.tsx +9 -3
- package/src/aldehyde/tmpl/interface.tsx +3 -0
|
@@ -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
|
|
|
@@ -57,7 +58,7 @@ const handleData = (data: { config: { [key: string]: string }, value: { [key: st
|
|
|
57
58
|
const temData = data.map((r) => {
|
|
58
59
|
const { config, value } = r;
|
|
59
60
|
const isD = Object.keys(config).some(r => r.includes("d"));
|
|
60
|
-
const vNames = Object.keys(config).filter((r) => r.startsWith("v")).sort((a, b) => parseInt(a.substring(1)) - parseInt(b.substring(1)));
|
|
61
|
+
const vNames = Object.keys(config).filter((r) => r.startsWith("v") && !r.includes("-")).sort((a, b) => parseInt(a.substring(1)) - parseInt(b.substring(1)));
|
|
61
62
|
return isD ? {
|
|
62
63
|
name: config.d1,
|
|
63
64
|
data: vNames.map((r) => ({
|
|
@@ -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
|
|
|
@@ -52,7 +53,8 @@ const handleData = (data: { config: { [key: string]: string }, value: { [key: st
|
|
|
52
53
|
const temData = data.map((r) => {
|
|
53
54
|
const { config, value } = r;
|
|
54
55
|
const isD = Object.keys(config).some(r => r.includes("d"));
|
|
55
|
-
|
|
56
|
+
// 过滤只有v1、v2等数据
|
|
57
|
+
const vNames = Object.keys(config).filter((r) => r.startsWith("v") && !r.includes("-")).sort((a, b) => parseInt(a.substring(1)) - parseInt(b.substring(1)));
|
|
56
58
|
return isD ? {
|
|
57
59
|
name: config.d1,
|
|
58
60
|
data: vNames.map((r) => ({
|
|
@@ -111,6 +113,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
111
113
|
const chartRef = useRef<HTMLDivElement>(null);
|
|
112
114
|
const chart = useRef<any>(null);
|
|
113
115
|
const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
|
|
116
|
+
const { translate } = useLocale();
|
|
114
117
|
|
|
115
118
|
const handleDestroy = () => {
|
|
116
119
|
pollingIntervalRef.current && clearInterval(pollingIntervalRef.current);
|
|
@@ -227,6 +230,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
227
230
|
option.xAxis = { ...option.xAxis, ...xAxis, axisTick: { show: xAxis?.axisLine?.show } };
|
|
228
231
|
option.yAxis = { ...option.yAxis, ...yAxis };
|
|
229
232
|
option.dataZoom = dataZoom ? [{ type: "inside", disabled: false }] : [];
|
|
233
|
+
option.title.text = translate("${暂无数据}");
|
|
230
234
|
option.title.show = !temData?.length;
|
|
231
235
|
option.series = temData.map((r, index) => ({
|
|
232
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
|
|
|
@@ -101,7 +102,7 @@ const handleData = (data: { config: { [key: string]: string }, value: { [key: st
|
|
|
101
102
|
}
|
|
102
103
|
} else {
|
|
103
104
|
const sum = Object.values(value[0]).reduce((total, item) => total + Number(item), 0);
|
|
104
|
-
const vNames = Object.keys(config).filter((r) => r.startsWith("v")).sort((a, b) => parseInt(a.substring(1)) - parseInt(b.substring(1)));
|
|
105
|
+
const vNames = Object.keys(config).filter((r) => r.startsWith("v") && !r.includes("-")).sort((a, b) => parseInt(a.substring(1)) - parseInt(b.substring(1)));
|
|
105
106
|
return {
|
|
106
107
|
name: "",
|
|
107
108
|
data: vNames.map(v => ({ name: config[v], value: value[0][v], pct: sum ? parseFloat(Number(value[0][v] / sum * 100).toFixed(2)) : 0 }))
|
|
@@ -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;
|
|
@@ -33,6 +33,7 @@ interface SelectTableProps extends ControlBaseProps, RouterCompProps {
|
|
|
33
33
|
// onCancel: () => void,
|
|
34
34
|
// onOK: (selectedRows: SelectedRow[]) => void,
|
|
35
35
|
onChange?: (selectedRows: SelectedRow[], selectedDatas: DtmplData[]) => void;
|
|
36
|
+
onClosePopover?: () => void; // Popover弹窗中使用SelectTable,弹窗中关闭弹窗
|
|
36
37
|
};
|
|
37
38
|
|
|
38
39
|
interface SelectTableStat {
|
|
@@ -390,8 +391,9 @@ class SelectTable extends React.PureComponent<SelectTableProps, SelectTableStat>
|
|
|
390
391
|
|
|
391
392
|
|
|
392
393
|
render() {
|
|
393
|
-
let { maxSelectedRows, selectedRows, selectedDatas, serverKey, sourceId, mainCode, fieldConfig, funcMode } = this.props;
|
|
394
|
+
let { maxSelectedRows, selectedRows, selectedDatas, serverKey, sourceId, mainCode, fieldConfig, funcMode, onClosePopover } = this.props;
|
|
394
395
|
let { queryKey, columns, selectConfig, criteriaData, loading, pageNo, pageSize, showView, drawCode, showEdit, ltmplConfig } = this.state;
|
|
396
|
+
const { translate } = this.context;
|
|
395
397
|
if (!selectConfig) {
|
|
396
398
|
return <>
|
|
397
399
|
</>
|
|
@@ -405,6 +407,10 @@ class SelectTable extends React.PureComponent<SelectTableProps, SelectTableStat>
|
|
|
405
407
|
(actions && actions.length > 0) || (jumps && jumps.length > 0) || (fileExports && fileExports.length > 0)) {
|
|
406
408
|
displayCriteriaCard = true;
|
|
407
409
|
}
|
|
410
|
+
|
|
411
|
+
const addAction = actions?.includes("add") ? [{ id: "add", buttonType: 'primary', title: translate("${添加}"), defDisabled: false, onClick: () => { this.editItem() } }] : [];
|
|
412
|
+
const closePopover = onClosePopover ? [{ id: "closePopover", buttonType: 'primary', title: translate("${确认}"), defDisabled: false, onClick: () => onClosePopover() }] : [];
|
|
413
|
+
|
|
408
414
|
// debugger
|
|
409
415
|
return (
|
|
410
416
|
// <Card
|
|
@@ -422,10 +428,10 @@ class SelectTable extends React.PureComponent<SelectTableProps, SelectTableStat>
|
|
|
422
428
|
serverKey={serverKey}
|
|
423
429
|
selectedRows={selectedRows}
|
|
424
430
|
selectedDatas={selectedDatas}
|
|
425
|
-
ltmplConfig={{ ...selectConfig, customButtons:
|
|
431
|
+
ltmplConfig={{ ...selectConfig, customButtons: [...(selectConfig.customButtons || []), ...addAction, ...closePopover] }}
|
|
426
432
|
data={criteriaData}
|
|
427
433
|
doSearch={this.doSearch} loading={loading}
|
|
428
|
-
doCustomButton={() =>
|
|
434
|
+
doCustomButton={(customButton) => customButton?.onClick()}
|
|
429
435
|
doAction={this.doSelectedAction}
|
|
430
436
|
/>
|
|
431
437
|
</div> : null}
|
|
@@ -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 {
|
|
@@ -175,6 +177,7 @@ export interface CustomButton extends ButtonConfig {
|
|
|
175
177
|
windowWidth: string;
|
|
176
178
|
preposes: FieldConfig[];
|
|
177
179
|
defDisabled?: boolean;
|
|
180
|
+
onClick?: () => void;
|
|
178
181
|
}
|
|
179
182
|
|
|
180
183
|
export interface FileExportButton extends ButtonConfig {
|