@titaui/pc 1.13.3 → 1.13.6
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/components/checkbox-list/index.css +31 -0
- package/lib/components/checkbox-list/index.js +68 -0
- package/lib/components/create-okr-modal/index.js +4 -1
- package/lib/components/dialog-qq-docs/index.css +106 -0
- package/lib/components/dialog-qq-docs/index.js +507 -0
- package/lib/components/dialog-qq-docs/request-apis.js +16 -0
- package/lib/components/dialog-qq-docs/utils.js +83 -0
- package/lib/components/dialog-select/index.css +9 -0
- package/lib/components/dialog-select/index.js +48 -0
- package/lib/components/dialog-upload/img/folder.svg +40 -0
- package/lib/components/dialog-upload/img/form.svg +38 -0
- package/lib/components/dialog-upload/img/mind.svg +39 -0
- package/lib/components/dialog-upload/util.js +20 -2
- package/lib/components/dialog-upload-type/assets/folder.svg +20 -0
- package/lib/components/dialog-upload-type/assets/qq-docs.svg +20 -0
- package/lib/components/dialog-upload-type/components/upload-type-item/index.css +14 -0
- package/lib/components/dialog-upload-type/components/upload-type-item/index.js +36 -0
- package/lib/components/dialog-upload-type/index.css +7 -0
- package/lib/components/dialog-upload-type/index.js +68 -0
- package/lib/components/file-list/components/single-file/index.css +29 -0
- package/lib/components/file-list/components/single-file/index.js +19 -28
- package/lib/components/file-list/img/folder.svg +40 -0
- package/lib/components/file-list/img/form.svg +38 -0
- package/lib/components/file-list/img/mind.svg +39 -0
- package/lib/components/file-list/index.js +2 -1
- package/lib/components/file-list/util.js +20 -2
- package/lib/components/file-preview/index.css +44 -0
- package/lib/components/file-preview/index.js +68 -0
- package/lib/components/loading/assets/loading.gif +0 -0
- package/lib/components/loading/index.css +28 -0
- package/lib/components/loading/index.js +64 -0
- package/lib/components/nav/index.css +37 -0
- package/lib/components/nav/index.js +31 -0
- package/lib/components/nav-top/index.css +6 -0
- package/lib/components/nav-top/index.js +138 -2
- package/lib/components/nav-top/request.apis.js +10 -2
- package/lib/components/okr-guide/constant.js +23 -0
- package/lib/components/okr-guide/img/left-img.jpg +0 -0
- package/lib/components/okr-guide/index.css +148 -0
- package/lib/components/okr-guide/index.js +242 -0
- package/lib/components/okr-guide/request-api.js +57 -0
- package/lib/components/okr-review/ReviewPop/components/ReviewBody/index.js +1 -1
- package/lib/components/rich-editor/plugins/inline/color/commond.js +3 -3
- package/lib/components/scroll-container/index.js +27 -6
- package/lib/components/search-input/index.css +2 -2
- package/lib/components/search-input/index.js +4 -0
- package/lib/components/upload/img/folder.svg +40 -0
- package/lib/components/upload/img/form.svg +38 -0
- package/lib/components/upload/img/mind.svg +39 -0
- package/lib/components/upload/index.js +195 -25
- package/lib/components/upload/index2.js +381 -0
- package/lib/components/upload/util.js +20 -2
- package/lib/components/user-selector/request-apis.js +3 -3
- package/lib/components/version-change-modal/index.js +1 -3
- package/lib/index.js +8 -0
- package/lib/utils/open-data.js +77 -68
- package/lib/utils/tools.js +11 -1
- package/package.json +1 -1
- package/lib/utils/mock-bsglobal.js +0 -1837
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="28px" height="28px" viewBox="0 0 28 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<title>pdf-icon</title>
|
|
4
|
+
<defs>
|
|
5
|
+
<linearGradient x1="100%" y1="29.7818714%" x2="83.6208606%" y2="29.7818714%" id="linearGradient-1">
|
|
6
|
+
<stop stop-color="#33C7FF" offset="0%"></stop>
|
|
7
|
+
<stop stop-color="#009FDB" offset="100%"></stop>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
<linearGradient x1="50%" y1="100%" x2="50%" y2="-2.48949813e-15%" id="linearGradient-2">
|
|
10
|
+
<stop stop-color="#12AFEA" offset="0%"></stop>
|
|
11
|
+
<stop stop-color="#94E2FF" offset="100%"></stop>
|
|
12
|
+
</linearGradient>
|
|
13
|
+
<filter x="-33.2%" y="-40.4%" width="166.4%" height="180.9%" filterUnits="objectBoundingBox" id="filter-3">
|
|
14
|
+
<feOffset dx="0" dy="0.8" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
|
|
15
|
+
<feGaussianBlur stdDeviation="0.4" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
|
|
16
|
+
<feColorMatrix values="0 0 0 0 0.0705882353 0 0 0 0 0.68627451 0 0 0 0 0.917647059 0 0 0 0.8 0" type="matrix" in="shadowBlurOuter1" result="shadowMatrixOuter1"></feColorMatrix>
|
|
17
|
+
<feMerge>
|
|
18
|
+
<feMergeNode in="shadowMatrixOuter1"></feMergeNode>
|
|
19
|
+
<feMergeNode in="SourceGraphic"></feMergeNode>
|
|
20
|
+
</feMerge>
|
|
21
|
+
</filter>
|
|
22
|
+
</defs>
|
|
23
|
+
<g id="老图标" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
24
|
+
<g id="附件图标" transform="translate(-121.000000, -2045.000000)">
|
|
25
|
+
<g id="caret-left" transform="translate(100.000000, 2024.000000)">
|
|
26
|
+
<g id="pdf-icon" transform="translate(21.000000, 21.451613)">
|
|
27
|
+
<rect id="矩形" x="0" y="0" width="28" height="27.0967742"></rect>
|
|
28
|
+
<path d="M8.08888889,7.67741935 L23.6444445,7.67741935 C24.503554,7.67741935 25.2,8.3455386 25.2,9.16970547 L25.2,23.3464236 C25.2,24.1705905 24.503554,24.8387097 23.6444445,24.8387097 L8.08888889,24.8387097 C7.22977928,24.8387097 6.53333333,24.1705905 6.53333333,23.3464236 L6.53333333,9.16970547 C6.53333333,8.3455386 7.22977928,7.67741935 8.08888889,7.67741935 Z" id="蒙版备份" fill="url(#linearGradient-1)" fill-rule="nonzero"></path>
|
|
29
|
+
<path d="M20.291358,2.25806452 C21.1313763,2.25806452 21.8123456,2.93204446 21.8123456,3.76344086 L21.8123456,23.3333334 C21.8123456,24.1647298 22.493315,24.8387097 23.3333333,24.8387097 L4.32098765,24.8387097 C3.48096937,24.8387097 2.8,24.1647298 2.8,23.3333334 L2.8,3.76344086 C2.8,2.93204446 3.48096937,2.25806452 4.32098765,2.25806452 L20.291358,2.25806452 Z" id="path-3" fill="url(#linearGradient-2)" fill-rule="nonzero"></path>
|
|
30
|
+
<g id="编组-22" filter="url(#filter-3)" transform="translate(6.000000, 8.798387)">
|
|
31
|
+
<path d="M7.13978495,4 L10.7397849,4 C11.1263843,4 11.4397849,4.31340068 11.4397849,4.7 C11.4397849,5.08659932 11.1263843,5.4 10.7397849,5.4 L7.13978495,5.4 C6.75318562,5.4 6.43978495,5.08659932 6.43978495,4.7 C6.43978495,4.31340068 6.75318562,4 7.13978495,4 Z" id="path-5" fill="#88DFFF" transform="translate(8.939785, 4.700000) rotate(-180.000000) translate(-8.939785, -4.700000) "></path>
|
|
32
|
+
<path d="M2.80326654,4 C3.08544089,4 3.34002538,4.16942267 3.44897952,4.42971358 C4.42734177,6.76701638 5.41282979,7.91043659 6.29653021,7.99493445 L6.40207871,8 L10.7,8 C11.0865993,8 11.4,8.31340068 11.4,8.7 C11.4,9.05438271 11.1366564,9.34725823 10.7949859,9.39360983 L10.7,9.4 L6.40207871,9.4 C4.9177844,9.4 3.65980532,8.17244898 2.53985234,5.8267506 L2.343,5.4 L0.7,5.4 C0.345617286,5.4 0.0527417698,5.13665638 0.00639017493,4.79498585 L0,4.7 C0,4.34561729 0.263343623,4.05274177 0.605014146,4.00639017 L0.7,4 L2.80326654,4 Z" id="路径-2" fill="#FFFFFF" fill-rule="nonzero"></path>
|
|
33
|
+
<path d="M2.80326654,0 C3.08544089,0 3.34002538,0.169422665 3.44897952,0.429713581 C4.42734177,2.76701638 5.41282979,3.91043659 6.29653021,3.99493445 L6.40207871,4 L10.7,4 C11.0865993,4 11.4,4.31340068 11.4,4.7 C11.4,5.05438271 11.1366564,5.34725823 10.7949859,5.39360983 L10.7,5.4 L6.40207871,5.4 C4.9177844,5.4 3.65980532,4.17244898 2.53985234,1.8267506 L2.343,1.4 L0.7,1.4 C0.345617286,1.4 0.0527417698,1.13665638 0.00639017493,0.794985854 L0,0.7 C0,0.345617286 0.263343623,0.0527417698 0.605014146,0.00639017493 L0.7,0 L2.80326654,0 Z" id="路径-2" fill="#FFFFFF" fill-rule="nonzero" transform="translate(5.700000, 2.700000) scale(1, -1) translate(-5.700000, -2.700000) "></path>
|
|
34
|
+
</g>
|
|
35
|
+
</g>
|
|
36
|
+
</g>
|
|
37
|
+
</g>
|
|
38
|
+
</g>
|
|
39
|
+
</svg>
|
|
@@ -13,6 +13,10 @@ var _titaUi = require("tita-ui");
|
|
|
13
13
|
|
|
14
14
|
var _uuid = _interopRequireDefault(require("uuid"));
|
|
15
15
|
|
|
16
|
+
var _dialogUploadType = _interopRequireDefault(require("../dialog-upload-type"));
|
|
17
|
+
|
|
18
|
+
var _dialogQqDocs = _interopRequireDefault(require("../dialog-qq-docs"));
|
|
19
|
+
|
|
16
20
|
var _Portals = _interopRequireDefault(require("../../components-v1/portals/Portals"));
|
|
17
21
|
|
|
18
22
|
var _requestV = require("../../utils/request-v1");
|
|
@@ -31,12 +35,22 @@ var _util = require("./util");
|
|
|
31
35
|
|
|
32
36
|
var _getLocale = require("../../utils/getLocale");
|
|
33
37
|
|
|
38
|
+
var _platform = require("../../utils/platform");
|
|
39
|
+
|
|
40
|
+
var _utils = require("../dialog-qq-docs/utils");
|
|
41
|
+
|
|
34
42
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
35
43
|
|
|
36
44
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
45
|
|
|
38
46
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
39
47
|
|
|
48
|
+
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 exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
49
|
+
|
|
50
|
+
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); } }
|
|
51
|
+
|
|
52
|
+
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); }); }; }
|
|
53
|
+
|
|
40
54
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
41
55
|
|
|
42
56
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -75,6 +89,9 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
75
89
|
|
|
76
90
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
77
91
|
|
|
92
|
+
var openTencentDocFile = window.BSGlobal && window.BSGlobal.TenantAdvancedSetting.TenantFunAdvancedSetting.TencentDocFile && // 默认在钉钉环境下禁用
|
|
93
|
+
!(0, _platform.isDD)(true);
|
|
94
|
+
|
|
78
95
|
var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
79
96
|
_inherits(Upload, _PureComponent);
|
|
80
97
|
|
|
@@ -87,8 +104,15 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
87
104
|
|
|
88
105
|
_this = _super.call(this, props);
|
|
89
106
|
|
|
90
|
-
_this.onFileInputChange = function () {
|
|
91
|
-
var
|
|
107
|
+
_this.onFileInputChange = function (e) {
|
|
108
|
+
var onChange = _this.props.onChange;
|
|
109
|
+
var fileInput = _this.refs.fileInput;
|
|
110
|
+
|
|
111
|
+
_this.setState({
|
|
112
|
+
dialogUploadTypeVidible: false
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
if (onChange) onChange(e); // @ts-ignore
|
|
92
116
|
|
|
93
117
|
var selectFiles = fileInput.files; // 选择的文件
|
|
94
118
|
// @ts-ignore
|
|
@@ -332,7 +356,9 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
332
356
|
};
|
|
333
357
|
|
|
334
358
|
_this._dealUploadSuccess = function (uploadSuccessFile) {
|
|
335
|
-
var
|
|
359
|
+
var _this$props2 = _this.props,
|
|
360
|
+
onSubmit = _this$props2.onSubmit,
|
|
361
|
+
onUploadSuccess = _this$props2.onUploadSuccess;
|
|
336
362
|
|
|
337
363
|
var uploadSuccessFiles = _toConsumableArray(_this.state.uploadSuccessFiles);
|
|
338
364
|
|
|
@@ -345,6 +371,8 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
345
371
|
|
|
346
372
|
onSubmit(uploadSuccessFilesPath); // 将上传完成的文件路径传递给父组件
|
|
347
373
|
|
|
374
|
+
if (onUploadSuccess) onUploadSuccess(uploadSuccessFilesFormat);
|
|
375
|
+
|
|
348
376
|
_this.setState({
|
|
349
377
|
uploadSuccessFiles: uploadSuccessFilesFormat,
|
|
350
378
|
attachmentPreviewUrl: (0, _util.getPreviewImgs)(uploadSuccessFilesFormat)
|
|
@@ -373,9 +401,9 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
373
401
|
};
|
|
374
402
|
|
|
375
403
|
_this.handlerUploadPreviewOptions = function (index, options) {
|
|
376
|
-
var _this$
|
|
377
|
-
onSubmit = _this$
|
|
378
|
-
onDelete = _this$
|
|
404
|
+
var _this$props3 = _this.props,
|
|
405
|
+
onSubmit = _this$props3.onSubmit,
|
|
406
|
+
onDelete = _this$props3.onDelete;
|
|
379
407
|
|
|
380
408
|
if (options === 'cancel') {
|
|
381
409
|
var reUploadFileInfo = _this.state.uploadSuccessFiles[index];
|
|
@@ -415,9 +443,12 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
415
443
|
};
|
|
416
444
|
|
|
417
445
|
_this.renderUploadList = function (list) {
|
|
418
|
-
var
|
|
446
|
+
var _this$props4 = _this.props,
|
|
447
|
+
attachmentPreviewBox = _this$props4.attachmentPreviewBox,
|
|
448
|
+
_this$props4$showFile = _this$props4.showFileList,
|
|
449
|
+
showFileList = _this$props4$showFile === void 0 ? true : _this$props4$showFile;
|
|
419
450
|
var attachmentPreviewUrl = _this.state.attachmentPreviewUrl;
|
|
420
|
-
if (!list.length) return;
|
|
451
|
+
if (!list.length || !showFileList) return '';
|
|
421
452
|
return /*#__PURE__*/_react["default"].createElement(_Portals["default"], {
|
|
422
453
|
domNode: attachmentPreviewBox,
|
|
423
454
|
className: "uploadFile__preview__list"
|
|
@@ -441,16 +472,134 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
441
472
|
_this.handleButtonClick = function (e) {
|
|
442
473
|
e.nativeEvent.stopImmediatePropagation();
|
|
443
474
|
|
|
475
|
+
if (openTencentDocFile) {
|
|
476
|
+
_this.setState({
|
|
477
|
+
dialogUploadTypeVidible: true
|
|
478
|
+
});
|
|
479
|
+
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
|
|
444
483
|
if (_this.refs.fileInput) {
|
|
445
484
|
// @ts-ignore
|
|
446
485
|
_this.refs.fileInput.click();
|
|
447
486
|
}
|
|
448
487
|
};
|
|
449
488
|
|
|
489
|
+
_this.hideDialogQQDocsVidible = function () {
|
|
490
|
+
_this.setState({
|
|
491
|
+
dialogQQDocsVidible: false
|
|
492
|
+
});
|
|
493
|
+
};
|
|
494
|
+
|
|
495
|
+
_this.hideDialogUploadTypeVidible = function () {
|
|
496
|
+
_this.setState({
|
|
497
|
+
dialogUploadTypeVidible: false
|
|
498
|
+
});
|
|
499
|
+
};
|
|
500
|
+
|
|
501
|
+
_this.onSelectLocalFife = function () {
|
|
502
|
+
if (_this.refs.fileInput) {
|
|
503
|
+
// @ts-ignore
|
|
504
|
+
_this.refs.fileInput.click();
|
|
505
|
+
}
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
_this.onShowDialogQQDocs = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
509
|
+
var data;
|
|
510
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
511
|
+
while (1) {
|
|
512
|
+
switch (_context.prev = _context.next) {
|
|
513
|
+
case 0:
|
|
514
|
+
_context.next = 2;
|
|
515
|
+
return (0, _utils.checkTencentAuth)({});
|
|
516
|
+
|
|
517
|
+
case 2:
|
|
518
|
+
data = _context.sent;
|
|
519
|
+
|
|
520
|
+
if (data) {
|
|
521
|
+
_context.next = 5;
|
|
522
|
+
break;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
return _context.abrupt("return");
|
|
526
|
+
|
|
527
|
+
case 5:
|
|
528
|
+
// 设置默认的文档数据,避免在弹窗内部再查询一次
|
|
529
|
+
_this.setState({
|
|
530
|
+
defaultQQDocsData: data,
|
|
531
|
+
dialogQQDocsVidible: true
|
|
532
|
+
});
|
|
533
|
+
|
|
534
|
+
case 6:
|
|
535
|
+
case "end":
|
|
536
|
+
return _context.stop();
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}, _callee);
|
|
540
|
+
}));
|
|
541
|
+
|
|
542
|
+
_this.qqDocsFormat = function (qqDocsList) {
|
|
543
|
+
return qqDocsList.map(function (element) {
|
|
544
|
+
var uploadStartFile = {
|
|
545
|
+
FileName: element.title,
|
|
546
|
+
FileType: element.type,
|
|
547
|
+
FileSize: element.size,
|
|
548
|
+
FileLastModified: element.lastModified,
|
|
549
|
+
IsImage: false,
|
|
550
|
+
percentComplete: 0,
|
|
551
|
+
uploadStatus: 3,
|
|
552
|
+
// 开始上传
|
|
553
|
+
IsSuccess: true,
|
|
554
|
+
uid: (0, _uuid["default"])(),
|
|
555
|
+
_smallImageUrl: '',
|
|
556
|
+
_bigImageUrl: '',
|
|
557
|
+
MediaType: '',
|
|
558
|
+
UserId: 0,
|
|
559
|
+
MaxDocCount: 0,
|
|
560
|
+
DfsPath: "".concat(element.url, "|").concat(element.type, "|").concat(element.title, "|tencentdoc"),
|
|
561
|
+
ClientUrl: element.url,
|
|
562
|
+
SmallImageUrl: '',
|
|
563
|
+
BigImageUrl: '',
|
|
564
|
+
DownloadUrl: '',
|
|
565
|
+
Msg: '',
|
|
566
|
+
AllowUploadAttachmentSize: 50,
|
|
567
|
+
Deleteable: true,
|
|
568
|
+
requestXHR: new XMLHttpRequest() // 在这创建是为了取消用
|
|
569
|
+
|
|
570
|
+
};
|
|
571
|
+
return uploadStartFile;
|
|
572
|
+
});
|
|
573
|
+
};
|
|
574
|
+
|
|
575
|
+
_this.onSelectQQDocsFileHandler = function (checkedDocsList) {
|
|
576
|
+
var uploadSuccessFiles = _this.state.uploadSuccessFiles;
|
|
577
|
+
var onSubmit = _this.props.onSubmit;
|
|
578
|
+
|
|
579
|
+
var newFileList = _this.qqDocsFormat(checkedDocsList);
|
|
580
|
+
|
|
581
|
+
var newUploadSuccessFiles = [].concat(_toConsumableArray(uploadSuccessFiles), _toConsumableArray(newFileList));
|
|
582
|
+
|
|
583
|
+
_this.setState({
|
|
584
|
+
uploadSuccessFiles: newUploadSuccessFiles
|
|
585
|
+
});
|
|
586
|
+
|
|
587
|
+
_this.setState({
|
|
588
|
+
dialogQQDocsVidible: false,
|
|
589
|
+
dialogUploadTypeVidible: false
|
|
590
|
+
});
|
|
591
|
+
|
|
592
|
+
onSubmit(newUploadSuccessFiles.map(function (item) {
|
|
593
|
+
return item.DfsPath;
|
|
594
|
+
}));
|
|
595
|
+
};
|
|
596
|
+
|
|
450
597
|
_this.state = {
|
|
451
598
|
uploadSuccessFiles: props.attachments || [],
|
|
452
599
|
attachmentPreviewUrl: props.attachments ? (0, _util.getPreviewImgs)(props.attachments) : [],
|
|
453
|
-
selectFiles: {}
|
|
600
|
+
selectFiles: {},
|
|
601
|
+
dialogUploadTypeVidible: false,
|
|
602
|
+
dialogQQDocsVidible: false
|
|
454
603
|
};
|
|
455
604
|
return _this;
|
|
456
605
|
}
|
|
@@ -488,21 +637,22 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
488
637
|
value: function render() {
|
|
489
638
|
var _this2 = this;
|
|
490
639
|
|
|
491
|
-
var _this$
|
|
492
|
-
children = _this$
|
|
493
|
-
className = _this$
|
|
494
|
-
style = _this$
|
|
495
|
-
_this$
|
|
496
|
-
attachmentTipText = _this$
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
640
|
+
var _this$props5 = this.props,
|
|
641
|
+
children = _this$props5.children,
|
|
642
|
+
className = _this$props5.className,
|
|
643
|
+
style = _this$props5.style,
|
|
644
|
+
_this$props5$attachme = _this$props5.attachmentTipText,
|
|
645
|
+
attachmentTipText = _this$props5$attachme === void 0 ? (0, _getLocale.getLocale)('OKR_MyO_KRP_Draganddropu') : _this$props5$attachme,
|
|
646
|
+
_this$props5$disableT = _this$props5.disableTooltip,
|
|
647
|
+
disableTooltip = _this$props5$disableT === void 0 ? false : _this$props5$disableT,
|
|
648
|
+
fileNumLimit = _this$props5.fileNumLimit;
|
|
649
|
+
var _this$state2 = this.state,
|
|
650
|
+
uploadSuccessFiles = _this$state2.uploadSuccessFiles,
|
|
651
|
+
dialogUploadTypeVidible = _this$state2.dialogUploadTypeVidible,
|
|
652
|
+
dialogQQDocsVidible = _this$state2.dialogQQDocsVidible,
|
|
653
|
+
defaultQQDocsData = _this$state2.defaultQQDocsData;
|
|
654
|
+
|
|
655
|
+
var uploadFormContainer = /*#__PURE__*/_react["default"].createElement(_style.UploadFormContainer, {
|
|
506
656
|
className: className,
|
|
507
657
|
style: style,
|
|
508
658
|
onMouseUp: function onMouseUp(e) {
|
|
@@ -522,7 +672,27 @@ var Upload = /*#__PURE__*/function (_PureComponent) {
|
|
|
522
672
|
display: 'none'
|
|
523
673
|
},
|
|
524
674
|
onChange: this.onFileInputChange
|
|
525
|
-
}))
|
|
675
|
+
}));
|
|
676
|
+
|
|
677
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_dialogUploadType["default"], {
|
|
678
|
+
onSelectLocal: this.onSelectLocalFife,
|
|
679
|
+
onSelectQQDocs: this.onShowDialogQQDocs,
|
|
680
|
+
visible: dialogUploadTypeVidible,
|
|
681
|
+
onClose: this.hideDialogUploadTypeVidible
|
|
682
|
+
}), /*#__PURE__*/_react["default"].createElement(_dialogQqDocs["default"], {
|
|
683
|
+
fileNumLimit: fileNumLimit,
|
|
684
|
+
defaultQQDocsData: defaultQQDocsData,
|
|
685
|
+
visible: dialogQQDocsVidible,
|
|
686
|
+
onClose: this.hideDialogQQDocsVidible,
|
|
687
|
+
onSubmit: this.onSelectQQDocsFileHandler
|
|
688
|
+
}), disableTooltip ? uploadFormContainer : /*#__PURE__*/_react["default"].createElement(_titaUi.Tooltip, {
|
|
689
|
+
container: document.body,
|
|
690
|
+
content: /*#__PURE__*/_react["default"].createElement("p", {
|
|
691
|
+
dangerouslySetInnerHTML: {
|
|
692
|
+
__html: attachmentTipText
|
|
693
|
+
}
|
|
694
|
+
})
|
|
695
|
+
}, uploadFormContainer), this.renderUploadList(uploadSuccessFiles));
|
|
526
696
|
}
|
|
527
697
|
}]);
|
|
528
698
|
|