aldehyde 0.0.1
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/LICENSE +201 -0
- package/README.md +1 -0
- package/dist/163.js +2 -0
- package/dist/163.js.LICENSE.txt +43 -0
- package/dist/41.js +1 -0
- package/dist/aldehyde.js +2 -0
- package/dist/aldehyde.js.LICENSE.txt +122 -0
- package/dist/chemstruc-graph.js +1 -0
- package/dist/css/163-24392163d3c7b54ea806.css +11 -0
- package/dist/css/290-5e8e152675ab7d201c00.css +886 -0
- package/dist/css/chemstruc-graph-87868f791bf92fb80db9.css +29 -0
- package/dist/css/main-2e6725ec1b56da516cee.css +256 -0
- package/dist/html-editor-draft.js +2 -0
- package/dist/html-editor-draft.js.LICENSE.txt +5 -0
- package/dist/images/logo-06f6a5d8.png +0 -0
- package/dist/index.html +4 -0
- package/dist/signature.js +2 -0
- package/dist/signature.js.LICENSE.txt +17 -0
- package/package.json +180 -0
- package/src/components/chart/antd/Chart.js +32 -0
- package/src/components/chart/antd/Chart10000.js +90 -0
- package/src/components/chart/antd/Max2DimLineChart.js +128 -0
- package/src/components/chart/antd/PieChart1.js +54 -0
- package/src/components/chart/antd/PieChart2.js +56 -0
- package/src/components/chart/antd/chart-utils.tsx +50 -0
- package/src/components/chart/antd/column-chart-sub.tsx +67 -0
- package/src/components/chart/antd/line-chart-sub.tsx +65 -0
- package/src/components/chart/antd/pie-chart-sub.tsx +54 -0
- package/src/components/chart/antd/statview-d2-chart.tsx +125 -0
- package/src/components/chart/statview-l2-chart.tsx +69 -0
- package/src/components/controls/action/index.css +9 -0
- package/src/components/controls/action/index.tsx +228 -0
- package/src/components/controls/action/utils.tsx +122 -0
- package/src/components/controls/auto-complete/index.tsx +80 -0
- package/src/components/controls/cascader/index.js +97 -0
- package/src/components/controls/chemstruc/graph.tsx +150 -0
- package/src/components/controls/chemstruc/index.css +28 -0
- package/src/components/controls/collapse-card/index.css +9 -0
- package/src/components/controls/collapse-card/index.tsx +59 -0
- package/src/components/controls/color-picker/index.css +27 -0
- package/src/components/controls/color-picker/index.tsx +88 -0
- package/src/components/controls/cquery/cquick-button.tsx +117 -0
- package/src/components/controls/date-picker/index.tsx +141 -0
- package/src/components/controls/entity-select/entity-select.tsx +277 -0
- package/src/components/controls/entity-select/index.css +6 -0
- package/src/components/controls/entity-select/popover-entity-select.tsx +112 -0
- package/src/components/controls/entry-control.tsx +240 -0
- package/src/components/controls/enum-badge/index.tsx +28 -0
- package/src/components/controls/enum-tag/index.tsx +30 -0
- package/src/components/controls/file-view/drawer-file-view.tsx +69 -0
- package/src/components/controls/file-view/index.tsx +145 -0
- package/src/components/controls/html-editor/draft.tsx +161 -0
- package/src/components/controls/html-editor/tinymce.js +55 -0
- package/src/components/controls/input-number/index.tsx +101 -0
- package/src/components/controls/input-range/index.tsx +48 -0
- package/src/components/controls/password-setter/index.css +3 -0
- package/src/components/controls/password-setter/index.js +70 -0
- package/src/components/controls/progress/index.tsx +61 -0
- package/src/components/controls/relation-existion/index.css +4 -0
- package/src/components/controls/relation-existion/index.tsx +108 -0
- package/src/components/controls/rfield/index.css +4 -0
- package/src/components/controls/rfield/index.tsx +161 -0
- package/src/components/controls/signature/index.tsx +162 -0
- package/src/components/controls/steps/index.tsx +58 -0
- package/src/components/controls/text/ellipsis-text.tsx +70 -0
- package/src/components/controls/upload/index.tsx +122 -0
- package/src/components/controls/view-control.tsx +177 -0
- package/src/components/detail/button/cquery-button-bar.tsx +112 -0
- package/src/components/detail/button/index.css +43 -0
- package/src/components/detail/button/submit-button-bar.tsx +151 -0
- package/src/components/detail/dtmpl.css +53 -0
- package/src/components/detail/edit/dtmpl-edit.tsx +218 -0
- package/src/components/detail/edit/fields-edit-card.tsx +103 -0
- package/src/components/detail/edit/modal-dtmpl-edit.tsx +198 -0
- package/src/components/detail/edit/modal-row-edit.tsx +72 -0
- package/src/components/detail/edit/post-result/index.tsx +52 -0
- package/src/components/detail/edit/row-edit-card.tsx +125 -0
- package/src/components/detail/edit/row-editor.tsx +71 -0
- package/src/components/detail/rightbar/index.css +35 -0
- package/src/components/detail/rightbar/index.tsx +76 -0
- package/src/components/detail/view/act-dtmpl-view.tsx +155 -0
- package/src/components/detail/view/dtmpl-view.tsx +143 -0
- package/src/components/detail/view/field-view-group.tsx +73 -0
- package/src/components/detail/view/modal-dtmpl-view.tsx +56 -0
- package/src/components/detail/view/snapshot-timeline.tsx +130 -0
- package/src/components/exportor/export-frame.css +3 -0
- package/src/components/exportor/export-frame.tsx +194 -0
- package/src/components/exportor/index.tsx +60 -0
- package/src/components/form/criteria-form.tsx +241 -0
- package/src/components/form/dtmpl-form.css +4 -0
- package/src/components/form/dtmpl-form.tsx +272 -0
- package/src/components/form/field-group-form.tsx +75 -0
- package/src/components/form/fields-form.tsx +51 -0
- package/src/components/form/form-Item-group.tsx +99 -0
- package/src/components/form/index.css +13 -0
- package/src/components/import/excel-import.tsx +316 -0
- package/src/components/import/index.css +54 -0
- package/src/components/import/template-builder.js +474 -0
- package/src/components/import/template.css +51 -0
- package/src/components/layout/MainPage.tsx +230 -0
- package/src/components/layout/footer/index.css +6 -0
- package/src/components/layout/footer/index.js +17 -0
- package/src/components/layout/header/index.css +86 -0
- package/src/components/layout/header/index.tsx +58 -0
- package/src/components/layout/menu/block.tsx +88 -0
- package/src/components/layout/menu/l2menu-message-bar.tsx +118 -0
- package/src/components/layout/menu/l2menu-quick-bar.tsx +132 -0
- package/src/components/layout/menu/menu-2layers.tsx +92 -0
- package/src/components/layout/menu/menu-render.tsx +49 -0
- package/src/components/layout/menu/reset-password.tsx +185 -0
- package/src/components/layout/menu/user-bar.tsx +97 -0
- package/src/components/layout/menu/userinfo-bar.tsx +70 -0
- package/src/components/layout/sidebar/index.css +26 -0
- package/src/components/layout/sidebar/index.tsx +38 -0
- package/src/components/login.js +137 -0
- package/src/components/module/criteria-page.tsx +175 -0
- package/src/components/module/dtmpl-page.tsx +70 -0
- package/src/components/module/ltmpl-page.tsx +181 -0
- package/src/components/routable/dtmpl-route.tsx +96 -0
- package/src/components/routable/import-route.tsx +28 -0
- package/src/components/routable/ltmpl-route.tsx +158 -0
- package/src/components/table/act-table.tsx +635 -0
- package/src/components/table/column/column-selector.tsx +79 -0
- package/src/components/table/column/index.css +14 -0
- package/src/components/table/index.css +45 -0
- package/src/components/table/l2-act-table.tsx +85 -0
- package/src/components/table/modal-select-table.tsx +248 -0
- package/src/components/table/pagination.css +15 -0
- package/src/components/table/pagination.tsx +72 -0
- package/src/components/table/query-table.tsx +331 -0
- package/src/components/table/relation-table.tsx +600 -0
- package/src/components/table/select-table.tsx +247 -0
- package/src/components/table/selected-rows-card.tsx +62 -0
- package/src/components/table/stat/restat.tsx +79 -0
- package/src/components/table/table-util.tsx +33 -0
- package/src/components/tmpl/control-type-supportor.tsx +97 -0
- package/src/components/tmpl/hc-data-source.tsx +230 -0
- package/src/components/tmpl/hcservice-v3.tsx +624 -0
- package/src/components/tmpl/interface.tsx +308 -0
- package/src/components/tmpl/superagent.js +93 -0
- package/src/components/tmpl/tmpl-config-analysis.tsx +111 -0
- package/src/components/units/EncryptUtils.js +38 -0
- package/src/components/units/image.d.ts +8 -0
- package/src/components/units/index.tsx +536 -0
- package/src/components/units/logo.png +0 -0
- package/src/components/units/storage.js +3 -0
- package/src/components/welcome/HCWelcome.js +232 -0
- package/src/components/welcome/index.css +13 -0
- package/src/components/welcome/logo.png +0 -0
- package/src/components/welcome/quick-entrance.tsx +77 -0
- package/src/components/welcome/workbench.tsx +76 -0
- package/src/index.js +4 -0
- package/src/style/common.css +79 -0
- package/src/style/coverstyle.css +49 -0
- package/src/style/transstyle.css +24 -0
- package/tsconfig.json +106 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Input} from "antd";
|
|
3
|
+
import {Editor} from '@tinymce/tinymce-react';
|
|
4
|
+
|
|
5
|
+
export default class HtmlEidtor extends React.Component {
|
|
6
|
+
//let [value,setValue] = useState();
|
|
7
|
+
state = {
|
|
8
|
+
value: undefined
|
|
9
|
+
}
|
|
10
|
+
componentDidMount() {
|
|
11
|
+
let {initialValue} = this.props;
|
|
12
|
+
this.setState({
|
|
13
|
+
value: initialValue
|
|
14
|
+
})
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
onChange = (content, editor) => {
|
|
18
|
+
console.log('Content was updated:', content);
|
|
19
|
+
this.setState({
|
|
20
|
+
value: content
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
onChange1 = (content, editor) => {
|
|
24
|
+
console.log('Content was updated11:', content);
|
|
25
|
+
this.setState({
|
|
26
|
+
value: content
|
|
27
|
+
})
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
render() {
|
|
32
|
+
let {initialValue} = this.props;
|
|
33
|
+
return <div>
|
|
34
|
+
{/*<Input style={{width:'220px'}} />*/}
|
|
35
|
+
<Editor
|
|
36
|
+
apiKey={'8htijpc1mghlxkfrfqr8puoylwqnv8nkth2hqvq709awthlo'}
|
|
37
|
+
initialValue={initialValue}
|
|
38
|
+
init={{
|
|
39
|
+
height: 200,
|
|
40
|
+
menubar: false,
|
|
41
|
+
plugins: [
|
|
42
|
+
'advlist autolink lists link image charmap print preview anchor',
|
|
43
|
+
'searchreplace visualblocks code fullscreen',
|
|
44
|
+
'insertdatetime media table paste code help wordcount'
|
|
45
|
+
],
|
|
46
|
+
toolbar:
|
|
47
|
+
'undo redo | formatselect | bold italic backcolor | \
|
|
48
|
+
alignleft aligncenter alignright alignjustify | \
|
|
49
|
+
bullist numlist outdent indent | removeformat | help'
|
|
50
|
+
}}
|
|
51
|
+
onEditorChange={this.props.onChange}
|
|
52
|
+
/>
|
|
53
|
+
</div>
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {InputNumber as AntdInputNumber,Space} from "antd";
|
|
3
|
+
import {EControlProps} from "../../tmpl/interface";
|
|
4
|
+
import Units from "../../units";
|
|
5
|
+
|
|
6
|
+
interface InputNumberProps extends EControlProps {
|
|
7
|
+
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const InputNumber: React.FC<InputNumberProps> = (props) => {
|
|
11
|
+
|
|
12
|
+
const {id,value, itemType, fieldConfig, onChange,style} = props;
|
|
13
|
+
|
|
14
|
+
let entryControl = undefined;
|
|
15
|
+
|
|
16
|
+
const changeValue = (value) => {
|
|
17
|
+
if (onChange) {
|
|
18
|
+
onChange(value);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
let valObj=Units.splitValue(value);
|
|
23
|
+
let valueBegin=valObj['valueBegin'], valueEnd=valObj['valueEnd'];
|
|
24
|
+
let valueSingle=value || value==0 ?value:null;
|
|
25
|
+
|
|
26
|
+
const changeBeginValue = (value) => {
|
|
27
|
+
if (onChange) {
|
|
28
|
+
onChange(Units.concatValue(value,valueEnd));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const changeEndValue = (value) => {
|
|
33
|
+
if (onChange) {
|
|
34
|
+
onChange(Units.concatValue(valueBegin,value));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const changeInt = (e) => { //只允许输入整数
|
|
39
|
+
if ((e.target.value || e.target.value==0) && !isNaN(e.target.value)) {
|
|
40
|
+
e.target.value = parseInt(e.target.value)
|
|
41
|
+
} else {
|
|
42
|
+
e.target.value = null
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
;
|
|
46
|
+
|
|
47
|
+
let placeholder = !fieldConfig.disabled ? `请输入${fieldConfig.title}` : "无需输入";
|
|
48
|
+
let disabled: boolean = fieldConfig.disabled;
|
|
49
|
+
|
|
50
|
+
let antdControlProps = {
|
|
51
|
+
id, placeholder, disabled,value
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
switch (itemType) {
|
|
55
|
+
case 'int':
|
|
56
|
+
entryControl = <AntdInputNumber style={{...style}} min={fieldConfig.min} max={fieldConfig.max}
|
|
57
|
+
{...antdControlProps} value={valueSingle}
|
|
58
|
+
onKeyUp={changeInt} onChange={changeValue}
|
|
59
|
+
/>
|
|
60
|
+
break;
|
|
61
|
+
case 'decimal':
|
|
62
|
+
case 'float':
|
|
63
|
+
case 'double':
|
|
64
|
+
entryControl = <AntdInputNumber style={{...style}}
|
|
65
|
+
{...antdControlProps} value={valueSingle} min={fieldConfig.min} max={fieldConfig.max}
|
|
66
|
+
// style={{width}}
|
|
67
|
+
step={0.1} onChange={changeValue}
|
|
68
|
+
/>
|
|
69
|
+
break;
|
|
70
|
+
case 'intrange':
|
|
71
|
+
entryControl =
|
|
72
|
+
<Space>
|
|
73
|
+
<AntdInputNumber min={fieldConfig.min} max={fieldConfig.max}
|
|
74
|
+
placeholder={`开始`} value={valueBegin}
|
|
75
|
+
onKeyUp={changeInt} onChange={changeBeginValue}
|
|
76
|
+
/>~
|
|
77
|
+
<AntdInputNumber min={fieldConfig.min} max={fieldConfig.max}
|
|
78
|
+
placeholder={`结束`} value={valueEnd}
|
|
79
|
+
onKeyUp={changeInt} onChange={changeEndValue}
|
|
80
|
+
/>
|
|
81
|
+
</Space>;
|
|
82
|
+
break;
|
|
83
|
+
case 'decimalrange':
|
|
84
|
+
entryControl =
|
|
85
|
+
<Space>
|
|
86
|
+
<AntdInputNumber min={fieldConfig.min} max={fieldConfig.max}
|
|
87
|
+
placeholder={`开始`} value={valueBegin}
|
|
88
|
+
onChange={changeBeginValue} step={0.1}
|
|
89
|
+
disabled={disabled}
|
|
90
|
+
/>~
|
|
91
|
+
<AntdInputNumber min={fieldConfig.min} max={fieldConfig.max}
|
|
92
|
+
placeholder={`结束`} value={valueEnd} step={0.1}
|
|
93
|
+
onChange={changeEndValue} disabled={disabled}
|
|
94
|
+
/>
|
|
95
|
+
</Space>;
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
return entryControl;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export default InputNumber;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {Input} from "antd";
|
|
3
|
+
import {EControlProps} from "../../tmpl/interface";
|
|
4
|
+
import Units from '../../units/'
|
|
5
|
+
|
|
6
|
+
interface InputRangeProps extends EControlProps {
|
|
7
|
+
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const InputRange: React.FC<InputRangeProps> = (props) => {
|
|
11
|
+
|
|
12
|
+
const {id,value, itemType, fieldConfig, onChange, style} = props;
|
|
13
|
+
|
|
14
|
+
let entryControl = undefined;
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
let valObj=Units.splitValue(value);
|
|
18
|
+
let valueBegin=valObj['valueBegin'], valueEnd=valObj['valueEnd'];
|
|
19
|
+
const changeBeginValue = ({ target: { value } }) => {
|
|
20
|
+
if (onChange) {
|
|
21
|
+
onChange(Units.concatValue(value,valueEnd));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const changeEndValue = ({ target: { value } }) => {
|
|
26
|
+
if (onChange) {
|
|
27
|
+
onChange(Units.concatValue(valueBegin,value));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
let disabled: boolean = fieldConfig.disabled;
|
|
32
|
+
entryControl =
|
|
33
|
+
<Input.Group compact>
|
|
34
|
+
<Input id={id} style={{ width: '45%' }} disabled={disabled} min={fieldConfig.min} max={fieldConfig.max}
|
|
35
|
+
placeholder={`开始`} value={valueBegin}
|
|
36
|
+
onChange={changeBeginValue}
|
|
37
|
+
/>
|
|
38
|
+
~
|
|
39
|
+
<Input style={{ width: '45%' }} disabled={disabled} min={fieldConfig.min} max={fieldConfig.max}
|
|
40
|
+
placeholder={`结束`} value={valueEnd}
|
|
41
|
+
onChange={changeEndValue}
|
|
42
|
+
/>
|
|
43
|
+
</Input.Group>;
|
|
44
|
+
|
|
45
|
+
return entryControl;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export default InputRange;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {Modal, Input, Form, message} from 'antd'
|
|
3
|
+
import {LockOutlined} from '@ant-design/icons';
|
|
4
|
+
import './index.css'
|
|
5
|
+
|
|
6
|
+
export default class SetPasswords extends React.Component {
|
|
7
|
+
|
|
8
|
+
handleOk = () => {
|
|
9
|
+
const {oldPass} = this.props
|
|
10
|
+
this.props.form.validateFields({force: true}, (err, values) => { //提交再次验证
|
|
11
|
+
if (!err) {
|
|
12
|
+
if (oldPass === values.oldpass) {
|
|
13
|
+
this.props.setNewPass(values.newpass)
|
|
14
|
+
} else {
|
|
15
|
+
message.error("原登录密码不正确!")
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
})
|
|
20
|
+
}
|
|
21
|
+
compareToFirstPassword = (rule, value, callback) => {
|
|
22
|
+
const form = this.props.form;
|
|
23
|
+
if (value && value !== form.getFieldValue('newpass')) {
|
|
24
|
+
callback('请输入相同的密码!');
|
|
25
|
+
} else {
|
|
26
|
+
callback();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
render() {
|
|
31
|
+
const {showSetPass, handleCancel} = this.props
|
|
32
|
+
return (
|
|
33
|
+
<Modal
|
|
34
|
+
title="修改密码"
|
|
35
|
+
visible={showSetPass}
|
|
36
|
+
onOk={this.handleOk}
|
|
37
|
+
destroyOnClose
|
|
38
|
+
onCancel={handleCancel}
|
|
39
|
+
className="setPass"
|
|
40
|
+
maskClosable={false}
|
|
41
|
+
>
|
|
42
|
+
<Form style={{width: "100%"}}>
|
|
43
|
+
<Form.Item label={"原登录密码"} name='oldpass' rules={[{required: true, message: '请输入原登录密码!'}]}>
|
|
44
|
+
<Input
|
|
45
|
+
prefix={<LockOutlined/>}
|
|
46
|
+
placeholder="请输入原登录密码"
|
|
47
|
+
type="password"
|
|
48
|
+
/>,
|
|
49
|
+
</Form.Item>
|
|
50
|
+
<Form.Item label={"新登录密码"} name='oldpass'> rules={[{required: true, message: '请输入新登录密码!'}]}
|
|
51
|
+
<Input
|
|
52
|
+
prefix={<LockOutlined/>}
|
|
53
|
+
type="password"
|
|
54
|
+
placeholder="请输入新登录密码"
|
|
55
|
+
/>,
|
|
56
|
+
</Form.Item>
|
|
57
|
+
<Form.Item label={"确认密码"}> name='apass' rules={[{required: true, message: '确认密码!'},
|
|
58
|
+
{validator: this.compareToFirstPassword,}
|
|
59
|
+
]}
|
|
60
|
+
<Input
|
|
61
|
+
prefix={<LockOutlined/>}
|
|
62
|
+
type="password"
|
|
63
|
+
placeholder="确认密码"
|
|
64
|
+
/>
|
|
65
|
+
</Form.Item>
|
|
66
|
+
</Form>
|
|
67
|
+
</Modal>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {InputNumber as AntdInputNumber,Progress as AntdProgress,Space} from "antd";
|
|
3
|
+
import {EControlProps,VEControlProps} from "../../tmpl/interface";
|
|
4
|
+
import Units from "../../units";
|
|
5
|
+
|
|
6
|
+
interface ProgressProps extends VEControlProps {
|
|
7
|
+
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const Progress: React.FC<ProgressProps> = (props) => {
|
|
11
|
+
|
|
12
|
+
const {value, itemType, fieldConfig, onChange,style,viewOrEdit} = props;
|
|
13
|
+
|
|
14
|
+
let val=0;
|
|
15
|
+
|
|
16
|
+
if (!value ) {
|
|
17
|
+
val=0;
|
|
18
|
+
}else{
|
|
19
|
+
if(isNaN(value)){
|
|
20
|
+
val= value;
|
|
21
|
+
}else {
|
|
22
|
+
val=value.toString();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const changeValue = (value) => {
|
|
27
|
+
if (onChange) {
|
|
28
|
+
onChange(value);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const changeInt = (e) => { //只允许输入整数
|
|
33
|
+
if (e.target.value && !isNaN(e.target.value)) {
|
|
34
|
+
e.target.value = parseInt(e.target.value)
|
|
35
|
+
} else {
|
|
36
|
+
e.target.value = 0
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
;
|
|
40
|
+
|
|
41
|
+
let placeholder = !fieldConfig.disabled ? `请输入${fieldConfig.title}` : "无需输入";
|
|
42
|
+
let disabled: boolean = fieldConfig.disabled;
|
|
43
|
+
|
|
44
|
+
let antdControlProps = {
|
|
45
|
+
placeholder, disabled,value
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
let entryControl;
|
|
49
|
+
|
|
50
|
+
if(viewOrEdit=='view' || fieldConfig.disabled){
|
|
51
|
+
entryControl= <AntdProgress width={90} percent={val} />
|
|
52
|
+
}else{
|
|
53
|
+
entryControl = <AntdInputNumber style={{...style}} min={0} max={100}
|
|
54
|
+
{...antdControlProps}
|
|
55
|
+
onKeyUp={changeInt} onChange={changeValue}
|
|
56
|
+
/>
|
|
57
|
+
}
|
|
58
|
+
return entryControl;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export default Progress;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import {Popover, Select} from 'antd'
|
|
3
|
+
import {EControlProps, SelectedRow} from "../../tmpl/interface";
|
|
4
|
+
import {SearchOutlined} from '@ant-design/icons';
|
|
5
|
+
import SelectTable from '../../table/select-table'
|
|
6
|
+
import './index.css'
|
|
7
|
+
|
|
8
|
+
interface RelationExistionProps extends EControlProps {
|
|
9
|
+
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
interface RelationExistionState {
|
|
13
|
+
showSelectTable: boolean;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default class RelationExistion extends React.PureComponent<RelationExistionProps, RelationExistionState> {
|
|
17
|
+
|
|
18
|
+
state = {
|
|
19
|
+
showSelectTable: false,
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
onClick = () => {
|
|
23
|
+
this.setState({
|
|
24
|
+
showSelectTable: true,
|
|
25
|
+
})
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
onClear = () => {
|
|
29
|
+
const { onChange} = this.props;
|
|
30
|
+
onChange([]);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
onDeselect=(val:string)=>{
|
|
34
|
+
const {value, onChange} = this.props;
|
|
35
|
+
let newValue = [];
|
|
36
|
+
if (value) {
|
|
37
|
+
for (let v of value) {
|
|
38
|
+
if(val!=v){
|
|
39
|
+
newValue.push(v);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
onChange(newValue);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
onSelect = (selectedRows: SelectedRow[]) => {
|
|
47
|
+
const {value, onChange} = this.props;
|
|
48
|
+
let newValue = [];
|
|
49
|
+
if (selectedRows) {
|
|
50
|
+
for (let row of selectedRows) {
|
|
51
|
+
newValue.push(row.code+ '@R@' +row.title );
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
onChange(newValue);
|
|
55
|
+
// this.setState({
|
|
56
|
+
// showSelectTable: false,
|
|
57
|
+
// })
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
render() {
|
|
62
|
+
const {id,value, itemType, fieldConfig, onChange, style} = this.props;
|
|
63
|
+
const {showSelectTable} = this.state;
|
|
64
|
+
let selectedRows: SelectedRow[] = [];
|
|
65
|
+
let relationOptions = []
|
|
66
|
+
if (value) {
|
|
67
|
+
value.forEach((v) => {
|
|
68
|
+
if (v.indexOf('@R@') > 0) {
|
|
69
|
+
let vs=v.split('@R@');
|
|
70
|
+
selectedRows.push({code: vs[0], title:vs[1]});
|
|
71
|
+
relationOptions.push({value: v, label: vs[1]});
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
}
|
|
75
|
+
return <>
|
|
76
|
+
<Popover placement="bottom" color={'#f0f0f0'} overlayStyle={{maxWidth: 'calc(100vw - 60px)', maxHeight: 'calc(100vh - 50px)',} }
|
|
77
|
+
overlayInnerStyle={{padding:'0px'}}
|
|
78
|
+
// getPopupContainer={(triggerNode) => {
|
|
79
|
+
// return triggerNode.parentNode;}}
|
|
80
|
+
content={<div style={{height:300,backgroundColor:'#fafafa',overflow:'auto',borderStyle:'solid',borderRadius:'6px',
|
|
81
|
+
borderWidth:'0px',borderColor:'#8c8c8c'}}><SelectTable selectedRows={selectedRows} sourceId={fieldConfig.id} onChange={this.onSelect}></SelectTable></div>}
|
|
82
|
+
trigger="click">
|
|
83
|
+
<Select id={id} style={{...style}}
|
|
84
|
+
value={value}
|
|
85
|
+
mode="multiple"
|
|
86
|
+
placeholder={`请选择${fieldConfig.title}`}
|
|
87
|
+
notFoundContent="请选择"
|
|
88
|
+
allowClear={true}
|
|
89
|
+
showArrow={true}
|
|
90
|
+
suffixIcon={<SearchOutlined/>}
|
|
91
|
+
dropdownStyle={{display: 'none'}}
|
|
92
|
+
onChange={(value)=>{
|
|
93
|
+
onChange(value)}
|
|
94
|
+
}
|
|
95
|
+
options={relationOptions}
|
|
96
|
+
>
|
|
97
|
+
</Select>
|
|
98
|
+
</Popover>
|
|
99
|
+
{/*<ModelSelectTable*/}
|
|
100
|
+
{/* maxSelectedRows={fieldConfig.max ? fieldConfig.max - (exceptCodes.length > 0 ? exceptCodes.length : 0) : 100}*/}
|
|
101
|
+
{/* visible={showSelectTable}*/}
|
|
102
|
+
{/* onOK={this.onSelect} onCancel={() => {*/}
|
|
103
|
+
{/* this.setState({showSelectTable: false})*/}
|
|
104
|
+
{/*}} sourceName={'rcriteria'} exceptCodes={exceptCodes}*/}
|
|
105
|
+
{/* sourceId={fieldConfig.id}></ModelSelectTable>*/}
|
|
106
|
+
</>;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import {Button, Popover, Space} from 'antd'
|
|
3
|
+
import {VControlProps} from "../../tmpl/interface";
|
|
4
|
+
import ModalDtmplView from '../../detail/view/modal-dtmpl-view'
|
|
5
|
+
import './index.css'
|
|
6
|
+
|
|
7
|
+
interface RfieldProps extends VControlProps {
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
interface RfieldState {
|
|
11
|
+
showDtmplView: boolean;
|
|
12
|
+
showSelectTable: boolean;
|
|
13
|
+
selectedCodes: string[];
|
|
14
|
+
openCode: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default class Rfield extends React.PureComponent<RfieldProps, RfieldState> {
|
|
18
|
+
|
|
19
|
+
state = {
|
|
20
|
+
showDtmplView: false,
|
|
21
|
+
showSelectTable: false,
|
|
22
|
+
selectedCodes: undefined,
|
|
23
|
+
openCode: undefined,
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
showRfieldDtmplView = (code) => {
|
|
28
|
+
this.setState({
|
|
29
|
+
openCode: code,
|
|
30
|
+
showDtmplView: true,
|
|
31
|
+
})
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
hiddenDtmplView = () => {
|
|
35
|
+
this.setState({
|
|
36
|
+
showDtmplView: false,
|
|
37
|
+
})
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
handleRFieldSelect = (id: string) => {
|
|
41
|
+
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
deleteRFieldValue = (id: string) => {
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
showCount = () => {
|
|
49
|
+
const {value} = this.props;
|
|
50
|
+
let valueArray: string[];
|
|
51
|
+
let vStr = "";
|
|
52
|
+
if (value instanceof Array) {
|
|
53
|
+
valueArray = value;
|
|
54
|
+
let i: number = 0;
|
|
55
|
+
for (let val of valueArray) {
|
|
56
|
+
i++;
|
|
57
|
+
let isRValue = val ? val.indexOf('@R@') > 0 : false;
|
|
58
|
+
let valueShow = isRValue ? val.split('@R@')[1] : val;
|
|
59
|
+
vStr = vStr + valueShow;
|
|
60
|
+
if (vStr.length >= 20) {
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return i;
|
|
65
|
+
} else {
|
|
66
|
+
return 1;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
needMore = () => {
|
|
71
|
+
const {value} = this.props;
|
|
72
|
+
let showCount = this.showCount();
|
|
73
|
+
let allCount = 0;
|
|
74
|
+
if (value instanceof Array) {
|
|
75
|
+
allCount = value.length;
|
|
76
|
+
} else {
|
|
77
|
+
allCount = 1;
|
|
78
|
+
}
|
|
79
|
+
if (allCount > showCount) {
|
|
80
|
+
return true;
|
|
81
|
+
} else {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
getValue = (count?: number) => {
|
|
87
|
+
const {fieldConfig, value,} = this.props;
|
|
88
|
+
const {buttons} = fieldConfig;
|
|
89
|
+
let valueArray: string[];
|
|
90
|
+
if (value instanceof Array) {
|
|
91
|
+
if (count && count > 0 && value.length > count) {
|
|
92
|
+
valueArray = value.slice(0, count);
|
|
93
|
+
} else {
|
|
94
|
+
valueArray = value;
|
|
95
|
+
}
|
|
96
|
+
} else {
|
|
97
|
+
if (value) {
|
|
98
|
+
valueArray = [value];
|
|
99
|
+
} else {
|
|
100
|
+
valueArray = [];
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
let dom;
|
|
104
|
+
if (buttons && buttons.includes('detail')) {
|
|
105
|
+
dom = <Space key={count?(count+1):1} size={[0, 4]} wrap>
|
|
106
|
+
{valueArray.map((val,index) => {
|
|
107
|
+
let isRValue = val ? val.indexOf('@R@') > 0 : false;
|
|
108
|
+
let valueShow = isRValue ? val.split('@R@')[1] : val;
|
|
109
|
+
let code = !val ? undefined : val.split('@R@')[0];
|
|
110
|
+
return isRValue ? <Button key={index} type="link" title=""
|
|
111
|
+
onClick={() => {
|
|
112
|
+
this.showRfieldDtmplView(code)
|
|
113
|
+
}}>{valueShow}
|
|
114
|
+
</Button> : <span key={index}>{valueShow}
|
|
115
|
+
</span>;
|
|
116
|
+
})
|
|
117
|
+
}
|
|
118
|
+
</Space>;
|
|
119
|
+
} else {
|
|
120
|
+
dom = <Space key={count?(count+2):2} size={[8, 16]} wrap>
|
|
121
|
+
{valueArray.map((val,index) => {
|
|
122
|
+
let isRValue = val ? val.indexOf('@R@') > 0 : false;
|
|
123
|
+
let valueShow = isRValue ? val.split('@R@')[1] : val;
|
|
124
|
+
let code = !val ? undefined : val.split('@R@')[0];
|
|
125
|
+
return <span key={index}>{valueShow}
|
|
126
|
+
</span>;
|
|
127
|
+
})
|
|
128
|
+
}
|
|
129
|
+
</Space>
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return dom;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
render() {
|
|
136
|
+
const {fieldConfig, value, itemType} = this.props;
|
|
137
|
+
const {showDtmplView, openCode} = this.state;
|
|
138
|
+
const {buttons} = fieldConfig;
|
|
139
|
+
|
|
140
|
+
// let isRValue = value ? value.indexOf('@R@') > 0 : false;
|
|
141
|
+
// let valueShow = isRValue ? value.split('@R@')[1] : "";
|
|
142
|
+
// let code = !value ? undefined : value.split('@R@')[0];
|
|
143
|
+
let showDom = this.getValue(this.showCount());
|
|
144
|
+
return <>
|
|
145
|
+
<Space key={3} size={[8, 16]} wrap style={{minWidth:'80px'}}>
|
|
146
|
+
{showDom}
|
|
147
|
+
{this.needMore() ?
|
|
148
|
+
<Popover overlayStyle={{maxWidth: '400px'}} placement="leftBottom" trigger="click"
|
|
149
|
+
content={this.getValue()}>
|
|
150
|
+
<Button key={'more'} type={"link"} size={'small'}
|
|
151
|
+
>更多...</Button>
|
|
152
|
+
</Popover> : null
|
|
153
|
+
}
|
|
154
|
+
{buttons && buttons.includes('detail') ?
|
|
155
|
+
<ModalDtmplView key={'mdv'} visible={showDtmplView} onCancel={this.hiddenDtmplView}
|
|
156
|
+
sourceId={fieldConfig.id}
|
|
157
|
+
code={openCode}> </ModalDtmplView> : ""}
|
|
158
|
+
</Space>
|
|
159
|
+
</>;
|
|
160
|
+
}
|
|
161
|
+
}
|