aldehyde 0.1.86 → 0.2.2
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/LICENSE +2 -2
- package/README.md +2 -1
- package/lib/controls/action/index.d.ts +2 -2
- package/lib/controls/action/index.d.ts.map +1 -1
- package/lib/controls/action/index.js +6 -6
- package/lib/controls/action/index.js.map +1 -1
- package/lib/controls/chemstruc/graph.d.ts +2 -2
- package/lib/controls/chemstruc/graph.d.ts.map +1 -1
- package/lib/controls/chemstruc/graph.js +5 -5
- package/lib/controls/chemstruc/graph.js.map +1 -1
- package/lib/controls/chemstruc/index.css +28 -28
- package/lib/controls/color-picker/index.d.ts.map +1 -1
- package/lib/controls/color-picker/index.js +2 -3
- package/lib/controls/color-picker/index.js.map +1 -1
- package/lib/controls/cquery/cquick-button.js +2 -2
- package/lib/controls/cquery/cquick-button.js.map +1 -1
- package/lib/controls/date-picker/index.js +17 -17
- package/lib/controls/date-picker/index.js.map +1 -1
- package/lib/controls/entity-select/index.css +6 -6
- package/lib/controls/file-view/drawer-file-view.d.ts +2 -2
- package/lib/controls/file-view/drawer-file-view.d.ts.map +1 -1
- package/lib/controls/file-view/drawer-file-view.js +5 -5
- package/lib/controls/file-view/drawer-file-view.js.map +1 -1
- package/lib/controls/html-editor/tinymce.d.ts +0 -5
- package/lib/controls/html-editor/tinymce.d.ts.map +1 -1
- package/lib/controls/password-setter/index.d.ts +0 -1
- package/lib/controls/password-setter/index.d.ts.map +1 -1
- package/lib/controls/password-setter/index.js +1 -1
- package/lib/controls/password-setter/index.js.map +1 -1
- package/lib/controls/relation-existion/index.css +4 -4
- package/lib/controls/rfield/index.css +4 -4
- package/lib/controls/rfield/index.js +1 -1
- package/lib/controls/rfield/index.js.map +1 -1
- package/lib/controls/signature/index.d.ts +2 -2
- package/lib/controls/signature/index.d.ts.map +1 -1
- package/lib/controls/signature/index.js +5 -5
- package/lib/controls/signature/index.js.map +1 -1
- package/lib/controls/view-control.d.ts.map +1 -1
- package/lib/controls/view-control.js +2 -4
- package/lib/controls/view-control.js.map +1 -1
- package/lib/custom-page/def-custom-page.d.ts +0 -1
- package/lib/custom-page/def-custom-page.d.ts.map +1 -1
- package/lib/detail/edit/dtmpl-edit-page.d.ts +1 -1
- package/lib/detail/edit/dtmpl-edit-page.d.ts.map +1 -1
- package/lib/detail/edit/dtmpl-edit-page.js +8 -8
- package/lib/detail/edit/dtmpl-edit-page.js.map +1 -1
- package/lib/detail/edit/dtmpl-edit.js +1 -1
- package/lib/detail/edit/dtmpl-edit.js.map +1 -1
- package/lib/detail/edit/modal-row-edit.d.ts +1 -1
- package/lib/detail/edit/modal-row-edit.d.ts.map +1 -1
- package/lib/detail/edit/modal-row-edit.js +2 -2
- package/lib/detail/edit/modal-row-edit.js.map +1 -1
- package/lib/detail/edit/post-result/index.d.ts +1 -1
- package/lib/detail/edit/post-result/index.d.ts.map +1 -1
- package/lib/detail/edit/post-result/index.js +2 -2
- package/lib/detail/edit/post-result/index.js.map +1 -1
- package/lib/detail/edit/row-editor.d.ts +2 -2
- package/lib/detail/edit/row-editor.d.ts.map +1 -1
- package/lib/detail/edit/row-editor.js +6 -6
- package/lib/detail/edit/row-editor.js.map +1 -1
- package/lib/detail/view/act-dtmpl-view.d.ts +2 -2
- package/lib/detail/view/act-dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/act-dtmpl-view.js +5 -5
- package/lib/detail/view/act-dtmpl-view.js.map +1 -1
- package/lib/detail/view/dtmpl-view.d.ts +1 -1
- package/lib/detail/view/dtmpl-view.js +2 -2
- package/lib/detail/view/dtmpl-view.js.map +1 -1
- package/lib/detail/view/modal-dtmpl-view.d.ts +2 -1
- package/lib/detail/view/modal-dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/modal-dtmpl-view.js +3 -3
- package/lib/detail/view/modal-dtmpl-view.js.map +1 -1
- package/lib/detail/view/snapshot-timeline.d.ts +1 -1
- package/lib/detail/view/snapshot-timeline.d.ts.map +1 -1
- package/lib/detail/view/snapshot-timeline.js +5 -5
- package/lib/detail/view/snapshot-timeline.js.map +1 -1
- package/lib/form/criteria-form.d.ts +1 -1
- package/lib/form/criteria-form.d.ts.map +1 -1
- package/lib/form/criteria-form.js +4 -4
- package/lib/form/criteria-form.js.map +1 -1
- package/lib/form/form-Item-group.d.ts +0 -1
- package/lib/form/form-Item-group.d.ts.map +1 -1
- package/lib/form/form-Item-group.js +0 -1
- package/lib/form/form-Item-group.js.map +1 -1
- package/lib/import/excel-import.d.ts +3 -3
- package/lib/import/excel-import.d.ts.map +1 -1
- package/lib/import/excel-import.js +6 -6
- package/lib/import/excel-import.js.map +1 -1
- package/lib/import/template-builder.d.ts +0 -8
- package/lib/import/template-builder.d.ts.map +1 -1
- package/lib/import/template-builder.js +1 -1
- package/lib/import/template-builder.js.map +1 -1
- package/lib/layout/footer/index.d.ts +0 -1
- package/lib/layout/footer/index.d.ts.map +1 -1
- package/lib/layout/menu/l2menu-message-bar.d.ts +1 -1
- package/lib/layout/menu/l2menu-message-bar.d.ts.map +1 -1
- package/lib/layout/menu/l2menu-message-bar.js +1 -1
- package/lib/layout/menu/l2menu-message-bar.js.map +1 -1
- package/lib/layout/menu/l2menu-quick-bar.d.ts +1 -1
- package/lib/layout/menu/l2menu-quick-bar.d.ts.map +1 -1
- package/lib/layout/menu/l2menu-quick-bar.js +2 -2
- package/lib/layout/menu/l2menu-quick-bar.js.map +1 -1
- package/lib/layout/menu/reset-password.d.ts +1 -1
- package/lib/layout/menu/reset-password.d.ts.map +1 -1
- package/lib/layout/menu/reset-password.js +2 -2
- package/lib/layout/menu/reset-password.js.map +1 -1
- package/lib/layout/menu/userinfo-bar.js +1 -1
- package/lib/layout/menu/userinfo-bar.js.map +1 -1
- package/lib/login/login-context.d.ts +0 -11
- package/lib/login/login-context.d.ts.map +1 -1
- package/lib/login/login.d.ts +0 -10
- package/lib/login/login.d.ts.map +1 -1
- package/lib/module/dtmpl-view-page.js +1 -1
- package/lib/module/dtmpl-view-page.js.map +1 -1
- package/lib/module/ltmpl-page.js +3 -3
- package/lib/module/ltmpl-page.js.map +1 -1
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js +1 -4
- package/lib/table/act-table.js.map +1 -1
- package/lib/table/modal-select-table.d.ts +1 -1
- package/lib/table/modal-select-table.d.ts.map +1 -1
- package/lib/table/modal-select-table.js +7 -7
- package/lib/table/modal-select-table.js.map +1 -1
- package/lib/table/relation-table.js +3 -3
- package/lib/table/relation-table.js.map +1 -1
- package/lib/table/select-table.js +1 -1
- package/lib/table/select-table.js.map +1 -1
- package/lib/table/stat/restat.d.ts +2 -2
- package/lib/table/stat/restat.d.ts.map +1 -1
- package/lib/table/stat/restat.js +5 -5
- package/lib/table/stat/restat.js.map +1 -1
- package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
- package/lib/tmpl/hcservice-v3.js +4 -3
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/tmpl/superagent.js +2 -2
- package/lib/tmpl/superagent.js.map +1 -1
- package/lib/tmpl/tmpl-config-analysis.d.ts.map +1 -1
- package/lib/tmpl/tmpl-config-analysis.js +15 -14
- package/lib/tmpl/tmpl-config-analysis.js.map +1 -1
- package/lib/units/index.d.ts +1 -1
- package/lib/units/index.js +3 -3
- package/lib/units/index.js.map +1 -1
- package/lib/welcome/HCWelcome.d.ts +0 -4
- package/lib/welcome/HCWelcome.d.ts.map +1 -1
- package/lib/welcome/quick-entrance.d.ts +1 -1
- package/lib/welcome/quick-entrance.d.ts.map +1 -1
- package/lib/welcome/quick-entrance.js +1 -1
- package/lib/welcome/quick-entrance.js.map +1 -1
- package/lib/welcome/workbench.d.ts +1 -1
- package/lib/welcome/workbench.d.ts.map +1 -1
- package/lib/welcome/workbench.js +1 -1
- package/lib/welcome/workbench.js.map +1 -1
- package/package.json +31 -33
- package/src/aldehyde/controls/action/index.tsx +8 -8
- package/src/aldehyde/controls/chemstruc/graph.tsx +6 -6
- package/src/aldehyde/controls/chemstruc/index.css +28 -28
- package/src/aldehyde/controls/color-picker/index.tsx +2 -5
- package/src/aldehyde/controls/cquery/cquick-button.tsx +2 -2
- package/src/aldehyde/controls/date-picker/index.tsx +20 -20
- package/src/aldehyde/controls/entity-select/index.css +6 -6
- package/src/aldehyde/controls/file-view/drawer-file-view.tsx +7 -7
- package/src/aldehyde/controls/password-setter/index.js +1 -1
- package/src/aldehyde/controls/relation-existion/index.css +4 -4
- package/src/aldehyde/controls/rfield/index.css +4 -4
- package/src/aldehyde/controls/rfield/index.tsx +1 -1
- package/src/aldehyde/controls/signature/index.tsx +6 -6
- package/src/aldehyde/controls/view-control.tsx +3 -4
- package/src/aldehyde/detail/edit/dtmpl-edit-page.tsx +9 -9
- package/src/aldehyde/detail/edit/dtmpl-edit.tsx +1 -1
- package/src/aldehyde/detail/edit/modal-row-edit.tsx +3 -3
- package/src/aldehyde/detail/edit/post-result/index.tsx +3 -3
- package/src/aldehyde/detail/edit/row-editor.tsx +7 -7
- package/src/aldehyde/detail/view/act-dtmpl-view.tsx +6 -6
- package/src/aldehyde/detail/view/dtmpl-view.tsx +2 -2
- package/src/aldehyde/detail/view/modal-dtmpl-view.tsx +4 -3
- package/src/aldehyde/detail/view/snapshot-timeline.tsx +6 -6
- package/src/aldehyde/form/criteria-form.tsx +5 -5
- package/src/aldehyde/form/form-Item-group.tsx +0 -2
- package/src/aldehyde/import/excel-import.tsx +8 -9
- package/src/aldehyde/import/template-builder.js +1 -1
- package/src/aldehyde/layout/menu/l2menu-message-bar.tsx +1 -1
- package/src/aldehyde/layout/menu/l2menu-quick-bar.tsx +2 -2
- package/src/aldehyde/layout/menu/reset-password.tsx +2 -2
- package/src/aldehyde/layout/menu/userinfo-bar.tsx +1 -1
- package/src/aldehyde/module/criteria-page.tsx1 +2 -2
- package/src/aldehyde/module/dtmpl-view-page.tsx +1 -1
- package/src/aldehyde/module/ltmpl-page.tsx +3 -3
- package/src/aldehyde/table/act-table.tsx +8 -9
- package/src/aldehyde/table/modal-select-table.tsx +8 -8
- package/src/aldehyde/table/relation-table.tsx +4 -4
- package/src/aldehyde/table/select-table.tsx +1 -1
- package/src/aldehyde/table/stat/restat.tsx +6 -6
- package/src/aldehyde/tmpl/hcservice-v3.tsx +4 -3
- package/src/aldehyde/tmpl/superagent.js +2 -2
- package/src/aldehyde/tmpl/tmpl-config-analysis.tsx +15 -14
- package/src/aldehyde/units/index.tsx +3 -3
- package/src/aldehyde/welcome/quick-entrance.tsx +1 -1
- package/src/aldehyde/welcome/workbench.tsx +1 -1
- package/lib/chart/antd/Chart.d.ts +0 -10
- package/lib/chart/antd/Chart.d.ts.map +0 -1
- package/lib/chart/antd/Chart.js +0 -31
- package/lib/chart/antd/Chart.js.map +0 -1
- package/lib/chart/antd/Max2DimLineChart.d.ts +0 -15
- package/lib/chart/antd/Max2DimLineChart.d.ts.map +0 -1
- package/lib/chart/antd/Max2DimLineChart.js +0 -126
- package/lib/chart/antd/Max2DimLineChart.js.map +0 -1
- package/lib/chart/antd/chart-utils.d.ts +0 -7
- package/lib/chart/antd/chart-utils.d.ts.map +0 -1
- package/lib/chart/antd/chart-utils.js +0 -46
- package/lib/chart/antd/chart-utils.js.map +0 -1
- package/lib/chart/antd/column-chart-sub.d.ts +0 -7
- package/lib/chart/antd/column-chart-sub.d.ts.map +0 -1
- package/lib/chart/antd/column-chart-sub.js +0 -50
- package/lib/chart/antd/column-chart-sub.js.map +0 -1
- package/lib/chart/antd/line-chart-sub.d.ts +0 -7
- package/lib/chart/antd/line-chart-sub.d.ts.map +0 -1
- package/lib/chart/antd/line-chart-sub.js +0 -49
- package/lib/chart/antd/line-chart-sub.js.map +0 -1
- package/lib/chart/antd/pie-chart-sub.d.ts +0 -7
- package/lib/chart/antd/pie-chart-sub.d.ts.map +0 -1
- package/lib/chart/antd/pie-chart-sub.js +0 -37
- package/lib/chart/antd/pie-chart-sub.js.map +0 -1
- package/lib/chart/antd/statview-d2-chart.d.ts +0 -17
- package/lib/chart/antd/statview-d2-chart.d.ts.map +0 -1
- package/lib/chart/antd/statview-d2-chart.js +0 -108
- package/lib/chart/antd/statview-d2-chart.js.map +0 -1
- package/lib/chart/statview-l2-chart.d.ts +0 -23
- package/lib/chart/statview-l2-chart.d.ts.map +0 -1
- package/lib/chart/statview-l2-chart.js +0 -64
- package/lib/chart/statview-l2-chart.js.map +0 -1
- package/src/aldehyde/chart/antd/Chart.js +0 -31
- package/src/aldehyde/chart/antd/Max2DimLineChart.js +0 -127
- package/src/aldehyde/chart/antd/chart-utils.tsx +0 -50
- package/src/aldehyde/chart/antd/column-chart-sub.tsx +0 -77
- package/src/aldehyde/chart/antd/line-chart-sub.tsx +0 -75
- package/src/aldehyde/chart/antd/pie-chart-sub.tsx +0 -65
- package/src/aldehyde/chart/antd/statview-d2-chart.tsx +0 -125
- package/src/aldehyde/chart/statview-l2-chart.tsx +0 -69
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import React , { useRef } from "react";
|
|
2
|
-
import {Column} from '@ant-design/charts';
|
|
3
|
-
import {Space, Spin} from 'antd';
|
|
4
|
-
import {SubChartProps} from "../../tmpl/interface";
|
|
5
|
-
//import loadable from '@loadable/component';
|
|
6
|
-
// const Loading = <Spin tip="Loading...">
|
|
7
|
-
// {/*<Alert*/}
|
|
8
|
-
// {/* message="正在加载数据。。。"*/}
|
|
9
|
-
// {/* description="初次访问加载数据较多,可能需要几秒或几分钟,请耐心等待!!"*/}
|
|
10
|
-
// {/* type="info"*/}
|
|
11
|
-
// {/*/>*/}
|
|
12
|
-
// </Spin>
|
|
13
|
-
// const dcharts=loadable(() =>
|
|
14
|
-
// import('@ant-design/charts'), {fallback: Loading});
|
|
15
|
-
// const Column=dcharts.Column;
|
|
16
|
-
|
|
17
|
-
interface ColumnChartProps extends SubChartProps {
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const ColumnChart: React.FC<ColumnChartProps> = (paras) => {
|
|
22
|
-
|
|
23
|
-
// const ref = React.createRef<Plot<ColumnOptions>>();
|
|
24
|
-
const ref = useRef();
|
|
25
|
-
|
|
26
|
-
const downloadImage = () => {
|
|
27
|
-
if(ref.current){
|
|
28
|
-
// @ts-ignore
|
|
29
|
-
ref.current.downloadImage()
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const config = {
|
|
34
|
-
data: paras.data,
|
|
35
|
-
height: 400,
|
|
36
|
-
xField: paras.config.xField,
|
|
37
|
-
yField: paras.config.yField,
|
|
38
|
-
point: {
|
|
39
|
-
size: 5,
|
|
40
|
-
shape: 'diamond',
|
|
41
|
-
},
|
|
42
|
-
xAxis: {
|
|
43
|
-
title: {
|
|
44
|
-
text: paras.config.xAxisTitle,
|
|
45
|
-
style: {fontSize: 14},
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
yAxis: {
|
|
49
|
-
title: {
|
|
50
|
-
text: paras.config.yAxisTitle,
|
|
51
|
-
style: {fontSize: 14},
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
label: {
|
|
55
|
-
style: {
|
|
56
|
-
fill: '#aaa',
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
return <div>
|
|
62
|
-
<Space direction="vertical" size={'middle'} style={{width: '100%'}}>
|
|
63
|
-
<button type="button" onClick={downloadImage} style={{marginRight: 24}}>
|
|
64
|
-
导出
|
|
65
|
-
</button>
|
|
66
|
-
<Column {...config} onReady={(plot) => {
|
|
67
|
-
// @ts-ignore
|
|
68
|
-
ref.current = plot;
|
|
69
|
-
}}/>
|
|
70
|
-
</Space>
|
|
71
|
-
|
|
72
|
-
</div>
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export default ColumnChart;
|
|
77
|
-
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import React, {useRef} from "react";
|
|
2
|
-
import {Line } from '@ant-design/charts';
|
|
3
|
-
import {Space,Spin} from 'antd';
|
|
4
|
-
import {SubChartProps} from "../../tmpl/interface";
|
|
5
|
-
//import loadable from '@loadable/component';
|
|
6
|
-
// const Loading = <Spin tip="Loading...">
|
|
7
|
-
// {/*<Alert*/}
|
|
8
|
-
// {/* message="正在加载数据。。。"*/}
|
|
9
|
-
// {/* description="初次访问加载数据较多,可能需要几秒或几分钟,请耐心等待!!"*/}
|
|
10
|
-
// {/* type="info"*/}
|
|
11
|
-
// {/*/>*/}
|
|
12
|
-
// </Spin>
|
|
13
|
-
// const dcharts=loadable(() =>
|
|
14
|
-
// import('@ant-design/charts'), {fallback: Loading});
|
|
15
|
-
// const Line=dcharts.Line;
|
|
16
|
-
interface LineChartProps extends SubChartProps {
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const LineChart: React.FC<LineChartProps> = (paras) => {
|
|
21
|
-
|
|
22
|
-
const ref = useRef();
|
|
23
|
-
|
|
24
|
-
const downloadImage = () => {
|
|
25
|
-
if (ref.current) {
|
|
26
|
-
// @ts-ignore
|
|
27
|
-
ref.current.downloadImage(paras.config.xAxisTitle+"_"+paras.config.yAxisTitle)
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const config = {
|
|
32
|
-
data: paras.data,
|
|
33
|
-
height: 400,
|
|
34
|
-
xField: paras.config.xField,
|
|
35
|
-
yField: paras.config.yField,
|
|
36
|
-
point: {
|
|
37
|
-
size: 5,
|
|
38
|
-
shape: 'diamond',
|
|
39
|
-
},
|
|
40
|
-
xAxis: {
|
|
41
|
-
title: {
|
|
42
|
-
text: paras.config.xAxisTitle,
|
|
43
|
-
style: { fontSize: 14 },
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
yAxis: {
|
|
47
|
-
title: {
|
|
48
|
-
text: paras.config.yAxisTitle,
|
|
49
|
-
style: { fontSize: 14 },
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
label: {
|
|
53
|
-
style: {
|
|
54
|
-
fill: '#aaa',
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
return <div>
|
|
60
|
-
<Space direction="vertical" size={'middle'} style={{width:'100%'}}>
|
|
61
|
-
<button type="button" onClick={downloadImage} style={{marginRight: 24}}>
|
|
62
|
-
导出
|
|
63
|
-
</button>
|
|
64
|
-
<Line {...config} onReady={(plot) => {
|
|
65
|
-
// @ts-ignore
|
|
66
|
-
ref.current = plot;
|
|
67
|
-
}}/>
|
|
68
|
-
</Space>
|
|
69
|
-
|
|
70
|
-
</div>
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export default LineChart;
|
|
75
|
-
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import React, {useRef} from "react";
|
|
2
|
-
import {Pie } from '@ant-design/charts';
|
|
3
|
-
import {Space, Spin} from 'antd';
|
|
4
|
-
import {SubChartProps} from "../../tmpl/interface";
|
|
5
|
-
// import loadable from '@loadable/component';
|
|
6
|
-
// const Loading = <Spin tip="Loading...">
|
|
7
|
-
// {/*<Alert*/}
|
|
8
|
-
// {/* message="正在加载数据。。。"*/}
|
|
9
|
-
// {/* description="初次访问加载数据较多,可能需要几秒或几分钟,请耐心等待!!"*/}
|
|
10
|
-
// {/* type="info"*/}
|
|
11
|
-
// {/*/>*/}
|
|
12
|
-
// </Spin>
|
|
13
|
-
// const dcharts=loadable(() =>
|
|
14
|
-
// import('@ant-design/charts'), {fallback: Loading});
|
|
15
|
-
// const Pie=dcharts.Pie;
|
|
16
|
-
|
|
17
|
-
interface PieChartProps extends SubChartProps {
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const PieChart: React.FC<PieChartProps> = (paras) => {
|
|
22
|
-
|
|
23
|
-
const ref = useRef();
|
|
24
|
-
|
|
25
|
-
const downloadImage = () => {
|
|
26
|
-
if (ref.current) {
|
|
27
|
-
// @ts-ignore
|
|
28
|
-
ref.current.downloadImage()
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const config = {
|
|
33
|
-
appendPadding: 4,
|
|
34
|
-
data: paras.data,
|
|
35
|
-
angleField: paras.config.yField,
|
|
36
|
-
colorField: paras.config.xField,
|
|
37
|
-
radius: 0.75,
|
|
38
|
-
label: {
|
|
39
|
-
type: 'spider',
|
|
40
|
-
labelHeight: 28,
|
|
41
|
-
content: '{name}\n{percentage}',
|
|
42
|
-
},
|
|
43
|
-
interactions: [{ type: 'element-selected' }, { type: 'element-active' }],
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
return <div >
|
|
47
|
-
<Space direction="vertical" size={'middle'} style={{width:'100%'}}>
|
|
48
|
-
<Space>
|
|
49
|
-
<button type="button" onClick={downloadImage} style={{marginRight: 24}}>
|
|
50
|
-
导出
|
|
51
|
-
</button>
|
|
52
|
-
<div style={{fontSize:'16px'}} >{paras.groupName+"-"+paras.config.xField+"-"+paras.config.yField}</div>
|
|
53
|
-
</Space>
|
|
54
|
-
<Pie {...config} onReady={(plot) => {
|
|
55
|
-
// @ts-ignore
|
|
56
|
-
ref.current = plot;
|
|
57
|
-
}}/>
|
|
58
|
-
</Space>
|
|
59
|
-
|
|
60
|
-
</div>
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export default PieChart;
|
|
65
|
-
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import LineChart from './line-chart-sub';
|
|
3
|
-
import ColumnChart from './column-chart-sub';
|
|
4
|
-
import PieChart from './pie-chart-sub';
|
|
5
|
-
import {Col, Divider, Row} from "antd";
|
|
6
|
-
import chartUtils from "./chart-utils";
|
|
7
|
-
import {ChartType, DtmplData, LtmplConfig} from "../../tmpl/interface";
|
|
8
|
-
|
|
9
|
-
interface StatView2DChartProps {
|
|
10
|
-
ltmplConfig: LtmplConfig;
|
|
11
|
-
dataSource: DtmplData[];
|
|
12
|
-
hiddenColIds?:string[];
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
interface StatView2DChartStat {
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
class StatviewD2Chart extends React.PureComponent<StatView2DChartProps, StatView2DChartStat> {
|
|
20
|
-
|
|
21
|
-
initData = () => {
|
|
22
|
-
const {dataSource, ltmplConfig,hiddenColIds} = this.props;
|
|
23
|
-
let data_;
|
|
24
|
-
|
|
25
|
-
// console.log("chart hiddenColIds:",hiddenColIds)
|
|
26
|
-
let firstDim = undefined, secondDim = undefined, dimensions = [], facts = [];
|
|
27
|
-
ltmplConfig.columns.forEach((col) => {
|
|
28
|
-
if(!hiddenColIds || !hiddenColIds.includes(col.id)){
|
|
29
|
-
if ("fact" == col.statColType) {
|
|
30
|
-
facts.push(col);
|
|
31
|
-
} else if ("dimension" == col.statColType) {
|
|
32
|
-
dimensions.push(col);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
let lineData;
|
|
37
|
-
if (dimensions.length > 1) {
|
|
38
|
-
firstDim = dimensions[0];
|
|
39
|
-
secondDim = dimensions[1];
|
|
40
|
-
data_ = chartUtils.transValueFloatGroupByDim(ltmplConfig, dataSource, firstDim);
|
|
41
|
-
lineData = new Map();
|
|
42
|
-
for (let [key, data1] of data_) {
|
|
43
|
-
lineData.set(key, []);
|
|
44
|
-
facts.forEach((fact) => {
|
|
45
|
-
let obj1 = {};
|
|
46
|
-
obj1['data'] = data1;
|
|
47
|
-
obj1['config'] = {
|
|
48
|
-
xAxisTitle: key,
|
|
49
|
-
yAxisTitle: fact.title,
|
|
50
|
-
xField: secondDim.title,
|
|
51
|
-
yField: fact.title
|
|
52
|
-
};
|
|
53
|
-
lineData.get(key).push(obj1);
|
|
54
|
-
})
|
|
55
|
-
}
|
|
56
|
-
} else if (dimensions.length == 1) {
|
|
57
|
-
lineData = [];
|
|
58
|
-
secondDim = dimensions[0];
|
|
59
|
-
data_ = chartUtils.transValueFloat(ltmplConfig, dataSource);
|
|
60
|
-
facts.forEach((fact) => {
|
|
61
|
-
let obj1 = {};
|
|
62
|
-
obj1['data'] = data_;
|
|
63
|
-
obj1['config'] = {
|
|
64
|
-
xAxisTitle: secondDim.title,
|
|
65
|
-
yAxisTitle: fact.title,
|
|
66
|
-
xField: secondDim.title,
|
|
67
|
-
yField: fact.title
|
|
68
|
-
};
|
|
69
|
-
lineData.push(obj1);
|
|
70
|
-
})
|
|
71
|
-
}
|
|
72
|
-
return lineData;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
get2DimChart = (lineData) => {
|
|
76
|
-
let {ltmplConfig} = this.props;
|
|
77
|
-
let refL2ChartType:ChartType[] = ltmplConfig.chartType;
|
|
78
|
-
let list = [];
|
|
79
|
-
let that = this;
|
|
80
|
-
for (let [key, obj] of lineData) {
|
|
81
|
-
obj.map(function (val) {
|
|
82
|
-
list.push(<Col span={12} key={val.config.yAxisTitle+val.config.xAxisTitle}>
|
|
83
|
-
{that.getChart1(refL2ChartType, val)}
|
|
84
|
-
{/*<PieChart groupName={key} data={val.data} config={val.config}/>*/}
|
|
85
|
-
<Divider dashed style={{borderTopColor: "#40a9ff",}} plain></Divider>
|
|
86
|
-
</Col>)
|
|
87
|
-
})
|
|
88
|
-
}
|
|
89
|
-
return list;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
getChart1 = (refL2ChartType:ChartType[], val) => {
|
|
93
|
-
return refL2ChartType.includes('line') ?
|
|
94
|
-
<LineChart data={val.data} config={val.config}/>
|
|
95
|
-
: refL2ChartType.includes('column') ?
|
|
96
|
-
<ColumnChart data={val.data} config={val.config}/>
|
|
97
|
-
:
|
|
98
|
-
refL2ChartType.includes('pie') ?
|
|
99
|
-
<PieChart data={val.data} config={val.config}/> :
|
|
100
|
-
<div>暂不支持的图形</div>
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
render() {
|
|
104
|
-
const {dataSource, ltmplConfig} = this.props;
|
|
105
|
-
let lineData = this.initData();
|
|
106
|
-
//console.log("lineData:",lineData);
|
|
107
|
-
let refL2ChartType = ltmplConfig.chartType;
|
|
108
|
-
let that = this;
|
|
109
|
-
return (<div>
|
|
110
|
-
<Row style={{padding: '8px 0'}} gutter={[32, {xs: 8, sm: 16, md: 24, lg: 32}]}>
|
|
111
|
-
{lineData instanceof Map ?
|
|
112
|
-
that.get2DimChart(lineData)
|
|
113
|
-
: lineData ? lineData.map(function (val) {
|
|
114
|
-
return <Col span={12} key={val.config.yAxisTitle+val.config.xAxisTitle}>
|
|
115
|
-
{that.getChart1(refL2ChartType, val)}
|
|
116
|
-
<Divider dashed style={{borderTopColor: "#40a9ff",}} plain></Divider>
|
|
117
|
-
</Col>
|
|
118
|
-
}) : ""
|
|
119
|
-
}
|
|
120
|
-
</Row>
|
|
121
|
-
</div>);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export default StatviewD2Chart;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import {DtmplData, LtmplConfig, QueryData} from "../tmpl/interface";
|
|
3
|
-
import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
4
|
-
import StatView2DChartProps from './antd/statview-d2-chart'
|
|
5
|
-
|
|
6
|
-
interface StatViewL2ChartProps {
|
|
7
|
-
queryKey: string;
|
|
8
|
-
ltmplConfig:LtmplConfig;
|
|
9
|
-
hiddenColIds?:string[];
|
|
10
|
-
hiddenRowCodes?:string[];
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
interface StatViewL2ChartStat {
|
|
14
|
-
dataSource: DtmplData[],
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class StatViewL2Chart extends React.PureComponent<StatViewL2ChartProps, StatViewL2ChartStat> {
|
|
19
|
-
state = {
|
|
20
|
-
dataSource: undefined,
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
loadData = async () => {
|
|
24
|
-
const {queryKey} = this.props;
|
|
25
|
-
if(queryKey) {
|
|
26
|
-
let queryData: QueryData = await HcserviceV3.requestQueryData(queryKey, {pageNo: 1, pageSize: 10000});
|
|
27
|
-
this.setState({
|
|
28
|
-
dataSource: queryData.entities,
|
|
29
|
-
})
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
async componentDidMount() {
|
|
34
|
-
this.loadData();
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
async componentDidUpdate(prevProps) {
|
|
38
|
-
const {queryKey} = this.props;
|
|
39
|
-
let {queryKey: preQueryKey} = prevProps;
|
|
40
|
-
|
|
41
|
-
if (queryKey && queryKey!=preQueryKey ){
|
|
42
|
-
this.loadData();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
getDataSource=()=>{//过滤
|
|
47
|
-
let {hiddenRowCodes} = this.props;
|
|
48
|
-
let {dataSource} = this.state;
|
|
49
|
-
let ds=[];
|
|
50
|
-
for(let d of dataSource){
|
|
51
|
-
if(!hiddenRowCodes || !hiddenRowCodes.includes(d.code)){
|
|
52
|
-
ds.push(d);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return ds;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
render() {
|
|
59
|
-
let {dataSource} = this.state;
|
|
60
|
-
let {ltmplConfig,hiddenColIds} = this.props;
|
|
61
|
-
return (
|
|
62
|
-
ltmplConfig && dataSource ?
|
|
63
|
-
<StatView2DChartProps hiddenColIds={hiddenColIds} dataSource={this.getDataSource()}
|
|
64
|
-
ltmplConfig={ltmplConfig}/> : ""
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export default StatViewL2Chart;
|