easy3wui 1.5.70-beta9 → 1.5.71
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/assets/formPage.css +10 -18
- package/assets/gridPage.css +7 -14
- package/assets/index.css +17 -36
- package/lib/Easy3wDownLoad/index.js +3 -7
- package/lib/Easy3wFormPage/index.js +31 -260
- package/lib/Easy3wGridPage/index.js +6 -27
- package/lib/Easy3wModal/index.js +103 -57
- package/lib/Easy3wUpload/index.js +2 -9
- package/lib/Easy3wUpload copy/index.js +511 -0
- package/lib/Easy3wUploadB/index.js +2 -9
- package/lib/Easy3wUploadB copy/index copy 2.js +1011 -0
- package/lib/Easy3wUploadB copy/index copy.js +1020 -0
- package/lib/Easy3wUploadB copy/index.js +1056 -0
- package/lib/Easy3wUploadM/index.js +2 -9
- package/lib/Easy3wUploadM copy/index.js +513 -0
- package/lib/index.js +0 -63
- package/package.json +1 -1
- package/assets/tree.css +0 -4
- package/lib/Easy3wCol/index.js +0 -53
- package/lib/Easy3wGridInputAmount/index.js +0 -93
- package/lib/Easy3wGridInputDigit/index.js +0 -83
- package/lib/Easy3wGridInputEmail/index.js +0 -73
- package/lib/Easy3wRow/index.js +0 -53
- package/lib/Easy3wTree/index.js +0 -318
- package/lib/Easy3wUIConfig/index.js +0 -30
|
@@ -129,8 +129,7 @@ var Easy3wGridPage = function (_Component) {
|
|
|
129
129
|
chooseFlag = _props.chooseFlag,
|
|
130
130
|
scroll = _props.scroll,
|
|
131
131
|
className = _props.className,
|
|
132
|
-
paginationInfo = _props.paginationInfo
|
|
133
|
-
handleSearchNew = _props.handleSearchNew;
|
|
132
|
+
paginationInfo = _props.paginationInfo;
|
|
134
133
|
var _state = this.state,
|
|
135
134
|
selectedRowKeysState = _state.selectedRowKeysState,
|
|
136
135
|
selectedRowsState = _state.selectedRowsState,
|
|
@@ -140,16 +139,6 @@ var Easy3wGridPage = function (_Component) {
|
|
|
140
139
|
var recursion = function recursion(arr) {
|
|
141
140
|
arr.forEach(function (item) {
|
|
142
141
|
var columnsType = item.type;
|
|
143
|
-
var title = item.title;
|
|
144
|
-
|
|
145
|
-
if (title && typeof title === 'string' && title.length > 6) {
|
|
146
|
-
item.title = _react2['default'].createElement(
|
|
147
|
-
_tooltip2['default'],
|
|
148
|
-
{ placement: 'topLeft', title: title },
|
|
149
|
-
title.substring(0, 6),
|
|
150
|
-
'...'
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
142
|
switch (columnsType) {
|
|
154
143
|
case 'shortText':
|
|
155
144
|
item.className = 'e3wGridShortText';break;
|
|
@@ -242,7 +231,7 @@ var Easy3wGridPage = function (_Component) {
|
|
|
242
231
|
}
|
|
243
232
|
var myColumns = columns;
|
|
244
233
|
// 处理分页 start
|
|
245
|
-
if (needPaginationFlag
|
|
234
|
+
if (needPaginationFlag) {
|
|
246
235
|
var defaultCurrent = paginationInfo ? paginationInfo.offset : 1;
|
|
247
236
|
var defaultPageSize = paginationInfo ? paginationInfo.limit : 10;
|
|
248
237
|
var current = paginationInfo ? paginationInfo.offset : this.state.pagination.offset;
|
|
@@ -261,14 +250,10 @@ var Easy3wGridPage = function (_Component) {
|
|
|
261
250
|
};
|
|
262
251
|
if (autoAddNumber) {
|
|
263
252
|
if (columns.length > 0) {
|
|
264
|
-
var fixed = columns[0].fixed;
|
|
265
|
-
|
|
266
253
|
myColumns = [{
|
|
267
254
|
title: '序号',
|
|
268
255
|
dataIndex: 'number',
|
|
269
256
|
className: 'e3wGridShortText',
|
|
270
|
-
width: 50,
|
|
271
|
-
fixed: fixed,
|
|
272
257
|
render: function render(text, record, index) {
|
|
273
258
|
return _react2['default'].createElement(
|
|
274
259
|
'div',
|
|
@@ -639,21 +624,15 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
639
624
|
var _props7 = _this3.props,
|
|
640
625
|
selfDealPageChangeFunc = _props7.selfDealPageChangeFunc,
|
|
641
626
|
getSearchCondition = _props7.getSearchCondition,
|
|
642
|
-
handleSearch = _props7.handleSearch
|
|
643
|
-
handleSearchNew = _props7.handleSearchNew;
|
|
627
|
+
handleSearch = _props7.handleSearch;
|
|
644
628
|
|
|
645
|
-
var formVal =
|
|
646
|
-
if (getSearchCondition && typeof getSearchCondition === 'function') {
|
|
647
|
-
formVal = getSearchCondition();
|
|
648
|
-
}
|
|
629
|
+
var formVal = getSearchCondition();
|
|
649
630
|
var paginationInfo = { offset: pagination.current, limit: pagination.pageSize };
|
|
650
631
|
_this3.setState({ pagination: paginationInfo });
|
|
651
|
-
if (selfDealPageChangeFunc
|
|
632
|
+
if (selfDealPageChangeFunc) {
|
|
652
633
|
selfDealPageChangeFunc(paginationInfo, formVal);
|
|
653
|
-
} else
|
|
634
|
+
} else {
|
|
654
635
|
handleSearch(paginationInfo, formVal);
|
|
655
|
-
} else if (handleSearchNew && typeof handleSearchNew === 'function') {
|
|
656
|
-
handleSearchNew(paginationInfo, formVal);
|
|
657
636
|
}
|
|
658
637
|
};
|
|
659
638
|
};
|
package/lib/Easy3wModal/index.js
CHANGED
|
@@ -110,22 +110,25 @@ var Easy3wModal = function (_Component) {
|
|
|
110
110
|
Easy3wModal.setGetLoading = function setGetLoading(fn) {
|
|
111
111
|
Easy3wModal.getLoading = fn;
|
|
112
112
|
};
|
|
113
|
-
//
|
|
113
|
+
// 返回一个promise
|
|
114
114
|
|
|
115
115
|
|
|
116
|
-
Easy3wModal.
|
|
117
|
-
var
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
116
|
+
Easy3wModal.returnPromise = function returnPromise() {
|
|
117
|
+
var onOk = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};
|
|
118
|
+
|
|
119
|
+
return new Promise(function (resolve) {
|
|
120
|
+
try {
|
|
121
|
+
onOk();
|
|
122
|
+
setTimeout(function () {
|
|
123
|
+
resolve(); // 300ms 后关闭 Modal
|
|
124
|
+
document.body.style.overflow = '';
|
|
125
|
+
}, 300);
|
|
126
|
+
} catch (e) {
|
|
127
|
+
console.error('onOk 执行报错:', e);
|
|
128
|
+
resolve(); // 出错时不关闭
|
|
129
|
+
document.body.style.overflow = '';
|
|
130
|
+
}
|
|
131
|
+
});
|
|
129
132
|
};
|
|
130
133
|
// confirm
|
|
131
134
|
|
|
@@ -133,10 +136,18 @@ var Easy3wModal = function (_Component) {
|
|
|
133
136
|
Easy3wModal.confirm = function confirm() {
|
|
134
137
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
135
138
|
var _onOk = props.onOk,
|
|
136
|
-
|
|
139
|
+
_onCancel = props.onCancel,
|
|
140
|
+
restProps = (0, _objectWithoutProperties3['default'])(props, ['onOk', 'onCancel']);
|
|
137
141
|
|
|
138
142
|
return _modal2['default'].confirm((0, _extends3['default'])({}, restProps, {
|
|
143
|
+
onCancel: function onCancel() {
|
|
144
|
+
if (_onCancel) {
|
|
145
|
+
_onCancel();
|
|
146
|
+
}
|
|
147
|
+
document.body.style.overflow = '';
|
|
148
|
+
},
|
|
139
149
|
onOk: function onOk() {
|
|
150
|
+
// 1. 检查全局 loading 状态,阻止重复操作
|
|
140
151
|
var loadingFlag = Easy3wModal.getLoading();
|
|
141
152
|
if (loadingFlag) {
|
|
142
153
|
_notification3['default'].warning({
|
|
@@ -146,80 +157,113 @@ var Easy3wModal = function (_Component) {
|
|
|
146
157
|
});
|
|
147
158
|
return Promise.reject(); // 阻止 Modal 自动关闭
|
|
148
159
|
}
|
|
149
|
-
|
|
150
|
-
|
|
160
|
+
|
|
161
|
+
// 2. onOk不是函数,关闭
|
|
162
|
+
if (typeof _onOk !== 'function') {
|
|
163
|
+
return true; // 直接关闭 Modal
|
|
151
164
|
}
|
|
152
|
-
|
|
165
|
+
|
|
166
|
+
// 3. 执行onOk
|
|
167
|
+
return new Promise(function (resolve) {
|
|
168
|
+
try {
|
|
169
|
+
_onOk();
|
|
170
|
+
setTimeout(function () {
|
|
171
|
+
resolve(); // 300ms 后关闭 Modal
|
|
172
|
+
document.body.style.overflow = '';
|
|
173
|
+
}, 300);
|
|
174
|
+
} catch (e) {
|
|
175
|
+
console.error('onOk 执行报错:', e);
|
|
176
|
+
resolve(); // 出错时不关闭
|
|
177
|
+
document.body.style.overflow = '';
|
|
178
|
+
}
|
|
179
|
+
});
|
|
153
180
|
}
|
|
154
181
|
}));
|
|
155
182
|
};
|
|
156
|
-
// info
|
|
157
183
|
|
|
184
|
+
// 展示modal
|
|
158
185
|
|
|
159
|
-
Easy3wModal.info = function info() {
|
|
160
|
-
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
161
186
|
|
|
162
|
-
|
|
187
|
+
Easy3wModal.showModal = function showModal(type) {
|
|
188
|
+
var _this2 = this;
|
|
189
|
+
|
|
190
|
+
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
191
|
+
|
|
192
|
+
// 1. 判断参数类型
|
|
163
193
|
var options = typeof props === 'string' || typeof props === 'number' ? { content: props } : props;
|
|
194
|
+
|
|
164
195
|
var _onOk2 = options.onOk,
|
|
165
|
-
|
|
196
|
+
_onCancel2 = options.onCancel,
|
|
197
|
+
restProps = (0, _objectWithoutProperties3['default'])(options, ['onOk', 'onCancel']);
|
|
198
|
+
|
|
199
|
+
// 2. 定义统一的关闭逻辑
|
|
200
|
+
|
|
201
|
+
var resetBodyOverflow = function resetBodyOverflow() {
|
|
202
|
+
document.body.style.overflow = '';
|
|
203
|
+
};
|
|
166
204
|
|
|
167
|
-
|
|
205
|
+
// 3. 调用对应类型的 Modal 方法
|
|
206
|
+
return _modal2['default'][type]((0, _extends3['default'])({}, restProps, {
|
|
207
|
+
onCancel: function onCancel() {
|
|
208
|
+
if (_onCancel2) {
|
|
209
|
+
_onCancel2();
|
|
210
|
+
}
|
|
211
|
+
resetBodyOverflow();
|
|
212
|
+
},
|
|
168
213
|
onOk: function onOk() {
|
|
169
|
-
|
|
214
|
+
if (_onOk2) {
|
|
215
|
+
var loadingFlag = Easy3wModal.getLoading();
|
|
216
|
+
if (loadingFlag) {
|
|
217
|
+
_notification3['default'].warning({
|
|
218
|
+
message: '温馨提示',
|
|
219
|
+
description: '操作正在进行中,请稍后!',
|
|
220
|
+
duration: 3
|
|
221
|
+
});
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
if (typeof _onOk2 !== 'function') {
|
|
225
|
+
return true; // 直接关闭 Modal
|
|
226
|
+
}
|
|
227
|
+
_this2.returnPromise(_onOk2).then(function () {});
|
|
228
|
+
}
|
|
170
229
|
}
|
|
171
230
|
}));
|
|
172
231
|
};
|
|
232
|
+
|
|
233
|
+
// info
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
Easy3wModal.info = function info() {
|
|
237
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
238
|
+
|
|
239
|
+
return this.showModal('info', props);
|
|
240
|
+
};
|
|
241
|
+
|
|
173
242
|
// success
|
|
174
243
|
|
|
175
244
|
|
|
176
245
|
Easy3wModal.success = function success() {
|
|
177
246
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
178
247
|
|
|
179
|
-
|
|
180
|
-
var options = typeof props === 'string' || typeof props === 'number' ? { content: props } : props;
|
|
181
|
-
var _onOk3 = options.onOk,
|
|
182
|
-
restProps = (0, _objectWithoutProperties3['default'])(options, ['onOk']);
|
|
183
|
-
|
|
184
|
-
return _modal2['default'].success((0, _extends3['default'])({}, restProps, {
|
|
185
|
-
onOk: function onOk() {
|
|
186
|
-
return Easy3wModal.checkLoadingAndRun(_onOk3);
|
|
187
|
-
}
|
|
188
|
-
}));
|
|
248
|
+
return this.showModal('success', props);
|
|
189
249
|
};
|
|
250
|
+
|
|
190
251
|
// error
|
|
191
252
|
|
|
192
253
|
|
|
193
254
|
Easy3wModal.error = function error() {
|
|
194
255
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
195
256
|
|
|
196
|
-
|
|
197
|
-
var options = typeof props === 'string' || typeof props === 'number' ? { content: props } : props;
|
|
198
|
-
var _onOk4 = options.onOk,
|
|
199
|
-
restProps = (0, _objectWithoutProperties3['default'])(options, ['onOk']);
|
|
200
|
-
|
|
201
|
-
return _modal2['default'].error((0, _extends3['default'])({}, restProps, {
|
|
202
|
-
onOk: function onOk() {
|
|
203
|
-
return Easy3wModal.checkLoadingAndRun(_onOk4);
|
|
204
|
-
}
|
|
205
|
-
}));
|
|
257
|
+
return this.showModal('error', props);
|
|
206
258
|
};
|
|
259
|
+
|
|
207
260
|
// warning
|
|
208
261
|
|
|
209
262
|
|
|
210
263
|
Easy3wModal.warning = function warning() {
|
|
211
264
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
212
265
|
|
|
213
|
-
|
|
214
|
-
var options = typeof props === 'string' || typeof props === 'number' ? { content: props } : props;
|
|
215
|
-
var _onOk5 = options.onOk,
|
|
216
|
-
restProps = (0, _objectWithoutProperties3['default'])(options, ['onOk']);
|
|
217
|
-
|
|
218
|
-
return _modal2['default'].warning((0, _extends3['default'])({}, restProps, {
|
|
219
|
-
onOk: function onOk() {
|
|
220
|
-
return Easy3wModal.checkLoadingAndRun(_onOk5);
|
|
221
|
-
}
|
|
222
|
-
}));
|
|
266
|
+
return this.showModal('warning', props);
|
|
223
267
|
};
|
|
224
268
|
|
|
225
269
|
Easy3wModal.prototype.render = function render() {
|
|
@@ -230,9 +274,11 @@ var Easy3wModal = function (_Component) {
|
|
|
230
274
|
loadingFlag = _props.loadingFlag,
|
|
231
275
|
cancelHandler = _props.cancelHandler,
|
|
232
276
|
onOk = _props.onOk,
|
|
233
|
-
width = _props.width
|
|
277
|
+
width = _props.width,
|
|
278
|
+
footer = _props.footer,
|
|
279
|
+
footBtnArr = _props.footBtnArr;
|
|
234
280
|
|
|
235
|
-
var btnObj = this.getBtnObj();
|
|
281
|
+
var btnObj = footer && footer.length ? footer : footBtnArr && footBtnArr.length ? this.getBtnObj() : null;
|
|
236
282
|
return _react2['default'].createElement(
|
|
237
283
|
_modal2['default'],
|
|
238
284
|
(0, _extends3['default'])({
|
|
@@ -76,16 +76,9 @@ var _Easy3wAESEncrypt = require('../Easy3wAESEncrypt');
|
|
|
76
76
|
|
|
77
77
|
var _Easy3wAESEncrypt2 = _interopRequireDefault(_Easy3wAESEncrypt);
|
|
78
78
|
|
|
79
|
-
var _Easy3wUIConfig = require('../Easy3wUIConfig');
|
|
80
|
-
|
|
81
|
-
var _Easy3wUIConfig2 = _interopRequireDefault(_Easy3wUIConfig);
|
|
82
|
-
|
|
83
79
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
|
84
80
|
|
|
85
|
-
var objPreviewFileDefault = _Easy3wUIConfig2['default'].objPreviewFileDefault;
|
|
86
|
-
|
|
87
81
|
// 文件上传配置
|
|
88
|
-
|
|
89
82
|
var _ref = _comonConfig.objE3wUIFileConfig || {},
|
|
90
83
|
maxSize = _ref.maxSize;
|
|
91
84
|
// maxSizeB 大附件-文件大小限制 单位:MB
|
|
@@ -116,7 +109,7 @@ var Easy3wUpload = function (_Component) {
|
|
|
116
109
|
}
|
|
117
110
|
|
|
118
111
|
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3['default'])(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.onPreview = function (file) {
|
|
119
|
-
var objPreviewFileNew = (0, _extends3['default'])({},
|
|
112
|
+
var objPreviewFileNew = (0, _extends3['default'])({}, _comonConfig.objPreviewFile, _this.props.objPreviewFile);
|
|
120
113
|
var previewFileUrl = objPreviewFileNew.previewFileUrl,
|
|
121
114
|
previewFileType = objPreviewFileNew.previewFileType;
|
|
122
115
|
var uid = file.uid,
|
|
@@ -231,7 +224,7 @@ var Easy3wUpload = function (_Component) {
|
|
|
231
224
|
if (isRead) {
|
|
232
225
|
upProps = (0, _extends3['default'])({}, upProps, { children: true, showUploadList: { showDownloadIcon: true, showPreviewIcon: true, showRemoveIcon: false } });
|
|
233
226
|
}
|
|
234
|
-
var objPreviewFileNew = (0, _extends3['default'])({},
|
|
227
|
+
var objPreviewFileNew = (0, _extends3['default'])({}, _comonConfig.objPreviewFile, this.props.objPreviewFile);
|
|
235
228
|
var previewFileFlag = objPreviewFileNew.previewFileFlag;
|
|
236
229
|
|
|
237
230
|
if (previewFileFlag && fileViewFlag !== false) {
|