aldehyde 0.1.34 → 0.1.37
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/counting-tag/index.d.ts +18 -0
- package/lib/controls/counting-tag/index.d.ts.map +1 -0
- package/lib/controls/counting-tag/index.js +31 -0
- package/lib/controls/counting-tag/index.js.map +1 -0
- package/lib/controls/entity-select/entity-select.d.ts.map +1 -1
- package/lib/controls/entity-select/entity-select.js +6 -6
- package/lib/controls/entity-select/entity-select.js.map +1 -1
- package/lib/controls/entity-select/popover-entity-select.d.ts +3 -3
- package/lib/controls/entity-select/popover-entity-select.d.ts.map +1 -1
- package/lib/controls/entity-select/popover-entity-select.js +4 -4
- package/lib/controls/entity-select/popover-entity-select.js.map +1 -1
- package/lib/controls/entry-control.d.ts +1 -0
- package/lib/controls/entry-control.d.ts.map +1 -1
- package/lib/controls/entry-control.js +23 -6
- package/lib/controls/entry-control.js.map +1 -1
- package/lib/controls/rfield/index.js +1 -1
- package/lib/controls/rfield/index.js.map +1 -1
- package/lib/controls/view-control.d.ts.map +1 -1
- package/lib/controls/view-control.js +1 -0
- package/lib/controls/view-control.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/detail/edit/row-editor.d.ts +2 -0
- package/lib/detail/edit/row-editor.d.ts.map +1 -1
- package/lib/detail/edit/row-editor.js +4 -3
- package/lib/detail/edit/row-editor.js.map +1 -1
- package/lib/detail/view/act-dtmpl-view.js +1 -1
- package/lib/detail/view/act-dtmpl-view.js.map +1 -1
- package/lib/detail/view/dtmpl-view.js +1 -1
- package/lib/detail/view/dtmpl-view.js.map +1 -1
- package/lib/form/criteria-form.d.ts +1 -0
- package/lib/form/criteria-form.d.ts.map +1 -1
- package/lib/form/criteria-form.js +1 -1
- package/lib/form/criteria-form.js.map +1 -1
- package/lib/form/dtmpl-form.d.ts.map +1 -1
- package/lib/form/dtmpl-form.js +5 -6
- package/lib/form/dtmpl-form.js.map +1 -1
- package/lib/form/form-Item-group.d.ts +1 -0
- package/lib/form/form-Item-group.d.ts.map +1 -1
- package/lib/form/form-Item-group.js +3 -3
- package/lib/form/form-Item-group.js.map +1 -1
- package/lib/layout/menu/menu-2layers.d.ts.map +1 -1
- package/lib/layout/menu/menu-2layers.js +38 -21
- package/lib/layout/menu/menu-2layers.js.map +1 -1
- package/lib/layout/menu/menu-render.d.ts +1 -0
- package/lib/layout/menu/menu-render.d.ts.map +1 -1
- package/lib/layout/menu/menu-render.js +28 -1
- package/lib/layout/menu/menu-render.js.map +1 -1
- package/lib/routable/dtmpl-route.d.ts +10 -0
- package/lib/routable/dtmpl-route.d.ts.map +1 -1
- package/lib/routable/dtmpl-route.js +56 -4
- package/lib/routable/dtmpl-route.js.map +1 -1
- package/lib/table/modal-select-table.d.ts +1 -0
- package/lib/table/modal-select-table.d.ts.map +1 -1
- package/lib/table/modal-select-table.js +2 -2
- package/lib/table/modal-select-table.js.map +1 -1
- package/lib/table/relation-table.d.ts +1 -0
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/table/relation-table.js +23 -53
- package/lib/table/relation-table.js.map +1 -1
- package/lib/table/select-table.d.ts +1 -0
- package/lib/table/select-table.d.ts.map +1 -1
- package/lib/table/select-table.js +2 -1
- package/lib/table/select-table.js.map +1 -1
- package/lib/tmpl/control-type-supportor.d.ts.map +1 -1
- package/lib/tmpl/control-type-supportor.js +1 -0
- package/lib/tmpl/control-type-supportor.js.map +1 -1
- package/lib/tmpl/hc-data-source.d.ts +1 -0
- package/lib/tmpl/hc-data-source.d.ts.map +1 -1
- package/lib/tmpl/hc-data-source.js +12 -0
- package/lib/tmpl/hc-data-source.js.map +1 -1
- package/lib/tmpl/hcservice-v3.d.ts +3 -0
- package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
- package/lib/tmpl/hcservice-v3.js +23 -3
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/tmpl/interface.d.ts +5 -1
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/counting-tag/index.tsx +45 -0
- package/src/aldehyde/controls/entity-select/entity-select.tsx +6 -5
- package/src/aldehyde/controls/entity-select/popover-entity-select.tsx +5 -5
- package/src/aldehyde/controls/entry-control.tsx +14 -6
- package/src/aldehyde/controls/rfield/index.tsx +1 -1
- package/src/aldehyde/controls/view-control.tsx +1 -0
- package/src/aldehyde/detail/edit/dtmpl-edit.tsx +2 -2
- package/src/aldehyde/detail/edit/row-editor.tsx +5 -2
- package/src/aldehyde/detail/view/act-dtmpl-view.tsx +1 -1
- package/src/aldehyde/detail/view/dtmpl-view.tsx +1 -1
- package/src/aldehyde/form/criteria-form.tsx +3 -1
- package/src/aldehyde/form/dtmpl-form.tsx +4 -4
- package/src/aldehyde/form/form-Item-group.tsx +4 -3
- package/src/aldehyde/layout/menu/menu-2layers.tsx +43 -25
- package/src/aldehyde/layout/menu/menu-render.tsx +33 -1
- package/src/aldehyde/routable/dtmpl-route.tsx +50 -7
- package/src/aldehyde/table/modal-select-table.tsx +3 -2
- package/src/aldehyde/table/relation-table.tsx +27 -54
- package/src/aldehyde/table/select-table.tsx +3 -1
- package/src/aldehyde/tmpl/control-type-supportor.tsx +1 -0
- package/src/aldehyde/tmpl/hc-data-source.tsx +12 -1
- package/src/aldehyde/tmpl/hcservice-v3.tsx +21 -4
- package/src/aldehyde/tmpl/interface.tsx +6 -2
|
@@ -15,6 +15,36 @@ export default {
|
|
|
15
15
|
}
|
|
16
16
|
})
|
|
17
17
|
},
|
|
18
|
+
getRoutePath(menu:Level2Menu,basePath,defaultCriteriaData){
|
|
19
|
+
if(menu){
|
|
20
|
+
let pageType=menu.pageType;
|
|
21
|
+
|
|
22
|
+
let routePath='act-table';
|
|
23
|
+
|
|
24
|
+
let codeSource='';
|
|
25
|
+
switch (pageType) {
|
|
26
|
+
case "列表":
|
|
27
|
+
routePath='act-table';
|
|
28
|
+
break;
|
|
29
|
+
case "添加":
|
|
30
|
+
routePath='detail-edit';
|
|
31
|
+
codeSource='&codeSource=new';
|
|
32
|
+
break;
|
|
33
|
+
case "编辑":
|
|
34
|
+
routePath='detail-edit';
|
|
35
|
+
codeSource='&codeSource=listTop';
|
|
36
|
+
break;
|
|
37
|
+
case "详情":
|
|
38
|
+
routePath='detail-view';
|
|
39
|
+
codeSource='&codeSource=listTop';
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return `${basePath}/${menu.id}/${routePath}?menuId=${menu.id}${codeSource}${defaultCriteriaData}`;
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
},
|
|
18
48
|
renderL2Menu(menus:Level2Menu[],target,basePath=""){
|
|
19
49
|
return menus.map((item) => {
|
|
20
50
|
let delimiter="/";
|
|
@@ -29,8 +59,10 @@ export default {
|
|
|
29
59
|
defaultCriteriaData='&'+ Units.transQueryParamsToStr(item.defaultCriteriaValue);
|
|
30
60
|
}
|
|
31
61
|
|
|
62
|
+
let path=customPath ?`${basePath}/page-${item.id}${delimiter}${customPath}?menuId=${item.id}` :this.getRoutePath(item,basePath,defaultCriteriaData);
|
|
63
|
+
|
|
32
64
|
return <Menu.Item key={item.id}>
|
|
33
|
-
<NavLink to={
|
|
65
|
+
<NavLink to={path} target={target} >{item.title}</NavLink>
|
|
34
66
|
</Menu.Item>
|
|
35
67
|
})
|
|
36
68
|
},
|
|
@@ -3,7 +3,8 @@ import {Button, Card, Form as AntdForm, Modal} from 'antd';
|
|
|
3
3
|
import {RouterCompProps} from '../tmpl/interface';
|
|
4
4
|
import Units from "../units";
|
|
5
5
|
import DtmplEdit from "../detail/edit/dtmpl-edit";
|
|
6
|
-
import ActDtmplView from '../detail/view/act-dtmpl-view'
|
|
6
|
+
import ActDtmplView from '../detail/view/act-dtmpl-view';
|
|
7
|
+
import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
export interface DtmplRouteProps extends RouterCompProps {
|
|
@@ -11,13 +12,37 @@ export interface DtmplRouteProps extends RouterCompProps {
|
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
export interface DtmplRoutePropsStat {
|
|
14
|
-
|
|
15
|
+
codeSource:'new'|'listTop'|undefined,
|
|
16
|
+
queriedCode:string,
|
|
15
17
|
};
|
|
16
18
|
|
|
17
19
|
class DtmplRoute extends React.PureComponent<DtmplRouteProps, DtmplRoutePropsStat> {
|
|
20
|
+
state={
|
|
21
|
+
codeSource:undefined,
|
|
22
|
+
queriedCode:undefined,
|
|
23
|
+
}
|
|
18
24
|
static defaultProps={
|
|
19
25
|
basePath:"",
|
|
26
|
+
codeSource:undefined,
|
|
27
|
+
queriedCode:undefined,
|
|
20
28
|
}
|
|
29
|
+
async componentDidMount() {
|
|
30
|
+
const {location,match}=this.props;
|
|
31
|
+
const {sourceId,} = match.params;
|
|
32
|
+
let codeSource:'new'|'listTop'|undefined=this.getCodeSource();
|
|
33
|
+
let queriedCode=undefined;
|
|
34
|
+
if(codeSource && codeSource=='listTop'){
|
|
35
|
+
//查询
|
|
36
|
+
let data= await HcserviceV3.requestMstrucLtmplQueryTop(sourceId,{top:1});
|
|
37
|
+
if(data && data.entities && data.entities[0]){
|
|
38
|
+
queriedCode=data.entities[0].code;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
this.setState({
|
|
42
|
+
codeSource,queriedCode
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
|
|
21
46
|
getMenuId=()=>{
|
|
22
47
|
const {location} = this.props;
|
|
23
48
|
console.log("this.props.match.params",this.props);
|
|
@@ -26,6 +51,16 @@ class DtmplRoute extends React.PureComponent<DtmplRouteProps, DtmplRoutePropsSta
|
|
|
26
51
|
return menuId;
|
|
27
52
|
}
|
|
28
53
|
|
|
54
|
+
getCodeSource=()=>{
|
|
55
|
+
const {location}=this.props;
|
|
56
|
+
let params=Units.transQueryStrToParams(location.search);
|
|
57
|
+
if('codeSource' in params){
|
|
58
|
+
return params['codeSource'];
|
|
59
|
+
}else{
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
29
64
|
goBackToLtmpl=()=>{
|
|
30
65
|
const { sourceId,} = this.props.match.params;
|
|
31
66
|
const {basePath}=this.props;
|
|
@@ -53,6 +88,7 @@ class DtmplRoute extends React.PureComponent<DtmplRouteProps, DtmplRoutePropsSta
|
|
|
53
88
|
|
|
54
89
|
getMainCode=()=>{
|
|
55
90
|
const {location}=this.props;
|
|
91
|
+
|
|
56
92
|
let params=Units.transQueryStrToParams(location.search);
|
|
57
93
|
if('mainCode' in params){
|
|
58
94
|
return params['mainCode'];
|
|
@@ -61,10 +97,16 @@ class DtmplRoute extends React.PureComponent<DtmplRouteProps, DtmplRoutePropsSta
|
|
|
61
97
|
}
|
|
62
98
|
}
|
|
63
99
|
|
|
64
|
-
getCode=()=>{
|
|
100
|
+
getCode= ()=>{
|
|
101
|
+
const {codeSource,queriedCode}=this.state;
|
|
65
102
|
const {location}=this.props;
|
|
66
|
-
let
|
|
67
|
-
|
|
103
|
+
//let code;
|
|
104
|
+
if(codeSource=='listTop'){
|
|
105
|
+
return queriedCode;
|
|
106
|
+
}else{
|
|
107
|
+
let params=Units.transQueryStrToParams(location.search);
|
|
108
|
+
return params['code'];
|
|
109
|
+
}
|
|
68
110
|
}
|
|
69
111
|
|
|
70
112
|
getMode=()=>{
|
|
@@ -76,7 +118,8 @@ class DtmplRoute extends React.PureComponent<DtmplRouteProps, DtmplRoutePropsSta
|
|
|
76
118
|
render() {
|
|
77
119
|
const {location,match}=this.props;
|
|
78
120
|
const {sourceId,} = match.params;
|
|
79
|
-
|
|
121
|
+
const {codeSource}=this.state;
|
|
122
|
+
console.log("this.props.match.params",match);
|
|
80
123
|
if(!location){
|
|
81
124
|
return <></>;
|
|
82
125
|
}
|
|
@@ -88,7 +131,7 @@ class DtmplRoute extends React.PureComponent<DtmplRouteProps, DtmplRoutePropsSta
|
|
|
88
131
|
);
|
|
89
132
|
}else{
|
|
90
133
|
return (
|
|
91
|
-
<DtmplEdit addOrUpdate={this.getMode()} sourceId={sourceId} code={this.getCode()} mainCode={this.getMainCode()} goBackToLtmpl={this.goBackToLtmpl} goDtmpl={this.goDtmpl}></DtmplEdit>
|
|
134
|
+
<DtmplEdit addOrUpdate={this.getMode()} sourceId={sourceId} code={this.getCode()} mainCode={this.getMainCode()} goBackToLtmpl={codeSource?undefined:this.goBackToLtmpl} goDtmpl={this.goDtmpl}></DtmplEdit>
|
|
92
135
|
);
|
|
93
136
|
}
|
|
94
137
|
|
|
@@ -15,6 +15,7 @@ interface ModelSelectTableProps {
|
|
|
15
15
|
maxSelectedRows: number,
|
|
16
16
|
visible: boolean,
|
|
17
17
|
sourceId: string,
|
|
18
|
+
mainCode:string,
|
|
18
19
|
exceptCodes?: string[],
|
|
19
20
|
onCancel: () => void,
|
|
20
21
|
onOK: (selectedRows: SelectedRow[]) => void,
|
|
@@ -53,10 +54,10 @@ class ModelSelectTable extends React.PureComponent<ModelSelectTableProps, ModelS
|
|
|
53
54
|
pageSize: defaultPageSize ? defaultPageSize : 10,
|
|
54
55
|
virtualEndPageNo: undefined,
|
|
55
56
|
}
|
|
56
|
-
const {sourceId, exceptCodes} = this.props;
|
|
57
|
+
const {sourceId, exceptCodes,mainCode} = this.props;
|
|
57
58
|
/** 构建 dataSource **/
|
|
58
59
|
//构建过滤条件
|
|
59
|
-
let queryKey: QueryKey = await HcserviceV3.requestLtmplQueryKey(sourceId, {exceptCodes, ...criteriaData, ...pageInfo});
|
|
60
|
+
let queryKey: QueryKey = await HcserviceV3.requestLtmplQueryKey(sourceId, {exceptCodes, ...criteriaData, ...pageInfo,mainCode});
|
|
60
61
|
this.setState({
|
|
61
62
|
queryKey,
|
|
62
63
|
criteriaData,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {Button, Input, message, Table, Tooltip} from 'antd';
|
|
2
|
+
import {Button, Input, message, Table, Tooltip,Space,Tag,Row,Col,Form,Typography} from 'antd';
|
|
3
3
|
import {
|
|
4
4
|
AlignLeftOutlined,
|
|
5
5
|
DeleteOutlined,
|
|
@@ -20,8 +20,12 @@ import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
|
20
20
|
import CollapseCard from '../controls/collapse-card'
|
|
21
21
|
import RowEditor from '../detail/edit/row-editor'
|
|
22
22
|
import Action from "../controls/action";
|
|
23
|
-
|
|
23
|
+
import EntryControl from "../controls/entry-control";
|
|
24
|
+
import CountingTag from "../controls/counting-tag";
|
|
25
|
+
const FormItem = Form.Item
|
|
26
|
+
const { Text} = Typography;
|
|
24
27
|
interface RelationTableProps {
|
|
28
|
+
mainCode?:string,
|
|
25
29
|
parentId: string,
|
|
26
30
|
loading: boolean,
|
|
27
31
|
viewOrEdit: ViewOrEdit,
|
|
@@ -196,17 +200,7 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
196
200
|
}) : ""}
|
|
197
201
|
{/*行编辑*/}
|
|
198
202
|
{rowEdit ?
|
|
199
|
-
|
|
200
|
-
// <Tooltip placement="left" title="编辑当前行">
|
|
201
|
-
// <Button
|
|
202
|
-
// type='primary'
|
|
203
|
-
// icon={<EditOutlined/>}
|
|
204
|
-
// size="small"
|
|
205
|
-
// // onClick={() => {
|
|
206
|
-
// // this.showRowEditModel(record.code)
|
|
207
|
-
// // }}
|
|
208
|
-
// ></Button> </Tooltip></Popover>
|
|
209
|
-
<RowEditor buttonIcon={<EditOutlined/>} dtmplData={this.getRowEditData(record.code)}
|
|
203
|
+
<RowEditor buttonIcon={<EditOutlined/>} dtmplData={this.getRowEditData(record.code)}
|
|
210
204
|
fieldGroupConfig={fieldGroupConfig}
|
|
211
205
|
onOk={this.handleRowEdit}
|
|
212
206
|
tooltipTitle={"编辑当前行"}></RowEditor> : ""}
|
|
@@ -337,8 +331,6 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
337
331
|
codes.push(row.code);
|
|
338
332
|
}
|
|
339
333
|
await this.add(codes);
|
|
340
|
-
|
|
341
|
-
|
|
342
334
|
}
|
|
343
335
|
|
|
344
336
|
add = async (codes: string[]) => {
|
|
@@ -367,27 +359,6 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
367
359
|
})
|
|
368
360
|
}
|
|
369
361
|
|
|
370
|
-
// edit = async (code: string) => {
|
|
371
|
-
//
|
|
372
|
-
// }
|
|
373
|
-
|
|
374
|
-
// showRowEditModel = (code?: string) => {
|
|
375
|
-
// const {value} = this.props;
|
|
376
|
-
// let selectedDtmplData = undefined;
|
|
377
|
-
// if (code) {
|
|
378
|
-
// for (let dtmplData of value) {
|
|
379
|
-
// if (code == dtmplData.code) {
|
|
380
|
-
// selectedDtmplData = dtmplData;
|
|
381
|
-
// break;
|
|
382
|
-
// }
|
|
383
|
-
// }
|
|
384
|
-
// }
|
|
385
|
-
// this.setState({
|
|
386
|
-
// showRowEdit: true,
|
|
387
|
-
// selectedDtmplData,
|
|
388
|
-
// })
|
|
389
|
-
// }
|
|
390
|
-
|
|
391
362
|
getRowEditData = (code?: string) => {
|
|
392
363
|
const {value} = this.props;
|
|
393
364
|
let data = undefined;
|
|
@@ -483,20 +454,11 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
483
454
|
const buttonDisabled: boolean = fieldGroupConfig.max ? fieldGroupConfig.max <= (value ? value.length : 0) : false;
|
|
484
455
|
|
|
485
456
|
if (viewOrEdit == 'edit') {
|
|
486
|
-
return
|
|
457
|
+
return <Row>
|
|
458
|
+
<Col span={20}>
|
|
459
|
+
<Space>
|
|
487
460
|
{buttons.includes('rowAdd') ?
|
|
488
|
-
|
|
489
|
-
// // <Button
|
|
490
|
-
// // disabled={buttonDisabled}
|
|
491
|
-
// // type='primary'
|
|
492
|
-
// // icon={<PlusOutlined/>}
|
|
493
|
-
// // size="small"
|
|
494
|
-
// // // onClick={() => {
|
|
495
|
-
// // // this.showRowEditModel()
|
|
496
|
-
// // // }}
|
|
497
|
-
// // style={{marginBottom: 10, marginRight: 10}}
|
|
498
|
-
// // >新建一行</Button></Popover>
|
|
499
|
-
<RowEditor buttonStyle={{marginBottom: 10, marginRight: 10}} buttonTitle={"新建一行"}
|
|
461
|
+
<RowEditor disabled={buttonDisabled} buttonStyle={{marginBottom: 10}} buttonTitle={"新建一行"}
|
|
500
462
|
fieldGroupConfig={fieldGroupConfig}
|
|
501
463
|
onOk={this.handleRowEdit}
|
|
502
464
|
></RowEditor>
|
|
@@ -508,7 +470,7 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
508
470
|
icon={<PlusSquareOutlined/>}
|
|
509
471
|
size="small"
|
|
510
472
|
onClick={this.showAddDtmplModel}
|
|
511
|
-
style={{marginBottom: 10
|
|
473
|
+
style={{marginBottom: 10}}
|
|
512
474
|
>新增</Button> : ""}
|
|
513
475
|
{buttons.includes('selectAdd') ?
|
|
514
476
|
<Button
|
|
@@ -517,9 +479,18 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
517
479
|
icon={<SnippetsOutlined/>}
|
|
518
480
|
size="small"
|
|
519
481
|
onClick={this.showSelect}
|
|
520
|
-
style={{marginBottom: 10
|
|
482
|
+
style={{marginBottom: 10}}
|
|
521
483
|
>选择</Button> : ""}
|
|
522
|
-
|
|
484
|
+
<FormItem name={'$virtual'+fieldGroupConfig.id}
|
|
485
|
+
style={{ margin: 0}}
|
|
486
|
+
rules={fieldGroupConfig.min? [{
|
|
487
|
+
required: true, message: `请选择或添加${fieldGroupConfig.title}`,
|
|
488
|
+
}] :null}>
|
|
489
|
+
<CountingTag min={fieldGroupConfig.min+""} style={{marginBottom: 10}} count={value?value.length:0}></CountingTag>
|
|
490
|
+
</FormItem>
|
|
491
|
+
</Space>
|
|
492
|
+
</Col>
|
|
493
|
+
</Row>
|
|
523
494
|
} else {
|
|
524
495
|
return "";
|
|
525
496
|
}
|
|
@@ -533,7 +504,7 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
533
504
|
|
|
534
505
|
render() {
|
|
535
506
|
|
|
536
|
-
const {fieldGroupConfig, value, parentId, loading, initCollapse} = this.props;
|
|
507
|
+
const {fieldGroupConfig, value, parentId, loading, initCollapse,mainCode} = this.props;
|
|
537
508
|
const {pageSize,selectedCode, showDtmplView, showSelectTable, showDtmplEdit, tableLoading, showRowEdit, selectedDtmplData} = this.state;
|
|
538
509
|
|
|
539
510
|
const {buttons} = fieldGroupConfig;
|
|
@@ -564,12 +535,14 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
564
535
|
className={`hoverable`}
|
|
565
536
|
headStyle={{background: "#f2f4f5"}}
|
|
566
537
|
loading={loading}
|
|
538
|
+
bodyStyle={{padding:'6px'}}
|
|
567
539
|
extra={<Input.Search onSearch={this.searchValue} allowClear placeholder="关键字搜索"/>
|
|
568
540
|
}
|
|
569
541
|
>
|
|
570
542
|
<div className="editTableList">
|
|
571
543
|
{this.buildButtons()}
|
|
572
544
|
<Table scroll={{scrollToFirstRowOnChange: false}}
|
|
545
|
+
locale={{emptyText:<div style={{textAlign:'center',width:'100%'}}><Text disabled>暂无数据...</Text></div>}}
|
|
573
546
|
bordered
|
|
574
547
|
loading={tableLoading}
|
|
575
548
|
dataSource={this.buildDataSource()}
|
|
@@ -598,7 +571,7 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
598
571
|
<ModelSelectTable maxSelectedRows={fieldGroupConfig.max} visible={showSelectTable}
|
|
599
572
|
onOK={this.select} onCancel={() => {
|
|
600
573
|
this.setState({showSelectTable: false})
|
|
601
|
-
}} exceptCodes={exceptCodes}
|
|
574
|
+
}} exceptCodes={exceptCodes} mainCode={mainCode}
|
|
602
575
|
sourceId={fieldGroupConfig.id}></ModelSelectTable> : ""}
|
|
603
576
|
|
|
604
577
|
</>
|
|
@@ -10,6 +10,7 @@ import CriteriaForm from "../form/criteria-form";
|
|
|
10
10
|
import ViewControl from "../controls/view-control";
|
|
11
11
|
|
|
12
12
|
interface SelectTableProps {
|
|
13
|
+
mainCode?:string,
|
|
13
14
|
maxSelectedRows?: number,
|
|
14
15
|
sourceId: string,
|
|
15
16
|
selectedRows: SelectedRow[];
|
|
@@ -45,6 +46,7 @@ class SelectTable extends React.PureComponent<SelectTableProps, SelectTableStat>
|
|
|
45
46
|
this.setState({
|
|
46
47
|
loading: true,
|
|
47
48
|
})
|
|
49
|
+
const {mainCode}=this.props;
|
|
48
50
|
const {defaultPageSize} = selectConfig;
|
|
49
51
|
let pageInfo = {
|
|
50
52
|
pageNo: 1,
|
|
@@ -54,7 +56,7 @@ class SelectTable extends React.PureComponent<SelectTableProps, SelectTableStat>
|
|
|
54
56
|
const {sourceId} = this.props;
|
|
55
57
|
/** 构建 dataSource **/
|
|
56
58
|
//构建过滤条件
|
|
57
|
-
let queryKey: QueryKey = await HcserviceV3.requestLtmplQueryKey(sourceId, {...criteriaData, ...pageInfo});
|
|
59
|
+
let queryKey: QueryKey = await HcserviceV3.requestLtmplQueryKey(sourceId, {...criteriaData, ...pageInfo,mainCode});
|
|
58
60
|
this.setState({
|
|
59
61
|
queryKey,
|
|
60
62
|
criteriaData,
|
|
@@ -36,6 +36,7 @@ SupportInputTypes.add('select');
|
|
|
36
36
|
SupportInputTypes.add('multiselect');
|
|
37
37
|
SupportInputTypes.add('checkbox');
|
|
38
38
|
SupportInputTypes.add('radio');
|
|
39
|
+
SupportInputTypes.add('yes-no-switch');
|
|
39
40
|
SupportInputTypes.add('caselect');
|
|
40
41
|
SupportInputTypes.add('relation');
|
|
41
42
|
SupportInputTypes.add('file');
|
|
@@ -19,6 +19,7 @@ const selectConfigMap: Map<string, SelectConfig> = new Map<string, SelectConfig>
|
|
|
19
19
|
const ltmplConfigMap: Map<string, LtmplConfigRes> = new Map<string, LtmplConfigRes>();
|
|
20
20
|
const l2LtmplConfigMap: Map<string, LtmplConfigRes> = new Map<string, LtmplConfigRes>();
|
|
21
21
|
const dtmplConfigMap: Map<string, DtmplConfig> = new Map<string, DtmplConfig>();
|
|
22
|
+
const viewDtmplConfigMap: Map<string, DtmplConfig> = new Map<string, DtmplConfig>();
|
|
22
23
|
|
|
23
24
|
|
|
24
25
|
function findUnloadEnumMstrucIdOfFields(fields:FieldBase[]) {
|
|
@@ -167,11 +168,20 @@ HCDataSource.requestDtmplConfig = async function ( sourceId: string) {
|
|
|
167
168
|
if (!dtmplConfigMap.has(sourceId)) {
|
|
168
169
|
dtmplConfigMap.set(sourceId, await HcserviceV3.requestDtmplConfig(sourceId));
|
|
169
170
|
//加载枚举
|
|
170
|
-
|
|
171
|
+
await loadEnumOfDtmplConfig(dtmplConfigMap.get(sourceId));
|
|
171
172
|
}
|
|
172
173
|
return dtmplConfigMap.get(sourceId);
|
|
173
174
|
};
|
|
174
175
|
|
|
176
|
+
HCDataSource.requestViewDtmplConfig = async function ( sourceId: string) {
|
|
177
|
+
if (!viewDtmplConfigMap.has(sourceId)) {
|
|
178
|
+
viewDtmplConfigMap.set(sourceId, await HcserviceV3.requestViewDtmplConfig(sourceId));
|
|
179
|
+
//加载枚举
|
|
180
|
+
await loadEnumOfDtmplConfig(viewDtmplConfigMap.get(sourceId));
|
|
181
|
+
}
|
|
182
|
+
return viewDtmplConfigMap.get(sourceId);
|
|
183
|
+
};
|
|
184
|
+
|
|
175
185
|
HCDataSource.getEnums = function (mstrucId:string): EnumItem[] {
|
|
176
186
|
//这里是不是后续可以考虑防止串改
|
|
177
187
|
return enumMap.get(mstrucId);
|
|
@@ -268,6 +278,7 @@ HCDataSource.clearOnly =async function () {
|
|
|
268
278
|
enumMap.clear();
|
|
269
279
|
ltmplConfigMap.clear();
|
|
270
280
|
dtmplConfigMap.clear();
|
|
281
|
+
viewDtmplConfigMap.clear();
|
|
271
282
|
selectConfigMap.clear();
|
|
272
283
|
l2LtmplConfigMap.clear();
|
|
273
284
|
optionsMap.clear();
|
|
@@ -57,10 +57,6 @@ export default class HcserviceV3 {
|
|
|
57
57
|
|
|
58
58
|
static async requestDtmplConfig(sourceId:string) {
|
|
59
59
|
|
|
60
|
-
// if(sourceId=='user'){
|
|
61
|
-
// return this.requestUserDtmplConfig();
|
|
62
|
-
// }
|
|
63
|
-
|
|
64
60
|
let url = `/v3/dtmpl/config`
|
|
65
61
|
let res = await Super.super({
|
|
66
62
|
url,
|
|
@@ -70,6 +66,17 @@ export default class HcserviceV3 {
|
|
|
70
66
|
return res.dtmplConfig;
|
|
71
67
|
}
|
|
72
68
|
|
|
69
|
+
static async requestViewDtmplConfig(sourceId:string) {
|
|
70
|
+
|
|
71
|
+
let url = `/v3/view-dtmpl/config`
|
|
72
|
+
let res = await Super.super({
|
|
73
|
+
url,
|
|
74
|
+
method: "GET",
|
|
75
|
+
query:{sourceId}
|
|
76
|
+
});
|
|
77
|
+
return res.dtmplConfig;
|
|
78
|
+
}
|
|
79
|
+
|
|
73
80
|
// static async requestUserDtmplConfig() {
|
|
74
81
|
// let url = `/v3/user/dtmpl/config`
|
|
75
82
|
// let res = await Super.super({
|
|
@@ -220,6 +227,16 @@ export default class HcserviceV3 {
|
|
|
220
227
|
return await this.requestCommonDtmplData(sourceId, code,versionId,url)
|
|
221
228
|
}
|
|
222
229
|
|
|
230
|
+
static async requestViewDtmplData(sourceId, code,versionId) {
|
|
231
|
+
let url = `/v3/view-dtmpl/data`;
|
|
232
|
+
return await this.requestCommonDtmplData(sourceId, code,versionId,url)
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
static async requestMstrucViewDtmplData(sourceId, code,versionId) {
|
|
236
|
+
let url = `/v3/mstruc/view-dtmpl/data`;
|
|
237
|
+
return await this.requestCommonDtmplData(sourceId, code,versionId,url)
|
|
238
|
+
}
|
|
239
|
+
|
|
223
240
|
// static async requestUserDtmplData() {
|
|
224
241
|
// let url = `/v3/user/dtmpl/data`;
|
|
225
242
|
// let res = await Super.super({
|
|
@@ -58,7 +58,8 @@ export interface Level2Menu extends MenuBase {
|
|
|
58
58
|
customPath?: string;
|
|
59
59
|
displayTotal?: boolean;
|
|
60
60
|
count?:number;
|
|
61
|
-
defaultCriteriaValue?:object
|
|
61
|
+
defaultCriteriaValue?:object,
|
|
62
|
+
pageType:'列表'|'详情'|'编辑'|'添加'
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
export interface Level1Menu extends MenuBase {
|
|
@@ -143,6 +144,8 @@ export interface SelectConfig extends TmplBase {
|
|
|
143
144
|
columns: ColumnConfig[];
|
|
144
145
|
criterias: CriteriaConfig[];
|
|
145
146
|
defaultCriteriaValue?:object;
|
|
147
|
+
characteristicColumn:ColumnConfig;
|
|
148
|
+
primaryCriteria:CriteriaConfig;
|
|
146
149
|
}
|
|
147
150
|
|
|
148
151
|
export interface RActionConfig extends OrderableTmplBase {
|
|
@@ -248,10 +251,11 @@ export interface VControlProps extends ControlBaseProps {
|
|
|
248
251
|
export interface ControlBaseProps {
|
|
249
252
|
id?:any;
|
|
250
253
|
value?: any;
|
|
251
|
-
fieldConfig
|
|
254
|
+
fieldConfig?: FieldConfig;
|
|
252
255
|
itemType?: string;
|
|
253
256
|
style?: object;
|
|
254
257
|
disabled?: boolean;
|
|
258
|
+
mainCode?:string;
|
|
255
259
|
}
|
|
256
260
|
|
|
257
261
|
export interface SelectedRow {
|