@panpanzhao/component-ui 1.24.1105 → 1.24.1217
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/0.worker.js +1 -0
- package/lib/component-ui.common.js +946 -181
- package/lib/components/0.worker.js +1052 -0
- package/lib/components/crud.js +6 -2
- package/lib/components/dialog.js +4 -4
- package/lib/components/drawer.js +2 -2
- package/lib/components/form-drawer.js +4 -4
- package/lib/components/form-input.js +910 -152
- package/lib/components/form-item.js +14 -6
- package/lib/components/form-query.js +2 -2
- package/lib/components/formula.js +21 -21
- package/lib/components/table-column.js +10 -10
- package/lib/components/table-editable.js +6 -6
- package/lib/components/table-operate.js +6 -2
- package/lib/components/table-search.js +6 -6
- package/lib/components/table.js +4 -4
- package/lib/components/timeline.js +4 -5
- package/lib/components/tree-line.js +2 -2
- package/lib/index.js +1 -1
- package/lib/styles/component-ui.css +2 -2
- package/lib/styles/index.css +2 -2
- package/lib/styles/upload-process.css +1 -1
- package/package.json +73 -70
|
@@ -82,7 +82,7 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 75);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ([
|
|
@@ -265,108 +265,703 @@ module.exports = require("element-ui/lib/radio");
|
|
|
265
265
|
module.exports = require("element-ui/lib/cascader");
|
|
266
266
|
|
|
267
267
|
/***/ }),
|
|
268
|
-
/* 36
|
|
268
|
+
/* 36 */
|
|
269
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
270
|
+
|
|
271
|
+
"use strict";
|
|
272
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return uploadFile; });
|
|
273
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return mergeChunk; });
|
|
274
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return checkFile; });
|
|
275
|
+
/**
|
|
276
|
+
* [uploadFile] - 上传切片参数
|
|
277
|
+
* @param fileHash 文件hash,String
|
|
278
|
+
* @param fileSize 文件大小,Number
|
|
279
|
+
* @param fileName 文件名称,String
|
|
280
|
+
* @param index 多文件上传中的所在index,number
|
|
281
|
+
* @param chunkFile 切片文件本身,File || Blob || void
|
|
282
|
+
* @param chunkHash 切片文件hash,String
|
|
283
|
+
* @param chunkSize 分片大小,Number
|
|
284
|
+
* @param chunkNumber 切片总数量,Number
|
|
285
|
+
* @param finish 是否上传完成,可选参数,Boolean
|
|
286
|
+
*/
|
|
287
|
+
|
|
288
|
+
// 上传单个切片
|
|
289
|
+
function uploadFile(data, _ref) {
|
|
290
|
+
var onCancel = _ref.onCancel,
|
|
291
|
+
service = _ref.service;
|
|
292
|
+
var controller = new AbortController();
|
|
293
|
+
var signal = controller.signal; // 获取 signal 对象
|
|
294
|
+
// 封装 axios 请求或 HTTP 客户端请求
|
|
295
|
+
var request = service({
|
|
296
|
+
url: "/tengine/dfs/bigStorage/upload",
|
|
297
|
+
method: "post",
|
|
298
|
+
data: data,
|
|
299
|
+
headers: {
|
|
300
|
+
Content_Type: "application/x-www-form-urlencoded"
|
|
301
|
+
},
|
|
302
|
+
signal: signal // 将 signal 传递给服务函数
|
|
303
|
+
});
|
|
304
|
+
// 如果提供了 onCancel 回调,则传递取消函数
|
|
305
|
+
if (typeof onCancel === "function") {
|
|
306
|
+
// 如果是一个函数,则直接调用传一个取消方法给 这个方法
|
|
307
|
+
// 所以只要传进来是方法,就会直接传一个参数并直接触发这个函数
|
|
308
|
+
// 那传过来的这个方法就会接收到一个参数(就是取消函数() => controller.abort())
|
|
309
|
+
// 在调用uploadFile就可以拿到这个参数
|
|
310
|
+
onCancel(function () {
|
|
311
|
+
return controller.abort();
|
|
312
|
+
}); // 调用 onCancel 时传入取消函数
|
|
313
|
+
}
|
|
314
|
+
return request;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* [mergeChunk] - 合并切片
|
|
319
|
+
* @param chunkSize 分片大小,Number
|
|
320
|
+
* @param fileName 文件名称,String
|
|
321
|
+
* @param fileSize 文件大小,Number
|
|
322
|
+
*/
|
|
323
|
+
|
|
324
|
+
// 合并所有切片
|
|
325
|
+
function mergeChunk(data, _ref2) {
|
|
326
|
+
var service = _ref2.service;
|
|
327
|
+
return service({
|
|
328
|
+
url: "/tengine/dfs/bigStorage/merge",
|
|
329
|
+
method: "post",
|
|
330
|
+
data: {
|
|
331
|
+
fileMd5: data.fileHash,
|
|
332
|
+
fsign: data.fsign,
|
|
333
|
+
fileName: data.fileName,
|
|
334
|
+
fileSize: data.fileSize,
|
|
335
|
+
busiType: data.busiType
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* [checkFile] - 检查文件是否存在
|
|
342
|
+
* @param fileHash 文件hash,String
|
|
343
|
+
* @param fileName 文件名称,String
|
|
344
|
+
*/
|
|
345
|
+
|
|
346
|
+
// 检查文件是否存在
|
|
347
|
+
function checkFile(data, _ref3) {
|
|
348
|
+
var service = _ref3.service;
|
|
349
|
+
return service({
|
|
350
|
+
url: "/tengine/dfs/bigStorage/checkChunk",
|
|
351
|
+
method: "post",
|
|
352
|
+
data: {
|
|
353
|
+
fileMd5: data.fileHash,
|
|
354
|
+
fileName: data.fileName,
|
|
355
|
+
busiType: data.busiType
|
|
356
|
+
},
|
|
357
|
+
headers: {
|
|
358
|
+
Content_Type: "application/x-www-form-urlencoded"
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/***/ }),
|
|
269
364
|
/* 37 */,
|
|
270
365
|
/* 38 */,
|
|
271
|
-
/* 39
|
|
366
|
+
/* 39 */,
|
|
367
|
+
/* 40 */
|
|
272
368
|
/***/ (function(module, exports) {
|
|
273
369
|
|
|
274
370
|
module.exports = require("element-ui/lib/input-number");
|
|
275
371
|
|
|
276
372
|
/***/ }),
|
|
277
|
-
/*
|
|
373
|
+
/* 41 */
|
|
278
374
|
/***/ (function(module, exports) {
|
|
279
375
|
|
|
280
376
|
module.exports = require("element-ui/lib/select");
|
|
281
377
|
|
|
282
378
|
/***/ }),
|
|
283
|
-
/*
|
|
379
|
+
/* 42 */
|
|
284
380
|
/***/ (function(module, exports) {
|
|
285
381
|
|
|
286
382
|
module.exports = require("element-ui/lib/option");
|
|
287
383
|
|
|
288
384
|
/***/ }),
|
|
289
|
-
/*
|
|
385
|
+
/* 43 */
|
|
290
386
|
/***/ (function(module, exports) {
|
|
291
387
|
|
|
292
388
|
module.exports = require("element-ui/lib/option-group");
|
|
293
389
|
|
|
294
390
|
/***/ }),
|
|
295
|
-
/*
|
|
391
|
+
/* 44 */
|
|
296
392
|
/***/ (function(module, exports) {
|
|
297
393
|
|
|
298
394
|
module.exports = require("@panpanzhao/component-ui/lib/components/tree-line");
|
|
299
395
|
|
|
300
396
|
/***/ }),
|
|
301
|
-
/*
|
|
397
|
+
/* 45 */
|
|
302
398
|
/***/ (function(module, exports) {
|
|
303
399
|
|
|
304
400
|
module.exports = require("element-ui/lib/radio-group");
|
|
305
401
|
|
|
306
402
|
/***/ }),
|
|
307
|
-
/*
|
|
403
|
+
/* 46 */
|
|
308
404
|
/***/ (function(module, exports) {
|
|
309
405
|
|
|
310
406
|
module.exports = require("element-ui/lib/radio-button");
|
|
311
407
|
|
|
312
408
|
/***/ }),
|
|
313
|
-
/*
|
|
409
|
+
/* 47 */
|
|
314
410
|
/***/ (function(module, exports) {
|
|
315
411
|
|
|
316
412
|
module.exports = require("element-ui/lib/checkbox-group");
|
|
317
413
|
|
|
318
414
|
/***/ }),
|
|
319
|
-
/*
|
|
415
|
+
/* 48 */
|
|
320
416
|
/***/ (function(module, exports) {
|
|
321
417
|
|
|
322
418
|
module.exports = require("element-ui/lib/checkbox");
|
|
323
419
|
|
|
324
420
|
/***/ }),
|
|
325
|
-
/*
|
|
421
|
+
/* 49 */
|
|
326
422
|
/***/ (function(module, exports) {
|
|
327
423
|
|
|
328
424
|
module.exports = require("element-ui/lib/checkbox-button");
|
|
329
425
|
|
|
330
426
|
/***/ }),
|
|
331
|
-
/*
|
|
427
|
+
/* 50 */
|
|
332
428
|
/***/ (function(module, exports) {
|
|
333
429
|
|
|
334
430
|
module.exports = require("element-ui/lib/date-picker");
|
|
335
431
|
|
|
336
432
|
/***/ }),
|
|
337
|
-
/*
|
|
433
|
+
/* 51 */
|
|
434
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
435
|
+
|
|
436
|
+
"use strict";
|
|
437
|
+
/* WEBPACK VAR INJECTION */(function(__webpack__worker__0) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LargeUpload; });
|
|
438
|
+
/* harmony import */ var _remote_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36);
|
|
439
|
+
/* harmony import */ var js_md5__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(52);
|
|
440
|
+
/* harmony import */ var js_md5__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(js_md5__WEBPACK_IMPORTED_MODULE_1__);
|
|
441
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
442
|
+
function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
443
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
444
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
445
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(typeof e + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
446
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
447
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
448
|
+
function _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError("attempted to use private field on non-instance"); } return receiver; }
|
|
449
|
+
var id = 0;
|
|
450
|
+
function _classPrivateFieldLooseKey(name) { return "__private_" + id++ + "_" + name; }
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
var _useWorker = /*#__PURE__*/_classPrivateFieldLooseKey("useWorker");
|
|
454
|
+
var _finishTask = /*#__PURE__*/_classPrivateFieldLooseKey("finishTask");
|
|
455
|
+
var _handleMerge = /*#__PURE__*/_classPrivateFieldLooseKey("handleMerge");
|
|
456
|
+
var _signleFileProgress = /*#__PURE__*/_classPrivateFieldLooseKey("signleFileProgress");
|
|
457
|
+
var _uploadSignleFile = /*#__PURE__*/_classPrivateFieldLooseKey("uploadSignleFile");
|
|
458
|
+
var LargeUpload = /*#__PURE__*/function () {
|
|
459
|
+
function LargeUpload(fileObj, options, callBack) {
|
|
460
|
+
// 单个文件上传
|
|
461
|
+
Object.defineProperty(this, _uploadSignleFile, {
|
|
462
|
+
value: _uploadSignleFile2
|
|
463
|
+
});
|
|
464
|
+
// 更新单个文件进度条
|
|
465
|
+
Object.defineProperty(this, _signleFileProgress, {
|
|
466
|
+
value: _signleFileProgress2
|
|
467
|
+
});
|
|
468
|
+
// 调取合并接口处理所有切片
|
|
469
|
+
Object.defineProperty(this, _handleMerge, {
|
|
470
|
+
value: _handleMerge2
|
|
471
|
+
});
|
|
472
|
+
// 设置单个文件上传已完成
|
|
473
|
+
Object.defineProperty(this, _finishTask, {
|
|
474
|
+
value: _finishTask2
|
|
475
|
+
});
|
|
476
|
+
// 生成文件 hash(web-worker)
|
|
477
|
+
Object.defineProperty(this, _useWorker, {
|
|
478
|
+
value: _useWorker2
|
|
479
|
+
});
|
|
480
|
+
var request = options.request,
|
|
481
|
+
uploadFileList = options.uploadFileList,
|
|
482
|
+
_chunkSize = options.chunkSize,
|
|
483
|
+
maxRequest = options.maxRequest,
|
|
484
|
+
_busiType = options.busiType,
|
|
485
|
+
batchMaxCount = options.batchMaxCount;
|
|
486
|
+
this.fileObj = fileObj;
|
|
487
|
+
this.request = request;
|
|
488
|
+
this.uploadFileList = uploadFileList;
|
|
489
|
+
this.chunkSize = _chunkSize;
|
|
490
|
+
this.busiType = _busiType;
|
|
491
|
+
this.maxRequest = maxRequest || 6;
|
|
492
|
+
this.batchMaxCount = batchMaxCount || 6;
|
|
493
|
+
this.onUploadProgress = callBack == null ? void 0 : callBack.onUploadProgress;
|
|
494
|
+
this.onUploadFinish = callBack == null ? void 0 : callBack.onUploadFinish;
|
|
495
|
+
this.onUploadError = callBack == null ? void 0 : callBack.onUploadError;
|
|
496
|
+
}
|
|
497
|
+
// 取消单个
|
|
498
|
+
var _proto = LargeUpload.prototype;
|
|
499
|
+
_proto.cancelSingle =
|
|
500
|
+
/*#__PURE__*/
|
|
501
|
+
function () {
|
|
502
|
+
var _cancelSingle = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
503
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
504
|
+
while (1) switch (_context.prev = _context.next) {
|
|
505
|
+
case 0:
|
|
506
|
+
this.pauseUpload(true);
|
|
507
|
+
//情况所有需要上传的分片
|
|
508
|
+
this.fileObj.allChunkList = [];
|
|
509
|
+
// 取消上传后列表删除该文件
|
|
510
|
+
// const list = uploadFileList.filter((itemB) => itemB.fileHash !== this.fileObj.fileHash);
|
|
511
|
+
// uploadFileList = list;
|
|
512
|
+
case 2:
|
|
513
|
+
case "end":
|
|
514
|
+
return _context.stop();
|
|
515
|
+
}
|
|
516
|
+
}, _callee, this);
|
|
517
|
+
}));
|
|
518
|
+
function cancelSingle() {
|
|
519
|
+
return _cancelSingle.apply(this, arguments);
|
|
520
|
+
}
|
|
521
|
+
return cancelSingle;
|
|
522
|
+
}() // 暂停上传(是暂停剩下未上传的)
|
|
523
|
+
;
|
|
524
|
+
_proto.pauseUpload = function pauseUpload(elsePause, error) {
|
|
525
|
+
if (elsePause === void 0) {
|
|
526
|
+
elsePause = true;
|
|
527
|
+
}
|
|
528
|
+
// elsePause为true就是主动暂停,为false就是请求中断
|
|
529
|
+
// 4是成功 6是失败 如果不是成功或者失败状态,
|
|
530
|
+
if (![200, 500].includes(this.fileObj.state)) {
|
|
531
|
+
// 3是暂停,5是中断
|
|
532
|
+
if (elsePause) {
|
|
533
|
+
this.fileObj.state = 30;
|
|
534
|
+
} else {
|
|
535
|
+
this.fileObj.state = 50;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
this.fileObj.errNumber = 0;
|
|
539
|
+
|
|
540
|
+
// 取消还在请求中的所有接口
|
|
541
|
+
if (this.fileObj.whileRequests.length > 0) {
|
|
542
|
+
for (var _iterator = _createForOfIteratorHelperLoose(this.fileObj.whileRequests), _step; !(_step = _iterator()).done;) {
|
|
543
|
+
var itemB = _step.value;
|
|
544
|
+
itemB.cancel ? itemB.cancel() : "";
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
if (typeof this.onUploadError === "function") {
|
|
548
|
+
this.onUploadError(error || new Error("上传失败"));
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
// 继续上传
|
|
552
|
+
;
|
|
553
|
+
_proto.resumeUpload = function resumeUpload() {
|
|
554
|
+
var _this$fileObj$allChun;
|
|
555
|
+
// 2为上传中
|
|
556
|
+
this.fileObj.state = 100;
|
|
557
|
+
// 把刚才暂停的正在上传中所有切片放到待上传切片列表中
|
|
558
|
+
(_this$fileObj$allChun = this.fileObj.allChunkList).push.apply(_this$fileObj$allChun, this.fileObj.whileRequests);
|
|
559
|
+
this.fileObj.whileRequests = [];
|
|
560
|
+
_classPrivateFieldLooseBase(this, _uploadSignleFile)[_uploadSignleFile]();
|
|
561
|
+
}
|
|
562
|
+
// 开始上传事件
|
|
563
|
+
;
|
|
564
|
+
_proto.hanldeUploadFile =
|
|
565
|
+
/*#__PURE__*/
|
|
566
|
+
function () {
|
|
567
|
+
var _hanldeUploadFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
568
|
+
var _this = this;
|
|
569
|
+
var _yield$_classPrivateF, fileHash, fileChunkList, baseName, lastIndex, res, skipUpload, uploadedChunks;
|
|
570
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
571
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
572
|
+
case 0:
|
|
573
|
+
_context2.prev = 0;
|
|
574
|
+
this.fileObj.state = 10,
|
|
575
|
+
// 0是什么都不做,1文件处理中,2是上传中,3是暂停,4是上传完成,5上传中断,6是上传失败
|
|
576
|
+
this.fileObj.fileHash = "", this.fileObj.fileName = this.fileObj.name, this.fileObj.fileSize = this.fileObj.size, this.fileObj.allChunkList = [],
|
|
577
|
+
// 所有请求的数据
|
|
578
|
+
this.fileObj.whileRequests = [],
|
|
579
|
+
// 正在请求中的请求个数,目前是要永远都保存请求个数为6
|
|
580
|
+
this.fileObj.finishNumber = 0,
|
|
581
|
+
//请求完成的个数
|
|
582
|
+
this.fileObj.errNumber = 0,
|
|
583
|
+
// 报错的个数,默认是0个,超多3个就是直接上传中断
|
|
584
|
+
this.fileObj.percentage = 0,
|
|
585
|
+
// 单个文件上传进度条
|
|
586
|
+
this.fileObj.cancel = null,
|
|
587
|
+
// 用于取消切片上传接口
|
|
588
|
+
this.fileObj.busiType = this.busiType, this.fileObj.resume = this.resumeUpload.bind(this),
|
|
589
|
+
//用于重新上传
|
|
590
|
+
this.fileObj.cancel = this.cancelSingle.bind(this); //用于取消上传
|
|
591
|
+
if (this.fileObj.size === 0) {
|
|
592
|
+
// 文件大小为0直接上传失败
|
|
593
|
+
this.fileObj.state = 500;
|
|
594
|
+
// 上传中断
|
|
595
|
+
this.pauseUpload(false, new Error("文件大小为0"));
|
|
596
|
+
}
|
|
597
|
+
console.log("文件开始解析");
|
|
598
|
+
|
|
599
|
+
// 计算文件hash
|
|
600
|
+
_context2.next = 6;
|
|
601
|
+
return _classPrivateFieldLooseBase(this, _useWorker)[_useWorker](this.fileObj.raw || this.fileObj.file.raw);
|
|
602
|
+
case 6:
|
|
603
|
+
_yield$_classPrivateF = _context2.sent;
|
|
604
|
+
fileHash = _yield$_classPrivateF.fileHash;
|
|
605
|
+
fileChunkList = _yield$_classPrivateF.fileChunkList;
|
|
606
|
+
console.log(fileHash, "文件hash计算完成");
|
|
607
|
+
|
|
608
|
+
// 解析完成开始上传文件
|
|
609
|
+
baseName = ""; // 查找'.'在fileName中最后出现的位置
|
|
610
|
+
lastIndex = this.fileObj.name.lastIndexOf("."); // 如果'.'不存在,则返回整个文件名
|
|
611
|
+
if (lastIndex === -1) {
|
|
612
|
+
baseName = this.fileObj.name;
|
|
613
|
+
}
|
|
614
|
+
// 否则,返回从fileName开始到'.'前一个字符的子串作为文件名(不包含'.')
|
|
615
|
+
baseName = "_" + Object(js_md5__WEBPACK_IMPORTED_MODULE_1__["md5"])(this.fileObj.name.slice(0, lastIndex));
|
|
616
|
+
// 这里要注意!可能同一个文件,是复制出来的,出现文件名不同但是内容相同,导致获取到的hash值也是相同的
|
|
617
|
+
// 所以文件hash要特殊处理
|
|
618
|
+
this.fileObj.fileHash = "" + fileHash + baseName;
|
|
619
|
+
this.fileObj.fsign = fileHash;
|
|
620
|
+
this.fileObj.state = 100;
|
|
621
|
+
// console.log(uploadFileList.value, 'uploadFileList.value')
|
|
622
|
+
// 上传之前要检查服务器是否存在该文件
|
|
623
|
+
_context2.next = 19;
|
|
624
|
+
return Object(_remote_js__WEBPACK_IMPORTED_MODULE_0__[/* checkFile */ "a"])({
|
|
625
|
+
fileHash: "" + fileHash + baseName,
|
|
626
|
+
fileName: this.fileObj.name,
|
|
627
|
+
busiType: this.fileObj.busiType
|
|
628
|
+
}, {
|
|
629
|
+
service: this.request
|
|
630
|
+
});
|
|
631
|
+
case 19:
|
|
632
|
+
res = _context2.sent;
|
|
633
|
+
skipUpload = res.skipUpload, uploadedChunks = res.uploadedChunks;
|
|
634
|
+
if (skipUpload) {
|
|
635
|
+
_context2.next = 25;
|
|
636
|
+
break;
|
|
637
|
+
}
|
|
638
|
+
//this.#finishTask(fileObj)
|
|
639
|
+
_classPrivateFieldLooseBase(this, _handleMerge)[_handleMerge]();
|
|
640
|
+
console.log("文件已存在,实现秒传");
|
|
641
|
+
return _context2.abrupt("return", false);
|
|
642
|
+
case 25:
|
|
643
|
+
this.fileObj.allChunkList = fileChunkList.map(function (item, index) {
|
|
644
|
+
return {
|
|
645
|
+
// 总文件hash
|
|
646
|
+
fileHash: "" + fileHash + baseName,
|
|
647
|
+
// 总文件size
|
|
648
|
+
fileSize: _this.fileObj.size,
|
|
649
|
+
// 总文件name
|
|
650
|
+
fileName: _this.fileObj.name,
|
|
651
|
+
index: index,
|
|
652
|
+
// 切片文件本身
|
|
653
|
+
chunkFile: item.chunkFile,
|
|
654
|
+
// 单个切片hash,以 - 连接
|
|
655
|
+
chunkHash: "" + fileHash + baseName + "-" + index,
|
|
656
|
+
// 切片文件大小
|
|
657
|
+
chunkSize: _this.chunkSize,
|
|
658
|
+
// 切片个数
|
|
659
|
+
chunkNumber: fileChunkList.length,
|
|
660
|
+
// 切片是否已经完成
|
|
661
|
+
finish: false
|
|
662
|
+
};
|
|
663
|
+
});
|
|
664
|
+
|
|
665
|
+
// 如果已存在部分文件切片,则要过滤调已经上传的切片
|
|
666
|
+
if (!((uploadedChunks == null ? void 0 : uploadedChunks.length) > 0)) {
|
|
667
|
+
_context2.next = 35;
|
|
668
|
+
break;
|
|
669
|
+
}
|
|
670
|
+
// 过滤掉已经上传过的切片
|
|
671
|
+
this.fileObj.allChunkList = this.fileObj.allChunkList.filter(function (item) {
|
|
672
|
+
return !uploadedChunks.includes(item.chunkHash);
|
|
673
|
+
// return !uploadedChunks.includes(String(item.index));
|
|
674
|
+
});
|
|
675
|
+
|
|
676
|
+
// 如果存在需要上传的,但是又为空,可能是因为还没合并,
|
|
677
|
+
if (this.fileObj.allChunkList.length) {
|
|
678
|
+
_context2.next = 34;
|
|
679
|
+
break;
|
|
680
|
+
}
|
|
681
|
+
_context2.next = 31;
|
|
682
|
+
return _classPrivateFieldLooseBase(this, _handleMerge)[_handleMerge]();
|
|
683
|
+
case 31:
|
|
684
|
+
return _context2.abrupt("return", false);
|
|
685
|
+
case 34:
|
|
686
|
+
// 同时要注意处理切片数量
|
|
687
|
+
this.fileObj.allChunkList = this.fileObj.allChunkList.map(function (item) {
|
|
688
|
+
return _extends({}, item, {
|
|
689
|
+
chunkNumber: _this.fileObj.allChunkList.length
|
|
690
|
+
});
|
|
691
|
+
});
|
|
692
|
+
case 35:
|
|
693
|
+
// 逐步对单个文件进行切片上传
|
|
694
|
+
_classPrivateFieldLooseBase(this, _uploadSignleFile)[_uploadSignleFile]();
|
|
695
|
+
_context2.next = 42;
|
|
696
|
+
break;
|
|
697
|
+
case 38:
|
|
698
|
+
_context2.prev = 38;
|
|
699
|
+
_context2.t0 = _context2["catch"](0);
|
|
700
|
+
console.log(_context2.t0);
|
|
701
|
+
this.pauseUpload(false, _context2.t0);
|
|
702
|
+
case 42:
|
|
703
|
+
case "end":
|
|
704
|
+
return _context2.stop();
|
|
705
|
+
}
|
|
706
|
+
}, _callee2, this, [[0, 38]]);
|
|
707
|
+
}));
|
|
708
|
+
function hanldeUploadFile() {
|
|
709
|
+
return _hanldeUploadFile.apply(this, arguments);
|
|
710
|
+
}
|
|
711
|
+
return hanldeUploadFile;
|
|
712
|
+
}();
|
|
713
|
+
return LargeUpload;
|
|
714
|
+
}();
|
|
715
|
+
function _useWorker2(file) {
|
|
716
|
+
var _this2 = this;
|
|
717
|
+
return new Promise(function (resolve) {
|
|
718
|
+
// const worker = new Worker(new URL("./hash-worker.js", import.meta.url), {
|
|
719
|
+
// type: "module",
|
|
720
|
+
// });
|
|
721
|
+
var worker = new Worker(__webpack__worker__0, undefined);
|
|
722
|
+
worker.postMessage({
|
|
723
|
+
file: file,
|
|
724
|
+
chunkSize: _this2.chunkSize
|
|
725
|
+
});
|
|
726
|
+
worker.onmessage = function (e) {
|
|
727
|
+
var _e$data = e.data,
|
|
728
|
+
fileHash = _e$data.fileHash,
|
|
729
|
+
fileChunkList = _e$data.fileChunkList;
|
|
730
|
+
if (fileHash) {
|
|
731
|
+
resolve({
|
|
732
|
+
fileHash: fileHash,
|
|
733
|
+
fileChunkList: fileChunkList
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
};
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
function _finishTask2() {
|
|
740
|
+
// 200是上传完成
|
|
741
|
+
// this.fileObj.state = 200;
|
|
742
|
+
if (typeof this.onUploadProgress === "function") {
|
|
743
|
+
this.onUploadProgress({
|
|
744
|
+
percentage: 100
|
|
745
|
+
});
|
|
746
|
+
return false;
|
|
747
|
+
}
|
|
748
|
+
this.fileObj.percentage = 100;
|
|
749
|
+
}
|
|
750
|
+
function _handleMerge2() {
|
|
751
|
+
return _handleMerge3.apply(this, arguments);
|
|
752
|
+
}
|
|
753
|
+
function _handleMerge3() {
|
|
754
|
+
_handleMerge3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
755
|
+
var _this$fileObj, fileName, fileHash, fsign, fileSize, busiType, res;
|
|
756
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
757
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
758
|
+
case 0:
|
|
759
|
+
_this$fileObj = this.fileObj, fileName = _this$fileObj.fileName, fileHash = _this$fileObj.fileHash, fsign = _this$fileObj.fsign, fileSize = _this$fileObj.fileSize, busiType = _this$fileObj.busiType;
|
|
760
|
+
_context4.prev = 1;
|
|
761
|
+
_context4.next = 4;
|
|
762
|
+
return Object(_remote_js__WEBPACK_IMPORTED_MODULE_0__[/* mergeChunk */ "b"])({
|
|
763
|
+
fileName: fileName,
|
|
764
|
+
fileHash: fileHash,
|
|
765
|
+
fsign: fsign,
|
|
766
|
+
fileSize: fileSize,
|
|
767
|
+
busiType: busiType
|
|
768
|
+
}, {
|
|
769
|
+
service: this.request
|
|
770
|
+
});
|
|
771
|
+
case 4:
|
|
772
|
+
res = _context4.sent;
|
|
773
|
+
// 设置文件上传状态
|
|
774
|
+
_classPrivateFieldLooseBase(this, _finishTask)[_finishTask]();
|
|
775
|
+
console.log("文件合并成功!");
|
|
776
|
+
// 最后赋值文件切片上传完成个数为0
|
|
777
|
+
this.fileObj.finishNumber = 0;
|
|
778
|
+
this.onUploadFinish(res);
|
|
779
|
+
return _context4.abrupt("return", res);
|
|
780
|
+
case 12:
|
|
781
|
+
_context4.prev = 12;
|
|
782
|
+
_context4.t0 = _context4["catch"](1);
|
|
783
|
+
this.pauseUpload(false, _context4.t0);
|
|
784
|
+
console.log("文件合并失败!");
|
|
785
|
+
// 最后赋值文件切片上传完成个数为0
|
|
786
|
+
this.fileObj.finishNumber = 0;
|
|
787
|
+
this.onUploadError(_context4.t0);
|
|
788
|
+
return _context4.abrupt("return", null);
|
|
789
|
+
case 19:
|
|
790
|
+
case "end":
|
|
791
|
+
return _context4.stop();
|
|
792
|
+
}
|
|
793
|
+
}, _callee4, this, [[1, 12]]);
|
|
794
|
+
}));
|
|
795
|
+
return _handleMerge3.apply(this, arguments);
|
|
796
|
+
}
|
|
797
|
+
function _signleFileProgress2(needObj) {
|
|
798
|
+
// 即使是超时请求也是会频繁的返回上传进度的,所以只能写成完成一片就添加它所占百分之多少,否则会造成误会
|
|
799
|
+
var percentage = Number((this.fileObj.finishNumber / needObj.chunkNumber * 100).toFixed(2));
|
|
800
|
+
if (typeof this.onUploadProgress === "function") {
|
|
801
|
+
this.onUploadProgress({
|
|
802
|
+
percentage: percentage
|
|
803
|
+
});
|
|
804
|
+
return false;
|
|
805
|
+
}
|
|
806
|
+
this.fileObj.percentage = percentage;
|
|
807
|
+
}
|
|
808
|
+
function _uploadSignleFile2() {
|
|
809
|
+
var _this$fileObj$whileRe,
|
|
810
|
+
_this3 = this;
|
|
811
|
+
// 如果没有需要上传的切片 / 正在上传的切片还没传完,就不做处理
|
|
812
|
+
if (this.fileObj.allChunkList.length === 0 || this.fileObj.whileRequests.length > 0) {
|
|
813
|
+
return false;
|
|
814
|
+
}
|
|
815
|
+
// 找到文件处于处理中/上传中的 文件列表(是文件而不是切片)
|
|
816
|
+
var isTaskArrIng = this.uploadFileList.filter(function (itemB) {
|
|
817
|
+
return itemB.state === 10 || itemB.state === 100;
|
|
818
|
+
});
|
|
819
|
+
|
|
820
|
+
// 实时动态获取并发请求数,每次调请求前都获取一次最大并发数
|
|
821
|
+
// 浏览器同域名同一时间请求的最大并发数限制为6
|
|
822
|
+
// 例如如果有3个文件同时上传/处理中,则每个文件切片接口最多调 6 / 3 == 2个相同的接口
|
|
823
|
+
this.maxRequest = Math.ceil(this.batchMaxCount / isTaskArrIng.length);
|
|
824
|
+
|
|
825
|
+
// 从数组的末尾开始提取 maxRequest 个元素。
|
|
826
|
+
var whileRequest = this.fileObj.allChunkList.slice(-this.maxRequest);
|
|
827
|
+
|
|
828
|
+
// 设置正在请求中的个数
|
|
829
|
+
(_this$fileObj$whileRe = this.fileObj.whileRequests).push.apply(_this$fileObj$whileRe, whileRequest);
|
|
830
|
+
// 如果总请求数大于并发数
|
|
831
|
+
if (this.fileObj.allChunkList.length > this.maxRequest) {
|
|
832
|
+
// 则减去并发数
|
|
833
|
+
this.fileObj.allChunkList.splice(-this.maxRequest);
|
|
834
|
+
} else {
|
|
835
|
+
// 否则总请求数置空,说明已经把没请求的全部放进请求列表了,不需要做过多请求
|
|
836
|
+
this.fileObj.allChunkList = [];
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
// 单个分片请求
|
|
840
|
+
var uploadChunk = /*#__PURE__*/function () {
|
|
841
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(needObj) {
|
|
842
|
+
var fd, fileHash, fileSize, fileName, index, chunkFile, chunkHash, chunkSize, chunkNumber;
|
|
843
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
844
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
845
|
+
case 0:
|
|
846
|
+
fd = new FormData();
|
|
847
|
+
fileHash = needObj.fileHash, fileSize = needObj.fileSize, fileName = needObj.fileName, index = needObj.index, chunkFile = needObj.chunkFile, chunkHash = needObj.chunkHash, chunkSize = needObj.chunkSize, chunkNumber = needObj.chunkNumber;
|
|
848
|
+
fd.append("fileHash", fileHash);
|
|
849
|
+
fd.append("fileSize", String(fileSize));
|
|
850
|
+
fd.append("fileName", fileName);
|
|
851
|
+
fd.append("index", String(index));
|
|
852
|
+
fd.append("chunkFile", chunkFile);
|
|
853
|
+
fd.append("chunkHash", chunkHash);
|
|
854
|
+
fd.append("chunkSize", String(chunkSize));
|
|
855
|
+
fd.append("chunkNumber", String(chunkNumber));
|
|
856
|
+
fd.append("fileMd5", fileHash);
|
|
857
|
+
fd.append("chunkIndex", String(index));
|
|
858
|
+
_context3.prev = 12;
|
|
859
|
+
_context3.next = 15;
|
|
860
|
+
return Object(_remote_js__WEBPACK_IMPORTED_MODULE_0__[/* uploadFile */ "c"])(fd, {
|
|
861
|
+
onCancel: function onCancel(onCancelFunc) {
|
|
862
|
+
// 在调用接口的同时,相当于同时调用了传入的这个函数,又能同时拿到返回的取消方法去赋值
|
|
863
|
+
needObj.cancel = onCancelFunc;
|
|
864
|
+
},
|
|
865
|
+
service: _this3.request
|
|
866
|
+
});
|
|
867
|
+
case 15:
|
|
868
|
+
if (!(_this3.fileObj.state === 30 || _this3.fileObj.state === 50)) {
|
|
869
|
+
_context3.next = 17;
|
|
870
|
+
break;
|
|
871
|
+
}
|
|
872
|
+
return _context3.abrupt("return", false);
|
|
873
|
+
case 17:
|
|
874
|
+
// 单个文件上传失败次数大于0则要减少一个
|
|
875
|
+
_this3.fileObj.errNumber > 0 ? _this3.fileObj.errNumber-- : 0;
|
|
876
|
+
// 单个文件切片上传成功数+1
|
|
877
|
+
_this3.fileObj.finishNumber++;
|
|
878
|
+
// 单个切片上传完成
|
|
879
|
+
needObj.finish = true;
|
|
880
|
+
_classPrivateFieldLooseBase(_this3, _signleFileProgress)[_signleFileProgress](needObj); // 更新进度条
|
|
881
|
+
// 上传成功了就删掉请求中数组中的那一片请求
|
|
882
|
+
_this3.fileObj.whileRequests = _this3.fileObj.whileRequests.filter(function (item) {
|
|
883
|
+
return item.chunkFile !== needObj.chunkFile;
|
|
884
|
+
});
|
|
885
|
+
// 如果单个文件最终成功数等于切片个数
|
|
886
|
+
if (_this3.fileObj.finishNumber === chunkNumber) {
|
|
887
|
+
// 全部上传完切片后就开始合并切片
|
|
888
|
+
_classPrivateFieldLooseBase(_this3, _handleMerge)[_handleMerge]();
|
|
889
|
+
} else {
|
|
890
|
+
// 如果还没完全上传完,则继续上传
|
|
891
|
+
_classPrivateFieldLooseBase(_this3, _uploadSignleFile)[_uploadSignleFile]();
|
|
892
|
+
}
|
|
893
|
+
_context3.next = 30;
|
|
894
|
+
break;
|
|
895
|
+
case 25:
|
|
896
|
+
_context3.prev = 25;
|
|
897
|
+
_context3.t0 = _context3["catch"](12);
|
|
898
|
+
// 请求异常,或者请求成功服务端返回报错都按单片上传失败逻辑处理,.then.catch的.catch是只能捕捉请求异常的
|
|
899
|
+
_this3.fileObj.errNumber++;
|
|
900
|
+
// 超过3次之后直接上传中断
|
|
901
|
+
if (_this3.fileObj.errNumber > 3) {
|
|
902
|
+
console.log("切片上传失败超过三次了");
|
|
903
|
+
_this3.pauseUpload(false, _context3.t0); // 上传中断
|
|
904
|
+
} else {
|
|
905
|
+
console.log("切片上传失败还没超过3次");
|
|
906
|
+
uploadChunk(needObj); // 失败了一片,继续当前分片请求
|
|
907
|
+
}
|
|
908
|
+
return _context3.abrupt("return", false);
|
|
909
|
+
case 30:
|
|
910
|
+
case "end":
|
|
911
|
+
return _context3.stop();
|
|
912
|
+
}
|
|
913
|
+
}, _callee3, null, [[12, 25]]);
|
|
914
|
+
}));
|
|
915
|
+
return function uploadChunk(_x) {
|
|
916
|
+
return _ref.apply(this, arguments);
|
|
917
|
+
};
|
|
918
|
+
}();
|
|
919
|
+
// 开始单个上传
|
|
920
|
+
for (var _iterator2 = _createForOfIteratorHelperLoose(whileRequest), _step2; !(_step2 = _iterator2()).done;) {
|
|
921
|
+
var item = _step2.value;
|
|
922
|
+
uploadChunk(item);
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(70)))
|
|
927
|
+
|
|
928
|
+
/***/ }),
|
|
929
|
+
/* 52 */
|
|
930
|
+
/***/ (function(module, exports) {
|
|
931
|
+
|
|
932
|
+
module.exports = require("js-md5");
|
|
933
|
+
|
|
934
|
+
/***/ }),
|
|
935
|
+
/* 53 */
|
|
338
936
|
/***/ (function(module, exports) {
|
|
339
937
|
|
|
340
938
|
module.exports = require("element-ui/lib/switch");
|
|
341
939
|
|
|
342
940
|
/***/ }),
|
|
343
|
-
/*
|
|
941
|
+
/* 54 */
|
|
344
942
|
/***/ (function(module, exports) {
|
|
345
943
|
|
|
346
944
|
module.exports = require("element-ui/lib/slider");
|
|
347
945
|
|
|
348
946
|
/***/ }),
|
|
349
|
-
/*
|
|
947
|
+
/* 55 */
|
|
350
948
|
/***/ (function(module, exports) {
|
|
351
949
|
|
|
352
950
|
module.exports = require("element-ui/lib/transfer");
|
|
353
951
|
|
|
354
952
|
/***/ }),
|
|
355
|
-
/*
|
|
953
|
+
/* 56 */
|
|
356
954
|
/***/ (function(module, exports) {
|
|
357
955
|
|
|
358
956
|
module.exports = require("element-ui/lib/time-picker");
|
|
359
957
|
|
|
360
958
|
/***/ }),
|
|
361
|
-
/*
|
|
959
|
+
/* 57 */
|
|
362
960
|
/***/ (function(module, exports) {
|
|
363
961
|
|
|
364
962
|
module.exports = require("element-ui/lib/upload");
|
|
365
963
|
|
|
366
964
|
/***/ }),
|
|
367
|
-
/* 55 */,
|
|
368
|
-
/* 56 */,
|
|
369
|
-
/* 57 */,
|
|
370
965
|
/* 58 */,
|
|
371
966
|
/* 59 */,
|
|
372
967
|
/* 60 */,
|
|
@@ -379,8 +974,17 @@ module.exports = require("element-ui/lib/upload");
|
|
|
379
974
|
/* 67 */,
|
|
380
975
|
/* 68 */,
|
|
381
976
|
/* 69 */,
|
|
382
|
-
/* 70
|
|
383
|
-
|
|
977
|
+
/* 70 */
|
|
978
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
979
|
+
|
|
980
|
+
module.exports = __webpack_require__.p + "0.worker.js"
|
|
981
|
+
|
|
982
|
+
/***/ }),
|
|
983
|
+
/* 71 */,
|
|
984
|
+
/* 72 */,
|
|
985
|
+
/* 73 */,
|
|
986
|
+
/* 74 */,
|
|
987
|
+
/* 75 */
|
|
384
988
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
385
989
|
|
|
386
990
|
"use strict";
|
|
@@ -555,7 +1159,7 @@ InputNumbervue_type_template_id_6c463d52_render._withStripped = true
|
|
|
555
1159
|
// CONCATENATED MODULE: ./src/components/form/src/item/InputNumber.vue?vue&type=template&id=6c463d52
|
|
556
1160
|
|
|
557
1161
|
// EXTERNAL MODULE: external "element-ui/lib/input-number"
|
|
558
|
-
var input_number_ = __webpack_require__(
|
|
1162
|
+
var input_number_ = __webpack_require__(40);
|
|
559
1163
|
var input_number_default = /*#__PURE__*/__webpack_require__.n(input_number_);
|
|
560
1164
|
|
|
561
1165
|
// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@8.3.0_@babel+core@7.23.9_webpack@4.47.0/node_modules/babel-loader/lib!./node_modules/.pnpm/vue-loader@15.11.1_css-loader@2.1.1_lodash@4.17.21_vue-template-compiler@2.7.16_webpack@4.47.0/node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/item/InputNumber.vue?vue&type=script&lang=js
|
|
@@ -598,15 +1202,15 @@ var InputNumber_component = Object(componentNormalizer["a" /* default */])(
|
|
|
598
1202
|
|
|
599
1203
|
/* harmony default export */ var InputNumber = (InputNumber_component.exports);
|
|
600
1204
|
// EXTERNAL MODULE: external "element-ui/lib/select"
|
|
601
|
-
var select_ = __webpack_require__(
|
|
1205
|
+
var select_ = __webpack_require__(41);
|
|
602
1206
|
var select_default = /*#__PURE__*/__webpack_require__.n(select_);
|
|
603
1207
|
|
|
604
1208
|
// EXTERNAL MODULE: external "element-ui/lib/option"
|
|
605
|
-
var option_ = __webpack_require__(
|
|
1209
|
+
var option_ = __webpack_require__(42);
|
|
606
1210
|
var option_default = /*#__PURE__*/__webpack_require__.n(option_);
|
|
607
1211
|
|
|
608
1212
|
// EXTERNAL MODULE: external "element-ui/lib/option-group"
|
|
609
|
-
var option_group_ = __webpack_require__(
|
|
1213
|
+
var option_group_ = __webpack_require__(43);
|
|
610
1214
|
var option_group_default = /*#__PURE__*/__webpack_require__.n(option_group_);
|
|
611
1215
|
|
|
612
1216
|
// CONCATENATED MODULE: ./node_modules/.pnpm/vue-loader@15.11.1_css-loader@2.1.1_lodash@4.17.21_vue-template-compiler@2.7.16_webpack@4.47.0/node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/.pnpm/vue-loader@15.11.1_css-loader@2.1.1_lodash@4.17.21_vue-template-compiler@2.7.16_webpack@4.47.0/node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/item/SelectTree.vue?vue&type=template&id=0f44d547
|
|
@@ -702,7 +1306,7 @@ SelectTreevue_type_template_id_0f44d547_render._withStripped = true
|
|
|
702
1306
|
// CONCATENATED MODULE: ./src/components/form/src/item/SelectTree.vue?vue&type=template&id=0f44d547
|
|
703
1307
|
|
|
704
1308
|
// EXTERNAL MODULE: external "@panpanzhao/component-ui/lib/components/tree-line"
|
|
705
|
-
var tree_line_ = __webpack_require__(
|
|
1309
|
+
var tree_line_ = __webpack_require__(44);
|
|
706
1310
|
var tree_line_default = /*#__PURE__*/__webpack_require__.n(tree_line_);
|
|
707
1311
|
|
|
708
1312
|
// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@8.3.0_@babel+core@7.23.9_webpack@4.47.0/node_modules/babel-loader/lib!./node_modules/.pnpm/vue-loader@15.11.1_css-loader@2.1.1_lodash@4.17.21_vue-template-compiler@2.7.16_webpack@4.47.0/node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/item/SelectTree.vue?vue&type=script&lang=js
|
|
@@ -1243,7 +1847,7 @@ var Select_component = Object(componentNormalizer["a" /* default */])(
|
|
|
1243
1847
|
|
|
1244
1848
|
/* harmony default export */ var Select = (Select_component.exports);
|
|
1245
1849
|
// EXTERNAL MODULE: external "element-ui/lib/radio-group"
|
|
1246
|
-
var radio_group_ = __webpack_require__(
|
|
1850
|
+
var radio_group_ = __webpack_require__(45);
|
|
1247
1851
|
var radio_group_default = /*#__PURE__*/__webpack_require__.n(radio_group_);
|
|
1248
1852
|
|
|
1249
1853
|
// EXTERNAL MODULE: external "element-ui/lib/radio"
|
|
@@ -1251,7 +1855,7 @@ var radio_ = __webpack_require__(31);
|
|
|
1251
1855
|
var radio_default = /*#__PURE__*/__webpack_require__.n(radio_);
|
|
1252
1856
|
|
|
1253
1857
|
// EXTERNAL MODULE: external "element-ui/lib/radio-button"
|
|
1254
|
-
var radio_button_ = __webpack_require__(
|
|
1858
|
+
var radio_button_ = __webpack_require__(46);
|
|
1255
1859
|
var radio_button_default = /*#__PURE__*/__webpack_require__.n(radio_button_);
|
|
1256
1860
|
|
|
1257
1861
|
// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@8.3.0_@babel+core@7.23.9_webpack@4.47.0/node_modules/babel-loader/lib!./node_modules/.pnpm/vue-loader@15.11.1_css-loader@2.1.1_lodash@4.17.21_vue-template-compiler@2.7.16_webpack@4.47.0/node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/item/Radio.vue?vue&type=script&lang=js
|
|
@@ -1446,15 +2050,15 @@ var Radio_component = Object(componentNormalizer["a" /* default */])(
|
|
|
1446
2050
|
|
|
1447
2051
|
/* harmony default export */ var Radio = (Radio_component.exports);
|
|
1448
2052
|
// EXTERNAL MODULE: external "element-ui/lib/checkbox-group"
|
|
1449
|
-
var checkbox_group_ = __webpack_require__(
|
|
2053
|
+
var checkbox_group_ = __webpack_require__(47);
|
|
1450
2054
|
var checkbox_group_default = /*#__PURE__*/__webpack_require__.n(checkbox_group_);
|
|
1451
2055
|
|
|
1452
2056
|
// EXTERNAL MODULE: external "element-ui/lib/checkbox"
|
|
1453
|
-
var checkbox_ = __webpack_require__(
|
|
2057
|
+
var checkbox_ = __webpack_require__(48);
|
|
1454
2058
|
var checkbox_default = /*#__PURE__*/__webpack_require__.n(checkbox_);
|
|
1455
2059
|
|
|
1456
2060
|
// EXTERNAL MODULE: external "element-ui/lib/checkbox-button"
|
|
1457
|
-
var checkbox_button_ = __webpack_require__(
|
|
2061
|
+
var checkbox_button_ = __webpack_require__(49);
|
|
1458
2062
|
var checkbox_button_default = /*#__PURE__*/__webpack_require__.n(checkbox_button_);
|
|
1459
2063
|
|
|
1460
2064
|
// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@8.3.0_@babel+core@7.23.9_webpack@4.47.0/node_modules/babel-loader/lib!./node_modules/.pnpm/vue-loader@15.11.1_css-loader@2.1.1_lodash@4.17.21_vue-template-compiler@2.7.16_webpack@4.47.0/node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/item/Checkbox.vue?vue&type=script&lang=js
|
|
@@ -2169,7 +2773,7 @@ var CascaderAddr_component = Object(componentNormalizer["a" /* default */])(
|
|
|
2169
2773
|
|
|
2170
2774
|
/* harmony default export */ var CascaderAddr = (CascaderAddr_component.exports);
|
|
2171
2775
|
// EXTERNAL MODULE: external "element-ui/lib/date-picker"
|
|
2172
|
-
var date_picker_ = __webpack_require__(
|
|
2776
|
+
var date_picker_ = __webpack_require__(50);
|
|
2173
2777
|
var date_picker_default = /*#__PURE__*/__webpack_require__.n(date_picker_);
|
|
2174
2778
|
|
|
2175
2779
|
// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@8.3.0_@babel+core@7.23.9_webpack@4.47.0/node_modules/babel-loader/lib!./node_modules/.pnpm/vue-loader@15.11.1_css-loader@2.1.1_lodash@4.17.21_vue-template-compiler@2.7.16_webpack@4.47.0/node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/item/DatePicker.vue?vue&type=script&lang=js
|
|
@@ -2271,13 +2875,16 @@ var DatePicker_component = Object(componentNormalizer["a" /* default */])(
|
|
|
2271
2875
|
)
|
|
2272
2876
|
|
|
2273
2877
|
/* harmony default export */ var DatePicker = (DatePicker_component.exports);
|
|
2274
|
-
// CONCATENATED MODULE: ./node_modules/.pnpm/vue-loader@15.11.1_css-loader@2.1.1_lodash@4.17.21_vue-template-compiler@2.7.16_webpack@4.47.0/node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/.pnpm/vue-loader@15.11.1_css-loader@2.1.1_lodash@4.17.21_vue-template-compiler@2.7.16_webpack@4.47.0/node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/item/
|
|
2275
|
-
var
|
|
2878
|
+
// CONCATENATED MODULE: ./node_modules/.pnpm/vue-loader@15.11.1_css-loader@2.1.1_lodash@4.17.21_vue-template-compiler@2.7.16_webpack@4.47.0/node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/.pnpm/vue-loader@15.11.1_css-loader@2.1.1_lodash@4.17.21_vue-template-compiler@2.7.16_webpack@4.47.0/node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/item/upload-process/index.vue?vue&type=template&id=b7318202
|
|
2879
|
+
var upload_processvue_type_template_id_b7318202_render = function render() {
|
|
2276
2880
|
var _vm = this,
|
|
2277
2881
|
_c = _vm._self._c
|
|
2278
2882
|
return _c(
|
|
2279
2883
|
"div",
|
|
2280
|
-
{
|
|
2884
|
+
{
|
|
2885
|
+
staticClass: "upload-process",
|
|
2886
|
+
class: { "upload-process__readonly": _vm.isReadonly },
|
|
2887
|
+
},
|
|
2281
2888
|
[
|
|
2282
2889
|
_c(
|
|
2283
2890
|
"el-upload",
|
|
@@ -2290,15 +2897,17 @@ var UploadProcessvue_type_template_id_f0c82e34_render = function render() {
|
|
|
2290
2897
|
false
|
|
2291
2898
|
),
|
|
2292
2899
|
[
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2900
|
+
!_vm.isReadonly
|
|
2901
|
+
? _c(
|
|
2902
|
+
"el-button",
|
|
2903
|
+
{
|
|
2904
|
+
attrs: { slot: "trigger", size: "small", type: "primary" },
|
|
2905
|
+
slot: "trigger",
|
|
2906
|
+
},
|
|
2907
|
+
[_vm._v("选取文件")]
|
|
2908
|
+
)
|
|
2909
|
+
: _c("div", { attrs: { slot: "trigger" }, slot: "trigger" }),
|
|
2910
|
+
!_vm.isReadonly && !_vm.autoUpload && _vm.uploadButton
|
|
2302
2911
|
? _c(
|
|
2303
2912
|
"span",
|
|
2304
2913
|
{ staticStyle: { "padding-left": "10px" } },
|
|
@@ -2316,7 +2925,7 @@ var UploadProcessvue_type_template_id_f0c82e34_render = function render() {
|
|
|
2316
2925
|
1
|
|
2317
2926
|
)
|
|
2318
2927
|
: _vm._e(),
|
|
2319
|
-
_vm.uploadDesc && _vm.fileList.length > 0
|
|
2928
|
+
!_vm.isReadonly && _vm.uploadDesc && _vm.fileList.length > 0
|
|
2320
2929
|
? _c("div", { staticClass: "el-upload__tip" }, [
|
|
2321
2930
|
_c("div", { staticClass: "file-desc" }, [
|
|
2322
2931
|
_c("span", [
|
|
@@ -2365,10 +2974,7 @@ var UploadProcessvue_type_template_id_f0c82e34_render = function render() {
|
|
|
2365
2974
|
_vm._l(_vm.fileList, function (file, index) {
|
|
2366
2975
|
return _c(
|
|
2367
2976
|
"li",
|
|
2368
|
-
{
|
|
2369
|
-
key: file.uid || index,
|
|
2370
|
-
staticClass: "file-list__item is-success",
|
|
2371
|
-
},
|
|
2977
|
+
{ key: index, staticClass: "file-list__item is-success" },
|
|
2372
2978
|
[
|
|
2373
2979
|
_c("div", { staticClass: "file-list__item-name" }, [
|
|
2374
2980
|
_c("i", { staticClass: "el-icon-document" }),
|
|
@@ -2397,7 +3003,7 @@ var UploadProcessvue_type_template_id_f0c82e34_render = function render() {
|
|
|
2397
3003
|
staticClass: "el-icon-success",
|
|
2398
3004
|
staticStyle: { color: "#67c23a" },
|
|
2399
3005
|
})
|
|
2400
|
-
: file.state === 500
|
|
3006
|
+
: file.state === 500 || file.state === 50
|
|
2401
3007
|
? _c("i", {
|
|
2402
3008
|
staticClass: "el-icon-warning",
|
|
2403
3009
|
staticStyle: { color: "#f56c6c !important" },
|
|
@@ -2425,6 +3031,23 @@ var UploadProcessvue_type_template_id_f0c82e34_render = function render() {
|
|
|
2425
3031
|
},
|
|
2426
3032
|
})
|
|
2427
3033
|
: _vm._e(),
|
|
3034
|
+
file.state === 200
|
|
3035
|
+
? _c("el-button", {
|
|
3036
|
+
attrs: {
|
|
3037
|
+
type: "primary",
|
|
3038
|
+
circle: "",
|
|
3039
|
+
icon: "el-icon-download",
|
|
3040
|
+
size: "mini",
|
|
3041
|
+
title: "下载",
|
|
3042
|
+
},
|
|
3043
|
+
on: {
|
|
3044
|
+
click: function ($event) {
|
|
3045
|
+
$event.stopPropagation()
|
|
3046
|
+
return _vm.handDownLoad(file)
|
|
3047
|
+
},
|
|
3048
|
+
},
|
|
3049
|
+
})
|
|
3050
|
+
: _vm._e(),
|
|
2428
3051
|
file.state === 500
|
|
2429
3052
|
? _c("el-button", {
|
|
2430
3053
|
attrs: {
|
|
@@ -2442,7 +3065,24 @@ var UploadProcessvue_type_template_id_f0c82e34_render = function render() {
|
|
|
2442
3065
|
},
|
|
2443
3066
|
})
|
|
2444
3067
|
: _vm._e(),
|
|
2445
|
-
file.state ===
|
|
3068
|
+
file.state === 50
|
|
3069
|
+
? _c("el-button", {
|
|
3070
|
+
attrs: {
|
|
3071
|
+
type: "primary",
|
|
3072
|
+
circle: "",
|
|
3073
|
+
icon: "el-icon-upload",
|
|
3074
|
+
size: "mini",
|
|
3075
|
+
title: "继续上传",
|
|
3076
|
+
},
|
|
3077
|
+
on: {
|
|
3078
|
+
click: function ($event) {
|
|
3079
|
+
$event.stopPropagation()
|
|
3080
|
+
return _vm.handResumeUpload(file)
|
|
3081
|
+
},
|
|
3082
|
+
},
|
|
3083
|
+
})
|
|
3084
|
+
: _vm._e(),
|
|
3085
|
+
file.state === 500 || file.state === 50
|
|
2446
3086
|
? _c("el-button", {
|
|
2447
3087
|
attrs: {
|
|
2448
3088
|
type: "warning",
|
|
@@ -2459,20 +3099,22 @@ var UploadProcessvue_type_template_id_f0c82e34_render = function render() {
|
|
|
2459
3099
|
},
|
|
2460
3100
|
})
|
|
2461
3101
|
: _vm._e(),
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
3102
|
+
!_vm.isReadonly
|
|
3103
|
+
? _c("el-button", {
|
|
3104
|
+
attrs: {
|
|
3105
|
+
type: "danger",
|
|
3106
|
+
circle: "",
|
|
3107
|
+
icon: "el-icon-delete",
|
|
3108
|
+
title: "删除",
|
|
3109
|
+
},
|
|
3110
|
+
on: {
|
|
3111
|
+
click: function ($event) {
|
|
3112
|
+
$event.stopPropagation()
|
|
3113
|
+
return _vm.handDelete(file, index)
|
|
3114
|
+
},
|
|
3115
|
+
},
|
|
3116
|
+
})
|
|
3117
|
+
: _vm._e(),
|
|
2476
3118
|
],
|
|
2477
3119
|
1
|
|
2478
3120
|
),
|
|
@@ -2487,10 +3129,7 @@ var UploadProcessvue_type_template_id_f0c82e34_render = function render() {
|
|
|
2487
3129
|
_vm._l(_vm.pendingFileList, function (file, index) {
|
|
2488
3130
|
return _c(
|
|
2489
3131
|
"li",
|
|
2490
|
-
{
|
|
2491
|
-
key: file.uid || index,
|
|
2492
|
-
staticClass: "file-list__item is-success",
|
|
2493
|
-
},
|
|
3132
|
+
{ key: index, staticClass: "file-list__item is-success" },
|
|
2494
3133
|
[
|
|
2495
3134
|
_c("div", { staticClass: "file-list__item-name" }, [
|
|
2496
3135
|
_c("i", { staticClass: "el-icon-document" }),
|
|
@@ -2537,11 +3176,11 @@ var UploadProcessvue_type_template_id_f0c82e34_render = function render() {
|
|
|
2537
3176
|
1
|
|
2538
3177
|
)
|
|
2539
3178
|
}
|
|
2540
|
-
var
|
|
2541
|
-
|
|
3179
|
+
var upload_processvue_type_template_id_b7318202_staticRenderFns = []
|
|
3180
|
+
upload_processvue_type_template_id_b7318202_render._withStripped = true
|
|
2542
3181
|
|
|
2543
3182
|
|
|
2544
|
-
// CONCATENATED MODULE: ./src/components/form/src/item/
|
|
3183
|
+
// CONCATENATED MODULE: ./src/components/form/src/item/upload-process/index.vue?vue&type=template&id=b7318202
|
|
2545
3184
|
|
|
2546
3185
|
// EXTERNAL MODULE: external "element-ui/lib/message"
|
|
2547
3186
|
var message_ = __webpack_require__(12);
|
|
@@ -2551,10 +3190,14 @@ var message_default = /*#__PURE__*/__webpack_require__.n(message_);
|
|
|
2551
3190
|
var message_box_ = __webpack_require__(26);
|
|
2552
3191
|
var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
2553
3192
|
|
|
2554
|
-
//
|
|
3193
|
+
// EXTERNAL MODULE: ./src/components/form/src/item/upload-process/large-upload/index.js
|
|
3194
|
+
var large_upload = __webpack_require__(51);
|
|
3195
|
+
|
|
3196
|
+
// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@8.3.0_@babel+core@7.23.9_webpack@4.47.0/node_modules/babel-loader/lib!./node_modules/.pnpm/vue-loader@15.11.1_css-loader@2.1.1_lodash@4.17.21_vue-template-compiler@2.7.16_webpack@4.47.0/node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/item/upload-process/index.vue?vue&type=script&lang=js
|
|
2555
3197
|
|
|
2556
3198
|
|
|
2557
|
-
|
|
3199
|
+
|
|
3200
|
+
/* harmony default export */ var upload_processvue_type_script_lang_js = ({
|
|
2558
3201
|
name: "UploadProcess",
|
|
2559
3202
|
components: {},
|
|
2560
3203
|
props: {
|
|
@@ -2597,10 +3240,30 @@ var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
|
2597
3240
|
type: Number,
|
|
2598
3241
|
default: 0
|
|
2599
3242
|
},
|
|
3243
|
+
limit: {
|
|
3244
|
+
type: Number,
|
|
3245
|
+
default: null
|
|
3246
|
+
},
|
|
3247
|
+
useLarge: {
|
|
3248
|
+
type: Boolean,
|
|
3249
|
+
default: false
|
|
3250
|
+
},
|
|
3251
|
+
largeSize: {
|
|
3252
|
+
type: Number,
|
|
3253
|
+
default: 1 * 1024 * 1024
|
|
3254
|
+
},
|
|
3255
|
+
largeChunkSize: {
|
|
3256
|
+
type: Number,
|
|
3257
|
+
default: 1 * 1024 * 1024
|
|
3258
|
+
},
|
|
3259
|
+
busiType: {
|
|
3260
|
+
type: String,
|
|
3261
|
+
default: ""
|
|
3262
|
+
},
|
|
2600
3263
|
// 批量上传最大数 0表示不批量上传
|
|
2601
3264
|
batchMaxCount: {
|
|
2602
3265
|
type: Number,
|
|
2603
|
-
default:
|
|
3266
|
+
default: 6
|
|
2604
3267
|
},
|
|
2605
3268
|
//是否自动上传
|
|
2606
3269
|
autoUpload: {
|
|
@@ -2625,16 +3288,16 @@ var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
|
2625
3288
|
rules: {
|
|
2626
3289
|
type: Array
|
|
2627
3290
|
},
|
|
3291
|
+
readonly: {
|
|
3292
|
+
type: [Function, Boolean],
|
|
3293
|
+
default: false
|
|
3294
|
+
},
|
|
2628
3295
|
isPreview: Function,
|
|
2629
3296
|
isDelete: Function
|
|
2630
3297
|
},
|
|
2631
3298
|
watch: {
|
|
2632
3299
|
value: function value(val) {
|
|
2633
|
-
|
|
2634
|
-
if (val && val[0] === null) {
|
|
2635
|
-
this.fileValue = [];
|
|
2636
|
-
this.$emit("input", this.fileValue);
|
|
2637
|
-
}
|
|
3300
|
+
this.setValue(val);
|
|
2638
3301
|
}
|
|
2639
3302
|
},
|
|
2640
3303
|
computed: {
|
|
@@ -2643,6 +3306,7 @@ var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
|
2643
3306
|
action: this.api.url,
|
|
2644
3307
|
headers: this.api.headers,
|
|
2645
3308
|
data: this.api.data,
|
|
3309
|
+
limit: this.limit,
|
|
2646
3310
|
multiple: true,
|
|
2647
3311
|
accept: ".doc,.docx,.ppt,.pptx,.xls,.xlsx,.pot,.pps,.vsd,.rtf,.wps,.et,.dps,.pdf,.txt,.jpg,.png,.jpeg,.jif,.zip,.rar,.gif,.mp4"
|
|
2648
3312
|
}, this.$attrs, {
|
|
@@ -2670,13 +3334,13 @@ var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
|
2670
3334
|
// 上传中
|
|
2671
3335
|
uploadingFiles: function uploadingFiles() {
|
|
2672
3336
|
return this.fileList && this.fileList.filter(function (item) {
|
|
2673
|
-
return item.state === 100;
|
|
3337
|
+
return item.state === 100 || item.state === 10 || item.state === 30;
|
|
2674
3338
|
});
|
|
2675
3339
|
},
|
|
2676
3340
|
// 上传处理完成(成功加失败)
|
|
2677
3341
|
finishFiles: function finishFiles() {
|
|
2678
3342
|
return this.fileList && this.fileList.filter(function (item) {
|
|
2679
|
-
return item.state === 200 || item.state === 500;
|
|
3343
|
+
return item.state === 200 || item.state === 500 || item.state === 50;
|
|
2680
3344
|
});
|
|
2681
3345
|
},
|
|
2682
3346
|
// 上传成功
|
|
@@ -2688,36 +3352,43 @@ var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
|
2688
3352
|
// 上传失败
|
|
2689
3353
|
errorFiles: function errorFiles() {
|
|
2690
3354
|
return this.fileList && this.fileList.filter(function (item) {
|
|
2691
|
-
return item.state === 500;
|
|
3355
|
+
return item.state === 500 || item.state === 50;
|
|
2692
3356
|
});
|
|
3357
|
+
},
|
|
3358
|
+
isReadonly: function isReadonly() {
|
|
3359
|
+
if (typeof this.readonly === "function") {
|
|
3360
|
+
return this.readonly.call(this);
|
|
3361
|
+
}
|
|
3362
|
+
return this.readonly;
|
|
2693
3363
|
}
|
|
2694
3364
|
},
|
|
2695
3365
|
data: function data() {
|
|
2696
3366
|
return {
|
|
2697
|
-
/**
|
|
2698
|
-
* {
|
|
2699
|
-
* id: 唯一编码
|
|
2700
|
-
* name: 文件名称
|
|
2701
|
-
* state: 0待上传 100上传中 200上传成功 500上传失败
|
|
2702
|
-
*
|
|
2703
|
-
*
|
|
2704
|
-
*
|
|
2705
|
-
*
|
|
2706
|
-
*
|
|
2707
|
-
*
|
|
2708
|
-
*
|
|
2709
|
-
*
|
|
3367
|
+
/**
|
|
3368
|
+
* {
|
|
3369
|
+
* id: 唯一编码
|
|
3370
|
+
* name: 文件名称
|
|
3371
|
+
* state: 0待上传 100上传中 200上传成功 500上传失败
|
|
3372
|
+
* 大文件特有状态 10文件处理中,30是暂停,50上传中断
|
|
3373
|
+
* percentage: 上传进度 数字 100表示100%
|
|
3374
|
+
* errorMsg: 错误信息
|
|
3375
|
+
* size: 文件大小
|
|
3376
|
+
* file: 源文件 name percentage raw size status uid
|
|
3377
|
+
* ...
|
|
3378
|
+
* fileId: 数据库id
|
|
3379
|
+
* fileUrl: 文件地址 上传成功后地址
|
|
3380
|
+
* }
|
|
2710
3381
|
*/
|
|
2711
3382
|
fileList: [],
|
|
2712
3383
|
//已处理
|
|
2713
3384
|
pendingFileList: [],
|
|
2714
3385
|
//待处理
|
|
2715
|
-
/**
|
|
2716
|
-
* {
|
|
2717
|
-
* id: 文件id
|
|
2718
|
-
* name: 文件名称
|
|
2719
|
-
* url: 文件地址
|
|
2720
|
-
* }
|
|
3386
|
+
/**
|
|
3387
|
+
* {
|
|
3388
|
+
* id: 文件id
|
|
3389
|
+
* name: 文件名称
|
|
3390
|
+
* url: 文件地址
|
|
3391
|
+
* }
|
|
2721
3392
|
*/
|
|
2722
3393
|
fileValue: []
|
|
2723
3394
|
};
|
|
@@ -2727,16 +3398,39 @@ var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
|
2727
3398
|
// eslint-disable-next-line vue/no-mutating-props
|
|
2728
3399
|
this.extend.that = this;
|
|
2729
3400
|
}
|
|
2730
|
-
|
|
2731
|
-
var _this$fileList;
|
|
2732
|
-
(_this$fileList = this.fileList).push.apply(_this$fileList, this.value.map(function (item) {
|
|
2733
|
-
item.state = 200;
|
|
2734
|
-
item.name = item.fileName;
|
|
2735
|
-
return item;
|
|
2736
|
-
}));
|
|
2737
|
-
}
|
|
3401
|
+
this.setValue(this.value);
|
|
2738
3402
|
},
|
|
2739
3403
|
methods: {
|
|
3404
|
+
setValue: function setValue(val) {
|
|
3405
|
+
if (!val) {
|
|
3406
|
+
return false;
|
|
3407
|
+
}
|
|
3408
|
+
// 解决重置第一个元素为null
|
|
3409
|
+
if (val && val[0] === null) {
|
|
3410
|
+
this.fileValue = [];
|
|
3411
|
+
this.fileList = [];
|
|
3412
|
+
this.$emit("input", this.fileValue);
|
|
3413
|
+
}
|
|
3414
|
+
if (val === this.fileValue) {
|
|
3415
|
+
return false;
|
|
3416
|
+
}
|
|
3417
|
+
this.fileValue = [];
|
|
3418
|
+
this.fileList = [];
|
|
3419
|
+
if (val && val.length) {
|
|
3420
|
+
var _this$value, _this$fileValue, _this$fileList;
|
|
3421
|
+
var valList = (_this$value = this.value) == null ? void 0 : _this$value.map(function (item) {
|
|
3422
|
+
if (!item) {
|
|
3423
|
+
return item;
|
|
3424
|
+
}
|
|
3425
|
+
item.state = 200;
|
|
3426
|
+
item.percentage = 100; // 进度条
|
|
3427
|
+
item.name = item.fileName;
|
|
3428
|
+
return item;
|
|
3429
|
+
});
|
|
3430
|
+
(_this$fileValue = this.fileValue).push.apply(_this$fileValue, valList);
|
|
3431
|
+
(_this$fileList = this.fileList).push.apply(_this$fileList, valList);
|
|
3432
|
+
}
|
|
3433
|
+
},
|
|
2740
3434
|
removeSpecialCharacters: function removeSpecialCharacters(filename) {
|
|
2741
3435
|
// 定义正则表达式,匹配除了字母、数字、下划线、空格和点号之外的所有字符
|
|
2742
3436
|
var pattern = /[^\w\u4e00-\u9fa5.]/gi;
|
|
@@ -2759,8 +3453,8 @@ var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
|
2759
3453
|
}).indexOf(file.fileId);
|
|
2760
3454
|
_this.fileValue.splice(indexVal, 1);
|
|
2761
3455
|
_this.$emit("input", _this.fileValue);
|
|
2762
|
-
} else if (file.state === 100) {
|
|
2763
|
-
file.cancel && file.cancel(
|
|
3456
|
+
} else if (file.state === 100 || file.state === 10 || file.state === 30) {
|
|
3457
|
+
file.cancel && file.cancel();
|
|
2764
3458
|
}
|
|
2765
3459
|
}).catch(function () {});
|
|
2766
3460
|
},
|
|
@@ -2774,6 +3468,17 @@ var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
|
2774
3468
|
window.open(file.fileUrl || file.filePath, "_blank");
|
|
2775
3469
|
}
|
|
2776
3470
|
},
|
|
3471
|
+
handDownLoad: function handDownLoad(file) {
|
|
3472
|
+
var link = document.createElement("a");
|
|
3473
|
+
link.style.display = "none";
|
|
3474
|
+
link.target = "_blank";
|
|
3475
|
+
link.href = file.filePath || file.fileUrl;
|
|
3476
|
+
link.download = file.fileName || file.name;
|
|
3477
|
+
// 使用该方法触发点击下载
|
|
3478
|
+
document.body.appendChild(link);
|
|
3479
|
+
link.click();
|
|
3480
|
+
document.body.removeChild(link);
|
|
3481
|
+
},
|
|
2777
3482
|
handUpload: function handUpload(file) {
|
|
2778
3483
|
if (!this.verification(file)) {
|
|
2779
3484
|
return false;
|
|
@@ -2781,6 +3486,9 @@ var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
|
2781
3486
|
file.percentage = 0;
|
|
2782
3487
|
this.uploading(file);
|
|
2783
3488
|
},
|
|
3489
|
+
handResumeUpload: function handResumeUpload(file) {
|
|
3490
|
+
file.resume();
|
|
3491
|
+
},
|
|
2784
3492
|
handError: function handError(file) {
|
|
2785
3493
|
if (this.$listeners.error) {
|
|
2786
3494
|
this.$emit("error", file);
|
|
@@ -2811,8 +3519,45 @@ var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
|
2811
3519
|
_this2.uploading(pending);
|
|
2812
3520
|
});
|
|
2813
3521
|
},
|
|
3522
|
+
uploadingLarge: function uploadingLarge(fileUpload) {
|
|
3523
|
+
var _this$api,
|
|
3524
|
+
_this3 = this;
|
|
3525
|
+
var largeUpload = new large_upload["a" /* default */](fileUpload, {
|
|
3526
|
+
request: this.request,
|
|
3527
|
+
uploadFileList: this.fileList,
|
|
3528
|
+
chunkSize: this.largeChunkSize,
|
|
3529
|
+
busiType: this.busiType || ((_this$api = this.api) == null || (_this$api = _this$api.data) == null ? void 0 : _this$api.busiType),
|
|
3530
|
+
//"piclib",
|
|
3531
|
+
maxRequest: this.batchMaxCount,
|
|
3532
|
+
batchMaxCount: this.batchMaxCount
|
|
3533
|
+
}, {
|
|
3534
|
+
onUploadProgress: function onUploadProgress(progressEvent) {
|
|
3535
|
+
var percent = progressEvent.percentage;
|
|
3536
|
+
var percentCompleted = Math.round(percent);
|
|
3537
|
+
// 处理上传进度,可根据实际需求进行操作
|
|
3538
|
+
if (percentCompleted == 100) {
|
|
3539
|
+
fileUpload.percentage = 99;
|
|
3540
|
+
} else {
|
|
3541
|
+
fileUpload.percentage = percentCompleted;
|
|
3542
|
+
}
|
|
3543
|
+
},
|
|
3544
|
+
onUploadFinish: function onUploadFinish(res) {
|
|
3545
|
+
_this3.uploadFinish(res, fileUpload);
|
|
3546
|
+
},
|
|
3547
|
+
onUploadError: function onUploadError(error) {
|
|
3548
|
+
fileUpload.state = 500; //上传失败
|
|
3549
|
+
fileUpload.errorMsg = error.message;
|
|
3550
|
+
_this3.batchUpload();
|
|
3551
|
+
}
|
|
3552
|
+
});
|
|
3553
|
+
largeUpload.hanldeUploadFile(fileUpload);
|
|
3554
|
+
},
|
|
2814
3555
|
uploading: function uploading(fileUpload) {
|
|
2815
|
-
var
|
|
3556
|
+
var _this4 = this;
|
|
3557
|
+
if (fileUpload.isLargeFile) {
|
|
3558
|
+
this.uploadingLarge(fileUpload);
|
|
3559
|
+
return false;
|
|
3560
|
+
}
|
|
2816
3561
|
// 数据处理
|
|
2817
3562
|
var formData = new FormData();
|
|
2818
3563
|
for (var key in this.api.data || {}) {
|
|
@@ -2824,11 +3569,15 @@ var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
|
2824
3569
|
"Content-Type": "multipart/form-data"
|
|
2825
3570
|
}, this.api.headers);
|
|
2826
3571
|
fileUpload.state = 100; //上传中...
|
|
3572
|
+
var controller = new AbortController();
|
|
3573
|
+
var signal = controller.signal; // 获取 signal 对象
|
|
2827
3574
|
var requestObj = {
|
|
2828
3575
|
url: this.api.url,
|
|
2829
3576
|
method: "POST",
|
|
2830
3577
|
headers: headers,
|
|
2831
3578
|
data: formData,
|
|
3579
|
+
signal: signal,
|
|
3580
|
+
// 将 signal 传递给服务函数
|
|
2832
3581
|
onUploadProgress: function onUploadProgress(progressEvent) {
|
|
2833
3582
|
var percent = progressEvent.loaded * 100 / progressEvent.total;
|
|
2834
3583
|
var percentCompleted = Math.round(percent);
|
|
@@ -2840,30 +3589,36 @@ var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
|
2840
3589
|
}
|
|
2841
3590
|
}
|
|
2842
3591
|
};
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
3592
|
+
fileUpload.cancel = function () {
|
|
3593
|
+
return controller.abort();
|
|
3594
|
+
};
|
|
3595
|
+
// if (this.CancelToken) {
|
|
3596
|
+
// requestObj.cancelToken = new this.CancelToken(function executor(c) {
|
|
3597
|
+
// // An executor function receives a cancel function as a parameter
|
|
3598
|
+
// fileUpload.cancel = c;
|
|
3599
|
+
// });
|
|
3600
|
+
// }
|
|
2849
3601
|
this.request(requestObj).then(function (res) {
|
|
2850
|
-
|
|
2851
|
-
fileUpload.percentage = 100; // 进度条
|
|
2852
|
-
fileUpload.state = 200; //上传成功
|
|
2853
|
-
var fileId = res[_this3.remoteProp.id];
|
|
2854
|
-
var fileUrl = typeof _this3.formatUrl === "function" ? _this3.formatUrl.call(_this3, res, fileUpload) : res[_this3.remoteProp.url];
|
|
2855
|
-
fileUpload.fileId = fileId;
|
|
2856
|
-
fileUpload.fileUrl = fileUrl;
|
|
2857
|
-
_this3.batchUpload();
|
|
2858
|
-
var fileName = _this3.removeSpecialCharacters(fileUpload.name);
|
|
2859
|
-
_this3.fileValue.push((_this3$fileValue$push = {}, _this3$fileValue$push[_this3.fileProp.id] = fileId, _this3$fileValue$push[_this3.fileProp.url] = fileUrl, _this3$fileValue$push[_this3.fileProp.name] = fileName, _this3$fileValue$push[_this3.fileProp.size] = fileUpload.size, _this3$fileValue$push[_this3.fileProp.type] = fileUpload.type, _this3$fileValue$push));
|
|
2860
|
-
_this3.$emit("input", _this3.fileValue);
|
|
3602
|
+
_this4.uploadFinish(res, fileUpload);
|
|
2861
3603
|
}).catch(function (error) {
|
|
2862
3604
|
fileUpload.state = 500; //上传失败
|
|
2863
3605
|
fileUpload.errorMsg = error.message;
|
|
2864
|
-
|
|
3606
|
+
_this4.batchUpload();
|
|
2865
3607
|
});
|
|
2866
3608
|
},
|
|
3609
|
+
uploadFinish: function uploadFinish(res, fileUpload) {
|
|
3610
|
+
var _this$fileValue$push;
|
|
3611
|
+
fileUpload.percentage = 100; // 进度条
|
|
3612
|
+
fileUpload.state = 200; //上传成功
|
|
3613
|
+
var fileId = res[this.remoteProp.id];
|
|
3614
|
+
var fileUrl = typeof this.formatUrl === "function" ? this.formatUrl.call(this, res, fileUpload) : res[this.remoteProp.url];
|
|
3615
|
+
fileUpload.fileId = fileId;
|
|
3616
|
+
fileUpload.fileUrl = fileUrl;
|
|
3617
|
+
this.batchUpload();
|
|
3618
|
+
var fileName = this.removeSpecialCharacters(fileUpload.name);
|
|
3619
|
+
this.fileValue.push((_this$fileValue$push = {}, _this$fileValue$push[this.fileProp.id] = fileId, _this$fileValue$push[this.fileProp.url] = fileUrl, _this$fileValue$push[this.fileProp.name] = fileName, _this$fileValue$push[this.fileProp.size] = fileUpload.size, _this$fileValue$push[this.fileProp.type] = fileUpload.type, _this$fileValue$push.mimeType = res == null ? void 0 : res.mimeType, _this$fileValue$push));
|
|
3620
|
+
this.$emit("input", this.fileValue);
|
|
3621
|
+
},
|
|
2867
3622
|
verification: function verification(upload) {
|
|
2868
3623
|
if (this.uploadMaxSize && this.uploadMaxSize > 0) {
|
|
2869
3624
|
var fileSize = upload.size / 1024 / 1024;
|
|
@@ -2886,20 +3641,23 @@ var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
|
2886
3641
|
var type = upload.raw.type;
|
|
2887
3642
|
// 准备上传数据
|
|
2888
3643
|
var fileUpload = {
|
|
2889
|
-
id: upload.uid,
|
|
3644
|
+
// id: upload.uid,
|
|
2890
3645
|
name: upload.name,
|
|
2891
3646
|
file: upload,
|
|
2892
3647
|
state: 0,
|
|
2893
3648
|
percentage: 0,
|
|
2894
3649
|
errorMsg: null,
|
|
2895
3650
|
size: size,
|
|
2896
|
-
type: type
|
|
3651
|
+
type: type,
|
|
3652
|
+
isLargeFile: false
|
|
2897
3653
|
};
|
|
2898
3654
|
if (!this.verification(fileUpload)) {
|
|
2899
|
-
|
|
2900
|
-
}
|
|
2901
|
-
|
|
3655
|
+
return false;
|
|
3656
|
+
}
|
|
3657
|
+
if (this.useLarge && size > this.largeSize) {
|
|
3658
|
+
fileUpload.isLargeFile = true;
|
|
2902
3659
|
}
|
|
3660
|
+
this.pendingFileList.push(fileUpload);
|
|
2903
3661
|
this.$emit("beforeUpload", {
|
|
2904
3662
|
ref: this,
|
|
2905
3663
|
fileList: this.fileList,
|
|
@@ -2919,9 +3677,9 @@ var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
|
2919
3677
|
}
|
|
2920
3678
|
}
|
|
2921
3679
|
});
|
|
2922
|
-
// CONCATENATED MODULE: ./src/components/form/src/item/
|
|
2923
|
-
/* harmony default export */ var
|
|
2924
|
-
// CONCATENATED MODULE: ./src/components/form/src/item/
|
|
3680
|
+
// CONCATENATED MODULE: ./src/components/form/src/item/upload-process/index.vue?vue&type=script&lang=js
|
|
3681
|
+
/* harmony default export */ var item_upload_processvue_type_script_lang_js = (upload_processvue_type_script_lang_js);
|
|
3682
|
+
// CONCATENATED MODULE: ./src/components/form/src/item/upload-process/index.vue
|
|
2925
3683
|
|
|
2926
3684
|
|
|
2927
3685
|
|
|
@@ -2929,10 +3687,10 @@ var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
|
2929
3687
|
|
|
2930
3688
|
/* normalize component */
|
|
2931
3689
|
|
|
2932
|
-
var
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
3690
|
+
var upload_process_component = Object(componentNormalizer["a" /* default */])(
|
|
3691
|
+
item_upload_processvue_type_script_lang_js,
|
|
3692
|
+
upload_processvue_type_template_id_b7318202_render,
|
|
3693
|
+
upload_processvue_type_template_id_b7318202_staticRenderFns,
|
|
2936
3694
|
false,
|
|
2937
3695
|
null,
|
|
2938
3696
|
null,
|
|
@@ -2940,25 +3698,25 @@ var UploadProcess_component = Object(componentNormalizer["a" /* default */])(
|
|
|
2940
3698
|
|
|
2941
3699
|
)
|
|
2942
3700
|
|
|
2943
|
-
/* harmony default export */ var
|
|
3701
|
+
/* harmony default export */ var upload_process = (upload_process_component.exports);
|
|
2944
3702
|
// EXTERNAL MODULE: external "element-ui/lib/switch"
|
|
2945
|
-
var switch_ = __webpack_require__(
|
|
3703
|
+
var switch_ = __webpack_require__(53);
|
|
2946
3704
|
var switch_default = /*#__PURE__*/__webpack_require__.n(switch_);
|
|
2947
3705
|
|
|
2948
3706
|
// EXTERNAL MODULE: external "element-ui/lib/slider"
|
|
2949
|
-
var slider_ = __webpack_require__(
|
|
3707
|
+
var slider_ = __webpack_require__(54);
|
|
2950
3708
|
var slider_default = /*#__PURE__*/__webpack_require__.n(slider_);
|
|
2951
3709
|
|
|
2952
3710
|
// EXTERNAL MODULE: external "element-ui/lib/transfer"
|
|
2953
|
-
var transfer_ = __webpack_require__(
|
|
3711
|
+
var transfer_ = __webpack_require__(55);
|
|
2954
3712
|
var transfer_default = /*#__PURE__*/__webpack_require__.n(transfer_);
|
|
2955
3713
|
|
|
2956
3714
|
// EXTERNAL MODULE: external "element-ui/lib/time-picker"
|
|
2957
|
-
var time_picker_ = __webpack_require__(
|
|
3715
|
+
var time_picker_ = __webpack_require__(56);
|
|
2958
3716
|
var time_picker_default = /*#__PURE__*/__webpack_require__.n(time_picker_);
|
|
2959
3717
|
|
|
2960
3718
|
// EXTERNAL MODULE: external "element-ui/lib/upload"
|
|
2961
|
-
var upload_ = __webpack_require__(
|
|
3719
|
+
var upload_ = __webpack_require__(57);
|
|
2962
3720
|
var upload_default = /*#__PURE__*/__webpack_require__.n(upload_);
|
|
2963
3721
|
|
|
2964
3722
|
// CONCATENATED MODULE: ./src/components/form/src/form-input.js
|
|
@@ -2998,7 +3756,7 @@ var upload_default = /*#__PURE__*/__webpack_require__.n(upload_);
|
|
|
2998
3756
|
Radio: Radio,
|
|
2999
3757
|
Checkbox: Checkbox,
|
|
3000
3758
|
InputText: InputText,
|
|
3001
|
-
UploadProcess:
|
|
3759
|
+
UploadProcess: upload_process
|
|
3002
3760
|
},
|
|
3003
3761
|
props: {
|
|
3004
3762
|
control: String,
|