component-shipinlv 2.0.2 → 2.0.3

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,2 +1,2 @@
1
- declare const getVideoGoodsUrl: (pathList: string[]) => Promise<VideoPublish.TxtVideoGoodsInfo[]>;
1
+ declare const getVideoGoodsUrl: (selectList: VideoPublish.VideoSelectList[]) => Promise<VideoPublish.TxtVideoGoodsInfo[]>;
2
2
  export default getVideoGoodsUrl;
@@ -4,58 +4,68 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
4
4
  import * as FileController from "../../service/video-api/FileController";
5
5
  import Tool from "../../lib/Tool";
6
6
  var getVideoGoodsUrl = /*#__PURE__*/function () {
7
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(pathList) {
8
- var resultDataList, _iterator, _step, filePath, resultData, folderPath, txtList, _iterator2, _step2, items, lineList, _iterator3, _step3, text, imageUrls, url;
7
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(selectList) {
8
+ var resultDataList, _iterator, _step, selectItem, resultData, folderPath, txtList, _iterator2, _step2, items, lineList, _iterator3, _step3, text, imageUrls, url;
9
9
  return _regeneratorRuntime().wrap(function _callee$(_context) {
10
10
  while (1) switch (_context.prev = _context.next) {
11
11
  case 0:
12
12
  resultDataList = [];
13
- _iterator = _createForOfIteratorHelper(pathList);
13
+ _iterator = _createForOfIteratorHelper(selectList);
14
14
  _context.prev = 2;
15
15
  _iterator.s();
16
16
  case 4:
17
17
  if ((_step = _iterator.n()).done) {
18
- _context.next = 38;
18
+ _context.next = 41;
19
19
  break;
20
20
  }
21
- filePath = _step.value;
21
+ selectItem = _step.value;
22
+ if (!selectItem.videoKindTag) {
23
+ _context.next = 9;
24
+ break;
25
+ }
26
+ resultDataList.push({
27
+ title: '',
28
+ url: ''
29
+ });
30
+ return _context.abrupt("continue", 39);
31
+ case 9:
22
32
  resultData = {
23
33
  title: '',
24
34
  url: ''
25
35
  };
26
- folderPath = Tool.getDirByPath(filePath);
27
- _context.next = 10;
36
+ folderPath = Tool.getDirByPath(selectItem.videoFinishUrl);
37
+ _context.next = 13;
28
38
  return FileController.getFolderTxtListContent({
29
39
  folderPath: folderPath
30
40
  }).catch(function (err) {
31
41
  console.log('获取视频 文件夹下的 记事本信息错误:' + (err === null || err === void 0 ? void 0 : err.message));
32
42
  });
33
- case 10:
43
+ case 13:
34
44
  txtList = _context.sent;
35
45
  if (txtList) {
36
- _context.next = 14;
46
+ _context.next = 17;
37
47
  break;
38
48
  }
39
49
  resultDataList.push(resultData);
40
- return _context.abrupt("continue", 36);
41
- case 14:
50
+ return _context.abrupt("continue", 39);
51
+ case 17:
42
52
  console.log('txtList:', txtList);
43
53
  _iterator2 = _createForOfIteratorHelper(txtList);
44
- _context.prev = 16;
54
+ _context.prev = 19;
45
55
  _iterator2.s();
46
- case 18:
56
+ case 21:
47
57
  if ((_step2 = _iterator2.n()).done) {
48
- _context.next = 27;
58
+ _context.next = 30;
49
59
  break;
50
60
  }
51
61
  items = _step2.value;
52
62
  lineList = items.content.split("\n");
53
63
  if (!resultData.url) {
54
- _context.next = 23;
64
+ _context.next = 26;
55
65
  break;
56
66
  }
57
- return _context.abrupt("break", 27);
58
- case 23:
67
+ return _context.abrupt("break", 30);
68
+ case 26:
59
69
  _iterator3 = _createForOfIteratorHelper(lineList);
60
70
  try {
61
71
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
@@ -81,43 +91,43 @@ var getVideoGoodsUrl = /*#__PURE__*/function () {
81
91
  } finally {
82
92
  _iterator3.f();
83
93
  }
84
- case 25:
85
- _context.next = 18;
94
+ case 28:
95
+ _context.next = 21;
86
96
  break;
87
- case 27:
88
- _context.next = 32;
97
+ case 30:
98
+ _context.next = 35;
89
99
  break;
90
- case 29:
91
- _context.prev = 29;
92
- _context.t0 = _context["catch"](16);
93
- _iterator2.e(_context.t0);
94
100
  case 32:
95
101
  _context.prev = 32;
96
- _iterator2.f();
97
- return _context.finish(32);
102
+ _context.t0 = _context["catch"](19);
103
+ _iterator2.e(_context.t0);
98
104
  case 35:
105
+ _context.prev = 35;
106
+ _iterator2.f();
107
+ return _context.finish(35);
108
+ case 38:
99
109
  resultDataList.push(resultData);
100
- case 36:
110
+ case 39:
101
111
  _context.next = 4;
102
112
  break;
103
- case 38:
104
- _context.next = 43;
113
+ case 41:
114
+ _context.next = 46;
105
115
  break;
106
- case 40:
107
- _context.prev = 40;
108
- _context.t1 = _context["catch"](2);
109
- _iterator.e(_context.t1);
110
116
  case 43:
111
117
  _context.prev = 43;
112
- _iterator.f();
113
- return _context.finish(43);
118
+ _context.t1 = _context["catch"](2);
119
+ _iterator.e(_context.t1);
114
120
  case 46:
121
+ _context.prev = 46;
122
+ _iterator.f();
123
+ return _context.finish(46);
124
+ case 49:
115
125
  return _context.abrupt("return", resultDataList);
116
- case 47:
126
+ case 50:
117
127
  case "end":
118
128
  return _context.stop();
119
129
  }
120
- }, _callee, null, [[2, 40, 43, 46], [16, 29, 32, 35]]);
130
+ }, _callee, null, [[2, 43, 46, 49], [19, 32, 35, 38]]);
121
131
  }));
122
132
  return function getVideoGoodsUrl(_x) {
123
133
  return _ref.apply(this, arguments);
@@ -135,9 +135,7 @@ var VideoPublishCreateTask = function VideoPublishCreateTask(_ref) {
135
135
  setLocalSelectList(_toConsumableArray(localSelectList));
136
136
  setLoadingSelectLocal(false);
137
137
  _context.next = 14;
138
- return getVideoGoodsUrl(localSelectList.map(function (item) {
139
- return item.videoFinishUrl;
140
- })).catch(function (err) {});
138
+ return getVideoGoodsUrl(localSelectList).catch(function (err) {});
141
139
  case 14:
142
140
  goodsUrlInfoList = _context.sent;
143
141
  if (goodsUrlInfoList) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "component-shipinlv",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",