xh-lab-rc 0.18.48 → 0.18.50

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.
@@ -1,13 +1,6 @@
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
- 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; }
3
- 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); } }
4
- 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); }); }; }
5
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
- 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."); }
7
- 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); }
8
- 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; }
9
- 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; } }
10
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
11
4
  /*
12
5
  * @Author: xqy
13
6
  * @Date: 2024-06-28 14:07:14
@@ -1,22 +1,9 @@
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
- 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; }
3
- 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); } }
4
- 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); }); }; }
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 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; }
10
- 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; }
11
- 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; }
12
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
13
- 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); }
14
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
15
- 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."); }
16
- 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); }
17
- 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; }
18
- 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; } }
19
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1
+ import _typeof from "@babel/runtime/helpers/esm/typeof";
2
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
3
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
4
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
5
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
6
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
20
7
  /*
21
8
  * @Author: xqy
22
9
  * @Date: 2024-04-23 13:43:55
@@ -0,0 +1,23 @@
1
+ import type { FC } from 'react';
2
+ import './style.less';
3
+ interface IndexProps {
4
+ imgList: any;
5
+ curImgIndex?: number;
6
+ fileField?: FileField;
7
+ isCanvasImg?: boolean;
8
+ getRotateImg?: (file?: any) => void;
9
+ styles?: object;
10
+ contDivStyle?: object;
11
+ footerStyle?: object;
12
+ ref?: any;
13
+ baseUrl?: string;
14
+ pdfjsSrc?: string;
15
+ isBtnSwitch?: boolean;
16
+ }
17
+ interface FileField {
18
+ filePath?: string;
19
+ fileName?: string;
20
+ [key: string]: any;
21
+ }
22
+ declare const LabAttachmentPreview: FC<IndexProps>;
23
+ export default LabAttachmentPreview;
@@ -0,0 +1,484 @@
1
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
4
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
5
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
6
+ /*
7
+ * @Author: xqy
8
+ * @Date: 2026-03-16 09:43:38
9
+ * @LastEditors: xqy
10
+ * @LastEditTime: 2026-03-19 14:02:09
11
+ * @Description: 横向附件预览(支持pdf切换预览)
12
+ */
13
+
14
+ import { Iconfont } from "../components";
15
+ import { downloadFileWithBlob, labCanvasToFile } from "../utils/utils";
16
+ import { FileTextOutlined, LeftOutlined, RightOutlined, RotateLeftOutlined, RotateRightOutlined, ZoomInOutlined, ZoomOutOutlined } from '@ant-design/icons';
17
+ import { Splitter } from 'antd';
18
+ import axios from 'axios';
19
+ import cn from 'classnames';
20
+ import React, { forwardRef, useEffect, useRef, useState } from 'react';
21
+ import { LabPdf } from "./..";
22
+ import "./style.less";
23
+ var LabAttachmentPreview = /*#__PURE__*/forwardRef(function (_ref, ref) {
24
+ var _list$curIndex5, _list$curIndex6, _list$curIndex7;
25
+ var imgList = _ref.imgList,
26
+ _ref$curImgIndex = _ref.curImgIndex,
27
+ curImgIndex = _ref$curImgIndex === void 0 ? 0 : _ref$curImgIndex,
28
+ _ref$fileField = _ref.fileField,
29
+ fileField = _ref$fileField === void 0 ? {
30
+ filePath: 'filePath',
31
+ fileName: 'fileName',
32
+ fileType: 'fileType'
33
+ } : _ref$fileField,
34
+ _ref$isCanvasImg = _ref.isCanvasImg,
35
+ isCanvasImg = _ref$isCanvasImg === void 0 ? false : _ref$isCanvasImg,
36
+ getRotateImg = _ref.getRotateImg,
37
+ styles = _ref.styles,
38
+ contDivStyle = _ref.contDivStyle,
39
+ footerStyle = _ref.footerStyle,
40
+ _ref$baseUrl = _ref.baseUrl,
41
+ baseUrl = _ref$baseUrl === void 0 ? '' : _ref$baseUrl,
42
+ _ref$pdfjsSrc = _ref.pdfjsSrc,
43
+ pdfjsSrc = _ref$pdfjsSrc === void 0 ? "".concat(baseUrl, "/statics/pdfjs/web/viewer.html") : _ref$pdfjsSrc,
44
+ _ref$isBtnSwitch = _ref.isBtnSwitch,
45
+ isBtnSwitch = _ref$isBtnSwitch === void 0 ? false : _ref$isBtnSwitch;
46
+ var _useState = useState(curImgIndex),
47
+ _useState2 = _slicedToArray(_useState, 2),
48
+ curIndex = _useState2[0],
49
+ setCurIndex = _useState2[1];
50
+ var _useState3 = useState(1),
51
+ _useState4 = _slicedToArray(_useState3, 2),
52
+ scale = _useState4[0],
53
+ setScale = _useState4[1]; //初始缩放比例
54
+ var _useState5 = useState([]),
55
+ _useState6 = _slicedToArray(_useState5, 2),
56
+ list = _useState6[0],
57
+ setList = _useState6[1]; //图片的数组
58
+ var _useState7 = useState(0),
59
+ _useState8 = _slicedToArray(_useState7, 2),
60
+ rotatinNum = _useState8[0],
61
+ setRotatinNum = _useState8[1]; //旋转次数
62
+ var canvasRef = useRef(null);
63
+ var _useState9 = useState(false),
64
+ _useState10 = _slicedToArray(_useState9, 2),
65
+ dragging = _useState10[0],
66
+ setDragging = _useState10[1]; //拖拽状态
67
+ var _useState11 = useState({
68
+ left: 'auto',
69
+ top: 'auto'
70
+ }),
71
+ _useState12 = _slicedToArray(_useState11, 2),
72
+ position = _useState12[0],
73
+ setPosition = _useState12[1]; // 用于存储图片位置的状态
74
+ var _useState13 = useState({
75
+ left: 0,
76
+ top: 0
77
+ }),
78
+ _useState14 = _slicedToArray(_useState13, 2),
79
+ initialPosition = _useState14[0],
80
+ setInitialPosition = _useState14[1]; //(被点击元素相对于页面偏移量))
81
+ var _useState15 = useState({
82
+ x: 0,
83
+ y: 0
84
+ }),
85
+ _useState16 = _slicedToArray(_useState15, 2),
86
+ initialMousePosition = _useState16[0],
87
+ setInitialMousePosition = _useState16[1]; //鼠标按下的坐标
88
+
89
+ //底部操作按钮
90
+ var _useState17 = useState([{
91
+ type: 'enlarge',
92
+ typeName: '放大(+)',
93
+ icon: /*#__PURE__*/React.createElement(ZoomInOutlined, {
94
+ className: "footer-icon"
95
+ }),
96
+ disabled: false,
97
+ disableName: '已是最大比例'
98
+ }, {
99
+ type: 'narrow',
100
+ typeName: '缩小(-)',
101
+ icon: /*#__PURE__*/React.createElement(ZoomOutOutlined, {
102
+ className: "footer-icon"
103
+ }),
104
+ disabled: false,
105
+ disableName: '已是最小比例'
106
+ }, {
107
+ type: 'turnLeft',
108
+ typeName: '向左旋转',
109
+ icon: /*#__PURE__*/React.createElement(RotateLeftOutlined, {
110
+ className: "footer-icon"
111
+ }),
112
+ disabled: false
113
+ }, {
114
+ type: 'turnRight',
115
+ typeName: '向右旋转',
116
+ icon: /*#__PURE__*/React.createElement(RotateRightOutlined, {
117
+ className: "footer-icon"
118
+ }),
119
+ disabled: false
120
+ }, {
121
+ type: 'downLoad',
122
+ typeName: '下载',
123
+ icon: /*#__PURE__*/React.createElement(Iconfont, {
124
+ type: "icon-xiazai1",
125
+ style: {
126
+ fontSize: '16px',
127
+ color: '#FFFFFF',
128
+ cursor: 'pointer'
129
+ }
130
+ }),
131
+ disabled: false
132
+ }]),
133
+ _useState18 = _slicedToArray(_useState17, 2),
134
+ footerBtns = _useState18[0],
135
+ setFooterBtns = _useState18[1];
136
+
137
+ /**鼠标滚轮实现图片的放大缩小 */
138
+ var handleWheel = function handleWheel(event) {
139
+ // event.preventDefault() //阻止默认的滚动行为,防止浏览器默认进行页面滚动
140
+ var scaleChange = event.deltaY > 0 ? -0.1 : 0.1;
141
+ //计算缩放比例,限制缩放比例在(0.5到4之间),防止过大或过小
142
+ var newScale = Math.min(Math.max(0.2, scale + scaleChange), 4);
143
+ //更新缩放的那一张比例
144
+ var updatedList = _toConsumableArray(list);
145
+ updatedList[curIndex].scale = newScale;
146
+ setList(updatedList);
147
+ setScale(newScale);
148
+ };
149
+
150
+ //图片放大缩小
151
+ var toZoomInOut = function toZoomInOut(type) {
152
+ var ratios = type === 'enlarge' ? scale + 0.2 : scale - 0.2; //比例
153
+ var newScale = Math.min(Math.max(0.2, ratios), 4);
154
+ var updatedList = _toConsumableArray(list);
155
+ updatedList[curIndex].scale = newScale;
156
+ setList(updatedList);
157
+ setScale(newScale);
158
+ };
159
+
160
+ //左右旋转图片
161
+ var toTurnHandle = /*#__PURE__*/function () {
162
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(direction) {
163
+ var newRotateNum, updatedList, newFiles;
164
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
165
+ while (1) switch (_context.prev = _context.next) {
166
+ case 0:
167
+ newRotateNum = rotatinNum;
168
+ if (direction === 'l') {
169
+ newRotateNum = rotatinNum - 1;
170
+ } else {
171
+ newRotateNum = rotatinNum + 1;
172
+ }
173
+ //更新缩放的那一张比例
174
+ updatedList = _toConsumableArray(list);
175
+ updatedList[curIndex].roteAngle = newRotateNum * 90;
176
+ //旋转之后,利用canvas生成新的二进制图片
177
+ if (!isCanvasImg) {
178
+ _context.next = 18;
179
+ break;
180
+ }
181
+ //生成新图,在新图的基础上只需要旋转90
182
+ updatedList[curIndex].roteAngle = direction === 'l' ? -90 : 90;
183
+ _context.prev = 6;
184
+ _context.next = 9;
185
+ return labCanvasToFile(canvasRef, updatedList[curIndex]);
186
+ case 9:
187
+ newFiles = _context.sent;
188
+ updatedList[curIndex].filePath = URL.createObjectURL(newFiles);
189
+ updatedList[curIndex].blobFilePath = newFiles;
190
+ getRotateImg === null || getRotateImg === void 0 || getRotateImg(_objectSpread(_objectSpread({}, updatedList[curIndex]), {}, {
191
+ blobFilePath: newFiles
192
+ }));
193
+ _context.next = 18;
194
+ break;
195
+ case 15:
196
+ _context.prev = 15;
197
+ _context.t0 = _context["catch"](6);
198
+ console.error('图片旋转失败:', _context.t0);
199
+ case 18:
200
+ setRotatinNum(newRotateNum);
201
+ setList(updatedList);
202
+ case 20:
203
+ case "end":
204
+ return _context.stop();
205
+ }
206
+ }, _callee, null, [[6, 15]]);
207
+ }));
208
+ return function toTurnHandle(_x) {
209
+ return _ref2.apply(this, arguments);
210
+ };
211
+ }();
212
+
213
+ //底部按钮点击事件(enlarge - 放大,narrow - 缩小,turnLeft - 左转, turnRight - 右转)
214
+ var clickHandle = /*#__PURE__*/function () {
215
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(type) {
216
+ var _list$curIndex, _list$curIndex2, _list$curIndex3;
217
+ var res;
218
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
219
+ while (1) switch (_context2.prev = _context2.next) {
220
+ case 0:
221
+ _context2.t0 = type;
222
+ _context2.next = _context2.t0 === 'enlarge' ? 3 : _context2.t0 === 'narrow' ? 5 : _context2.t0 === 'turnLeft' ? 7 : _context2.t0 === 'turnRight' ? 9 : _context2.t0 === 'downLoad' ? 11 : 16;
223
+ break;
224
+ case 3:
225
+ toZoomInOut('enlarge');
226
+ return _context2.abrupt("break", 17);
227
+ case 5:
228
+ toZoomInOut('narrow');
229
+ return _context2.abrupt("break", 17);
230
+ case 7:
231
+ toTurnHandle('l');
232
+ return _context2.abrupt("break", 17);
233
+ case 9:
234
+ toTurnHandle('r');
235
+ return _context2.abrupt("break", 17);
236
+ case 11:
237
+ _context2.next = 13;
238
+ return axios.get(((_list$curIndex = list[curIndex]) === null || _list$curIndex === void 0 ? void 0 : _list$curIndex.filePath) + '', {
239
+ responseType: 'blob'
240
+ });
241
+ case 13:
242
+ res = _context2.sent;
243
+ downloadFileWithBlob({
244
+ name: ((_list$curIndex2 = list[curIndex]) === null || _list$curIndex2 === void 0 ? void 0 : _list$curIndex2.fileName) || '',
245
+ blob: res.data,
246
+ suffix: ((_list$curIndex3 = list[curIndex]) === null || _list$curIndex3 === void 0 || (_list$curIndex3 = _list$curIndex3.filePath) === null || _list$curIndex3 === void 0 ? void 0 : _list$curIndex3.split('.').pop()) || ''
247
+ });
248
+ return _context2.abrupt("break", 17);
249
+ case 16:
250
+ return _context2.abrupt("break", 17);
251
+ case 17:
252
+ case "end":
253
+ return _context2.stop();
254
+ }
255
+ }, _callee2);
256
+ }));
257
+ return function clickHandle(_x2) {
258
+ return _ref3.apply(this, arguments);
259
+ };
260
+ }();
261
+
262
+ //图片拖拽(鼠标按下,开始拖拽)
263
+ var handleMouseDown = function handleMouseDown(event) {
264
+ event.preventDefault();
265
+ setDragging(true);
266
+ // 鼠标按下开始坐标
267
+ setInitialMousePosition({
268
+ x: event.clientX,
269
+ y: event.clientY
270
+ });
271
+ //被点击元素相对于页面的偏移量
272
+ setInitialPosition({
273
+ left: event.currentTarget.offsetLeft,
274
+ top: event.currentTarget.offsetTop
275
+ });
276
+ };
277
+
278
+ //图片拖拽(拖拽移动中)
279
+ var handleMouseMove = function handleMouseMove(event) {
280
+ if (dragging) {
281
+ //计算拖拽移动距离
282
+ var dx = event.clientX - initialMousePosition.x;
283
+ var dy = event.clientY - initialMousePosition.y;
284
+ setPosition({
285
+ left: "".concat(initialPosition.left + dx, "px"),
286
+ top: "".concat(initialPosition.top + dy, "px")
287
+ });
288
+ }
289
+ };
290
+
291
+ // 图片拖拽(鼠标松开,结束拖拽)
292
+ var handleMouseUp = function handleMouseUp() {
293
+ setDragging(false);
294
+ setPosition({
295
+ left: 'auto',
296
+ top: 'auto'
297
+ });
298
+ };
299
+
300
+ //点击左右切换事件
301
+ var carouselClick = function carouselClick(type) {
302
+ setScale(1); //重置初始的缩放比例
303
+ setRotatinNum(0); //重置初始的缩放比例
304
+ if (type === 'l') {
305
+ //向左切换
306
+ if (curIndex === 0) {
307
+ //当前的索引为0,获取最后一张图片
308
+ setCurIndex((list === null || list === void 0 ? void 0 : list.length) - 1);
309
+ return;
310
+ } else {
311
+ //获取上一张的图片
312
+ setCurIndex(curIndex - 1);
313
+ }
314
+ } else {
315
+ //向右切换
316
+ if (curIndex === (list === null || list === void 0 ? void 0 : list.length) - 1) {
317
+ //索引为最后一张,还切换就是切换到第一张
318
+ setCurIndex(0);
319
+ } else {
320
+ //获取下一张的图片
321
+ setCurIndex(curIndex + 1);
322
+ }
323
+ }
324
+ };
325
+ useEffect(function () {
326
+ setCurIndex(curImgIndex !== null && curImgIndex !== void 0 ? curImgIndex : 0);
327
+ //重置旋转次数、缩放、角度比例
328
+ setRotatinNum(0);
329
+ setScale(1);
330
+ if (Array.isArray(imgList) && imgList.length) {
331
+ var arr = imgList.map(function (i) {
332
+ var _Object$keys, _type;
333
+ var name = i === null || i === void 0 ? void 0 : i.fileName;
334
+ var path = i === null || i === void 0 ? void 0 : i.filePath;
335
+ var type = i === null || i === void 0 ? void 0 : i.fileType;
336
+ if ((_Object$keys = Object.keys(fileField)) !== null && _Object$keys !== void 0 && _Object$keys.length) {
337
+ var _i$filePath, _i$filePath2, _i$filePath3;
338
+ var _fileField$filePath = fileField.filePath,
339
+ filePath = _fileField$filePath === void 0 ? '' : _fileField$filePath,
340
+ _fileField$fileName = fileField.fileName,
341
+ fileName = _fileField$fileName === void 0 ? '' : _fileField$fileName,
342
+ _fileField$fileType = fileField.fileType,
343
+ fileType = _fileField$fileType === void 0 ? '' : _fileField$fileType;
344
+ name = name ? name : i[fileName] ? i[fileName] : (_i$filePath = i[filePath]) === null || _i$filePath === void 0 || (_i$filePath = _i$filePath.split('/')) === null || _i$filePath === void 0 ? void 0 : _i$filePath.pop();
345
+ type = type ? type : i[fileType] ? i[fileType] : (_i$filePath2 = i[filePath]) === null || _i$filePath2 === void 0 ? void 0 : _i$filePath2.substring(((_i$filePath3 = i[filePath]) === null || _i$filePath3 === void 0 ? void 0 : _i$filePath3.lastIndexOf('.')) + 1);
346
+ path = path ? path : i[filePath];
347
+ }
348
+ return _objectSpread(_objectSpread({}, i), {}, {
349
+ fileType: (_type = type) === null || _type === void 0 ? void 0 : _type.toLowerCase(),
350
+ filePath: path,
351
+ fileName: name,
352
+ scale: 1,
353
+ roteAngle: 0
354
+ });
355
+ });
356
+ setList(arr);
357
+ }
358
+ }, [imgList]);
359
+ useEffect(function () {
360
+ var newBtns = _toConsumableArray(footerBtns);
361
+ if (scale <= 0.2) {
362
+ //最小的放大比例,缩小禁用
363
+ newBtns[1].disabled = true;
364
+ newBtns[0].disabled = false;
365
+ } else if (scale >= 4) {
366
+ //放大禁用
367
+ newBtns[1].disabled = false;
368
+ newBtns[0].disabled = true;
369
+ } else {
370
+ newBtns[1].disabled = false;
371
+ newBtns[0].disabled = false;
372
+ }
373
+ setFooterBtns(newBtns);
374
+ }, [scale]);
375
+ return /*#__PURE__*/React.createElement("div", {
376
+ className: 'lab-attach-perview',
377
+ style: styles
378
+ }, /*#__PURE__*/React.createElement(Splitter, {
379
+ style: {
380
+ width: '100%',
381
+ height: '100%'
382
+ }
383
+ }, (imgList === null || imgList === void 0 ? void 0 : imgList.length) > 1 && !isBtnSwitch && /*#__PURE__*/React.createElement(Splitter.Panel, {
384
+ defaultSize: 359,
385
+ size: 359,
386
+ min: "20%",
387
+ max: "70%"
388
+ }, /*#__PURE__*/React.createElement("div", {
389
+ className: "left"
390
+ }, /*#__PURE__*/React.createElement("ul", null, list.map(function (v, index) {
391
+ var _list$curIndex4;
392
+ return /*#__PURE__*/React.createElement("li", {
393
+ key: v.filePath,
394
+ style: {
395
+ backgroundColor: ((_list$curIndex4 = list[curIndex]) === null || _list$curIndex4 === void 0 ? void 0 : _list$curIndex4.filePath) === (v === null || v === void 0 ? void 0 : v.filePath) ? '#D0E4FF' : ''
396
+ }
397
+ }, /*#__PURE__*/React.createElement("div", {
398
+ title: "".concat(v.fileName),
399
+ onClick: function onClick() {
400
+ setCurIndex(index);
401
+ setRotatinNum(0);
402
+ setScale(1);
403
+ }
404
+ }, /*#__PURE__*/React.createElement("i", null, /*#__PURE__*/React.createElement(FileTextOutlined, {
405
+ style: {
406
+ fontSize: '13px',
407
+ color: '#868B9C',
408
+ margin: '0 6px'
409
+ }
410
+ })), v.fileName, ".", v === null || v === void 0 ? void 0 : v.fileType));
411
+ })))), /*#__PURE__*/React.createElement(Splitter.Panel, null, /*#__PURE__*/React.createElement("div", {
412
+ className: "right",
413
+ style: {
414
+ border: ((_list$curIndex5 = list[curIndex]) === null || _list$curIndex5 === void 0 ? void 0 : _list$curIndex5.fileType) !== 'pdf' && isBtnSwitch ? 'none' : '1px solid #D9D9D9',
415
+ borderLeft: (imgList === null || imgList === void 0 ? void 0 : imgList.length) > 1 ? 'none' : '1px solid #D9D9D9',
416
+ backgroundColor: isBtnSwitch ? '#fff' : '#F7F7F7'
417
+ }
418
+ }, /*#__PURE__*/React.createElement("div", {
419
+ className: "contentPart"
420
+ }, list[curIndex] && Object.keys(list[curIndex]).length && /*#__PURE__*/React.createElement("div", {
421
+ className: cn('contentDiv', list[curIndex].fileType === 'pdf' && 'pdfStyle'),
422
+ style: contDivStyle
423
+ }, ((_list$curIndex6 = list[curIndex]) === null || _list$curIndex6 === void 0 ? void 0 : _list$curIndex6.fileType) === 'pdf' ? /*#__PURE__*/React.createElement(LabPdf, {
424
+ baseUrl: baseUrl,
425
+ src: list[curIndex].filePath,
426
+ pdfjsSrc: pdfjsSrc
427
+ }) : /*#__PURE__*/React.createElement("img", {
428
+ style: {
429
+ maxWidth: '100%',
430
+ maxHeight: '100%',
431
+ transform: "".concat(isCanvasImg ? '' : "rotate(".concat(list[curIndex].roteAngle, "deg)"), "\n scale3d(").concat(list[curIndex].scale, ", ").concat(list[curIndex].scale, ", 1)"),
432
+ transition: 'transform ease-in-out 0.2s',
433
+ // 添加平滑的缩放过渡效果
434
+ cursor: dragging ? 'grabbing' : 'grab',
435
+ position: 'absolute',
436
+ left: "".concat(position === null || position === void 0 ? void 0 : position.left),
437
+ top: "".concat(position === null || position === void 0 ? void 0 : position.top)
438
+ },
439
+ id: "previewImg",
440
+ src: "".concat(baseUrl).concat(list[curIndex].filePath),
441
+ onWheel: handleWheel,
442
+ key: list[curIndex].filePath,
443
+ onMouseDown: handleMouseDown,
444
+ onMouseMove: handleMouseMove,
445
+ onMouseUp: handleMouseUp
446
+ }))), ((_list$curIndex7 = list[curIndex]) === null || _list$curIndex7 === void 0 ? void 0 : _list$curIndex7.fileType) !== 'pdf' && /*#__PURE__*/React.createElement("div", {
447
+ className: "footer",
448
+ style: footerStyle
449
+ }, /*#__PURE__*/React.createElement("div", {
450
+ className: "operate-btn"
451
+ }, footerBtns.map(function (item, index) {
452
+ return /*#__PURE__*/React.createElement("div", {
453
+ onClick: function onClick() {
454
+ return clickHandle(item.type);
455
+ },
456
+ key: item.type,
457
+ className: item.disabled ? 'disable-btn' : '',
458
+ title: item.disabled ? item.disableName : item.typeName,
459
+ style: {
460
+ paddingLeft: index > 0 ? '28px' : '0'
461
+ }
462
+ }, item.icon);
463
+ }))), /*#__PURE__*/React.createElement("canvas", {
464
+ ref: canvasRef,
465
+ style: {
466
+ display: 'none'
467
+ }
468
+ })))), isBtnSwitch && (list === null || list === void 0 ? void 0 : list.length) > 1 && curIndex > 0 && /*#__PURE__*/React.createElement("span", {
469
+ onClick: function onClick() {
470
+ return carouselClick('l');
471
+ },
472
+ className: "toggleIcon leftIcon"
473
+ }, /*#__PURE__*/React.createElement(LeftOutlined, {
474
+ className: "spanIcon"
475
+ })), isBtnSwitch && (list === null || list === void 0 ? void 0 : list.length) > 1 && curIndex < (list === null || list === void 0 ? void 0 : list.length) - 1 && /*#__PURE__*/React.createElement("span", {
476
+ onClick: function onClick() {
477
+ return carouselClick('r');
478
+ },
479
+ className: "toggleIcon rightIcon"
480
+ }, /*#__PURE__*/React.createElement(RightOutlined, {
481
+ className: "spanIcon"
482
+ })));
483
+ });
484
+ export default LabAttachmentPreview;