easy3wui 1.5.68 → 1.5.69

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.
@@ -6,6 +6,10 @@ var _extends2 = require('babel-runtime/helpers/extends');
6
6
 
7
7
  var _extends3 = _interopRequireDefault(_extends2);
8
8
 
9
+ var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');
10
+
11
+ var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
12
+
9
13
  var _notification2 = require('antd/lib/notification');
10
14
 
11
15
  var _notification3 = _interopRequireDefault(_notification2);
@@ -77,13 +81,12 @@ var Easy3wModal = function (_Component) {
77
81
  return _react2['default'].createElement(
78
82
  _button2['default'],
79
83
  {
84
+ type: 'primary',
85
+ className: (0, _classnames2['default'])(['e3wFootBtn']),
86
+ loading: obj.loading,
80
87
  onClick: function onClick(e) {
81
88
  return _this.onClickFunc(e, obj.func);
82
- },
83
- type: 'primary',
84
- className: (0, _classnames2['default'])(['e3wFootBtn'])
85
- // loading={obj.loading}
86
- , loading: obj.loading === undefined ? _this.props.loadingFlag.global : obj.loading
89
+ }
87
90
  },
88
91
  obj.cName
89
92
  );
@@ -100,26 +103,124 @@ var Easy3wModal = function (_Component) {
100
103
  );
101
104
  }, _temp), (0, _possibleConstructorReturn3['default'])(_this, _ret);
102
105
  }
103
- // constructor(props) {
104
- // super(props);
105
- // this.state = {
106
- // notificationKey: 'easy3w_processing_notice',
107
- // };
108
- // }
109
-
110
- // componentWillReceiveProps(prevProps) {
111
- // const { notificationKey } = this.state;
112
- // if (prevProps.loadingFlag.global) {
113
- // notification.warning({
114
- // key: notificationKey,
115
- // message: '温馨提示',
116
- // description: '正在后台处理,请稍后!',
117
- // duration: 0, // 不自动关闭
118
- // });
119
- // } else {
120
- // notification.close(notificationKey);
121
- // }
122
- // }
106
+ // 获取loading状态
107
+
108
+
109
+ // 供脚手架index存store
110
+ Easy3wModal.setGetLoading = function setGetLoading(fn) {
111
+ Easy3wModal.getLoading = fn;
112
+ };
113
+ // 统一的 loading 检查
114
+
115
+
116
+ Easy3wModal.checkLoadingAndRun = function checkLoadingAndRun(callback) {
117
+ var loadingFlag = Easy3wModal.getLoading();
118
+ if (loadingFlag) {
119
+ _notification3['default'].warning({
120
+ message: '温馨提示',
121
+ description: '操作正在进行中,请稍后!',
122
+ duration: 3
123
+ });
124
+ return;
125
+ }
126
+ if (typeof callback === 'function') {
127
+ return callback();
128
+ }
129
+ };
130
+ // confirm
131
+
132
+
133
+ Easy3wModal.confirm = function confirm() {
134
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
135
+ var _onOk = props.onOk,
136
+ restProps = (0, _objectWithoutProperties3['default'])(props, ['onOk']);
137
+
138
+ return _modal2['default'].confirm((0, _extends3['default'])({}, restProps, {
139
+ onOk: function onOk() {
140
+ var loadingFlag = Easy3wModal.getLoading();
141
+ if (loadingFlag) {
142
+ _notification3['default'].warning({
143
+ message: '温馨提示',
144
+ description: '操作正在进行中,请稍后!',
145
+ duration: 3
146
+ });
147
+ return Promise.reject(); // 阻止 Modal 自动关闭
148
+ }
149
+ if (typeof _onOk === 'function') {
150
+ return _onOk();
151
+ }
152
+ return true;
153
+ }
154
+ }));
155
+ };
156
+ // info
157
+
158
+
159
+ Easy3wModal.info = function info() {
160
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
161
+
162
+ // 判断类型
163
+ var options = typeof props === 'string' || typeof props === 'number' ? { content: props } : props;
164
+ var _onOk2 = options.onOk,
165
+ restProps = (0, _objectWithoutProperties3['default'])(options, ['onOk']);
166
+
167
+ return _modal2['default'].info((0, _extends3['default'])({}, restProps, {
168
+ onOk: function onOk() {
169
+ return Easy3wModal.checkLoadingAndRun(_onOk2);
170
+ }
171
+ }));
172
+ };
173
+ // success
174
+
175
+
176
+ Easy3wModal.success = function success() {
177
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
178
+
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
+ }));
189
+ };
190
+ // error
191
+
192
+
193
+ Easy3wModal.error = function error() {
194
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
195
+
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
+ }));
206
+ };
207
+ // warning
208
+
209
+
210
+ Easy3wModal.warning = function warning() {
211
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
212
+
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
+ }));
223
+ };
123
224
 
124
225
  Easy3wModal.prototype.render = function render() {
125
226
  var _props = this.props,
@@ -144,7 +245,7 @@ var Easy3wModal = function (_Component) {
144
245
  width: width,
145
246
  destroyOnClose: true,
146
247
  maskClosable: false,
147
- style: { top: 20 }
248
+ style: { top: 20, zIndex: 99998 }
148
249
  }, this.props, {
149
250
  afterClose: function afterClose() {
150
251
  document.body.style.overflow = '';
@@ -157,6 +258,10 @@ var Easy3wModal = function (_Component) {
157
258
  return Easy3wModal;
158
259
  }(_react.Component);
159
260
 
261
+ Easy3wModal.getLoading = function () {
262
+ return false;
263
+ };
264
+
160
265
  exports['default'] = (0, _dva.connect)(function (state) {
161
266
  return {
162
267
  loadingFlag: state.loading
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy3wui",
3
- "version": "1.5.68",
3
+ "version": "1.5.69",
4
4
  "description": "easy3wui components for react",
5
5
  "keywords": [
6
6
  "react",