ztxkui 4.2.17 → 4.2.18-10
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/dist/DemoCom/SyhDemo.d.ts +3 -0
- package/dist/DemoCom/SyhDemo.js +257 -0
- package/dist/components/Input/input.js +0 -5
- package/dist/components/PrintContainer/text.json +3 -0
- package/dist/components/PrintContainer/utils.js +3 -3
- package/dist/components/TimePicker/time-picker.d.ts +0 -1
- package/dist/components/business/Common/UserForgetPassword/index.js +17 -6
- package/dist/components/business/Common/UserPassword/index.d.ts +1 -0
- package/dist/components/business/Common/UserPassword/index.js +41 -12
- package/dist/components/business/Common/validatePassword.d.ts +8 -0
- package/dist/components/business/Common/validatePassword.js +168 -0
- package/dist/index.css +1 -0
- package/dist/index.css.map +1 -1
- package/dist/index.js +4 -0
- package/package.json +2 -2
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* @description
|
|
14
|
+
*/
|
|
15
|
+
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
|
16
|
+
import SearchContainer from '../components/business/SearchContainer';
|
|
17
|
+
import Form from '../components/Form';
|
|
18
|
+
import Input from 'components/Input';
|
|
19
|
+
import Table from 'components/Table';
|
|
20
|
+
import DatePicker from 'components/DatePicker';
|
|
21
|
+
import { Cascader } from 'antd';
|
|
22
|
+
import dayjs from 'dayjs';
|
|
23
|
+
import { timeTransfrom } from 'ztxkutils/dist/tools';
|
|
24
|
+
var SearchItem = SearchContainer.SearchItem, SearchLeft = SearchContainer.SearchLeft, SearchRight = SearchContainer.SearchRight;
|
|
25
|
+
var TextArea = Input.TextArea;
|
|
26
|
+
var RangePicker = DatePicker.RangePicker;
|
|
27
|
+
var aa = [
|
|
28
|
+
{
|
|
29
|
+
extra: '1',
|
|
30
|
+
hasChildren: true,
|
|
31
|
+
id: '1460583429813227521',
|
|
32
|
+
key: '1460583429813227521',
|
|
33
|
+
parentId: '1460582731688103938',
|
|
34
|
+
remark: null,
|
|
35
|
+
label: '合同工',
|
|
36
|
+
value: '1',
|
|
37
|
+
children: [
|
|
38
|
+
{
|
|
39
|
+
extra: '11',
|
|
40
|
+
id: '1460582731776184321',
|
|
41
|
+
key: '1460582731776184321',
|
|
42
|
+
parentId: '1460583429813227521',
|
|
43
|
+
remark: null,
|
|
44
|
+
label: '合同制',
|
|
45
|
+
value: '11',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
extra: '16',
|
|
49
|
+
id: '1460582731797155842',
|
|
50
|
+
key: '1460582731797155842',
|
|
51
|
+
parentId: '1460583429813227521',
|
|
52
|
+
remark: null,
|
|
53
|
+
label: '退休返聘',
|
|
54
|
+
value: '16',
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
extra: '2',
|
|
60
|
+
hasChildren: true,
|
|
61
|
+
id: '1460583501221253121',
|
|
62
|
+
key: '1460583501221253121',
|
|
63
|
+
parentId: '1460582731688103938',
|
|
64
|
+
remark: null,
|
|
65
|
+
label: '非合同工',
|
|
66
|
+
value: '2',
|
|
67
|
+
children: [
|
|
68
|
+
{
|
|
69
|
+
extra: '12',
|
|
70
|
+
id: '1460582731784572929',
|
|
71
|
+
key: '1460582731784572929',
|
|
72
|
+
parentId: '1460583501221253121',
|
|
73
|
+
remark: null,
|
|
74
|
+
label: '非全日制',
|
|
75
|
+
value: '12',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
extra: '13',
|
|
79
|
+
id: '1460582731792961538',
|
|
80
|
+
key: '1460582731792961538',
|
|
81
|
+
parentId: '1460583501221253121',
|
|
82
|
+
remark: null,
|
|
83
|
+
label: '临时协议',
|
|
84
|
+
value: '13',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
extra: '15',
|
|
88
|
+
id: '1460582731792961539',
|
|
89
|
+
key: '1460582731792961539',
|
|
90
|
+
parentId: '1460583501221253121',
|
|
91
|
+
remark: null,
|
|
92
|
+
label: '劳务派遣',
|
|
93
|
+
value: '15',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
extra: '22',
|
|
97
|
+
id: '1460582731797155843',
|
|
98
|
+
key: '1460582731797155843',
|
|
99
|
+
parentId: '1460583501221253121',
|
|
100
|
+
remark: null,
|
|
101
|
+
label: '外包协议',
|
|
102
|
+
value: '22',
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
];
|
|
107
|
+
var SyhDemo = function () {
|
|
108
|
+
var form = Form.useForm()[0];
|
|
109
|
+
var _a = useState([
|
|
110
|
+
{ id: 1, test1: 1, test2: 1 },
|
|
111
|
+
]), records = _a[0], setRecords = _a[1];
|
|
112
|
+
var recordsRef = useRef([]);
|
|
113
|
+
var _b = useState(false), firstRender = _b[0], setFirstRender = _b[1];
|
|
114
|
+
// 新增删除行改变
|
|
115
|
+
var _c = useState(false), lengthChange = _c[0], setLengthChange = _c[1];
|
|
116
|
+
useEffect(function () {
|
|
117
|
+
recordsRef.current = records;
|
|
118
|
+
}, [records]);
|
|
119
|
+
var columns = [
|
|
120
|
+
{
|
|
121
|
+
title: '序号',
|
|
122
|
+
width: 38,
|
|
123
|
+
fixed: 'left',
|
|
124
|
+
key: 'index',
|
|
125
|
+
render: function (text, _record, index) { return "" + (index + 1); },
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
title: '测试1',
|
|
129
|
+
width: 100,
|
|
130
|
+
dataIndex: 'test1',
|
|
131
|
+
key: 'test1',
|
|
132
|
+
render: function (text, record, index) { return (React.createElement(TextArea, { value: text, maxLength: 6, autoSize: { minRows: 1 }, onChange: function (e) {
|
|
133
|
+
var newRecord = {
|
|
134
|
+
test1: e.target.value,
|
|
135
|
+
};
|
|
136
|
+
onEditableSaveHandle(newRecord, index);
|
|
137
|
+
} })); },
|
|
138
|
+
shouldCellUpdate: function (record, preRecord) {
|
|
139
|
+
if (firstRender) {
|
|
140
|
+
setFirstRender(false);
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
if (lengthChange) {
|
|
144
|
+
setLengthChange(false);
|
|
145
|
+
return true;
|
|
146
|
+
}
|
|
147
|
+
return record.test1 !== preRecord.test1;
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
title: '测试2',
|
|
152
|
+
width: 100,
|
|
153
|
+
dataIndex: 'test2',
|
|
154
|
+
key: 'test2',
|
|
155
|
+
editable: true,
|
|
156
|
+
editableConfig: {
|
|
157
|
+
type: 'textArea',
|
|
158
|
+
maxLength: 6,
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
title: '测试3',
|
|
163
|
+
width: 100,
|
|
164
|
+
dataIndex: 'test3',
|
|
165
|
+
key: 'test3',
|
|
166
|
+
render: function (text, record, index) { return (React.createElement(DatePicker, { value: text ? dayjs(text) : null, onChange: function (value, dateString) {
|
|
167
|
+
var newRecord = {
|
|
168
|
+
test3: dateString,
|
|
169
|
+
};
|
|
170
|
+
onEditableSaveHandle(newRecord, index);
|
|
171
|
+
} })); },
|
|
172
|
+
shouldCellUpdate: function (record, preRecord) {
|
|
173
|
+
if (firstRender) {
|
|
174
|
+
setFirstRender(false);
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
if (lengthChange) {
|
|
178
|
+
setLengthChange(false);
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
181
|
+
return record.test3 !== preRecord.test3;
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
title: '测试4',
|
|
186
|
+
width: 100,
|
|
187
|
+
dataIndex: 'text4Start',
|
|
188
|
+
key: 'text4Start',
|
|
189
|
+
render: function (text, record, index) {
|
|
190
|
+
var newParams = (record === null || record === void 0 ? void 0 : record.text4Start) && (record === null || record === void 0 ? void 0 : record.test4End)
|
|
191
|
+
? timeTransfrom({
|
|
192
|
+
params: {
|
|
193
|
+
text4Start: record === null || record === void 0 ? void 0 : record.text4Start,
|
|
194
|
+
test4End: record === null || record === void 0 ? void 0 : record.test4End,
|
|
195
|
+
},
|
|
196
|
+
fromKey: [['text4Start', 'test4End']],
|
|
197
|
+
toKey: ['text4'],
|
|
198
|
+
type: 'object',
|
|
199
|
+
})
|
|
200
|
+
: {};
|
|
201
|
+
return (React.createElement(RangePicker, { value: newParams === null || newParams === void 0 ? void 0 : newParams.text4, onChange: function (value) {
|
|
202
|
+
var newRecord = timeTransfrom({
|
|
203
|
+
params: { text4: value },
|
|
204
|
+
fromKey: ['text4'],
|
|
205
|
+
toKey: [['text4Start', 'test4End']],
|
|
206
|
+
});
|
|
207
|
+
onEditableSaveHandle(newRecord, index);
|
|
208
|
+
} }));
|
|
209
|
+
},
|
|
210
|
+
shouldCellUpdate: function (record, preRecord) {
|
|
211
|
+
if (firstRender) {
|
|
212
|
+
setFirstRender(false);
|
|
213
|
+
return true;
|
|
214
|
+
}
|
|
215
|
+
if (lengthChange) {
|
|
216
|
+
setLengthChange(false);
|
|
217
|
+
return true;
|
|
218
|
+
}
|
|
219
|
+
return record.test4 !== preRecord.test4;
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
];
|
|
223
|
+
var onEditableSaveHandle = useCallback(function (record, index, _dataIndex) {
|
|
224
|
+
var _a;
|
|
225
|
+
if (_dataIndex === void 0) { _dataIndex = ''; }
|
|
226
|
+
if (typeof index === 'number') {
|
|
227
|
+
var newRecords = recordsRef.current.slice();
|
|
228
|
+
var item = newRecords[index];
|
|
229
|
+
newRecords.splice(index, 1, _dataIndex
|
|
230
|
+
? __assign(__assign(__assign({}, record), item), (_a = {}, _a[_dataIndex] = record[_dataIndex], _a)) : __assign(__assign({}, item), record));
|
|
231
|
+
setRecords(newRecords);
|
|
232
|
+
}
|
|
233
|
+
}, [setRecords]);
|
|
234
|
+
return (React.createElement(React.Fragment, null,
|
|
235
|
+
React.createElement(Form, { name: "syh-demo", form: form },
|
|
236
|
+
React.createElement(SearchContainer, null,
|
|
237
|
+
React.createElement(SearchLeft, null,
|
|
238
|
+
React.createElement(SearchItem, { width: "half", name: "a", label: "\u7B2C\u4E00" },
|
|
239
|
+
React.createElement(Input.TextArea, { autoSize: true, allowClear: true, onChange: function (e) {
|
|
240
|
+
console.log(e.target.value);
|
|
241
|
+
} })),
|
|
242
|
+
React.createElement(SearchItem, { width: "half", name: "b", label: "\u7B2C\u4E8C" },
|
|
243
|
+
React.createElement(Input, null)),
|
|
244
|
+
React.createElement(SearchItem, { width: "half", name: "c", label: "\u7B2C\u4E09" },
|
|
245
|
+
React.createElement(Input, null)),
|
|
246
|
+
React.createElement(SearchItem, { width: "half", name: "d", label: "\u7B2C\u56DB" },
|
|
247
|
+
React.createElement(Input, null)),
|
|
248
|
+
React.createElement(SearchItem, { width: "half", name: "e", label: "\u7B2C\u4E94" },
|
|
249
|
+
React.createElement(Input, null)),
|
|
250
|
+
React.createElement(SearchItem, { name: "f", label: "\u7B2C\u516D" },
|
|
251
|
+
React.createElement(Cascader, { options: aa })),
|
|
252
|
+
React.createElement(SearchItem, { name: "g", label: "\u7B2C\u4E03" },
|
|
253
|
+
React.createElement(TextArea, { maxLength: 6 }))),
|
|
254
|
+
React.createElement(SearchRight, { onResetHandle: function () { }, onSearchHandle: function () { } }))),
|
|
255
|
+
React.createElement(Table, { columns: columns, dataSource: records, rowKey: "id", onEditableSave: onEditableSaveHandle })));
|
|
256
|
+
};
|
|
257
|
+
export default SyhDemo;
|
|
@@ -14,11 +14,6 @@ import Modal from '../Modal';
|
|
|
14
14
|
import { Input as AntInput } from 'antd';
|
|
15
15
|
import classNames from 'classnames';
|
|
16
16
|
function Input(props) {
|
|
17
|
-
// const onBlur = (e) => {
|
|
18
|
-
// props.onBlur && props.onBlur(e);
|
|
19
|
-
// e.target.value = e.target.value.trim();
|
|
20
|
-
// props.onChange && props.onChange(e);
|
|
21
|
-
// };
|
|
22
17
|
return React.createElement(AntInput, __assign({}, props));
|
|
23
18
|
}
|
|
24
19
|
var TextArea = React.forwardRef(function (props, ref) {
|