aldehyde 0.1.18 → 0.1.21
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/cquery/cquick-button.d.ts +1 -2
- package/lib/controls/cquery/cquick-button.d.ts.map +1 -1
- package/lib/controls/cquery/cquick-button.js +3 -10
- 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 +19 -3
- 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 +5 -0
- package/lib/controls/view-control.js.map +1 -1
- package/lib/detail/button/submit-button-bar.js +1 -1
- 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/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 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -2
- package/lib/index.js.map +1 -1
- package/lib/layout/header/index.css +2 -1
- package/lib/module/dtmpl-view-page.js +2 -2
- package/lib/module/dtmpl-view-page.js.map +1 -1
- 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 +20 -2
- 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 +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/hcservice-v3.d.ts +2 -1
- package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
- package/lib/tmpl/hcservice-v3.js +12 -0
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/tmpl/interface.d.ts +8 -2
- 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 +4 -1
- package/lib/units/index.d.ts.map +1 -1
- package/lib/units/index.js +12 -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/cquery/cquick-button.tsx +5 -26
- 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 +20 -3
- 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 +5 -1
- package/src/aldehyde/detail/button/submit-button-bar.tsx +1 -1
- package/src/aldehyde/detail/edit/{modal-dtmpl-edit.tsx → dtmpl-edit-page.tsx} +36 -13
- 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 -2
- package/src/aldehyde/layout/header/index.css +2 -1
- package/src/aldehyde/module/dtmpl-view-page.tsx +5 -5
- package/src/aldehyde/module/ltmpl-page.tsx +7 -5
- package/src/aldehyde/routable/ltmpl-route.tsx +23 -2
- package/src/aldehyde/table/act-table.tsx +6 -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/hcservice-v3.tsx +16 -1
- package/src/aldehyde/tmpl/interface.tsx +8 -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
|
@@ -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
|
|
|
@@ -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
|
@@ -20,12 +20,15 @@ import QuickEntrance from './welcome/quick-entrance'
|
|
|
20
20
|
import Workbench from './welcome/workbench';
|
|
21
21
|
import PopoverEntitySelect from "./controls/entity-select/popover-entity-select";
|
|
22
22
|
import DatePicker from "./controls/date-picker";
|
|
23
|
-
import
|
|
23
|
+
import DtmplEditPage from "./detail/edit/dtmpl-edit-page";
|
|
24
24
|
import TmplDataSource from './tmpl/hc-data-source';
|
|
25
25
|
import * as TmplInterface from './tmpl/interface';
|
|
26
26
|
import Superagent from './tmpl/superagent';
|
|
27
|
+
import HCWelcome from './welcome/HCWelcome';
|
|
28
|
+
import MainPage from './layout/MainPage';
|
|
29
|
+
import ExcelImportRoute from './routable/import-route';
|
|
27
30
|
|
|
28
31
|
export {ActTable,SelectTable,Loginit,DtmplRoute,ImportRoute,LtmplRoute,DtmplViewPage,LtmplPage,Menu2layers,Block,UserBar,
|
|
29
32
|
ResetPassword,Footer,EntryControl,ViewControl,ProgramConfig,HydrocarbonService,QuickEntrance,Workbench,PopoverEntitySelect
|
|
30
|
-
,DatePicker,
|
|
33
|
+
,DatePicker,DtmplEditPage,TmplInterface,TmplDataSource,Superagent,DtmplEdit,HCWelcome,MainPage,ExcelImportRoute}
|
|
31
34
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import
|
|
2
|
+
import DtmplEditPage from "../detail/edit/dtmpl-edit-page";
|
|
3
3
|
import ActDtmplView from "../detail/view/act-dtmpl-view";
|
|
4
4
|
|
|
5
5
|
//以列表为入口的,页面内列表,基本原则是所有交互在页面内完成,不会触发路由。
|
|
@@ -48,13 +48,13 @@ class DtmplViewPage extends React.PureComponent<DtmplViewPageProps, DtmplViewPag
|
|
|
48
48
|
const { sourceId,code,mainCode} = this.props;
|
|
49
49
|
return <>
|
|
50
50
|
<ActDtmplView goDtmpl={this.goDtmpl} sourceId={sourceId} code={code} mainCode={mainCode}></ActDtmplView>
|
|
51
|
-
<
|
|
51
|
+
<DtmplEditPage visible={showDtmplEdit} onCancel={()=>{
|
|
52
52
|
this.setState({
|
|
53
53
|
showDtmplEdit:false,
|
|
54
54
|
})}}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
sourceId={sourceId}
|
|
56
|
+
code={code}
|
|
57
|
+
onOk={this.handleDtmplEdit} />
|
|
58
58
|
</>
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -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
|
}
|
|
@@ -68,14 +68,23 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
68
68
|
showView = (code: string) => {
|
|
69
69
|
const {basePath}=this.props;
|
|
70
70
|
const { sourceId} = this.props.match.params;
|
|
71
|
-
|
|
71
|
+
const {ltmplConfigRes} = this.state;
|
|
72
|
+
let path = `${basePath}/${sourceId}/detail-view?code=${code}&menuId=${this.getMenuId()}`;
|
|
73
|
+
if(ltmplConfigRes.ltmplConfig.customViewPagePath){
|
|
74
|
+
path=`${basePath}${ltmplConfigRes.ltmplConfig.customViewPagePath}?menuId=${this.getMenuId()}&sourceId=${sourceId}`;
|
|
75
|
+
}
|
|
76
|
+
this.onRoute(path);
|
|
72
77
|
}
|
|
73
78
|
|
|
74
79
|
doEdit = (code: string,mode:string) => {
|
|
75
80
|
const {basePath}=this.props;
|
|
76
81
|
const { sourceId} = this.props.match.params;
|
|
82
|
+
const {ltmplConfigRes} = this.state;
|
|
77
83
|
let mainCode = this.getMainCode();
|
|
78
84
|
let path = `${basePath}/${sourceId}/detail-edit?code=${code}&menuId=${this.getMenuId()}&mode=${mode}`;
|
|
85
|
+
if(ltmplConfigRes.ltmplConfig.customEditPagePath){
|
|
86
|
+
path=`${basePath}${ltmplConfigRes.ltmplConfig.customEditPagePath}?menuId=${this.getMenuId()}&sourceId=${sourceId}`;
|
|
87
|
+
}
|
|
79
88
|
if (mainCode) {
|
|
80
89
|
path = path + `&mainCode=${mainCode}`;
|
|
81
90
|
}
|
|
@@ -97,7 +106,11 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
97
106
|
doCreate = () => {
|
|
98
107
|
const {basePath}=this.props;
|
|
99
108
|
const { sourceId} = this.props.match.params;
|
|
109
|
+
const {ltmplConfigRes} = this.state;
|
|
100
110
|
let path = `${basePath}/${sourceId}/detail-edit?menuId=${this.getMenuId()}`;
|
|
111
|
+
if(ltmplConfigRes.ltmplConfig.customEditPagePath){
|
|
112
|
+
path=`${basePath}${ltmplConfigRes.ltmplConfig.customEditPagePath}?menuId=${this.getMenuId()}&sourceId=${sourceId}`;
|
|
113
|
+
}
|
|
101
114
|
let mainCode = this.getMainCode();
|
|
102
115
|
if (mainCode) {
|
|
103
116
|
path = path + `&mainCode=${mainCode}`;
|
|
@@ -105,6 +118,12 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
105
118
|
this.onRoute(path);
|
|
106
119
|
}
|
|
107
120
|
|
|
121
|
+
doRAction = (ractionId:string,mainCode:String) => {
|
|
122
|
+
const {basePath}=this.props;
|
|
123
|
+
let path = `${basePath}/${ractionId}/act-table?mainCode=${mainCode}&menuId=${this.getMenuId()}`;
|
|
124
|
+
this.onRoute(path);
|
|
125
|
+
}
|
|
126
|
+
|
|
108
127
|
doSearch = (params_) => {
|
|
109
128
|
const {basePath}=this.props;
|
|
110
129
|
const { sourceId} = this.props.match.params;
|
|
@@ -154,7 +173,9 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
154
173
|
return <ActTable menuId={this.getMenuId()} mainCode={mainCode} showView={this.showView}
|
|
155
174
|
doSearch={this.doSearch} doEdit={this.doEdit} doCreate={this.doCreate}
|
|
156
175
|
sourceId={sourceId} criteriaData={criteriaData}
|
|
157
|
-
ltmplConfig={ltmplConfigRes.ltmplConfig}
|
|
176
|
+
ltmplConfig={ltmplConfigRes.ltmplConfig}
|
|
177
|
+
doRAction={this.doRAction}
|
|
178
|
+
/>
|
|
158
179
|
}
|
|
159
180
|
|
|
160
181
|
}
|
|
@@ -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) => {
|
|
@@ -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
|
}
|
|
@@ -124,7 +124,7 @@ export default class HcserviceV3 {
|
|
|
124
124
|
return res;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
static async requestLtmplQueryKey(sourceId, condition) {
|
|
127
|
+
static async requestLtmplQueryKey(sourceId, condition?) {
|
|
128
128
|
console.log('condition:',condition);
|
|
129
129
|
let url = `/v3/ltmpl/query/key`
|
|
130
130
|
let res = await Super.super({
|
|
@@ -135,6 +135,17 @@ export default class HcserviceV3 {
|
|
|
135
135
|
return res;
|
|
136
136
|
}
|
|
137
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
|
+
|
|
138
149
|
static async requestSelectedData(sourceId, codes) {
|
|
139
150
|
if (!codes) {
|
|
140
151
|
message.warn("没有选择实体")
|
|
@@ -271,6 +282,8 @@ export default class HcserviceV3 {
|
|
|
271
282
|
return res;
|
|
272
283
|
}
|
|
273
284
|
|
|
285
|
+
|
|
286
|
+
|
|
274
287
|
static async requestLtmplCount(sourceId) {
|
|
275
288
|
|
|
276
289
|
let url = `/v3/ltmpl/data/count`;
|
|
@@ -305,6 +318,8 @@ export default class HcserviceV3 {
|
|
|
305
318
|
// return criterias;
|
|
306
319
|
// }
|
|
307
320
|
|
|
321
|
+
|
|
322
|
+
|
|
308
323
|
static async requestQueryData(queryKey:string, pageInfo:PageInfo) {
|
|
309
324
|
let res = await Super.super({
|
|
310
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
|
|
|
@@ -170,7 +171,8 @@ export interface LtmplConfig extends SelectConfig {
|
|
|
170
171
|
chartType?: ChartType[];
|
|
171
172
|
editAction:ActionConfig;
|
|
172
173
|
reStatParams?: CriteriaConfig[];
|
|
173
|
-
|
|
174
|
+
customEditPagePath?:string;
|
|
175
|
+
customViewPagePath?:string;
|
|
174
176
|
drillingParams?: CriteriaConfig[];
|
|
175
177
|
}
|
|
176
178
|
|
|
@@ -230,6 +232,8 @@ export interface QueryData {
|
|
|
230
232
|
|
|
231
233
|
export interface EControlProps extends ControlBaseProps {
|
|
232
234
|
onChange?: (value: any) => void;
|
|
235
|
+
min?:string;
|
|
236
|
+
max?:string;
|
|
233
237
|
}
|
|
234
238
|
|
|
235
239
|
export interface VEControlProps extends EControlProps {
|
|
@@ -86,10 +86,10 @@ TmplConfigAnalysis.currentL1 = function ( config: string,format:string) {
|
|
|
86
86
|
break;
|
|
87
87
|
}
|
|
88
88
|
if(symbol=="-"){
|
|
89
|
-
|
|
89
|
+
// console.log("moment().subtract(n,momentUnit)",moment().subtract(n,momentUnit).format(format));
|
|
90
90
|
return moment().subtract(n,momentUnit).format(format);
|
|
91
91
|
}else{
|
|
92
|
-
|
|
92
|
+
// console.log("moment().add(n,momentUnit)",moment().add(n,momentUnit).format(format));
|
|
93
93
|
return moment().add(n,momentUnit).format(format);
|
|
94
94
|
}
|
|
95
95
|
}
|