eoss-ui 0.5.69 → 0.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/lib/button-group.js +34 -36
- package/lib/button.js +34 -36
- package/lib/checkbox-group.js +70 -56
- package/lib/data-table-form.js +37 -39
- package/lib/data-table.js +59 -59
- package/lib/date-picker.js +34 -36
- package/lib/dialog.js +49 -51
- package/lib/eoss-ui.common.js +665 -573
- package/lib/flow-group.js +34 -36
- package/lib/flow-list.js +36 -38
- package/lib/flow.js +40 -42
- package/lib/form.js +410 -376
- package/lib/handle-user.js +36 -38
- package/lib/handler.js +34 -36
- package/lib/index.js +1 -1
- package/lib/input-number.js +34 -36
- package/lib/input.js +65 -48
- package/lib/layout.js +2 -2
- package/lib/login.js +54 -55
- package/lib/main.js +39 -41
- package/lib/menu.js +5 -4
- package/lib/nav.js +34 -36
- package/lib/page.js +34 -36
- package/lib/player.js +34 -36
- package/lib/qr-code.js +34 -36
- package/lib/radio-group.js +69 -53
- package/lib/retrial-auth.js +34 -36
- package/lib/select-ganged.js +122 -106
- package/lib/select.js +115 -105
- package/lib/selector-panel.js +90 -76
- package/lib/selector.js +34 -36
- package/lib/sizer.js +36 -38
- package/lib/steps.js +60 -44
- package/lib/switch.js +34 -36
- package/lib/table-form.js +36 -38
- package/lib/tabs.js +34 -36
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/login.css +1 -1
- package/lib/tips.js +59 -42
- package/lib/tree-group.js +34 -36
- package/lib/tree.js +93 -77
- package/lib/upload.js +111 -94
- package/lib/utils/util.js +34 -36
- package/lib/wujie.js +34 -36
- package/lib/wxlogin.js +34 -36
- package/package.json +2 -2
- package/packages/checkbox-group/src/main.vue +7 -1
- package/packages/data-table/src/main.vue +4 -2
- package/packages/dialog/src/main.vue +2 -3
- package/packages/form/src/main.vue +11 -2
- package/packages/input/src/main.vue +8 -1
- package/packages/login/src/main.vue +15 -11
- package/packages/menu/src/main.vue +3 -2
- package/packages/radio-group/src/main.vue +7 -1
- package/packages/select/src/main.vue +10 -10
- package/packages/select-ganged/src/main.vue +7 -1
- package/packages/selector-panel/src/main.vue +7 -1
- package/packages/steps/src/main.vue +9 -3
- package/packages/theme-chalk/lib/index.css +1 -1
- package/packages/theme-chalk/lib/login.css +1 -1
- package/packages/theme-chalk/src/login.scss +1 -1
- package/packages/tips/src/main.vue +8 -1
- package/packages/tree/src/main.vue +8 -2
- package/packages/upload/src/main.vue +11 -2
- package/src/index.js +1 -1
- package/src/utils/util.js +34 -34
package/lib/form.js
CHANGED
|
@@ -85,9 +85,8 @@ module.exports =
|
|
|
85
85
|
/******/ return __webpack_require__(__webpack_require__.s = 45);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
|
-
/******/ (
|
|
89
|
-
|
|
90
|
-
/***/ 0:
|
|
88
|
+
/******/ ([
|
|
89
|
+
/* 0 */
|
|
91
90
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
92
91
|
|
|
93
92
|
"use strict";
|
|
@@ -154,21 +153,17 @@ var JSONbigToString = json_bigint__WEBPACK_IMPORTED_MODULE_3___default()({ store
|
|
|
154
153
|
* @param {Array} [encodes] - 需要对参数值进行encodeURIComponent编码的参数值名称
|
|
155
154
|
**/
|
|
156
155
|
// 请求
|
|
157
|
-
|
|
158
|
-
function getRequestKey(config) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
if (pendingRequest.has(requestKey)) {
|
|
169
|
-
pendingRequest.delete(requestKey);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
156
|
+
// const pendingRequest = new Map();
|
|
157
|
+
// function getRequestKey(config) {
|
|
158
|
+
// const { method, url, params, data } = config;
|
|
159
|
+
// return [method, url, qs.stringify(params), qs.stringify(data)].join('&');
|
|
160
|
+
// };
|
|
161
|
+
// function delPendingRequest(config) {
|
|
162
|
+
// let requestKey = getRequestKey(config);
|
|
163
|
+
// if (pendingRequest.has(requestKey)) {
|
|
164
|
+
// pendingRequest.delete(requestKey);
|
|
165
|
+
// }
|
|
166
|
+
// }
|
|
172
167
|
var ajax = function ajax(_ref) {
|
|
173
168
|
var headers = _ref.headers,
|
|
174
169
|
method = _ref.method,
|
|
@@ -217,30 +212,32 @@ var ajax = function ajax(_ref) {
|
|
|
217
212
|
http.interceptors.request.use(function (config) {
|
|
218
213
|
config.headers.common = getStorage();
|
|
219
214
|
// 根据请求的信息(请求方式,url,请求get/post数据),产生map的key
|
|
220
|
-
|
|
221
|
-
// 判断请求是否重复
|
|
222
|
-
if (pendingRequest.has(requestKey)) {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
229
|
-
// 把请求信息,添加请求到map当中
|
|
230
|
-
// 生成取消方法
|
|
231
|
-
config.cancelToken =
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
215
|
+
// let requestKey = getRequestKey(config);
|
|
216
|
+
// // 判断请求是否重复
|
|
217
|
+
// if (pendingRequest.has(requestKey)) {
|
|
218
|
+
// // 取消上次请求
|
|
219
|
+
// let cancel = pendingRequest.get(requestKey);
|
|
220
|
+
// cancel();
|
|
221
|
+
// // 删除请求信息
|
|
222
|
+
// pendingRequest.delete(requestKey);
|
|
223
|
+
// }
|
|
224
|
+
// // 把请求信息,添加请求到map当中
|
|
225
|
+
// // 生成取消方法
|
|
226
|
+
// config.cancelToken =
|
|
227
|
+
// config.cancelToken ||
|
|
228
|
+
// new axios.CancelToken(cancel => {
|
|
229
|
+
// // 把取消方法添加到map
|
|
230
|
+
// if (!pendingRequest.has(requestKey)) {
|
|
231
|
+
// pendingRequest.set(requestKey, cancel);
|
|
232
|
+
// }
|
|
233
|
+
// });
|
|
237
234
|
return config;
|
|
238
235
|
}, function (err) {
|
|
239
236
|
return err;
|
|
240
237
|
});
|
|
241
238
|
// 响应拦截
|
|
242
239
|
http.interceptors.response.use(function (response) {
|
|
243
|
-
delPendingRequest(response.config);
|
|
240
|
+
// delPendingRequest(response.config);
|
|
244
241
|
loading && loading.close();
|
|
245
242
|
if (response.headers.authorization && response.headers.authorization !== getStorage('token')) {
|
|
246
243
|
if (localStorage.getItem('storage') === 'localStorage' || localStorage.getItem('token') || localStorage.getItem('Authorization')) {
|
|
@@ -357,9 +354,9 @@ var ajax = function ajax(_ref) {
|
|
|
357
354
|
}
|
|
358
355
|
}, function (error) {
|
|
359
356
|
loading && loading.close();
|
|
360
|
-
if (!
|
|
361
|
-
|
|
362
|
-
}
|
|
357
|
+
// if (!axios.isCancel(error)) {
|
|
358
|
+
// delPendingRequest(error.config || {});
|
|
359
|
+
// }
|
|
363
360
|
if (error && error.response) {
|
|
364
361
|
if (error.response.status) {
|
|
365
362
|
switch (error.response.status) {
|
|
@@ -3141,8 +3138,7 @@ var watermark = function watermark(option) {
|
|
|
3141
3138
|
});
|
|
3142
3139
|
|
|
3143
3140
|
/***/ }),
|
|
3144
|
-
|
|
3145
|
-
/***/ 1:
|
|
3141
|
+
/* 1 */
|
|
3146
3142
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3147
3143
|
|
|
3148
3144
|
"use strict";
|
|
@@ -3489,54 +3485,13 @@ var sendBatch = '/notify2/sendRecord/reSendNotifyMessageBatch';
|
|
|
3489
3485
|
var formContents = '/config/admin/online/onlineForm/render';
|
|
3490
3486
|
|
|
3491
3487
|
/***/ }),
|
|
3492
|
-
|
|
3493
|
-
/***/ 10:
|
|
3494
|
-
/***/ (function(module, exports) {
|
|
3495
|
-
|
|
3496
|
-
module.exports = require("sm-crypto");
|
|
3497
|
-
|
|
3498
|
-
/***/ }),
|
|
3499
|
-
|
|
3500
|
-
/***/ 12:
|
|
3501
|
-
/***/ (function(module, exports) {
|
|
3502
|
-
|
|
3503
|
-
module.exports = require("babel-runtime/regenerator");
|
|
3504
|
-
|
|
3505
|
-
/***/ }),
|
|
3506
|
-
|
|
3507
|
-
/***/ 13:
|
|
3508
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3509
|
-
|
|
3510
|
-
"use strict";
|
|
3511
|
-
// 手机号
|
|
3512
|
-
var phone = { pattern: new RegExp('^[1][3, 4, 5, 6, 7, 8, 9][0-9]{9}$'), message: '手机号不合法' };
|
|
3513
|
-
// 身份证
|
|
3514
|
-
var idCard = { pattern: new RegExp('(^\\d{15}$)|(^\\d{18}$)|(^\\d{17}(\\d|X|x)$)'), message: '身份证号不合法' };
|
|
3515
|
-
// 座机号
|
|
3516
|
-
var telephone = { pattern: new RegExp('^(\\d{3,4}-)?\\d{7,8}$'), message: '座机号不合法' };
|
|
3517
|
-
// IP
|
|
3518
|
-
var ip = { pattern: new RegExp('^(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])$'), message: 'IP地址不合法' };
|
|
3519
|
-
// 银行卡号
|
|
3520
|
-
var bankCard = { pattern: new RegExp('^([1-9]{1})(\\d{14}|\\d{18})$'), message: '银行卡号不合法' };
|
|
3521
|
-
|
|
3522
|
-
/* harmony default export */ __webpack_exports__["a"] = ({
|
|
3523
|
-
phone: phone,
|
|
3524
|
-
idCard: idCard,
|
|
3525
|
-
telephone: telephone,
|
|
3526
|
-
ip: ip,
|
|
3527
|
-
bankCard: bankCard
|
|
3528
|
-
});
|
|
3529
|
-
|
|
3530
|
-
/***/ }),
|
|
3531
|
-
|
|
3532
|
-
/***/ 2:
|
|
3488
|
+
/* 2 */
|
|
3533
3489
|
/***/ (function(module, exports) {
|
|
3534
3490
|
|
|
3535
3491
|
module.exports = require("eoss-element");
|
|
3536
3492
|
|
|
3537
3493
|
/***/ }),
|
|
3538
|
-
|
|
3539
|
-
/***/ 3:
|
|
3494
|
+
/* 3 */
|
|
3540
3495
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3541
3496
|
|
|
3542
3497
|
"use strict";
|
|
@@ -3640,22 +3595,249 @@ function normalizeComponent(
|
|
|
3640
3595
|
|
|
3641
3596
|
|
|
3642
3597
|
/***/ }),
|
|
3643
|
-
|
|
3644
|
-
/***/ 4:
|
|
3598
|
+
/* 4 */
|
|
3645
3599
|
/***/ (function(module, exports) {
|
|
3646
3600
|
|
|
3647
3601
|
module.exports = require("qs");
|
|
3648
3602
|
|
|
3649
3603
|
/***/ }),
|
|
3604
|
+
/* 5 */
|
|
3605
|
+
/***/ (function(module, exports) {
|
|
3606
|
+
|
|
3607
|
+
module.exports = require("axios");
|
|
3608
|
+
|
|
3609
|
+
/***/ }),
|
|
3610
|
+
/* 6 */
|
|
3611
|
+
/***/ (function(module, exports) {
|
|
3612
|
+
|
|
3613
|
+
module.exports = require("json-bigint");
|
|
3614
|
+
|
|
3615
|
+
/***/ }),
|
|
3616
|
+
/* 7 */
|
|
3617
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3618
|
+
|
|
3619
|
+
"use strict";
|
|
3620
|
+
/* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
|
|
3621
|
+
/* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(sockjs_client__WEBPACK_IMPORTED_MODULE_0__);
|
|
3622
|
+
/* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
|
|
3623
|
+
/* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(stompjs__WEBPACK_IMPORTED_MODULE_1__);
|
|
3624
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3625
|
+
|
|
3626
|
+
|
|
3627
|
+
|
|
3628
|
+
|
|
3629
|
+
var WebSocket = function () {
|
|
3630
|
+
// 构造函数
|
|
3631
|
+
function WebSocket() {
|
|
3632
|
+
_classCallCheck(this, WebSocket);
|
|
3633
|
+
|
|
3634
|
+
this.host = sessionStorage.getItem('wshost') || '';
|
|
3635
|
+
this.tryTimes = 1; // 重连次数
|
|
3636
|
+
this.callback = null; // 回调函数
|
|
3637
|
+
this.client = null; // stomp对象
|
|
3638
|
+
this.reconTimeout = null; // 重连延时器
|
|
3639
|
+
this.debug = true; // 调试
|
|
3640
|
+
this.interval = 20; // 重连间隔时间
|
|
3641
|
+
this.vm = null;
|
|
3642
|
+
this.nextDate = 0;
|
|
3643
|
+
this.connects = 1;
|
|
3644
|
+
this.recon = false;
|
|
3645
|
+
this.sendTimeout = null;
|
|
3646
|
+
}
|
|
3647
|
+
|
|
3648
|
+
/** socket连接 */
|
|
3649
|
+
|
|
3650
|
+
|
|
3651
|
+
WebSocket.prototype.connect = function connect() {
|
|
3652
|
+
var _this = this;
|
|
3653
|
+
|
|
3654
|
+
if (!this.client) {
|
|
3655
|
+
// 连接SockJS
|
|
3656
|
+
var socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url);
|
|
3657
|
+
// 获取STOMP子协议的客户端对象
|
|
3658
|
+
this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(socket);
|
|
3659
|
+
}
|
|
3660
|
+
|
|
3661
|
+
// 日志不打印
|
|
3662
|
+
if (!this.debug) {
|
|
3663
|
+
console.log(111);
|
|
3664
|
+
this.client.debug = function () {};
|
|
3665
|
+
}
|
|
3666
|
+
|
|
3667
|
+
// 向服务器发起websocket连接
|
|
3668
|
+
this.client.connect({}, function () {
|
|
3669
|
+
_this.recon = true;
|
|
3670
|
+
// tryTimes定义重置
|
|
3671
|
+
_this.connects = 1;
|
|
3672
|
+
// 订阅消息
|
|
3673
|
+
_this.subscribe();
|
|
3674
|
+
}, function (error) {
|
|
3675
|
+
var diffSecond = parseInt((new Date() - _this.nextDate) / 1000, 10);
|
|
3676
|
+
if (_this.connects > 5 && diffSecond < _this.interval) {
|
|
3677
|
+
_this.client.disconnect();
|
|
3678
|
+
_this.error && _this.error(error);
|
|
3679
|
+
} else {
|
|
3680
|
+
_this.reconTimeout = setTimeout(function () {
|
|
3681
|
+
_this.connect();
|
|
3682
|
+
_this.connects++;
|
|
3683
|
+
}, 5000);
|
|
3684
|
+
}
|
|
3685
|
+
});
|
|
3686
|
+
};
|
|
3687
|
+
/** 订阅服务端 */
|
|
3688
|
+
|
|
3689
|
+
|
|
3690
|
+
WebSocket.prototype.subscribe = function subscribe() {
|
|
3691
|
+
var _this2 = this;
|
|
3692
|
+
|
|
3693
|
+
// 订阅服务端提供的某个topic
|
|
3694
|
+
this.client.subscribe(this.take, function (response) {
|
|
3695
|
+
if (response && (_this2.callback || _this2.success)) {
|
|
3696
|
+
var callback = _this2.callback || _this2.success;
|
|
3697
|
+
callback(JSON.parse(response.body));
|
|
3698
|
+
}
|
|
3699
|
+
});
|
|
3700
|
+
};
|
|
3701
|
+
|
|
3702
|
+
/** 赋值、初始化socket */
|
|
3703
|
+
|
|
3704
|
+
|
|
3705
|
+
WebSocket.prototype.init = function init(option, vm) {
|
|
3706
|
+
for (var i in option) {
|
|
3707
|
+
this[i] = option[i];
|
|
3708
|
+
}
|
|
3709
|
+
this.vm = vm;
|
|
3710
|
+
// 初始化连接
|
|
3711
|
+
this.connect();
|
|
3712
|
+
};
|
|
3713
|
+
|
|
3714
|
+
/** 发送消息 */
|
|
3715
|
+
|
|
3716
|
+
|
|
3717
|
+
WebSocket.prototype.send = function send(data) {
|
|
3718
|
+
var _this3 = this;
|
|
3719
|
+
|
|
3720
|
+
if (this.recon) {
|
|
3721
|
+
clearTimeout(this.sendTimeout);
|
|
3722
|
+
this.client.send(this.take, {}, typeof data === 'string' ? data : JSON.stringify(data));
|
|
3723
|
+
} else {
|
|
3724
|
+
this.sendTimeout = setTimeout(function () {
|
|
3725
|
+
_this3.send(data);
|
|
3726
|
+
}, 1000);
|
|
3727
|
+
}
|
|
3728
|
+
};
|
|
3729
|
+
|
|
3730
|
+
/** 销毁 */
|
|
3731
|
+
|
|
3732
|
+
|
|
3733
|
+
WebSocket.prototype.destroy = function destroy() {
|
|
3734
|
+
// 断开连接,清除定时器
|
|
3735
|
+
if (this.client) {
|
|
3736
|
+
this.client.disconnect();
|
|
3737
|
+
};
|
|
3738
|
+
this.reconTimeout && clearTimeout(this.reconTimeout);
|
|
3739
|
+
this.sendTimeout && clearTimeout(this.sendTimeout);
|
|
3740
|
+
};
|
|
3741
|
+
|
|
3742
|
+
return WebSocket;
|
|
3743
|
+
}();
|
|
3744
|
+
|
|
3745
|
+
/* harmony default export */ __webpack_exports__["a"] = (WebSocket);
|
|
3746
|
+
|
|
3747
|
+
/***/ }),
|
|
3748
|
+
/* 8 */
|
|
3749
|
+
/***/ (function(module, exports) {
|
|
3750
|
+
|
|
3751
|
+
module.exports = require("sockjs-client");
|
|
3752
|
+
|
|
3753
|
+
/***/ }),
|
|
3754
|
+
/* 9 */
|
|
3755
|
+
/***/ (function(module, exports) {
|
|
3756
|
+
|
|
3757
|
+
module.exports = require("stompjs");
|
|
3758
|
+
|
|
3759
|
+
/***/ }),
|
|
3760
|
+
/* 10 */
|
|
3761
|
+
/***/ (function(module, exports) {
|
|
3762
|
+
|
|
3763
|
+
module.exports = require("sm-crypto");
|
|
3764
|
+
|
|
3765
|
+
/***/ }),
|
|
3766
|
+
/* 11 */
|
|
3767
|
+
/***/ (function(module, exports) {
|
|
3768
|
+
|
|
3769
|
+
module.exports = require("throttle-debounce");
|
|
3770
|
+
|
|
3771
|
+
/***/ }),
|
|
3772
|
+
/* 12 */,
|
|
3773
|
+
/* 13 */
|
|
3774
|
+
/***/ (function(module, exports) {
|
|
3775
|
+
|
|
3776
|
+
module.exports = require("babel-runtime/regenerator");
|
|
3777
|
+
|
|
3778
|
+
/***/ }),
|
|
3779
|
+
/* 14 */
|
|
3780
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3781
|
+
|
|
3782
|
+
"use strict";
|
|
3783
|
+
// 手机号
|
|
3784
|
+
var phone = { pattern: new RegExp('^[1][3, 4, 5, 6, 7, 8, 9][0-9]{9}$'), message: '手机号不合法' };
|
|
3785
|
+
// 身份证
|
|
3786
|
+
var idCard = { pattern: new RegExp('(^\\d{15}$)|(^\\d{18}$)|(^\\d{17}(\\d|X|x)$)'), message: '身份证号不合法' };
|
|
3787
|
+
// 座机号
|
|
3788
|
+
var telephone = { pattern: new RegExp('^(\\d{3,4}-)?\\d{7,8}$'), message: '座机号不合法' };
|
|
3789
|
+
// IP
|
|
3790
|
+
var ip = { pattern: new RegExp('^(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])$'), message: 'IP地址不合法' };
|
|
3791
|
+
// 银行卡号
|
|
3792
|
+
var bankCard = { pattern: new RegExp('^([1-9]{1})(\\d{14}|\\d{18})$'), message: '银行卡号不合法' };
|
|
3793
|
+
|
|
3794
|
+
/* harmony default export */ __webpack_exports__["a"] = ({
|
|
3795
|
+
phone: phone,
|
|
3796
|
+
idCard: idCard,
|
|
3797
|
+
telephone: telephone,
|
|
3798
|
+
ip: ip,
|
|
3799
|
+
bankCard: bankCard
|
|
3800
|
+
});
|
|
3650
3801
|
|
|
3651
|
-
/***/
|
|
3802
|
+
/***/ }),
|
|
3803
|
+
/* 15 */,
|
|
3804
|
+
/* 16 */,
|
|
3805
|
+
/* 17 */,
|
|
3806
|
+
/* 18 */,
|
|
3807
|
+
/* 19 */,
|
|
3808
|
+
/* 20 */,
|
|
3809
|
+
/* 21 */,
|
|
3810
|
+
/* 22 */,
|
|
3811
|
+
/* 23 */,
|
|
3812
|
+
/* 24 */,
|
|
3813
|
+
/* 25 */,
|
|
3814
|
+
/* 26 */,
|
|
3815
|
+
/* 27 */,
|
|
3816
|
+
/* 28 */,
|
|
3817
|
+
/* 29 */,
|
|
3818
|
+
/* 30 */,
|
|
3819
|
+
/* 31 */,
|
|
3820
|
+
/* 32 */,
|
|
3821
|
+
/* 33 */,
|
|
3822
|
+
/* 34 */,
|
|
3823
|
+
/* 35 */,
|
|
3824
|
+
/* 36 */,
|
|
3825
|
+
/* 37 */,
|
|
3826
|
+
/* 38 */,
|
|
3827
|
+
/* 39 */,
|
|
3828
|
+
/* 40 */,
|
|
3829
|
+
/* 41 */,
|
|
3830
|
+
/* 42 */,
|
|
3831
|
+
/* 43 */,
|
|
3832
|
+
/* 44 */,
|
|
3833
|
+
/* 45 */
|
|
3652
3834
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3653
3835
|
|
|
3654
3836
|
"use strict";
|
|
3655
3837
|
// ESM COMPAT FLAG
|
|
3656
3838
|
__webpack_require__.r(__webpack_exports__);
|
|
3657
3839
|
|
|
3658
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/form/src/main.vue?vue&type=template&id=
|
|
3840
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/form/src/main.vue?vue&type=template&id=06e3fac4&
|
|
3659
3841
|
var render = function () {
|
|
3660
3842
|
var _vm = this
|
|
3661
3843
|
var _h = _vm.$createElement
|
|
@@ -15116,20 +15298,23 @@ var staticRenderFns = []
|
|
|
15116
15298
|
render._withStripped = true
|
|
15117
15299
|
|
|
15118
15300
|
|
|
15119
|
-
// CONCATENATED MODULE: ./packages/form/src/main.vue?vue&type=template&id=
|
|
15301
|
+
// CONCATENATED MODULE: ./packages/form/src/main.vue?vue&type=template&id=06e3fac4&
|
|
15120
15302
|
|
|
15121
15303
|
// EXTERNAL MODULE: external "babel-runtime/regenerator"
|
|
15122
|
-
var regenerator_ = __webpack_require__(
|
|
15304
|
+
var regenerator_ = __webpack_require__(13);
|
|
15123
15305
|
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator_);
|
|
15124
15306
|
|
|
15125
15307
|
// EXTERNAL MODULE: ./src/config/api.js
|
|
15126
15308
|
var api = __webpack_require__(1);
|
|
15127
15309
|
|
|
15310
|
+
// EXTERNAL MODULE: external "throttle-debounce"
|
|
15311
|
+
var external_throttle_debounce_ = __webpack_require__(11);
|
|
15312
|
+
|
|
15128
15313
|
// EXTERNAL MODULE: ./src/utils/util.js
|
|
15129
15314
|
var util = __webpack_require__(0);
|
|
15130
15315
|
|
|
15131
15316
|
// EXTERNAL MODULE: ./src/utils/rules.js
|
|
15132
|
-
var rules = __webpack_require__(
|
|
15317
|
+
var rules = __webpack_require__(14);
|
|
15133
15318
|
|
|
15134
15319
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/form/src/main.vue?vue&type=script&lang=js&
|
|
15135
15320
|
|
|
@@ -19146,6 +19331,7 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
19146
19331
|
|
|
19147
19332
|
|
|
19148
19333
|
|
|
19334
|
+
|
|
19149
19335
|
/* harmony default export */ var mainvue_type_script_lang_js_ = ({
|
|
19150
19336
|
name: 'EsForm',
|
|
19151
19337
|
inheritAttrs: false,
|
|
@@ -19616,15 +19802,25 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
19616
19802
|
}
|
|
19617
19803
|
}
|
|
19618
19804
|
},
|
|
19805
|
+
beforeCreate: function beforeCreate() {
|
|
19806
|
+
var _this3 = this;
|
|
19807
|
+
|
|
19808
|
+
this.getContent = Object(external_throttle_debounce_["debounce"])(500, function () {
|
|
19809
|
+
_this3.getContents();
|
|
19810
|
+
});
|
|
19811
|
+
this.getValue = Object(external_throttle_debounce_["debounce"])(500, function () {
|
|
19812
|
+
_this3.getValues();
|
|
19813
|
+
});
|
|
19814
|
+
},
|
|
19619
19815
|
created: function created() {
|
|
19620
19816
|
this.dialog = window.$wujie && window.$wujie.props ? window.$wujie.props._dialog : false;
|
|
19621
19817
|
},
|
|
19622
19818
|
mounted: function mounted() {
|
|
19623
|
-
var
|
|
19819
|
+
var _this4 = this;
|
|
19624
19820
|
|
|
19625
19821
|
this.$nextTick(function () {
|
|
19626
|
-
!
|
|
19627
|
-
|
|
19822
|
+
!_this4.height && _this4.getHeight();
|
|
19823
|
+
_this4.$refs.esForm.$el.addEventListener('keyup', _this4.handleEnter);
|
|
19628
19824
|
});
|
|
19629
19825
|
},
|
|
19630
19826
|
|
|
@@ -19647,8 +19843,8 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
19647
19843
|
}
|
|
19648
19844
|
return this.getParentHeight(dom.parentNode);
|
|
19649
19845
|
},
|
|
19650
|
-
|
|
19651
|
-
var
|
|
19846
|
+
getContents: function getContents() {
|
|
19847
|
+
var _this5 = this;
|
|
19652
19848
|
|
|
19653
19849
|
if (typeof this.contents === 'string' || util["a" /* default */].isObject(this.contents) && Object.prototype.hasOwnProperty.call(this.contents, 'formId')) {
|
|
19654
19850
|
this.loading = true;
|
|
@@ -19658,36 +19854,36 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
19658
19854
|
data: params,
|
|
19659
19855
|
params: params
|
|
19660
19856
|
}).then(function (res) {
|
|
19661
|
-
|
|
19857
|
+
_this5.loading = false;
|
|
19662
19858
|
if (res.rCode === 0) {
|
|
19663
19859
|
var results = JSON.parse(JSON.stringify(res.results));
|
|
19664
19860
|
if (Array.isArray(results)) {
|
|
19665
|
-
|
|
19861
|
+
_this5.resolution(results);
|
|
19666
19862
|
} else {
|
|
19667
|
-
|
|
19863
|
+
_this5.resolution(results.contents || results.content || []);
|
|
19668
19864
|
var data = {};
|
|
19669
|
-
if (
|
|
19670
|
-
data = { id:
|
|
19671
|
-
} else if (
|
|
19672
|
-
if (typeof
|
|
19673
|
-
data = { id:
|
|
19865
|
+
if (_this5.businessId !== undefined) {
|
|
19866
|
+
data = { id: _this5.businessId };
|
|
19867
|
+
} else if (_this5.autoId) {
|
|
19868
|
+
if (typeof _this5.autoId === 'boolean') {
|
|
19869
|
+
data = { id: _this5.uuid };
|
|
19674
19870
|
} else {
|
|
19675
|
-
data[
|
|
19871
|
+
data[_this5.autoId] = _this5.uuid;
|
|
19676
19872
|
}
|
|
19677
19873
|
}
|
|
19678
|
-
|
|
19874
|
+
_this5.values = util["a" /* default */].extend({}, data, results.value || results.data || {});
|
|
19679
19875
|
}
|
|
19680
19876
|
}
|
|
19681
19877
|
}).catch(function (err) {
|
|
19682
|
-
|
|
19878
|
+
_this5.loading = false;
|
|
19683
19879
|
if (err.message && err.message !== 'canceled') {
|
|
19684
|
-
|
|
19880
|
+
_this5.$message.error(err.message);
|
|
19685
19881
|
}
|
|
19686
19882
|
});
|
|
19687
19883
|
}
|
|
19688
19884
|
},
|
|
19689
19885
|
resolution: function resolution(res) {
|
|
19690
|
-
var
|
|
19886
|
+
var _this6 = this;
|
|
19691
19887
|
|
|
19692
19888
|
this.forbid = false;
|
|
19693
19889
|
if (res.length > 0) {
|
|
@@ -19695,11 +19891,11 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
19695
19891
|
var names = [];
|
|
19696
19892
|
res.forEach(function (item, index) {
|
|
19697
19893
|
if (item.type === 'submit' || item.type === 'button') {
|
|
19698
|
-
|
|
19894
|
+
_this6.$set(_this6, 'button', item.contents);
|
|
19699
19895
|
} else {
|
|
19700
19896
|
if (Object.prototype.hasOwnProperty.call(item, 'title') && Object.prototype.hasOwnProperty.call(item, 'contents')) {
|
|
19701
|
-
|
|
19702
|
-
if (
|
|
19897
|
+
_this6.isCollapse = true;
|
|
19898
|
+
if (_this6.accordion) {
|
|
19703
19899
|
if (index === 0) {
|
|
19704
19900
|
names = item.name || String(index);
|
|
19705
19901
|
}
|
|
@@ -19707,7 +19903,7 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
19707
19903
|
names.push(item.name || String(index));
|
|
19708
19904
|
}
|
|
19709
19905
|
} else {
|
|
19710
|
-
|
|
19906
|
+
_this6.isCollapse = false;
|
|
19711
19907
|
}
|
|
19712
19908
|
contents.push(util["a" /* default */].extend({}, item));
|
|
19713
19909
|
}
|
|
@@ -19721,8 +19917,8 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
19721
19917
|
}
|
|
19722
19918
|
}
|
|
19723
19919
|
},
|
|
19724
|
-
|
|
19725
|
-
var
|
|
19920
|
+
getValues: function getValues() {
|
|
19921
|
+
var _this7 = this;
|
|
19726
19922
|
|
|
19727
19923
|
if (typeof this.model === 'string') {
|
|
19728
19924
|
this.loading = true;
|
|
@@ -19733,45 +19929,45 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
19733
19929
|
data: param,
|
|
19734
19930
|
params: param
|
|
19735
19931
|
}).then(function (res) {
|
|
19736
|
-
|
|
19932
|
+
_this7.loading = false;
|
|
19737
19933
|
if (res.rCode === 0) {
|
|
19738
|
-
var value = res.results ?
|
|
19934
|
+
var value = res.results ? _this7.parseData ? _this7.parseData(JSON.parse(JSON.stringify(res.results))) : JSON.parse(JSON.stringify(res.results)) : {};
|
|
19739
19935
|
|
|
19740
19936
|
var data = {};
|
|
19741
|
-
if (
|
|
19742
|
-
if (typeof
|
|
19937
|
+
if (_this7.autoId) {
|
|
19938
|
+
if (typeof _this7.autoId === 'boolean') {
|
|
19743
19939
|
if (value.id) {
|
|
19744
|
-
|
|
19940
|
+
_this7.$emit('update:businessId', value.id);
|
|
19745
19941
|
} else {
|
|
19746
|
-
if (
|
|
19747
|
-
data = { id:
|
|
19942
|
+
if (_this7.businessId !== undefined) {
|
|
19943
|
+
data = { id: _this7.businessId };
|
|
19748
19944
|
} else {
|
|
19749
|
-
data = { id:
|
|
19945
|
+
data = { id: _this7.uuid };
|
|
19750
19946
|
}
|
|
19751
|
-
|
|
19947
|
+
_this7.$emit('update:businessId', data.id);
|
|
19752
19948
|
}
|
|
19753
19949
|
} else {
|
|
19754
|
-
if (value[
|
|
19755
|
-
|
|
19950
|
+
if (value[_this7.autoId]) {
|
|
19951
|
+
_this7.$emit('update:businessId', value[_this7.autoId]);
|
|
19756
19952
|
} else {
|
|
19757
|
-
if (
|
|
19758
|
-
data[
|
|
19953
|
+
if (_this7.businessId !== undefined) {
|
|
19954
|
+
data[_this7.autoId] = _this7.businessId;
|
|
19759
19955
|
} else {
|
|
19760
|
-
data[
|
|
19956
|
+
data[_this7.autoId] = _this7.uuid;
|
|
19761
19957
|
}
|
|
19762
|
-
|
|
19958
|
+
_this7.$emit('update:businessId', data[_this7.autoId]);
|
|
19763
19959
|
}
|
|
19764
19960
|
}
|
|
19765
19961
|
}
|
|
19766
|
-
|
|
19767
|
-
|
|
19768
|
-
|
|
19769
|
-
|
|
19962
|
+
_this7.values = util["a" /* default */].extend({}, data, value);
|
|
19963
|
+
_this7.$emit('valueSuccess', _this7.values);
|
|
19964
|
+
_this7.$emit('value-success', _this7.values);
|
|
19965
|
+
_this7.$emit('result', _this7.values);
|
|
19770
19966
|
}
|
|
19771
19967
|
}).catch(function (err) {
|
|
19772
|
-
|
|
19968
|
+
_this7.loading = false;
|
|
19773
19969
|
if (err.message && err.message !== 'canceled') {
|
|
19774
|
-
|
|
19970
|
+
_this7.$message.error(err.message);
|
|
19775
19971
|
}
|
|
19776
19972
|
});
|
|
19777
19973
|
}
|
|
@@ -19810,7 +20006,7 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
19810
20006
|
}
|
|
19811
20007
|
},
|
|
19812
20008
|
handleClick: function handleClick(res, index) {
|
|
19813
|
-
var
|
|
20009
|
+
var _this8 = this;
|
|
19814
20010
|
|
|
19815
20011
|
if (res.event && typeof res.event === 'function') {
|
|
19816
20012
|
if (res.validate) {
|
|
@@ -19821,9 +20017,9 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
19821
20017
|
switch (_context.prev = _context.next) {
|
|
19822
20018
|
case 0:
|
|
19823
20019
|
if (valid) {
|
|
19824
|
-
res.event(res,
|
|
20020
|
+
res.event(res, _this8.models, index);
|
|
19825
20021
|
} else {
|
|
19826
|
-
|
|
20022
|
+
_this8.setScroll(valid, triggers, _this8.$refs.scrollbar);
|
|
19827
20023
|
}
|
|
19828
20024
|
|
|
19829
20025
|
case 1:
|
|
@@ -19831,7 +20027,7 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
19831
20027
|
return _context.stop();
|
|
19832
20028
|
}
|
|
19833
20029
|
}
|
|
19834
|
-
}, _callee,
|
|
20030
|
+
}, _callee, _this8);
|
|
19835
20031
|
}));
|
|
19836
20032
|
|
|
19837
20033
|
return function (_x, _x2, _x3) {
|
|
@@ -19845,11 +20041,11 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
19845
20041
|
if (this.stepActive < index) {
|
|
19846
20042
|
this.$refs.esForm.validate(function (valid, fields, triggers) {
|
|
19847
20043
|
if (valid) {
|
|
19848
|
-
|
|
19849
|
-
|
|
19850
|
-
|
|
20044
|
+
_this8.stepActive = index;
|
|
20045
|
+
_this8.$emit('stepChange', _this8.stepActive);
|
|
20046
|
+
_this8.$emit('step-change', _this8.stepActive);
|
|
19851
20047
|
} else {
|
|
19852
|
-
|
|
20048
|
+
_this8.setScroll(valid, triggers, _this8.$refs.scrollbar);
|
|
19853
20049
|
}
|
|
19854
20050
|
});
|
|
19855
20051
|
} else {
|
|
@@ -19868,9 +20064,9 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
19868
20064
|
switch (_context2.prev = _context2.next) {
|
|
19869
20065
|
case 0:
|
|
19870
20066
|
if (valid) {
|
|
19871
|
-
|
|
20067
|
+
_this8.$emit('submit', _this8.getNewValue(util["a" /* default */].extend({}, _this8._value, _this8.models), res), res);
|
|
19872
20068
|
} else {
|
|
19873
|
-
|
|
20069
|
+
_this8.setScroll(valid, triggers, _this8.$refs.scrollbar);
|
|
19874
20070
|
}
|
|
19875
20071
|
|
|
19876
20072
|
case 1:
|
|
@@ -19878,7 +20074,7 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
19878
20074
|
return _context2.stop();
|
|
19879
20075
|
}
|
|
19880
20076
|
}
|
|
19881
|
-
}, _callee2,
|
|
20077
|
+
}, _callee2, _this8);
|
|
19882
20078
|
}));
|
|
19883
20079
|
|
|
19884
20080
|
return function (_x4, _x5, _x6) {
|
|
@@ -19900,13 +20096,13 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
19900
20096
|
} else if (res.event === 'stepNext') {
|
|
19901
20097
|
this.$refs.esForm.validate(function (valid, fields, triggers) {
|
|
19902
20098
|
if (valid) {
|
|
19903
|
-
|
|
19904
|
-
|
|
19905
|
-
|
|
19906
|
-
|
|
19907
|
-
|
|
20099
|
+
_this8.stepActive += 1;
|
|
20100
|
+
_this8.$emit('stepChange', _this8.stepActive);
|
|
20101
|
+
_this8.$emit('step-change', _this8.stepActive);
|
|
20102
|
+
_this8.$emit('stepNext', res, _this8.models, _this8.getNewValue(util["a" /* default */].extend({}, _this8._value, _this8.models), res));
|
|
20103
|
+
_this8.$emit('step-next', res, _this8.models, _this8.getNewValue(util["a" /* default */].extend({}, _this8._value, _this8.models), res));
|
|
19908
20104
|
} else {
|
|
19909
|
-
|
|
20105
|
+
_this8.setScroll(valid, triggers, _this8.$refs.scrollbar);
|
|
19910
20106
|
}
|
|
19911
20107
|
});
|
|
19912
20108
|
} else if (res.verify === false) {
|
|
@@ -19956,7 +20152,7 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
19956
20152
|
},
|
|
19957
20153
|
handleCollapse: function handleCollapse() {},
|
|
19958
20154
|
handleChange: function handleChange(a, b, c) {
|
|
19959
|
-
var
|
|
20155
|
+
var _this9 = this;
|
|
19960
20156
|
|
|
19961
20157
|
if (Object.prototype.hasOwnProperty.call(a, 'idCard')) {
|
|
19962
20158
|
var obj = this.IdCardToInfo(b, a);
|
|
@@ -19966,13 +20162,13 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
19966
20162
|
if ((typeof item === 'undefined' ? 'undefined' : _typeof(item)) === 'object') {
|
|
19967
20163
|
for (var i in item) {
|
|
19968
20164
|
if (typeof item[i] === 'string') {
|
|
19969
|
-
|
|
20165
|
+
_this9.$set(_this9.models, i, obj[item[i]]);
|
|
19970
20166
|
} else {
|
|
19971
|
-
|
|
20167
|
+
_this9.$set(_this9.models, i, item[i][obj.sex]);
|
|
19972
20168
|
}
|
|
19973
20169
|
}
|
|
19974
20170
|
} else {
|
|
19975
|
-
|
|
20171
|
+
_this9.$set(_this9.models, item, obj[item]);
|
|
19976
20172
|
}
|
|
19977
20173
|
});
|
|
19978
20174
|
} else {
|
|
@@ -19988,7 +20184,7 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
19988
20184
|
if (Object.prototype.hasOwnProperty.call(a, 'setValues') && (typeof b === 'undefined' ? 'undefined' : _typeof(b)) === 'object') {
|
|
19989
20185
|
if (Array.isArray(a.setValues)) {
|
|
19990
20186
|
a.setValues.forEach(function (item) {
|
|
19991
|
-
|
|
20187
|
+
_this9.$set(_this9.models, item, b[item]);
|
|
19992
20188
|
});
|
|
19993
20189
|
} else {
|
|
19994
20190
|
for (var i in a.setValues) {
|
|
@@ -20028,7 +20224,7 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
20028
20224
|
}
|
|
20029
20225
|
},
|
|
20030
20226
|
validate: function validate(callback) {
|
|
20031
|
-
var
|
|
20227
|
+
var _this10 = this;
|
|
20032
20228
|
|
|
20033
20229
|
var promise = void 0;
|
|
20034
20230
|
if (typeof callback !== 'function' && window.Promise) {
|
|
@@ -20039,7 +20235,7 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
20039
20235
|
});
|
|
20040
20236
|
}
|
|
20041
20237
|
this.$refs.esForm.validate(function (val, fields, triggers) {
|
|
20042
|
-
|
|
20238
|
+
_this10.setScroll(val, triggers, _this10.$refs.scrollbar);
|
|
20043
20239
|
callback(val, fields, triggers);
|
|
20044
20240
|
});
|
|
20045
20241
|
if (promise) {
|
|
@@ -20059,13 +20255,13 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
20059
20255
|
return this.$refs.esForm.validateField(props, callback);
|
|
20060
20256
|
},
|
|
20061
20257
|
resetFields: function resetFields() {
|
|
20062
|
-
var
|
|
20258
|
+
var _this11 = this;
|
|
20063
20259
|
|
|
20064
20260
|
for (var i in this.models) {
|
|
20065
20261
|
this.$set(this.models, i, '');
|
|
20066
20262
|
}
|
|
20067
20263
|
this.$nextTick(function () {
|
|
20068
|
-
|
|
20264
|
+
_this11.clearValidate();
|
|
20069
20265
|
});
|
|
20070
20266
|
//this.$refs.esForm.resetFields();
|
|
20071
20267
|
},
|
|
@@ -20075,7 +20271,7 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
20075
20271
|
submitData: function submitData(handle) {
|
|
20076
20272
|
var close = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
20077
20273
|
|
|
20078
|
-
var
|
|
20274
|
+
var _this12 = this;
|
|
20079
20275
|
|
|
20080
20276
|
var type = arguments[2];
|
|
20081
20277
|
var validate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
@@ -20087,7 +20283,7 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
20087
20283
|
handle = this.handles || {};
|
|
20088
20284
|
}
|
|
20089
20285
|
return new Promise(function (resolve, reject) {
|
|
20090
|
-
validate ?
|
|
20286
|
+
validate ? _this12.$refs.esForm.validate(function () {
|
|
20091
20287
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee3(valid, fields, triggers) {
|
|
20092
20288
|
var models, param, loading;
|
|
20093
20289
|
return regenerator_default.a.wrap(function _callee3$(_context3) {
|
|
@@ -20099,9 +20295,9 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
20099
20295
|
break;
|
|
20100
20296
|
}
|
|
20101
20297
|
|
|
20102
|
-
models =
|
|
20298
|
+
models = _this12.getNewValue(util["a" /* default */].extend({}, _this12._value, _this12.models), handle, type);
|
|
20103
20299
|
|
|
20104
|
-
if (!(
|
|
20300
|
+
if (!(_this12.validated && !_this12.validated(models, validate))) {
|
|
20105
20301
|
_context3.next = 4;
|
|
20106
20302
|
break;
|
|
20107
20303
|
}
|
|
@@ -20109,48 +20305,48 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
20109
20305
|
return _context3.abrupt('return', reject(err));
|
|
20110
20306
|
|
|
20111
20307
|
case 4:
|
|
20112
|
-
param =
|
|
20308
|
+
param = _this12.param;
|
|
20113
20309
|
|
|
20114
20310
|
if (handle.param) {
|
|
20115
|
-
param = util["a" /* default */].extend({},
|
|
20311
|
+
param = util["a" /* default */].extend({}, _this12.param, handle.param);
|
|
20116
20312
|
}
|
|
20117
20313
|
loading = void 0;
|
|
20118
20314
|
|
|
20119
|
-
if (
|
|
20120
|
-
loading = util["a" /* default */].loading(
|
|
20315
|
+
if (_this12.submitLoading) {
|
|
20316
|
+
loading = util["a" /* default */].loading(_this12.$loading, handle.loadingText ? handle.loadingText + '...' : '提交中...');
|
|
20121
20317
|
}
|
|
20122
20318
|
_context3.next = 10;
|
|
20123
|
-
return util["a" /* default */].ajax(_extends({},
|
|
20124
|
-
url: _typeof(
|
|
20125
|
-
format: handle.format ||
|
|
20319
|
+
return util["a" /* default */].ajax(_extends({}, _this12.ajaxConfig, {
|
|
20320
|
+
url: _typeof(_this12.action) === 'object' ? _this12.action[_this12.actionType] : _this12.action,
|
|
20321
|
+
format: handle.format || _this12.format,
|
|
20126
20322
|
data: _extends({}, models, param),
|
|
20127
|
-
method:
|
|
20323
|
+
method: _this12.method,
|
|
20128
20324
|
loading: loading
|
|
20129
20325
|
})).then(function (res) {
|
|
20130
20326
|
loading && loading.close();
|
|
20131
20327
|
if (res.rCode === 0) {
|
|
20132
|
-
|
|
20133
|
-
|
|
20134
|
-
|
|
20135
|
-
if (
|
|
20136
|
-
|
|
20328
|
+
_this12.showMsg && _this12.$message.success(res.msg || res.message || '成功!');
|
|
20329
|
+
_this12.$emit('success', res, models);
|
|
20330
|
+
_this12.models = {};
|
|
20331
|
+
if (_this12.esTabs) {
|
|
20332
|
+
_this12.esTabs.handleTabState(true);
|
|
20137
20333
|
}
|
|
20138
|
-
if (
|
|
20334
|
+
if (_this12.closeDialog) {
|
|
20139
20335
|
if (window.$wujie && window.$wujie.props && window.$wujie.props._dialog) {
|
|
20140
20336
|
window.$wujie.bus.$emit('dialogClose', handle.reload, window.$wujie.props);
|
|
20141
20337
|
}
|
|
20142
|
-
if (
|
|
20143
|
-
|
|
20338
|
+
if (_this12.esDialog && close) {
|
|
20339
|
+
_this12.esDialog.handleClose(handle.reload);
|
|
20144
20340
|
}
|
|
20145
20341
|
}
|
|
20146
20342
|
resolve();
|
|
20147
20343
|
} else {
|
|
20148
|
-
|
|
20149
|
-
|
|
20344
|
+
_this12.$message.error(res.msg || res.message || '系统错误,请联系管理员!');
|
|
20345
|
+
_this12.$emit('error', res);
|
|
20150
20346
|
}
|
|
20151
20347
|
}).catch(function (err) {
|
|
20152
20348
|
if (err.message && err.message !== 'canceled') {
|
|
20153
|
-
|
|
20349
|
+
_this12.$message.error(err.message);
|
|
20154
20350
|
}
|
|
20155
20351
|
reject(err);
|
|
20156
20352
|
});
|
|
@@ -20160,7 +20356,7 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
20160
20356
|
break;
|
|
20161
20357
|
|
|
20162
20358
|
case 12:
|
|
20163
|
-
|
|
20359
|
+
_this12.setScroll(valid, triggers, _this12.$refs.scrollbar);
|
|
20164
20360
|
console.error(valid);
|
|
20165
20361
|
return _context3.abrupt('return', false);
|
|
20166
20362
|
|
|
@@ -20169,7 +20365,7 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
20169
20365
|
return _context3.stop();
|
|
20170
20366
|
}
|
|
20171
20367
|
}
|
|
20172
|
-
}, _callee3,
|
|
20368
|
+
}, _callee3, _this12);
|
|
20173
20369
|
}));
|
|
20174
20370
|
|
|
20175
20371
|
return function (_x9, _x10, _x11) {
|
|
@@ -20181,9 +20377,9 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
20181
20377
|
while (1) {
|
|
20182
20378
|
switch (_context4.prev = _context4.next) {
|
|
20183
20379
|
case 0:
|
|
20184
|
-
models =
|
|
20380
|
+
models = _this12.getNewValue(util["a" /* default */].extend({}, _this12._value, _this12.models), handle, type);
|
|
20185
20381
|
|
|
20186
|
-
if (!(
|
|
20382
|
+
if (!(_this12.validated && !_this12.validated(models, validate))) {
|
|
20187
20383
|
_context4.next = 3;
|
|
20188
20384
|
break;
|
|
20189
20385
|
}
|
|
@@ -20191,48 +20387,48 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
20191
20387
|
return _context4.abrupt('return', reject(err));
|
|
20192
20388
|
|
|
20193
20389
|
case 3:
|
|
20194
|
-
param =
|
|
20390
|
+
param = _this12.param;
|
|
20195
20391
|
|
|
20196
20392
|
if (handle.param) {
|
|
20197
|
-
param = util["a" /* default */].extend({},
|
|
20393
|
+
param = util["a" /* default */].extend({}, _this12.param, handle.param);
|
|
20198
20394
|
}
|
|
20199
20395
|
loading = void 0;
|
|
20200
20396
|
|
|
20201
|
-
if (
|
|
20202
|
-
loading = util["a" /* default */].loading(
|
|
20397
|
+
if (_this12.submitLoading) {
|
|
20398
|
+
loading = util["a" /* default */].loading(_this12.$loading, handle.loadingText ? handle.loadingText + '...' : '提交中...');
|
|
20203
20399
|
}
|
|
20204
20400
|
_context4.next = 9;
|
|
20205
|
-
return util["a" /* default */].ajax(_extends({},
|
|
20206
|
-
url: _typeof(
|
|
20207
|
-
format: handle.format ||
|
|
20401
|
+
return util["a" /* default */].ajax(_extends({}, _this12.ajaxConfig, {
|
|
20402
|
+
url: _typeof(_this12.action) === 'object' ? _this12.action[_this12.actionType] : _this12.action,
|
|
20403
|
+
format: handle.format || _this12.format,
|
|
20208
20404
|
data: _extends({}, models, param),
|
|
20209
|
-
method:
|
|
20405
|
+
method: _this12.method,
|
|
20210
20406
|
loading: loading
|
|
20211
20407
|
})).then(function (res) {
|
|
20212
20408
|
loading && loading.close();
|
|
20213
20409
|
if (res.rCode === 0) {
|
|
20214
|
-
|
|
20215
|
-
|
|
20216
|
-
|
|
20217
|
-
if (
|
|
20218
|
-
|
|
20410
|
+
_this12.showMsg && _this12.$message.success(res.msg || res.message || '成功!');
|
|
20411
|
+
_this12.$emit('success', res, models);
|
|
20412
|
+
_this12.models = {};
|
|
20413
|
+
if (_this12.esTabs) {
|
|
20414
|
+
_this12.esTabs.handleTabState(true);
|
|
20219
20415
|
}
|
|
20220
|
-
if (
|
|
20416
|
+
if (_this12.closeDialog) {
|
|
20221
20417
|
if (window.$wujie && window.$wujie.props && window.$wujie.props._dialog) {
|
|
20222
20418
|
window.$wujie.bus.$emit('dialogClose', handle.reload, window.$wujie.props);
|
|
20223
20419
|
}
|
|
20224
|
-
if (
|
|
20225
|
-
|
|
20420
|
+
if (_this12.esDialog && close) {
|
|
20421
|
+
_this12.esDialog.handleClose(handle.reload);
|
|
20226
20422
|
}
|
|
20227
20423
|
}
|
|
20228
20424
|
resolve();
|
|
20229
20425
|
} else {
|
|
20230
|
-
|
|
20231
|
-
|
|
20426
|
+
_this12.$message.error(res.msg || res.message || '系统错误,请联系管理员!');
|
|
20427
|
+
_this12.$emit('error', res);
|
|
20232
20428
|
}
|
|
20233
20429
|
}).catch(function (err) {
|
|
20234
20430
|
if (err.message && err.message !== 'canceled') {
|
|
20235
|
-
|
|
20431
|
+
_this12.$message.error(err.message);
|
|
20236
20432
|
}
|
|
20237
20433
|
reject(err);
|
|
20238
20434
|
});
|
|
@@ -20242,12 +20438,12 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
20242
20438
|
return _context4.stop();
|
|
20243
20439
|
}
|
|
20244
20440
|
}
|
|
20245
|
-
}, _callee4,
|
|
20441
|
+
}, _callee4, _this12);
|
|
20246
20442
|
}))();
|
|
20247
20443
|
});
|
|
20248
20444
|
},
|
|
20249
20445
|
getVal: function getVal(value, keys) {
|
|
20250
|
-
var
|
|
20446
|
+
var _this13 = this;
|
|
20251
20447
|
|
|
20252
20448
|
if (typeof keys === 'string') {
|
|
20253
20449
|
if (Array.isArray(value)) {
|
|
@@ -20265,15 +20461,15 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
|
|
|
20265
20461
|
return item[keys[i]];
|
|
20266
20462
|
});
|
|
20267
20463
|
return {
|
|
20268
|
-
v:
|
|
20464
|
+
v: _this13.format ? _val.join(',') : _val
|
|
20269
20465
|
};
|
|
20270
20466
|
}
|
|
20271
20467
|
return {
|
|
20272
|
-
v:
|
|
20468
|
+
v: _this13.format && Array.isArray(value[i][keys[i]]) ? value[i][keys[i]].join(',') : value[i][keys[i]]
|
|
20273
20469
|
};
|
|
20274
20470
|
} else {
|
|
20275
20471
|
return {
|
|
20276
|
-
v:
|
|
20472
|
+
v: _this13.getVal(value[i], keys[i])
|
|
20277
20473
|
};
|
|
20278
20474
|
}
|
|
20279
20475
|
};
|
|
@@ -20445,167 +20641,5 @@ main.install = function (Vue) {
|
|
|
20445
20641
|
|
|
20446
20642
|
/* harmony default export */ var packages_form = __webpack_exports__["default"] = (main);
|
|
20447
20643
|
|
|
20448
|
-
/***/ }),
|
|
20449
|
-
|
|
20450
|
-
/***/ 5:
|
|
20451
|
-
/***/ (function(module, exports) {
|
|
20452
|
-
|
|
20453
|
-
module.exports = require("axios");
|
|
20454
|
-
|
|
20455
|
-
/***/ }),
|
|
20456
|
-
|
|
20457
|
-
/***/ 6:
|
|
20458
|
-
/***/ (function(module, exports) {
|
|
20459
|
-
|
|
20460
|
-
module.exports = require("json-bigint");
|
|
20461
|
-
|
|
20462
|
-
/***/ }),
|
|
20463
|
-
|
|
20464
|
-
/***/ 7:
|
|
20465
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
20466
|
-
|
|
20467
|
-
"use strict";
|
|
20468
|
-
/* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
|
|
20469
|
-
/* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(sockjs_client__WEBPACK_IMPORTED_MODULE_0__);
|
|
20470
|
-
/* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
|
|
20471
|
-
/* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(stompjs__WEBPACK_IMPORTED_MODULE_1__);
|
|
20472
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
20473
|
-
|
|
20474
|
-
|
|
20475
|
-
|
|
20476
|
-
|
|
20477
|
-
var WebSocket = function () {
|
|
20478
|
-
// 构造函数
|
|
20479
|
-
function WebSocket() {
|
|
20480
|
-
_classCallCheck(this, WebSocket);
|
|
20481
|
-
|
|
20482
|
-
this.host = sessionStorage.getItem('wshost') || '';
|
|
20483
|
-
this.tryTimes = 1; // 重连次数
|
|
20484
|
-
this.callback = null; // 回调函数
|
|
20485
|
-
this.client = null; // stomp对象
|
|
20486
|
-
this.reconTimeout = null; // 重连延时器
|
|
20487
|
-
this.debug = true; // 调试
|
|
20488
|
-
this.interval = 20; // 重连间隔时间
|
|
20489
|
-
this.vm = null;
|
|
20490
|
-
this.nextDate = 0;
|
|
20491
|
-
this.connects = 1;
|
|
20492
|
-
this.recon = false;
|
|
20493
|
-
this.sendTimeout = null;
|
|
20494
|
-
}
|
|
20495
|
-
|
|
20496
|
-
/** socket连接 */
|
|
20497
|
-
|
|
20498
|
-
|
|
20499
|
-
WebSocket.prototype.connect = function connect() {
|
|
20500
|
-
var _this = this;
|
|
20501
|
-
|
|
20502
|
-
if (!this.client) {
|
|
20503
|
-
// 连接SockJS
|
|
20504
|
-
var socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url);
|
|
20505
|
-
// 获取STOMP子协议的客户端对象
|
|
20506
|
-
this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(socket);
|
|
20507
|
-
}
|
|
20508
|
-
|
|
20509
|
-
// 日志不打印
|
|
20510
|
-
if (!this.debug) {
|
|
20511
|
-
console.log(111);
|
|
20512
|
-
this.client.debug = function () {};
|
|
20513
|
-
}
|
|
20514
|
-
|
|
20515
|
-
// 向服务器发起websocket连接
|
|
20516
|
-
this.client.connect({}, function () {
|
|
20517
|
-
_this.recon = true;
|
|
20518
|
-
// tryTimes定义重置
|
|
20519
|
-
_this.connects = 1;
|
|
20520
|
-
// 订阅消息
|
|
20521
|
-
_this.subscribe();
|
|
20522
|
-
}, function (error) {
|
|
20523
|
-
var diffSecond = parseInt((new Date() - _this.nextDate) / 1000, 10);
|
|
20524
|
-
if (_this.connects > 5 && diffSecond < _this.interval) {
|
|
20525
|
-
_this.client.disconnect();
|
|
20526
|
-
_this.error && _this.error(error);
|
|
20527
|
-
} else {
|
|
20528
|
-
_this.reconTimeout = setTimeout(function () {
|
|
20529
|
-
_this.connect();
|
|
20530
|
-
_this.connects++;
|
|
20531
|
-
}, 5000);
|
|
20532
|
-
}
|
|
20533
|
-
});
|
|
20534
|
-
};
|
|
20535
|
-
/** 订阅服务端 */
|
|
20536
|
-
|
|
20537
|
-
|
|
20538
|
-
WebSocket.prototype.subscribe = function subscribe() {
|
|
20539
|
-
var _this2 = this;
|
|
20540
|
-
|
|
20541
|
-
// 订阅服务端提供的某个topic
|
|
20542
|
-
this.client.subscribe(this.take, function (response) {
|
|
20543
|
-
if (response && (_this2.callback || _this2.success)) {
|
|
20544
|
-
var callback = _this2.callback || _this2.success;
|
|
20545
|
-
callback(JSON.parse(response.body));
|
|
20546
|
-
}
|
|
20547
|
-
});
|
|
20548
|
-
};
|
|
20549
|
-
|
|
20550
|
-
/** 赋值、初始化socket */
|
|
20551
|
-
|
|
20552
|
-
|
|
20553
|
-
WebSocket.prototype.init = function init(option, vm) {
|
|
20554
|
-
for (var i in option) {
|
|
20555
|
-
this[i] = option[i];
|
|
20556
|
-
}
|
|
20557
|
-
this.vm = vm;
|
|
20558
|
-
// 初始化连接
|
|
20559
|
-
this.connect();
|
|
20560
|
-
};
|
|
20561
|
-
|
|
20562
|
-
/** 发送消息 */
|
|
20563
|
-
|
|
20564
|
-
|
|
20565
|
-
WebSocket.prototype.send = function send(data) {
|
|
20566
|
-
var _this3 = this;
|
|
20567
|
-
|
|
20568
|
-
if (this.recon) {
|
|
20569
|
-
clearTimeout(this.sendTimeout);
|
|
20570
|
-
this.client.send(this.take, {}, typeof data === 'string' ? data : JSON.stringify(data));
|
|
20571
|
-
} else {
|
|
20572
|
-
this.sendTimeout = setTimeout(function () {
|
|
20573
|
-
_this3.send(data);
|
|
20574
|
-
}, 1000);
|
|
20575
|
-
}
|
|
20576
|
-
};
|
|
20577
|
-
|
|
20578
|
-
/** 销毁 */
|
|
20579
|
-
|
|
20580
|
-
|
|
20581
|
-
WebSocket.prototype.destroy = function destroy() {
|
|
20582
|
-
// 断开连接,清除定时器
|
|
20583
|
-
if (this.client) {
|
|
20584
|
-
this.client.disconnect();
|
|
20585
|
-
};
|
|
20586
|
-
this.reconTimeout && clearTimeout(this.reconTimeout);
|
|
20587
|
-
this.sendTimeout && clearTimeout(this.sendTimeout);
|
|
20588
|
-
};
|
|
20589
|
-
|
|
20590
|
-
return WebSocket;
|
|
20591
|
-
}();
|
|
20592
|
-
|
|
20593
|
-
/* harmony default export */ __webpack_exports__["a"] = (WebSocket);
|
|
20594
|
-
|
|
20595
|
-
/***/ }),
|
|
20596
|
-
|
|
20597
|
-
/***/ 8:
|
|
20598
|
-
/***/ (function(module, exports) {
|
|
20599
|
-
|
|
20600
|
-
module.exports = require("sockjs-client");
|
|
20601
|
-
|
|
20602
|
-
/***/ }),
|
|
20603
|
-
|
|
20604
|
-
/***/ 9:
|
|
20605
|
-
/***/ (function(module, exports) {
|
|
20606
|
-
|
|
20607
|
-
module.exports = require("stompjs");
|
|
20608
|
-
|
|
20609
20644
|
/***/ })
|
|
20610
|
-
|
|
20611
|
-
/******/ });
|
|
20645
|
+
/******/ ]);
|