aldehyde 0.1.17 → 0.1.20
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 +4 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -3
- package/lib/index.js.map +1 -1
- package/lib/layout/header/index.css +2 -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.d.ts.map +1 -1
- package/lib/module/ltmpl-page.js +2 -2
- package/lib/module/ltmpl-page.js.map +1 -1
- package/lib/routable/ltmpl-route.d.ts +1 -0
- package/lib/routable/ltmpl-route.d.ts.map +1 -1
- package/lib/routable/ltmpl-route.js +6 -1
- package/lib/routable/ltmpl-route.js.map +1 -1
- package/lib/table/act-table.d.ts +1 -0
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js +5 -5
- 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 +6 -2
- 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 +5 -4
- package/src/aldehyde/layout/header/index.css +2 -1
- 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 +7 -5
- package/src/aldehyde/routable/ltmpl-route.tsx +9 -1
- package/src/aldehyde/table/act-table.tsx +8 -5
- 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 +20 -1
- 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
|
@@ -9,7 +9,7 @@ interface InputNumberProps extends EControlProps {
|
|
|
9
9
|
|
|
10
10
|
const InputNumber: React.FC<InputNumberProps> = (props) => {
|
|
11
11
|
|
|
12
|
-
const {id,value, itemType, fieldConfig, onChange,style} = props;
|
|
12
|
+
const {id,value, itemType, fieldConfig, onChange,style,min,max} = props;
|
|
13
13
|
|
|
14
14
|
let entryControl = undefined;
|
|
15
15
|
|
|
@@ -53,7 +53,7 @@ const InputNumber: React.FC<InputNumberProps> = (props) => {
|
|
|
53
53
|
|
|
54
54
|
switch (itemType) {
|
|
55
55
|
case 'int':
|
|
56
|
-
entryControl = <AntdInputNumber style={{...style}} min={
|
|
56
|
+
entryControl = <AntdInputNumber style={{...style}} min={min} max={max}
|
|
57
57
|
{...antdControlProps} value={valueSingle}
|
|
58
58
|
onKeyUp={changeInt} onChange={changeValue}
|
|
59
59
|
/>
|
|
@@ -62,7 +62,7 @@ const InputNumber: React.FC<InputNumberProps> = (props) => {
|
|
|
62
62
|
case 'float':
|
|
63
63
|
case 'double':
|
|
64
64
|
entryControl = <AntdInputNumber style={{...style}}
|
|
65
|
-
{...antdControlProps} value={valueSingle} min={
|
|
65
|
+
{...antdControlProps} value={valueSingle} min={min} max={max}
|
|
66
66
|
// style={{width}}
|
|
67
67
|
step={0.1} onChange={changeValue}
|
|
68
68
|
/>
|
|
@@ -70,11 +70,11 @@ const InputNumber: React.FC<InputNumberProps> = (props) => {
|
|
|
70
70
|
case 'intrange':
|
|
71
71
|
entryControl =
|
|
72
72
|
<Space>
|
|
73
|
-
<AntdInputNumber min={
|
|
73
|
+
<AntdInputNumber min={min} max={max}
|
|
74
74
|
placeholder={`开始`} value={valueBegin}
|
|
75
75
|
onKeyUp={changeInt} onChange={changeBeginValue}
|
|
76
76
|
/>~
|
|
77
|
-
<AntdInputNumber min={
|
|
77
|
+
<AntdInputNumber min={min} max={max}
|
|
78
78
|
placeholder={`结束`} value={valueEnd}
|
|
79
79
|
onKeyUp={changeInt} onChange={changeEndValue}
|
|
80
80
|
/>
|
|
@@ -83,12 +83,12 @@ const InputNumber: React.FC<InputNumberProps> = (props) => {
|
|
|
83
83
|
case 'decimalrange':
|
|
84
84
|
entryControl =
|
|
85
85
|
<Space>
|
|
86
|
-
<AntdInputNumber min={
|
|
86
|
+
<AntdInputNumber min={min} max={max}
|
|
87
87
|
placeholder={`开始`} value={valueBegin}
|
|
88
88
|
onChange={changeBeginValue} step={0.1}
|
|
89
89
|
disabled={disabled}
|
|
90
90
|
/>~
|
|
91
|
-
<AntdInputNumber min={
|
|
91
|
+
<AntdInputNumber min={min} max={max}
|
|
92
92
|
placeholder={`结束`} value={valueEnd} step={0.1}
|
|
93
93
|
onChange={changeEndValue} disabled={disabled}
|
|
94
94
|
/>
|
|
@@ -13,6 +13,7 @@ import moment from "moment";
|
|
|
13
13
|
import Progress from './progress'
|
|
14
14
|
import ColorPicker from "./color-picker";
|
|
15
15
|
import EllipsisText from './text/ellipsis-text'
|
|
16
|
+
import {ProgramConfig} from "../index";
|
|
16
17
|
//import ChemStruc from "./chemstruc/graph";
|
|
17
18
|
// import HtmlEditor from "../HtmlEditor/tinymce";
|
|
18
19
|
const Loading = <Spin tip="Loading...">
|
|
@@ -59,7 +60,10 @@ function renderControl(fieldConfig: FieldConfig, fieldValue: any,pHolderType:Con
|
|
|
59
60
|
let controlProps = {
|
|
60
61
|
fieldConfig, itemType, value,viewOrEdit,
|
|
61
62
|
}
|
|
62
|
-
|
|
63
|
+
//自定义组件为先
|
|
64
|
+
if(ProgramConfig.getCustomEditControl(itemType)){
|
|
65
|
+
return React.createElement(ProgramConfig.getCustomViewControl(itemType),controlProps);
|
|
66
|
+
}
|
|
63
67
|
const unSupportControl =
|
|
64
68
|
<span className="infoStyle">{`暂未完成-${itemType}`}</span>;
|
|
65
69
|
|
|
@@ -126,7 +130,7 @@ function renderControl(fieldConfig: FieldConfig, fieldValue: any,pHolderType:Con
|
|
|
126
130
|
viewControl = unSupportControl;
|
|
127
131
|
break;
|
|
128
132
|
case 'caselect':
|
|
129
|
-
viewControl =
|
|
133
|
+
viewControl = <span className="infoStyle">{value}</span>;
|
|
130
134
|
break;
|
|
131
135
|
case 'relation':
|
|
132
136
|
viewControl = unSupportControl
|
|
@@ -94,7 +94,7 @@ class SubmitButtonBar extends React.PureComponent<SubmitButtonProps, SubmitButto
|
|
|
94
94
|
// type="primary"
|
|
95
95
|
// >{item.title}</Button>
|
|
96
96
|
// </Popconfirm>
|
|
97
|
-
return <Action hiddenType={'disabled'} buttonType={'primary'} serial={serial} key={item.id} formRef={formRef} actionConfig={item} doAction={doSubmit}></Action>
|
|
97
|
+
return <Action iconType={'icon-title'} hiddenType={'disabled'} buttonType={'primary'} serial={serial} key={item.id} formRef={formRef} actionConfig={item} doAction={doSubmit}></Action>
|
|
98
98
|
}
|
|
99
99
|
})
|
|
100
100
|
}
|
|
@@ -104,8 +104,11 @@ class SubmitButtonBar extends React.PureComponent<SubmitButtonProps, SubmitButto
|
|
|
104
104
|
|
|
105
105
|
|
|
106
106
|
return (
|
|
107
|
-
<Affix
|
|
108
|
-
|
|
107
|
+
<Affix
|
|
108
|
+
//style={{position: 'absolute', right: 10, maxHeight: 100}}
|
|
109
|
+
// offsetBottom={this.calcOffsetBottom(buttons, actions)}>
|
|
110
|
+
style={{position: 'absolute',bottom:60,right: 15,}} offsetBottom={this.calcOffsetBottom(buttons, actions)}
|
|
111
|
+
>
|
|
109
112
|
<div className={'submitButtonBar'} >
|
|
110
113
|
<ul>
|
|
111
114
|
{buttons.includes('dtmplSave') ? <li key={100}>
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {Button, FormInstance, Modal, Popconfirm} from 'antd'
|
|
3
|
-
import {DtmplBaseProps, DtmplConfig, DtmplData} from "../../tmpl/interface";
|
|
2
|
+
import {Button, Drawer, FormInstance, Modal, Popconfirm, Space} from 'antd'
|
|
3
|
+
import {DtmplBaseProps, DtmplConfig, DtmplData, PageType} from "../../tmpl/interface";
|
|
4
4
|
import DtmplForm from '../../form/dtmpl-form';
|
|
5
5
|
import HCDataSource from "../../tmpl/hc-data-source";
|
|
6
6
|
import Units from "../../units";
|
|
7
7
|
import HcserviceV3 from "../../tmpl/hcservice-v3";
|
|
8
8
|
import Action from "../../controls/action";
|
|
9
|
+
import DtmplEdit from "./dtmpl-edit";
|
|
9
10
|
|
|
10
11
|
interface ModalEditorProps extends DtmplBaseProps {
|
|
11
|
-
height
|
|
12
|
+
height?: any,
|
|
13
|
+
width?:number,
|
|
12
14
|
visible: boolean,
|
|
13
15
|
onOk: (code: string) => void,
|
|
14
16
|
onCancel: () => void,
|
|
15
|
-
|
|
17
|
+
pageType:PageType;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
interface ModalEditorState {
|
|
@@ -23,7 +25,7 @@ interface ModalEditorState {
|
|
|
23
25
|
dtmplData:DtmplData,
|
|
24
26
|
}
|
|
25
27
|
|
|
26
|
-
export default class
|
|
28
|
+
export default class DtmplEditPage extends React.PureComponent<ModalEditorProps, ModalEditorState> {
|
|
27
29
|
formRef = React.createRef<FormInstance>();
|
|
28
30
|
autoSaveTimer = -1000000000000000;
|
|
29
31
|
autoSaveInterval=undefined;
|
|
@@ -35,12 +37,13 @@ export default class ModalDtmplEdit extends React.PureComponent<ModalEditorProps
|
|
|
35
37
|
static defaultProps = {
|
|
36
38
|
showConfirm: true,
|
|
37
39
|
height: 500,
|
|
40
|
+
width:1250,
|
|
38
41
|
//antd modal
|
|
39
42
|
forceRender: true,
|
|
40
43
|
style: {maxWidth: 'calc(100vw - 60px)', maxHeight: 'calc(100vh - 50px)'},
|
|
41
44
|
okText: "确定",
|
|
42
45
|
cancelText: "取消",
|
|
43
|
-
|
|
46
|
+
pageType:'modal'
|
|
44
47
|
}
|
|
45
48
|
state = {
|
|
46
49
|
id:'modelDtmplEdit'+Units.getRandomNum(6),
|
|
@@ -160,7 +163,7 @@ export default class ModalDtmplEdit extends React.PureComponent<ModalEditorProps
|
|
|
160
163
|
//处理action
|
|
161
164
|
if (dtmplConfig) {
|
|
162
165
|
dtmplConfig.actions.forEach((ac, index) => {
|
|
163
|
-
footerButtons.unshift(<Action hiddenType={'disabled'} serial={serial} key={ac.id} formRef={this.formRef} actionConfig={ac} doAction={this.doSubmit}></Action>);
|
|
166
|
+
footerButtons.unshift(<Action iconType={'icon-title'} hiddenType={'disabled'} serial={serial} key={ac.id} formRef={this.formRef} actionConfig={ac} doAction={this.doSubmit}></Action>);
|
|
164
167
|
})
|
|
165
168
|
}
|
|
166
169
|
footerButtons.unshift(<Popconfirm key="back" placement="topLeft" title={"确定要取消本次修改内容吗?"} onConfirm={onCancel} okText="确定" cancelText="取消">
|
|
@@ -171,12 +174,12 @@ export default class ModalDtmplEdit extends React.PureComponent<ModalEditorProps
|
|
|
171
174
|
}
|
|
172
175
|
|
|
173
176
|
render() {
|
|
174
|
-
const {height, onOk, onCancel, code, sourceId, visible,mainCode} = this.props
|
|
177
|
+
const {height, onOk, onCancel, code, sourceId, visible,mainCode,width,pageType} = this.props
|
|
175
178
|
const {dtmplConfig,id,dtmplData} = this.state;
|
|
176
179
|
|
|
177
|
-
return <Modal
|
|
180
|
+
return (<> {pageType=='modal'? <Modal
|
|
178
181
|
visible={visible}
|
|
179
|
-
width={
|
|
182
|
+
width={width}
|
|
180
183
|
title={dtmplConfig ? dtmplConfig.title : ""}
|
|
181
184
|
bodyStyle={{height: height, overflow: 'auto'}}
|
|
182
185
|
destroyOnClose={true}
|
|
@@ -185,13 +188,33 @@ export default class ModalDtmplEdit extends React.PureComponent<ModalEditorProps
|
|
|
185
188
|
footer={this.getFooter()}
|
|
186
189
|
>
|
|
187
190
|
{visible} <div onClick={this.onClickBody}>
|
|
188
|
-
{/*<Scrollbars autoHide autoHideTimeout={1000}>*/}
|
|
189
191
|
<DtmplForm parentId={id} dtmplConfig={dtmplConfig} formRef={this.formRef} sourceId={sourceId}
|
|
190
192
|
onFinish={onOk}
|
|
191
193
|
showConfirm={false} dtmplData={dtmplData} onValuesChange={this.onValuesChange} />
|
|
192
|
-
{/*</Scrollbars>*/}
|
|
193
194
|
</div>
|
|
194
|
-
|
|
195
|
+
</Modal>
|
|
196
|
+
:
|
|
197
|
+
<Drawer
|
|
198
|
+
placement={'left'}
|
|
199
|
+
closable={true}
|
|
200
|
+
mask={false}
|
|
201
|
+
onClose={onCancel}
|
|
202
|
+
visible={visible}
|
|
203
|
+
width={width}
|
|
204
|
+
style={{
|
|
205
|
+
maxWidth: 1960,
|
|
206
|
+
}}
|
|
207
|
+
extra={
|
|
208
|
+
<Space>{this.getFooter()}</Space>
|
|
209
|
+
}
|
|
210
|
+
>
|
|
211
|
+
<DtmplForm parentId={id} dtmplConfig={dtmplConfig} formRef={this.formRef} sourceId={sourceId}
|
|
212
|
+
onFinish={onOk}
|
|
213
|
+
showConfirm={false} dtmplData={dtmplData} onValuesChange={this.onValuesChange} />
|
|
214
|
+
</Drawer>
|
|
215
|
+
}
|
|
216
|
+
</>
|
|
217
|
+
)
|
|
195
218
|
|
|
196
219
|
}
|
|
197
220
|
|
|
@@ -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,12 +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';
|
|
25
26
|
import Superagent from './tmpl/superagent';
|
|
26
27
|
|
|
27
|
-
export {ActTable,SelectTable,Loginit,DtmplRoute,ImportRoute,LtmplRoute,
|
|
28
|
+
export {ActTable,SelectTable,Loginit,DtmplRoute,ImportRoute,LtmplRoute,DtmplViewPage,LtmplPage,Menu2layers,Block,UserBar,
|
|
28
29
|
ResetPassword,Footer,EntryControl,ViewControl,ProgramConfig,HydrocarbonService,QuickEntrance,Workbench,PopoverEntitySelect
|
|
29
|
-
,DatePicker,
|
|
30
|
+
,DatePicker,DtmplEditPage,TmplInterface,TmplDataSource,Superagent,DtmplEdit}
|
|
30
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
|
//以列表为入口的,页面内列表,基本原则是所有交互在页面内完成,不会触发路由。
|
|
@@ -107,6 +107,8 @@ class LtmplPage extends React.PureComponent<LtmplPageProps, LtmplPageState> {
|
|
|
107
107
|
|
|
108
108
|
|
|
109
109
|
|
|
110
|
+
|
|
111
|
+
|
|
110
112
|
doCreate = () => {
|
|
111
113
|
this.setState({
|
|
112
114
|
selectedCode:null,
|
|
@@ -163,13 +165,13 @@ class LtmplPage extends React.PureComponent<LtmplPageProps, LtmplPageState> {
|
|
|
163
165
|
sourceId={sourceId}
|
|
164
166
|
code={selectedCode}> </ModalDtmplView> : ""}
|
|
165
167
|
{buttons.includes('dtmplEdit') || buttons.includes('dtmplAdd') ?
|
|
166
|
-
<
|
|
168
|
+
<DtmplEditPage visible={showDtmplEdit} onCancel={()=>{
|
|
167
169
|
this.setState({
|
|
168
170
|
showDtmplEdit:false,
|
|
169
171
|
})}}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
172
|
+
sourceId={sourceId}
|
|
173
|
+
code={selectedCode}
|
|
174
|
+
onOk={this.handleDtmplEdit} />
|
|
173
175
|
: ""}
|
|
174
176
|
</>
|
|
175
177
|
}
|
|
@@ -105,6 +105,12 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
105
105
|
this.onRoute(path);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
doRAction = (ractionId:string,mainCode:String) => {
|
|
109
|
+
const {basePath}=this.props;
|
|
110
|
+
let path = `${basePath}/${ractionId}/act-table?mainCode=${mainCode}&menuId=${this.getMenuId()}`;
|
|
111
|
+
this.onRoute(path);
|
|
112
|
+
}
|
|
113
|
+
|
|
108
114
|
doSearch = (params_) => {
|
|
109
115
|
const {basePath}=this.props;
|
|
110
116
|
const { sourceId} = this.props.match.params;
|
|
@@ -154,7 +160,9 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
154
160
|
return <ActTable menuId={this.getMenuId()} mainCode={mainCode} showView={this.showView}
|
|
155
161
|
doSearch={this.doSearch} doEdit={this.doEdit} doCreate={this.doCreate}
|
|
156
162
|
sourceId={sourceId} criteriaData={criteriaData}
|
|
157
|
-
ltmplConfig={ltmplConfigRes.ltmplConfig}
|
|
163
|
+
ltmplConfig={ltmplConfigRes.ltmplConfig}
|
|
164
|
+
doRAction={this.doRAction}
|
|
165
|
+
/>
|
|
158
166
|
}
|
|
159
167
|
|
|
160
168
|
}
|
|
@@ -59,6 +59,7 @@ interface ActTableProps extends TmplBaseProps {
|
|
|
59
59
|
doCreate?: () => void,
|
|
60
60
|
doEdit?: (code: string,mode:AddOrUpdate) => void,
|
|
61
61
|
doSearch?: (params: object) => void,
|
|
62
|
+
doRAction?:(ractionId:string,mainCode:string)=>void,
|
|
62
63
|
level?: Level,
|
|
63
64
|
};
|
|
64
65
|
|
|
@@ -178,7 +179,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
178
179
|
}
|
|
179
180
|
|
|
180
181
|
buildTableColumns = (ltmplConfig: LtmplConfig, hiddenColIds: string[], hiddenRowCodes: string[], sortedColConfigs: ColumnConfig[]) => {
|
|
181
|
-
const {mainCode, showView, doEdit,menuId} = this.props
|
|
182
|
+
const {mainCode, showView, doEdit,menuId,doRAction} = this.props
|
|
182
183
|
const {buttons} = ltmplConfig;
|
|
183
184
|
let tableColumns = [];
|
|
184
185
|
let s = 0;
|
|
@@ -267,13 +268,15 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
267
268
|
key={raction.id}
|
|
268
269
|
size="small"
|
|
269
270
|
type="dashed"
|
|
270
|
-
|
|
271
|
+
onClick={() => doRAction(raction.id,record.code)}
|
|
272
|
+
// href={`#/${raction.id}/act-table?mainCode=${record.code}&menuId=${menuId}`}
|
|
273
|
+
>
|
|
271
274
|
{raction.title}
|
|
272
275
|
</Button>
|
|
273
276
|
}) : ""}
|
|
274
277
|
{ltmplConfig.rowActions && ltmplConfig.rowActions.length > 0 ?
|
|
275
278
|
ltmplConfig.rowActions.map((action) => {
|
|
276
|
-
return <Action key={action.id} data={[record]} actionConfig={action} doAction={this.doRowAction} buttonSize={'small'} serial={1}></Action>
|
|
279
|
+
return <Action iconType={'icon'} key={action.id} data={[record]} actionConfig={action} doAction={this.doRowAction} buttonSize={'small'} serial={1}></Action>
|
|
277
280
|
}) : ""}
|
|
278
281
|
{ltmplConfig.jumps && ltmplConfig.jumps.length > 0 ?
|
|
279
282
|
ltmplConfig.jumps.map((jump) => {
|
|
@@ -287,9 +290,9 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
287
290
|
// onClick={() => this.doRowCQuery(cQuery.id, record.code)}
|
|
288
291
|
// >{cQuery.title}</Button>;
|
|
289
292
|
console.log("record record",record);
|
|
290
|
-
return <CquickButton key={cquery.id} size={"small"}
|
|
293
|
+
return <CquickButton key={cquery.id} size={"small"} pageType={'drawer'}
|
|
291
294
|
// onClick={() => doCQuery(cquery.id)}
|
|
292
|
-
|
|
295
|
+
cQueryConfig={cquery} mainCode={cquery.mainCodeColId?record[cquery.mainCodeColId]:record.code}/>
|
|
293
296
|
}) : ""}
|
|
294
297
|
</Space>);
|
|
295
298
|
} 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';
|