aldehyde 0.1.33 → 0.1.36
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.js +2 -2
- package/lib/controls/entity-select/entity-select.js.map +1 -1
- package/lib/controls/entity-select/lab-tree-select.js +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/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/custom-page/custom-page-router.js +1 -1
- package/lib/custom-page/custom-page-router.js.map +1 -1
- package/lib/custom-page/{DefCustomPage.d.ts → def-custom-page.d.ts} +1 -1
- package/lib/custom-page/def-custom-page.d.ts.map +1 -0
- package/lib/custom-page/def-custom-page.js +14 -0
- package/lib/custom-page/def-custom-page.js.map +1 -0
- 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 +4 -4
- package/lib/form/form-Item-group.js.map +1 -1
- package/lib/layout/menu/menu-2layers.d.ts +0 -8
- 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/layout/sidebar/index.d.ts +1 -1
- package/lib/layout/sidebar/index.d.ts.map +1 -1
- package/lib/layout/sidebar/index.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 +20 -52
- 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 +10 -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 +2 -2
- package/src/aldehyde/controls/entity-select/lab-tree-select.tsx +1 -1
- 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/view-control.tsx +1 -0
- package/src/aldehyde/custom-page/custom-page-router.tsx +1 -1
- package/src/aldehyde/custom-page/def-custom-page.js +20 -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 +5 -4
- package/src/aldehyde/layout/menu/menu-2layers.tsx +44 -35
- package/src/aldehyde/layout/menu/menu-render.tsx +33 -1
- package/src/aldehyde/layout/sidebar/index.tsx +2 -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 +25 -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 +12 -3
- package/lib/custom-page/DefCustomPage.d.ts.map +0 -1
- package/lib/custom-page/DefCustomPage.js +0 -7
- package/lib/custom-page/DefCustomPage.js.map +0 -1
- package/src/aldehyde/custom-page/DefCustomPage.js +0 -9
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import {Menu} from 'antd';
|
|
3
|
-
import {BlockMenu} from "../../tmpl/interface";
|
|
3
|
+
import {BlockMenu,Menu2layersProps} from "../../tmpl/interface";
|
|
4
4
|
import MenuRender from './menu-render';
|
|
5
5
|
import {withRouter} from 'react-router-dom';
|
|
6
|
-
import {MenuProps} from "antd/lib/menu";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export interface Menu2layersProps extends MenuProps{
|
|
10
|
-
blockMenu: BlockMenu;
|
|
11
|
-
collapsed?: boolean;
|
|
12
|
-
currentL2MenuId?: string;
|
|
13
|
-
basePath?:string;
|
|
14
|
-
}
|
|
15
6
|
|
|
16
7
|
interface Menu2layersState {
|
|
17
8
|
openKeys: string[];
|
|
@@ -27,45 +18,63 @@ class Menu2layers extends React.PureComponent<Menu2layersProps, Menu2layersState
|
|
|
27
18
|
}
|
|
28
19
|
}
|
|
29
20
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
componentDidMount() {
|
|
22
|
+
const {currentL2MenuId, blockMenu,collapsed} = this.props;
|
|
23
|
+
const {openKeys} = this.state;
|
|
24
|
+
let openKey = blockMenu?MenuRender.findOpenId(blockMenu.l1Menus, currentL2MenuId):undefined;
|
|
25
|
+
if(openKey && openKeys.length<1){
|
|
26
|
+
this.setState({
|
|
27
|
+
openKeys:[openKey.toString()]
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
}
|
|
33
31
|
componentDidUpdate(prevProps) {
|
|
34
32
|
const {currentL2MenuId, blockMenu,collapsed} = this.props;
|
|
35
|
-
let {currentL2MenuId:preMenuId}=prevProps;
|
|
33
|
+
let {currentL2MenuId:preMenuId,blockMenu:preBlockMenu}=prevProps;
|
|
36
34
|
const {openKeys} = this.state;
|
|
37
|
-
// if(collapsed){
|
|
38
|
-
// if(openKeys.length>0){
|
|
39
|
-
// this.setState({
|
|
40
|
-
// openKeys:[]
|
|
41
|
-
// })
|
|
42
|
-
// }
|
|
43
|
-
// }else{
|
|
44
35
|
|
|
36
|
+
if(!preBlockMenu || !blockMenu || blockMenu.id!=preBlockMenu.id){
|
|
37
|
+
//console.log('currentL2MenuId:',currentL2MenuId);
|
|
45
38
|
let openKey = blockMenu?MenuRender.findOpenId(blockMenu.l1Menus, currentL2MenuId):undefined;
|
|
46
|
-
if(openKey && openKeys.length<1){
|
|
47
|
-
this.setState({
|
|
48
|
-
openKeys:[openKey.toString()]
|
|
49
|
-
})
|
|
50
|
-
}else if(preMenuId!=currentL2MenuId){
|
|
51
|
-
console.log('currentL2MenuId:',currentL2MenuId);
|
|
52
39
|
if (openKey) {
|
|
53
|
-
if(openKeys.length==1){
|
|
54
|
-
openKeys.push(openKey.toString())
|
|
55
|
-
if (openKeys && openKeys.length > 1) {
|
|
56
|
-
openKeys.splice(0, 1);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
40
|
this.setState({
|
|
60
|
-
openKeys,
|
|
41
|
+
openKeys:[openKey],
|
|
61
42
|
})
|
|
62
43
|
}
|
|
44
|
+
}else {
|
|
45
|
+
let openKey = blockMenu?MenuRender.findOpenId(blockMenu.l1Menus, currentL2MenuId):undefined;
|
|
46
|
+
let preOpenKey = blockMenu?MenuRender.findOpenId(preBlockMenu.l1Menus, preMenuId):undefined;
|
|
47
|
+
if(openKey && openKey!=preOpenKey){
|
|
48
|
+
this.setState({
|
|
49
|
+
openKeys:[openKey],
|
|
50
|
+
})
|
|
63
51
|
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// let openKey = blockMenu?MenuRender.findOpenId(blockMenu.l1Menus, currentL2MenuId):undefined;
|
|
55
|
+
// if(openKey && openKeys.length<1){
|
|
56
|
+
// this.setState({
|
|
57
|
+
// openKeys:[openKey.toString()]
|
|
58
|
+
// })
|
|
59
|
+
// }else if(preMenuId!=currentL2MenuId){
|
|
60
|
+
// console.log('currentL2MenuId:',currentL2MenuId);
|
|
61
|
+
// if (openKey) {
|
|
62
|
+
// if(openKeys.length==1){
|
|
63
|
+
// openKeys.push(openKey.toString())
|
|
64
|
+
// if (openKeys && openKeys.length > 1) {
|
|
65
|
+
// openKeys.splice(0, 1);
|
|
66
|
+
// }
|
|
67
|
+
// }
|
|
68
|
+
// this.setState({
|
|
69
|
+
// openKeys,
|
|
70
|
+
// })
|
|
71
|
+
// }
|
|
72
|
+
// }
|
|
64
73
|
//}
|
|
65
74
|
}
|
|
66
75
|
|
|
67
76
|
handleOpen = (openKeys) => {
|
|
68
|
-
if (openKeys && openKeys.length
|
|
77
|
+
if (openKeys && openKeys.length>1) {
|
|
69
78
|
openKeys.splice(0, 1);
|
|
70
79
|
}
|
|
71
80
|
this.setState({
|
|
@@ -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
|
},
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import './index.css'
|
|
3
3
|
import Units from '../../units';
|
|
4
|
-
import Menu2layers
|
|
4
|
+
import Menu2layers from "../menu/menu-2layers";
|
|
5
|
+
import {Menu2layersProps} from "../../tmpl/interface";
|
|
5
6
|
import Scrollbars from 'react-custom-scrollbars';
|
|
6
7
|
import {Image, Layout, Menu} from 'antd';
|
|
7
8
|
import logo from './logo.png';
|
|
@@ -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} from 'antd';
|
|
3
3
|
import {
|
|
4
4
|
AlignLeftOutlined,
|
|
5
5
|
DeleteOutlined,
|
|
@@ -20,8 +20,11 @@ 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
|
|
24
26
|
interface RelationTableProps {
|
|
27
|
+
mainCode?:string,
|
|
25
28
|
parentId: string,
|
|
26
29
|
loading: boolean,
|
|
27
30
|
viewOrEdit: ViewOrEdit,
|
|
@@ -196,17 +199,7 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
196
199
|
}) : ""}
|
|
197
200
|
{/*行编辑*/}
|
|
198
201
|
{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)}
|
|
202
|
+
<RowEditor buttonIcon={<EditOutlined/>} dtmplData={this.getRowEditData(record.code)}
|
|
210
203
|
fieldGroupConfig={fieldGroupConfig}
|
|
211
204
|
onOk={this.handleRowEdit}
|
|
212
205
|
tooltipTitle={"编辑当前行"}></RowEditor> : ""}
|
|
@@ -337,8 +330,6 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
337
330
|
codes.push(row.code);
|
|
338
331
|
}
|
|
339
332
|
await this.add(codes);
|
|
340
|
-
|
|
341
|
-
|
|
342
333
|
}
|
|
343
334
|
|
|
344
335
|
add = async (codes: string[]) => {
|
|
@@ -367,27 +358,6 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
367
358
|
})
|
|
368
359
|
}
|
|
369
360
|
|
|
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
361
|
getRowEditData = (code?: string) => {
|
|
392
362
|
const {value} = this.props;
|
|
393
363
|
let data = undefined;
|
|
@@ -483,20 +453,11 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
483
453
|
const buttonDisabled: boolean = fieldGroupConfig.max ? fieldGroupConfig.max <= (value ? value.length : 0) : false;
|
|
484
454
|
|
|
485
455
|
if (viewOrEdit == 'edit') {
|
|
486
|
-
return
|
|
456
|
+
return <Row>
|
|
457
|
+
<Col span={20}>
|
|
458
|
+
<Space>
|
|
487
459
|
{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={"新建一行"}
|
|
460
|
+
<RowEditor disabled={buttonDisabled} buttonStyle={{marginBottom: 10}} buttonTitle={"新建一行"}
|
|
500
461
|
fieldGroupConfig={fieldGroupConfig}
|
|
501
462
|
onOk={this.handleRowEdit}
|
|
502
463
|
></RowEditor>
|
|
@@ -508,7 +469,7 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
508
469
|
icon={<PlusSquareOutlined/>}
|
|
509
470
|
size="small"
|
|
510
471
|
onClick={this.showAddDtmplModel}
|
|
511
|
-
style={{marginBottom: 10
|
|
472
|
+
style={{marginBottom: 10}}
|
|
512
473
|
>新增</Button> : ""}
|
|
513
474
|
{buttons.includes('selectAdd') ?
|
|
514
475
|
<Button
|
|
@@ -517,9 +478,18 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
517
478
|
icon={<SnippetsOutlined/>}
|
|
518
479
|
size="small"
|
|
519
480
|
onClick={this.showSelect}
|
|
520
|
-
style={{marginBottom: 10
|
|
481
|
+
style={{marginBottom: 10}}
|
|
521
482
|
>选择</Button> : ""}
|
|
522
|
-
|
|
483
|
+
<FormItem name={'$virtual'+fieldGroupConfig.id}
|
|
484
|
+
style={{ margin: 0}}
|
|
485
|
+
rules={fieldGroupConfig.min? [{
|
|
486
|
+
required: true, message: `请选择或添加${fieldGroupConfig.title}`,
|
|
487
|
+
}] :null}>
|
|
488
|
+
<CountingTag min={fieldGroupConfig.min+""} style={{marginBottom: 10}} count={value?value.length:0}></CountingTag>
|
|
489
|
+
</FormItem>
|
|
490
|
+
</Space>
|
|
491
|
+
</Col>
|
|
492
|
+
</Row>
|
|
523
493
|
} else {
|
|
524
494
|
return "";
|
|
525
495
|
}
|
|
@@ -533,7 +503,7 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
533
503
|
|
|
534
504
|
render() {
|
|
535
505
|
|
|
536
|
-
const {fieldGroupConfig, value, parentId, loading, initCollapse} = this.props;
|
|
506
|
+
const {fieldGroupConfig, value, parentId, loading, initCollapse,mainCode} = this.props;
|
|
537
507
|
const {pageSize,selectedCode, showDtmplView, showSelectTable, showDtmplEdit, tableLoading, showRowEdit, selectedDtmplData} = this.state;
|
|
538
508
|
|
|
539
509
|
const {buttons} = fieldGroupConfig;
|
|
@@ -564,6 +534,7 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
564
534
|
className={`hoverable`}
|
|
565
535
|
headStyle={{background: "#f2f4f5"}}
|
|
566
536
|
loading={loading}
|
|
537
|
+
bodyStyle={{padding:'6px'}}
|
|
567
538
|
extra={<Input.Search onSearch={this.searchValue} allowClear placeholder="关键字搜索"/>
|
|
568
539
|
}
|
|
569
540
|
>
|
|
@@ -598,7 +569,7 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
598
569
|
<ModelSelectTable maxSelectedRows={fieldGroupConfig.max} visible={showSelectTable}
|
|
599
570
|
onOK={this.select} onCancel={() => {
|
|
600
571
|
this.setState({showSelectTable: false})
|
|
601
|
-
}} exceptCodes={exceptCodes}
|
|
572
|
+
}} exceptCodes={exceptCodes} mainCode={mainCode}
|
|
602
573
|
sourceId={fieldGroupConfig.id}></ModelSelectTable> : ""}
|
|
603
574
|
|
|
604
575
|
</>
|
|
@@ -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({
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import {MenuProps} from "antd/lib/menu";
|
|
2
|
+
|
|
1
3
|
export type ViewOrEdit = 'view' | 'edit' ;
|
|
2
4
|
|
|
3
5
|
export type AddOrUpdate = 'add' | 'update'| 'copy' ;
|
|
@@ -56,7 +58,8 @@ export interface Level2Menu extends MenuBase {
|
|
|
56
58
|
customPath?: string;
|
|
57
59
|
displayTotal?: boolean;
|
|
58
60
|
count?:number;
|
|
59
|
-
defaultCriteriaValue?:object
|
|
61
|
+
defaultCriteriaValue?:object,
|
|
62
|
+
pageType:'列表'|'详情'|'编辑'|'添加'
|
|
60
63
|
}
|
|
61
64
|
|
|
62
65
|
export interface Level1Menu extends MenuBase {
|
|
@@ -246,10 +249,11 @@ export interface VControlProps extends ControlBaseProps {
|
|
|
246
249
|
export interface ControlBaseProps {
|
|
247
250
|
id?:any;
|
|
248
251
|
value?: any;
|
|
249
|
-
fieldConfig
|
|
252
|
+
fieldConfig?: FieldConfig;
|
|
250
253
|
itemType?: string;
|
|
251
254
|
style?: object;
|
|
252
255
|
disabled?: boolean;
|
|
256
|
+
mainCode?:string;
|
|
253
257
|
}
|
|
254
258
|
|
|
255
259
|
export interface SelectedRow {
|
|
@@ -312,6 +316,11 @@ export interface FileValue {
|
|
|
312
316
|
thn?: FileLoadInfo,
|
|
313
317
|
base?: FileLoadInfo,
|
|
314
318
|
}
|
|
315
|
-
|
|
319
|
+
export interface Menu2layersProps extends MenuProps{
|
|
320
|
+
blockMenu: BlockMenu;
|
|
321
|
+
collapsed?: boolean;
|
|
322
|
+
currentL2MenuId?: string;
|
|
323
|
+
basePath?:string;
|
|
324
|
+
}
|
|
316
325
|
|
|
317
326
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefCustomPage.d.ts","sourceRoot":"","sources":["../../../../src/aldehyde/custom-page/DefCustomPage.js"],"names":[],"mappings":"AAEA;IAMopnB,wBAA8C;IAAA,sCAAyJ;IALv1nB,sBAIC;CACJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefCustomPage.js","sourceRoot":"","sources":["../../../../src/aldehyde/custom-page/DefCustomPage.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,KAAK,CAAC,SAAS;IACtD,MAAM;QACF,OAAO,CACL,8EAAkB,CACnB,CAAC;IACN,CAAC;CACJ"}
|