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,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import {RefObject} from 'react'
|
|
3
|
-
import {Button, Checkbox as AntdCheckbox, Popconfirm, Popover,} from 'antd'
|
|
3
|
+
import {Button, Checkbox as AntdCheckbox, Popconfirm, Popover,Tooltip} from 'antd'
|
|
4
4
|
import './index.css'
|
|
5
5
|
import {ActionConfig, Comparator, DtmplData} from "../../tmpl/interface";
|
|
6
6
|
import {FormInstance} from "antd/lib/form/hooks/useForm";
|
|
@@ -8,9 +8,10 @@ import {ButtonType} from "antd/lib/button/button";
|
|
|
8
8
|
import FieldsEditCard from "../../detail/edit/fields-edit-card"
|
|
9
9
|
import {SizeType} from "antd/lib/config-provider/SizeContext";
|
|
10
10
|
import ActionUtils from './utils';
|
|
11
|
+
import Icon from '../../icon';
|
|
11
12
|
|
|
12
13
|
const CheckboxGroup = AntdCheckbox.Group;
|
|
13
|
-
|
|
14
|
+
export type ActionButtonIconType = 'icon' | 'icon-title' | 'title'
|
|
14
15
|
export type ActionButtonType = 'primary-block' | 'dashed' | 'primary'
|
|
15
16
|
export type ActionButtonHiddenType = 'hidden' | 'disabled'
|
|
16
17
|
|
|
@@ -24,6 +25,7 @@ interface ActionProps {
|
|
|
24
25
|
buttonType?: ActionButtonType,
|
|
25
26
|
hiddenType?: ActionButtonHiddenType,
|
|
26
27
|
buttonSize?: SizeType,
|
|
28
|
+
iconType:ActionButtonIconType,
|
|
27
29
|
};
|
|
28
30
|
|
|
29
31
|
interface ActionState {
|
|
@@ -37,6 +39,7 @@ export default class Action extends React.PureComponent<ActionProps, ActionState
|
|
|
37
39
|
buttonType: 'dashed',
|
|
38
40
|
hiddenType: 'hidden',
|
|
39
41
|
buttonSize: undefined,
|
|
42
|
+
iconType:'icon-title',
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
state = {
|
|
@@ -149,10 +152,25 @@ export default class Action extends React.PureComponent<ActionProps, ActionState
|
|
|
149
152
|
onValuesChange={this.onValuesChange}/>}>
|
|
150
153
|
<Button danger={actionConfig.beforeExeConfirm == 'danger'} type={this.getButtonType()} block={this.blockButton()} size={buttonSize}
|
|
151
154
|
onClick={() => this.setState({popoverVisible: !popoverVisible})}
|
|
152
|
-
disabled={disabled_} >{
|
|
155
|
+
disabled={disabled_} >{this.getTitle()}</Button>
|
|
153
156
|
</Popover>
|
|
154
157
|
}
|
|
155
158
|
|
|
159
|
+
getTitle=()=>{
|
|
160
|
+
const {actionConfig,iconType} = this.props;
|
|
161
|
+
if(actionConfig.icon){
|
|
162
|
+
if(iconType=='icon-title'){
|
|
163
|
+
return <><Icon type={actionConfig.icon}></Icon>{actionConfig.title}</>
|
|
164
|
+
}else if(iconType=='icon'){
|
|
165
|
+
return <Tooltip placement="top" title={actionConfig.title}><Icon type={actionConfig.icon}></Icon>{''}</Tooltip>
|
|
166
|
+
}else{
|
|
167
|
+
return actionConfig.title;
|
|
168
|
+
}
|
|
169
|
+
}else{
|
|
170
|
+
return actionConfig.title;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
156
174
|
|
|
157
175
|
getCodes = () => {
|
|
158
176
|
const {data,} = this.props;
|
|
@@ -194,7 +212,7 @@ export default class Action extends React.PureComponent<ActionProps, ActionState
|
|
|
194
212
|
cancelText="取消"
|
|
195
213
|
>
|
|
196
214
|
<Button size={buttonSize} type={bType} block={block} disabled={disabled_}
|
|
197
|
-
>{
|
|
215
|
+
>{this.getTitle()}</Button>
|
|
198
216
|
</Popconfirm> :
|
|
199
217
|
actionConfig.beforeExeConfirm == 'danger' ?
|
|
200
218
|
<Popconfirm key={actionConfig.id}
|
|
@@ -209,12 +227,12 @@ export default class Action extends React.PureComponent<ActionProps, ActionState
|
|
|
209
227
|
okType={'danger'}
|
|
210
228
|
>
|
|
211
229
|
<Button type={bType} block={block} danger={true} size={buttonSize} disabled={disabled_}
|
|
212
|
-
>{
|
|
230
|
+
>{this.getTitle()}</Button>
|
|
213
231
|
</Popconfirm> :
|
|
214
232
|
<Button type={bType} block={block} size={buttonSize}
|
|
215
233
|
onClick={() => doAction(actionConfig.id, codes, {})}
|
|
216
234
|
disabled={disabled_}
|
|
217
|
-
>{
|
|
235
|
+
>{this.getTitle()}</Button>
|
|
218
236
|
}
|
|
219
237
|
|
|
220
238
|
render() {
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import {Drawer, Space,Button,ButtonProps} from 'antd'
|
|
3
|
-
import {CQueryConfig} from "../../tmpl/interface";
|
|
3
|
+
import {CQueryConfig,PageType} from "../../tmpl/interface";
|
|
4
4
|
import LtmplPage from "./../../module/ltmpl-page";
|
|
5
5
|
import {
|
|
6
6
|
EditOutlined,
|
|
7
7
|
} from '@ant-design/icons';
|
|
8
8
|
import Units from '../../units'
|
|
9
|
-
import
|
|
9
|
+
import DtmplEditPage from "../../detail/edit/dtmpl-edit-page";
|
|
10
10
|
import DtmplEdit from "../../detail/edit/dtmpl-edit";
|
|
11
|
-
export type PageType='modal'|'drawer'
|
|
12
11
|
interface CquickButtonProps extends ButtonProps{
|
|
13
12
|
mainCode:string;
|
|
14
13
|
cQueryConfig:CQueryConfig;
|
|
@@ -67,33 +66,13 @@ class CquickButton extends React.PureComponent<CquickButtonProps, CquickButtonSt
|
|
|
67
66
|
}}>{outlinedMap[cQueryConfig.title]?outlinedMap[cQueryConfig.title]:cQueryConfig.title}</Button>}
|
|
68
67
|
{!showDraw?null:
|
|
69
68
|
cQueryConfig.type=='edit'?
|
|
70
|
-
|
|
69
|
+
<DtmplEditPage pageType={pageType} visible={showDraw} onCancel={()=>{
|
|
71
70
|
this.setState({
|
|
72
71
|
showDraw:false,
|
|
73
72
|
})}}
|
|
74
73
|
sourceId={cQueryConfig.id}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
<Drawer
|
|
78
|
-
placement={'left'}
|
|
79
|
-
closable={true}
|
|
80
|
-
mask={false}
|
|
81
|
-
onClose={this.closeDrawer}
|
|
82
|
-
visible={showDraw}
|
|
83
|
-
width={'calc(100% - 280px)'}
|
|
84
|
-
style={{
|
|
85
|
-
maxWidth: 1960,
|
|
86
|
-
overflowY:'hidden',
|
|
87
|
-
}}
|
|
88
|
-
extra={
|
|
89
|
-
<Space>
|
|
90
|
-
<Button onClick={this.closeDrawer}>关闭</Button>
|
|
91
|
-
</Space>
|
|
92
|
-
}
|
|
93
|
-
>
|
|
94
|
-
|
|
95
|
-
<DtmplEdit sourceId={cQueryConfig.id} code={mcode} ></DtmplEdit>
|
|
96
|
-
</Drawer>
|
|
74
|
+
code={mcode}
|
|
75
|
+
onOk={this.closeDrawer} />
|
|
97
76
|
:
|
|
98
77
|
<Drawer
|
|
99
78
|
placement={'left'}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import {DatePicker as AntdDatePicker,TimePicker} from "antd";
|
|
3
3
|
import moment from "moment";
|
|
4
|
+
import type { Moment } from "moment";
|
|
4
5
|
import {FieldConfig,EControlProps} from "../../tmpl/interface";
|
|
5
6
|
import Units from "../../units";
|
|
6
|
-
import
|
|
7
|
+
import type { RangePickerProps } from 'antd/es/date-picker';
|
|
7
8
|
|
|
8
9
|
const {RangePicker} = AntdDatePicker;
|
|
9
10
|
|
|
@@ -15,38 +16,30 @@ interface DataPickerProps extends EControlProps{
|
|
|
15
16
|
|
|
16
17
|
const DatePicker: React.FC<DataPickerProps> = (props) => {
|
|
17
18
|
|
|
18
|
-
const {id,value:propsValue, itemType, fieldConfig, onChange,style} = props;
|
|
19
|
+
const {id,value:propsValue, itemType, fieldConfig, onChange,style,min,max} = props;
|
|
19
20
|
let value=propsValue;
|
|
20
21
|
let format = Units.getMomentFormat(itemType);
|
|
21
22
|
|
|
22
|
-
const changeValue = (value) => {
|
|
23
|
+
const changeValue = (value:Moment) => {
|
|
23
24
|
if (onChange) {
|
|
24
|
-
onChange(value?
|
|
25
|
+
onChange(value?value.format(format):undefined);
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
const changeRangeValue = (value:
|
|
29
|
+
const changeRangeValue = (value:Moment[]) => {
|
|
29
30
|
if (onChange) {
|
|
30
31
|
if(!value){
|
|
31
32
|
onChange(value);
|
|
32
33
|
}else if(value.length===2 && value[0] && value[1]){
|
|
33
|
-
onChange(
|
|
34
|
+
onChange(value[0].format(format)+"~"+value[1].format(format));
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// changeRangeValue(TmplConfigAnalysis.current(value,format));
|
|
43
|
-
// break;
|
|
44
|
-
// default:
|
|
45
|
-
// changeValue(TmplConfigAnalysis.current(value,format)[0]);
|
|
46
|
-
// break;
|
|
47
|
-
// }
|
|
48
|
-
//
|
|
49
|
-
// }
|
|
39
|
+
const disabledDate: RangePickerProps['disabledDate'] = current => {
|
|
40
|
+
// console.log('current',moment(min,format).format(format));
|
|
41
|
+
return current && ( (max && moment(current.format(format),format) > moment(max,format)) || (min && moment(current.format(format),format) <moment(min,format)));
|
|
42
|
+
};
|
|
50
43
|
|
|
51
44
|
let entryControl = undefined;
|
|
52
45
|
let picker:"date" | "time" | "year" | "month" | "week" | "quarter"="date";
|
|
@@ -63,6 +56,7 @@ const DatePicker: React.FC<DataPickerProps> = (props) => {
|
|
|
63
56
|
style={{...style}}
|
|
64
57
|
picker={picker}
|
|
65
58
|
format={format}
|
|
59
|
+
disabledDate={disabledDate}
|
|
66
60
|
value={momentValue}
|
|
67
61
|
disabled={fieldConfig.disabled}
|
|
68
62
|
onChange={changeValue}
|
|
@@ -75,6 +69,7 @@ const DatePicker: React.FC<DataPickerProps> = (props) => {
|
|
|
75
69
|
entryControl = <AntdDatePicker
|
|
76
70
|
id={id}
|
|
77
71
|
style={{...style}}
|
|
72
|
+
disabledDate={disabledDate}
|
|
78
73
|
showTime={{format: Units.getDateTimeFormat(itemType)}}
|
|
79
74
|
picker='date'
|
|
80
75
|
format={format}
|
|
@@ -94,6 +89,7 @@ const DatePicker: React.FC<DataPickerProps> = (props) => {
|
|
|
94
89
|
entryControl = <RangePicker id={id} picker={picker}
|
|
95
90
|
style={{...style}}
|
|
96
91
|
format={format}
|
|
92
|
+
disabledDate={disabledDate}
|
|
97
93
|
value={momentValue}
|
|
98
94
|
disabled={fieldConfig.disabled}
|
|
99
95
|
onChange={changeRangeValue}/>;
|
|
@@ -108,6 +104,7 @@ const DatePicker: React.FC<DataPickerProps> = (props) => {
|
|
|
108
104
|
format={format}
|
|
109
105
|
style={{...style}}
|
|
110
106
|
value={momentValue}
|
|
107
|
+
disabledDate={disabledDate}
|
|
111
108
|
disabled={fieldConfig.disabled}
|
|
112
109
|
onChange={changeRangeValue}/>;
|
|
113
110
|
break;
|
|
@@ -201,10 +201,12 @@ export default class EntitySelect extends React.PureComponent<InnerEntitySelectP
|
|
|
201
201
|
pageInfo = queryData.pageInfo;
|
|
202
202
|
queryData.entities.forEach((item, index) => {
|
|
203
203
|
let title = item.fieldMap[titleId];
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
204
|
+
if(title){
|
|
205
|
+
let ts=title.split('@R@');
|
|
206
|
+
let t=ts && ts.length>0?ts[ts.length-1]:title;
|
|
207
|
+
let option = this.toOption(item.code,t , onEntityClick);
|
|
208
|
+
options.push(option);
|
|
209
|
+
}
|
|
208
210
|
})
|
|
209
211
|
return {options, touchEnd: queryData.touchEnd};
|
|
210
212
|
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import {Button, Select, Spin,TreeSelect} from 'antd'
|
|
3
|
+
import {EControlProps, PageInfo, QueryData, QueryKey, SelectConfig, SourceName} from "../../tmpl/interface";
|
|
4
|
+
import {SearchOutlined} from '@ant-design/icons';
|
|
5
|
+
import debounce from 'lodash/debounce';
|
|
6
|
+
import './index.css';
|
|
7
|
+
import HcserviceV3 from "../../tmpl/hcservice-v3";
|
|
8
|
+
import HCDataSource from "../../tmpl/hc-data-source";
|
|
9
|
+
|
|
10
|
+
interface LabTreeSelectProps extends EControlProps {
|
|
11
|
+
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
interface LabTreeSelectState {
|
|
15
|
+
treeData: object[],
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
type LoadDataSource = {
|
|
19
|
+
options: any[],
|
|
20
|
+
touchEnd: boolean,
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default class LabTreeSelect extends React.PureComponent<LabTreeSelectProps, LabTreeSelectState> {
|
|
24
|
+
|
|
25
|
+
static defaultProps = {
|
|
26
|
+
maxSelected: 100,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
state = {
|
|
30
|
+
treeData: [],
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async componentDidMount() {
|
|
34
|
+
this.setState({treeData:await this.loadSchoolLevelUnit()}) ;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
//第一步查根
|
|
38
|
+
loadSchoolLevelUnit=async ()=>{
|
|
39
|
+
let data=[];
|
|
40
|
+
let res=await HcserviceV3.requestLtmplQueryTop('221036732522497',{});
|
|
41
|
+
|
|
42
|
+
if(res.entities){
|
|
43
|
+
res.entities.forEach((item, index) => {
|
|
44
|
+
let d={};
|
|
45
|
+
d["id"]=item.code;
|
|
46
|
+
d['level']=1;
|
|
47
|
+
d["pId"]=0;
|
|
48
|
+
d["title"]= item.fieldMap['228431869288450'];
|
|
49
|
+
d["value"]=d["id"]+"@R@"+d["title"];
|
|
50
|
+
d["key"]=d["value"];
|
|
51
|
+
d["selectable"]=false;
|
|
52
|
+
data.push(d);
|
|
53
|
+
})
|
|
54
|
+
}
|
|
55
|
+
return data;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
loadLab=async (mainCode)=>{
|
|
59
|
+
let data=[];
|
|
60
|
+
let res=await HcserviceV3.requestLtmplQueryTop('228261345665025',{mainCode});
|
|
61
|
+
|
|
62
|
+
if(res.entities){
|
|
63
|
+
res.entities.forEach((item, index) => {
|
|
64
|
+
let d={};
|
|
65
|
+
d["id"]=item.code;
|
|
66
|
+
d['level']=2;
|
|
67
|
+
d["pId"]=mainCode;
|
|
68
|
+
d["title"]= item.fieldMap['227350535774211'];
|
|
69
|
+
d["value"]=d["id"]+"@R@"+d["title"];
|
|
70
|
+
d["key"]=d["value"];
|
|
71
|
+
d["selectable"]=false;
|
|
72
|
+
data.push(d);
|
|
73
|
+
})
|
|
74
|
+
}
|
|
75
|
+
return data;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
loadRoom=async (mainCode)=>{
|
|
79
|
+
let data=[];
|
|
80
|
+
let res=await HcserviceV3.requestLtmplQueryTop('228261733638145',{mainCode});
|
|
81
|
+
|
|
82
|
+
if(res.entities){
|
|
83
|
+
res.entities.forEach((item, index) => {
|
|
84
|
+
let d={};
|
|
85
|
+
d["id"]=item.code;
|
|
86
|
+
d['level']=3;
|
|
87
|
+
d["pId"]=mainCode;
|
|
88
|
+
d["title"]= item.fieldMap['227349996806149'];
|
|
89
|
+
d["value"]=d["id"]+"@R@"+d["title"];
|
|
90
|
+
d["key"]=d["value"];
|
|
91
|
+
d["isLeaf"]=true;
|
|
92
|
+
data.push(d);
|
|
93
|
+
})
|
|
94
|
+
}
|
|
95
|
+
return data;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
onChange=(newValue: string)=>{
|
|
99
|
+
const {onChange} = this.props;
|
|
100
|
+
console.log("newValue",newValue);
|
|
101
|
+
onChange(newValue);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
onLoadData = async (node) => {
|
|
106
|
+
console.log('node:',node);
|
|
107
|
+
const {treeData}=this.state;
|
|
108
|
+
if(node['level']==1){
|
|
109
|
+
//加载实验室
|
|
110
|
+
let d = await this.loadLab(node['id']);
|
|
111
|
+
console.log('treeData dddd ',d);
|
|
112
|
+
this.setState({
|
|
113
|
+
treeData:[...treeData,...d]
|
|
114
|
+
})
|
|
115
|
+
}else if(node['level']==2){
|
|
116
|
+
let d = await this.loadRoom(node['id']);
|
|
117
|
+
console.log('treeData dddd ',d);
|
|
118
|
+
this.setState({
|
|
119
|
+
treeData:[...treeData,...d]
|
|
120
|
+
})
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
render() {
|
|
125
|
+
const {id,value, fieldConfig, style} = this.props;
|
|
126
|
+
const {treeData} = this.state;
|
|
127
|
+
let v;
|
|
128
|
+
if(value){
|
|
129
|
+
v=value.split("@R@")[1];
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
console.log('treeData',treeData);
|
|
133
|
+
return (
|
|
134
|
+
<TreeSelect
|
|
135
|
+
treeDataSimpleMode
|
|
136
|
+
style={{ width: '100%' ,minWidth:'260px'}}
|
|
137
|
+
value={v}
|
|
138
|
+
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
|
139
|
+
placeholder="--请选择--"
|
|
140
|
+
onChange={this.onChange}
|
|
141
|
+
loadData={this.onLoadData}
|
|
142
|
+
treeData={treeData}
|
|
143
|
+
/>
|
|
144
|
+
)
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
|
|
@@ -33,7 +33,19 @@ export default class EntitySelect extends React.PureComponent<EntitySelectProps,
|
|
|
33
33
|
let newValue = [];
|
|
34
34
|
if (selectedRows) {
|
|
35
35
|
for (let row of selectedRows) {
|
|
36
|
-
|
|
36
|
+
let title:string=null;
|
|
37
|
+
if(row.title instanceof Array){
|
|
38
|
+
title = row.title[0];
|
|
39
|
+
}else{
|
|
40
|
+
title = row.title;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
console.log('1323',title);
|
|
44
|
+
if(row.title && row.title.includes("@R@")){
|
|
45
|
+
let ts= title.split('@R@');
|
|
46
|
+
title=ts[ts.length-1];
|
|
47
|
+
}
|
|
48
|
+
newValue.push(row.code + '@R@' + title);
|
|
37
49
|
}
|
|
38
50
|
}
|
|
39
51
|
onChange(newValue);
|
|
@@ -16,6 +16,9 @@ import Cascader from './cascader'
|
|
|
16
16
|
import EntitySelect from "./entity-select/entity-select";
|
|
17
17
|
import PopoverEntitySelect from './entity-select/popover-entity-select'
|
|
18
18
|
import ColorPicker from './color-picker'
|
|
19
|
+
import LabTreeSelect from './entity-select/lab-tree-select'
|
|
20
|
+
import Units from "../units";
|
|
21
|
+
import {ProgramConfig} from "../index";
|
|
19
22
|
// import EntitySelect from "./entity-select/inner-entity-select";
|
|
20
23
|
// import ChemStruc from "./chemstruc/graph";
|
|
21
24
|
const CheckboxGroup=Checkbox.Group;
|
|
@@ -66,8 +69,13 @@ function renderControl(id:any,fieldConfig: FieldConfig, fieldValue: any, onChang
|
|
|
66
69
|
let disabled: boolean = fieldConfig.disabled;
|
|
67
70
|
|
|
68
71
|
let viewOrEdit: ViewOrEdit = 'edit';
|
|
72
|
+
let fieldConfigM:string=fieldConfig.min;
|
|
73
|
+
let min=(fieldConfigM || fieldConfigM=='0' ) ? Units.configParamTrans(fieldConfigM) : undefined;
|
|
74
|
+
fieldConfigM=fieldConfig.max;
|
|
75
|
+
let max=(fieldConfigM || fieldConfigM=='0' ) ? Units.configParamTrans(fieldConfigM) : undefined;;
|
|
76
|
+
|
|
69
77
|
let controlProps = {
|
|
70
|
-
id, fieldConfig, itemType, viewOrEdit, onChange, disabled, value: fieldValue, style: {minWidth: 220, width: '100%'}
|
|
78
|
+
id, fieldConfig,min,max, itemType, viewOrEdit, onChange, disabled, value: fieldValue, style: {minWidth: 220, width: '100%'}
|
|
71
79
|
}
|
|
72
80
|
|
|
73
81
|
let antdControlProps = {
|
|
@@ -80,6 +88,11 @@ function renderControl(id:any,fieldConfig: FieldConfig, fieldValue: any, onChang
|
|
|
80
88
|
disabled={true}
|
|
81
89
|
/>;
|
|
82
90
|
|
|
91
|
+
//自定义组件为先
|
|
92
|
+
if(ProgramConfig.getCustomEditControl(itemType)){
|
|
93
|
+
return React.createElement(ProgramConfig.getCustomEditControl(itemType),controlProps);
|
|
94
|
+
}
|
|
95
|
+
|
|
83
96
|
switch (itemType) {
|
|
84
97
|
case 'int':
|
|
85
98
|
case 'decimal':
|
|
@@ -200,11 +213,15 @@ function renderControl(id:any,fieldConfig: FieldConfig, fieldValue: any, onChang
|
|
|
200
213
|
case 'relselect':
|
|
201
214
|
case 'refselect':
|
|
202
215
|
case 'entity-select':
|
|
203
|
-
entryControl=<EntitySelect maxSelected={
|
|
216
|
+
entryControl=<EntitySelect maxSelected={max?parseInt(max):undefined} {...controlProps} />
|
|
204
217
|
// entryControl = <EntitySelect {...controlProps} sourceName={'rcriteria'}></EntitySelect>
|
|
205
218
|
break;
|
|
206
219
|
case 'table-entity-select':
|
|
207
|
-
entryControl=<PopoverEntitySelect maxSelected={
|
|
220
|
+
entryControl=<PopoverEntitySelect maxSelected={max?parseInt(max):undefined} {...controlProps} />
|
|
221
|
+
// entryControl = <EntitySelect {...controlProps} sourceName={'rcriteria'}></EntitySelect>
|
|
222
|
+
break;
|
|
223
|
+
case 'lab-tree-select':
|
|
224
|
+
entryControl=<LabTreeSelect maxSelected={max?parseInt(max):undefined} {...controlProps} />
|
|
208
225
|
// entryControl = <EntitySelect {...controlProps} sourceName={'rcriteria'}></EntitySelect>
|
|
209
226
|
break;
|
|
210
227
|
case 'progress':
|
|
@@ -5,7 +5,6 @@ import HCDataSource from "../../tmpl/hc-data-source";
|
|
|
5
5
|
|
|
6
6
|
interface EnumTagsProps extends VControlProps {
|
|
7
7
|
|
|
8
|
-
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
|
|
@@ -15,10 +14,17 @@ const EnumTags: React.FC<EnumTagsProps> = (props) => {
|
|
|
15
14
|
let viewControl = undefined;
|
|
16
15
|
let tagList = [];
|
|
17
16
|
if (value) {
|
|
18
|
-
value
|
|
17
|
+
let v=value;
|
|
18
|
+
if(value instanceof Array){
|
|
19
|
+
|
|
20
|
+
}else {
|
|
21
|
+
v=value.split(',');
|
|
22
|
+
}
|
|
23
|
+
v.forEach(v => {
|
|
19
24
|
let color = HCDataSource.getEnumValueColor(fieldConfig.mstrucId, value);
|
|
20
25
|
tagList.push(<Tag key={v} color={color ? color : 'blue'}>{v}</Tag>)
|
|
21
26
|
})
|
|
27
|
+
|
|
22
28
|
}
|
|
23
29
|
viewControl = <span className="infoStyle">
|
|
24
30
|
{tagList}
|
|
@@ -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
|
|
|
@@ -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
|
}
|