aldehyde 0.2.517 → 0.2.519
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/detail/view/act-dtmpl-view.d.ts +5 -1
- package/lib/detail/view/act-dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/act-dtmpl-view.js +7 -3
- package/lib/detail/view/act-dtmpl-view.js.map +1 -1
- package/lib/detail/view/audit-data-popover.d.ts +11 -0
- package/lib/detail/view/audit-data-popover.d.ts.map +1 -0
- package/lib/detail/view/audit-data-popover.js +48 -0
- package/lib/detail/view/audit-data-popover.js.map +1 -0
- package/lib/detail/view/dtmpl-view.d.ts +6 -1
- package/lib/detail/view/dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/dtmpl-view.js +21 -17
- package/lib/detail/view/dtmpl-view.js.map +1 -1
- package/lib/detail/view/field-view-group.d.ts +8 -0
- package/lib/detail/view/field-view-group.d.ts.map +1 -1
- package/lib/detail/view/field-view-group.js +15 -14
- package/lib/detail/view/field-view-group.js.map +1 -1
- package/lib/form/dtmpl-form.d.ts +12 -1
- package/lib/form/dtmpl-form.d.ts.map +1 -1
- package/lib/form/dtmpl-form.js +38 -28
- package/lib/form/dtmpl-form.js.map +1 -1
- package/lib/form/form-Item-group.d.ts +9 -0
- package/lib/form/form-Item-group.d.ts.map +1 -1
- package/lib/form/form-Item-group.js +13 -3
- package/lib/form/form-Item-group.js.map +1 -1
- package/lib/list/card-list/card-list-item.d.ts.map +1 -1
- package/lib/list/card-list/card-list-item.js +28 -6
- package/lib/list/card-list/card-list-item.js.map +1 -1
- package/lib/module/dtmpl-edit-page.d.ts +1 -0
- package/lib/module/dtmpl-edit-page.d.ts.map +1 -1
- package/lib/module/dtmpl-edit-page.js +5 -5
- package/lib/module/dtmpl-edit-page.js.map +1 -1
- package/lib/module/dtmpl-view-card.d.ts +2 -0
- package/lib/module/dtmpl-view-card.d.ts.map +1 -1
- package/lib/module/dtmpl-view-card.js +7 -4
- package/lib/module/dtmpl-view-card.js.map +1 -1
- package/lib/module/dtmpl-view-drawer.d.ts +2 -0
- package/lib/module/dtmpl-view-drawer.d.ts.map +1 -1
- package/lib/module/dtmpl-view-drawer.js +3 -2
- package/lib/module/dtmpl-view-drawer.js.map +1 -1
- package/lib/module/dtmpl-view-modal.d.ts +2 -0
- package/lib/module/dtmpl-view-modal.d.ts.map +1 -1
- package/lib/module/dtmpl-view-modal.js +3 -2
- package/lib/module/dtmpl-view-modal.js.map +1 -1
- package/lib/module/ttmpl-table.d.ts.map +1 -1
- package/lib/module/ttmpl-table.js +1 -1
- package/lib/module/ttmpl-table.js.map +1 -1
- package/lib/routable/index.less +5 -0
- package/lib/routable/ltmpl-route.d.ts +1 -0
- package/lib/routable/ltmpl-route.d.ts.map +1 -1
- package/lib/routable/ltmpl-route.js +37 -7
- package/lib/routable/ltmpl-route.js.map +1 -1
- package/lib/routable/ttmpl-table-route.d.ts.map +1 -1
- package/lib/routable/ttmpl-table-route.js +1 -1
- package/lib/routable/ttmpl-table-route.js.map +1 -1
- package/lib/table/act-table.d.ts +2 -0
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js +4 -4
- 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 +19 -7
- package/lib/table/column/column-builder.js.map +1 -1
- package/lib/table/pagination.js +1 -1
- package/lib/table/pagination.js.map +1 -1
- package/lib/table/relation-table.d.ts +5 -0
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/table/relation-table.js +54 -10
- package/lib/table/relation-table.js.map +1 -1
- package/lib/tmpl/hcservice-v3.d.ts +1 -0
- package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
- package/lib/tmpl/hcservice-v3.js +13 -0
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/tmpl/interface.d.ts +16 -1
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js +1 -0
- package/lib/tmpl/interface.js.map +1 -1
- package/lib/units/index.d.ts +2 -0
- package/lib/units/index.d.ts.map +1 -1
- package/lib/units/index.js +48 -2
- package/lib/units/index.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/detail/view/act-dtmpl-view.tsx +11 -3
- package/src/aldehyde/detail/view/audit-data-popover.tsx +70 -0
- package/src/aldehyde/detail/view/dtmpl-view.tsx +23 -27
- package/src/aldehyde/detail/view/field-view-group.tsx +16 -19
- package/src/aldehyde/form/dtmpl-form.tsx +62 -56
- package/src/aldehyde/form/form-Item-group.tsx +16 -5
- package/src/aldehyde/list/card-list/card-list-item.tsx +26 -7
- package/src/aldehyde/module/dtmpl-edit-page.tsx +10 -1
- package/src/aldehyde/module/dtmpl-view-card.tsx +39 -34
- package/src/aldehyde/module/dtmpl-view-drawer.tsx +4 -2
- package/src/aldehyde/module/dtmpl-view-modal.tsx +4 -2
- package/src/aldehyde/module/ttmpl-table.tsx +1 -0
- package/src/aldehyde/routable/index.less +5 -0
- package/src/aldehyde/routable/ltmpl-route.tsx +39 -4
- package/src/aldehyde/routable/ttmpl-table-route.tsx +1 -0
- package/src/aldehyde/table/act-table.tsx +6 -4
- package/src/aldehyde/table/column/column-builder.tsx +13 -2
- package/src/aldehyde/table/pagination.tsx +1 -1
- package/src/aldehyde/table/relation-table.tsx +77 -16
- package/src/aldehyde/tmpl/hcservice-v3.tsx +11 -0
- package/src/aldehyde/tmpl/interface.tsx +19 -3
- package/src/aldehyde/units/index.tsx +46 -1
|
@@ -1,62 +1,67 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import ActDtmplView from "./../detail/view/act-dtmpl-view";
|
|
3
3
|
import DtmplEditModal from './dtmpl-edit-modal';
|
|
4
|
-
import {CodeSource} from "../tmpl/interface";
|
|
4
|
+
import { CodeSource } from "../tmpl/interface";
|
|
5
5
|
|
|
6
6
|
//以列表为入口的,页面内列表,基本原则是所有交互在页面内完成,不会触发路由。
|
|
7
7
|
|
|
8
|
-
export interface DtmplViewCardProps
|
|
9
|
-
title?:any,
|
|
10
|
-
serverKey?:string,
|
|
11
|
-
sourceId?:string,
|
|
12
|
-
addTmplId?:string,
|
|
13
|
-
code?:string;
|
|
14
|
-
mainCode?:string;
|
|
15
|
-
editable?:boolean;
|
|
16
|
-
codeSource?:CodeSource,
|
|
17
|
-
showHeader?:boolean,
|
|
8
|
+
export interface DtmplViewCardProps {
|
|
9
|
+
title?: any,
|
|
10
|
+
serverKey?: string,
|
|
11
|
+
sourceId?: string,
|
|
12
|
+
addTmplId?: string,
|
|
13
|
+
code?: string;
|
|
14
|
+
mainCode?: string;
|
|
15
|
+
editable?: boolean;
|
|
16
|
+
codeSource?: CodeSource,
|
|
17
|
+
showHeader?: boolean,
|
|
18
|
+
isAudit?: boolean, // 是否审计
|
|
18
19
|
};
|
|
19
20
|
|
|
20
|
-
export interface DtmplViewCardState
|
|
21
|
-
showDtmplEdit?:boolean;
|
|
21
|
+
export interface DtmplViewCardState {
|
|
22
|
+
showDtmplEdit?: boolean;
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
class DtmplViewCard extends React.PureComponent<DtmplViewCardProps, DtmplViewCardState> {
|
|
25
26
|
|
|
26
27
|
state = {
|
|
27
|
-
showDtmplEdit:false,
|
|
28
|
+
showDtmplEdit: false,
|
|
28
29
|
}
|
|
29
30
|
|
|
30
|
-
static defaultProps={
|
|
31
|
-
|
|
31
|
+
static defaultProps = {
|
|
32
|
+
editable: true,
|
|
33
|
+
showHeader: true,
|
|
34
|
+
isAudit: false,
|
|
35
|
+
}
|
|
32
36
|
|
|
33
|
-
goDtmpl=()=>{
|
|
37
|
+
goDtmpl = () => {
|
|
34
38
|
this.setState({
|
|
35
|
-
showDtmplEdit:true,
|
|
39
|
+
showDtmplEdit: true,
|
|
36
40
|
})
|
|
37
41
|
}
|
|
38
42
|
|
|
39
|
-
handleDtmplEdit =
|
|
43
|
+
handleDtmplEdit = (code: string) => {
|
|
40
44
|
this.setState({
|
|
41
|
-
showDtmplEdit:false,
|
|
45
|
+
showDtmplEdit: false,
|
|
42
46
|
})
|
|
43
47
|
}
|
|
44
48
|
|
|
45
49
|
render() {
|
|
46
|
-
const {showDtmplEdit} = this.state;
|
|
47
|
-
const { sourceId,code,mainCode,editable,serverKey,codeSource,title,showHeader,addTmplId} = this.props;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
50
|
+
const { showDtmplEdit } = this.state;
|
|
51
|
+
const { sourceId, code, mainCode, editable, serverKey, codeSource, title, showHeader, addTmplId, isAudit } = this.props;
|
|
52
|
+
return <>
|
|
53
|
+
<ActDtmplView showHeader={showHeader} title={title} codeSource={codeSource} serverKey={serverKey}
|
|
54
|
+
goDtmpl={editable ? this.goDtmpl : null} sourceId={sourceId}
|
|
55
|
+
code={code} mainCode={mainCode} isAudit={isAudit} />
|
|
56
|
+
{showDtmplEdit ? <DtmplEditModal addTmplId={addTmplId} codeSource={codeSource} serverKey={serverKey} open={showDtmplEdit} onCancel={() => {
|
|
57
|
+
this.setState({
|
|
58
|
+
showDtmplEdit: false,
|
|
59
|
+
})
|
|
60
|
+
}}
|
|
61
|
+
sourceId={sourceId}
|
|
62
|
+
code={code}
|
|
63
|
+
onOk={this.handleDtmplEdit} /> : null}
|
|
64
|
+
</>
|
|
60
65
|
}
|
|
61
66
|
}
|
|
62
67
|
|
|
@@ -12,6 +12,7 @@ interface DtmplViewDrawerProps extends DtmplBaseProps {
|
|
|
12
12
|
height?: string | number,
|
|
13
13
|
cancelText: string,
|
|
14
14
|
editable?: boolean,
|
|
15
|
+
isAudit?: boolean, // 是否审计
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
interface DtmplViewDrawerState {
|
|
@@ -32,6 +33,7 @@ class DtmplViewDrawer extends React.PureComponent<DtmplViewDrawerProps, DtmplVie
|
|
|
32
33
|
placement: 'left',
|
|
33
34
|
open: false,
|
|
34
35
|
editable: true,
|
|
36
|
+
isAudit: false
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
async componentDidMount() {
|
|
@@ -41,7 +43,7 @@ class DtmplViewDrawer extends React.PureComponent<DtmplViewDrawerProps, DtmplVie
|
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
render() {
|
|
44
|
-
const { title, sourceId, code, open, onClose, cancelText, editable, serverKey, codeSource } = this.props;
|
|
46
|
+
const { title, sourceId, code, open, onClose, cancelText, editable, serverKey, codeSource, isAudit } = this.props;
|
|
45
47
|
const { drawerSize } = this.state;
|
|
46
48
|
const placement = this.props.placement || 'left';
|
|
47
49
|
const maxSize = ["top", "bottom"].includes(placement) ? document.documentElement.clientHeight : document.documentElement.clientWidth * 0.9;
|
|
@@ -64,7 +66,7 @@ class DtmplViewDrawer extends React.PureComponent<DtmplViewDrawerProps, DtmplVie
|
|
|
64
66
|
</Space>
|
|
65
67
|
}
|
|
66
68
|
>
|
|
67
|
-
<DtmplViewCard codeSource={codeSource} serverKey={serverKey} editable={editable} sourceId={sourceId} code={code} />
|
|
69
|
+
<DtmplViewCard isAudit={isAudit} codeSource={codeSource} serverKey={serverKey} editable={editable} sourceId={sourceId} code={code} />
|
|
68
70
|
</Drawer>)
|
|
69
71
|
}
|
|
70
72
|
}
|
|
@@ -11,6 +11,7 @@ interface DtmplViewModalProps extends DtmplBaseProps {
|
|
|
11
11
|
onClose: () => void,
|
|
12
12
|
width?: string | number,
|
|
13
13
|
height?: string | number,
|
|
14
|
+
isAudit?: boolean;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
interface DtmplViewModalState {
|
|
@@ -29,6 +30,7 @@ class DtmplViewModal extends React.PureComponent<DtmplViewModalProps, DtmplViewM
|
|
|
29
30
|
forceRender: true,
|
|
30
31
|
style: { maxWidth: 'calc(100vw - 60px)', maxHeight: 'calc(100vh - 50px)' },
|
|
31
32
|
open: false,
|
|
33
|
+
isAudit: false,
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
async componentDidMount() {
|
|
@@ -36,7 +38,7 @@ class DtmplViewModal extends React.PureComponent<DtmplViewModalProps, DtmplViewM
|
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
render() {
|
|
39
|
-
const { title, sourceId, code, open, onClose, width, height, serverKey, codeSource } = this.props;
|
|
41
|
+
const { title, sourceId, code, open, onClose, width, height, serverKey, codeSource, isAudit } = this.props;
|
|
40
42
|
return <DraggableModal
|
|
41
43
|
open={open}
|
|
42
44
|
width={width}
|
|
@@ -48,7 +50,7 @@ class DtmplViewModal extends React.PureComponent<DtmplViewModalProps, DtmplViewM
|
|
|
48
50
|
className='dtmpl-view-modal'
|
|
49
51
|
>
|
|
50
52
|
<Scrollbars autoHide autoHideTimeout={1000}>
|
|
51
|
-
<DtmplViewCard codeSource={codeSource} serverKey={serverKey} sourceId={sourceId} code={code}
|
|
53
|
+
<DtmplViewCard isAudit={isAudit} codeSource={codeSource} serverKey={serverKey} sourceId={sourceId} code={code} />
|
|
52
54
|
</Scrollbars>
|
|
53
55
|
</DraggableModal>
|
|
54
56
|
}
|
|
@@ -282,6 +282,7 @@ const TtmplTable = (props: TtmplTableProps) => {
|
|
|
282
282
|
bordered={bordered}
|
|
283
283
|
showHeader={showHeader}
|
|
284
284
|
expandable={(subNodes?.length || recursiveRatmplId) ? { expandedRowRender } : undefined} // 嵌套表格
|
|
285
|
+
showEmpty={false}
|
|
285
286
|
/>
|
|
286
287
|
{buttons.includes("detail") && showDtmplView ? (
|
|
287
288
|
<ModalDtmplView
|
|
@@ -50,6 +50,7 @@ export interface LtmplRouteState {
|
|
|
50
50
|
showEdit2D?: boolean; // 编辑2D图
|
|
51
51
|
showView2D?: boolean; // 查看2D图
|
|
52
52
|
isCopy?: boolean; // 是否复制
|
|
53
|
+
isAudit?: boolean; // 是否审计
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
@@ -83,7 +84,8 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
83
84
|
drawerSize: "92vw",
|
|
84
85
|
showEdit2D: false,
|
|
85
86
|
showView2D: false,
|
|
86
|
-
isCopy: false
|
|
87
|
+
isCopy: false,
|
|
88
|
+
isAudit: false
|
|
87
89
|
};
|
|
88
90
|
|
|
89
91
|
async componentDidMount() {
|
|
@@ -152,7 +154,8 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
152
154
|
showWindowType: undefined,
|
|
153
155
|
showEdit: false,
|
|
154
156
|
selectedCode: undefined,
|
|
155
|
-
toCustomPage: false
|
|
157
|
+
toCustomPage: false,
|
|
158
|
+
isAudit: false
|
|
156
159
|
}
|
|
157
160
|
)
|
|
158
161
|
};
|
|
@@ -323,6 +326,35 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
323
326
|
this.setState({ showView2D: true, selectedCode: val });
|
|
324
327
|
}
|
|
325
328
|
|
|
329
|
+
// 审计查看
|
|
330
|
+
doAuditView = (val: string) => {
|
|
331
|
+
const { sourceId } = this.props.params;
|
|
332
|
+
const { ltmplConfigRes } = this.state;
|
|
333
|
+
let ltmplConfig: LtmplConfig = ltmplConfigRes.ltmplConfig;
|
|
334
|
+
let showType: string = !ltmplConfig.buttonViewConfig ? "drawer" : ltmplConfig.buttonViewConfig.showType;
|
|
335
|
+
this.setState({
|
|
336
|
+
showViewModal: showType === "modal",
|
|
337
|
+
showViewDrawer: ["drawer", "default"].includes(showType),
|
|
338
|
+
selectedCode: val,
|
|
339
|
+
viewSourceId: sourceId,
|
|
340
|
+
isAudit: true
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
// 审计编辑
|
|
344
|
+
doAuditEdit = (val: string) => {
|
|
345
|
+
const { sourceId } = this.props.params;
|
|
346
|
+
const { ltmplConfigRes } = this.state;
|
|
347
|
+
let ltmplConfig: LtmplConfig = ltmplConfigRes.ltmplConfig;
|
|
348
|
+
let showWindowType: PageType = !ltmplConfig.buttonEditConfig ? "drawer" : ltmplConfig.buttonEditConfig.showType;
|
|
349
|
+
this.setState({
|
|
350
|
+
showEdit: true,
|
|
351
|
+
showWindowType: showWindowType === "default" ? "drawer" : showWindowType,
|
|
352
|
+
selectedCode: val,
|
|
353
|
+
editSourceId: sourceId,
|
|
354
|
+
isAudit: true
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
|
|
326
358
|
pathMark = () => {
|
|
327
359
|
const { tableType } = this.props;
|
|
328
360
|
return tableType && tableType == "report" ? "report-table" : "act-table";
|
|
@@ -399,7 +431,7 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
399
431
|
const {
|
|
400
432
|
ltmplConfigRes, showDraw, showWindowType, ractionId, selectedCode,
|
|
401
433
|
showViewDrawer, showViewModal, showEdit, editSourceId, viewSourceId, toCustomPage, userPageConfig,
|
|
402
|
-
themeConfig, pageSizeOptions, userPageConfigLoading, drawerSize, showEdit2D, showView2D, isCopy
|
|
434
|
+
themeConfig, pageSizeOptions, userPageConfigLoading, drawerSize, showEdit2D, showView2D, isCopy, isAudit
|
|
403
435
|
} = this.state;
|
|
404
436
|
const { location, params, tableType, rowOperatable, defShowType } = this.props;
|
|
405
437
|
const { sourceId } = params;
|
|
@@ -448,6 +480,7 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
448
480
|
defShowType={defShowType} userPageConfig={userPageConfig} setUserPageConfig={this.setUserPageConfig}
|
|
449
481
|
resetUserPageConfig={this.resetUserPageConfig} allowUserConfig={themeConfig?.allowUserConfig}
|
|
450
482
|
onUpdatePageSizeOptions={this.onUpdatePageSizeOptions} doEdit2D={this.doEdit2D} doView2D={this.doView2D}
|
|
483
|
+
doAuditView={this.doAuditView} doAuditEdit={this.doAuditEdit}
|
|
451
484
|
/>
|
|
452
485
|
{showDraw ? (
|
|
453
486
|
<Drawer
|
|
@@ -478,6 +511,7 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
478
511
|
open={showViewDrawer}
|
|
479
512
|
sourceId={viewSourceId ? viewSourceId : sourceId}
|
|
480
513
|
code={selectedCode}
|
|
514
|
+
isAudit={isAudit}
|
|
481
515
|
/>
|
|
482
516
|
) : null}
|
|
483
517
|
{showViewModal && selectedCode ? (
|
|
@@ -486,7 +520,7 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
486
520
|
<DtmplViewModal
|
|
487
521
|
serverKey={serverKey} width={windowWidth} height={windowHeight} onClose={this.doClose}
|
|
488
522
|
open={showViewModal} sourceId={viewSourceId ? viewSourceId : sourceId}
|
|
489
|
-
code={selectedCode}
|
|
523
|
+
code={selectedCode} isAudit={isAudit}
|
|
490
524
|
/>
|
|
491
525
|
) : null}
|
|
492
526
|
{showEdit && ltmplConfig ? (
|
|
@@ -517,6 +551,7 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
517
551
|
code={selectedCode}
|
|
518
552
|
onOk={this.doSubmited}
|
|
519
553
|
isCopy={isCopy}
|
|
554
|
+
isAudit={isAudit}
|
|
520
555
|
/>
|
|
521
556
|
)
|
|
522
557
|
) : null}
|
|
@@ -88,6 +88,8 @@ interface ActTableProps extends TmplBaseProps {
|
|
|
88
88
|
loadDataCallback?: (val: object[]) => void; // 请求数据回调函数
|
|
89
89
|
doEdit2D?: (val: string) => void; // 2D图编辑
|
|
90
90
|
doView2D?: (val: string) => void; // 2D图查看
|
|
91
|
+
doAuditView?: (val: string) => void; // 审计查看
|
|
92
|
+
doAuditEdit?: (val: string) => void; // 审计编辑
|
|
91
93
|
showTableAdd?: boolean; // 是否支持添加列表
|
|
92
94
|
expandable?: { expandedRowRender: (val: { [key: string]: any }) => React.JSX.Element }; // 嵌套表格
|
|
93
95
|
hideOnSinglePage?: boolean; // 分页配置,只有一页时是否隐藏分页器
|
|
@@ -1572,7 +1574,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1572
1574
|
title, collapsible,
|
|
1573
1575
|
onChangePage, serverKey, criteriaData, showEmpty, loadDataCallback,
|
|
1574
1576
|
showView, doEdit, doRAction, customEditable, readOnly, tableType, showPagination, showAggregates, userPageConfig,
|
|
1575
|
-
doEdit2D, doView2D, showTableAdd, setUserPageConfig, expandable, hideOnSinglePage, bordered, showHeader
|
|
1577
|
+
doEdit2D, doView2D, showTableAdd, setUserPageConfig, expandable, hideOnSinglePage, bordered, showHeader, doAuditView, doAuditEdit
|
|
1576
1578
|
} = this.props;
|
|
1577
1579
|
const { translate } = this.context;
|
|
1578
1580
|
|
|
@@ -1598,12 +1600,12 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1598
1600
|
doRowAction: this.doRowAction, doDeleteByCode: this.doDeleteByCode, sortColumns: criteriaData["sortColIds"],
|
|
1599
1601
|
editings, editRowEdit: this.editRowEdit, cancelRowEdit: this.cancelRowEdit, saveRowData: this.saveRowData,
|
|
1600
1602
|
doDelModalOpen: this.doDelModalOpen, mainCode, criteriaData: userCriteriaData, actTableDoSearch: this.actTableDoSearch,
|
|
1601
|
-
columnResize: userPageConfig?.colResize, doEdit2D, doView2D
|
|
1603
|
+
columnResize: userPageConfig?.colResize, doEdit2D, doView2D, doAuditView, doAuditEdit
|
|
1602
1604
|
}
|
|
1603
1605
|
);
|
|
1604
1606
|
|
|
1605
1607
|
let { buttons, extDisplayConfig, rowCardCount, customViewPagePath, splitTabShowType } = ltmplConfig;
|
|
1606
|
-
let { primaryColumn, primaryColumnLabel, secondColumn, secondColumnLabel, mainPicture, mainPictureLabel, labelColumn, cardShowCols, notDisplayFieldName, colNumOnRow } = extDisplayConfig;
|
|
1608
|
+
let { primaryColumn, primaryColumnLabel, secondColumn, secondColumnLabel, mainPicture, mainPictureLabel, labelColumn, cardShowCols, notDisplayFieldName, colNumOnRow, secondaryPicture } = extDisplayConfig;
|
|
1607
1609
|
let displayCriteriaCard: boolean = false;
|
|
1608
1610
|
if (funcMode == "simple" || funcMode == "common") {
|
|
1609
1611
|
displayCriteriaCard = false;
|
|
@@ -1665,7 +1667,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1665
1667
|
groupIColumns={ltmplConfig.groupIColumns}
|
|
1666
1668
|
doSearch={this.actTableDoSearch}
|
|
1667
1669
|
sortColumnData={sortColumnData}
|
|
1668
|
-
cardListConfig={{ primaryColumn, primaryColumnLabel, secondColumn, secondColumnLabel, mainPicture, mainPictureLabel, labelColumn, cardShowCols, rowCardCount, buttons, customViewPagePath, mainCode, notDisplayFieldName, colNumOnRow }}
|
|
1670
|
+
cardListConfig={{ primaryColumn, primaryColumnLabel, secondColumn, secondColumnLabel, mainPicture, mainPictureLabel, labelColumn, cardShowCols, rowCardCount, buttons, customViewPagePath, mainCode, notDisplayFieldName, colNumOnRow, secondaryPicture }}
|
|
1669
1671
|
ltmplConfig={ltmplConfig}
|
|
1670
1672
|
showView={showView}
|
|
1671
1673
|
showPagination={showPagination}
|
|
@@ -12,7 +12,8 @@ import {
|
|
|
12
12
|
FormOutlined,
|
|
13
13
|
KeyOutlined,
|
|
14
14
|
MenuOutlined, QuestionCircleOutlined, PlaySquareOutlined,
|
|
15
|
-
SettingOutlined, UpSquareFilled, DownSquareFilled
|
|
15
|
+
SettingOutlined, UpSquareFilled, DownSquareFilled, AlignCenterOutlined,
|
|
16
|
+
EditOutlined
|
|
16
17
|
} from "@ant-design/icons";
|
|
17
18
|
import ActionUtils from "../../controls/action/utils";
|
|
18
19
|
import ViewButton from "../../detail/button/view-button";
|
|
@@ -553,7 +554,7 @@ export default {
|
|
|
553
554
|
readOnly,
|
|
554
555
|
sourceId, translate, doCustomButton, doRowJump, blockMenuTreeDrawerOpen,
|
|
555
556
|
doRowAction, doDeleteByCode, editRowEdit, editings, cancelRowEdit, saveRowData, doDelModalOpen,
|
|
556
|
-
doView2D, doEdit2D, actTableDoSearch
|
|
557
|
+
doView2D, doEdit2D, actTableDoSearch, doAuditView, doAuditEdit
|
|
557
558
|
} = props;
|
|
558
559
|
const { buttons, builtInButtons, defShowRowActionCount, strongDeleteConfirmText, edit2DBtnTitle, view2DBtnTitle, deleteBtnTitle, copyMode } = ltmplConfig;
|
|
559
560
|
let actionButtons: any[] = [];
|
|
@@ -588,6 +589,16 @@ export default {
|
|
|
588
589
|
)
|
|
589
590
|
};
|
|
590
591
|
|
|
592
|
+
// 审计查看
|
|
593
|
+
if (buttons.includes("auditView") && doAuditView && !readOnly && ActionUtils.isShow(ltmplConfig.buttonAuditViewAction?.preposes, [record], undefined)) {
|
|
594
|
+
actionButtons.push(<Tooltip title={translate("${审计查看}")}><Button type="primary" size="small" onClick={() => doAuditView(record.code)} icon={<AlignCenterOutlined />} /></Tooltip>);
|
|
595
|
+
};
|
|
596
|
+
|
|
597
|
+
// 审计编辑
|
|
598
|
+
if (buttons.includes("auditEdit") && doAuditEdit && !readOnly && ActionUtils.isShow(ltmplConfig.buttonAuditEditAction?.preposes, [record], undefined)) {
|
|
599
|
+
actionButtons.push(<Tooltip title={translate("${审计编辑}")}><Button size="small" onClick={() => doAuditEdit(record.code)} icon={<EditOutlined />} /></Tooltip>);
|
|
600
|
+
};
|
|
601
|
+
|
|
591
602
|
// 2D图编辑
|
|
592
603
|
if (buttons.includes("edit2D") && doEdit2D && !readOnly) {
|
|
593
604
|
actionButtons.push((!edit2DBtnTitle || edit2DBtnTitle?.length < 4) ? <Button size="small" onClick={() => doEdit2D(record.code)}>{edit2DBtnTitle || <SettingOutlined />}</Button> :
|
|
@@ -55,7 +55,7 @@ class Pagination extends React.PureComponent<PaginationProps, PaginationStat> {
|
|
|
55
55
|
|
|
56
56
|
return (
|
|
57
57
|
<div className="Pagination" style={{ justifyContent: paginationPosition === "middle" ? "center" : (paginationPosition || "left"), marginTop: !(hideOnSinglePage && (total < (pageInfo.pageSize || 10))) ? "10px" : 0 }}>
|
|
58
|
-
{!(hideOnSinglePage && (total < (pageInfo.pageSize || 10))) ?
|
|
58
|
+
{!(hideOnSinglePage && ((total || 0) < (pageInfo.pageSize || 10))) ?
|
|
59
59
|
<span
|
|
60
60
|
className={sewTotal ? "sewTotal" : "seeTotal"}
|
|
61
61
|
onClick={queryTotal}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
Space,
|
|
9
9
|
Tooltip,
|
|
10
10
|
Typography, Popconfirm, FormInstance,
|
|
11
|
-
message
|
|
11
|
+
message, Tag
|
|
12
12
|
} from "antd";
|
|
13
13
|
import Table from "./control-table-x-axis-wrapper";
|
|
14
14
|
import {
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
EditOutlined,
|
|
18
18
|
FormOutlined,
|
|
19
19
|
PlusSquareOutlined, QuestionCircleOutlined,
|
|
20
|
-
SnippetsOutlined,
|
|
20
|
+
SnippetsOutlined, ExclamationCircleOutlined
|
|
21
21
|
} from "@ant-design/icons";
|
|
22
22
|
import "./index.css";
|
|
23
23
|
import {
|
|
@@ -47,6 +47,12 @@ import TmplConfigAnalysis from "../tmpl/tmpl-config-analysis";
|
|
|
47
47
|
const FormItem = AntdForm.Item;
|
|
48
48
|
const { Text } = Typography;
|
|
49
49
|
|
|
50
|
+
const auditDataStates = {
|
|
51
|
+
add: { "text": "新增", "color": "green" },
|
|
52
|
+
edit: { "text": "修改", "color": "orange" },
|
|
53
|
+
remove: { "text": "删除", "color": "red" },
|
|
54
|
+
};
|
|
55
|
+
|
|
50
56
|
interface RelationTableProps {
|
|
51
57
|
showRightNav?: boolean;
|
|
52
58
|
mainCode?: string;
|
|
@@ -62,6 +68,7 @@ interface RelationTableProps {
|
|
|
62
68
|
onEditing?: (editing: boolean) => void;
|
|
63
69
|
initCollapse?: boolean;
|
|
64
70
|
showCollapseCard?: boolean; // 是否显示折叠卡片,默认显示
|
|
71
|
+
audit?: { isAudit: boolean, previousData: any, changeInfo: any }; // 审计页面配置
|
|
65
72
|
}
|
|
66
73
|
|
|
67
74
|
interface RelationTableStat {
|
|
@@ -126,14 +133,14 @@ class RelationTable extends React.PureComponent<
|
|
|
126
133
|
|
|
127
134
|
buildDataSource = () => {
|
|
128
135
|
const { filterStr } = this.state;
|
|
129
|
-
const { value } = this.props;
|
|
136
|
+
const { value, audit } = this.props;
|
|
130
137
|
let dataSource = undefined;
|
|
131
138
|
|
|
132
139
|
/** 构建 dataSource **/
|
|
133
140
|
if (value) {
|
|
134
141
|
dataSource = [];
|
|
135
|
-
value.forEach((item
|
|
136
|
-
let flag = true;
|
|
142
|
+
value.forEach((item) => {
|
|
143
|
+
let flag = true, opt, preData;
|
|
137
144
|
if (filterStr) {
|
|
138
145
|
flag = false;
|
|
139
146
|
for (let value of Object.values(item.fieldMap)) {
|
|
@@ -143,23 +150,52 @@ class RelationTable extends React.PureComponent<
|
|
|
143
150
|
}
|
|
144
151
|
}
|
|
145
152
|
if (flag) {
|
|
153
|
+
if (audit?.isAudit) { // 审计页面
|
|
154
|
+
const temChange = audit.changeInfo?.find(r => r.code === item.code);
|
|
155
|
+
opt = temChange?.opt; // 数据类型
|
|
156
|
+
// 修改类型的数据
|
|
157
|
+
if (opt === "edit") {
|
|
158
|
+
const temData = audit?.previousData?.get(item.code)?.fieldMap;
|
|
159
|
+
preData = temChange.changeFields?.reduce((total, item) => {
|
|
160
|
+
total[item] = temData[item];
|
|
161
|
+
return total;
|
|
162
|
+
}, {});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
146
165
|
let row = {
|
|
147
166
|
key: item.code,
|
|
148
167
|
editStatus: item.editStatus,
|
|
149
168
|
relationLabel: item.relationLabel,
|
|
150
169
|
code: item.code, //增加code,为了删除操作
|
|
170
|
+
opt, // 审计页面展示数据状态
|
|
171
|
+
preData, // 审计页面修改数据展示上次数据
|
|
151
172
|
...item.fieldMap,
|
|
152
173
|
};
|
|
153
174
|
dataSource.push(row);
|
|
154
175
|
}
|
|
155
176
|
});
|
|
156
|
-
}
|
|
157
177
|
|
|
178
|
+
if (audit?.isAudit) { // 审计页面上次删除数据展示
|
|
179
|
+
const delDatas = audit.changeInfo?.filter(r => r.opt === "remove") || [];
|
|
180
|
+
delDatas.forEach(item => {
|
|
181
|
+
const tData = audit.previousData.get(item.code);
|
|
182
|
+
const row = {
|
|
183
|
+
key: item.code,
|
|
184
|
+
editStatus: tData.editStatus,
|
|
185
|
+
relationLabel: tData.relationLabel,
|
|
186
|
+
code: item.code,
|
|
187
|
+
opt: "remove",
|
|
188
|
+
...tData.fieldMap,
|
|
189
|
+
};
|
|
190
|
+
dataSource.push(row);
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}
|
|
158
194
|
return dataSource;
|
|
159
195
|
};
|
|
160
196
|
|
|
161
197
|
buildColumns = () => {
|
|
162
|
-
const { viewOrEdit, fieldGroupConfig, serverKey, parentFormInstance } = this.props;
|
|
198
|
+
const { viewOrEdit, fieldGroupConfig, serverKey, parentFormInstance, audit } = this.props;
|
|
163
199
|
const {
|
|
164
200
|
buttons,
|
|
165
201
|
fields,
|
|
@@ -173,6 +209,18 @@ class RelationTable extends React.PureComponent<
|
|
|
173
209
|
let columns = [];
|
|
174
210
|
/** 构建column **/
|
|
175
211
|
let s = 0;
|
|
212
|
+
|
|
213
|
+
if (audit?.isAudit) { // 审计页面-增加数据状态列显示
|
|
214
|
+
let column = {};
|
|
215
|
+
columns.push(column);
|
|
216
|
+
column["dataIndex"] = "数据状态";
|
|
217
|
+
column["title"] = translate("${数据状态}");
|
|
218
|
+
column["render"] = (_, record) => {
|
|
219
|
+
const state = auditDataStates[record.opt];
|
|
220
|
+
return state ? <Tag key={record.opt} color={state.color} >{state.text}</Tag> : "";
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
|
|
176
224
|
fields.forEach((item) => {
|
|
177
225
|
let column = {};
|
|
178
226
|
columns.push(column);
|
|
@@ -209,13 +257,28 @@ class RelationTable extends React.PureComponent<
|
|
|
209
257
|
fieldConfig={{ ...item }}
|
|
210
258
|
value={record[item.id]}
|
|
211
259
|
editStatus={record.editStatus}
|
|
212
|
-
/></FormItem> :
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
260
|
+
/></FormItem> : (
|
|
261
|
+
(audit?.isAudit && record.opt === "edit" && record.preData?.[item.id]) ?
|
|
262
|
+
<div style={{ display: "flex", alignItems: "center", justifyContent: "space-between" }}>
|
|
263
|
+
<div style={{ width: "calc(100% - 20px)" }}>
|
|
264
|
+
<ViewControl
|
|
265
|
+
serverKey={serverKey}
|
|
266
|
+
holderType={"table"}
|
|
267
|
+
fieldConfig={item}
|
|
268
|
+
value={record[item.id]}
|
|
269
|
+
/>
|
|
270
|
+
</div>
|
|
271
|
+
<Tooltip title={<ViewControl serverKey={serverKey} holderType={"table"} fieldConfig={item} value={record.preData[item.id]} />}>
|
|
272
|
+
<ExclamationCircleOutlined style={{ color: "red", cursor: "pointer" }} />
|
|
273
|
+
</Tooltip>
|
|
274
|
+
</div> :
|
|
275
|
+
<ViewControl
|
|
276
|
+
serverKey={serverKey}
|
|
277
|
+
holderType={"table"}
|
|
278
|
+
fieldConfig={item}
|
|
279
|
+
value={record[item.id]}
|
|
280
|
+
/>
|
|
281
|
+
)
|
|
219
282
|
);
|
|
220
283
|
};
|
|
221
284
|
});
|
|
@@ -1008,8 +1071,6 @@ class RelationTable extends React.PureComponent<
|
|
|
1008
1071
|
/></AntdForm>}
|
|
1009
1072
|
</div>;
|
|
1010
1073
|
|
|
1011
|
-
console.log("showCollapseCard", showCollapseCard);
|
|
1012
|
-
|
|
1013
1074
|
return fieldGroupConfig.displayConfig.includes("nonDataNonDisplayed") &&
|
|
1014
1075
|
(!value || value.length <= 0) ? "" : (
|
|
1015
1076
|
<>
|
|
@@ -465,6 +465,17 @@ export default class HcserviceV3 {
|
|
|
465
465
|
);
|
|
466
466
|
}
|
|
467
467
|
|
|
468
|
+
// 查询审计数据
|
|
469
|
+
static async requestViewDtmplAuditData(serverKey: string, sourceId: string, code, versionId) {
|
|
470
|
+
let url = `/v3/dtmpl/audit-data`;
|
|
471
|
+
let res = await Super.super({ url, serverKey, query: { code, versionId, sourceId }, method: "GET" });
|
|
472
|
+
if (res?.status === "success") {
|
|
473
|
+
return { sourceId, ...res };
|
|
474
|
+
} else {
|
|
475
|
+
return null;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
|
|
468
479
|
static async requestMstrucViewDtmplData(
|
|
469
480
|
serverKey: string,
|
|
470
481
|
sourceId,
|
|
@@ -60,6 +60,7 @@ export interface CardListConfig {
|
|
|
60
60
|
mainPictureLabel?: ColumnConfig;
|
|
61
61
|
labelColumn?: ColumnConfig;
|
|
62
62
|
cardShowCols?: ColumnConfig[];
|
|
63
|
+
secondaryPicture?: ColumnConfig;
|
|
63
64
|
rowCardCount?: number;
|
|
64
65
|
buttons?: string[];
|
|
65
66
|
customViewPagePath?: string;
|
|
@@ -152,7 +153,8 @@ export interface DtmplFormProps extends DtmplBaseProps {
|
|
|
152
153
|
showHeader?: boolean;
|
|
153
154
|
onFinish: (code: string | boolean) => void;
|
|
154
155
|
onValuesChange?: (changedValues, allValues: DtmplData) => void;
|
|
155
|
-
valueFieldMap?: { [key: string]: any } // 表单关联项
|
|
156
|
+
valueFieldMap?: { [key: string]: any }; // 表单关联项
|
|
157
|
+
isAudit?: boolean; // 是否审计编辑页
|
|
156
158
|
}
|
|
157
159
|
|
|
158
160
|
export interface CQueryConfig extends OrderableTmplBase {
|
|
@@ -352,7 +354,7 @@ export type ButtonName =
|
|
|
352
354
|
| "ltmplSelectAdd"
|
|
353
355
|
| "reStat"
|
|
354
356
|
| "drilling"
|
|
355
|
-
| "ratmplSelect" | "edit2D" | "view2D" | "showTableAdd";
|
|
357
|
+
| "ratmplSelect" | "edit2D" | "view2D" | "showTableAdd" | "auditView" | "auditEdit";
|
|
356
358
|
|
|
357
359
|
export type ChartType = "line" | "pie" | "column";
|
|
358
360
|
export type GroupDisplayConfig =
|
|
@@ -524,6 +526,8 @@ export interface ActionRenderProps {
|
|
|
524
526
|
doView2D?: (recordCode: string) => any,
|
|
525
527
|
doEdit2D?: (recordCode: string) => any,
|
|
526
528
|
actTableDoSearch?: (data: object) => void,
|
|
529
|
+
doAuditView?: (recordCode: string) => any, // 审计查看
|
|
530
|
+
doAuditEdit?: (recordCode: string) => any, // 审计编辑
|
|
527
531
|
}
|
|
528
532
|
|
|
529
533
|
export interface FileRule {
|
|
@@ -672,6 +676,7 @@ export interface LtmplConfig extends SelectConfig {
|
|
|
672
676
|
cardShowCols?: ColumnConfig[];
|
|
673
677
|
notDisplayFieldName?: boolean;
|
|
674
678
|
colNumOnRow?: number; // 卡片展示字段每行列数
|
|
679
|
+
secondaryPicture?: ColumnConfig; // 次图片字段
|
|
675
680
|
};
|
|
676
681
|
rowCardCount?: number;
|
|
677
682
|
defaultDtmplData?: DtmplData;
|
|
@@ -715,6 +720,8 @@ export interface LtmplConfig extends SelectConfig {
|
|
|
715
720
|
totalNumInTotalViewTitle?: string; // 聚合视图中显示总数的标题
|
|
716
721
|
notAutoQuery?: boolean; // 页面是否默认查询
|
|
717
722
|
tableLayout?: "auto" | "fixed"; // 表格布局(自适应列宽/固定列宽)
|
|
723
|
+
buttonAuditViewAction?: ActionConfig; // 审计查看按钮
|
|
724
|
+
buttonAuditEditAction?: ActionConfig; // 审计编辑按钮
|
|
718
725
|
}
|
|
719
726
|
|
|
720
727
|
export interface EnumItem {
|
|
@@ -964,4 +971,13 @@ export interface ThemeConfig {
|
|
|
964
971
|
supportedLanguages?: string[]; // 支持语言
|
|
965
972
|
defaultLanguage?: string; // 默认语言
|
|
966
973
|
wsTypes?: ("sys-messages" | "user-notification")[];
|
|
967
|
-
}
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
export interface AuditData { // 审计对比数据
|
|
977
|
+
entity: DtmplData;
|
|
978
|
+
previous?: DtmplData;
|
|
979
|
+
changeInfo?: {
|
|
980
|
+
changeFields: string[];
|
|
981
|
+
arrayChangeInfos: object
|
|
982
|
+
}
|
|
983
|
+
};
|