aldehyde 0.1.16 → 0.1.19
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 +4 -0
- package/lib/controls/action/index.d.ts.map +1 -1
- package/lib/controls/action/index.js +28 -5
- package/lib/controls/action/index.js.map +1 -1
- package/lib/controls/action/utils.js +1 -1
- package/lib/controls/action/utils.js.map +1 -1
- package/lib/controls/auto-complete/index.d.ts.map +1 -1
- package/lib/controls/auto-complete/index.js.map +1 -1
- package/lib/controls/cascader/index.d.ts +16 -7
- package/lib/controls/cascader/index.d.ts.map +1 -1
- package/lib/controls/cascader/index.js +86 -67
- package/lib/controls/cascader/index.js.map +1 -1
- package/lib/controls/cquery/cquick-button.d.ts +5 -1
- package/lib/controls/cquery/cquick-button.d.ts.map +1 -1
- package/lib/controls/cquery/cquick-button.js +13 -9
- package/lib/controls/cquery/cquick-button.js.map +1 -1
- package/lib/controls/date-picker/index.d.ts.map +1 -1
- package/lib/controls/date-picker/index.js +11 -19
- package/lib/controls/date-picker/index.js.map +1 -1
- package/lib/controls/entity-select/entity-select.d.ts.map +1 -1
- package/lib/controls/entity-select/entity-select.js +6 -4
- package/lib/controls/entity-select/entity-select.js.map +1 -1
- package/lib/controls/entity-select/lab-tree-select.d.ts +25 -0
- package/lib/controls/entity-select/lab-tree-select.d.ts.map +1 -0
- package/lib/controls/entity-select/lab-tree-select.js +121 -0
- package/lib/controls/entity-select/lab-tree-select.js.map +1 -0
- package/lib/controls/entity-select/popover-entity-select.d.ts.map +1 -1
- package/lib/controls/entity-select/popover-entity-select.js +13 -1
- package/lib/controls/entity-select/popover-entity-select.js.map +1 -1
- package/lib/controls/entry-control.d.ts.map +1 -1
- package/lib/controls/entry-control.js +21 -4
- package/lib/controls/entry-control.js.map +1 -1
- package/lib/controls/enum-tag/index.d.ts.map +1 -1
- package/lib/controls/enum-tag/index.js +7 -1
- package/lib/controls/enum-tag/index.js.map +1 -1
- package/lib/controls/input-number/index.js +7 -7
- package/lib/controls/input-number/index.js.map +1 -1
- package/lib/controls/view-control.d.ts.map +1 -1
- package/lib/controls/view-control.js +7 -2
- package/lib/controls/view-control.js.map +1 -1
- package/lib/detail/button/submit-button-bar.d.ts.map +1 -1
- package/lib/detail/button/submit-button-bar.js +8 -2
- package/lib/detail/button/submit-button-bar.js.map +1 -1
- package/lib/detail/edit/{modal-dtmpl-edit.d.ts → dtmpl-edit-page.d.ts} +8 -4
- package/lib/detail/edit/dtmpl-edit-page.d.ts.map +1 -0
- package/lib/detail/edit/{modal-dtmpl-edit.js → dtmpl-edit-page.js} +19 -10
- package/lib/detail/edit/dtmpl-edit-page.js.map +1 -0
- package/lib/detail/edit/dtmpl-edit.d.ts +2 -2
- package/lib/detail/edit/dtmpl-edit.d.ts.map +1 -1
- package/lib/form/criteria-form.js.map +1 -1
- package/lib/form/dtmpl-form.d.ts +4 -0
- package/lib/form/dtmpl-form.d.ts.map +1 -1
- package/lib/form/dtmpl-form.js +7 -4
- package/lib/form/dtmpl-form.js.map +1 -1
- package/lib/form/form-Item-group.d.ts +2 -0
- package/lib/form/form-Item-group.d.ts.map +1 -1
- package/lib/form/form-Item-group.js +5 -1
- package/lib/form/form-Item-group.js.map +1 -1
- package/lib/icon/index.d.ts +11 -0
- package/lib/icon/index.d.ts.map +1 -0
- package/lib/icon/index.js +22 -0
- package/lib/icon/index.js.map +1 -0
- package/lib/index.d.ts +5 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -3
- package/lib/index.js.map +1 -1
- package/lib/layout/menu/userinfo-bar.js +2 -2
- package/lib/layout/menu/userinfo-bar.js.map +1 -1
- package/lib/module/{dtmpl-page.d.ts → dtmpl-view-page.d.ts} +5 -5
- package/lib/module/dtmpl-view-page.d.ts.map +1 -0
- package/lib/module/{dtmpl-page.js → dtmpl-view-page.js} +5 -5
- package/lib/module/dtmpl-view-page.js.map +1 -0
- package/lib/module/ltmpl-page.js +2 -2
- package/lib/module/ltmpl-page.js.map +1 -1
- package/lib/table/act-table.js +3 -3
- package/lib/table/act-table.js.map +1 -1
- package/lib/table/column/column-selector.d.ts +0 -1
- package/lib/table/column/column-selector.d.ts.map +1 -1
- package/lib/table/column/column-selector.js +0 -1
- package/lib/table/column/column-selector.js.map +1 -1
- package/lib/table/index.css +1 -1
- package/lib/table/relation-table.d.ts +3 -1
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/table/relation-table.js +11 -5
- package/lib/table/relation-table.js.map +1 -1
- package/lib/tmpl/control-type-supportor.d.ts.map +1 -1
- package/lib/tmpl/control-type-supportor.js +8 -1
- 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 +54 -3
- package/lib/tmpl/hc-data-source.js.map +1 -1
- package/lib/tmpl/hcservice-v3.d.ts +3 -1
- package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
- package/lib/tmpl/hcservice-v3.js +28 -0
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/tmpl/interface.d.ts +9 -3
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/lib/tmpl/tmpl-config-analysis.js +2 -2
- package/lib/tmpl/tmpl-config-analysis.js.map +1 -1
- package/lib/units/index.d.ts +5 -1
- package/lib/units/index.d.ts.map +1 -1
- package/lib/units/index.js +18 -0
- package/lib/units/index.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/action/index.tsx +24 -6
- package/src/aldehyde/controls/action/utils.tsx +1 -1
- package/src/aldehyde/controls/auto-complete/index.tsx +0 -1
- package/src/aldehyde/controls/cascader/index.tsx +114 -0
- package/src/aldehyde/controls/cquery/cquick-button.tsx +13 -12
- package/src/aldehyde/controls/date-picker/index.tsx +15 -18
- package/src/aldehyde/controls/entity-select/entity-select.tsx +6 -4
- package/src/aldehyde/controls/entity-select/lab-tree-select.tsx +148 -0
- package/src/aldehyde/controls/entity-select/popover-entity-select.tsx +13 -1
- package/src/aldehyde/controls/entry-control.tsx +22 -5
- package/src/aldehyde/controls/enum-tag/index.tsx +8 -2
- package/src/aldehyde/controls/input-number/index.tsx +7 -7
- package/src/aldehyde/controls/view-control.tsx +7 -3
- package/src/aldehyde/detail/button/submit-button-bar.tsx +6 -3
- package/src/aldehyde/detail/edit/{modal-dtmpl-edit.tsx → dtmpl-edit-page.tsx} +36 -13
- package/src/aldehyde/detail/edit/dtmpl-edit.tsx +2 -2
- package/src/aldehyde/form/criteria-form.tsx +1 -1
- package/src/aldehyde/form/dtmpl-form.tsx +8 -4
- package/src/aldehyde/form/form-Item-group.tsx +6 -1
- package/src/aldehyde/icon/index.tsx +30 -0
- package/src/aldehyde/index.tsx +6 -4
- package/src/aldehyde/layout/menu/userinfo-bar.tsx +2 -2
- package/src/aldehyde/module/{dtmpl-page.tsx → dtmpl-view-page.tsx} +9 -16
- package/src/aldehyde/module/ltmpl-page.tsx +5 -5
- package/src/aldehyde/table/act-table.tsx +3 -3
- package/src/aldehyde/table/column/column-selector.tsx +0 -1
- package/src/aldehyde/table/index.css +1 -1
- package/src/aldehyde/table/relation-table.tsx +17 -8
- package/src/aldehyde/tmpl/control-type-supportor.tsx +7 -1
- package/src/aldehyde/tmpl/hc-data-source.tsx +59 -6
- package/src/aldehyde/tmpl/hcservice-v3.tsx +30 -1
- package/src/aldehyde/tmpl/interface.tsx +10 -4
- package/src/aldehyde/tmpl/tmpl-config-analysis.tsx +2 -2
- package/src/aldehyde/units/index.tsx +26 -2
- package/lib/detail/edit/modal-dtmpl-edit.d.ts.map +0 -1
- package/lib/detail/edit/modal-dtmpl-edit.js.map +0 -1
- package/lib/module/dtmpl-page.d.ts.map +0 -1
- package/lib/module/dtmpl-page.js.map +0 -1
- package/src/aldehyde/controls/cascader/index.js +0 -97
|
@@ -12,8 +12,8 @@ import HcserviceV3 from "../../tmpl/hcservice-v3";
|
|
|
12
12
|
import CqueryButtonBar from "../button/cquery-button-bar"
|
|
13
13
|
|
|
14
14
|
interface DtmplEditProps extends DtmplBaseProps {
|
|
15
|
-
goBackToLtmpl
|
|
16
|
-
addOrUpdate
|
|
15
|
+
goBackToLtmpl?: () => void,
|
|
16
|
+
addOrUpdate?:AddOrUpdate,
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
interface DtmplEditState {
|
|
@@ -68,7 +68,7 @@ const CriteriaForm: React.FC<CriteriaFormProps> = (props) => {
|
|
|
68
68
|
// <Button type="primary" key={action.id}
|
|
69
69
|
// disabled={disabled}>{action.title}</Button>
|
|
70
70
|
// </Popconfirm>;
|
|
71
|
-
return <Action
|
|
71
|
+
return <Action hiddenType={"disabled"} key={action.id} disabled={disabled} data={selectedDatas} actionConfig={action} doAction={doAction} serial={1} ></Action>
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -18,6 +18,7 @@ export interface DtmplFormProps extends DtmplBaseProps {
|
|
|
18
18
|
showConfirm: boolean,
|
|
19
19
|
onFinish: (code:string) => void,
|
|
20
20
|
onValuesChange?:()=>void,
|
|
21
|
+
maxColsOnRow?:number,// 2
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
interface DtmplFormStat {
|
|
@@ -37,6 +38,9 @@ export default class Form extends React.PureComponent<DtmplFormProps, DtmplFormS
|
|
|
37
38
|
dtmplData: undefined,
|
|
38
39
|
// changedGroupData:new Map<number,DtmplData[]>()
|
|
39
40
|
}
|
|
41
|
+
static defaultPorps={
|
|
42
|
+
maxCols:2,
|
|
43
|
+
}
|
|
40
44
|
|
|
41
45
|
async componentDidMount() {
|
|
42
46
|
await this.loadData();
|
|
@@ -140,11 +144,11 @@ export default class Form extends React.PureComponent<DtmplFormProps, DtmplFormS
|
|
|
140
144
|
if (ds) {
|
|
141
145
|
ds.forEach((d, index) => {
|
|
142
146
|
values[`${group.id}[${index}].$$relation$$`] = d.relationLabel;
|
|
143
|
-
if (d.editStatus
|
|
147
|
+
if (d.editStatus && d.editStatus=='new') {
|
|
144
148
|
for (let field of group.fields) {
|
|
145
149
|
values[`${group.id}[${index}].${field.id}`] = d.fieldMap[field.id];
|
|
146
150
|
}
|
|
147
|
-
} else if(d.editStatus
|
|
151
|
+
} else if(d.editStatus && d.editStatus=='changed'){
|
|
148
152
|
values[`${group.id}[${index}].唯一编码`] = d.code;
|
|
149
153
|
for (let field of group.fields) {
|
|
150
154
|
values[`${group.id}[${index}].${field.id}`] = d.fieldMap[field.id];
|
|
@@ -175,7 +179,7 @@ export default class Form extends React.PureComponent<DtmplFormProps, DtmplFormS
|
|
|
175
179
|
|
|
176
180
|
fieldGroupList = () => {
|
|
177
181
|
|
|
178
|
-
const {dtmplConfig,parentId} = this.props;
|
|
182
|
+
const {dtmplConfig,parentId,maxColsOnRow} = this.props;
|
|
179
183
|
const {dtmplData, loading} = this.state;
|
|
180
184
|
|
|
181
185
|
let groups: FieldGroupConfig[];
|
|
@@ -202,7 +206,7 @@ export default class Form extends React.PureComponent<DtmplFormProps, DtmplFormS
|
|
|
202
206
|
headStyle={{background: "#f2f4f5"}}
|
|
203
207
|
loading={loading}
|
|
204
208
|
>
|
|
205
|
-
<FormItemGroup
|
|
209
|
+
<FormItemGroup maxColsOnRow={maxColsOnRow} fields={item?item.fields:undefined} valueMap={dtmplData ? dtmplData.fieldMap : undefined}
|
|
206
210
|
></FormItemGroup>
|
|
207
211
|
</CollapseCard>
|
|
208
212
|
}
|
|
@@ -14,6 +14,7 @@ export interface FieldGroupProps {
|
|
|
14
14
|
nameAttr?:string,
|
|
15
15
|
valueMap: object,
|
|
16
16
|
width?: number,
|
|
17
|
+
maxColsOnRow?:number,
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
interface FieldGroupState {
|
|
@@ -24,6 +25,7 @@ export default class FormItemGroup extends React.PureComponent<FieldGroupProps,
|
|
|
24
25
|
|
|
25
26
|
static defaultProps={
|
|
26
27
|
nameAttr:'id',
|
|
28
|
+
maxColsOnRow:2,
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
constructor(props) {
|
|
@@ -34,7 +36,7 @@ export default class FormItemGroup extends React.PureComponent<FieldGroupProps,
|
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
initFormList = () => {
|
|
37
|
-
const {fields, valueMap,nameAttr} = this.props
|
|
39
|
+
const {fields, valueMap,nameAttr,maxColsOnRow} = this.props
|
|
38
40
|
const formItemList = [];
|
|
39
41
|
|
|
40
42
|
if ( fields && fields.length > 0) {
|
|
@@ -75,8 +77,11 @@ export default class FormItemGroup extends React.PureComponent<FieldGroupProps,
|
|
|
75
77
|
|
|
76
78
|
for (let i = 0; i < formItemList.length; i = i + 1) {
|
|
77
79
|
let colNum = fields[i].colNum;
|
|
80
|
+
|
|
78
81
|
if(fields[i].extControlType=='hidden'){
|
|
79
82
|
colNum=0;
|
|
83
|
+
}else if(maxColsOnRow && maxColsOnRow==1){
|
|
84
|
+
colNum=2;
|
|
80
85
|
}
|
|
81
86
|
let col = <Col key={i} span={12 * colNum}>
|
|
82
87
|
{formItemList[i]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {FileDoneOutlined,CheckOutlined,CloseCircleOutlined,FileAddOutlined,ThunderboltOutlined} from '@ant-design/icons';
|
|
3
|
+
|
|
4
|
+
interface IconProps{
|
|
5
|
+
type:string,
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface IconStat {
|
|
9
|
+
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const iconMap={
|
|
13
|
+
FileDoneOutlined:FileDoneOutlined,
|
|
14
|
+
CheckOutlined:CheckOutlined,
|
|
15
|
+
CloseCircleOutlined:CloseCircleOutlined,
|
|
16
|
+
FileAddOutlined:FileAddOutlined,
|
|
17
|
+
ThunderboltOutlined:ThunderboltOutlined,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default class Icon extends React.PureComponent<IconProps, IconStat>{
|
|
21
|
+
render(){
|
|
22
|
+
const {type}=this.props;
|
|
23
|
+
if(iconMap[type]){
|
|
24
|
+
return React.createElement(iconMap[type]);
|
|
25
|
+
}else{
|
|
26
|
+
return <ThunderboltOutlined />
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
}
|
package/src/aldehyde/index.tsx
CHANGED
|
@@ -4,7 +4,8 @@ import Loginit from './login/login';
|
|
|
4
4
|
import DtmplRoute from './routable/dtmpl-route';
|
|
5
5
|
import ImportRoute from './routable/import-route';
|
|
6
6
|
import LtmplRoute from "./routable/ltmpl-route";
|
|
7
|
-
import
|
|
7
|
+
import DtmplViewPage from './module/dtmpl-view-page';
|
|
8
|
+
import DtmplEdit from './detail/edit/dtmpl-edit';
|
|
8
9
|
import LtmplPage from './module/ltmpl-page';
|
|
9
10
|
import Menu2layers from './layout/menu/menu-2layers';
|
|
10
11
|
import Block from './layout/menu/block';
|
|
@@ -19,11 +20,12 @@ import QuickEntrance from './welcome/quick-entrance'
|
|
|
19
20
|
import Workbench from './welcome/workbench';
|
|
20
21
|
import PopoverEntitySelect from "./controls/entity-select/popover-entity-select";
|
|
21
22
|
import DatePicker from "./controls/date-picker";
|
|
22
|
-
import
|
|
23
|
+
import DtmplEditPage from "./detail/edit/dtmpl-edit-page";
|
|
23
24
|
import TmplDataSource from './tmpl/hc-data-source';
|
|
24
25
|
import * as TmplInterface from './tmpl/interface';
|
|
26
|
+
import Superagent from './tmpl/superagent';
|
|
25
27
|
|
|
26
|
-
export {ActTable,SelectTable,Loginit,DtmplRoute,ImportRoute,LtmplRoute,
|
|
28
|
+
export {ActTable,SelectTable,Loginit,DtmplRoute,ImportRoute,LtmplRoute,DtmplViewPage,LtmplPage,Menu2layers,Block,UserBar,
|
|
27
29
|
ResetPassword,Footer,EntryControl,ViewControl,ProgramConfig,HydrocarbonService,QuickEntrance,Workbench,PopoverEntitySelect
|
|
28
|
-
,DatePicker,
|
|
30
|
+
,DatePicker,DtmplEditPage,TmplInterface,TmplDataSource,Superagent,DtmplEdit}
|
|
29
31
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { Drawer, Space,Button} from 'antd'
|
|
3
3
|
import {SolutionOutlined} from '@ant-design/icons';
|
|
4
|
-
import
|
|
4
|
+
import DtmplViewPage from "../../module/dtmpl-view-page";
|
|
5
5
|
|
|
6
6
|
interface UserInfoBarProps {
|
|
7
7
|
|
|
@@ -54,7 +54,7 @@ class UserInfoBar extends React.PureComponent<UserInfoBarProps, UserInfoBarState
|
|
|
54
54
|
</Space>
|
|
55
55
|
}
|
|
56
56
|
>
|
|
57
|
-
<
|
|
57
|
+
<DtmplViewPage sourceId={'0'} code={"userCode"}></DtmplViewPage>
|
|
58
58
|
</Drawer>
|
|
59
59
|
</>
|
|
60
60
|
);
|
|
@@ -1,27 +1,20 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import
|
|
3
|
-
import Units from "../units";
|
|
4
|
-
import ActTable from '../table/act-table'
|
|
5
|
-
// import StatActTable from '../table/stat-act-table'
|
|
6
|
-
import HCDataSource from "../tmpl/hc-data-source";
|
|
7
|
-
import ModalDtmplView from "../detail/view/modal-dtmpl-view";
|
|
8
|
-
import ModalDtmplEdit from "../detail/edit/modal-dtmpl-edit";
|
|
9
|
-
import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
2
|
+
import DtmplEditPage from "../detail/edit/dtmpl-edit-page";
|
|
10
3
|
import ActDtmplView from "../detail/view/act-dtmpl-view";
|
|
11
4
|
|
|
12
5
|
//以列表为入口的,页面内列表,基本原则是所有交互在页面内完成,不会触发路由。
|
|
13
6
|
|
|
14
|
-
export interface
|
|
7
|
+
export interface DtmplViewPageProps {
|
|
15
8
|
sourceId?:string,
|
|
16
9
|
code?:string;
|
|
17
10
|
mainCode?:string;
|
|
18
11
|
};
|
|
19
12
|
|
|
20
|
-
export interface
|
|
13
|
+
export interface DtmplViewPageState {
|
|
21
14
|
showDtmplEdit:boolean;
|
|
22
15
|
};
|
|
23
16
|
|
|
24
|
-
class
|
|
17
|
+
class DtmplViewPage extends React.PureComponent<DtmplViewPageProps, DtmplViewPageState> {
|
|
25
18
|
|
|
26
19
|
state = {
|
|
27
20
|
showDtmplEdit:false,
|
|
@@ -55,16 +48,16 @@ class DtmplPage extends React.PureComponent<DtmplPageProps, DtmplPageState> {
|
|
|
55
48
|
const { sourceId,code,mainCode} = this.props;
|
|
56
49
|
return <>
|
|
57
50
|
<ActDtmplView goDtmpl={this.goDtmpl} sourceId={sourceId} code={code} mainCode={mainCode}></ActDtmplView>
|
|
58
|
-
<
|
|
51
|
+
<DtmplEditPage visible={showDtmplEdit} onCancel={()=>{
|
|
59
52
|
this.setState({
|
|
60
53
|
showDtmplEdit:false,
|
|
61
54
|
})}}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
55
|
+
sourceId={sourceId}
|
|
56
|
+
code={code}
|
|
57
|
+
onOk={this.handleDtmplEdit} />
|
|
65
58
|
</>
|
|
66
59
|
}
|
|
67
60
|
}
|
|
68
61
|
|
|
69
|
-
export default
|
|
62
|
+
export default DtmplViewPage;
|
|
70
63
|
|
|
@@ -5,7 +5,7 @@ import ActTable from '../table/act-table'
|
|
|
5
5
|
// import StatActTable from '../table/stat-act-table'
|
|
6
6
|
import HCDataSource from "../tmpl/hc-data-source";
|
|
7
7
|
import ModalDtmplView from "../detail/view/modal-dtmpl-view";
|
|
8
|
-
import
|
|
8
|
+
import DtmplEditPage from "../detail/edit/dtmpl-edit-page";
|
|
9
9
|
import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
10
10
|
|
|
11
11
|
//以列表为入口的,页面内列表,基本原则是所有交互在页面内完成,不会触发路由。
|
|
@@ -163,13 +163,13 @@ class LtmplPage extends React.PureComponent<LtmplPageProps, LtmplPageState> {
|
|
|
163
163
|
sourceId={sourceId}
|
|
164
164
|
code={selectedCode}> </ModalDtmplView> : ""}
|
|
165
165
|
{buttons.includes('dtmplEdit') || buttons.includes('dtmplAdd') ?
|
|
166
|
-
<
|
|
166
|
+
<DtmplEditPage visible={showDtmplEdit} onCancel={()=>{
|
|
167
167
|
this.setState({
|
|
168
168
|
showDtmplEdit:false,
|
|
169
169
|
})}}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
sourceId={sourceId}
|
|
171
|
+
code={selectedCode}
|
|
172
|
+
onOk={this.handleDtmplEdit} />
|
|
173
173
|
: ""}
|
|
174
174
|
</>
|
|
175
175
|
}
|
|
@@ -273,7 +273,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
273
273
|
}) : ""}
|
|
274
274
|
{ltmplConfig.rowActions && ltmplConfig.rowActions.length > 0 ?
|
|
275
275
|
ltmplConfig.rowActions.map((action) => {
|
|
276
|
-
return <Action key={action.id} data={[record]} actionConfig={action} doAction={this.doRowAction} buttonSize={'small'} serial={1}></Action>
|
|
276
|
+
return <Action iconType={'icon'} key={action.id} data={[record]} actionConfig={action} doAction={this.doRowAction} buttonSize={'small'} serial={1}></Action>
|
|
277
277
|
}) : ""}
|
|
278
278
|
{ltmplConfig.jumps && ltmplConfig.jumps.length > 0 ?
|
|
279
279
|
ltmplConfig.jumps.map((jump) => {
|
|
@@ -287,9 +287,9 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
287
287
|
// onClick={() => this.doRowCQuery(cQuery.id, record.code)}
|
|
288
288
|
// >{cQuery.title}</Button>;
|
|
289
289
|
console.log("record record",record);
|
|
290
|
-
return <CquickButton key={cquery.id} size={"small"}
|
|
290
|
+
return <CquickButton key={cquery.id} size={"small"} pageType={'drawer'}
|
|
291
291
|
// onClick={() => doCQuery(cquery.id)}
|
|
292
|
-
|
|
292
|
+
cQueryConfig={cquery} mainCode={cquery.mainCodeColId?record[cquery.mainCodeColId]:record.code}/>
|
|
293
293
|
}) : ""}
|
|
294
294
|
</Space>);
|
|
295
295
|
} else {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import {Checkbox, Col, Row} from "antd";
|
|
3
3
|
import {ColumnConfig,} from "../../tmpl/interface";
|
|
4
|
-
import '../pagination.css';
|
|
5
4
|
import {MenuOutlined} from '@ant-design/icons';
|
|
6
5
|
import {SortableContainer, SortableElement, SortableHandle} from 'react-sortable-hoc';
|
|
7
6
|
import {arrayMoveImmutable} from 'array-move';
|
|
@@ -14,7 +14,7 @@ import SupportInputTypes from '../tmpl/control-type-supportor';
|
|
|
14
14
|
import TableUnits from "./table-util";
|
|
15
15
|
import ViewControl from "../controls/view-control";
|
|
16
16
|
import ModalDtmplView from '../detail/view/modal-dtmpl-view';
|
|
17
|
-
import
|
|
17
|
+
import DtmplEditPage from '../detail/edit/dtmpl-edit-page'
|
|
18
18
|
import ModelSelectTable from './modal-select-table';
|
|
19
19
|
import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
20
20
|
import CollapseCard from '../controls/collapse-card'
|
|
@@ -41,6 +41,7 @@ interface RelationTableStat {
|
|
|
41
41
|
showRowEdit: boolean,
|
|
42
42
|
selectedDtmplData: DtmplData,
|
|
43
43
|
filterStr: string,
|
|
44
|
+
pageSize:number,
|
|
44
45
|
};
|
|
45
46
|
|
|
46
47
|
|
|
@@ -55,6 +56,7 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
55
56
|
showRowEdit: false,
|
|
56
57
|
selectedDtmplData: undefined,
|
|
57
58
|
filterStr: undefined,
|
|
59
|
+
pageSize:10,
|
|
58
60
|
// columns:[],
|
|
59
61
|
// dataSource:[],
|
|
60
62
|
// current:1,
|
|
@@ -306,7 +308,11 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
306
308
|
})
|
|
307
309
|
}
|
|
308
310
|
|
|
309
|
-
tabChange = () => {
|
|
311
|
+
tabChange = (pagination) => {
|
|
312
|
+
console.log('pagination',pagination);
|
|
313
|
+
this.setState({
|
|
314
|
+
pageSize:pagination.pageSize,
|
|
315
|
+
})
|
|
310
316
|
|
|
311
317
|
}
|
|
312
318
|
|
|
@@ -446,6 +452,9 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
446
452
|
datas.unshift(dtmplData);
|
|
447
453
|
}
|
|
448
454
|
onChange(fieldGroupConfig, datas);
|
|
455
|
+
|
|
456
|
+
console.log("handleRowEdit data:",datas);
|
|
457
|
+
|
|
449
458
|
if (isAdd) {
|
|
450
459
|
message.success('已添加');
|
|
451
460
|
} else {
|
|
@@ -525,11 +534,11 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
525
534
|
render() {
|
|
526
535
|
|
|
527
536
|
const {fieldGroupConfig, value, parentId, loading, initCollapse} = this.props;
|
|
528
|
-
const {selectedCode, showDtmplView, showSelectTable, showDtmplEdit, tableLoading, showRowEdit, selectedDtmplData} = this.state;
|
|
537
|
+
const {pageSize,selectedCode, showDtmplView, showSelectTable, showDtmplEdit, tableLoading, showRowEdit, selectedDtmplData} = this.state;
|
|
529
538
|
|
|
530
539
|
const {buttons} = fieldGroupConfig;
|
|
531
540
|
let page = {
|
|
532
|
-
pageSize:
|
|
541
|
+
pageSize: pageSize,
|
|
533
542
|
hideOnSinglePage: true,
|
|
534
543
|
defaultCurrent: 1,
|
|
535
544
|
total: value ? value.length : undefined,
|
|
@@ -575,10 +584,10 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
575
584
|
sourceId={fieldGroupConfig.id}
|
|
576
585
|
code={selectedCode}> </ModalDtmplView> : ""}
|
|
577
586
|
{buttons.includes('dtmplEdit') || buttons.includes('dtmplAdd') ?
|
|
578
|
-
<
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
587
|
+
<DtmplEditPage visible={showDtmplEdit} onCancel={this.hiddenEntityEdit}
|
|
588
|
+
sourceId={fieldGroupConfig.id}
|
|
589
|
+
code={selectedCode}
|
|
590
|
+
onOk={selectedCode ? this.handleDtmplEdit : this.handleDtmplAdd} />
|
|
582
591
|
: ""}
|
|
583
592
|
{/*{buttons.includes('rowEdit') || buttons.includes('rowAdd') ?*/}
|
|
584
593
|
{/* <ModalRowEdit visible={showRowEdit} onCancel={this.hiddenRowEdit}*/}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {ColumnConfig, EnumItem, FieldBase, FieldConfig} from "./interface";
|
|
2
2
|
import HCDataSource from "./hc-data-source";
|
|
3
|
+
import {ProgramConfig} from "../index";
|
|
3
4
|
|
|
4
5
|
const SupportInputTypes:Set<string>=new Set<string>();
|
|
5
6
|
SupportInputTypes.add('date-YY');
|
|
@@ -61,12 +62,17 @@ SupportInputTypes.add('modal-entity-select');
|
|
|
61
62
|
SupportInputTypes.add('color');
|
|
62
63
|
|
|
63
64
|
SupportInputTypes.add('hidden');
|
|
65
|
+
SupportInputTypes.add('lab-tree-select');
|
|
64
66
|
function ControlTypeSupportor(){
|
|
65
67
|
|
|
66
68
|
}
|
|
67
69
|
ControlTypeSupportor.isSupport=function(type:string):boolean {
|
|
68
70
|
if(type){
|
|
69
|
-
|
|
71
|
+
if(ProgramConfig.getCustomViewControl(type)){
|
|
72
|
+
return true;
|
|
73
|
+
}else{
|
|
74
|
+
return SupportInputTypes.has(type);
|
|
75
|
+
}
|
|
70
76
|
}else{
|
|
71
77
|
return false;
|
|
72
78
|
}
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
BlockMenu,
|
|
3
3
|
DtmplConfig,
|
|
4
4
|
EnumItem,
|
|
5
|
-
FieldBase, LtmplConfigRes,
|
|
6
|
-
SelectConfig, Level2Menu
|
|
5
|
+
FieldBase, LtmplConfigRes,ActionConfig,
|
|
6
|
+
SelectConfig, Level2Menu,LtmplConfig
|
|
7
7
|
} from "./interface";
|
|
8
8
|
import HcserviceV3 from './hcservice-v3';
|
|
9
9
|
import ControlTypeSupportor from './control-type-supportor'
|
|
@@ -13,7 +13,8 @@ const blocksCache: BlockMenu[] = [];
|
|
|
13
13
|
const quickEntranceCache: Level2Menu[] = [];
|
|
14
14
|
const messageCache: Level2Menu[] = [];
|
|
15
15
|
const workbenchCache: Level2Menu[] = [];
|
|
16
|
-
const enumMap: Map<string, EnumItem[]> = new Map<string, EnumItem[]>()
|
|
16
|
+
const enumMap: Map<string, EnumItem[]> = new Map<string, EnumItem[]>();//key mstrucId
|
|
17
|
+
const optionsMap: Map<string, EnumItem[]> = new Map<string, EnumItem[]>();//key mstrucId
|
|
17
18
|
const selectConfigMap: Map<string, SelectConfig> = new Map<string, SelectConfig>();
|
|
18
19
|
const ltmplConfigMap: Map<string, LtmplConfigRes> = new Map<string, LtmplConfigRes>();
|
|
19
20
|
const l2LtmplConfigMap: Map<string, LtmplConfigRes> = new Map<string, LtmplConfigRes>();
|
|
@@ -35,6 +36,19 @@ function findUnloadEnumMstrucIdOfFields(fields:FieldBase[]) {
|
|
|
35
36
|
return mstrucIdArray;
|
|
36
37
|
}
|
|
37
38
|
|
|
39
|
+
function findUnloadEnumMstrucIdOfActions(actions:ActionConfig[]) {
|
|
40
|
+
const mstrucIds = [];
|
|
41
|
+
if (actions) {
|
|
42
|
+
actions.forEach((item) => {
|
|
43
|
+
let subs= findUnloadEnumMstrucIdOfFields(item.writes);
|
|
44
|
+
concat(mstrucIds,subs);
|
|
45
|
+
subs= findUnloadEnumMstrucIdOfFields(item.preposes);
|
|
46
|
+
concat(mstrucIds,subs);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return mstrucIds;
|
|
50
|
+
}
|
|
51
|
+
|
|
38
52
|
async function loadEnumOfDtmplConfig(selectConfig:DtmplConfig){
|
|
39
53
|
const mstrucIds = [];
|
|
40
54
|
if(selectConfig.groups){
|
|
@@ -43,6 +57,8 @@ async function loadEnumOfDtmplConfig(selectConfig:DtmplConfig){
|
|
|
43
57
|
concat(mstrucIds,subs);
|
|
44
58
|
})
|
|
45
59
|
}
|
|
60
|
+
let subs= findUnloadEnumMstrucIdOfActions(selectConfig.actions);
|
|
61
|
+
concat(mstrucIds,subs);
|
|
46
62
|
await loadEnum(mstrucIds);
|
|
47
63
|
}
|
|
48
64
|
|
|
@@ -57,12 +73,29 @@ function concat(mstrucIds,sub){
|
|
|
57
73
|
return mstrucIds;
|
|
58
74
|
}
|
|
59
75
|
|
|
60
|
-
async function loadEnumOfSelectConfig(selectConfig:SelectConfig){
|
|
76
|
+
async function loadEnumOfSelectConfig(selectConfig:SelectConfig ){
|
|
77
|
+
const mstrucIds = [];
|
|
78
|
+
let subs= findUnloadEnumMstrucIdOfFields(selectConfig.columns);
|
|
79
|
+
concat(mstrucIds,subs);
|
|
80
|
+
subs= findUnloadEnumMstrucIdOfFields(selectConfig.criterias);
|
|
81
|
+
concat(mstrucIds,subs);
|
|
82
|
+
await loadEnum(mstrucIds);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
async function loadEnumOfLtmplConfig(selectConfig: LtmplConfig ){
|
|
61
86
|
const mstrucIds = [];
|
|
62
87
|
let subs= findUnloadEnumMstrucIdOfFields(selectConfig.columns);
|
|
63
88
|
concat(mstrucIds,subs);
|
|
64
89
|
subs= findUnloadEnumMstrucIdOfFields(selectConfig.criterias);
|
|
65
90
|
concat(mstrucIds,subs);
|
|
91
|
+
subs= findUnloadEnumMstrucIdOfFields(selectConfig.drillingParams);
|
|
92
|
+
concat(mstrucIds,subs);
|
|
93
|
+
subs= findUnloadEnumMstrucIdOfFields(selectConfig.reStatParams);
|
|
94
|
+
concat(mstrucIds,subs);
|
|
95
|
+
subs= findUnloadEnumMstrucIdOfActions(selectConfig.actions);
|
|
96
|
+
concat(mstrucIds,subs);
|
|
97
|
+
subs= findUnloadEnumMstrucIdOfActions(selectConfig.rowActions);
|
|
98
|
+
concat(mstrucIds,subs);
|
|
66
99
|
await loadEnum(mstrucIds);
|
|
67
100
|
}
|
|
68
101
|
async function loadEnum(mstrucIds:string[]){
|
|
@@ -79,16 +112,35 @@ async function loadEnum(mstrucIds:string[]){
|
|
|
79
112
|
}
|
|
80
113
|
|
|
81
114
|
|
|
115
|
+
|
|
116
|
+
|
|
82
117
|
function HCDataSource() {
|
|
83
118
|
|
|
84
119
|
}
|
|
85
120
|
|
|
121
|
+
HCDataSource.getOptions = async function (mstrucId:string){
|
|
122
|
+
if(!mstrucId){
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
if( !optionsMap.has(mstrucId)){
|
|
126
|
+
let reqOptions= await HcserviceV3.requestOptions(mstrucId);
|
|
127
|
+
for(let option of reqOptions){
|
|
128
|
+
if(option['css']){
|
|
129
|
+
option['color']=option['css'].color;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
optionsMap.set(mstrucId,reqOptions);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return optionsMap.get(mstrucId);
|
|
136
|
+
}
|
|
137
|
+
|
|
86
138
|
HCDataSource.requestLtmplConfig = async function ( sourceId: string) {
|
|
87
139
|
if (!ltmplConfigMap.has(sourceId)) {
|
|
88
140
|
ltmplConfigMap.set(sourceId, await HcserviceV3.requestLtmplConfig(sourceId));
|
|
89
141
|
//加载枚举
|
|
90
142
|
let res:LtmplConfigRes=ltmplConfigMap.get(sourceId);
|
|
91
|
-
await
|
|
143
|
+
await loadEnumOfLtmplConfig(res.ltmplConfig);
|
|
92
144
|
}
|
|
93
145
|
return ltmplConfigMap.get(sourceId);
|
|
94
146
|
};
|
|
@@ -97,7 +149,7 @@ HCDataSource.requestL2LtmplConfig = async function (sourceId: string) {
|
|
|
97
149
|
l2LtmplConfigMap.set(sourceId, await HcserviceV3.requestL2LtmplConfig(sourceId));
|
|
98
150
|
//加载枚举
|
|
99
151
|
let res:LtmplConfigRes=l2LtmplConfigMap.get(sourceId);
|
|
100
|
-
await
|
|
152
|
+
await loadEnumOfLtmplConfig(res.ltmplConfig);
|
|
101
153
|
}
|
|
102
154
|
return l2LtmplConfigMap.get(sourceId);
|
|
103
155
|
};
|
|
@@ -218,6 +270,7 @@ HCDataSource.clearOnly =async function () {
|
|
|
218
270
|
dtmplConfigMap.clear();
|
|
219
271
|
selectConfigMap.clear();
|
|
220
272
|
l2LtmplConfigMap.clear();
|
|
273
|
+
optionsMap.clear();
|
|
221
274
|
blocksCache.splice(0,blocksCache.length);
|
|
222
275
|
quickEntranceCache.splice(0,quickEntranceCache.length);
|
|
223
276
|
messageCache.splice(0,quickEntranceCache.length);
|
|
@@ -21,6 +21,20 @@ export default class HcserviceV3 {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
static async requestOptions(mstrucId) { //有下拉菜单时,请求下拉选项操作
|
|
25
|
+
if (mstrucId) {
|
|
26
|
+
let res = await Super.super({
|
|
27
|
+
url: `/v3/enum`,
|
|
28
|
+
query: {
|
|
29
|
+
mstrucId
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
return res.options;
|
|
33
|
+
} else {
|
|
34
|
+
return {};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
24
38
|
// static async requestSelect(requestedMap, selectMSFieldIdArray) {
|
|
25
39
|
// //先从当前状态从中找,没有的才去查
|
|
26
40
|
// //后续可以放在缓存里,但需要一些策略和技巧
|
|
@@ -110,7 +124,7 @@ export default class HcserviceV3 {
|
|
|
110
124
|
return res;
|
|
111
125
|
}
|
|
112
126
|
|
|
113
|
-
static async requestLtmplQueryKey(sourceId, condition) {
|
|
127
|
+
static async requestLtmplQueryKey(sourceId, condition?) {
|
|
114
128
|
console.log('condition:',condition);
|
|
115
129
|
let url = `/v3/ltmpl/query/key`
|
|
116
130
|
let res = await Super.super({
|
|
@@ -121,6 +135,17 @@ export default class HcserviceV3 {
|
|
|
121
135
|
return res;
|
|
122
136
|
}
|
|
123
137
|
|
|
138
|
+
static async requestLtmplQueryTop(sourceId, condition) {
|
|
139
|
+
console.log('condition:',condition);
|
|
140
|
+
let url = `/v3/ltmpl/top-data`
|
|
141
|
+
let res = await Super.super({
|
|
142
|
+
url: url,
|
|
143
|
+
method: 'GET',
|
|
144
|
+
query: {...condition,sourceId}
|
|
145
|
+
});
|
|
146
|
+
return res;
|
|
147
|
+
}
|
|
148
|
+
|
|
124
149
|
static async requestSelectedData(sourceId, codes) {
|
|
125
150
|
if (!codes) {
|
|
126
151
|
message.warn("没有选择实体")
|
|
@@ -257,6 +282,8 @@ export default class HcserviceV3 {
|
|
|
257
282
|
return res;
|
|
258
283
|
}
|
|
259
284
|
|
|
285
|
+
|
|
286
|
+
|
|
260
287
|
static async requestLtmplCount(sourceId) {
|
|
261
288
|
|
|
262
289
|
let url = `/v3/ltmpl/data/count`;
|
|
@@ -291,6 +318,8 @@ export default class HcserviceV3 {
|
|
|
291
318
|
// return criterias;
|
|
292
319
|
// }
|
|
293
320
|
|
|
321
|
+
|
|
322
|
+
|
|
294
323
|
static async requestQueryData(queryKey:string, pageInfo:PageInfo) {
|
|
295
324
|
let res = await Super.super({
|
|
296
325
|
url: `/v3/ltmpl/query/data`,
|
|
@@ -13,7 +13,7 @@ export type StatColType = 'fact' | 'dimension';
|
|
|
13
13
|
export type ActTableViewModel = 'table' | 'verticalList' | 'horizontalList';
|
|
14
14
|
|
|
15
15
|
export type ControlHolderType= 'table' | 'descriptions'
|
|
16
|
-
|
|
16
|
+
export type PageType='modal'|'drawer';
|
|
17
17
|
export interface TmplBase {
|
|
18
18
|
id: string;
|
|
19
19
|
title: string;
|
|
@@ -42,6 +42,7 @@ export interface CQueryConfig extends OrderableTmplBase {
|
|
|
42
42
|
|
|
43
43
|
export interface ActionConfig extends OrderableTmplBase {
|
|
44
44
|
multible: boolean,
|
|
45
|
+
icon:string,
|
|
45
46
|
beforeExeConfirm:string,
|
|
46
47
|
preposes:FieldConfig[],
|
|
47
48
|
writes:FieldConfig[],
|
|
@@ -121,8 +122,8 @@ export type Comparator = 'equal' | 'unequal' | 'includeOne' | 'exclude' | 'noLe
|
|
|
121
122
|
|
|
122
123
|
export interface FieldConfig extends FieldBase {
|
|
123
124
|
disabled?: boolean;
|
|
124
|
-
max?:
|
|
125
|
-
min?:
|
|
125
|
+
max?: string;
|
|
126
|
+
min?: string;
|
|
126
127
|
buttons?: ButtonName[];
|
|
127
128
|
rules?: FileRule[];
|
|
128
129
|
|
|
@@ -168,16 +169,19 @@ export interface LtmplConfig extends SelectConfig {
|
|
|
168
169
|
cQuerys?:CQueryConfig[];
|
|
169
170
|
rowCQuerys?:CQueryConfig[];
|
|
170
171
|
chartType?: ChartType[];
|
|
171
|
-
reStatParams?: CriteriaConfig[];
|
|
172
172
|
editAction:ActionConfig;
|
|
173
|
+
reStatParams?: CriteriaConfig[];
|
|
174
|
+
|
|
173
175
|
drillingParams?: CriteriaConfig[];
|
|
174
176
|
}
|
|
175
177
|
|
|
176
178
|
export interface EnumItem {
|
|
177
179
|
title: string;
|
|
178
180
|
value: string;
|
|
181
|
+
id:string;
|
|
179
182
|
color: string;
|
|
180
183
|
order:string;
|
|
184
|
+
subOptions?:EnumItem[]
|
|
181
185
|
}
|
|
182
186
|
|
|
183
187
|
export type EditStatus ='new'|'changed'|'persisted'
|
|
@@ -227,6 +231,8 @@ export interface QueryData {
|
|
|
227
231
|
|
|
228
232
|
export interface EControlProps extends ControlBaseProps {
|
|
229
233
|
onChange?: (value: any) => void;
|
|
234
|
+
min?:string;
|
|
235
|
+
max?:string;
|
|
230
236
|
}
|
|
231
237
|
|
|
232
238
|
export interface VEControlProps extends EControlProps {
|