easy3wui 1.5.63 → 1.5.64-beta.2

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.
@@ -0,0 +1,196 @@
1
+ // import React, { PureComponent } from 'react';
2
+ // import { Form } from 'antd';
3
+ // import { Easy3wModal, Easy3wFormPage } from 'easy3wui';
4
+ // import { Modal } from 'antd/lib';
5
+
6
+ // class Easy3wEditBigTableForm extends PureComponent {
7
+ // constructor(props) {
8
+ // super(props);
9
+ // const { bidPureComponent } = this.props;
10
+ // if (bidPureComponent && typeof bidPureComponent === 'function') {
11
+ // bidPureComponent(this);
12
+ // }
13
+ // this.getOptionLst();
14
+ // this.state = {
15
+ // };
16
+ // }
17
+ // componentDidMount() {
18
+ // }
19
+ // componentWillUnmount() {
20
+ // }
21
+ // // 绑定组件
22
+ // bidPureComponent = (pureComponentName, that) => {
23
+ // this[pureComponentName] = that;
24
+ // }
25
+ // // 创建columns
26
+ // getOptionLst = () => {
27
+ // const { objOtherParameters } = this.props;
28
+ // const { columns } = objOtherParameters;
29
+ // const arrColumns = [];
30
+ // const columnsNew = [...columns];
31
+ // columnsNew.map((item, index) => {
32
+ // const { strName, name, editable, editor, otherEditable } = item;
33
+ // // if (editable || editor || otherEditable) { // 编辑
34
+ // if (editable || editor) { // 编辑
35
+ // arrColumns.push({
36
+ // label: strName || name,
37
+ // value: index,
38
+ // });
39
+ // }
40
+ // return item;
41
+ // });
42
+ // this.arrColumns = arrColumns;
43
+ // }
44
+ // // 获取批量录入字段
45
+ // getBatchField = () => {
46
+ // const { form, objOtherParameters } = this.props;
47
+ // const { columns } = objOtherParameters;
48
+ // const batchField = form.getFieldValue('batchField_easy3wView');
49
+ // const fieldRowItems = [];
50
+ // let hiddenItems = [];
51
+ // if (batchField) {
52
+ // const objColumn = columns[batchField];
53
+ // const { strName, name, key, fieldId, rowItem, unit, hiddeKeys, required = true, fieldType, options = [],
54
+ // cmptPros = {}, rules = [], ruleType, regex, regexMsg } = objColumn;
55
+ // // strNName 字段名称
56
+ // // name 字段名称
57
+ // // key 字段key
58
+ // // rowItem 字段行
59
+ // // unit 字段单位
60
+ // // hiddeKeys 隐藏字段key
61
+ // // required 是否必填
62
+ // // fieldType 字段类型
63
+ // // optionLst 选项列表
64
+ // // rules 校验规则
65
+ // // ruleType 校验规则类型
66
+ // // onChange 字段值变化回调
67
+ // // cmptPros 组件属性
68
+ // const arrHiddenItems = [];
69
+ // if (hiddeKeys) {
70
+ // const arrHiddenKeys = hiddeKeys.split(',');
71
+ // arrHiddenKeys.map((item) => {
72
+ // arrHiddenItems.push({
73
+ // fieldId: item,
74
+ // });
75
+ // return item;
76
+ // });
77
+ // hiddenItems = [...arrHiddenItems]; // 隐藏字段
78
+ // }
79
+ // const arrRules = [...rules];
80
+ // if (ruleType === 'phone') {
81
+ // arrRules.push({ pattern: /^1\d{10}$/, message: '手机格式错误!' });
82
+ // } else if (ruleType === 'email') {
83
+ // arrRules.push({ type: 'email', message: '邮箱地址格式错误!' });
84
+ // } else if (ruleType === 'idcard') {
85
+ // arrRules.push({ pattern: /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}[0-9Xx]$)/, message: '身份证格式错误!' });
86
+ // } else if (regex) {
87
+ // arrRules.push({ pattern: new RegExp(regex), message: regexMsg || '数据格式错误!' });
88
+ // }
89
+ // const fieldRowItem = {
90
+ // cols: [
91
+ // rowItem || {
92
+ // label: strName || name,
93
+ // fieldId: fieldId || key,
94
+ // fieldType: fieldType || 'input',
95
+ // value: '',
96
+ // required,
97
+ // cmptPros: {
98
+ // optionLst: options,
99
+ // options,
100
+ // addonAfter: unit || '',
101
+ // rules: arrRules,
102
+ // onChange: (...arg) => this.onChange(arg, objColumn),
103
+ // ...cmptPros,
104
+ // },
105
+ // },
106
+ // ],
107
+ // };
108
+ // fieldRowItems.push(fieldRowItem);
109
+ // }
110
+ // return { fieldRowItems, hiddenItems };
111
+ // }
112
+ // // 字段值变化回调
113
+ // onChange = (arg, objColumn) => {
114
+ // const { form } = this.props;
115
+ // const { onChange } = objColumn;
116
+ // if (onChange && typeof onChange === 'function') {
117
+ // onChange(form, arg, objColumn);
118
+ // }
119
+ // }
120
+ // // 保存
121
+ // touchConfirm = () => {
122
+ // const { confirmCallback, objOtherParameters } = this.props;
123
+ // this.props.form.validateFieldsAndScroll((err, values) => {
124
+ // if (!err) {
125
+ // const { batchField_easy3wView: batchField, ...valuesNew } = values;
126
+ // // delete values.batchField_easy3wView;
127
+ // if (confirmCallback && typeof confirmCallback === 'function') {
128
+ // const { columns } = objOtherParameters;
129
+ // const objColumn = columns[batchField];
130
+ // const { strName, name } = objColumn;
131
+ // // key 字段
132
+ // // required 必填
133
+ // // strName 字串名称
134
+ // // name 字段名称
135
+ // Modal.confirm({
136
+ // content: `请确认此列${strName || name}全部设置成录入值,将覆盖原值!`,
137
+ // onOk: () => {
138
+ // confirmCallback(valuesNew, objColumn);
139
+ // },
140
+ // onCancel: () => {
141
+ // },
142
+ // okText: '确认',
143
+ // cancelText: '取消',
144
+ // });
145
+ // }
146
+ // this.touchCancel();
147
+ // }
148
+ // });
149
+ // }
150
+ // // 取消
151
+ // touchCancel = () => {
152
+ // const { hideModal } = this.props;
153
+ // if (hideModal && typeof hideModal === 'function') {
154
+ // hideModal();
155
+ // }
156
+ // }
157
+ // render() {
158
+ // const { objOtherParameters, visible, form } = this.props;
159
+ // const { batchButtonText } = objOtherParameters;
160
+ // const footBtnArr = [
161
+ // { func: this.touchConfirm, cName: '保存' },
162
+ // { func: this.touchCancel, cName: '关闭' },
163
+ // ];
164
+ // const { fieldRowItems, hiddenItems } = this.getBatchField();
165
+ // const rowItems = [
166
+ // {
167
+ // cols: [
168
+ // {
169
+ // label: '录入内容',
170
+ // fieldId: 'batchField_easy3wView',
171
+ // fieldType: 'select',
172
+ // required: true,
173
+ // value: '',
174
+ // cmptPros: {
175
+ // optionLst: this.arrColumns,
176
+ // },
177
+ // },
178
+ // ],
179
+ // },
180
+ // ...fieldRowItems,
181
+ // ];
182
+ // return (
183
+ // <Easy3wModal
184
+ // title={batchButtonText || '批量录入'}
185
+ // visible={visible}
186
+ // onCancel={this.touchCancel}
187
+ // footBtnArr={footBtnArr}
188
+ // width="80%"
189
+ // >
190
+ // <Easy3wFormPage rowItems={rowItems} hiddenItems={hiddenItems} form={form} mixColFlag />
191
+ // </Easy3wModal>
192
+ // );
193
+ // }
194
+ // }
195
+ // export default Form.create()(Easy3wEditBigTableForm);
196
+ "use strict";
@@ -0,0 +1,45 @@
1
+ // import React from 'react';
2
+ // import ReactDataGrid from 'react-data-grid';
3
+
4
+ // const { editors } = ReactDataGrid;
5
+ // const { EditorBase } = editors;
6
+
7
+ // export default class EditorNumber extends EditorBase {
8
+ // setInputRef = (input) => {
9
+ // this.input = input;
10
+ // }
11
+ // // 获取 input 节点
12
+ // getInputNode = () => {
13
+ // return this.setInputRef();
14
+ // }
15
+ // // 获取 input 值
16
+ // getValue = () => {
17
+ // // const { value } = this.state;
18
+ // return { [this.props.column.key]: this.getInputNode().value };
19
+ // }
20
+ // // input 失去焦点
21
+ // onBlur = (event) => {
22
+ // const { onBlur, onCommit } = this.props;
23
+ // if (onBlur && typeof onBlur === 'function') {
24
+ // onBlur(event);
25
+ // }
26
+ // if (onCommit && typeof onCommit === 'function') {
27
+ // onCommit();
28
+ // }
29
+ // }
30
+
31
+ // render() {
32
+ // const { value } = this.props;
33
+ // return (
34
+ // <input
35
+ // ref={this.setInputRef}
36
+ // type="number"
37
+ // className="form-control"
38
+ // defaultValue={value}
39
+ // {...this.props}
40
+ // onBlur={this.onBlur}
41
+ // />
42
+ // );
43
+ // }
44
+ // }
45
+ "use strict";
@@ -0,0 +1,86 @@
1
+
2
+ // import React from 'react';
3
+ // // import ReactDOM from 'react-dom';
4
+ // import { DatePicker } from 'antd';
5
+ // import locale from 'antd/lib/date-picker/locale/zh_CN';
6
+ // import 'moment/locale/zh-cn';
7
+ // import moment from 'moment';
8
+ // import ReactDataGrid from 'react-data-grid';
9
+
10
+ // const { editors } = ReactDataGrid;
11
+ // const { EditorBase } = editors;
12
+
13
+ // moment.locale('zh-cn');
14
+ // const dateFormatDefault = 'YYYY-MM-DD';
15
+
16
+ // export default class EditorsDatePicker extends React.Component {
17
+ // constructor(props) {
18
+ // super(props);
19
+ // const { value, refCallback } = props;
20
+ // if (refCallback && refCallback instanceof Function) {
21
+ // refCallback(this);
22
+ // }
23
+ // this.state = {
24
+ // value,
25
+ // };
26
+ // }
27
+ // // 获取组件节点
28
+ // getReactDataGridZJ = (el) => {
29
+ // this.EditorsZJ = el;
30
+ // return el;
31
+ // }
32
+ // // 设置样式
33
+ // getStyle = () => {
34
+ // return {
35
+ // width: '100%',
36
+ // minWidth: '120px',
37
+ // };
38
+ // }
39
+ // // 获取 input 节点
40
+ // getInputNode = () => {
41
+ // return this.getReactDataGridZJ();
42
+ // }
43
+ // // 获取 input 值
44
+ // getValue = () => {
45
+ // const { value } = this.state;
46
+ // return { [this.props.column.key]: value };
47
+ // }
48
+ // // input 值改变时回调
49
+ // onChange = (momentDate, strDate) => {
50
+ // const { onChange, cmptPros = {} } = this.props;
51
+ // const { dateFormat } = cmptPros;
52
+ // if (onChange) {
53
+ // onChange(momentDate, strDate);
54
+ // }
55
+ // const value = momentDate ? momentDate.format(dateFormat || dateFormatDefault) : null;
56
+ // this.setState({ value });
57
+ // }
58
+ // // input 失去焦点时回调
59
+ // onBlur = () => {
60
+ // const { onCommit, onBlur } = this.props;
61
+ // if (onCommit) {
62
+ // onCommit();
63
+ // }
64
+ // }
65
+
66
+ // render() {
67
+ // const { cmptPros = {} } = this.props;
68
+ // const { dateFormat } = cmptPros;
69
+ // const { value } = this.state;
70
+ // return (
71
+ // <DatePicker
72
+ // style={this.getStyle()}
73
+ // autoFocus
74
+ // locale={locale}
75
+ // format={dateFormat || dateFormatDefault}
76
+ // value={value ? moment(value, dateFormat || dateFormatDefault) : null}
77
+ // ref={this.getReactDataGridZJ}
78
+ // // autoFocus
79
+ // {...cmptPros}
80
+ // onChange={this.onChange}
81
+ // onBlur={this.onBlur}
82
+ // />
83
+ // );
84
+ // }
85
+ // }
86
+ "use strict";
@@ -0,0 +1,73 @@
1
+
2
+ // import React from 'react';
3
+ // import ReactDOM from 'react-dom';
4
+ // import { InputNumber } from 'antd';
5
+ // import ReactDataGrid from 'react-data-grid';
6
+
7
+ // const { editors } = ReactDataGrid;
8
+ // const { EditorBase } = editors;
9
+
10
+ // export default class EditorsInputNumber extends React.Component {
11
+ // constructor(props) {
12
+ // super(props);
13
+ // const { value, refCallback } = props;
14
+ // if (refCallback && refCallback instanceof Function) {
15
+ // refCallback(this);
16
+ // }
17
+ // this.state = {
18
+ // value,
19
+ // };
20
+ // }
21
+ // componentDidMount() {
22
+ // const domNode = this.getInputNode();
23
+ // console.log('inputNode', domNode);
24
+ // }
25
+ // componentWillUnmount() {
26
+ // }
27
+ // // 设置样式
28
+ // getStyle = () => {
29
+ // return {
30
+ // width: '100%',
31
+ // };
32
+ // }
33
+ // // 获取 input 节点
34
+ // getInputNode = () => {
35
+ // return ReactDOM.findDOMNode(this);
36
+ // }
37
+ // // 获取 input 值
38
+ // getValue = () => {
39
+ // const { value } = this.state;
40
+ // return { [this.props.column.key]: value };
41
+ // }
42
+ // // input 值改变时回调
43
+ // onChange = (value) => {
44
+ // const { onChange } = this.props;
45
+ // if (onChange) {
46
+ // onChange(value);
47
+ // }
48
+ // this.setState({ value });
49
+ // }
50
+ // // input 失去焦点时回调
51
+ // onBlur = () => {
52
+ // const { onCommit } = this.props;
53
+ // if (onCommit) {
54
+ // onCommit();
55
+ // }
56
+ // }
57
+
58
+ // render() {
59
+ // const { cmptPros } = this.props;
60
+ // const { value } = this.state;
61
+ // return (
62
+ // <InputNumber
63
+ // style={this.getStyle()}
64
+ // value={value}
65
+ // onChange={this.onChange}
66
+ // onBlur={this.onBlur}
67
+ // autoFocus
68
+ // {...cmptPros}
69
+ // />
70
+ // );
71
+ // }
72
+ // }
73
+ "use strict";