@cloud-app-dev/vidc 4.0.11 → 4.0.12

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,6 +1,6 @@
1
1
  import React, { useEffect } from 'react';
2
- import { _LOGIN_STATUS_EVENT_CHANGE_, _OPERATION_EVENT_CHANGE_, _USER_EVENT_CHANGE_, _STORE_EVENT_CHANGE_ } from "./static";
3
2
  import SocketEmitter from "../SocketEmitter";
3
+ import { _LOGIN_STATUS_EVENT_CHANGE_, _OPERATION_EVENT_CHANGE_, _STORE_EVENT_CHANGE_, _USER_EVENT_CHANGE_ } from "./static";
4
4
  import { Fragment as _Fragment } from "react/jsx-runtime";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  function Sync(_ref) {
@@ -14,8 +14,8 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
14
14
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
15
15
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
16
16
  import db from 'db.js';
17
- import logger from "../logger";
18
17
  import cache from "../cache";
18
+ import logger from "../logger";
19
19
  var schema = {
20
20
  key: {
21
21
  keyPath: 'id',
@@ -1,3 +1,3 @@
1
- import EventEmitter from "../SocketEmitter/eventEmitter";
1
+ import EventEmitter from '../SocketEmitter/eventEmitter';
2
2
  declare const EventTools: typeof EventEmitter;
3
3
  export default EventTools;
@@ -2,6 +2,7 @@
2
2
  interface IRatePick {
3
3
  onChange: (rate: number) => void;
4
4
  value: number;
5
+ multipleList?: number[];
5
6
  }
6
- declare function RatePick({ onChange, value }: IRatePick): JSX.Element;
7
+ declare function RatePick({ onChange, value, multipleList }: IRatePick): JSX.Element;
7
8
  export default RatePick;
@@ -5,8 +5,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
5
5
  import { jsxs as _jsxs } from "react/jsx-runtime";
6
6
  function RatePick(_ref) {
7
7
  var onChange = _ref.onChange,
8
- value = _ref.value;
9
- return /*#__PURE__*/_jsxs(CustomRenderSelect, {
8
+ value = _ref.value,
9
+ _ref$multipleList = _ref.multipleList,
10
+ multipleList = _ref$multipleList === void 0 ? [8, 6, 4, 2, 1.5, 1, 0.5] : _ref$multipleList;
11
+ return /*#__PURE__*/_jsx(CustomRenderSelect, {
10
12
  value: value,
11
13
  popupClassName: "rate-select-dropdown ",
12
14
  customRender: function customRender() {
@@ -17,28 +19,12 @@ function RatePick(_ref) {
17
19
  },
18
20
  onChange: onChange,
19
21
  placement: "topLeft",
20
- children: [/*#__PURE__*/_jsx(Select.Option, {
21
- value: 8,
22
- children: "8.0\u500D"
23
- }), /*#__PURE__*/_jsx(Select.Option, {
24
- value: 6,
25
- children: "6.0\u500D"
26
- }), /*#__PURE__*/_jsx(Select.Option, {
27
- value: 4,
28
- children: "4.0\u500D"
29
- }), /*#__PURE__*/_jsx(Select.Option, {
30
- value: 2,
31
- children: "2.0\u500D"
32
- }), /*#__PURE__*/_jsx(Select.Option, {
33
- value: 1.5,
34
- children: "1.5\u500D"
35
- }), /*#__PURE__*/_jsx(Select.Option, {
36
- value: 1,
37
- children: "1.0\u500D"
38
- }), /*#__PURE__*/_jsx(Select.Option, {
39
- value: 0.5,
40
- children: "0.5\u500D"
41
- })]
22
+ children: multipleList === null || multipleList === void 0 ? void 0 : multipleList.map(function (v, i) {
23
+ return /*#__PURE__*/_jsxs(Select.Option, {
24
+ value: v,
25
+ children: [v, "\u500D"]
26
+ }, i);
27
+ })
42
28
  });
43
29
  }
44
30
  export default RatePick;
@@ -6,5 +6,5 @@ import './index.less';
6
6
  * @param param0
7
7
  * @returns
8
8
  */
9
- declare function RecordPlayer({ list, children, oneWinExtTools, allWinExtTools, fpsDelay, fps, seekLoading, ...props }: IRecordPlayerProps): JSX.Element;
9
+ declare function RecordPlayer({ list, children, oneWinExtTools, allWinExtTools, fpsDelay, fps, seekLoading, multipleList, ...props }: IRecordPlayerProps): JSX.Element;
10
10
  export default RecordPlayer;
@@ -1,7 +1,7 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
2
  import _useUpdateEffect from "ahooks/es/useUpdateEffect";
3
3
  import _useMemoizedFn from "ahooks/es/useMemoizedFn";
4
- var _excluded = ["list", "children", "oneWinExtTools", "allWinExtTools", "fpsDelay", "fps", "seekLoading"];
4
+ var _excluded = ["list", "children", "oneWinExtTools", "allWinExtTools", "fpsDelay", "fps", "seekLoading", "multipleList"];
5
5
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
6
6
  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); } }
7
7
  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); }); }; }
@@ -57,6 +57,7 @@ function RecordPlayer(_ref) {
57
57
  fpsDelay = _ref.fpsDelay,
58
58
  fps = _ref.fps,
59
59
  seekLoading = _ref.seekLoading,
60
+ multipleList = _ref.multipleList,
60
61
  props = _objectWithoutProperties(_ref, _excluded);
61
62
  var _useState = useState(_objectSpread(_objectSpread({}, cloneDeep(defaultState)), {}, {
62
63
  screenNum: (_props$defaultScreen = props.defaultScreen) !== null && _props$defaultScreen !== void 0 ? _props$defaultScreen : defaultState.screenNum
@@ -424,7 +425,8 @@ function RecordPlayer(_ref) {
424
425
  snapshot: props.snapshot,
425
426
  oneWinExtTools: oneWinExtTools,
426
427
  allWinExtTools: allWinExtTools,
427
- hasPlugin: !!props.pluginDownloadUrl
428
+ hasPlugin: !!props.pluginDownloadUrl,
429
+ multipleList: multipleList
428
430
  })
429
431
  }), /*#__PURE__*/_jsx(DisableMark, {
430
432
  disabled: !segmentItem.cid,
@@ -23,6 +23,7 @@ interface IToolsProps {
23
23
  getPlayerItem: () => ExportPlayerType | undefined;
24
24
  download?: () => void;
25
25
  snapshot?: (base64: string) => void;
26
+ multipleList?: number[];
26
27
  /**
27
28
  * 单窗口拓展工具条,左侧
28
29
  */
@@ -33,5 +34,5 @@ interface IToolsProps {
33
34
  allWinExtTools?: JSX.Element;
34
35
  hasPlugin?: boolean;
35
36
  }
36
- declare function RecordTools({ containerRef, screenNum, mode, fit, time, oneWinExtTools, allWinExtTools, hasPlugin, ...props }: IToolsProps): JSX.Element;
37
+ declare function RecordTools({ containerRef, screenNum, mode, fit, time, oneWinExtTools, allWinExtTools, hasPlugin, multipleList, ...props }: IToolsProps): JSX.Element;
37
38
  export default RecordTools;
@@ -2,7 +2,7 @@ import _useRafInterval from "ahooks/es/useRafInterval";
2
2
  import _useUpdateEffect from "ahooks/es/useUpdateEffect";
3
3
  import _useUpdate from "ahooks/es/useUpdate";
4
4
  import _useToggle3 from "ahooks/es/useToggle";
5
- var _excluded = ["containerRef", "screenNum", "mode", "fit", "time", "oneWinExtTools", "allWinExtTools", "hasPlugin"];
5
+ var _excluded = ["containerRef", "screenNum", "mode", "fit", "time", "oneWinExtTools", "allWinExtTools", "hasPlugin", "multipleList"];
6
6
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
7
7
  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."); }
8
8
  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); }
@@ -31,6 +31,7 @@ function RecordTools(_ref) {
31
31
  oneWinExtTools = _ref.oneWinExtTools,
32
32
  allWinExtTools = _ref.allWinExtTools,
33
33
  hasPlugin = _ref.hasPlugin,
34
+ multipleList = _ref.multipleList,
34
35
  props = _objectWithoutProperties(_ref, _excluded);
35
36
  var _useFullscreen = useFullscreen(containerRef),
36
37
  _useFullscreen2 = _slicedToArray(_useFullscreen, 2),
@@ -139,6 +140,7 @@ function RecordTools(_ref) {
139
140
  })
140
141
  }), /*#__PURE__*/_jsx(RatePick, {
141
142
  onChange: ratechange,
143
+ multipleList: multipleList,
142
144
  value: (_player$video$playbac = player === null || player === void 0 ? void 0 : (_player$video = player.video) === null || _player$video === void 0 ? void 0 : _player$video.playbackRate) !== null && _player$video$playbac !== void 0 ? _player$video$playbac : 1
143
145
  }), oneWinExtTools]
144
146
  }), /*#__PURE__*/_jsxs("div", {
@@ -97,6 +97,11 @@ export interface IRecordPlayerProps {
97
97
  * 用户控制seek频率
98
98
  */
99
99
  seekLoading?: boolean;
100
+
101
+ /**
102
+ * 控制播放倍数数组
103
+ */
104
+ multipleList?: number[];
100
105
  }
101
106
 
102
107
  export interface IRecordPlayerState {
@@ -5,6 +5,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
5
5
  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; }
6
6
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
7
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
+ /* eslint-disable @typescript-eslint/no-unused-expressions */
8
9
  /**
9
10
  * 自定义事件
10
11
  * author hjj
@@ -15,10 +15,10 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
15
15
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
16
16
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
17
17
  /* eslint-disable @typescript-eslint/no-unused-expressions */
18
- import EventEmitter from "./eventEmitter";
19
- import logger from "../logger";
20
- import cache from "../cache";
21
18
  import io from 'socket.io-client';
19
+ import cache from "../cache";
20
+ import logger from "../logger";
21
+ import EventEmitter from "./eventEmitter";
22
22
  var SocketEmitter = /*#__PURE__*/function (_EventEmitter) {
23
23
  _inherits(SocketEmitter, _EventEmitter);
24
24
  var _super = _createSuper(SocketEmitter);
@@ -1,4 +1,4 @@
1
1
  declare module 'socket.io-client' {
2
- io: any;
2
+ declare const io: any;
3
3
  export default io;
4
4
  }
@@ -2,4 +2,4 @@
2
2
  * 文字超出中间省略号
3
3
  * @param {string} str
4
4
  */
5
- export default function submidstr(str: String, replaceLength?: number): string | String;
5
+ export default function submidstr(str: string, replaceLength?: number): string;
@@ -1,6 +1,6 @@
1
- declare function computPlaceTree<T>(list: T[], isNoDeep?: boolean): T[];
2
- declare function computPlaceTreeHasUnknown<T>(list: T[], isNoDeep?: boolean): T[];
3
- declare function computTreeList<T>(list: T[], id?: string, pid?: string, isNoDeep?: boolean): T[];
1
+ declare function computPlaceTree<T>(lt: any[], isNoDeep?: boolean): any[];
2
+ declare function computPlaceTreeHasUnknown<T>(lt: any[], isNoDeep?: boolean): any[];
3
+ declare function computTreeList<T>(list: any[], id?: string, pid?: string, isNoDeep?: boolean): any[];
4
4
  declare function computTreeList2<T>(list: T[], key?: string, pKey?: string): T[];
5
5
  declare const _default: {
6
6
  computPlaceTree: typeof computPlaceTree;
@@ -4,10 +4,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
  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; }
5
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
6
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
- import { compact, cloneDeep, orderBy } from 'lodash-es';
8
- function computPlaceTree(list, isNoDeep) {
7
+ import { cloneDeep, compact, orderBy } from 'lodash-es';
8
+ function computPlaceTree(lt, isNoDeep) {
9
9
  var treeData;
10
- list = orderBy(list, ['provinceId'], ['asc']);
10
+ var list = orderBy(lt, ['provinceId'], ['asc']);
11
11
  if (!isNoDeep) {
12
12
  treeData = cloneDeep(list);
13
13
  } else {
@@ -33,7 +33,9 @@ function computPlaceTree(list, isNoDeep) {
33
33
  var item2 = pPlaces[pLevels.indexOf(Math.max.apply(null, pLevels))];
34
34
  if (item2) {
35
35
  hasParent = true;
36
- !Array.isArray(item2.children) && (item2.children = []);
36
+ if (!Array.isArray(item2.children)) {
37
+ item2.children = [];
38
+ }
37
39
  item2.children.push(item);
38
40
  }
39
41
  }
@@ -41,20 +43,24 @@ function computPlaceTree(list, isNoDeep) {
41
43
  if (item.parentCode && treeMap[item.parentCode]) {
42
44
  hasParent = true;
43
45
  var _item = treeMap[item.parentCode];
44
- !Array.isArray(_item.children) && (_item.children = []);
46
+ if (!Array.isArray(_item.children)) {
47
+ _item.children = [];
48
+ }
45
49
  _item.children.push(item);
46
50
  }
47
51
  }
48
- !hasParent && arr.push(index);
52
+ if (!hasParent) {
53
+ arr.push(index);
54
+ }
49
55
  });
50
56
  treeMap = null;
51
57
  return treeData.filter(function (v, index) {
52
58
  return arr.includes(index) && v.id !== '1200000000000000000';
53
59
  });
54
60
  }
55
- function computPlaceTreeHasUnknown(list, isNoDeep) {
61
+ function computPlaceTreeHasUnknown(lt, isNoDeep) {
56
62
  var treeData;
57
- list = orderBy(list, ['provinceId'], ['asc']);
63
+ var list = orderBy(lt, ['provinceId'], ['asc']);
58
64
  if (!isNoDeep) {
59
65
  treeData = cloneDeep(list);
60
66
  } else {
@@ -80,7 +86,9 @@ function computPlaceTreeHasUnknown(list, isNoDeep) {
80
86
  var item2 = pPlaces[pLevels.indexOf(Math.max.apply(null, pLevels))];
81
87
  if (item2) {
82
88
  hasParent = true;
83
- !Array.isArray(item2.children) && (item2.children = []);
89
+ if (!Array.isArray(item2.children)) {
90
+ item2.children = [];
91
+ }
84
92
  item2.children.push(item);
85
93
  }
86
94
  }
@@ -88,11 +96,15 @@ function computPlaceTreeHasUnknown(list, isNoDeep) {
88
96
  if (item.parentCode && treeMap[item.parentCode]) {
89
97
  hasParent = true;
90
98
  var _item2 = treeMap[item.parentCode];
91
- !Array.isArray(_item2.children) && (_item2.children = []);
99
+ if (!Array.isArray(_item2.children)) {
100
+ _item2.children = [];
101
+ }
92
102
  _item2.children.push(item);
93
103
  }
94
104
  }
95
- !hasParent && arr.push(index);
105
+ if (!hasParent) {
106
+ arr.push(index);
107
+ }
96
108
  });
97
109
  treeMap = null;
98
110
  return treeData.filter(function (v, index) {
@@ -120,10 +132,14 @@ function computTreeList(list) {
120
132
  if (item[pid] && treeMap[item[pid]]) {
121
133
  hasParent = true;
122
134
  var item2 = treeMap[item[pid]];
123
- !Array.isArray(item2.children) && (item2.children = []);
135
+ if (!Array.isArray(item2.children)) {
136
+ item2.children = [];
137
+ }
124
138
  item2.children.push(item);
125
139
  }
126
- !hasParent && arr.push(i);
140
+ if (!hasParent) {
141
+ arr.push(i);
142
+ }
127
143
  }
128
144
  treeMap = null;
129
145
  return treeData.filter(function (_, index) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "private": false,
3
3
  "name": "@cloud-app-dev/vidc",
4
4
  "description": "Video Image Data Componennts",
5
- "version": "4.0.11",
5
+ "version": "4.0.12",
6
6
  "scripts": {
7
7
  "docs:deploy": "gh-pages -d docs-dist",
8
8
  "build": "npm run entry && father build",