aldehyde 0.2.92 → 0.2.94
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/action/index.d.ts.map +1 -1
- package/lib/controls/action/index.js +1 -1
- package/lib/controls/action/index.js.map +1 -1
- package/lib/controls/action/utils.d.ts +3 -1
- package/lib/controls/action/utils.d.ts.map +1 -1
- package/lib/controls/action/utils.js +53 -28
- package/lib/controls/action/utils.js.map +1 -1
- package/lib/controls/entity-select/entity-select.js +1 -1
- package/lib/controls/entity-select/entity-select.js.map +1 -1
- package/lib/controls/entry-control.js +1 -1
- package/lib/controls/entry-control.js.map +1 -1
- package/lib/controls/input-number/index.js +3 -3
- package/lib/controls/input-number/index.js.map +1 -1
- package/lib/detail/button/bottom-submit-button-bar.d.ts.map +1 -1
- package/lib/detail/button/bottom-submit-button-bar.js +2 -2
- package/lib/detail/button/bottom-submit-button-bar.js.map +1 -1
- package/lib/detail/button/fix-right-submit-button-bar.js +3 -3
- package/lib/detail/button/fix-right-submit-button-bar.js.map +1 -1
- package/lib/detail/button/submit-button-bar.d.ts +2 -1
- package/lib/detail/button/submit-button-bar.d.ts.map +1 -1
- package/lib/detail/button/submit-button-bar.js +3 -3
- package/lib/detail/button/submit-button-bar.js.map +1 -1
- package/lib/detail/edit/dtmpl-edit.d.ts.map +1 -1
- package/lib/detail/edit/dtmpl-edit.js +5 -5
- package/lib/detail/edit/dtmpl-edit.js.map +1 -1
- package/lib/layout/MainPage.js +4 -4
- package/lib/layout/MainPage.js.map +1 -1
- package/lib/login/context-setter.d.ts.map +1 -1
- package/lib/login/context-setter.js +1 -0
- package/lib/login/context-setter.js.map +1 -1
- package/lib/module/dtmpl-edit-card.js +4 -4
- package/lib/module/dtmpl-edit-card.js.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-editor.js +4 -4
- 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 +19 -5
- 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 +18 -15
- package/lib/tmpl/hc-data-source.js.map +1 -1
- package/lib/tmpl/hcservice-v3.d.ts +1 -1
- 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 +6 -1
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/lib/tmpl/superagent.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 +1 -1
- package/lib/tree/tmpl-tree.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/action/index.tsx +1 -2
- package/src/aldehyde/controls/action/utils.tsx +66 -39
- package/src/aldehyde/controls/entity-select/entity-select.tsx +1 -1
- package/src/aldehyde/controls/entry-control.tsx +1 -1
- package/src/aldehyde/controls/input-number/index.tsx +3 -3
- package/src/aldehyde/detail/button/bottom-submit-button-bar.tsx +2 -3
- package/src/aldehyde/detail/button/fix-right-submit-button-bar.tsx +3 -3
- package/src/aldehyde/detail/button/submit-button-bar.tsx +12 -4
- package/src/aldehyde/detail/edit/dtmpl-edit.tsx +6 -5
- package/src/aldehyde/layout/MainPage.tsx +4 -4
- package/src/aldehyde/login/context-setter.tsx +1 -0
- package/src/aldehyde/module/dtmpl-edit-card.tsx +4 -4
- package/src/aldehyde/module/dtmpl-edit-page.tsx +5 -5
- package/src/aldehyde/module/dtmpl-editor.tsx +4 -4
- 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 +25 -5
- package/src/aldehyde/table/relation-table.tsx +31 -6
- package/src/aldehyde/tmpl/hc-data-source.tsx +19 -17
- package/src/aldehyde/tmpl/hcservice-v3.tsx +5 -5
- package/src/aldehyde/tmpl/interface.tsx +8 -1
- package/src/aldehyde/tmpl/superagent.js +1 -1
- package/src/aldehyde/tree/act-tree.tsx +11 -9
- package/src/aldehyde/tree/tmpl-tree.tsx +2 -2
|
@@ -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,
|
|
@@ -605,6 +605,18 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
605
605
|
})
|
|
606
606
|
}
|
|
607
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
|
+
|
|
608
620
|
|
|
609
621
|
renderHeaderButtons = () => {
|
|
610
622
|
let {hiddenColIds, queryKey, viewModels, sortedColConfigs, disabledColIds, showL2Chart, showL2ActTable} = this.state;
|
|
@@ -619,15 +631,23 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
619
631
|
: null
|
|
620
632
|
}
|
|
621
633
|
{buttons.includes("dtmplAdd") && doCreate && !readOnly ?
|
|
622
|
-
|
|
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={'创建'}>
|
|
623
643
|
<Button
|
|
624
|
-
onClick={() => doCreate()}>
|
|
644
|
+
onClick={() => doCreate(null,false)}>
|
|
625
645
|
<PlusOutlined/>
|
|
626
646
|
</Button> </Tooltip> : ''}
|
|
627
647
|
{(buttons.includes("dtmplCustomAdd") || customCreatable) && doCreate && !readOnly?
|
|
628
648
|
<Tooltip title={'创建'}>
|
|
629
649
|
<Button
|
|
630
|
-
onClick={() => doCreate(true)}><PlusCircleOutlined/></Button></Tooltip> : ''}
|
|
650
|
+
onClick={() => doCreate(null,true)}><PlusCircleOutlined/></Button></Tooltip> : ''}
|
|
631
651
|
{buttons.includes("importLtmplExcel") && !readOnly ? <Tooltip title={'导入'}> <Button
|
|
632
652
|
href={`#/${sourceId}/importer?menuId=${menuId}`} target={'_blank'}>
|
|
633
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}/>
|
|
@@ -163,7 +163,6 @@ HCDataSource.getOptions = async function (serverKey: string, mstrucId: string) {
|
|
|
163
163
|
}
|
|
164
164
|
enumMap.set(mstrucId, reqOptions);
|
|
165
165
|
}
|
|
166
|
-
|
|
167
166
|
}
|
|
168
167
|
|
|
169
168
|
return enumMap.get(mstrucId);
|
|
@@ -201,7 +200,7 @@ HCDataSource.requestDtmplConfig = async function (serverKey: string, sourceId: s
|
|
|
201
200
|
if (!dtmplConfigMap.has(sourceId)) {
|
|
202
201
|
let dtmplConfig:DtmplConfig=await HcserviceV3.requestDtmplConfig(serverKey, sourceId,code);
|
|
203
202
|
|
|
204
|
-
if(!dtmplConfig.dynamic){
|
|
203
|
+
if(dtmplConfig && !dtmplConfig.dynamic){
|
|
205
204
|
dtmplConfigMap.set(sourceId,dtmplConfig);
|
|
206
205
|
}else{
|
|
207
206
|
//直接返回
|
|
@@ -232,13 +231,14 @@ HCDataSource.requestViewDtmplConfig = async function (serverKey: string, sourceI
|
|
|
232
231
|
return viewDtmplConfigMap.get(sourceId);
|
|
233
232
|
};
|
|
234
233
|
|
|
235
|
-
HCDataSource.requestAddDtmplConfig = async function (serverKey: string, sourceId: string) {
|
|
236
|
-
|
|
237
|
-
|
|
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));
|
|
238
238
|
//加载枚举
|
|
239
|
-
await loadEnumOfDtmplConfig(serverKey, addDtmplConfigMap.get(
|
|
239
|
+
await loadEnumOfDtmplConfig(serverKey, addDtmplConfigMap.get(key));
|
|
240
240
|
}
|
|
241
|
-
return addDtmplConfigMap.get(
|
|
241
|
+
return addDtmplConfigMap.get(key);
|
|
242
242
|
};
|
|
243
243
|
|
|
244
244
|
HCDataSource.getEnums = function (mstrucId: string): EnumItem[] {
|
|
@@ -274,17 +274,19 @@ HCDataSource.requestBlocks = async (l2MenuId: string, blockId: string) => {
|
|
|
274
274
|
let result;
|
|
275
275
|
if (blocksCache.length < 1) {
|
|
276
276
|
let blockRes = await HcserviceV3.requestBlocks(l2MenuId ? l2MenuId : undefined, blockId ? blockId : undefined);
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
277
|
+
if(blockRes){
|
|
278
|
+
for (let block of blockRes.blocks) {
|
|
279
|
+
blocksCache.push(block);
|
|
280
|
+
}
|
|
281
|
+
programName = blockRes.programName;
|
|
282
|
+
result = {
|
|
283
|
+
blocks: blockRes.blocks,
|
|
284
|
+
l2MenuId: blockRes.l2MenuId,
|
|
285
|
+
blockId: blockRes.blockId,
|
|
286
|
+
programName: blockRes.programName,
|
|
287
|
+
};
|
|
280
288
|
}
|
|
281
|
-
|
|
282
|
-
result = {
|
|
283
|
-
blocks: blockRes.blocks,
|
|
284
|
-
l2MenuId: blockRes.l2MenuId,
|
|
285
|
-
blockId: blockRes.blockId,
|
|
286
|
-
programName: blockRes.programName,
|
|
287
|
-
};
|
|
289
|
+
|
|
288
290
|
} else {
|
|
289
291
|
result = {
|
|
290
292
|
blocks: blocksCache,
|
|
@@ -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
|
}
|
|
@@ -649,7 +649,7 @@ export default class HcserviceV3 {
|
|
|
649
649
|
url: '/v3/auth/context-source-value',
|
|
650
650
|
method: "GET"
|
|
651
651
|
})
|
|
652
|
-
return res.value;
|
|
652
|
+
return res?res.value:null;
|
|
653
653
|
}
|
|
654
654
|
|
|
655
655
|
static async login(json, kaptchaToken, kaptchaText, pubkey,programCode?:string) {
|
|
@@ -720,7 +720,7 @@ export default class HcserviceV3 {
|
|
|
720
720
|
header:{programCode,hydrocarbonToken},
|
|
721
721
|
url: '/v3/current-user',
|
|
722
722
|
});
|
|
723
|
-
return res.user;
|
|
723
|
+
return res?res.user:null;
|
|
724
724
|
}
|
|
725
725
|
|
|
726
726
|
// static async requestMessagebar() {
|
|
@@ -747,7 +747,7 @@ export default class HcserviceV3 {
|
|
|
747
747
|
url: url,
|
|
748
748
|
method: "GET",
|
|
749
749
|
})
|
|
750
|
-
return res.fastMenu;
|
|
750
|
+
return res?res.fastMenu:null;
|
|
751
751
|
}
|
|
752
752
|
|
|
753
753
|
static async reload() {
|
|
@@ -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,12 +146,13 @@ 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';
|
|
148
153
|
|
|
149
154
|
export interface DtmplConfig extends TmplBase {
|
|
150
|
-
|
|
155
|
+
autoSaveInterval?: number;
|
|
151
156
|
//exportExcel fusionMode history dtmplSave refresh
|
|
152
157
|
buttons: ButtonName[];
|
|
153
158
|
// 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 {
|
|
@@ -143,7 +143,7 @@ export default class Superagent {
|
|
|
143
143
|
|
|
144
144
|
static getHeaderObj() {
|
|
145
145
|
return {
|
|
146
|
-
'hydrocarbon-token': Units.hydrocarbonToken() ?Units.hydrocarbonToken() : Units.getAnoHydrocarbonToken(),
|
|
146
|
+
'hydrocarbon-token': Units.hydrocarbonToken() ? Units.hydrocarbonToken() : Units.getAnoHydrocarbonToken(),
|
|
147
147
|
'hydrocarbon-program-token': Units.programCode()
|
|
148
148
|
}
|
|
149
149
|
}
|
|
@@ -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
|
|