gxxc-ui 1.0.0
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/LICENSE +21 -0
- package/README.md +41 -0
- package/dist/AmountCellUI/index.d.ts +11 -0
- package/dist/AmountCellUI/index.js +123 -0
- package/dist/AnchorUI/demo/anchor-button.d.ts +3 -0
- package/dist/AnchorUI/demo/anchor-button.js +85 -0
- package/dist/AnchorUI/demo/use-anchor.d.ts +3 -0
- package/dist/AnchorUI/demo/use-anchor.js +69 -0
- package/dist/AnchorUI/index.d.ts +4 -0
- package/dist/AnchorUI/index.js +56 -0
- package/dist/AnchorUI/index.scss +21 -0
- package/dist/BackUI/index.d.ts +14 -0
- package/dist/BackUI/index.js +35 -0
- package/dist/BackUI/index.scss +26 -0
- package/dist/BroadcastUI/index.d.ts +12 -0
- package/dist/BroadcastUI/index.js +62 -0
- package/dist/BroadcastUI/index.scss +43 -0
- package/dist/ButtonUI/index.d.ts +9 -0
- package/dist/ButtonUI/index.js +17 -0
- package/dist/ButtonUI/index.scss +6 -0
- package/dist/CellUI/index.d.ts +13 -0
- package/dist/CellUI/index.js +78 -0
- package/dist/CellUI/index.scss +28 -0
- package/dist/Components/index.d.ts +2 -0
- package/dist/Components/index.js +4 -0
- package/dist/DateUI/index.d.ts +5 -0
- package/dist/DateUI/index.js +116 -0
- package/dist/DateUI/index.scss +3 -0
- package/dist/DescriptionsUI/index.d.ts +19 -0
- package/dist/DescriptionsUI/index.js +72 -0
- package/dist/DescriptionsUI/index.scss +88 -0
- package/dist/EmptyUI/emptyImage.d.ts +3 -0
- package/dist/EmptyUI/emptyImage.js +12 -0
- package/dist/EmptyUI/index.d.ts +9 -0
- package/dist/EmptyUI/index.js +13 -0
- package/dist/EmptyUI/index.scss +10 -0
- package/dist/FilterUI/index.d.ts +28 -0
- package/dist/FilterUI/index.js +252 -0
- package/dist/FilterUI/index.scss +80 -0
- package/dist/FormUI/index.d.ts +4 -0
- package/dist/FormUI/index.js +45 -0
- package/dist/FormUI/index.scss +64 -0
- package/dist/IconUI/index.d.ts +27 -0
- package/dist/IconUI/index.js +22 -0
- package/dist/IconUI/material/dictionary.d.ts +4 -0
- package/dist/IconUI/material/dictionary.js +71 -0
- package/dist/IconUI/material/dictionary.scss +58 -0
- package/dist/IconUI/material/material.d.ts +16 -0
- package/dist/IconUI/material/material.js +476 -0
- package/dist/IconUI/material/rally.d.ts +22 -0
- package/dist/IconUI/material/rally.js +50 -0
- package/dist/ImageUI/index.d.ts +13 -0
- package/dist/ImageUI/index.js +159 -0
- package/dist/ImageUI/index.scss +59 -0
- package/dist/InputUI/index.d.ts +7 -0
- package/dist/InputUI/index.js +114 -0
- package/dist/InputUI/index.scss +24 -0
- package/dist/LoadingUI/index.d.ts +4 -0
- package/dist/LoadingUI/index.js +13 -0
- package/dist/LoadingUI/index.scss +47 -0
- package/dist/MessageUI/index.d.ts +3 -0
- package/dist/MessageUI/index.js +9 -0
- package/dist/MessageUI/index.scss +50 -0
- package/dist/ModalUI/index.d.ts +4 -0
- package/dist/ModalUI/index.js +98 -0
- package/dist/ModalUI/index.scss +45 -0
- package/dist/NotificationUI/index.d.ts +3 -0
- package/dist/NotificationUI/index.js +30 -0
- package/dist/NotificationUI/index.scss +0 -0
- package/dist/PasswordStrongUI/index.d.ts +8 -0
- package/dist/PasswordStrongUI/index.js +67 -0
- package/dist/PasswordStrongUI/index.scss +35 -0
- package/dist/RichEditorUI/index.d.ts +10 -0
- package/dist/RichEditorUI/index.js +68 -0
- package/dist/RichEditorUI/index.scss +20 -0
- package/dist/SearchUI/index.d.ts +4 -0
- package/dist/SearchUI/index.js +55 -0
- package/dist/SearchUI/index.scss +20 -0
- package/dist/SelectUI/index.d.ts +13 -0
- package/dist/SelectUI/index.js +87 -0
- package/dist/SelectUI/index.scss +13 -0
- package/dist/StatisticUI/index.d.ts +20 -0
- package/dist/StatisticUI/index.js +70 -0
- package/dist/StatisticUI/index.scss +6 -0
- package/dist/SwitchUI/index.d.ts +4 -0
- package/dist/SwitchUI/index.js +24 -0
- package/dist/SwitchUI/index.scss +0 -0
- package/dist/TableUI/demo/index.scss +7 -0
- package/dist/TableUI/demo/setting.d.ts +4 -0
- package/dist/TableUI/demo/setting.js +107 -0
- package/dist/TableUI/index.d.ts +12 -0
- package/dist/TableUI/index.js +109 -0
- package/dist/TableUI/index.scss +40 -0
- package/dist/TableUI/material/Button/index.d.ts +4 -0
- package/dist/TableUI/material/Button/index.js +20 -0
- package/dist/TableUI/material/Button/index.scss +35 -0
- package/dist/TableUI/material/HideMultipleLines/index.d.ts +4 -0
- package/dist/TableUI/material/HideMultipleLines/index.js +48 -0
- package/dist/TableUI/material/HideMultipleLines/index.scss +11 -0
- package/dist/TableUI/material/MultiLine/index.d.ts +4 -0
- package/dist/TableUI/material/MultiLine/index.js +23 -0
- package/dist/TableUI/material/MultiLine/index.scss +25 -0
- package/dist/TableUI/material/Operate/index.d.ts +3 -0
- package/dist/TableUI/material/Operate/index.js +43 -0
- package/dist/TableUI/material/Operate/index.scss +25 -0
- package/dist/TableUI/material/Setting/index.d.ts +3 -0
- package/dist/TableUI/material/Setting/index.js +211 -0
- package/dist/TableUI/material/Setting/index.scss +52 -0
- package/dist/TagUI/index.d.ts +17 -0
- package/dist/TagUI/index.js +118 -0
- package/dist/TagUI/index.scss +41 -0
- package/dist/TestUI/index.d.ts +3 -0
- package/dist/TestUI/index.js +5 -0
- package/dist/TestUI/index.scss +0 -0
- package/dist/TextUI/index.d.ts +7 -0
- package/dist/TextUI/index.js +17 -0
- package/dist/TextUI/index.scss +10 -0
- package/dist/Tiga/demo/demoQuick.d.ts +3 -0
- package/dist/Tiga/demo/demoQuick.js +104 -0
- package/dist/Tiga/demo/demoQuickType.d.ts +8 -0
- package/dist/Tiga/demo/demoQuickType.js +94 -0
- package/dist/Tiga/index.d.ts +4 -0
- package/dist/Tiga/index.js +68 -0
- package/dist/Tiga/index.scss +0 -0
- package/dist/Tiga/material/quickType.d.ts +29 -0
- package/dist/Tiga/material/quickType.js +75 -0
- package/dist/UploadUI/index.d.ts +23 -0
- package/dist/UploadUI/index.js +383 -0
- package/dist/UploadUI/index.scss +202 -0
- package/dist/UploadUI/type.d.ts +4 -0
- package/dist/UploadUI/type.js +30 -0
- package/dist/VesselUI/index.d.ts +3 -0
- package/dist/VesselUI/index.js +199 -0
- package/dist/VesselUI/type.d.ts +64 -0
- package/dist/VesselUI/type.js +1 -0
- package/dist/VideoPreviewUI/index.d.ts +11 -0
- package/dist/VideoPreviewUI/index.js +65 -0
- package/dist/VideoPreviewUI/index.scss +32 -0
- package/dist/assets/index.d.ts +1 -0
- package/dist/assets/index.js +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +34 -0
- package/package.json +87 -0
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["className", "mode", "value", "scene", "title", "fileType", "maxSize", "maxCount", "children", "backgroundImage", "onChange", "getOssDataAPI"];
|
|
3
|
+
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); }
|
|
4
|
+
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; }
|
|
5
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
6
|
+
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."); }
|
|
7
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
9
|
+
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); } }
|
|
10
|
+
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); }); }; }
|
|
11
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
15
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
17
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
18
|
+
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); }
|
|
19
|
+
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; }
|
|
20
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
21
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
22
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
23
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
24
|
+
import { DownloadOutlined, RotateLeftOutlined, RotateRightOutlined, SwapOutlined, UndoOutlined, ZoomInOutlined, ZoomOutOutlined } from '@ant-design/icons';
|
|
25
|
+
import { Image, Space, Upload } from 'antd';
|
|
26
|
+
import React, { useEffect, useState } from 'react';
|
|
27
|
+
import { IconUI, MessageUI } from "./..";
|
|
28
|
+
import { file_calculate_md5, getUrlConfig } from 'sic-util';
|
|
29
|
+
import "./index.scss";
|
|
30
|
+
import { DraggerFileItems } from "./type";
|
|
31
|
+
// 文件名转义 后端解析地址需要排除部分符号
|
|
32
|
+
var getCheckFileName = function getCheckFileName(name) {
|
|
33
|
+
var fileName = name.replace(/\s*/g, '').replace(/&/g, '_').replace(/%/g, '').replace(/\.(?=.*\.)/g, '');
|
|
34
|
+
return fileName;
|
|
35
|
+
};
|
|
36
|
+
// 获取图片base64格式
|
|
37
|
+
var getBase64 = function getBase64(file) {
|
|
38
|
+
return new Promise(function (resolve, reject) {
|
|
39
|
+
var reader = new FileReader();
|
|
40
|
+
reader.readAsDataURL(file);
|
|
41
|
+
reader.onload = function () {
|
|
42
|
+
return resolve(reader.result);
|
|
43
|
+
};
|
|
44
|
+
reader.onerror = function (error) {
|
|
45
|
+
return reject(error);
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
var UploadUI = function UploadUI(props) {
|
|
50
|
+
var _DraggerFileItems, _DraggerFileItems2;
|
|
51
|
+
var className = props.className,
|
|
52
|
+
_props$mode = props.mode,
|
|
53
|
+
mode = _props$mode === void 0 ? 1 : _props$mode,
|
|
54
|
+
value = props.value,
|
|
55
|
+
scene = props.scene,
|
|
56
|
+
_props$title = props.title,
|
|
57
|
+
title = _props$title === void 0 ? '点击上传' : _props$title,
|
|
58
|
+
_props$fileType = props.fileType,
|
|
59
|
+
fileType = _props$fileType === void 0 ? 'file' : _props$fileType,
|
|
60
|
+
maxSize = props.maxSize,
|
|
61
|
+
_props$maxCount = props.maxCount,
|
|
62
|
+
maxCount = _props$maxCount === void 0 ? 1 : _props$maxCount,
|
|
63
|
+
children = props.children,
|
|
64
|
+
backgroundImage = props.backgroundImage,
|
|
65
|
+
onChange = props.onChange,
|
|
66
|
+
getOssDataAPI = props.getOssDataAPI,
|
|
67
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
68
|
+
|
|
69
|
+
// 文件列表
|
|
70
|
+
var _useState = useState([]),
|
|
71
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
72
|
+
fileList = _useState2[0],
|
|
73
|
+
setFileList = _useState2[1];
|
|
74
|
+
// 预览窗口
|
|
75
|
+
var _useState3 = useState(false),
|
|
76
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
77
|
+
previewOpen = _useState4[0],
|
|
78
|
+
setPreviewOpen = _useState4[1];
|
|
79
|
+
// 预览图片
|
|
80
|
+
var _useState5 = useState(''),
|
|
81
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
82
|
+
previewImage = _useState6[0],
|
|
83
|
+
setPreviewImage = _useState6[1];
|
|
84
|
+
useEffect(function () {
|
|
85
|
+
var newFileList = (value === null || value === void 0 ? void 0 : value.map(function (item, index) {
|
|
86
|
+
var _getUrlConfig, _item$url;
|
|
87
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
88
|
+
uid: (item === null || item === void 0 ? void 0 : item.uid) || (item === null || item === void 0 ? void 0 : item.md5) || "temp_uid_".concat(Date.now(), "_").concat(index),
|
|
89
|
+
name: (item === null || item === void 0 ? void 0 : item.name) || ((_getUrlConfig = getUrlConfig((_item$url = item === null || item === void 0 ? void 0 : item.url) !== null && _item$url !== void 0 ? _item$url : '')) === null || _getUrlConfig === void 0 ? void 0 : _getUrlConfig.fileName) || "file_".concat(index + 1)
|
|
90
|
+
});
|
|
91
|
+
})) || [];
|
|
92
|
+
setFileList(newFileList);
|
|
93
|
+
}, [value]);
|
|
94
|
+
var beforeUpload = function beforeUpload(file) {
|
|
95
|
+
// 检查文件大小
|
|
96
|
+
var fileSize = ((file === null || file === void 0 ? void 0 : file.size) || 0) / 1024 / 1024;
|
|
97
|
+
if (maxSize && fileSize > maxSize) {
|
|
98
|
+
MessageUI.error("\u6587\u4EF6\u6700\u5927\u652F\u6301".concat(maxSize, "M\uFF0C\u8BF7\u4FEE\u6539\u56FE\u7247\u5927\u5C0F\u540E\u91CD\u8BD5\uFF01"));
|
|
99
|
+
return false;
|
|
100
|
+
} else {
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
// 自定义上传
|
|
106
|
+
var customRequest = /*#__PURE__*/function () {
|
|
107
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
|
|
108
|
+
var md5Hash, _fileName, ossData, _ossData$body, _ossData$body2, _ossData$body3, _ossData$body4, _ossData$body5, _ossData$body6, _ossData$body7, _ossData$body8, _ossData$body9, formData, res, data, newFileList;
|
|
109
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
110
|
+
while (1) switch (_context.prev = _context.next) {
|
|
111
|
+
case 0:
|
|
112
|
+
_context.prev = 0;
|
|
113
|
+
if (!(typeof getOssDataAPI !== 'function')) {
|
|
114
|
+
_context.next = 5;
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
MessageUI.error('获取ossDataAPI未配置!');
|
|
118
|
+
if (options !== null && options !== void 0 && options.onError) options.onError('获取ossDataAPI未配置!', options === null || options === void 0 ? void 0 : options.file);
|
|
119
|
+
return _context.abrupt("return");
|
|
120
|
+
case 5:
|
|
121
|
+
_context.next = 7;
|
|
122
|
+
return file_calculate_md5(options === null || options === void 0 ? void 0 : options.file);
|
|
123
|
+
case 7:
|
|
124
|
+
md5Hash = _context.sent;
|
|
125
|
+
_fileName = getCheckFileName(options === null || options === void 0 ? void 0 : options.file.name); // 获取OSS配置
|
|
126
|
+
_context.next = 11;
|
|
127
|
+
return getOssDataAPI(scene, _fileName, md5Hash);
|
|
128
|
+
case 11:
|
|
129
|
+
ossData = _context.sent;
|
|
130
|
+
if (!((ossData === null || ossData === void 0 ? void 0 : ossData.code) === '0')) {
|
|
131
|
+
_context.next = 37;
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
formData = new FormData();
|
|
135
|
+
formData.append('key', ossData === null || ossData === void 0 || (_ossData$body = ossData.body) === null || _ossData$body === void 0 ? void 0 : _ossData$body.dir);
|
|
136
|
+
formData.append('OSSAccessKeyId', ossData === null || ossData === void 0 || (_ossData$body2 = ossData.body) === null || _ossData$body2 === void 0 ? void 0 : _ossData$body2.accessId);
|
|
137
|
+
formData.append('policy', ossData === null || ossData === void 0 || (_ossData$body3 = ossData.body) === null || _ossData$body3 === void 0 ? void 0 : _ossData$body3.policy);
|
|
138
|
+
formData.append('Signature', ossData === null || ossData === void 0 || (_ossData$body4 = ossData.body) === null || _ossData$body4 === void 0 ? void 0 : _ossData$body4.signature);
|
|
139
|
+
formData.append('callback', ossData === null || ossData === void 0 || (_ossData$body5 = ossData.body) === null || _ossData$body5 === void 0 ? void 0 : _ossData$body5.callBack);
|
|
140
|
+
formData.append('expire', ossData === null || ossData === void 0 || (_ossData$body6 = ossData.body) === null || _ossData$body6 === void 0 ? void 0 : _ossData$body6.expire);
|
|
141
|
+
formData.append('accessId', ossData === null || ossData === void 0 || (_ossData$body7 = ossData.body) === null || _ossData$body7 === void 0 ? void 0 : _ossData$body7.accessId);
|
|
142
|
+
formData.append('dir', ossData === null || ossData === void 0 || (_ossData$body8 = ossData.body) === null || _ossData$body8 === void 0 ? void 0 : _ossData$body8.dir);
|
|
143
|
+
formData.append('file', options === null || options === void 0 ? void 0 : options.file);
|
|
144
|
+
_context.next = 25;
|
|
145
|
+
return fetch(ossData === null || ossData === void 0 || (_ossData$body9 = ossData.body) === null || _ossData$body9 === void 0 ? void 0 : _ossData$body9.host, {
|
|
146
|
+
method: 'POST',
|
|
147
|
+
body: formData
|
|
148
|
+
});
|
|
149
|
+
case 25:
|
|
150
|
+
res = _context.sent;
|
|
151
|
+
if (!(res !== null && res !== void 0 && res.ok)) {
|
|
152
|
+
_context.next = 33;
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
_context.next = 29;
|
|
156
|
+
return res.json();
|
|
157
|
+
case 29:
|
|
158
|
+
data = _context.sent;
|
|
159
|
+
if ((data === null || data === void 0 ? void 0 : data.code) === '0') {
|
|
160
|
+
if (options !== null && options !== void 0 && options.onSuccess) options.onSuccess(data === null || data === void 0 ? void 0 : data.body, options === null || options === void 0 ? void 0 : options.file);
|
|
161
|
+
newFileList = [].concat(_toConsumableArray(fileList), [_objectSpread(_objectSpread({}, data === null || data === void 0 ? void 0 : data.body), {}, {
|
|
162
|
+
name: _fileName
|
|
163
|
+
})]).slice(-maxCount);
|
|
164
|
+
setFileList(newFileList);
|
|
165
|
+
if (onChange) onChange(newFileList);
|
|
166
|
+
} else {
|
|
167
|
+
if (options !== null && options !== void 0 && options.onError) options.onError(data === null || data === void 0 ? void 0 : data.msg, options === null || options === void 0 ? void 0 : options.file);
|
|
168
|
+
MessageUI.error(data === null || data === void 0 ? void 0 : data.msg);
|
|
169
|
+
}
|
|
170
|
+
_context.next = 35;
|
|
171
|
+
break;
|
|
172
|
+
case 33:
|
|
173
|
+
if (options !== null && options !== void 0 && options.onError) options.onError(res === null || res === void 0 ? void 0 : res.statusText, options === null || options === void 0 ? void 0 : options.file);
|
|
174
|
+
MessageUI.error(res === null || res === void 0 ? void 0 : res.statusText);
|
|
175
|
+
case 35:
|
|
176
|
+
_context.next = 39;
|
|
177
|
+
break;
|
|
178
|
+
case 37:
|
|
179
|
+
if (options !== null && options !== void 0 && options.onError) options.onError(ossData === null || ossData === void 0 ? void 0 : ossData.msg, options === null || options === void 0 ? void 0 : options.file);
|
|
180
|
+
MessageUI.error(ossData === null || ossData === void 0 ? void 0 : ossData.msg);
|
|
181
|
+
case 39:
|
|
182
|
+
_context.next = 44;
|
|
183
|
+
break;
|
|
184
|
+
case 41:
|
|
185
|
+
_context.prev = 41;
|
|
186
|
+
_context.t0 = _context["catch"](0);
|
|
187
|
+
MessageUI.error('上传失败,请稍后重试!');
|
|
188
|
+
case 44:
|
|
189
|
+
case "end":
|
|
190
|
+
return _context.stop();
|
|
191
|
+
}
|
|
192
|
+
}, _callee, null, [[0, 41]]);
|
|
193
|
+
}));
|
|
194
|
+
return function customRequest(_x) {
|
|
195
|
+
return _ref.apply(this, arguments);
|
|
196
|
+
};
|
|
197
|
+
}();
|
|
198
|
+
var onRemove = function onRemove(file) {
|
|
199
|
+
var newFileList = fileList === null || fileList === void 0 ? void 0 : fileList.filter(function (item) {
|
|
200
|
+
return (item === null || item === void 0 ? void 0 : item.uid) !== (file === null || file === void 0 ? void 0 : file.uid);
|
|
201
|
+
});
|
|
202
|
+
if (onChange) onChange(newFileList);
|
|
203
|
+
setFileList(newFileList);
|
|
204
|
+
};
|
|
205
|
+
var onPreview = /*#__PURE__*/function () {
|
|
206
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(file) {
|
|
207
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
208
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
209
|
+
case 0:
|
|
210
|
+
if (!(!file.url && !file.preview)) {
|
|
211
|
+
_context2.next = 4;
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
_context2.next = 3;
|
|
215
|
+
return getBase64(file.originFileObj);
|
|
216
|
+
case 3:
|
|
217
|
+
file.preview = _context2.sent;
|
|
218
|
+
case 4:
|
|
219
|
+
setPreviewImage(file.url || file.preview);
|
|
220
|
+
setPreviewOpen(true);
|
|
221
|
+
case 6:
|
|
222
|
+
case "end":
|
|
223
|
+
return _context2.stop();
|
|
224
|
+
}
|
|
225
|
+
}, _callee2);
|
|
226
|
+
}));
|
|
227
|
+
return function onPreview(_x2) {
|
|
228
|
+
return _ref2.apply(this, arguments);
|
|
229
|
+
};
|
|
230
|
+
}();
|
|
231
|
+
var onDownload = function onDownload() {
|
|
232
|
+
fetch(previewImage).then(function (response) {
|
|
233
|
+
return response.blob();
|
|
234
|
+
}).then(function (blob) {
|
|
235
|
+
var url = URL.createObjectURL(new Blob([blob]));
|
|
236
|
+
var link = document.createElement('a');
|
|
237
|
+
link.href = url;
|
|
238
|
+
link.download = 'image.png';
|
|
239
|
+
document.body.appendChild(link);
|
|
240
|
+
link.click();
|
|
241
|
+
URL.revokeObjectURL(url);
|
|
242
|
+
link.remove();
|
|
243
|
+
});
|
|
244
|
+
};
|
|
245
|
+
var uploadProps = _objectSpread({
|
|
246
|
+
fileList: fileList,
|
|
247
|
+
maxCount: maxCount,
|
|
248
|
+
beforeUpload: beforeUpload,
|
|
249
|
+
customRequest: customRequest,
|
|
250
|
+
onRemove: onRemove
|
|
251
|
+
}, otherProps);
|
|
252
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, mode === 1 && /*#__PURE__*/React.createElement(Upload, _extends({
|
|
253
|
+
className: "uploadUI uploadUI-mode1 ".concat(className !== null && className !== void 0 ? className : ''),
|
|
254
|
+
showUploadList: false
|
|
255
|
+
}, uploadProps), children), mode === 2 && /*#__PURE__*/React.createElement(Upload, _extends({
|
|
256
|
+
className: "uploadUI uploadUI-mode2 ".concat(className !== null && className !== void 0 ? className : ''),
|
|
257
|
+
listType: "picture-card",
|
|
258
|
+
onPreview: onPreview
|
|
259
|
+
}, uploadProps), (fileList === null || fileList === void 0 ? void 0 : fileList.length) >= maxCount ? null : /*#__PURE__*/React.createElement("div", {
|
|
260
|
+
className: "uploadUI-mode2-content",
|
|
261
|
+
style: {
|
|
262
|
+
backgroundImage: "url(".concat(backgroundImage, ")")
|
|
263
|
+
}
|
|
264
|
+
}, /*#__PURE__*/React.createElement(IconUI, {
|
|
265
|
+
name: "Upload",
|
|
266
|
+
size: "24"
|
|
267
|
+
}), title)), mode === 3 && /*#__PURE__*/React.createElement(Upload.Dragger, _extends({
|
|
268
|
+
className: "uploadUI uploadUI-mode3 ".concat(className !== null && className !== void 0 ? className : '')
|
|
269
|
+
}, uploadProps), /*#__PURE__*/React.createElement("div", {
|
|
270
|
+
className: "uploadUI-mode3-content"
|
|
271
|
+
}, /*#__PURE__*/React.createElement(IconUI, {
|
|
272
|
+
name: (_DraggerFileItems = DraggerFileItems(fileType)) === null || _DraggerFileItems === void 0 ? void 0 : _DraggerFileItems.icon3,
|
|
273
|
+
strokeWidth: 2
|
|
274
|
+
}), (_DraggerFileItems2 = DraggerFileItems(fileType)) === null || _DraggerFileItems2 === void 0 ? void 0 : _DraggerFileItems2.text3)), mode === 4 && /*#__PURE__*/React.createElement(Upload, _extends({
|
|
275
|
+
className: "uploadUI uploadUI-mode4 ".concat(className !== null && className !== void 0 ? className : ''),
|
|
276
|
+
listType: "picture-card",
|
|
277
|
+
onPreview: onPreview
|
|
278
|
+
}, uploadProps), (fileList === null || fileList === void 0 ? void 0 : fileList.length) >= maxCount ? null : /*#__PURE__*/React.createElement("div", {
|
|
279
|
+
className: "uploadUI-mode4-content"
|
|
280
|
+
}, /*#__PURE__*/React.createElement(IconUI, {
|
|
281
|
+
name: "Upload",
|
|
282
|
+
size: "20"
|
|
283
|
+
}), /*#__PURE__*/React.createElement("div", null, title))), mode === 5 && /*#__PURE__*/React.createElement(Upload, _extends({
|
|
284
|
+
className: "uploadUI uploadUI-mode5 ".concat(className !== null && className !== void 0 ? className : ''),
|
|
285
|
+
listType: "picture-card",
|
|
286
|
+
onPreview: onPreview
|
|
287
|
+
}, uploadProps), (fileList === null || fileList === void 0 ? void 0 : fileList.length) >= maxCount ? null : /*#__PURE__*/React.createElement("div", {
|
|
288
|
+
className: "uploadUI-mode5-content"
|
|
289
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
290
|
+
src: backgroundImage,
|
|
291
|
+
height: 50,
|
|
292
|
+
preview: false
|
|
293
|
+
}), /*#__PURE__*/React.createElement("div", null, title))), mode === 6 && /*#__PURE__*/React.createElement(Upload, _extends({
|
|
294
|
+
className: "uploadUI uploadUI-mode6 ".concat(className !== null && className !== void 0 ? className : ''),
|
|
295
|
+
showUploadList: false
|
|
296
|
+
}, uploadProps), /*#__PURE__*/React.createElement("div", {
|
|
297
|
+
className: "uploadUI-mode6-content"
|
|
298
|
+
}, (fileList === null || fileList === void 0 ? void 0 : fileList.length) < maxCount && /*#__PURE__*/React.createElement("div", {
|
|
299
|
+
className: "mode6BeforeUpload"
|
|
300
|
+
}, /*#__PURE__*/React.createElement(IconUI, {
|
|
301
|
+
name: "UploadPdf"
|
|
302
|
+
}), /*#__PURE__*/React.createElement("div", null, title)), (fileList === null || fileList === void 0 ? void 0 : fileList.length) > 0 && /*#__PURE__*/React.createElement("div", {
|
|
303
|
+
className: "mode6UploadList"
|
|
304
|
+
}, fileList.map(function (item, index) {
|
|
305
|
+
var _getUrlConfig2;
|
|
306
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
307
|
+
className: "mode6UploadList-item",
|
|
308
|
+
key: index
|
|
309
|
+
}, /*#__PURE__*/React.createElement(IconUI, {
|
|
310
|
+
name: "UploadPdf"
|
|
311
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
312
|
+
className: "mode6UploadList-item-fileName"
|
|
313
|
+
}, (_getUrlConfig2 = getUrlConfig(item === null || item === void 0 ? void 0 : item.url)) === null || _getUrlConfig2 === void 0 ? void 0 : _getUrlConfig2.fileName), /*#__PURE__*/React.createElement("div", {
|
|
314
|
+
className: "mode6UploadList-item-mask",
|
|
315
|
+
onClick: function onClick(e) {
|
|
316
|
+
return e.stopPropagation();
|
|
317
|
+
}
|
|
318
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
319
|
+
className: "mask-delete",
|
|
320
|
+
onClick: function onClick() {
|
|
321
|
+
return onRemove(item);
|
|
322
|
+
}
|
|
323
|
+
}, /*#__PURE__*/React.createElement(IconUI, {
|
|
324
|
+
name: "Delete"
|
|
325
|
+
}), "\u5220\u9664"), /*#__PURE__*/React.createElement("div", {
|
|
326
|
+
className: "mask-check",
|
|
327
|
+
onClick: function onClick() {
|
|
328
|
+
return window.open(item === null || item === void 0 ? void 0 : item.url);
|
|
329
|
+
}
|
|
330
|
+
}, /*#__PURE__*/React.createElement(IconUI, {
|
|
331
|
+
name: "PreviewOpen"
|
|
332
|
+
}), "\u67E5\u770B")));
|
|
333
|
+
})))), previewImage && /*#__PURE__*/React.createElement(Image, {
|
|
334
|
+
wrapperStyle: {
|
|
335
|
+
display: 'none'
|
|
336
|
+
},
|
|
337
|
+
preview: {
|
|
338
|
+
visible: previewOpen,
|
|
339
|
+
toolbarRender: function toolbarRender(_, _ref3) {
|
|
340
|
+
var scale = _ref3.transform.scale,
|
|
341
|
+
_ref3$actions = _ref3.actions,
|
|
342
|
+
onFlipY = _ref3$actions.onFlipY,
|
|
343
|
+
onFlipX = _ref3$actions.onFlipX,
|
|
344
|
+
onRotateLeft = _ref3$actions.onRotateLeft,
|
|
345
|
+
onRotateRight = _ref3$actions.onRotateRight,
|
|
346
|
+
onZoomOut = _ref3$actions.onZoomOut,
|
|
347
|
+
onZoomIn = _ref3$actions.onZoomIn,
|
|
348
|
+
onReset = _ref3$actions.onReset;
|
|
349
|
+
return /*#__PURE__*/React.createElement(Space, {
|
|
350
|
+
size: 12,
|
|
351
|
+
className: "uploadUI-previewImageToolbar"
|
|
352
|
+
}, /*#__PURE__*/React.createElement(DownloadOutlined, {
|
|
353
|
+
onClick: onDownload
|
|
354
|
+
}), /*#__PURE__*/React.createElement(SwapOutlined, {
|
|
355
|
+
rotate: 90,
|
|
356
|
+
onClick: onFlipY
|
|
357
|
+
}), /*#__PURE__*/React.createElement(SwapOutlined, {
|
|
358
|
+
onClick: onFlipX
|
|
359
|
+
}), /*#__PURE__*/React.createElement(RotateLeftOutlined, {
|
|
360
|
+
onClick: onRotateLeft
|
|
361
|
+
}), /*#__PURE__*/React.createElement(RotateRightOutlined, {
|
|
362
|
+
onClick: onRotateRight
|
|
363
|
+
}), /*#__PURE__*/React.createElement(ZoomOutOutlined, {
|
|
364
|
+
disabled: scale === 1,
|
|
365
|
+
onClick: onZoomOut
|
|
366
|
+
}), /*#__PURE__*/React.createElement(ZoomInOutlined, {
|
|
367
|
+
disabled: scale === 50,
|
|
368
|
+
onClick: onZoomIn
|
|
369
|
+
}), /*#__PURE__*/React.createElement(UndoOutlined, {
|
|
370
|
+
onClick: onReset
|
|
371
|
+
}));
|
|
372
|
+
},
|
|
373
|
+
onVisibleChange: function onVisibleChange(visible) {
|
|
374
|
+
return setPreviewOpen(visible);
|
|
375
|
+
},
|
|
376
|
+
afterOpenChange: function afterOpenChange(visible) {
|
|
377
|
+
return !visible && setPreviewImage('');
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
src: previewImage
|
|
381
|
+
}));
|
|
382
|
+
};
|
|
383
|
+
export default UploadUI;
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
.uploadUI,
|
|
2
|
+
.ant-upload {
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
}
|
|
6
|
+
.uploadUI.uploadUI-mode2 {
|
|
7
|
+
.ant-upload.ant-upload-select,
|
|
8
|
+
.ant-upload-list.ant-upload-list-picture-card .ant-upload-list-item-container {
|
|
9
|
+
width: 240px;
|
|
10
|
+
height: 160px;
|
|
11
|
+
}
|
|
12
|
+
.uploadUI-mode2-content {
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: 100%;
|
|
15
|
+
color: #fff;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
gap: 4px;
|
|
21
|
+
border-radius: 8px;
|
|
22
|
+
background-size: 100% 100%;
|
|
23
|
+
background-repeat: no-repeat;
|
|
24
|
+
transition: color 0.3s;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
.uploadUI.uploadUI-mode3 {
|
|
28
|
+
.uploadUI-mode3-content {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
gap: 12px;
|
|
32
|
+
transition: color 0.3s;
|
|
33
|
+
.i-icon {
|
|
34
|
+
font-size: 48px;
|
|
35
|
+
color: var(--themeColor);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.uploadUI.uploadUI-mode4 {
|
|
41
|
+
.uploadUI-mode4-content {
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
align-items: center;
|
|
45
|
+
gap: 4px;
|
|
46
|
+
transition: color 0.3s;
|
|
47
|
+
.i-icon {
|
|
48
|
+
font-size: 48px;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
.uploadUI.uploadUI-mode5 {
|
|
53
|
+
.uploadUI-mode5-content {
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
align-items: center;
|
|
57
|
+
gap: 4px;
|
|
58
|
+
transition: color 0.3s;
|
|
59
|
+
}
|
|
60
|
+
.ant-upload.ant-upload-select {
|
|
61
|
+
background: #fff;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.uploadUI.uploadUI-mode6 {
|
|
66
|
+
.uploadUI-mode6-content {
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-direction: column;
|
|
69
|
+
gap: 4px;
|
|
70
|
+
.mode6BeforeUpload {
|
|
71
|
+
box-sizing: border-box;
|
|
72
|
+
padding: 6px 12px;
|
|
73
|
+
width: 100%;
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
justify-content: center;
|
|
77
|
+
gap: 4px;
|
|
78
|
+
border-radius: 4px;
|
|
79
|
+
border: 1px solid var(--themeColor2);
|
|
80
|
+
background: var(--themeColor1);
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
}
|
|
83
|
+
.mode6BeforeUpload:hover {
|
|
84
|
+
border: 1px dashed var(--themeColor);
|
|
85
|
+
}
|
|
86
|
+
.mode6UploadList {
|
|
87
|
+
display: flex;
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
gap: 4px;
|
|
90
|
+
&-item {
|
|
91
|
+
box-sizing: border-box;
|
|
92
|
+
padding: 6px 12px;
|
|
93
|
+
width: 100%;
|
|
94
|
+
display: flex;
|
|
95
|
+
align-items: center;
|
|
96
|
+
justify-content: center;
|
|
97
|
+
border-radius: 4px;
|
|
98
|
+
border: 1px solid #f5f5f5;
|
|
99
|
+
background: #f5f5f5;
|
|
100
|
+
position: relative;
|
|
101
|
+
&-fileName {
|
|
102
|
+
max-width: calc(100% - 20px);
|
|
103
|
+
margin-left: 4px;
|
|
104
|
+
white-space: nowrap;
|
|
105
|
+
overflow: hidden;
|
|
106
|
+
text-overflow: ellipsis;
|
|
107
|
+
}
|
|
108
|
+
&-mask {
|
|
109
|
+
position: absolute;
|
|
110
|
+
width: 100%;
|
|
111
|
+
height: 100%;
|
|
112
|
+
color: #fff;
|
|
113
|
+
display: none;
|
|
114
|
+
align-items: center;
|
|
115
|
+
justify-content: center;
|
|
116
|
+
border-radius: 4px;
|
|
117
|
+
background: rgba(126, 126, 126, 0.1);
|
|
118
|
+
backdrop-filter: blur(6px);
|
|
119
|
+
|
|
120
|
+
.i-icon {
|
|
121
|
+
margin-right: 4px;
|
|
122
|
+
}
|
|
123
|
+
.mask-delete:hover {
|
|
124
|
+
color: var(--red);
|
|
125
|
+
cursor: pointer;
|
|
126
|
+
}
|
|
127
|
+
.mask-check:hover {
|
|
128
|
+
color: #2e64fa;
|
|
129
|
+
cursor: pointer;
|
|
130
|
+
}
|
|
131
|
+
.mask-delete {
|
|
132
|
+
margin-right: 12px;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
&-item:hover {
|
|
137
|
+
.mode6UploadList-item-mask {
|
|
138
|
+
display: flex;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
.uploadUI-previewImageToolbar {
|
|
145
|
+
position: fixed;
|
|
146
|
+
bottom: 32px;
|
|
147
|
+
left: 50%;
|
|
148
|
+
padding: 0px 24px;
|
|
149
|
+
color: #fff;
|
|
150
|
+
font-size: 20px;
|
|
151
|
+
background-color: rgba(0, 0, 0, 0.1);
|
|
152
|
+
border-radius: 100px;
|
|
153
|
+
transform: translateX(-50%);
|
|
154
|
+
.anticon {
|
|
155
|
+
padding: 12px;
|
|
156
|
+
cursor: pointer;
|
|
157
|
+
}
|
|
158
|
+
.anticon[disabled] {
|
|
159
|
+
cursor: not-allowed;
|
|
160
|
+
opacity: 0.3;
|
|
161
|
+
}
|
|
162
|
+
.anticon:hover {
|
|
163
|
+
opacity: 0.3;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
//统一处理 hover 状态的样式
|
|
167
|
+
.ant-upload:hover {
|
|
168
|
+
.uploadUI-mode2-content,
|
|
169
|
+
.uploadUI-mode3-content,
|
|
170
|
+
.uploadUI-mode4-content,
|
|
171
|
+
.uploadUI-mode5-content {
|
|
172
|
+
color: var(--themeColor);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
//统一处理 禁用状态的样式
|
|
176
|
+
.ant-upload-disabled {
|
|
177
|
+
.uploadUI-mode3-content {
|
|
178
|
+
.i-icon {
|
|
179
|
+
color: #d9d9d9;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
.uploadUI-mode6-content {
|
|
183
|
+
svg {
|
|
184
|
+
opacity: 0.3;
|
|
185
|
+
}
|
|
186
|
+
.mode6BeforeUpload {
|
|
187
|
+
background-color: #f5f5f5;
|
|
188
|
+
border: 1px solid #f5f5f5;
|
|
189
|
+
cursor: not-allowed;
|
|
190
|
+
}
|
|
191
|
+
.mode6BeforeUpload:hover {
|
|
192
|
+
border: 1px solid #f5f5f5;
|
|
193
|
+
}
|
|
194
|
+
.mode6UploadList-item {
|
|
195
|
+
background-color: #f5f5f5;
|
|
196
|
+
border: 1px solid #f5f5f5;
|
|
197
|
+
.mask-delete {
|
|
198
|
+
display: none;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//不同类型上传内容
|
|
2
|
+
export var DraggerFileItems = function DraggerFileItems(type) {
|
|
3
|
+
switch (type) {
|
|
4
|
+
case 'file':
|
|
5
|
+
return {
|
|
6
|
+
icon3: 'FileAddition',
|
|
7
|
+
text3: '点击或拖动文件至此区域即可上传'
|
|
8
|
+
};
|
|
9
|
+
case 'pdf':
|
|
10
|
+
return {
|
|
11
|
+
icon3: 'FilePdf',
|
|
12
|
+
text3: '点击或拖动PDF文件至此区域即可上传'
|
|
13
|
+
};
|
|
14
|
+
case 'image':
|
|
15
|
+
return {
|
|
16
|
+
icon3: 'FileAddition',
|
|
17
|
+
text3: '点击或拖动文件至此区域即可上传'
|
|
18
|
+
};
|
|
19
|
+
case 'excel':
|
|
20
|
+
return {
|
|
21
|
+
icon3: 'Excel',
|
|
22
|
+
text3: '点击或拖动Excel(*xlsx格式)文件至此区域即可上传'
|
|
23
|
+
};
|
|
24
|
+
default:
|
|
25
|
+
return {
|
|
26
|
+
icon3: '',
|
|
27
|
+
text3: ''
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
};
|