aldehyde 0.2.412 → 0.2.413
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/color-picker/index.d.ts.map +1 -1
- package/lib/controls/color-picker/index.js +2 -1
- package/lib/controls/color-picker/index.js.map +1 -1
- package/lib/layout2/components/theme-button.d.ts +5 -1
- package/lib/layout2/components/theme-button.d.ts.map +1 -1
- package/lib/layout2/components/theme-button.js +13 -2
- package/lib/layout2/components/theme-button.js.map +1 -1
- package/lib/layout2/components/user-button.d.ts.map +1 -1
- package/lib/layout2/components/user-button.js +20 -3
- package/lib/layout2/components/user-button.js.map +1 -1
- package/lib/layout2/header.js +2 -4
- package/lib/layout2/header.js.map +1 -1
- package/lib/layout2/main.js +1 -1
- package/lib/layout2/main.js.map +1 -1
- package/lib/layout3/header.js +2 -4
- package/lib/layout3/header.js.map +1 -1
- package/lib/layout4/header.js +2 -4
- package/lib/layout4/header.js.map +1 -1
- package/lib/layout5/header.js +2 -4
- package/lib/layout5/header.js.map +1 -1
- package/lib/list/vertical-list/index.less +12 -3
- package/lib/list/vertical-list/item.js +11 -7
- package/lib/list/vertical-list/item.js.map +1 -1
- package/lib/locale/LocaleButton.d.ts +5 -1
- package/lib/locale/LocaleButton.d.ts.map +1 -1
- package/lib/locale/LocaleButton.js +13 -3
- package/lib/locale/LocaleButton.js.map +1 -1
- package/lib/login3/img/login-bg.png +0 -0
- package/lib/lowcode-components/assets/china.json +1 -99420
- package/lib/lowcode-components/lowcode-view/component/font/FontGlobal.css +4 -4
- package/lib/module/dtmpl-view-modal.d.ts +1 -0
- package/lib/module/dtmpl-view-modal.d.ts.map +1 -1
- package/lib/module/dtmpl-view-modal.js +2 -1
- package/lib/module/dtmpl-view-modal.js.map +1 -1
- package/lib/module/index.less +5 -0
- package/lib/table/act-table.d.ts +1 -0
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js +28 -2
- package/lib/table/act-table.js.map +1 -1
- package/lib/table/index.css +57 -0
- package/lib/table/query-table.d.ts +0 -4
- package/lib/table/query-table.d.ts.map +1 -1
- package/lib/table/query-table.js +7 -63
- package/lib/table/query-table.js.map +1 -1
- package/lib/table/relation-table.d.ts +3 -0
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/table/report-table.d.ts.map +1 -1
- package/lib/table/report-table.js +1 -1
- package/lib/table/report-table.js.map +1 -1
- package/lib/tmpl/interface.d.ts +4 -0
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/lib/tmpl/tmpl-config-analysis.js +1 -1
- package/lib/tmpl/tmpl-config-analysis.js.map +1 -1
- package/lib/welcome/HCWelcome.js +20 -3
- package/lib/welcome/HCWelcome.js.map +1 -1
- package/lib/welcome/img/welcome2.png +0 -0
- package/package.json +1 -1
- package/src/aldehyde/controls/color-picker/index.tsx +3 -1
- package/src/aldehyde/layout2/components/theme-button.tsx +9 -3
- package/src/aldehyde/layout2/components/user-button.tsx +19 -4
- package/src/aldehyde/layout2/header.tsx +4 -4
- package/src/aldehyde/layout2/main.tsx +2 -2
- package/src/aldehyde/layout3/header.tsx +4 -4
- package/src/aldehyde/layout4/header.tsx +4 -4
- package/src/aldehyde/layout5/header.tsx +4 -4
- package/src/aldehyde/list/vertical-list/index.less +12 -3
- package/src/aldehyde/list/vertical-list/item.tsx +17 -17
- package/src/aldehyde/locale/LocaleButton.tsx +11 -10
- package/src/aldehyde/login3/img/login-bg.png +0 -0
- package/src/aldehyde/lowcode-components/assets/china.json +1 -99420
- package/src/aldehyde/lowcode-components/lowcode-view/component/font/DingTalk-JinBuTi.woff2 +0 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/font/DouyinSansBold.woff +0 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/font/FontGlobal.css +4 -4
- package/src/aldehyde/lowcode-components/lowcode-view/component/font/PangMenZhengDaoBiaoTiTiMianFeiBan.woff2 +0 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/font/YouSheBiaoTiHei.woff2 +0 -0
- package/src/aldehyde/module/dtmpl-view-modal.tsx +26 -24
- package/src/aldehyde/module/index.less +5 -0
- package/src/aldehyde/table/act-table.tsx +35 -2
- package/src/aldehyde/table/index.css +57 -0
- package/src/aldehyde/table/query-table.tsx +6 -63
- package/src/aldehyde/table/report-table.tsx +69 -69
- package/src/aldehyde/tmpl/interface.tsx +4 -0
- package/src/aldehyde/tmpl/tmpl-config-analysis.tsx +1 -1
- package/src/aldehyde/welcome/HCWelcome.js +17 -1
- package/src/aldehyde/welcome/img/welcome2.png +0 -0
- package/lib/lowcode-components/lowcode-view/component/font/DingTalk JinBuTi.ttf +0 -0
- package/lib/lowcode-components/lowcode-view/component/font/DouyinSansBold.ttf +0 -0
- package/lib/lowcode-components/lowcode-view/component/font//344/274/230/350/256/276/346/240/207/351/242/230/351/273/221.ttf +0 -0
- package/lib/lowcode-components/lowcode-view/component/font//345/272/236/351/227/250/346/255/243/351/201/223/346/240/207/351/242/230/344/275/223/345/205/215/350/264/271/347/211/210.ttf +0 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/font/DingTalk JinBuTi.ttf +0 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/font/DouyinSansBold.ttf +0 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/font//344/274/230/350/256/276/346/240/207/351/242/230/351/273/221.ttf +0 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/font//345/272/236/351/227/250/346/255/243/351/201/223/346/240/207/351/242/230/344/275/223/345/205/215/350/264/271/347/211/210.ttf +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
@font-face {
|
|
2
2
|
font-family: "DingTalk JinBuTi";
|
|
3
|
-
src: url('./DingTalk
|
|
3
|
+
src: url('./DingTalk-JinBuTi.woff2');
|
|
4
4
|
font-weight: normal;
|
|
5
5
|
font-style: normal;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
@font-face {
|
|
9
9
|
font-family: "DouyinSansBold";
|
|
10
|
-
src: url('./DouyinSansBold.
|
|
10
|
+
src: url('./DouyinSansBold.woff');
|
|
11
11
|
font-weight: normal;
|
|
12
12
|
font-style: normal;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
@font-face {
|
|
16
16
|
font-family: "优设标题黑";
|
|
17
|
-
src: url('
|
|
17
|
+
src: url('./YouSheBiaoTiHei.woff2');
|
|
18
18
|
font-weight: normal;
|
|
19
19
|
font-style: normal;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
@font-face {
|
|
23
23
|
font-family: "庞门正道标题体免费版";
|
|
24
|
-
src: url('
|
|
24
|
+
src: url('./PangMenZhengDaoBiaoTiTiMianFeiBan.woff2');
|
|
25
25
|
font-weight: normal;
|
|
26
26
|
font-style: normal;
|
|
27
27
|
}
|
|
Binary file
|
|
Binary file
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import React, {ReactNode} from 'react'
|
|
2
|
-
import { Modal} from 'antd'
|
|
1
|
+
import React, { ReactNode } from 'react'
|
|
3
2
|
import DtmplViewCard from "./dtmpl-view-card";
|
|
4
|
-
import {DtmplBaseProps} from "../tmpl/interface";
|
|
3
|
+
import { DtmplBaseProps } from "../tmpl/interface";
|
|
5
4
|
import Scrollbars from 'react-custom-scrollbars';
|
|
6
5
|
import DraggableModal from "./draggable-modal";
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import "./index.less";
|
|
7
|
+
|
|
8
|
+
interface DtmplViewModalProps extends DtmplBaseProps {
|
|
9
|
+
title?: ReactNode,
|
|
9
10
|
open: boolean,
|
|
10
11
|
onClose: () => void,
|
|
11
|
-
width?:string|number,
|
|
12
|
-
height?:string|number,
|
|
12
|
+
width?: string | number,
|
|
13
|
+
height?: string | number,
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
interface DtmplViewModalState {
|
|
@@ -18,16 +19,16 @@ interface DtmplViewModalState {
|
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
class DtmplViewModal extends React.PureComponent<DtmplViewModalProps, DtmplViewModalState> {
|
|
21
|
-
state={
|
|
22
|
+
state = {
|
|
22
23
|
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
static defaultProps = {
|
|
26
27
|
height: "82vh",
|
|
27
|
-
width:"82vw",
|
|
28
|
+
width: "82vw",
|
|
28
29
|
forceRender: true,
|
|
29
|
-
style: {maxWidth: 'calc(100vw - 60px)', maxHeight: 'calc(100vh - 50px)'},
|
|
30
|
-
open:false,
|
|
30
|
+
style: { maxWidth: 'calc(100vw - 60px)', maxHeight: 'calc(100vh - 50px)' },
|
|
31
|
+
open: false,
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
async componentDidMount() {
|
|
@@ -35,20 +36,21 @@ class DtmplViewModal extends React.PureComponent<DtmplViewModalProps, DtmplViewM
|
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
render() {
|
|
38
|
-
const {title,sourceId,code,open,onClose,width,height,serverKey,codeSource}=this.props;
|
|
39
|
+
const { title, sourceId, code, open, onClose, width, height, serverKey, codeSource } = this.props;
|
|
39
40
|
return <DraggableModal
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
41
|
+
open={open}
|
|
42
|
+
width={width}
|
|
43
|
+
title={title}
|
|
44
|
+
styles={{ body: { height: height, overflow: 'auto' }, header: { minHeight: "24px" } }}
|
|
45
|
+
destroyOnHidden={true}
|
|
46
|
+
centered
|
|
47
|
+
onCancel={onClose}
|
|
48
|
+
className='dtmpl-view-modal'
|
|
49
|
+
>
|
|
50
|
+
<Scrollbars autoHide autoHideTimeout={1000}>
|
|
51
|
+
<DtmplViewCard codeSource={codeSource} serverKey={serverKey} sourceId={sourceId} code={code}></DtmplViewCard>
|
|
52
|
+
</Scrollbars>
|
|
53
|
+
</DraggableModal>
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
56
|
|
|
@@ -34,6 +34,8 @@ import ColumnBuilder from "./column/column-builder";
|
|
|
34
34
|
import ReportTable from "./report-table";
|
|
35
35
|
import EntryControl from "../controls/entry-control";
|
|
36
36
|
import DraggableModal from "../module/draggable-modal";
|
|
37
|
+
import Icon from "../icon/aliIcon";
|
|
38
|
+
|
|
37
39
|
const { Content, Sider } = Layout;
|
|
38
40
|
type Level = "l1" | "l2";
|
|
39
41
|
|
|
@@ -1321,6 +1323,37 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1321
1323
|
this.setState({ tabActiveKey: val });
|
|
1322
1324
|
}
|
|
1323
1325
|
|
|
1326
|
+
renderAggregates() { // 统计数据渲染
|
|
1327
|
+
const { aggregateVO } = this.state;
|
|
1328
|
+
const { ltmplConfig } = this.props;
|
|
1329
|
+
const aggregates = aggregateVO?.aggregates || [];
|
|
1330
|
+
const columns = ltmplConfig?.columns || [];
|
|
1331
|
+
return aggregates?.length ? <div className="aggregates">{aggregates.map(item => {
|
|
1332
|
+
const column = columns.find(r => r.id === item.fieldId);
|
|
1333
|
+
if (!column) {
|
|
1334
|
+
return "";
|
|
1335
|
+
}
|
|
1336
|
+
const { dataUnit, themeColor, themeIcon } = column;
|
|
1337
|
+
return <Card className="aggregate-card" hoverable styles={{ body: { padding: 20 } }}>
|
|
1338
|
+
<div style={{ display: "flex", alignItems: "start", justifyContent: "space-between" }}>
|
|
1339
|
+
<div style={{ width: "calc(100% - 40px)" }}>
|
|
1340
|
+
<p className="title">{item.fieldTitle}</p>
|
|
1341
|
+
<div className="value">
|
|
1342
|
+
<span className="number">{item.value}</span>
|
|
1343
|
+
{dataUnit ? <span className="unit">{dataUnit}</span> : ""}
|
|
1344
|
+
</div>
|
|
1345
|
+
</div>
|
|
1346
|
+
{themeIcon ?
|
|
1347
|
+
<div className="icon" style={{ color: themeColor, background: `${themeColor}26` }}>
|
|
1348
|
+
<Icon type={themeIcon} />
|
|
1349
|
+
</div> :
|
|
1350
|
+
""}
|
|
1351
|
+
</div>
|
|
1352
|
+
</Card>
|
|
1353
|
+
}).filter(Boolean)
|
|
1354
|
+
}</div > : "";
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1324
1357
|
renderContent = () => {
|
|
1325
1358
|
let {
|
|
1326
1359
|
queryKey, loading, selectedRows, hiddenRowCodes, viewModels, sortedColConfigs, hiddenColIds, showL2ActTable,
|
|
@@ -1402,8 +1435,6 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1402
1435
|
onChangePage={onChangePage}
|
|
1403
1436
|
viewModels={viewModels}
|
|
1404
1437
|
primaryColumn={ltmplConfig.primaryColumn}
|
|
1405
|
-
defaultShowTotalCols={ltmplConfig.defaultShowTotalCols}
|
|
1406
|
-
rowTotalCols={ltmplConfig.rowTotalCols}
|
|
1407
1438
|
columnConfigs={columnConfigs} summaryConfigs={ltmplConfig.totalColumnConfigs}
|
|
1408
1439
|
maxSelectedRows={this.props?.tableType === "select" || this.checkBoxUseful() ? 10000 : -1}
|
|
1409
1440
|
selectedRows={selectedRows} columns={tableColumns}
|
|
@@ -1424,6 +1455,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1424
1455
|
ltmplConfig={ltmplConfig}
|
|
1425
1456
|
showView={showView}
|
|
1426
1457
|
showPagination={showPagination}
|
|
1458
|
+
onChangeAggregateVO={(val) => this.setState({ aggregateVO: val })}
|
|
1427
1459
|
/>);
|
|
1428
1460
|
|
|
1429
1461
|
return (
|
|
@@ -1488,6 +1520,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1488
1520
|
</Sider>
|
|
1489
1521
|
<Layout style={{ backgroundColor: "#fff" }}>
|
|
1490
1522
|
<Content style={{ overflow: "initial" }}>
|
|
1523
|
+
{this.renderAggregates()}
|
|
1491
1524
|
{displayCriteriaCard ? this.renderCriteriaForm() : null}
|
|
1492
1525
|
{buttons.includes("rowEdit") ? <AntdForm ref={this.formRef} component={false} onValuesChange={this.doRowEditFormChange}>{renderActTable}</AntdForm> : renderActTable}
|
|
1493
1526
|
</Content>
|
|
@@ -102,4 +102,61 @@
|
|
|
102
102
|
|
|
103
103
|
.actTable .ant-tabs-nav::before {
|
|
104
104
|
display: none;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.aggregates {
|
|
108
|
+
display: grid;
|
|
109
|
+
grid-template-columns: repeat(1, minmax(0, 1fr));
|
|
110
|
+
gap: 16px;
|
|
111
|
+
|
|
112
|
+
@media (min-width: 768px) {
|
|
113
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@media (min-width: 1024px) {
|
|
117
|
+
grid-template-columns: repeat(5, minmax(0, 1fr));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.aggregate-card .title {
|
|
122
|
+
margin-bottom: 16px;
|
|
123
|
+
font-size: 14px;
|
|
124
|
+
line-height: 20px;
|
|
125
|
+
color: var(--ant-color-text-secondary);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.aggregate-card .value {
|
|
129
|
+
display: flex;
|
|
130
|
+
gap: 4px;
|
|
131
|
+
align-items: baseline;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.aggregate-card .value .number {
|
|
135
|
+
font-size: 28px;
|
|
136
|
+
line-height: 32px;
|
|
137
|
+
font-weight: 700;
|
|
138
|
+
overflow: hidden;
|
|
139
|
+
text-overflow: ellipsis;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.aggregate-card .value .unit {
|
|
143
|
+
font-size: 16px;
|
|
144
|
+
line-height: 20px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.aggregate-card .icon {
|
|
148
|
+
padding: 8px;
|
|
149
|
+
border-radius: 8px;
|
|
150
|
+
background-color: var(--ant-layout-body-bg);
|
|
151
|
+
font-size: 20px;
|
|
152
|
+
display: flex;
|
|
153
|
+
justify-content: center;
|
|
154
|
+
align-items: center;
|
|
155
|
+
transition-property: all;
|
|
156
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
157
|
+
transition-duration: 300ms;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.aggregate-card:hover .icon {
|
|
161
|
+
transform: scale(1.1);
|
|
105
162
|
}
|
|
@@ -42,7 +42,6 @@ interface QueryTableStat {
|
|
|
42
42
|
touchEnd?: boolean;
|
|
43
43
|
aggregateVO?: AggregateVO;
|
|
44
44
|
beforeSelectedRows?: number;
|
|
45
|
-
aggregateShowSize?: number;
|
|
46
45
|
errorText?: string;
|
|
47
46
|
}
|
|
48
47
|
|
|
@@ -62,8 +61,6 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
62
61
|
selectedRows: [],
|
|
63
62
|
viewModels: ["table"],
|
|
64
63
|
summaryConfigs: [],
|
|
65
|
-
rowTotalCols: 4,
|
|
66
|
-
defaultShowTotalCols: 7,
|
|
67
64
|
cardListConfig: {},
|
|
68
65
|
ltmplConfig: {},
|
|
69
66
|
showPagination: true,
|
|
@@ -79,7 +76,6 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
79
76
|
touchEnd: undefined,
|
|
80
77
|
aggregateVO: undefined,
|
|
81
78
|
beforeSelectedRows: undefined,
|
|
82
|
-
aggregateShowSize: undefined,
|
|
83
79
|
errorText: undefined
|
|
84
80
|
};
|
|
85
81
|
|
|
@@ -87,12 +83,9 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
87
83
|
context: React.ContextType<typeof LocaleContext>;
|
|
88
84
|
|
|
89
85
|
async componentDidMount() {
|
|
90
|
-
const { queryKey, pageInfo
|
|
86
|
+
const { queryKey, pageInfo } = this.props;
|
|
91
87
|
if (queryKey) {
|
|
92
88
|
await this.loadData(queryKey.key, pageInfo);
|
|
93
|
-
this.setState({
|
|
94
|
-
aggregateShowSize: defaultShowTotalCols,
|
|
95
|
-
});
|
|
96
89
|
}
|
|
97
90
|
}
|
|
98
91
|
|
|
@@ -244,7 +237,7 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
244
237
|
};
|
|
245
238
|
|
|
246
239
|
queryTotal = async () => {
|
|
247
|
-
const { queryKey, serverKey, queryTotal } = this.props;
|
|
240
|
+
const { queryKey, serverKey, queryTotal, onChangeAggregateVO } = this.props;
|
|
248
241
|
const { aggregateVO: stateAggregateVO } = this.state;
|
|
249
242
|
let aggregateVO;
|
|
250
243
|
if (stateAggregateVO && stateAggregateVO.queryKey == queryKey.key) {
|
|
@@ -255,9 +248,8 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
255
248
|
} else {
|
|
256
249
|
aggregateVO = await HcserviceV3.requestQueryAggregates(serverKey, queryKey.key);
|
|
257
250
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
});
|
|
251
|
+
onChangeAggregateVO(aggregateVO)
|
|
252
|
+
this.setState({ aggregateVO });
|
|
261
253
|
}
|
|
262
254
|
};
|
|
263
255
|
|
|
@@ -437,14 +429,14 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
437
429
|
groupIColumns,
|
|
438
430
|
hiddenRowCodes,
|
|
439
431
|
columnConfigs,
|
|
440
|
-
serverKey,
|
|
432
|
+
serverKey,
|
|
441
433
|
cardListConfig,
|
|
442
434
|
ltmplConfig,
|
|
443
435
|
showView,
|
|
444
436
|
showPagination
|
|
445
437
|
} = this.props;
|
|
446
438
|
//debugger
|
|
447
|
-
const { touchEnd, aggregateVO, loading, virtualEndPageNo, dataSource,
|
|
439
|
+
const { touchEnd, aggregateVO, loading, virtualEndPageNo, dataSource, errorText } = this.state;
|
|
448
440
|
const isProSumarryTable = Boolean(subtotalXColumn);
|
|
449
441
|
// 是否是树形表格(存在甘特图视图展示且存在展开关系)
|
|
450
442
|
const isTreeTable = viewModels.includes("ganttChart") && ltmplConfig.gttSubOpenRatmplId;
|
|
@@ -531,58 +523,9 @@ class QueryTable extends React.PureComponent<QueryTableProps, QueryTableStat> {
|
|
|
531
523
|
this.mergeRowInCol(_, rowIdx, colIdx, mergeMp, current_cols.length))
|
|
532
524
|
);
|
|
533
525
|
}
|
|
534
|
-
let aggregateItems = [];
|
|
535
|
-
if (aggregateVO && aggregateVO.aggregates) {
|
|
536
|
-
if (aggregateShowSize < aggregateVO.aggregates.length) {
|
|
537
|
-
aggregateVO.aggregates.forEach(av => {
|
|
538
|
-
if (aggregateItems.length == aggregateShowSize) {
|
|
539
|
-
aggregateItems.push({
|
|
540
|
-
key: "opt",
|
|
541
|
-
label: <Button icon={<DownOutlined />} type={'link'} onClick={() => {
|
|
542
|
-
this.setState({ aggregateShowSize: aggregateVO.aggregates.length })
|
|
543
|
-
}}>{translate("${展开}")}</Button>,
|
|
544
|
-
children: null
|
|
545
|
-
// <div style={{fontSize:24}}>{av.value}</div>
|
|
546
|
-
})
|
|
547
|
-
} else if (aggregateItems.length < aggregateShowSize) {
|
|
548
|
-
aggregateItems.push({
|
|
549
|
-
key: av.fieldId,
|
|
550
|
-
label: <div style={{ fontSize: 14 }}>{translate("${" + av.fieldTitle + "}")}</div>,
|
|
551
|
-
children: <Statistic valueStyle={{ fontSize: 16 }} value={av.value ? av.value : 0} />
|
|
552
|
-
// <div style={{fontSize:24}}>{av.value}</div>
|
|
553
|
-
})
|
|
554
|
-
}
|
|
555
|
-
})
|
|
556
|
-
} else {
|
|
557
|
-
aggregateVO.aggregates.forEach(av => {
|
|
558
|
-
aggregateItems.push({
|
|
559
|
-
key: av.fieldId,
|
|
560
|
-
label: <div style={{ fontSize: 14 }}>{translate("${" + av.fieldTitle + "}")}</div>,
|
|
561
|
-
children: <Statistic valueStyle={{ fontSize: 16 }} value={av.value ? av.value : 0} />
|
|
562
|
-
})
|
|
563
|
-
});
|
|
564
|
-
if (this.defaultAggregateShowSize < aggregateVO.aggregates.length) {
|
|
565
|
-
aggregateItems.push({
|
|
566
|
-
key: "opt",
|
|
567
|
-
label: <Button icon={<UpOutlined />} type={'link'} onClick={() => {
|
|
568
|
-
this.setState({ aggregateShowSize: this.defaultAggregateShowSize })
|
|
569
|
-
}}>{translate("${收起}")}</Button>,
|
|
570
|
-
children: null
|
|
571
|
-
// <div style={{fontSize:24}}>{av.value}</div>
|
|
572
|
-
})
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
526
|
|
|
577
527
|
return (
|
|
578
528
|
<>
|
|
579
|
-
{aggregateVO?.aggregates?.length > 0 ?
|
|
580
|
-
<Card variant="borderless" styles={{ body: { paddingLeft: 10, paddingTop: 4, paddingBottom: 4, paddingRight: 10 } }}>
|
|
581
|
-
<Descriptions
|
|
582
|
-
column={rowTotalCols} colon={false}
|
|
583
|
-
items={aggregateItems}
|
|
584
|
-
/>
|
|
585
|
-
</Card> : null}
|
|
586
529
|
{/*{viewModels.includes("table") ? (*/}
|
|
587
530
|
{/* <Table*/}
|
|
588
531
|
{/* size={tableProps.size ? tableProps.size : undefined}*/}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import React, {useEffect, useState} from 'react'
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
2
|
import "./index.css"
|
|
3
|
-
import { ReportData, ReportTableProps} from "../tmpl/interface";
|
|
3
|
+
import { ReportData, ReportTableProps } from "../tmpl/interface";
|
|
4
4
|
import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
5
|
-
import {useLocale} from "../locale/useLocale";
|
|
5
|
+
import { useLocale } from "../locale/useLocale";
|
|
6
6
|
import ColumnBuilder from "./column/column-builder";
|
|
7
7
|
import ResizableTable from "./resizable-table";
|
|
8
8
|
|
|
9
|
-
const ReportTable=(props:ReportTableProps)=> {
|
|
9
|
+
const ReportTable = (props: ReportTableProps) => {
|
|
10
10
|
|
|
11
11
|
const [loading, setLoading] = useState<boolean>(false);
|
|
12
12
|
const [dataSource, setDataSource] = useState<object[]>(undefined);
|
|
13
13
|
const [reportData, setReportData] = useState<ReportData>(undefined);
|
|
14
14
|
|
|
15
|
-
const { getServiceLangStr, translate} = useLocale();
|
|
16
|
-
const {tableProps,columns,queryKey,serverKey,leftFixedCols,hiddenColIds}=props
|
|
15
|
+
const { getServiceLangStr, translate } = useLocale();
|
|
16
|
+
const { tableProps, columns, queryKey, serverKey, leftFixedCols, hiddenColIds } = props
|
|
17
17
|
|
|
18
|
-
useEffect(
|
|
18
|
+
useEffect(() => {
|
|
19
19
|
const queryData = async () => {
|
|
20
20
|
if (queryKey) {
|
|
21
|
-
await loadData(queryKey.key,serverKey);
|
|
21
|
+
await loadData(queryKey.key, serverKey);
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
queryData()
|
|
@@ -27,81 +27,81 @@ const ReportTable=(props:ReportTableProps)=> {
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
const loadData = async (
|
|
30
|
-
queryKey: string,serverKey:string
|
|
30
|
+
queryKey: string, serverKey: string
|
|
31
31
|
) => {
|
|
32
32
|
setLoading(true);
|
|
33
33
|
let reportData: ReportData = await HcserviceV3.requestQueryReportData(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
setDataSource(dataSource);
|
|
56
|
-
setReportData(reportData);
|
|
57
|
-
setLoading(false);
|
|
34
|
+
serverKey,
|
|
35
|
+
queryKey, getServiceLangStr()
|
|
36
|
+
);
|
|
37
|
+
if (reportData?.key != queryKey) {
|
|
38
|
+
return;
|
|
39
|
+
} else {
|
|
40
|
+
let dataSource: object[] = [];
|
|
41
|
+
if (reportData.entities) {
|
|
42
|
+
reportData.entities.forEach((item, index) => {
|
|
43
|
+
if (item) {
|
|
44
|
+
let row = {
|
|
45
|
+
key: item.code,
|
|
46
|
+
code: item.code, //增加code,为了删除操作
|
|
47
|
+
...item.fieldMap,
|
|
48
|
+
index,
|
|
49
|
+
};
|
|
50
|
+
dataSource.push(row);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
58
53
|
}
|
|
54
|
+
|
|
55
|
+
setDataSource(dataSource);
|
|
56
|
+
setReportData(reportData);
|
|
57
|
+
setLoading(false);
|
|
58
|
+
}
|
|
59
59
|
}
|
|
60
|
-
const addColumnOnCell=(current_cols,hiddenColIds:string[])=>{
|
|
61
|
-
if(!reportData){
|
|
60
|
+
const addColumnOnCell = (current_cols, hiddenColIds: string[]) => {
|
|
61
|
+
if (!reportData) {
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
|
-
const {rowGrids}=reportData
|
|
64
|
+
const { rowGrids } = reportData
|
|
65
65
|
current_cols.forEach((c) => {
|
|
66
66
|
debugger
|
|
67
|
-
if(rowGrids){
|
|
68
|
-
c.onCell=(record,index)=>{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
67
|
+
if (rowGrids) {
|
|
68
|
+
c.onCell = (record, index) => {
|
|
69
|
+
let rowGrid = rowGrids[record.code];
|
|
70
|
+
if (rowGrid && rowGrid.cellMap) {
|
|
71
|
+
if (rowGrid.cellMap[c.dataIndex]) {
|
|
72
|
+
let a = {
|
|
73
|
+
...rowGrid.cellMap[c.dataIndex]
|
|
74
|
+
}
|
|
75
|
+
if (a.colSpan > 1) {
|
|
76
|
+
let hiddenDim = 0;
|
|
77
|
+
if (hiddenColIds) {
|
|
78
|
+
debugger
|
|
79
|
+
hiddenColIds.forEach(id => {
|
|
80
|
+
if (rowGrid.cellMap[id]) {
|
|
81
|
+
hiddenDim++;
|
|
82
|
+
}
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
return { colSpan: a.colSpan - hiddenDim, rowSpan: 1 }
|
|
86
|
+
} else {
|
|
87
|
+
return a;
|
|
88
|
+
}
|
|
89
|
+
} else {
|
|
90
|
+
return { colSpan: 1, rowSpan: 1 }
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
let current_cols=reportData?.columnConfigs?ColumnBuilder.buildReportTableColumns({columnConfigs:[...reportData.columnConfigs],translate,leftFixedCols,hiddenColIds}):columns
|
|
99
|
-
|
|
98
|
+
let current_cols = reportData?.columnConfigs ? ColumnBuilder.buildReportTableColumns({ columnConfigs: [...reportData.columnConfigs], translate, leftFixedCols, hiddenColIds }) : columns;
|
|
99
|
+
let table_x = 20;
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
addColumnOnCell(current_cols,hiddenColIds);
|
|
101
|
+
current_cols.forEach((c) => {
|
|
102
|
+
table_x = table_x + (c.width ? c.width : 140);
|
|
103
|
+
});
|
|
104
|
+
addColumnOnCell(current_cols, hiddenColIds);
|
|
105
105
|
|
|
106
106
|
return <ResizableTable
|
|
107
107
|
size={tableProps?.size ? tableProps.size : undefined}
|
|
@@ -118,7 +118,7 @@ const ReportTable=(props:ReportTableProps)=> {
|
|
|
118
118
|
}
|
|
119
119
|
bordered
|
|
120
120
|
pagination={false}
|
|
121
|
-
style={{ display: columns ? "block" : "none" }}></ResizableTable>
|
|
121
|
+
style={{ display: columns ? "block" : "none", marginBottom: "12px" }}></ResizableTable>
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
export default ReportTable;
|
|
@@ -90,6 +90,7 @@ export interface QueryTableProps extends ReportTableProps {
|
|
|
90
90
|
ltmplConfig?: LtmplConfig;
|
|
91
91
|
showView?: (showVievParam: ShowViewParam) => void;
|
|
92
92
|
showPagination?: boolean;
|
|
93
|
+
onChangeAggregateVO?: (aggregateVO: AggregateVO) => void;
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
export interface AggregateVO {
|
|
@@ -454,6 +455,9 @@ export interface FieldConfig extends FieldBase {
|
|
|
454
455
|
dateControlShortcutKeys?: string[]; // 时间范围预设配置
|
|
455
456
|
placeholder?: string; // 占位符
|
|
456
457
|
appendCriteria?: CriteriaConfig; // 列查询条件配置
|
|
458
|
+
dataUnit?: string; // 单位
|
|
459
|
+
themeColor?: string; // 颜色
|
|
460
|
+
themeIcon?: string; // Icon
|
|
457
461
|
}
|
|
458
462
|
|
|
459
463
|
export interface ActionRenderProps {
|
|
@@ -298,6 +298,19 @@ const handleMenu = (arr) => {
|
|
|
298
298
|
});
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
+
// 获取菜单的所有子节点
|
|
302
|
+
const getLeafNodes = (tree, result = []) => {
|
|
303
|
+
if (!tree || !Array.isArray(tree)) return result;
|
|
304
|
+
tree.forEach(node => {
|
|
305
|
+
if (!node.children || node.children.length === 0) {
|
|
306
|
+
result.push(node);
|
|
307
|
+
} else {
|
|
308
|
+
getLeafNodes(node.children, result);
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
return result;
|
|
312
|
+
}
|
|
313
|
+
|
|
301
314
|
// 处理图片地址
|
|
302
315
|
const handleImgUrl = (basePath) => {
|
|
303
316
|
if (basePath.startsWith("http")) {
|
|
@@ -317,6 +330,7 @@ const HCWelcome = (props) => {
|
|
|
317
330
|
if (programCode) Units.setProgramCode(programCode);
|
|
318
331
|
const [orgHomeImg, setOrgHomeImg] = useState();
|
|
319
332
|
const [menus, setMenus] = useState([]);
|
|
333
|
+
const [leafMenus, setLeafMenus] = useState([]);
|
|
320
334
|
|
|
321
335
|
const initUserConfig = async () => {
|
|
322
336
|
let userInfo = await Units.getCurrentUserInfo();
|
|
@@ -336,7 +350,9 @@ const HCWelcome = (props) => {
|
|
|
336
350
|
const getMenus = async () => {
|
|
337
351
|
const temData = await getMenuConfig(layoutRootPath || "v2");
|
|
338
352
|
const temMenus = handleMenu(temData?.menu || []);
|
|
353
|
+
const temLeafNodes = getLeafNodes(temMenus);
|
|
339
354
|
setMenus(temMenus);
|
|
355
|
+
setLeafMenus(temLeafNodes)
|
|
340
356
|
}
|
|
341
357
|
|
|
342
358
|
useEffect(() => {
|
|
@@ -349,7 +365,7 @@ const HCWelcome = (props) => {
|
|
|
349
365
|
<div style={{ width: "100%", paddingTop: "12px" }} >
|
|
350
366
|
<Row gutter={[0]}>
|
|
351
367
|
<Col span={24}>
|
|
352
|
-
<Workbench layoutRootPath={layoutRootPath} menus={
|
|
368
|
+
<Workbench layoutRootPath={layoutRootPath} menus={leafMenus || []} />
|
|
353
369
|
</Col>
|
|
354
370
|
<Col span={24}>
|
|
355
371
|
<Row gutter={16}>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|