aldehyde 0.1.35 → 0.1.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/controls/counting-tag/index.d.ts +18 -0
- package/lib/controls/counting-tag/index.d.ts.map +1 -0
- package/lib/controls/counting-tag/index.js +31 -0
- package/lib/controls/counting-tag/index.js.map +1 -0
- package/lib/controls/entity-select/entity-select.d.ts +1 -0
- package/lib/controls/entity-select/entity-select.d.ts.map +1 -1
- package/lib/controls/entity-select/entity-select.js +15 -11
- package/lib/controls/entity-select/entity-select.js.map +1 -1
- package/lib/controls/entity-select/popover-entity-select.d.ts +3 -3
- package/lib/controls/entity-select/popover-entity-select.d.ts.map +1 -1
- package/lib/controls/entity-select/popover-entity-select.js +4 -4
- package/lib/controls/entity-select/popover-entity-select.js.map +1 -1
- package/lib/controls/entry-control.d.ts +1 -0
- package/lib/controls/entry-control.d.ts.map +1 -1
- package/lib/controls/entry-control.js +23 -6
- package/lib/controls/entry-control.js.map +1 -1
- package/lib/controls/file-view/index.d.ts +1 -0
- package/lib/controls/file-view/index.d.ts.map +1 -1
- package/lib/controls/file-view/index.js +1 -0
- package/lib/controls/file-view/index.js.map +1 -1
- package/lib/controls/rfield/index.js +1 -1
- package/lib/controls/rfield/index.js.map +1 -1
- package/lib/controls/view-control.d.ts.map +1 -1
- package/lib/controls/view-control.js +1 -0
- package/lib/controls/view-control.js.map +1 -1
- package/lib/detail/edit/dtmpl-edit-page.d.ts.map +1 -1
- package/lib/detail/edit/dtmpl-edit-page.js +11 -4
- package/lib/detail/edit/dtmpl-edit-page.js.map +1 -1
- package/lib/detail/edit/dtmpl-edit.d.ts.map +1 -1
- package/lib/detail/edit/dtmpl-edit.js +11 -4
- package/lib/detail/edit/dtmpl-edit.js.map +1 -1
- package/lib/detail/edit/row-editor.d.ts +2 -0
- package/lib/detail/edit/row-editor.d.ts.map +1 -1
- package/lib/detail/edit/row-editor.js +4 -3
- package/lib/detail/edit/row-editor.js.map +1 -1
- package/lib/form/criteria-form.d.ts +1 -0
- package/lib/form/criteria-form.d.ts.map +1 -1
- package/lib/form/criteria-form.js +1 -1
- package/lib/form/criteria-form.js.map +1 -1
- package/lib/form/dtmpl-form.d.ts.map +1 -1
- package/lib/form/dtmpl-form.js +5 -6
- package/lib/form/dtmpl-form.js.map +1 -1
- package/lib/form/form-Item-group.d.ts +1 -0
- package/lib/form/form-Item-group.d.ts.map +1 -1
- package/lib/form/form-Item-group.js +3 -3
- package/lib/form/form-Item-group.js.map +1 -1
- package/lib/module/ltmpl-page.d.ts +12 -1
- package/lib/module/ltmpl-page.d.ts.map +1 -1
- package/lib/module/ltmpl-page.js +25 -6
- package/lib/module/ltmpl-page.js.map +1 -1
- package/lib/table/modal-select-table.d.ts +1 -0
- package/lib/table/modal-select-table.d.ts.map +1 -1
- package/lib/table/modal-select-table.js +2 -2
- package/lib/table/modal-select-table.js.map +1 -1
- package/lib/table/relation-table.d.ts +1 -0
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/table/relation-table.js +25 -55
- package/lib/table/relation-table.js.map +1 -1
- package/lib/table/select-table.d.ts +1 -0
- package/lib/table/select-table.d.ts.map +1 -1
- package/lib/table/select-table.js +2 -1
- package/lib/table/select-table.js.map +1 -1
- package/lib/tmpl/control-type-supportor.d.ts.map +1 -1
- package/lib/tmpl/control-type-supportor.js +1 -0
- package/lib/tmpl/control-type-supportor.js.map +1 -1
- package/lib/tmpl/hc-data-source.d.ts +1 -0
- package/lib/tmpl/hc-data-source.d.ts.map +1 -1
- package/lib/tmpl/hc-data-source.js +12 -0
- package/lib/tmpl/hc-data-source.js.map +1 -1
- package/lib/tmpl/hcservice-v3.d.ts +1 -0
- package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
- package/lib/tmpl/hcservice-v3.js +11 -0
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/tmpl/interface.d.ts +4 -1
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/counting-tag/index.tsx +45 -0
- package/src/aldehyde/controls/entity-select/entity-select.tsx +20 -13
- package/src/aldehyde/controls/entity-select/popover-entity-select.tsx +5 -5
- package/src/aldehyde/controls/entry-control.tsx +14 -6
- package/src/aldehyde/controls/file-view/index.tsx +2 -0
- package/src/aldehyde/controls/rfield/index.tsx +1 -1
- package/src/aldehyde/controls/view-control.tsx +1 -0
- package/src/aldehyde/detail/edit/dtmpl-edit-page.tsx +10 -4
- package/src/aldehyde/detail/edit/dtmpl-edit.tsx +10 -4
- package/src/aldehyde/detail/edit/row-editor.tsx +5 -2
- package/src/aldehyde/form/criteria-form.tsx +3 -1
- package/src/aldehyde/form/dtmpl-form.tsx +4 -4
- package/src/aldehyde/form/form-Item-group.tsx +4 -3
- package/src/aldehyde/module/ltmpl-page.tsx +50 -11
- package/src/aldehyde/table/modal-select-table.tsx +3 -2
- package/src/aldehyde/table/relation-table.tsx +29 -56
- package/src/aldehyde/table/select-table.tsx +3 -1
- package/src/aldehyde/tmpl/control-type-supportor.tsx +1 -0
- package/src/aldehyde/tmpl/hc-data-source.tsx +11 -1
- package/src/aldehyde/tmpl/hcservice-v3.tsx +11 -0
- package/src/aldehyde/tmpl/interface.tsx +4 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {DtmplData, LtmplConfigRes} from '../tmpl/interface';
|
|
2
|
+
import {AddOrUpdate, DtmplData, LtmplConfigRes} from '../tmpl/interface';
|
|
3
3
|
import Units from "../units";
|
|
4
4
|
import ActTable from '../table/act-table'
|
|
5
5
|
// import StatActTable from '../table/stat-act-table'
|
|
@@ -7,12 +7,18 @@ import HCDataSource from "../tmpl/hc-data-source";
|
|
|
7
7
|
import ModalDtmplView from "../detail/view/modal-dtmpl-view";
|
|
8
8
|
import DtmplEditPage from "../detail/edit/dtmpl-edit-page";
|
|
9
9
|
import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
10
|
+
import {Button, Drawer, Space} from "antd";
|
|
10
11
|
|
|
11
12
|
//以列表为入口的,页面内列表,基本原则是所有交互在页面内完成,不会触发路由。
|
|
12
13
|
|
|
13
14
|
export interface LtmplPageProps {
|
|
14
15
|
sourceId:string,
|
|
15
16
|
mainCode?:string;
|
|
17
|
+
showView?: (code: string,toCustomPage?:boolean) => void,
|
|
18
|
+
doCreate?: (toCustomPage?:boolean) => void,
|
|
19
|
+
doEdit?: (code: string,mode:AddOrUpdate,toCustomPage?:boolean) => void,
|
|
20
|
+
doSearch?: (params: object) => void,
|
|
21
|
+
doRAction?:(ractionId:string,mainCode:string)=>void,
|
|
16
22
|
};
|
|
17
23
|
|
|
18
24
|
export interface LtmplPageState {
|
|
@@ -21,6 +27,8 @@ export interface LtmplPageState {
|
|
|
21
27
|
showDtmplView:boolean;
|
|
22
28
|
selectedCode:string;
|
|
23
29
|
showDtmplEdit:boolean;
|
|
30
|
+
showDraw:boolean;
|
|
31
|
+
ractionId:string,
|
|
24
32
|
};
|
|
25
33
|
|
|
26
34
|
class LtmplPage extends React.PureComponent<LtmplPageProps, LtmplPageState> {
|
|
@@ -31,6 +39,8 @@ class LtmplPage extends React.PureComponent<LtmplPageProps, LtmplPageState> {
|
|
|
31
39
|
showDtmplView:false,
|
|
32
40
|
showDtmplEdit:false,
|
|
33
41
|
selectedCode:undefined,
|
|
42
|
+
showDraw:false,
|
|
43
|
+
ractionId:undefined,
|
|
34
44
|
}
|
|
35
45
|
|
|
36
46
|
async componentDidMount() {
|
|
@@ -104,17 +114,24 @@ class LtmplPage extends React.PureComponent<LtmplPageProps, LtmplPageState> {
|
|
|
104
114
|
showDtmplEdit:true,
|
|
105
115
|
})
|
|
106
116
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
117
|
+
doRAction = (ractionId:string,mainCode:string) => {
|
|
118
|
+
this.setState({
|
|
119
|
+
selectedCode:mainCode,
|
|
120
|
+
showDraw:true,
|
|
121
|
+
ractionId
|
|
122
|
+
})
|
|
123
|
+
}
|
|
112
124
|
doCreate = () => {
|
|
113
125
|
this.setState({
|
|
114
126
|
selectedCode:null,
|
|
115
127
|
showDtmplEdit:true,
|
|
116
128
|
})
|
|
117
129
|
}
|
|
130
|
+
closeDrawer=()=>{
|
|
131
|
+
this.setState({
|
|
132
|
+
showDraw:false,
|
|
133
|
+
})
|
|
134
|
+
}
|
|
118
135
|
|
|
119
136
|
doSearch = (params_) => {
|
|
120
137
|
const { sourceId,mainCode} = this.props;
|
|
@@ -144,16 +161,16 @@ class LtmplPage extends React.PureComponent<LtmplPageProps, LtmplPageState> {
|
|
|
144
161
|
|
|
145
162
|
|
|
146
163
|
render() {
|
|
147
|
-
const {ltmplConfigRes,criteriaData,showDtmplView,selectedCode,showDtmplEdit} = this.state;
|
|
148
|
-
const { sourceId,mainCode} = this.props;
|
|
164
|
+
const {ltmplConfigRes,criteriaData,showDtmplView,selectedCode,showDtmplEdit,ractionId,showDraw} = this.state;
|
|
165
|
+
const { sourceId,mainCode,showView,doCreate,doEdit,doSearch,doRAction} = this.props;
|
|
149
166
|
|
|
150
167
|
if (!ltmplConfigRes) {
|
|
151
168
|
return <></>;
|
|
152
169
|
} else {
|
|
153
170
|
const {buttons}=ltmplConfigRes.ltmplConfig
|
|
154
171
|
return <>
|
|
155
|
-
<ActTable mainCode={mainCode} showView={this.showView}
|
|
156
|
-
doSearch={this.doSearch} doEdit={this.doEdit} doCreate={this.doCreate}
|
|
172
|
+
<ActTable mainCode={mainCode} showView={showView?showView:this.showView} doRAction={doRAction?doRAction:this.doRAction}
|
|
173
|
+
doSearch={doSearch?doSearch:this.doSearch} doEdit={doEdit?doEdit:this.doEdit} doCreate={doCreate?doCreate:this.doCreate}
|
|
157
174
|
sourceId={sourceId} criteriaData={criteriaData}
|
|
158
175
|
ltmplConfig={ltmplConfigRes.ltmplConfig} />
|
|
159
176
|
{buttons.includes('detail') ?
|
|
@@ -161,7 +178,7 @@ class LtmplPage extends React.PureComponent<LtmplPageProps, LtmplPageState> {
|
|
|
161
178
|
this.setState({
|
|
162
179
|
showDtmplView:false,
|
|
163
180
|
})}
|
|
164
|
-
}
|
|
181
|
+
} mainCode={mainCode}
|
|
165
182
|
sourceId={sourceId}
|
|
166
183
|
code={selectedCode}> </ModalDtmplView> : ""}
|
|
167
184
|
{buttons.includes('dtmplEdit') || buttons.includes('dtmplAdd') ?
|
|
@@ -170,9 +187,31 @@ class LtmplPage extends React.PureComponent<LtmplPageProps, LtmplPageState> {
|
|
|
170
187
|
showDtmplEdit:false,
|
|
171
188
|
})}}
|
|
172
189
|
sourceId={sourceId}
|
|
190
|
+
mainCode={mainCode}
|
|
173
191
|
code={selectedCode}
|
|
174
192
|
onOk={this.handleDtmplEdit} />
|
|
175
193
|
: ""}
|
|
194
|
+
<Drawer
|
|
195
|
+
placement={'left'}
|
|
196
|
+
title="关联查询"
|
|
197
|
+
closable={true}
|
|
198
|
+
mask={false}
|
|
199
|
+
onClose={this.closeDrawer}
|
|
200
|
+
visible={showDraw}
|
|
201
|
+
width={'calc(100% - 280px)'}
|
|
202
|
+
style={{
|
|
203
|
+
maxWidth: 1960,
|
|
204
|
+
}}
|
|
205
|
+
extra={
|
|
206
|
+
<Space>
|
|
207
|
+
<Button onClick={this.closeDrawer}>关闭</Button>
|
|
208
|
+
</Space>
|
|
209
|
+
}
|
|
210
|
+
>
|
|
211
|
+
{
|
|
212
|
+
<LtmplPage sourceId={ractionId} mainCode={selectedCode}></LtmplPage>
|
|
213
|
+
}
|
|
214
|
+
</Drawer>
|
|
176
215
|
</>
|
|
177
216
|
}
|
|
178
217
|
|
|
@@ -15,6 +15,7 @@ interface ModelSelectTableProps {
|
|
|
15
15
|
maxSelectedRows: number,
|
|
16
16
|
visible: boolean,
|
|
17
17
|
sourceId: string,
|
|
18
|
+
mainCode:string,
|
|
18
19
|
exceptCodes?: string[],
|
|
19
20
|
onCancel: () => void,
|
|
20
21
|
onOK: (selectedRows: SelectedRow[]) => void,
|
|
@@ -53,10 +54,10 @@ class ModelSelectTable extends React.PureComponent<ModelSelectTableProps, ModelS
|
|
|
53
54
|
pageSize: defaultPageSize ? defaultPageSize : 10,
|
|
54
55
|
virtualEndPageNo: undefined,
|
|
55
56
|
}
|
|
56
|
-
const {sourceId, exceptCodes} = this.props;
|
|
57
|
+
const {sourceId, exceptCodes,mainCode} = this.props;
|
|
57
58
|
/** 构建 dataSource **/
|
|
58
59
|
//构建过滤条件
|
|
59
|
-
let queryKey: QueryKey = await HcserviceV3.requestLtmplQueryKey(sourceId, {exceptCodes, ...criteriaData, ...pageInfo});
|
|
60
|
+
let queryKey: QueryKey = await HcserviceV3.requestLtmplQueryKey(sourceId, {exceptCodes, ...criteriaData, ...pageInfo,mainCode});
|
|
60
61
|
this.setState({
|
|
61
62
|
queryKey,
|
|
62
63
|
criteriaData,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {Button, Input, message, Table, Tooltip} from 'antd';
|
|
2
|
+
import {Button, Input, message, Table, Tooltip,Space,Tag,Row,Col,Form,Typography} from 'antd';
|
|
3
3
|
import {
|
|
4
4
|
AlignLeftOutlined,
|
|
5
5
|
DeleteOutlined,
|
|
@@ -20,8 +20,12 @@ import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
|
20
20
|
import CollapseCard from '../controls/collapse-card'
|
|
21
21
|
import RowEditor from '../detail/edit/row-editor'
|
|
22
22
|
import Action from "../controls/action";
|
|
23
|
-
|
|
23
|
+
import EntryControl from "../controls/entry-control";
|
|
24
|
+
import CountingTag from "../controls/counting-tag";
|
|
25
|
+
const FormItem = Form.Item
|
|
26
|
+
const { Text} = Typography;
|
|
24
27
|
interface RelationTableProps {
|
|
28
|
+
mainCode?:string,
|
|
25
29
|
parentId: string,
|
|
26
30
|
loading: boolean,
|
|
27
31
|
viewOrEdit: ViewOrEdit,
|
|
@@ -196,17 +200,7 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
196
200
|
}) : ""}
|
|
197
201
|
{/*行编辑*/}
|
|
198
202
|
{rowEdit ?
|
|
199
|
-
|
|
200
|
-
// <Tooltip placement="left" title="编辑当前行">
|
|
201
|
-
// <Button
|
|
202
|
-
// type='primary'
|
|
203
|
-
// icon={<EditOutlined/>}
|
|
204
|
-
// size="small"
|
|
205
|
-
// // onClick={() => {
|
|
206
|
-
// // this.showRowEditModel(record.code)
|
|
207
|
-
// // }}
|
|
208
|
-
// ></Button> </Tooltip></Popover>
|
|
209
|
-
<RowEditor buttonIcon={<EditOutlined/>} dtmplData={this.getRowEditData(record.code)}
|
|
203
|
+
<RowEditor buttonIcon={<EditOutlined/>} dtmplData={this.getRowEditData(record.code)}
|
|
210
204
|
fieldGroupConfig={fieldGroupConfig}
|
|
211
205
|
onOk={this.handleRowEdit}
|
|
212
206
|
tooltipTitle={"编辑当前行"}></RowEditor> : ""}
|
|
@@ -337,8 +331,6 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
337
331
|
codes.push(row.code);
|
|
338
332
|
}
|
|
339
333
|
await this.add(codes);
|
|
340
|
-
|
|
341
|
-
|
|
342
334
|
}
|
|
343
335
|
|
|
344
336
|
add = async (codes: string[]) => {
|
|
@@ -367,27 +359,6 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
367
359
|
})
|
|
368
360
|
}
|
|
369
361
|
|
|
370
|
-
// edit = async (code: string) => {
|
|
371
|
-
//
|
|
372
|
-
// }
|
|
373
|
-
|
|
374
|
-
// showRowEditModel = (code?: string) => {
|
|
375
|
-
// const {value} = this.props;
|
|
376
|
-
// let selectedDtmplData = undefined;
|
|
377
|
-
// if (code) {
|
|
378
|
-
// for (let dtmplData of value) {
|
|
379
|
-
// if (code == dtmplData.code) {
|
|
380
|
-
// selectedDtmplData = dtmplData;
|
|
381
|
-
// break;
|
|
382
|
-
// }
|
|
383
|
-
// }
|
|
384
|
-
// }
|
|
385
|
-
// this.setState({
|
|
386
|
-
// showRowEdit: true,
|
|
387
|
-
// selectedDtmplData,
|
|
388
|
-
// })
|
|
389
|
-
// }
|
|
390
|
-
|
|
391
362
|
getRowEditData = (code?: string) => {
|
|
392
363
|
const {value} = this.props;
|
|
393
364
|
let data = undefined;
|
|
@@ -483,20 +454,11 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
483
454
|
const buttonDisabled: boolean = fieldGroupConfig.max ? fieldGroupConfig.max <= (value ? value.length : 0) : false;
|
|
484
455
|
|
|
485
456
|
if (viewOrEdit == 'edit') {
|
|
486
|
-
return
|
|
457
|
+
return <Row>
|
|
458
|
+
<Col span={20}>
|
|
459
|
+
<Space>
|
|
487
460
|
{buttons.includes('rowAdd') ?
|
|
488
|
-
|
|
489
|
-
// // <Button
|
|
490
|
-
// // disabled={buttonDisabled}
|
|
491
|
-
// // type='primary'
|
|
492
|
-
// // icon={<PlusOutlined/>}
|
|
493
|
-
// // size="small"
|
|
494
|
-
// // // onClick={() => {
|
|
495
|
-
// // // this.showRowEditModel()
|
|
496
|
-
// // // }}
|
|
497
|
-
// // style={{marginBottom: 10, marginRight: 10}}
|
|
498
|
-
// // >新建一行</Button></Popover>
|
|
499
|
-
<RowEditor buttonStyle={{marginBottom: 10, marginRight: 10}} buttonTitle={"新建一行"}
|
|
461
|
+
<RowEditor disabled={buttonDisabled} buttonStyle={{marginBottom: 10}} buttonTitle={"新建一行"}
|
|
500
462
|
fieldGroupConfig={fieldGroupConfig}
|
|
501
463
|
onOk={this.handleRowEdit}
|
|
502
464
|
></RowEditor>
|
|
@@ -508,7 +470,7 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
508
470
|
icon={<PlusSquareOutlined/>}
|
|
509
471
|
size="small"
|
|
510
472
|
onClick={this.showAddDtmplModel}
|
|
511
|
-
style={{marginBottom: 10
|
|
473
|
+
style={{marginBottom: 10}}
|
|
512
474
|
>新增</Button> : ""}
|
|
513
475
|
{buttons.includes('selectAdd') ?
|
|
514
476
|
<Button
|
|
@@ -517,9 +479,18 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
517
479
|
icon={<SnippetsOutlined/>}
|
|
518
480
|
size="small"
|
|
519
481
|
onClick={this.showSelect}
|
|
520
|
-
style={{marginBottom: 10
|
|
482
|
+
style={{marginBottom: 10}}
|
|
521
483
|
>选择</Button> : ""}
|
|
522
|
-
|
|
484
|
+
<FormItem name={'$virtual'+fieldGroupConfig.id}
|
|
485
|
+
style={{ margin: 0}}
|
|
486
|
+
rules={fieldGroupConfig.min? [{
|
|
487
|
+
required: true, message: `请选择或添加${fieldGroupConfig.title}`,
|
|
488
|
+
}] :null}>
|
|
489
|
+
<CountingTag min={fieldGroupConfig.min+""} style={{marginBottom: 10}} count={value?value.length:0}></CountingTag>
|
|
490
|
+
</FormItem>
|
|
491
|
+
</Space>
|
|
492
|
+
</Col>
|
|
493
|
+
</Row>
|
|
523
494
|
} else {
|
|
524
495
|
return "";
|
|
525
496
|
}
|
|
@@ -533,7 +504,7 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
533
504
|
|
|
534
505
|
render() {
|
|
535
506
|
|
|
536
|
-
const {fieldGroupConfig, value, parentId, loading, initCollapse} = this.props;
|
|
507
|
+
const {fieldGroupConfig, value, parentId, loading, initCollapse,mainCode} = this.props;
|
|
537
508
|
const {pageSize,selectedCode, showDtmplView, showSelectTable, showDtmplEdit, tableLoading, showRowEdit, selectedDtmplData} = this.state;
|
|
538
509
|
|
|
539
510
|
const {buttons} = fieldGroupConfig;
|
|
@@ -564,12 +535,14 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
564
535
|
className={`hoverable`}
|
|
565
536
|
headStyle={{background: "#f2f4f5"}}
|
|
566
537
|
loading={loading}
|
|
538
|
+
bodyStyle={{padding:'6px'}}
|
|
567
539
|
extra={<Input.Search onSearch={this.searchValue} allowClear placeholder="关键字搜索"/>
|
|
568
540
|
}
|
|
569
541
|
>
|
|
570
542
|
<div className="editTableList">
|
|
571
543
|
{this.buildButtons()}
|
|
572
544
|
<Table scroll={{scrollToFirstRowOnChange: false}}
|
|
545
|
+
locale={{emptyText:<div style={{textAlign:'center',width:'100%'}}><Text disabled>暂无数据...</Text></div>}}
|
|
573
546
|
bordered
|
|
574
547
|
loading={tableLoading}
|
|
575
548
|
dataSource={this.buildDataSource()}
|
|
@@ -580,11 +553,11 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
580
553
|
</div>
|
|
581
554
|
</CollapseCard>
|
|
582
555
|
{buttons.includes('detail') ?
|
|
583
|
-
<ModalDtmplView visible={showDtmplView} onCancel={this.hiddenEntityView}
|
|
556
|
+
<ModalDtmplView mainCode={mainCode?mainCode:parentId} visible={showDtmplView} onCancel={this.hiddenEntityView}
|
|
584
557
|
sourceId={fieldGroupConfig.id}
|
|
585
558
|
code={selectedCode}> </ModalDtmplView> : ""}
|
|
586
559
|
{buttons.includes('dtmplEdit') || buttons.includes('dtmplAdd') ?
|
|
587
|
-
<DtmplEditPage visible={showDtmplEdit} onCancel={this.hiddenEntityEdit}
|
|
560
|
+
<DtmplEditPage mainCode={mainCode?mainCode:parentId} visible={showDtmplEdit} onCancel={this.hiddenEntityEdit}
|
|
588
561
|
sourceId={fieldGroupConfig.id}
|
|
589
562
|
code={selectedCode}
|
|
590
563
|
onOk={selectedCode ? this.handleDtmplEdit : this.handleDtmplAdd} />
|
|
@@ -598,7 +571,7 @@ class RelationTable extends React.PureComponent<RelationTableProps, RelationTabl
|
|
|
598
571
|
<ModelSelectTable maxSelectedRows={fieldGroupConfig.max} visible={showSelectTable}
|
|
599
572
|
onOK={this.select} onCancel={() => {
|
|
600
573
|
this.setState({showSelectTable: false})
|
|
601
|
-
}} exceptCodes={exceptCodes}
|
|
574
|
+
}} exceptCodes={exceptCodes} mainCode={mainCode?mainCode:parentId}
|
|
602
575
|
sourceId={fieldGroupConfig.id}></ModelSelectTable> : ""}
|
|
603
576
|
|
|
604
577
|
</>
|
|
@@ -10,6 +10,7 @@ import CriteriaForm from "../form/criteria-form";
|
|
|
10
10
|
import ViewControl from "../controls/view-control";
|
|
11
11
|
|
|
12
12
|
interface SelectTableProps {
|
|
13
|
+
mainCode?:string,
|
|
13
14
|
maxSelectedRows?: number,
|
|
14
15
|
sourceId: string,
|
|
15
16
|
selectedRows: SelectedRow[];
|
|
@@ -45,6 +46,7 @@ class SelectTable extends React.PureComponent<SelectTableProps, SelectTableStat>
|
|
|
45
46
|
this.setState({
|
|
46
47
|
loading: true,
|
|
47
48
|
})
|
|
49
|
+
const {mainCode}=this.props;
|
|
48
50
|
const {defaultPageSize} = selectConfig;
|
|
49
51
|
let pageInfo = {
|
|
50
52
|
pageNo: 1,
|
|
@@ -54,7 +56,7 @@ class SelectTable extends React.PureComponent<SelectTableProps, SelectTableStat>
|
|
|
54
56
|
const {sourceId} = this.props;
|
|
55
57
|
/** 构建 dataSource **/
|
|
56
58
|
//构建过滤条件
|
|
57
|
-
let queryKey: QueryKey = await HcserviceV3.requestLtmplQueryKey(sourceId, {...criteriaData, ...pageInfo});
|
|
59
|
+
let queryKey: QueryKey = await HcserviceV3.requestLtmplQueryKey(sourceId, {...criteriaData, ...pageInfo,mainCode});
|
|
58
60
|
this.setState({
|
|
59
61
|
queryKey,
|
|
60
62
|
criteriaData,
|
|
@@ -36,6 +36,7 @@ SupportInputTypes.add('select');
|
|
|
36
36
|
SupportInputTypes.add('multiselect');
|
|
37
37
|
SupportInputTypes.add('checkbox');
|
|
38
38
|
SupportInputTypes.add('radio');
|
|
39
|
+
SupportInputTypes.add('yes-no-switch');
|
|
39
40
|
SupportInputTypes.add('caselect');
|
|
40
41
|
SupportInputTypes.add('relation');
|
|
41
42
|
SupportInputTypes.add('file');
|
|
@@ -20,7 +20,7 @@ const ltmplConfigMap: Map<string, LtmplConfigRes> = new Map<string, LtmplConfigR
|
|
|
20
20
|
const l2LtmplConfigMap: Map<string, LtmplConfigRes> = new Map<string, LtmplConfigRes>();
|
|
21
21
|
const dtmplConfigMap: Map<string, DtmplConfig> = new Map<string, DtmplConfig>();
|
|
22
22
|
const viewDtmplConfigMap: Map<string, DtmplConfig> = new Map<string, DtmplConfig>();
|
|
23
|
-
|
|
23
|
+
const addDtmplConfigMap: Map<string, DtmplConfig> = new Map<string, DtmplConfig>();
|
|
24
24
|
|
|
25
25
|
function findUnloadEnumMstrucIdOfFields(fields:FieldBase[]) {
|
|
26
26
|
const mstrucIdArray = [];
|
|
@@ -182,6 +182,15 @@ HCDataSource.requestViewDtmplConfig = async function ( sourceId: string) {
|
|
|
182
182
|
return viewDtmplConfigMap.get(sourceId);
|
|
183
183
|
};
|
|
184
184
|
|
|
185
|
+
HCDataSource.requestAddDtmplConfig = async function ( sourceId: string) {
|
|
186
|
+
if (!addDtmplConfigMap.has(sourceId)) {
|
|
187
|
+
addDtmplConfigMap.set(sourceId, await HcserviceV3.requestAddDtmplConfig(sourceId));
|
|
188
|
+
//加载枚举
|
|
189
|
+
await loadEnumOfDtmplConfig(addDtmplConfigMap.get(sourceId));
|
|
190
|
+
}
|
|
191
|
+
return addDtmplConfigMap.get(sourceId);
|
|
192
|
+
};
|
|
193
|
+
|
|
185
194
|
HCDataSource.getEnums = function (mstrucId:string): EnumItem[] {
|
|
186
195
|
//这里是不是后续可以考虑防止串改
|
|
187
196
|
return enumMap.get(mstrucId);
|
|
@@ -279,6 +288,7 @@ HCDataSource.clearOnly =async function () {
|
|
|
279
288
|
ltmplConfigMap.clear();
|
|
280
289
|
dtmplConfigMap.clear();
|
|
281
290
|
viewDtmplConfigMap.clear();
|
|
291
|
+
addDtmplConfigMap.clear();
|
|
282
292
|
selectConfigMap.clear();
|
|
283
293
|
l2LtmplConfigMap.clear();
|
|
284
294
|
optionsMap.clear();
|
|
@@ -77,6 +77,17 @@ export default class HcserviceV3 {
|
|
|
77
77
|
return res.dtmplConfig;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
static async requestAddDtmplConfig(sourceId:string) {
|
|
81
|
+
|
|
82
|
+
let url = `/v3/add-dtmpl/config`
|
|
83
|
+
let res = await Super.super({
|
|
84
|
+
url,
|
|
85
|
+
method: "GET",
|
|
86
|
+
query:{sourceId}
|
|
87
|
+
});
|
|
88
|
+
return res.dtmplConfig;
|
|
89
|
+
}
|
|
90
|
+
|
|
80
91
|
// static async requestUserDtmplConfig() {
|
|
81
92
|
// let url = `/v3/user/dtmpl/config`
|
|
82
93
|
// let res = await Super.super({
|
|
@@ -144,6 +144,8 @@ export interface SelectConfig extends TmplBase {
|
|
|
144
144
|
columns: ColumnConfig[];
|
|
145
145
|
criterias: CriteriaConfig[];
|
|
146
146
|
defaultCriteriaValue?:object;
|
|
147
|
+
characteristicColumn:ColumnConfig;
|
|
148
|
+
primaryCriteria:CriteriaConfig;
|
|
147
149
|
}
|
|
148
150
|
|
|
149
151
|
export interface RActionConfig extends OrderableTmplBase {
|
|
@@ -249,10 +251,11 @@ export interface VControlProps extends ControlBaseProps {
|
|
|
249
251
|
export interface ControlBaseProps {
|
|
250
252
|
id?:any;
|
|
251
253
|
value?: any;
|
|
252
|
-
fieldConfig
|
|
254
|
+
fieldConfig?: FieldConfig;
|
|
253
255
|
itemType?: string;
|
|
254
256
|
style?: object;
|
|
255
257
|
disabled?: boolean;
|
|
258
|
+
mainCode?:string;
|
|
256
259
|
}
|
|
257
260
|
|
|
258
261
|
export interface SelectedRow {
|