aldehyde 0.2.91 → 0.2.93
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/entity-select/entity-select.d.ts.map +1 -1
- package/lib/controls/entity-select/entity-select.js +10 -5
- package/lib/controls/entity-select/entity-select.js.map +1 -1
- package/lib/detail/edit/dtmpl-edit.js +2 -2
- package/lib/detail/edit/dtmpl-edit.js.map +1 -1
- package/lib/module/dtmpl-edit-card.js +2 -2
- package/lib/module/dtmpl-edit-card.js.map +1 -1
- package/lib/module/dtmpl-edit-page.d.ts.map +1 -1
- package/lib/module/dtmpl-edit-page.js +3 -3
- package/lib/module/dtmpl-edit-page.js.map +1 -1
- package/lib/module/dtmpl-editor.js +2 -2
- package/lib/module/dtmpl-editor.js.map +1 -1
- package/lib/module/dtmpl-view-card.d.ts +1 -0
- package/lib/module/dtmpl-view-card.d.ts.map +1 -1
- package/lib/module/dtmpl-view-card.js +2 -2
- package/lib/module/dtmpl-view-card.js.map +1 -1
- package/lib/module/embed-dtmpl-edit-page.d.ts +1 -0
- package/lib/module/embed-dtmpl-edit-page.d.ts.map +1 -1
- package/lib/module/embed-dtmpl-edit-page.js +2 -2
- package/lib/module/embed-dtmpl-edit-page.js.map +1 -1
- package/lib/module/ltmpl-table.d.ts +3 -1
- package/lib/module/ltmpl-table.d.ts.map +1 -1
- package/lib/module/ltmpl-table.js +5 -3
- package/lib/module/ltmpl-table.js.map +1 -1
- package/lib/routable/dtmpl-route.d.ts.map +1 -1
- package/lib/routable/dtmpl-route.js +3 -3
- package/lib/routable/dtmpl-route.js.map +1 -1
- package/lib/routable/ltmpl-route.js +2 -2
- package/lib/routable/ltmpl-route.js.map +1 -1
- package/lib/table/act-table.d.ts +3 -2
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js +31 -7
- package/lib/table/act-table.js.map +1 -1
- package/lib/table/relation-table.d.ts +5 -2
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/table/relation-table.js +22 -5
- package/lib/table/relation-table.js.map +1 -1
- package/lib/tmpl/hc-data-source.d.ts +1 -1
- package/lib/tmpl/hc-data-source.d.ts.map +1 -1
- package/lib/tmpl/hc-data-source.js +9 -5
- package/lib/tmpl/hc-data-source.js.map +1 -1
- package/lib/tmpl/hcservice-v3.d.ts +2 -2
- package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
- package/lib/tmpl/hcservice-v3.js +5 -5
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/tmpl/interface.d.ts +5 -0
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/lib/tree/act-tree.d.ts +4 -2
- package/lib/tree/act-tree.d.ts.map +1 -1
- package/lib/tree/act-tree.js +10 -9
- package/lib/tree/act-tree.js.map +1 -1
- package/lib/tree/tmpl-tree.d.ts +1 -1
- package/lib/tree/tmpl-tree.d.ts.map +1 -1
- package/lib/tree/tmpl-tree.js +10 -9
- package/lib/tree/tmpl-tree.js.map +1 -1
- package/lib/tree/tree-utils.d.ts +1 -1
- package/lib/tree/tree-utils.d.ts.map +1 -1
- package/lib/tree/tree-utils.js +10 -7
- package/lib/tree/tree-utils.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/entity-select/entity-select.tsx +114 -103
- package/src/aldehyde/detail/edit/dtmpl-edit.tsx +2 -2
- package/src/aldehyde/module/dtmpl-edit-card.tsx +2 -2
- package/src/aldehyde/module/dtmpl-edit-page.tsx +3 -4
- package/src/aldehyde/module/dtmpl-editor.tsx +2 -2
- package/src/aldehyde/module/dtmpl-view-card.tsx +3 -2
- package/src/aldehyde/module/embed-dtmpl-edit-page.tsx +3 -2
- package/src/aldehyde/module/ltmpl-table.tsx +6 -3
- package/src/aldehyde/routable/dtmpl-route.tsx +5 -3
- package/src/aldehyde/routable/ltmpl-route.tsx +2 -2
- package/src/aldehyde/table/act-table.tsx +38 -8
- package/src/aldehyde/table/relation-table.tsx +31 -6
- package/src/aldehyde/tmpl/hc-data-source.tsx +9 -6
- package/src/aldehyde/tmpl/hcservice-v3.tsx +6 -6
- package/src/aldehyde/tmpl/interface.tsx +7 -0
- package/src/aldehyde/tree/act-tree.tsx +11 -9
- package/src/aldehyde/tree/tmpl-tree.tsx +10 -10
- package/src/aldehyde/tree/tree-utils.tsx +12 -8
|
@@ -40,6 +40,7 @@ export interface LtmplTableState {
|
|
|
40
40
|
showDtmplCustomEdit?: boolean;
|
|
41
41
|
ractionId?: string,
|
|
42
42
|
collapse?: boolean,
|
|
43
|
+
addTmplId?:string,
|
|
43
44
|
};
|
|
44
45
|
|
|
45
46
|
class LtmplTable extends React.PureComponent<LtmplTableProps, LtmplTableState> {
|
|
@@ -56,6 +57,7 @@ class LtmplTable extends React.PureComponent<LtmplTableProps, LtmplTableState> {
|
|
|
56
57
|
showDraw: false,
|
|
57
58
|
ractionId: undefined,
|
|
58
59
|
collapse: false,
|
|
60
|
+
addTmplId:undefined,
|
|
59
61
|
}
|
|
60
62
|
|
|
61
63
|
static defaultProps = {
|
|
@@ -143,7 +145,7 @@ class LtmplTable extends React.PureComponent<LtmplTableProps, LtmplTableState> {
|
|
|
143
145
|
ractionId
|
|
144
146
|
})
|
|
145
147
|
}
|
|
146
|
-
doCreate = (toCustomPage) => {
|
|
148
|
+
doCreate = (addTmplId:string,toCustomPage?:boolean,) => {
|
|
147
149
|
const {doCustomCreate} = this.props
|
|
148
150
|
if (toCustomPage) {
|
|
149
151
|
if (doCustomCreate) {
|
|
@@ -160,6 +162,7 @@ class LtmplTable extends React.PureComponent<LtmplTableProps, LtmplTableState> {
|
|
|
160
162
|
this.setState({
|
|
161
163
|
selectedCode: null,
|
|
162
164
|
showDtmplEdit: true,
|
|
165
|
+
addTmplId,
|
|
163
166
|
})
|
|
164
167
|
}
|
|
165
168
|
}
|
|
@@ -203,7 +206,7 @@ class LtmplTable extends React.PureComponent<LtmplTableProps, LtmplTableState> {
|
|
|
203
206
|
|
|
204
207
|
|
|
205
208
|
render() {
|
|
206
|
-
const {ltmplConfigRes, criteriaData,pageSize,pageNo, showDtmplView, selectedCode, showDtmplEdit, showDtmplCustomEdit, ractionId, showDraw, collapse} = this.state;
|
|
209
|
+
const {ltmplConfigRes, criteriaData,pageSize,pageNo, showDtmplView, selectedCode, showDtmplEdit, showDtmplCustomEdit, ractionId, showDraw, collapse,addTmplId} = this.state;
|
|
207
210
|
const {sourceId, mainCode, showView, doSearch, doRAction, funcMode, tip,title, collapsible, initCollapse,doCustomEdit,doCustomCreate,serverKey,readOnly} = this.props;
|
|
208
211
|
|
|
209
212
|
if (!ltmplConfigRes) {
|
|
@@ -227,7 +230,7 @@ class LtmplTable extends React.PureComponent<LtmplTableProps, LtmplTableState> {
|
|
|
227
230
|
sourceId={sourceId}
|
|
228
231
|
code={selectedCode}> </ModalDtmplView> : ""}
|
|
229
232
|
{(buttons.includes('dtmplEdit') || buttons.includes('dtmplAdd')) && showDtmplEdit ?
|
|
230
|
-
<DtmplEditPage serverKey={serverKey} open={showDtmplEdit} onCancel={() => {
|
|
233
|
+
<DtmplEditPage addTmplId={addTmplId} serverKey={serverKey} open={showDtmplEdit} onCancel={() => {
|
|
231
234
|
this.setState({
|
|
232
235
|
showDtmplEdit: false,
|
|
233
236
|
})
|
|
@@ -114,8 +114,10 @@ class DtmplRoute extends React.Component<DtmplRouteProps, DtmplRoutePropsStat> {
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
render() {
|
|
117
|
-
|
|
118
|
-
const {
|
|
117
|
+
|
|
118
|
+
const {location,params,searchParams}=this.props;
|
|
119
|
+
const {sourceId} = params;
|
|
120
|
+
|
|
119
121
|
const {codeSource}=this.state;
|
|
120
122
|
if(!location){
|
|
121
123
|
return <></>;
|
|
@@ -132,7 +134,7 @@ class DtmplRoute extends React.Component<DtmplRouteProps, DtmplRoutePropsStat> {
|
|
|
132
134
|
);
|
|
133
135
|
}else{
|
|
134
136
|
return (
|
|
135
|
-
<DtmplEdit serverKey={null} addOrUpdate={this.getMode()} sourceId={sourceId} code={code} mainCode={this.getMainCode()} goBackToLtmpl={codeSource?undefined:this.goBackToLtmpl} goDtmpl={this.goDtmpl}></DtmplEdit>
|
|
137
|
+
<DtmplEdit addTmplId={searchParams.get('addTmplId')} serverKey={null} addOrUpdate={this.getMode()} sourceId={sourceId} code={code} mainCode={this.getMainCode()} goBackToLtmpl={codeSource?undefined:this.goBackToLtmpl} goDtmpl={this.goDtmpl}></DtmplEdit>
|
|
136
138
|
);
|
|
137
139
|
}
|
|
138
140
|
|
|
@@ -101,11 +101,11 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
101
101
|
return mainCode;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
doCreate = (toCustomPage: boolean = false) => {
|
|
104
|
+
doCreate = (addTmplId:string,toCustomPage: boolean = false) => {
|
|
105
105
|
const {basePath} = this.props;
|
|
106
106
|
const {sourceId} = this.props.params;
|
|
107
107
|
const {ltmplConfigRes} = this.state;
|
|
108
|
-
let path = `${basePath}/${sourceId}/detail-edit?menuId=${this.getMenuId()}`;
|
|
108
|
+
let path = `${basePath}/${sourceId}/detail-edit?menuId=${this.getMenuId()}&addTmplId=${addTmplId}`;
|
|
109
109
|
if (toCustomPage && ltmplConfigRes.ltmplConfig.customEditPagePath) {
|
|
110
110
|
path = `${basePath}/page/${sourceId}${ltmplConfigRes.ltmplConfig.customEditPagePath}?menuId=${this.getMenuId()}`;
|
|
111
111
|
}
|
|
@@ -25,7 +25,7 @@ import "./index.css"
|
|
|
25
25
|
import {
|
|
26
26
|
ActTableMode,
|
|
27
27
|
ActTableViewModel,
|
|
28
|
-
AddOrUpdate,
|
|
28
|
+
AddOrUpdate, ClassifiedAddConfig,
|
|
29
29
|
ColumnConfig,
|
|
30
30
|
DtmplData, JumpConfig,
|
|
31
31
|
LtmplConfig,
|
|
@@ -68,7 +68,7 @@ interface ActTableProps extends TmplBaseProps {
|
|
|
68
68
|
ltmplConfig: LtmplConfig,
|
|
69
69
|
menuId?: string,
|
|
70
70
|
showView?: (code: string, toCustomPage?: boolean) => void,
|
|
71
|
-
doCreate?: (toCustomPage
|
|
71
|
+
doCreate?: (addtmplId:string,toCustomPage: boolean) => void,
|
|
72
72
|
customCreatable?:boolean,
|
|
73
73
|
doEdit?: (code: string, mode: AddOrUpdate, toCustomPage?: boolean) => void,
|
|
74
74
|
customEditable?:boolean,
|
|
@@ -199,7 +199,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
buildTableColumns = (ltmplConfig: LtmplConfig, hiddenColIds: string[], hiddenRowCodes: string[], sortedColConfigs: ColumnConfig[]) => {
|
|
202
|
-
const { showView, doEdit, doRAction,customEditable,serverKey,readOnly} = this.props
|
|
202
|
+
const { showView, doEdit, doRAction,customEditable,serverKey,readOnly,sourceId} = this.props
|
|
203
203
|
const {buttons} = ltmplConfig;
|
|
204
204
|
let tableColumns = [];
|
|
205
205
|
let s = 0;
|
|
@@ -280,7 +280,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
280
280
|
icon={<EditOutlined/>}
|
|
281
281
|
onClick={() => doEdit(record.code, 'update')}>
|
|
282
282
|
</Button> : ""}
|
|
283
|
-
{(buttons.includes('dtmplCustomEdit') ||customEditable) && doEdit && !readOnly
|
|
283
|
+
{(buttons.includes('dtmplCustomEdit') || customEditable) && doEdit && !readOnly
|
|
284
284
|
&& (!ltmplConfig.editAction || ActionUtils.isShow(ltmplConfig.editAction, [record], undefined)) ?
|
|
285
285
|
< Button
|
|
286
286
|
size="small"
|
|
@@ -294,7 +294,17 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
294
294
|
size="small"
|
|
295
295
|
type="dashed"
|
|
296
296
|
icon={<CopyOutlined/>}
|
|
297
|
-
onClick={() =>
|
|
297
|
+
onClick={ async () => {
|
|
298
|
+
//先复制
|
|
299
|
+
let toCustomPage=false;
|
|
300
|
+
if(buttons.includes('dtmplCustomEdit') || customEditable){
|
|
301
|
+
toCustomPage=true;
|
|
302
|
+
}
|
|
303
|
+
let code = await HcserviceV3.doCopy(serverKey,sourceId,record.code);
|
|
304
|
+
if(code){
|
|
305
|
+
doEdit(code, 'update',toCustomPage);
|
|
306
|
+
}
|
|
307
|
+
}}>
|
|
298
308
|
</Button></Tooltip> : ""}
|
|
299
309
|
{ltmplConfig.ractions && !readOnly ? ltmplConfig.ractions.map((raction) => {
|
|
300
310
|
return <Button
|
|
@@ -595,6 +605,18 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
595
605
|
})
|
|
596
606
|
}
|
|
597
607
|
|
|
608
|
+
getAddTmplButton= (classifiedAddConfigs: ClassifiedAddConfig[]) => {
|
|
609
|
+
if(classifiedAddConfigs && classifiedAddConfigs.length<1){
|
|
610
|
+
return "没有分类添加按钮";
|
|
611
|
+
}
|
|
612
|
+
return classifiedAddConfigs.map((config)=>{
|
|
613
|
+
return <p><Button size={'small'} type={'text'}
|
|
614
|
+
onClick={() => this.props.doCreate(config.id,false)}>
|
|
615
|
+
{config.title}
|
|
616
|
+
</Button></p>
|
|
617
|
+
})
|
|
618
|
+
}
|
|
619
|
+
|
|
598
620
|
|
|
599
621
|
renderHeaderButtons = () => {
|
|
600
622
|
let {hiddenColIds, queryKey, viewModels, sortedColConfigs, disabledColIds, showL2Chart, showL2ActTable} = this.state;
|
|
@@ -609,15 +631,23 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
609
631
|
: null
|
|
610
632
|
}
|
|
611
633
|
{buttons.includes("dtmplAdd") && doCreate && !readOnly ?
|
|
612
|
-
|
|
634
|
+
ltmplConfig.classifiedAddConfigs && ltmplConfig.classifiedAddConfigs.length>0 ?
|
|
635
|
+
<Popover arrow={false} content={this.getAddTmplButton(ltmplConfig.classifiedAddConfigs)}
|
|
636
|
+
placement="bottomRight"
|
|
637
|
+
>
|
|
638
|
+
<Tooltip >
|
|
639
|
+
<Button><PlusOutlined/></Button>
|
|
640
|
+
</Tooltip>
|
|
641
|
+
</Popover>
|
|
642
|
+
:<Tooltip title={'创建'}>
|
|
613
643
|
<Button
|
|
614
|
-
onClick={() => doCreate()}>
|
|
644
|
+
onClick={() => doCreate(null,false)}>
|
|
615
645
|
<PlusOutlined/>
|
|
616
646
|
</Button> </Tooltip> : ''}
|
|
617
647
|
{(buttons.includes("dtmplCustomAdd") || customCreatable) && doCreate && !readOnly?
|
|
618
648
|
<Tooltip title={'创建'}>
|
|
619
649
|
<Button
|
|
620
|
-
onClick={() => doCreate(true)}><PlusCircleOutlined/></Button></Tooltip> : ''}
|
|
650
|
+
onClick={() => doCreate(null,true)}><PlusCircleOutlined/></Button></Tooltip> : ''}
|
|
621
651
|
{buttons.includes("importLtmplExcel") && !readOnly ? <Tooltip title={'导入'}> <Button
|
|
622
652
|
href={`#/${sourceId}/importer?menuId=${menuId}`} target={'_blank'}>
|
|
623
653
|
<UploadOutlined/>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {Button, Col, Form, message, Row, Space, Table, Tooltip, Typography} from 'antd';
|
|
2
|
+
import {Button, Col, Form, message, Popover, Row, Space, Table, Tooltip, Typography} from 'antd';
|
|
3
3
|
import {
|
|
4
4
|
AlignLeftOutlined,
|
|
5
5
|
DeleteOutlined,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
SnippetsOutlined
|
|
10
10
|
} from '@ant-design/icons';
|
|
11
11
|
import "./index.css";
|
|
12
|
-
import {DtmplData, FieldGroupConfig, SelectedRow, ViewOrEdit} from "../tmpl/interface";
|
|
12
|
+
import {ClassifiedAddConfig, DtmplData, FieldGroupConfig, SelectedRow, ViewOrEdit} from "../tmpl/interface";
|
|
13
13
|
import SupportInputTypes from '../tmpl/control-type-supportor';
|
|
14
14
|
import TableUnits from "./table-util";
|
|
15
15
|
import ViewControl from "../controls/view-control";
|
|
@@ -49,6 +49,7 @@ interface RelationTableStat {
|
|
|
49
49
|
selectedDtmplData?: DtmplData,
|
|
50
50
|
filterStr?: string,
|
|
51
51
|
pageSize?: number,
|
|
52
|
+
addTmplId?:string,
|
|
52
53
|
};
|
|
53
54
|
|
|
54
55
|
|
|
@@ -64,6 +65,7 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
64
65
|
selectedDtmplData: undefined,
|
|
65
66
|
filterStr: undefined,
|
|
66
67
|
pageSize: 10,
|
|
68
|
+
addTmplId:undefined,
|
|
67
69
|
// columns:[],
|
|
68
70
|
// dataSource:[],
|
|
69
71
|
// current:1,
|
|
@@ -439,19 +441,33 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
439
441
|
//this.hiddenRowEdit();
|
|
440
442
|
}
|
|
441
443
|
|
|
442
|
-
showAddDtmplModel = () => {
|
|
444
|
+
showAddDtmplModel = (addTmplId?:string) => {
|
|
443
445
|
this.setState({
|
|
444
446
|
showDtmplEdit: true,
|
|
447
|
+
addTmplId,
|
|
445
448
|
selectedCode: undefined,
|
|
446
449
|
})
|
|
447
450
|
}
|
|
448
451
|
showEditDtmplModel = (record) => {
|
|
449
452
|
this.setState({
|
|
450
453
|
showDtmplEdit: true,
|
|
454
|
+
addTmplId:undefined,
|
|
451
455
|
selectedCode: record.code,
|
|
452
456
|
})
|
|
453
457
|
}
|
|
454
458
|
|
|
459
|
+
getAddTmplButton= (classifiedAddConfigs: ClassifiedAddConfig[]) => {
|
|
460
|
+
if(classifiedAddConfigs && classifiedAddConfigs.length<1){
|
|
461
|
+
return "没有分类添加按钮";
|
|
462
|
+
}
|
|
463
|
+
return classifiedAddConfigs.map((config)=>{
|
|
464
|
+
return <p><Button size={'small'} type={'text'}
|
|
465
|
+
onClick={() => this.showAddDtmplModel(config.id)}>
|
|
466
|
+
{config.title}
|
|
467
|
+
</Button></p>
|
|
468
|
+
})
|
|
469
|
+
}
|
|
470
|
+
|
|
455
471
|
buildButtons = () => {
|
|
456
472
|
const {fieldGroupConfig, viewOrEdit, value,serverKey} = this.props;
|
|
457
473
|
const {buttons, disabled} = fieldGroupConfig;
|
|
@@ -469,11 +485,20 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
469
485
|
></RowEditor>
|
|
470
486
|
: ''}
|
|
471
487
|
{buttons.includes('dtmplAdd') ?
|
|
488
|
+
fieldGroupConfig.classifiedAddConfigs && fieldGroupConfig.classifiedAddConfigs.length>0 ?
|
|
489
|
+
<Popover arrow={false} content={this.getAddTmplButton(fieldGroupConfig.classifiedAddConfigs)}
|
|
490
|
+
placement="bottomRight"
|
|
491
|
+
>
|
|
492
|
+
<Tooltip >
|
|
493
|
+
<Button icon={<PlusSquareOutlined/>}>新增</Button>
|
|
494
|
+
</Tooltip>
|
|
495
|
+
</Popover>
|
|
496
|
+
:
|
|
472
497
|
<Button
|
|
473
498
|
disabled={buttonDisabled}
|
|
474
499
|
icon={<PlusSquareOutlined/>}
|
|
475
500
|
size="small"
|
|
476
|
-
onClick={this.showAddDtmplModel}
|
|
501
|
+
onClick={()=>this.showAddDtmplModel()}
|
|
477
502
|
style={{marginBottom: 10}}
|
|
478
503
|
>新增</Button> : ""}
|
|
479
504
|
{buttons.includes('selectAdd') ?
|
|
@@ -513,7 +538,7 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
513
538
|
render() {
|
|
514
539
|
|
|
515
540
|
const {fieldGroupConfig, value, parentId, loading, initCollapse, mainCode,serverKey,showRightNav} = this.props;
|
|
516
|
-
const {pageSize, selectedCode, showDtmplView, showSelectTable, showDtmplEdit, tableLoading, showRowEdit, selectedDtmplData} = this.state;
|
|
541
|
+
const {pageSize, selectedCode, showDtmplView, showSelectTable, showDtmplEdit,addTmplId, tableLoading, showRowEdit, selectedDtmplData} = this.state;
|
|
517
542
|
|
|
518
543
|
const {buttons} = fieldGroupConfig;
|
|
519
544
|
let mainCode1 = fieldGroupConfig.mainCode ? fieldGroupConfig.mainCode : mainCode ? mainCode : parentId;
|
|
@@ -570,7 +595,7 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
570
595
|
sourceId={fieldGroupConfig.id}
|
|
571
596
|
code={selectedCode}> </ModalDtmplView> : ""}
|
|
572
597
|
{buttons.includes('dtmplEdit') || buttons.includes('dtmplAdd') ?
|
|
573
|
-
<DtmplEditPage serverKey={serverKey} mainCode={mainCode1} open={showDtmplEdit} onCancel={this.hiddenEntityEdit}
|
|
598
|
+
<DtmplEditPage addTmplId={addTmplId} serverKey={serverKey} mainCode={mainCode1} open={showDtmplEdit} onCancel={this.hiddenEntityEdit}
|
|
574
599
|
sourceId={fieldGroupConfig.id}
|
|
575
600
|
code={selectedCode}
|
|
576
601
|
onOk={selectedCode ? this.handleDtmplEdit : this.handleDtmplAdd}/>
|
|
@@ -101,6 +101,9 @@ async function loadEnumOfSelectConfig(serverKey: string, selectConfig: SelectCon
|
|
|
101
101
|
|
|
102
102
|
async function loadEnumOfLtmplConfig(serverKey: string, selectConfig: LtmplConfig) {
|
|
103
103
|
const mstrucIds = [];
|
|
104
|
+
if(!selectConfig){
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
104
107
|
let subs = findUnloadEnumMstrucIdOfFields(selectConfig.columns);
|
|
105
108
|
concat(mstrucIds, subs);
|
|
106
109
|
subs = findUnloadEnumMstrucIdOfFields(selectConfig.criterias);
|
|
@@ -160,7 +163,6 @@ HCDataSource.getOptions = async function (serverKey: string, mstrucId: string) {
|
|
|
160
163
|
}
|
|
161
164
|
enumMap.set(mstrucId, reqOptions);
|
|
162
165
|
}
|
|
163
|
-
|
|
164
166
|
}
|
|
165
167
|
|
|
166
168
|
return enumMap.get(mstrucId);
|
|
@@ -229,13 +231,14 @@ HCDataSource.requestViewDtmplConfig = async function (serverKey: string, sourceI
|
|
|
229
231
|
return viewDtmplConfigMap.get(sourceId);
|
|
230
232
|
};
|
|
231
233
|
|
|
232
|
-
HCDataSource.requestAddDtmplConfig = async function (serverKey: string, sourceId: string) {
|
|
233
|
-
|
|
234
|
-
|
|
234
|
+
HCDataSource.requestAddDtmplConfig = async function (serverKey: string, sourceId: string,addTmplId:string) {
|
|
235
|
+
let key=addTmplId?addTmplId:sourceId;
|
|
236
|
+
if (!addDtmplConfigMap.has(key)) {
|
|
237
|
+
addDtmplConfigMap.set(key, await HcserviceV3.requestAddDtmplConfig(serverKey, sourceId,addTmplId));
|
|
235
238
|
//加载枚举
|
|
236
|
-
await loadEnumOfDtmplConfig(serverKey, addDtmplConfigMap.get(
|
|
239
|
+
await loadEnumOfDtmplConfig(serverKey, addDtmplConfigMap.get(key));
|
|
237
240
|
}
|
|
238
|
-
return addDtmplConfigMap.get(
|
|
241
|
+
return addDtmplConfigMap.get(key);
|
|
239
242
|
};
|
|
240
243
|
|
|
241
244
|
HCDataSource.getEnums = function (mstrucId: string): EnumItem[] {
|
|
@@ -72,14 +72,14 @@ export default class HcserviceV3 {
|
|
|
72
72
|
return res.dtmplConfig;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
static async requestAddDtmplConfig(serverKey:string,sourceId: string) {
|
|
75
|
+
static async requestAddDtmplConfig(serverKey:string,sourceId: string,addTmplId:string) {
|
|
76
76
|
|
|
77
77
|
let url = `/v3/add-dtmpl/config`
|
|
78
78
|
let res = await Super.super({
|
|
79
79
|
url,
|
|
80
80
|
serverKey,
|
|
81
81
|
method: "GET",
|
|
82
|
-
query: {sourceId}
|
|
82
|
+
query: {sourceId,addTmplId}
|
|
83
83
|
});
|
|
84
84
|
return res.dtmplConfig;
|
|
85
85
|
}
|
|
@@ -501,7 +501,7 @@ export default class HcserviceV3 {
|
|
|
501
501
|
return res;
|
|
502
502
|
}
|
|
503
503
|
|
|
504
|
-
static async doCopy(serverKey:string,sourceId:string,code:string,copyRelation
|
|
504
|
+
static async doCopy(serverKey:string,sourceId:string,code:string,copyRelation?,copyOpp2One?) {
|
|
505
505
|
let res = await Super.super({
|
|
506
506
|
url: `/v3/mstruc/copy-data`,
|
|
507
507
|
serverKey,
|
|
@@ -511,12 +511,12 @@ export default class HcserviceV3 {
|
|
|
511
511
|
code,copyRelation,copyOpp2One
|
|
512
512
|
}
|
|
513
513
|
},null,null);
|
|
514
|
-
if(res.status
|
|
514
|
+
if(res.status == 'success' ){
|
|
515
515
|
if(res.message){
|
|
516
|
-
message.
|
|
516
|
+
message.info("提示信息:" + res.message,4)
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
|
-
return res;
|
|
519
|
+
return res.entityCode;
|
|
520
520
|
}
|
|
521
521
|
|
|
522
522
|
// static downloadDetailExcel(sourceId, entityCode) {
|
|
@@ -77,6 +77,10 @@ export interface JumpConfig extends OrderableTmplBase {
|
|
|
77
77
|
searchParams:FieldConfig[],
|
|
78
78
|
routeParams:FieldConfig[],
|
|
79
79
|
}
|
|
80
|
+
export interface ClassifiedAddConfig extends OrderableTmplBase {
|
|
81
|
+
|
|
82
|
+
}
|
|
83
|
+
|
|
80
84
|
|
|
81
85
|
export interface Level2Menu extends MenuBase {
|
|
82
86
|
items:(BlockMenu|Level2Menu)[],
|
|
@@ -142,6 +146,7 @@ export interface FieldGroupConfig extends OrderableTmplBase {
|
|
|
142
146
|
pageSourceFieldMstrucId:string,
|
|
143
147
|
codeSourceFieldMstrucId:string,
|
|
144
148
|
pointSourceId:string,
|
|
149
|
+
classifiedAddConfigs?:ClassifiedAddConfig[],
|
|
145
150
|
}
|
|
146
151
|
|
|
147
152
|
export type SaveJumpType = 'list' | 'add' | 'edit';
|
|
@@ -251,6 +256,7 @@ export interface LtmplConfig extends SelectConfig {
|
|
|
251
256
|
reStatParams?: CriteriaConfig[];
|
|
252
257
|
customEditPagePath?:string;
|
|
253
258
|
customViewPagePath?:string;
|
|
259
|
+
classifiedAddConfigs?:ClassifiedAddConfig[],
|
|
254
260
|
drillingParams?: CriteriaConfig[];
|
|
255
261
|
footer?:string;
|
|
256
262
|
header?:string;
|
|
@@ -369,6 +375,7 @@ export interface DtmplBaseProps extends TmplBaseProps {
|
|
|
369
375
|
serialNumber?: number,
|
|
370
376
|
goDtmpl?: (code?:string) => void,
|
|
371
377
|
maxColsOnRow?:1|2,
|
|
378
|
+
addTmplId?:string,
|
|
372
379
|
};
|
|
373
380
|
|
|
374
381
|
export interface ChartConfig {
|
|
@@ -21,6 +21,7 @@ interface ActTreeState {
|
|
|
21
21
|
mainCode?: string,
|
|
22
22
|
sourceId?: string,
|
|
23
23
|
cardtitle?:string,
|
|
24
|
+
addTmplId?:string,
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
export default class ActTree extends React.PureComponent<ActTreeProps, ActTreeState> {
|
|
@@ -34,6 +35,7 @@ export default class ActTree extends React.PureComponent<ActTreeProps, ActTreeSt
|
|
|
34
35
|
mainCode: undefined,
|
|
35
36
|
sourceId: undefined,
|
|
36
37
|
cardtitle:undefined,
|
|
38
|
+
addTmplId:undefined
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
refTmplTree: any = React.createRef();
|
|
@@ -67,42 +69,42 @@ export default class ActTree extends React.PureComponent<ActTreeProps, ActTreeSt
|
|
|
67
69
|
const {ttmplConfig} = this.props;
|
|
68
70
|
this.showCard(title,ttmplConfig.rootGtmplId,null,code,true,false);
|
|
69
71
|
};
|
|
70
|
-
showCard=(cardtitle,sourceId,mainCode,recordCode,showEdit,showView)=>{
|
|
72
|
+
showCard=(cardtitle,sourceId,mainCode,recordCode,showEdit,showView,addTmplId?:string)=>{
|
|
71
73
|
this.setState({
|
|
72
74
|
mainCode,
|
|
73
75
|
cardtitle,
|
|
74
76
|
recordCode,
|
|
75
77
|
showEdit,
|
|
76
78
|
showView,
|
|
77
|
-
sourceId,
|
|
79
|
+
sourceId,addTmplId
|
|
78
80
|
})
|
|
79
81
|
}
|
|
80
82
|
onViewRoot = (title:string,code?: string) => {
|
|
81
83
|
const {ttmplConfig} = this.props;
|
|
82
|
-
this.showCard(title,ttmplConfig.rootGtmplId,null,code,false,true);
|
|
84
|
+
this.showCard(title,ttmplConfig.rootGtmplId,null,code,false,true,null);
|
|
83
85
|
};
|
|
84
86
|
|
|
85
87
|
onEditSub = (title:string,sourceId:string,mainCode:string,recordCode?: string) => {
|
|
86
|
-
this.showCard(title,sourceId,mainCode,recordCode,true,false);
|
|
88
|
+
this.showCard(title,sourceId,mainCode,recordCode,true,false,null);
|
|
87
89
|
};
|
|
88
90
|
|
|
89
91
|
onViewSub = (title:string,sourceId:string,mainCode:string,recordCode?: string) => {
|
|
90
92
|
|
|
91
|
-
this.showCard(title,sourceId,mainCode,recordCode,false,true);
|
|
93
|
+
this.showCard(title,sourceId,mainCode,recordCode,false,true,null);
|
|
92
94
|
};
|
|
93
95
|
|
|
94
96
|
onDelete=(sourceId:string,recordCode?: string) => {
|
|
95
97
|
HcserviceV3.deleteByCode(null,sourceId, [recordCode]);
|
|
96
98
|
};
|
|
97
|
-
onAddSub=(title:string,sourceId:string,mainCode: string) => {
|
|
99
|
+
onAddSub=(title:string,sourceId:string,mainCode: string,addTmplId: string) => {
|
|
98
100
|
|
|
99
|
-
this.showCard(title,sourceId,mainCode,null,true,false);
|
|
101
|
+
this.showCard(title,sourceId,mainCode,null,true,false,addTmplId);
|
|
100
102
|
};
|
|
101
103
|
|
|
102
104
|
render() {
|
|
103
105
|
const {} = this.props;
|
|
104
106
|
|
|
105
|
-
const {ttmplNodeConfig,showView, showEdit, recordCode, mainCode, sourceId,cardtitle} = this.state;
|
|
107
|
+
const {ttmplNodeConfig,showView, showEdit, recordCode, mainCode, sourceId,cardtitle,addTmplId} = this.state;
|
|
106
108
|
if (!ttmplNodeConfig) {
|
|
107
109
|
return <Card loading={true}></Card>
|
|
108
110
|
}
|
|
@@ -128,7 +130,7 @@ export default class ActTree extends React.PureComponent<ActTreeProps, ActTreeSt
|
|
|
128
130
|
</Sider>
|
|
129
131
|
<Layout style={{marginLeft: 322, backgroundColor: '#fff'}}>
|
|
130
132
|
<Content style={{overflow: 'initial'}}>
|
|
131
|
-
{showEdit ? <DtmplEditCard title={<>{recordCode ? <>编辑 {cardtitle?cardtitle:""}</> : <>添加 {cardtitle?cardtitle:""}</>} </>}
|
|
133
|
+
{showEdit ? <DtmplEditCard addTmplId={addTmplId} title={<>{recordCode ? <>编辑 {cardtitle?cardtitle:""}</> : <>添加 {cardtitle?cardtitle:""}</>} </>}
|
|
132
134
|
mainCode={mainCode}
|
|
133
135
|
sourceId={sourceId}
|
|
134
136
|
code={recordCode}
|
|
@@ -24,7 +24,7 @@ interface TmplTreeProps {
|
|
|
24
24
|
doEditRoot?: (title:string,code?: string) => void,
|
|
25
25
|
doViewRoot?: (title:string,code?: string) => void,
|
|
26
26
|
doDelete?: (ratmplId: string, code?: string) => void,
|
|
27
|
-
doAddSub?: (title:string,ratmplId: string, mainCode: string) => void,
|
|
27
|
+
doAddSub?: (title:string,ratmplId: string, mainCode: string,addTmplId:string) => void,
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
interface TmplTreeState {
|
|
@@ -236,7 +236,7 @@ class TmplTree extends React.PureComponent<TmplTreeProps, TmplTreeState> {
|
|
|
236
236
|
const {doAddSub} = this.props;
|
|
237
237
|
return <Button onClick={(e) => {
|
|
238
238
|
this.stopPropagation(e)
|
|
239
|
-
doAddSub(title,ratmplId, mainCode);
|
|
239
|
+
doAddSub(title,ratmplId, mainCode,null);
|
|
240
240
|
}} size={'small'}>{icon}{title}</Button>
|
|
241
241
|
}
|
|
242
242
|
|
|
@@ -245,19 +245,19 @@ class TmplTree extends React.PureComponent<TmplTreeProps, TmplTreeState> {
|
|
|
245
245
|
let buttons = [];
|
|
246
246
|
if (dataNode.parent) {//说明是sub
|
|
247
247
|
if (dataNode.isLeaf) {
|
|
248
|
-
if (ttmplNodeConfig.leafLTmplConfig
|
|
248
|
+
if (ttmplNodeConfig.leafLTmplConfig?.buttons.indexOf("dtmplEdit") > 0) {
|
|
249
249
|
buttons.push(<Button onClick={(e) => {
|
|
250
250
|
this.stopPropagation(e)
|
|
251
251
|
doEditSub(ttmplNodeConfig.leafTitle,ttmplNodeConfig.leafRatmplId, dataNode.parent.code, dataNode.code);
|
|
252
252
|
}} size={'small'}><EditOutlined/>编辑</Button>);
|
|
253
253
|
}
|
|
254
|
-
if (ttmplNodeConfig.leafLTmplConfig
|
|
254
|
+
if (ttmplNodeConfig.leafLTmplConfig?.buttons.indexOf("detail") > 0) {
|
|
255
255
|
buttons.push(<Button onClick={(e) => {
|
|
256
256
|
this.stopPropagation(e)
|
|
257
257
|
doViewSub(ttmplNodeConfig.leafTitle,ttmplNodeConfig.leafRatmplId, dataNode.parent.code, dataNode.code);
|
|
258
258
|
}} size={'small'}><AlignLeftOutlined/>查看</Button>);
|
|
259
259
|
}
|
|
260
|
-
if (ttmplNodeConfig.leafLTmplConfig
|
|
260
|
+
if (ttmplNodeConfig.leafLTmplConfig?.buttons.indexOf("singleDelete") > 0) {
|
|
261
261
|
buttons.push(this.getDeleteButton(ttmplNodeConfig.leafRatmplId, dataNode.code)
|
|
262
262
|
);
|
|
263
263
|
}
|
|
@@ -269,7 +269,7 @@ class TmplTree extends React.PureComponent<TmplTreeProps, TmplTreeState> {
|
|
|
269
269
|
doEditSub(ttmplNodeConfig.branchTitle,ttmplNodeConfig.branchRatmplId, dataNode.parent.code, dataNode.code);
|
|
270
270
|
}} size={'small'}><EditOutlined/>编辑</Button>);
|
|
271
271
|
}
|
|
272
|
-
if (ttmplNodeConfig.branchLTmplConfig
|
|
272
|
+
if (ttmplNodeConfig.branchLTmplConfig?.buttons.indexOf("detail") > 0) {
|
|
273
273
|
buttons.push(<Button onClick={(e) => {
|
|
274
274
|
this.stopPropagation(e)
|
|
275
275
|
doViewSub(ttmplNodeConfig.branchTitle,ttmplNodeConfig.branchRatmplId, dataNode.parent.code, dataNode.code);
|
|
@@ -277,18 +277,18 @@ class TmplTree extends React.PureComponent<TmplTreeProps, TmplTreeState> {
|
|
|
277
277
|
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
-
if (ttmplNodeConfig.branchLTmplConfig
|
|
280
|
+
if (ttmplNodeConfig.branchLTmplConfig?.buttons.indexOf("dtmplAdd") > 0) {
|
|
281
281
|
buttons.push(this.getAddButton(ttmplNodeConfig.branchTitle,
|
|
282
282
|
<PlusSquareOutlined/>, ttmplNodeConfig.branchRatmplId, dataNode.code)
|
|
283
283
|
);
|
|
284
284
|
}
|
|
285
285
|
|
|
286
|
-
if (ttmplNodeConfig.leafLTmplConfig
|
|
286
|
+
if (ttmplNodeConfig.leafLTmplConfig?.buttons.indexOf("dtmplAdd") > 0) {
|
|
287
287
|
buttons.push(this.getAddButton(ttmplNodeConfig.leafTitle,
|
|
288
288
|
<PlusOutlined/>, ttmplNodeConfig.leafRatmplId, dataNode.code)
|
|
289
289
|
);
|
|
290
290
|
}
|
|
291
|
-
if (ttmplNodeConfig.branchLTmplConfig
|
|
291
|
+
if (ttmplNodeConfig.branchLTmplConfig?.buttons.indexOf("singleDelete") > 0) {
|
|
292
292
|
buttons.push(this.getDeleteButton(ttmplNodeConfig.branchRatmplId, dataNode.code));
|
|
293
293
|
}
|
|
294
294
|
}
|
|
@@ -313,7 +313,7 @@ class TmplTree extends React.PureComponent<TmplTreeProps, TmplTreeState> {
|
|
|
313
313
|
);
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
|
-
if (ttmplNodeConfig.leafLTmplConfig
|
|
316
|
+
if (ttmplNodeConfig.leafLTmplConfig?.buttons.indexOf("dtmplAdd") > 0) {
|
|
317
317
|
buttons.push(this.getAddButton(ttmplNodeConfig.leafTitle,
|
|
318
318
|
<PlusOutlined/>, ttmplNodeConfig.leafRatmplId, dataNode.code)
|
|
319
319
|
);
|
|
@@ -59,7 +59,7 @@ export default class TreeUtils {
|
|
|
59
59
|
//组织data
|
|
60
60
|
if (res.entities) {
|
|
61
61
|
res.entities.forEach((item, index) => {
|
|
62
|
-
data.push(this.toTreeNodeData(item,config.rootTitleId,null,false));
|
|
62
|
+
data.push(this.toTreeNodeData(item,config.rootTitleId,null,false,"R"));
|
|
63
63
|
})
|
|
64
64
|
}
|
|
65
65
|
return data;
|
|
@@ -91,9 +91,12 @@ export default class TreeUtils {
|
|
|
91
91
|
let res = await HydrocarbonService.requestLtmplQueryTop(null, config.branchRatmplId, {mainCode: parentNodes[0].code});
|
|
92
92
|
brancEntities = res.entities;
|
|
93
93
|
}
|
|
94
|
+
let leafEntities: any[];
|
|
95
|
+
if(config.leafRatmplId){
|
|
96
|
+
let res1 = await HydrocarbonService.requestLtmplQueryTop(null, config.leafRatmplId, {mainCode: parentNodes[0].code});
|
|
97
|
+
leafEntities = res1.entities;
|
|
98
|
+
}
|
|
94
99
|
|
|
95
|
-
let res1 = await HydrocarbonService.requestLtmplQueryTop(null, config.leafRatmplId, {mainCode: parentNodes[0].code});
|
|
96
|
-
let leafEntities: any[] = res1.entities;
|
|
97
100
|
for(let parentNode of parentNodes){
|
|
98
101
|
this.pushNodeData(parentNode, config,brancEntities,leafEntities);
|
|
99
102
|
}
|
|
@@ -101,21 +104,22 @@ export default class TreeUtils {
|
|
|
101
104
|
}
|
|
102
105
|
|
|
103
106
|
|
|
104
|
-
static toLeafTreeNodeData = (item: DtmplData,config:TtmplNodeConfig, parent: TreeDataNode) => {
|
|
105
|
-
let d= this.toTreeNodeData(item,config.leafTitleId,parent,true);
|
|
107
|
+
static toLeafTreeNodeData = (item: DtmplData,config:TtmplNodeConfig, parent: TreeDataNode ) => {
|
|
108
|
+
let d= this.toTreeNodeData(item,config.leafTitleId,parent,true,"B");
|
|
106
109
|
return d;
|
|
107
110
|
}
|
|
108
111
|
|
|
109
112
|
static toBanchTreeNodeData = (item: DtmplData,config:TtmplNodeConfig, parent: TreeDataNode) => {
|
|
110
|
-
let d= this.toTreeNodeData(item,config.branchTitleId,parent,false);
|
|
113
|
+
let d= this.toTreeNodeData(item,config.branchTitleId,parent,false,"L");
|
|
111
114
|
return d;
|
|
112
115
|
}
|
|
113
116
|
|
|
114
|
-
static toTreeNodeData = (item: DtmplData,titleId:string, parent: TreeDataNode,isLeaf:boolean
|
|
117
|
+
static toTreeNodeData = (item: DtmplData,titleId:string, parent: TreeDataNode,isLeaf:boolean,keyPrex
|
|
118
|
+
:string) => {
|
|
115
119
|
let name = item.fieldMap[titleId];
|
|
116
120
|
let d = {
|
|
117
121
|
code: item.code,
|
|
118
|
-
key: parent?.code+item.code,
|
|
122
|
+
key: keyPrex + parent?.code+item.code,
|
|
119
123
|
name,
|
|
120
124
|
title: <><span>{name?name:item.code}</span></>,
|
|
121
125
|
children: [],
|