aldehyde 0.2.420 → 0.2.422
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/date-picker/index.d.ts.map +1 -1
- package/lib/controls/date-picker/index.js +8 -15
- package/lib/controls/date-picker/index.js.map +1 -1
- package/lib/controls/file-view/index.d.ts.map +1 -1
- package/lib/controls/file-view/index.js +5 -3
- package/lib/controls/file-view/index.js.map +1 -1
- package/lib/detail/button/view-button.d.ts +1 -0
- package/lib/detail/button/view-button.d.ts.map +1 -1
- package/lib/detail/button/view-button.js +3 -3
- package/lib/detail/button/view-button.js.map +1 -1
- package/lib/hooks/use-tabs/index.d.ts.map +1 -1
- package/lib/hooks/use-tabs/index.js +3 -0
- package/lib/hooks/use-tabs/index.js.map +1 -1
- package/lib/layout2/components/search-menu.js +1 -1
- package/lib/layout2/components/search-menu.js.map +1 -1
- package/lib/layout2/components/user-button.d.ts +3 -0
- package/lib/layout2/components/user-button.d.ts.map +1 -1
- package/lib/layout2/components/user-button.js +27 -7
- package/lib/layout2/components/user-button.js.map +1 -1
- package/lib/layout2/header.d.ts +2 -0
- package/lib/layout2/header.d.ts.map +1 -1
- package/lib/layout2/header.js +3 -3
- package/lib/layout2/header.js.map +1 -1
- package/lib/layout2/page.d.ts.map +1 -1
- package/lib/layout2/page.js +7 -5
- package/lib/layout2/page.js.map +1 -1
- package/lib/layout2/sider.d.ts +2 -0
- package/lib/layout2/sider.d.ts.map +1 -1
- package/lib/layout2/sider.js +2 -2
- package/lib/layout2/sider.js.map +1 -1
- package/lib/layout3/header.d.ts +2 -0
- package/lib/layout3/header.d.ts.map +1 -1
- package/lib/layout3/header.js +4 -4
- package/lib/layout3/header.js.map +1 -1
- package/lib/layout3/page.d.ts.map +1 -1
- package/lib/layout3/page.js +6 -4
- package/lib/layout3/page.js.map +1 -1
- package/lib/layout3/sider.d.ts +2 -0
- package/lib/layout3/sider.d.ts.map +1 -1
- package/lib/layout3/sider.js +2 -2
- package/lib/layout3/sider.js.map +1 -1
- package/lib/layout4/header.d.ts +2 -0
- package/lib/layout4/header.d.ts.map +1 -1
- package/lib/layout4/header.js +4 -4
- package/lib/layout4/header.js.map +1 -1
- package/lib/layout4/page.d.ts.map +1 -1
- package/lib/layout4/page.js +7 -5
- package/lib/layout4/page.js.map +1 -1
- package/lib/layout4/sider.d.ts +2 -0
- package/lib/layout4/sider.d.ts.map +1 -1
- package/lib/layout4/sider.js +2 -2
- package/lib/layout4/sider.js.map +1 -1
- package/lib/layout5/header.d.ts +2 -0
- package/lib/layout5/header.d.ts.map +1 -1
- package/lib/layout5/header.js +2 -2
- package/lib/layout5/header.js.map +1 -1
- package/lib/layout5/page.d.ts.map +1 -1
- package/lib/layout5/page.js +7 -5
- package/lib/layout5/page.js.map +1 -1
- package/lib/layout5/sider.d.ts +2 -0
- package/lib/layout5/sider.d.ts.map +1 -1
- package/lib/layout5/sider.js +2 -2
- package/lib/layout5/sider.js.map +1 -1
- package/lib/list/card-list/card-list-item.js +1 -1
- package/lib/list/card-list/card-list-item.js.map +1 -1
- package/lib/lowcode-components/bar-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/bar-chart/index.js +9 -1
- package/lib/lowcode-components/bar-chart/index.js.map +1 -1
- package/lib/lowcode-components/base-map/index.d.ts.map +1 -1
- package/lib/lowcode-components/base-map/index.js +9 -1
- package/lib/lowcode-components/base-map/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 +9 -1
- package/lib/lowcode-components/capsule-bar-chart/index.js.map +1 -1
- package/lib/lowcode-components/circular-progress-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/circular-progress-chart/index.js +9 -1
- package/lib/lowcode-components/circular-progress-chart/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 +9 -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 +9 -1
- package/lib/lowcode-components/column-chart/index.js.map +1 -1
- package/lib/lowcode-components/effectScatter-map/index.d.ts.map +1 -1
- package/lib/lowcode-components/effectScatter-map/index.js +9 -1
- package/lib/lowcode-components/effectScatter-map/index.js.map +1 -1
- package/lib/lowcode-components/effectScatter-map-3d/index.d.ts.map +1 -1
- package/lib/lowcode-components/effectScatter-map-3d/index.js +9 -1
- package/lib/lowcode-components/effectScatter-map-3d/index.js.map +1 -1
- package/lib/lowcode-components/gauge-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/gauge-chart/index.js +9 -1
- package/lib/lowcode-components/gauge-chart/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 +9 -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 +9 -1
- package/lib/lowcode-components/line-chart/index.js.map +1 -1
- package/lib/lowcode-components/liquid-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/liquid-chart/index.js +9 -1
- package/lib/lowcode-components/liquid-chart/index.js.map +1 -1
- package/lib/lowcode-components/lowcode-view/component/screen-fit/index.d.ts.map +1 -1
- package/lib/lowcode-components/lowcode-view/component/screen-fit/index.js +2 -0
- package/lib/lowcode-components/lowcode-view/component/screen-fit/index.js.map +1 -1
- package/lib/lowcode-components/lowcode-view/component/screen-fit/index.less +2 -1
- package/lib/lowcode-components/lowcode-view/index.d.ts +2 -1
- package/lib/lowcode-components/lowcode-view/index.d.ts.map +1 -1
- package/lib/lowcode-components/lowcode-view/index.js +2 -2
- package/lib/lowcode-components/lowcode-view/index.js.map +1 -1
- package/lib/lowcode-components/lowcode-view/index.less +7 -0
- package/lib/lowcode-components/pie-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/pie-chart/index.js +9 -1
- package/lib/lowcode-components/pie-chart/index.js.map +1 -1
- package/lib/lowcode-components/progress-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/progress-chart/index.js +9 -1
- package/lib/lowcode-components/progress-chart/index.js.map +1 -1
- package/lib/routable/ltmpl-route.d.ts +2 -1
- package/lib/routable/ltmpl-route.d.ts.map +1 -1
- package/lib/routable/ltmpl-route.js +11 -5
- package/lib/routable/ltmpl-route.js.map +1 -1
- package/lib/routable/splitview-ltmpl-route.d.ts.map +1 -1
- package/lib/routable/splitview-ltmpl-route.js +11 -4
- package/lib/routable/splitview-ltmpl-route.js.map +1 -1
- package/lib/table/act-table.d.ts +4 -0
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js +37 -12
- package/lib/table/act-table.js.map +1 -1
- package/lib/table/column/column-builder.d.ts.map +1 -1
- package/lib/table/column/column-builder.js +6 -8
- package/lib/table/column/column-builder.js.map +1 -1
- package/lib/table/index.css +29 -2
- package/lib/table/page-config-button.d.ts +15 -0
- package/lib/table/page-config-button.d.ts.map +1 -0
- package/lib/table/page-config-button.js +156 -0
- package/lib/table/page-config-button.js.map +1 -0
- package/lib/table/pagination.d.ts +1 -0
- package/lib/table/pagination.d.ts.map +1 -1
- package/lib/table/pagination.js +2 -2
- package/lib/table/pagination.js.map +1 -1
- package/lib/table/query-table.d.ts.map +1 -1
- package/lib/table/query-table.js +1 -1
- package/lib/table/query-table.js.map +1 -1
- package/lib/table/relation-table.d.ts +1 -0
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/tmpl/hcservice-v3.d.ts +9 -0
- package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
- package/lib/tmpl/hcservice-v3.js +154 -0
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/tmpl/interface.d.ts +21 -0
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/lib/units/index.d.ts +9 -4
- package/lib/units/index.d.ts.map +1 -1
- package/lib/units/index.js +49 -13
- package/lib/units/index.js.map +1 -1
- package/lib/welcome/HCWelcome.js +10 -0
- package/lib/welcome/HCWelcome.js.map +1 -1
- package/lib/welcome/components/menu-card.less +1 -0
- package/lib/welcome/components/user-menus.d.ts +16 -0
- package/lib/welcome/components/user-menus.d.ts.map +1 -0
- package/lib/welcome/components/user-menus.js +210 -0
- package/lib/welcome/components/user-menus.js.map +1 -0
- package/lib/welcome/components/user-menus.less +193 -0
- package/package.json +1 -1
- package/src/aldehyde/controls/date-picker/index.tsx +12 -4
- package/src/aldehyde/controls/file-view/index.tsx +5 -1
- package/src/aldehyde/detail/button/view-button.tsx +7 -6
- package/src/aldehyde/hooks/use-tabs/index.tsx +3 -0
- package/src/aldehyde/layout2/components/search-menu.tsx +1 -1
- package/src/aldehyde/layout2/components/user-button.tsx +45 -8
- package/src/aldehyde/layout2/header.tsx +5 -3
- package/src/aldehyde/layout2/page.tsx +8 -7
- package/src/aldehyde/layout2/sider.tsx +4 -3
- package/src/aldehyde/layout3/header.tsx +6 -4
- package/src/aldehyde/layout3/page.tsx +7 -4
- package/src/aldehyde/layout3/sider.tsx +4 -3
- package/src/aldehyde/layout4/header.tsx +6 -4
- package/src/aldehyde/layout4/page.tsx +8 -5
- package/src/aldehyde/layout4/sider.tsx +4 -3
- package/src/aldehyde/layout5/header.tsx +4 -2
- package/src/aldehyde/layout5/page.tsx +8 -5
- package/src/aldehyde/layout5/sider.tsx +4 -3
- package/src/aldehyde/list/card-list/card-list-item.tsx +1 -1
- package/src/aldehyde/lowcode-components/bar-chart/index.tsx +12 -2
- package/src/aldehyde/lowcode-components/base-map/index.tsx +12 -2
- package/src/aldehyde/lowcode-components/capsule-bar-chart/index.tsx +12 -2
- package/src/aldehyde/lowcode-components/circular-progress-chart/index.tsx +12 -2
- package/src/aldehyde/lowcode-components/column-3d-chart/index.tsx +12 -2
- package/src/aldehyde/lowcode-components/column-chart/index.tsx +12 -2
- package/src/aldehyde/lowcode-components/effectScatter-map/index.tsx +12 -2
- package/src/aldehyde/lowcode-components/effectScatter-map-3d/index.tsx +12 -2
- package/src/aldehyde/lowcode-components/gauge-chart/index.tsx +12 -2
- package/src/aldehyde/lowcode-components/line-bar-chart/index.tsx +12 -2
- package/src/aldehyde/lowcode-components/line-chart/index.tsx +12 -2
- package/src/aldehyde/lowcode-components/liquid-chart/index.tsx +12 -2
- package/src/aldehyde/lowcode-components/lowcode-view/component/screen-fit/index.less +2 -1
- package/src/aldehyde/lowcode-components/lowcode-view/component/screen-fit/index.tsx +3 -1
- package/src/aldehyde/lowcode-components/lowcode-view/index.less +7 -0
- package/src/aldehyde/lowcode-components/lowcode-view/index.tsx +3 -1
- package/src/aldehyde/lowcode-components/pie-chart/index.tsx +12 -2
- package/src/aldehyde/lowcode-components/progress-chart/index.tsx +12 -2
- package/src/aldehyde/routable/ltmpl-route.tsx +13 -5
- package/src/aldehyde/routable/splitview-ltmpl-route.tsx +12 -3
- package/src/aldehyde/table/act-table.tsx +44 -13
- package/src/aldehyde/table/column/column-builder.tsx +13 -20
- package/src/aldehyde/table/index.css +29 -2
- package/src/aldehyde/table/page-config-button.tsx +199 -0
- package/src/aldehyde/table/pagination.tsx +8 -7
- package/src/aldehyde/table/query-table.tsx +1 -0
- package/src/aldehyde/tmpl/hcservice-v3.tsx +136 -0
- package/src/aldehyde/tmpl/interface.tsx +22 -0
- package/src/aldehyde/units/index.tsx +34 -3
- package/src/aldehyde/welcome/HCWelcome.js +10 -0
- package/src/aldehyde/welcome/components/menu-card.less +1 -0
- package/src/aldehyde/welcome/components/user-menus.less +193 -0
- package/src/aldehyde/welcome/components/user-menus.tsx +275 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as echarts from 'echarts';
|
|
2
2
|
import React, { useEffect, useRef, useState, ForwardedRef, forwardRef, useImperativeHandle } from 'react';
|
|
3
3
|
import _ from 'lodash';
|
|
4
|
+
import { Spin } from "antd";
|
|
4
5
|
import ProgramConfig from "../../units";
|
|
5
6
|
import chinaJson from "../assets/china.json";
|
|
6
7
|
import HydrocarbonService from "../../tmpl/hcservice-v3";
|
|
@@ -195,7 +196,7 @@ export interface ComponentStyle {
|
|
|
195
196
|
|
|
196
197
|
export interface ComponentProps {
|
|
197
198
|
style?: ComponentStyle;
|
|
198
|
-
base: { width: number, height: number }
|
|
199
|
+
base: { width: number, height: number };
|
|
199
200
|
data?: DataConfigProps;
|
|
200
201
|
isDesignMode?: boolean; // 是否编辑模式
|
|
201
202
|
initSearchParams?: { [key: string]: any }; // 全局初始化外部参数,例:传参包含设备id,则在查询时带上设备id
|
|
@@ -214,6 +215,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
214
215
|
const [data, setData] = useState<{ name: string, value: number[] }[]>([]);
|
|
215
216
|
const [searchParams, setSearchParams] = useState<{ [key: string]: any }>();
|
|
216
217
|
const [initSearchParams, setInitSearchParams] = useState<{ [key: string]: any }>();
|
|
218
|
+
const [loading, setLoading] = useState<boolean>(false);
|
|
217
219
|
const chartRef = useRef<HTMLDivElement>(null);
|
|
218
220
|
const chart = useRef<any>(null);
|
|
219
221
|
const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
|
|
@@ -279,7 +281,9 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
279
281
|
|
|
280
282
|
// 请求数据
|
|
281
283
|
const getData = async (params?: object) => {
|
|
284
|
+
setLoading(true);
|
|
282
285
|
const { data } = await HydrocarbonService.requestChartData(null, dataConfig?.sourceId, params) || {};
|
|
286
|
+
setLoading(false);
|
|
283
287
|
const { config, value } = data || {};
|
|
284
288
|
setData(handleData(value));
|
|
285
289
|
return config;
|
|
@@ -394,7 +398,13 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
394
398
|
}
|
|
395
399
|
}, [size]);
|
|
396
400
|
|
|
397
|
-
|
|
401
|
+
const renderChartDom = () => <div ref={chartRef} style={{ width: '100%', height: '100%' }} />;
|
|
402
|
+
|
|
403
|
+
if (isDesignMode) {
|
|
404
|
+
return renderChartDom();
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
return <Spin spinning={loading}>{renderChartDom()}</Spin>;
|
|
398
408
|
});
|
|
399
409
|
|
|
400
410
|
export default Index;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as echarts from 'echarts';
|
|
2
2
|
import React, { useEffect, useRef, useState, ForwardedRef, forwardRef, useImperativeHandle } from 'react';
|
|
3
3
|
import _ from 'lodash';
|
|
4
|
+
import { Spin } from "antd";
|
|
4
5
|
import HydrocarbonService from "../../tmpl/hcservice-v3";
|
|
5
6
|
import { DataConfigProps } from "../data";
|
|
6
7
|
|
|
@@ -46,7 +47,7 @@ export interface ComponentStyle {
|
|
|
46
47
|
|
|
47
48
|
export interface ComponentProps {
|
|
48
49
|
style?: ComponentStyle;
|
|
49
|
-
base: { width: number, height: number }
|
|
50
|
+
base: { width: number, height: number };
|
|
50
51
|
data?: DataConfigProps;
|
|
51
52
|
isDesignMode?: boolean; // 是否编辑模式
|
|
52
53
|
initSearchParams?: { [key: string]: any }; // 全局初始化外部参数,例:传参包含设备id,则在查询时带上设备id
|
|
@@ -66,6 +67,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
66
67
|
const [data, setData] = useState<number>(0);
|
|
67
68
|
const [searchParams, setSearchParams] = useState<{ [key: string]: any }>();
|
|
68
69
|
const [initSearchParams, setInitSearchParams] = useState<{ [key: string]: any }>();
|
|
70
|
+
const [loading, setLoading] = useState<boolean>(false);
|
|
69
71
|
const chartRef = useRef<HTMLDivElement>(null);
|
|
70
72
|
const chart = useRef<any>(null);
|
|
71
73
|
const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
|
|
@@ -121,7 +123,9 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
121
123
|
|
|
122
124
|
// 请求数据
|
|
123
125
|
const getData = async (params?: object) => {
|
|
126
|
+
setLoading(true);
|
|
124
127
|
const { data } = await HydrocarbonService.requestChartData(null, dataConfig?.sourceId, params) || {};
|
|
128
|
+
setLoading(false);
|
|
125
129
|
const { config, value } = data || {};
|
|
126
130
|
const temData = handleData(value);
|
|
127
131
|
setData(temData);
|
|
@@ -227,7 +231,13 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
227
231
|
}
|
|
228
232
|
}, [size]);
|
|
229
233
|
|
|
230
|
-
|
|
234
|
+
const renderChartDom = () => <div ref={chartRef} style={{ width: '100%', height: '100%' }} />;
|
|
235
|
+
|
|
236
|
+
if (isDesignMode) {
|
|
237
|
+
return renderChartDom();
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
return <Spin spinning={loading}>{renderChartDom()}</Spin>;
|
|
231
241
|
});
|
|
232
242
|
|
|
233
243
|
export default Index;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as echarts from 'echarts';
|
|
2
2
|
import React, { useEffect, useRef, useState, ForwardedRef, forwardRef, useImperativeHandle } from 'react';
|
|
3
3
|
import _ from 'lodash';
|
|
4
|
+
import { Spin } from "antd";
|
|
4
5
|
import HydrocarbonService from "../../tmpl/hcservice-v3";
|
|
5
6
|
import { DataConfigProps } from "../data";
|
|
6
7
|
|
|
@@ -92,7 +93,7 @@ export interface ComponentStyle {
|
|
|
92
93
|
|
|
93
94
|
export interface ComponentProps {
|
|
94
95
|
style?: ComponentStyle;
|
|
95
|
-
base: { width: number, height: number }
|
|
96
|
+
base: { width: number, height: number };
|
|
96
97
|
data?: DataConfigProps;
|
|
97
98
|
isDesignMode?: boolean; // 是否编辑模式
|
|
98
99
|
initSearchParams?: { [key: string]: any }; // 全局初始化外部参数,例:传参包含设备id,则在查询时带上设备id
|
|
@@ -112,6 +113,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
112
113
|
const [data, setData] = useState<{ name: string, data: any }[]>([]);
|
|
113
114
|
const [searchParams, setSearchParams] = useState<{ [key: string]: any }>();
|
|
114
115
|
const [initSearchParams, setInitSearchParams] = useState<{ [key: string]: any }>();
|
|
116
|
+
const [loading, setLoading] = useState<boolean>(false);
|
|
115
117
|
const chartRef = useRef<HTMLDivElement>(null);
|
|
116
118
|
const chart = useRef<any>(null);
|
|
117
119
|
const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
|
|
@@ -167,7 +169,9 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
167
169
|
|
|
168
170
|
// 请求数据
|
|
169
171
|
const getData = async (params?: object) => {
|
|
172
|
+
setLoading(true);
|
|
170
173
|
const { data } = await HydrocarbonService.requestChartData(null, dataConfig?.sourceId, params) || {};
|
|
174
|
+
setLoading(false);
|
|
171
175
|
const { config, value } = data || {};
|
|
172
176
|
const temData = handleData(value);
|
|
173
177
|
setData(temData);
|
|
@@ -264,7 +268,13 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
264
268
|
}
|
|
265
269
|
}, [size]);
|
|
266
270
|
|
|
267
|
-
|
|
271
|
+
const renderChartDom = () => <div ref={chartRef} style={{ width: '100%', height: '100%' }} />;
|
|
272
|
+
|
|
273
|
+
if (isDesignMode) {
|
|
274
|
+
return renderChartDom();
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
return <Spin spinning={loading}>{renderChartDom()}</Spin>;
|
|
268
278
|
});
|
|
269
279
|
|
|
270
280
|
export default Index;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as echarts from 'echarts';
|
|
2
2
|
import React, { useEffect, useRef, useState, ForwardedRef, forwardRef, useImperativeHandle } from 'react';
|
|
3
3
|
import _ from 'lodash';
|
|
4
|
+
import { Spin } from "antd";
|
|
4
5
|
import HydrocarbonService from "../../tmpl/hcservice-v3";
|
|
5
6
|
import { DataConfigProps } from "../data";
|
|
6
7
|
|
|
@@ -86,7 +87,7 @@ export interface ComponentStyle {
|
|
|
86
87
|
|
|
87
88
|
export interface ComponentProps {
|
|
88
89
|
style?: ComponentStyle;
|
|
89
|
-
base: { width: number, height: number }
|
|
90
|
+
base: { width: number, height: number };
|
|
90
91
|
data?: DataConfigProps;
|
|
91
92
|
isDesignMode?: boolean; // 是否编辑模式
|
|
92
93
|
initSearchParams?: { [key: string]: any }; // 全局初始化外部参数,例:传参包含设备id,则在查询时带上设备id
|
|
@@ -106,6 +107,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
106
107
|
const [data, setData] = useState<{ name: string, data: any }[]>([]);
|
|
107
108
|
const [searchParams, setSearchParams] = useState<{ [key: string]: any }>();
|
|
108
109
|
const [initSearchParams, setInitSearchParams] = useState<{ [key: string]: any }>();
|
|
110
|
+
const [loading, setLoading] = useState<boolean>(false);
|
|
109
111
|
const chartRef = useRef<HTMLDivElement>(null);
|
|
110
112
|
const chart = useRef<any>(null);
|
|
111
113
|
const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
|
|
@@ -161,7 +163,9 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
161
163
|
|
|
162
164
|
// 请求数据
|
|
163
165
|
const getData = async (params?: object) => {
|
|
166
|
+
setLoading(true);
|
|
164
167
|
const { data } = await HydrocarbonService.requestChartData(null, dataConfig?.sourceId, params) || {};
|
|
168
|
+
setLoading(false);
|
|
165
169
|
const { config, value } = data || {};
|
|
166
170
|
const temData = handleData(value);
|
|
167
171
|
setData(temData);
|
|
@@ -253,7 +257,13 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
253
257
|
}
|
|
254
258
|
}, [size]);
|
|
255
259
|
|
|
256
|
-
|
|
260
|
+
const renderChartDom = () => <div ref={chartRef} style={{ width: '100%', height: '100%' }} />;
|
|
261
|
+
|
|
262
|
+
if (isDesignMode) {
|
|
263
|
+
return renderChartDom();
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
return <Spin spinning={loading}>{renderChartDom()}</Spin>;
|
|
257
267
|
});
|
|
258
268
|
|
|
259
269
|
export default Index;
|
|
@@ -2,6 +2,7 @@ import * as echarts from 'echarts';
|
|
|
2
2
|
import 'echarts-liquidfill';
|
|
3
3
|
import React, { useEffect, useRef, useState, ForwardedRef, forwardRef, useImperativeHandle } from 'react';
|
|
4
4
|
import _ from 'lodash';
|
|
5
|
+
import { Spin } from "antd";
|
|
5
6
|
import HydrocarbonService from "../../tmpl/hcservice-v3";
|
|
6
7
|
import { DataConfigProps } from "../data";
|
|
7
8
|
|
|
@@ -62,7 +63,7 @@ export interface ComponentStyle {
|
|
|
62
63
|
|
|
63
64
|
export interface ComponentProps {
|
|
64
65
|
style?: ComponentStyle;
|
|
65
|
-
base: { width: number, height: number }
|
|
66
|
+
base: { width: number, height: number };
|
|
66
67
|
data?: DataConfigProps;
|
|
67
68
|
isDesignMode?: boolean; // 是否编辑模式
|
|
68
69
|
initSearchParams?: { [key: string]: any }; // 全局初始化外部参数,例:传参包含设备id,则在查询时带上设备id
|
|
@@ -82,6 +83,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
82
83
|
const [data, setData] = useState<number>(0);
|
|
83
84
|
const [searchParams, setSearchParams] = useState<{ [key: string]: any }>();
|
|
84
85
|
const [initSearchParams, setInitSearchParams] = useState<{ [key: string]: any }>();
|
|
86
|
+
const [loading, setLoading] = useState<boolean>(false);
|
|
85
87
|
const chartRef = useRef<HTMLDivElement>(null);
|
|
86
88
|
const chart = useRef<any>(null);
|
|
87
89
|
const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
|
|
@@ -137,7 +139,9 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
137
139
|
|
|
138
140
|
// 请求数据
|
|
139
141
|
const getData = async (params?: object) => {
|
|
142
|
+
setLoading(true);
|
|
140
143
|
const { data } = await HydrocarbonService.requestChartData(null, dataConfig?.sourceId, params) || {};
|
|
144
|
+
setLoading(false);
|
|
141
145
|
const { config, value } = data || {};
|
|
142
146
|
const temData = handleData(value);
|
|
143
147
|
setData(temData);
|
|
@@ -225,7 +229,13 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
225
229
|
}
|
|
226
230
|
}, [size]);
|
|
227
231
|
|
|
228
|
-
|
|
232
|
+
const renderChartDom = () => <div ref={chartRef} style={{ width: '100%', height: '100%' }} />;
|
|
233
|
+
|
|
234
|
+
if (isDesignMode) {
|
|
235
|
+
return renderChartDom();
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
return <Spin spinning={loading}>{renderChartDom()}</Spin>;
|
|
229
239
|
});
|
|
230
240
|
|
|
231
241
|
export default Index;
|
|
@@ -52,10 +52,12 @@ export default function ScreenFit(props: ScreenFitProps) {
|
|
|
52
52
|
break;
|
|
53
53
|
case 'full-x':
|
|
54
54
|
elRef.current.style.transform = `scale(${widthScale})`;
|
|
55
|
+
canvasRef.current.style.height = `${Number(realHeight) * widthScale}px`;
|
|
55
56
|
scaleChange?.(widthScale, widthScale);
|
|
56
57
|
break;
|
|
57
58
|
case 'full-y':
|
|
58
59
|
elRef.current.style.transform = `scale(${heightScale})`;
|
|
60
|
+
canvasRef.current.style.width = `${Number(realWidth) * heightScale}px`;
|
|
59
61
|
scaleChange?.(heightScale, heightScale);
|
|
60
62
|
if (currentWidth > (+realWidth * heightScale)) {
|
|
61
63
|
elRef.current.style.margin = `0px ${(currentWidth - +realWidth * heightScale) / 2}px`;
|
|
@@ -115,7 +117,7 @@ export default function ScreenFit(props: ScreenFitProps) {
|
|
|
115
117
|
}, [])
|
|
116
118
|
|
|
117
119
|
return (
|
|
118
|
-
<div ref={canvasRef} className={'react-screen-box'}>
|
|
120
|
+
<div ref={canvasRef} className={'react-screen-box'} >
|
|
119
121
|
<div className={'screen-wrapper'} ref={elRef}>
|
|
120
122
|
{props.children}
|
|
121
123
|
</div>
|
|
@@ -62,10 +62,11 @@ interface Props {
|
|
|
62
62
|
ddpageId?: string,
|
|
63
63
|
layoutRootPath?: string,
|
|
64
64
|
initSearchParams?: { [key: string]: any }, // 组件数据源初始化查询参数
|
|
65
|
+
style?: CSSProperties,
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
const LowcodeView = (props: Props) => {
|
|
68
|
-
const { isFullScreen, layoutRootPath, ddpageId: propsDdpageId, initSearchParams } = props;
|
|
69
|
+
const { isFullScreen, layoutRootPath, ddpageId: propsDdpageId, initSearchParams, style = {} } = props;
|
|
69
70
|
const { ddpageId: urlDdpageId } = useParams();
|
|
70
71
|
const ddpageId = propsDdpageId || urlDdpageId;
|
|
71
72
|
const [loading, setLoading] = useState<boolean>(false);
|
|
@@ -195,6 +196,7 @@ const LowcodeView = (props: Props) => {
|
|
|
195
196
|
backgroundImage: backgroundImage ? `url(${backgroundImage})` : undefined,
|
|
196
197
|
backgroundSize: "100% 100%",
|
|
197
198
|
backgroundRepeat: 'no-repeat',
|
|
199
|
+
...style,
|
|
198
200
|
}}>
|
|
199
201
|
{loading || !layerManager ?
|
|
200
202
|
<Loading />
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as echarts from 'echarts';
|
|
2
2
|
import React, { useEffect, useRef, useState, ForwardedRef, forwardRef, useImperativeHandle } from 'react';
|
|
3
3
|
import _ from 'lodash';
|
|
4
|
+
import { Spin } from "antd";
|
|
4
5
|
import HydrocarbonService from "../../tmpl/hcservice-v3";
|
|
5
6
|
import { DataConfigProps } from "../data";
|
|
6
7
|
|
|
@@ -120,7 +121,7 @@ export interface ComponentStyle {
|
|
|
120
121
|
|
|
121
122
|
export interface ComponentProps {
|
|
122
123
|
style?: ComponentStyle;
|
|
123
|
-
base: { width: number, height: number }
|
|
124
|
+
base: { width: number, height: number };
|
|
124
125
|
data?: DataConfigProps;
|
|
125
126
|
isDesignMode?: boolean; // 是否编辑模式
|
|
126
127
|
initSearchParams?: { [key: string]: any }; // 全局初始化外部参数,例:传参包含设备id,则在查询时带上设备id
|
|
@@ -140,6 +141,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
140
141
|
const [data, setData] = useState<{ name: string, data: any }[]>([]);
|
|
141
142
|
const [searchParams, setSearchParams] = useState<{ [key: string]: any }>();
|
|
142
143
|
const [initSearchParams, setInitSearchParams] = useState<{ [key: string]: any }>();
|
|
144
|
+
const [loading, setLoading] = useState<boolean>(false);
|
|
143
145
|
const chartRef = useRef<HTMLDivElement>(null);
|
|
144
146
|
const chart = useRef<any>(null);
|
|
145
147
|
const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
|
|
@@ -195,7 +197,9 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
195
197
|
|
|
196
198
|
// 请求数据
|
|
197
199
|
const getData = async (params?: object) => {
|
|
200
|
+
setLoading(true);
|
|
198
201
|
const { data } = await HydrocarbonService.requestChartData(null, dataConfig?.sourceId, params) || {};
|
|
202
|
+
setLoading(false);
|
|
199
203
|
const { config, value } = data || {};
|
|
200
204
|
const temData = handleData(value);
|
|
201
205
|
setData(temData);
|
|
@@ -310,7 +314,13 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
310
314
|
}
|
|
311
315
|
}, [size]);
|
|
312
316
|
|
|
313
|
-
|
|
317
|
+
const renderChartDom = () => <div ref={chartRef} style={{ width: '100%', height: '100%' }} />;
|
|
318
|
+
|
|
319
|
+
if (isDesignMode) {
|
|
320
|
+
return renderChartDom();
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
return <Spin spinning={loading}>{renderChartDom()}</Spin>;
|
|
314
324
|
});
|
|
315
325
|
|
|
316
326
|
export default Index;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as echarts from 'echarts';
|
|
2
2
|
import React, { useEffect, useRef, useState, ForwardedRef, forwardRef, useImperativeHandle } from 'react';
|
|
3
3
|
import _ from 'lodash';
|
|
4
|
+
import { Spin } from "antd";
|
|
4
5
|
import HydrocarbonService from "../../tmpl/hcservice-v3";
|
|
5
6
|
import { DataConfigProps } from "../data";
|
|
6
7
|
|
|
@@ -93,7 +94,7 @@ export interface ComponentStyle {
|
|
|
93
94
|
|
|
94
95
|
export interface ComponentProps {
|
|
95
96
|
style?: ComponentStyle;
|
|
96
|
-
base: { width: number, height: number }
|
|
97
|
+
base: { width: number, height: number };
|
|
97
98
|
data?: DataConfigProps;
|
|
98
99
|
isDesignMode?: boolean; // 是否编辑模式
|
|
99
100
|
initSearchParams?: { [key: string]: any }; // 全局初始化外部参数,例:传参包含设备id,则在查询时带上设备id
|
|
@@ -113,6 +114,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
113
114
|
const [data, setData] = useState<number>(0);
|
|
114
115
|
const [searchParams, setSearchParams] = useState<{ [key: string]: any }>();
|
|
115
116
|
const [initSearchParams, setInitSearchParams] = useState<{ [key: string]: any }>();
|
|
117
|
+
const [loading, setLoading] = useState<boolean>(false);
|
|
116
118
|
const chartRef = useRef<HTMLDivElement>(null);
|
|
117
119
|
const chart = useRef<any>(null);
|
|
118
120
|
const pollingIntervalRef = useRef<number | NodeJS.Timeout>(null);
|
|
@@ -168,7 +170,9 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
168
170
|
|
|
169
171
|
// 请求数据
|
|
170
172
|
const getData = async (params?: object) => {
|
|
173
|
+
setLoading(true);
|
|
171
174
|
const { data } = await HydrocarbonService.requestChartData(null, dataConfig?.sourceId, params) || {};
|
|
175
|
+
setLoading(false);
|
|
172
176
|
const { config, value } = data || {};
|
|
173
177
|
const temData = handleData(value);
|
|
174
178
|
setData(temData);
|
|
@@ -270,7 +274,13 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
270
274
|
}
|
|
271
275
|
}, [size]);
|
|
272
276
|
|
|
273
|
-
|
|
277
|
+
const renderChartDom = () => <div ref={chartRef} style={{ width: '100%', height: '100%' }} />;
|
|
278
|
+
|
|
279
|
+
if (isDesignMode) {
|
|
280
|
+
return renderChartDom();
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
return <Spin spinning={loading}>{renderChartDom()}</Spin>;
|
|
274
284
|
});
|
|
275
285
|
|
|
276
286
|
export default Index;
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
DoEditParam, LtmplConfig,
|
|
4
4
|
LtmplConfigRes, PageType,
|
|
5
5
|
RouterCompProps,
|
|
6
|
-
ShowViewParam, ActTableViewModel
|
|
6
|
+
ShowViewParam, ActTableViewModel, ThemeConfig
|
|
7
7
|
} from "../tmpl/interface";
|
|
8
8
|
import Units from "../units";
|
|
9
9
|
import ActTable from "../table/act-table";
|
|
@@ -41,6 +41,7 @@ export interface LtmplRouteState {
|
|
|
41
41
|
editSourceId?: string;
|
|
42
42
|
toCustomPage?: boolean;
|
|
43
43
|
userPageConfig?: { [key: string]: any };
|
|
44
|
+
themeConfig?: ThemeConfig;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
@@ -68,11 +69,13 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
68
69
|
editSourceId: undefined,
|
|
69
70
|
toCustomPage: false,
|
|
70
71
|
userPageConfig: undefined,
|
|
72
|
+
themeConfig: undefined,
|
|
71
73
|
};
|
|
72
74
|
|
|
73
75
|
async componentDidMount() {
|
|
74
76
|
this.loadData();
|
|
75
77
|
this.getUserPageConfig();
|
|
78
|
+
this.getThemeConfig();
|
|
76
79
|
}
|
|
77
80
|
Z
|
|
78
81
|
get computedLayoutPath() {
|
|
@@ -82,13 +85,18 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
82
85
|
}
|
|
83
86
|
|
|
84
87
|
// 获取用户页面配置
|
|
85
|
-
getUserPageConfig = () => {
|
|
88
|
+
getUserPageConfig = async () => {
|
|
86
89
|
const { params } = this.props;
|
|
87
90
|
const { sourceId } = params;
|
|
88
|
-
const config = Units.getUserPageConfig(sourceId);
|
|
91
|
+
const config = await Units.getUserPageConfig(sourceId);
|
|
89
92
|
this.setState({ userPageConfig: config });
|
|
90
93
|
};
|
|
91
94
|
|
|
95
|
+
getThemeConfig = async () => {
|
|
96
|
+
const theme: ThemeConfig = await Units.getThemeConfig();
|
|
97
|
+
this.setState({ themeConfig: theme });
|
|
98
|
+
}
|
|
99
|
+
|
|
92
100
|
// 设置用户页面配置
|
|
93
101
|
setUserPageConfig = (config: { [key: string]: any }) => {
|
|
94
102
|
const { params } = this.props;
|
|
@@ -350,7 +358,7 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
350
358
|
render() {
|
|
351
359
|
const {
|
|
352
360
|
ltmplConfigRes, showDraw, showWindowType, ractionId, selectedCode,
|
|
353
|
-
showViewDrawer, showViewModal, showEdit, editSourceId, viewSourceId, toCustomPage, userPageConfig
|
|
361
|
+
showViewDrawer, showViewModal, showEdit, editSourceId, viewSourceId, toCustomPage, userPageConfig, themeConfig
|
|
354
362
|
} = this.state;
|
|
355
363
|
const { location, params, tableType, rowOperatable, defShowType } = this.props;
|
|
356
364
|
const { sourceId } = params;
|
|
@@ -394,7 +402,7 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
394
402
|
doCreate={this.doCreate} sourceId={sourceId}
|
|
395
403
|
criteriaData={criteriaData} ltmplConfig={ltmplConfig} doRAction={this.doRAction}
|
|
396
404
|
defShowType={defShowType} userPageConfig={userPageConfig} setUserPageConfig={this.setUserPageConfig}
|
|
397
|
-
resetUserPageConfig={this.resetUserPageConfig}
|
|
405
|
+
resetUserPageConfig={this.resetUserPageConfig} allowUserConfig={themeConfig?.allowUserConfig}
|
|
398
406
|
/>
|
|
399
407
|
{showDraw ? (
|
|
400
408
|
<Drawer
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState, useMemo } from "react";
|
|
2
2
|
import { useParams, useLocation, useNavigate } from "react-router-dom";
|
|
3
|
-
import { DoEditParam, LtmplConfig, LtmplConfigRes, PageType, RouterCompProps, ShowViewParam, ActTableViewModel } from "../tmpl/interface";
|
|
3
|
+
import { DoEditParam, LtmplConfig, LtmplConfigRes, PageType, RouterCompProps, ShowViewParam, ActTableViewModel, ThemeConfig } from "../tmpl/interface";
|
|
4
4
|
import Units from "../units";
|
|
5
5
|
import ActTable from "../table/act-table";
|
|
6
6
|
import HCDataSource from "../tmpl/hc-data-source";
|
|
@@ -38,6 +38,7 @@ const Index = (props: Props) => {
|
|
|
38
38
|
const [viewSourceId, setViewSourceId] = useState<string>();
|
|
39
39
|
const [editSourceId, setEditSourceId] = useState<string>();
|
|
40
40
|
const [userPageConfig, setUserPageConfig] = useState<{ [key: string]: any }>();
|
|
41
|
+
const [themeConfig, setThemeConfig] = useState<ThemeConfig>(); // 主题配置信息
|
|
41
42
|
const { sourceId } = useParams();
|
|
42
43
|
const { search } = useLocation();
|
|
43
44
|
const { translate } = useLocale();
|
|
@@ -60,11 +61,17 @@ const Index = (props: Props) => {
|
|
|
60
61
|
};
|
|
61
62
|
|
|
62
63
|
// 获取用户页面配置
|
|
63
|
-
const getUserPageConfig = () => {
|
|
64
|
-
const config = Units.getUserPageConfig(sourceId);
|
|
64
|
+
const getUserPageConfig = async () => {
|
|
65
|
+
const config = await Units.getUserPageConfig(sourceId);
|
|
65
66
|
setUserPageConfig(config);
|
|
66
67
|
};
|
|
67
68
|
|
|
69
|
+
// 获取全局主题配置
|
|
70
|
+
const getThemeConfig = async () => {
|
|
71
|
+
const theme: ThemeConfig = await Units.getThemeConfig();
|
|
72
|
+
setThemeConfig(theme);
|
|
73
|
+
}
|
|
74
|
+
|
|
68
75
|
// 设置用户页面配置
|
|
69
76
|
const handleSetUserPageConfig = (config: { [key: string]: any }) => {
|
|
70
77
|
const temConfig = Units.setUserPageConfig(sourceId, config);
|
|
@@ -81,6 +88,7 @@ const Index = (props: Props) => {
|
|
|
81
88
|
if (sourceId) {
|
|
82
89
|
getLtmplConfig();
|
|
83
90
|
getUserPageConfig();
|
|
91
|
+
getThemeConfig();
|
|
84
92
|
}
|
|
85
93
|
}, [sourceId]);
|
|
86
94
|
|
|
@@ -204,6 +212,7 @@ const Index = (props: Props) => {
|
|
|
204
212
|
userPageConfig={userPageConfig}
|
|
205
213
|
setUserPageConfig={handleSetUserPageConfig}
|
|
206
214
|
resetUserPageConfig={resetUserPageConfig}
|
|
215
|
+
allowUserConfig={themeConfig?.allowUserConfig}
|
|
207
216
|
/>;
|
|
208
217
|
};
|
|
209
218
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
import {
|
|
3
3
|
Button, Card, Checkbox, Col, Divider, Popover, Row, Space, Drawer, Tooltip,
|
|
4
|
-
message, Layout, Table, Form as AntdForm, FormInstance, Modal, Input, Alert, Tabs, Radio
|
|
4
|
+
message, Layout, Table, Form as AntdForm, FormInstance, Modal, Input, Alert, Tabs, Radio, Typography
|
|
5
5
|
} from "antd";
|
|
6
6
|
import {
|
|
7
7
|
ExportOutlined, FundOutlined, LineChartOutlined,
|
|
8
8
|
PlusCircleOutlined, PlusOutlined, ReloadOutlined, RetweetOutlined, SearchOutlined,
|
|
9
|
-
TableOutlined, ImportOutlined
|
|
9
|
+
TableOutlined, ImportOutlined
|
|
10
10
|
} from "@ant-design/icons";
|
|
11
11
|
import "./index.css";
|
|
12
12
|
import {
|
|
@@ -35,8 +35,11 @@ import ReportTable from "./report-table";
|
|
|
35
35
|
import EntryControl from "../controls/entry-control";
|
|
36
36
|
import DraggableModal from "../module/draggable-modal";
|
|
37
37
|
import Icon from "../icon/aliIcon";
|
|
38
|
+
import PageConfigButton from "./page-config-button";
|
|
38
39
|
|
|
39
40
|
const { Content, Sider } = Layout;
|
|
41
|
+
const { Text } = Typography;
|
|
42
|
+
|
|
40
43
|
type Level = "l1" | "l2";
|
|
41
44
|
|
|
42
45
|
const enumTypes = ["select", "multiselect", "texttags", "checkbox", "radio", "steps"];
|
|
@@ -75,6 +78,7 @@ interface ActTableProps extends TmplBaseProps {
|
|
|
75
78
|
userPageConfig?: { [key: string]: any }; // 用户页面配置本地缓存
|
|
76
79
|
setUserPageConfig?: (config: { [key: string]: any }) => void; // 更新用户页面配置本地缓存
|
|
77
80
|
resetUserPageConfig?: () => void; // 重置用户页面配置本地缓存
|
|
81
|
+
allowUserConfig?: boolean; // 是否可用户自定义配置
|
|
78
82
|
}
|
|
79
83
|
|
|
80
84
|
interface ActTableStat {
|
|
@@ -484,7 +488,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
484
488
|
}
|
|
485
489
|
|
|
486
490
|
async componentDidUpdate(prevProps, prevState) {
|
|
487
|
-
const { sourceId, criteriaData, ltmplConfig, tableType, pageSize, pageNo, userPageConfig } = this.props;
|
|
491
|
+
const { sourceId, criteriaData, ltmplConfig, tableType, pageSize, pageNo, userPageConfig, defShowType } = this.props;
|
|
488
492
|
// const {userCriteriaData:preUserCriteriaData}=prevState;
|
|
489
493
|
const { userCriteriaData } = this.state;
|
|
490
494
|
const { translate } = this.context;
|
|
@@ -492,6 +496,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
492
496
|
ltmplConfig: preLtmplConfig,
|
|
493
497
|
criteriaData: preCriteriaData,
|
|
494
498
|
sourceId: preSourceId, pageSize: prePageSize, pageNo: prePageNo,
|
|
499
|
+
userPageConfig: preUserPageConfig
|
|
495
500
|
} = prevProps;
|
|
496
501
|
if (!this.isSameSourceQuery(sourceId, criteriaData)) {
|
|
497
502
|
return false;
|
|
@@ -503,6 +508,9 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
503
508
|
userCriteriaData: criteriaData,
|
|
504
509
|
})
|
|
505
510
|
}
|
|
511
|
+
if (!preUserPageConfig && userPageConfig) {
|
|
512
|
+
this.setState({ viewModels: userPageConfig?.["viewModels"] || [defShowType || ltmplConfig?.showType || "table"] });
|
|
513
|
+
}
|
|
506
514
|
let { hiddenColIds, sortedColConfigs } = this.state;
|
|
507
515
|
let currentQueryParams = ProgramConfig.transQueryParamsToStr(criteriaData, false, [
|
|
508
516
|
"pageSize",
|
|
@@ -913,14 +921,38 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
913
921
|
resetUserPageConfig();
|
|
914
922
|
}
|
|
915
923
|
|
|
924
|
+
// 更新当前页面配置
|
|
925
|
+
handleUpdateUserPageConfig = (val: { [key: string]: any }) => {
|
|
926
|
+
const { sortedColIds, hiddenColIds, viewModels, criteriaData } = val;
|
|
927
|
+
const { setUserPageConfig, ltmplConfig, tableType, defShowType, menuId } = this.props;
|
|
928
|
+
const { userCriteriaData } = this.state;
|
|
929
|
+
const { translate } = this.context;
|
|
930
|
+
let sortedColConfigs = undefined;
|
|
931
|
+
if (ltmplConfig) {
|
|
932
|
+
sortedColConfigs = tableType === 'report' ? ltmplConfig.columns : [
|
|
933
|
+
{ id: "10000", title: translate("${排序}"), originalId: "10000" },
|
|
934
|
+
{ id: "20000", title: translate("${隐藏}"), originalId: "20000" },
|
|
935
|
+
...ltmplConfig.columns,
|
|
936
|
+
];
|
|
937
|
+
}
|
|
938
|
+
if (sortedColIds) { // 页面配置更新列排序
|
|
939
|
+
sortedColConfigs.sort((a, b) => sortedColIds.indexOf(a.id) - sortedColIds.indexOf(b.id));
|
|
940
|
+
}
|
|
941
|
+
// 旧过滤参数设置为空
|
|
942
|
+
const oldParms = Object.keys(userCriteriaData || {}).reduce((total, item) => { total[item] = ""; return total; }, {});
|
|
943
|
+
this.actTableDoSearch({ ...oldParms, ...(criteriaData || { menuId }) });
|
|
944
|
+
this.setState({ userCriteriaData: criteriaData, viewModels: viewModels || [defShowType || ltmplConfig.showType || "table"], hiddenColIds: hiddenColIds || defaultDisabledColIds, sortedColConfigs });
|
|
945
|
+
setUserPageConfig({ ...val, criteriaData: undefined });
|
|
946
|
+
}
|
|
947
|
+
|
|
916
948
|
renderHeaderButtons = () => {
|
|
917
949
|
let {
|
|
918
950
|
hiddenColIds, viewModels, sortedColConfigs, disabledColIds, showL2Chart,
|
|
919
|
-
showL2ActTable, restatParams,
|
|
951
|
+
showL2ActTable, restatParams, userCriteriaData
|
|
920
952
|
} = this.state;
|
|
921
953
|
const {
|
|
922
954
|
ltmplConfig, sourceId, doCreate, doSearch, menuId,
|
|
923
|
-
funcMode, customCreatable, serverKey, readOnly, userPageConfig
|
|
955
|
+
funcMode, customCreatable, serverKey, readOnly, userPageConfig, allowUserConfig
|
|
924
956
|
} = this.props;
|
|
925
957
|
const { translate } = this.context;
|
|
926
958
|
let { buttons } = ltmplConfig;
|
|
@@ -929,13 +961,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
929
961
|
return (
|
|
930
962
|
<>
|
|
931
963
|
<Space>
|
|
932
|
-
{userPageConfig ?
|
|
933
|
-
<Tooltip title={translate("${重置}")}>
|
|
934
|
-
<Button onClick={() => this.handleResetUserPageConfig()}>
|
|
935
|
-
<SyncOutlined />
|
|
936
|
-
</Button>
|
|
937
|
-
</Tooltip>
|
|
938
|
-
: ""}
|
|
964
|
+
{userPageConfig && allowUserConfig ? <PageConfigButton menuCode={menuId} handleResetUserPageConfig={this.handleResetUserPageConfig} handleUpdateUserPageConfig={this.handleUpdateUserPageConfig} userCriteriaData={userCriteriaData} /> : ""}
|
|
939
965
|
{funcMode == "common" && this.criteriaFormUseful() ? (
|
|
940
966
|
<Popover trigger="click" content={this.renderCriteriaForm()}>
|
|
941
967
|
<Button>
|
|
@@ -1401,7 +1427,12 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1401
1427
|
<div style={{ width: "calc(100% - 40px)" }}>
|
|
1402
1428
|
<p className="title">{item.fieldTitle}</p>
|
|
1403
1429
|
<div className="value">
|
|
1404
|
-
<
|
|
1430
|
+
<Text
|
|
1431
|
+
style={{ maxWidth: "100%" }}
|
|
1432
|
+
ellipsis={{ tooltip: item.value }}
|
|
1433
|
+
>
|
|
1434
|
+
<span className="number">{item.value}</span>
|
|
1435
|
+
</Text>
|
|
1405
1436
|
{dataUnit ? <span className="unit">{dataUnit}</span> : ""}
|
|
1406
1437
|
</div>
|
|
1407
1438
|
</div>
|