component-shipinlv 2.3.7 → 2.3.8

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.
Files changed (114) hide show
  1. package/dist/Auth/index.js +4 -4
  2. package/dist/PhonePublish/account-manage/home.d.ts +11 -0
  3. package/dist/PhonePublish/account-manage/home.js +243 -0
  4. package/dist/PhonePublish/account-manage/home.less +28 -0
  5. package/dist/PhonePublish/account-manage/index.d.ts +3 -0
  6. package/dist/PhonePublish/account-manage/index.js +56 -0
  7. package/dist/PhonePublish/account-manage/index.less +59 -0
  8. package/dist/PhonePublish/account-manage/list.d.ts +17 -0
  9. package/dist/PhonePublish/account-manage/list.js +443 -0
  10. package/dist/PhonePublish/account-manage/list.less +95 -0
  11. package/dist/PhonePublish/account-manage/setting/index.d.ts +6 -0
  12. package/dist/PhonePublish/account-manage/setting/index.js +199 -0
  13. package/dist/PhonePublish/account-manage/setting/index.less +11 -0
  14. package/dist/PhonePublish/create-task/base/index.d.ts +10 -0
  15. package/dist/PhonePublish/create-task/base/index.js +386 -0
  16. package/dist/PhonePublish/create-task/base/index.less +64 -0
  17. package/dist/PhonePublish/create-task/getVideoGoodsUrl.d.ts +2 -0
  18. package/dist/PhonePublish/create-task/getVideoGoodsUrl.js +136 -0
  19. package/dist/PhonePublish/create-task/hour-enabled.d.ts +9 -0
  20. package/dist/PhonePublish/create-task/hour-enabled.js +42 -0
  21. package/dist/PhonePublish/create-task/hour-enabled.less +24 -0
  22. package/dist/PhonePublish/create-task/index.d.ts +11 -0
  23. package/dist/PhonePublish/create-task/index.js +449 -0
  24. package/dist/PhonePublish/create-task/index.less +75 -0
  25. package/dist/PhonePublish/create-task/select-list.css.d.ts +5 -0
  26. package/dist/PhonePublish/create-task/select-list.css.js +6 -0
  27. package/dist/PhonePublish/create-task/select-list.d.ts +8 -0
  28. package/dist/PhonePublish/create-task/select-list.js +304 -0
  29. package/dist/PhonePublish/create-task/task-list.css.d.ts +5 -0
  30. package/dist/PhonePublish/create-task/task-list.css.js +6 -0
  31. package/dist/PhonePublish/create-task/task-list.d.ts +9 -0
  32. package/dist/PhonePublish/create-task/task-list.js +323 -0
  33. package/dist/PhonePublish/index.css.d.ts +2 -0
  34. package/dist/PhonePublish/index.css.js +35 -0
  35. package/dist/PhonePublish/index.d.ts +15 -0
  36. package/dist/PhonePublish/index.js +191 -0
  37. package/dist/PhonePublish/index.less +55 -0
  38. package/dist/PhonePublish/lib/chrome-quit.d.ts +2 -0
  39. package/dist/PhonePublish/lib/chrome-quit.js +20 -0
  40. package/dist/PhonePublish/log/index.d.ts +8 -0
  41. package/dist/PhonePublish/log/index.js +186 -0
  42. package/dist/PhonePublish/log/index.less +81 -0
  43. package/dist/PhonePublish/publish-task-plan/index.d.ts +9 -0
  44. package/dist/PhonePublish/publish-task-plan/index.js +32 -0
  45. package/dist/PhonePublish/publish-task-plan/index.less +4 -0
  46. package/dist/PhonePublish/publish-task-plan/tool-bak.txt +219 -0
  47. package/dist/PhonePublish/publish-task-plan/tool.d.ts +29 -0
  48. package/dist/PhonePublish/publish-task-plan/tool.js +720 -0
  49. package/dist/PhonePublish/task-list/index.d.ts +8 -0
  50. package/dist/PhonePublish/task-list/index.js +224 -0
  51. package/dist/PhonePublish/task-list/index.less +8 -0
  52. package/dist/PhonePublish/task-list/plan/list.d.ts +12 -0
  53. package/dist/PhonePublish/task-list/plan/list.js +290 -0
  54. package/dist/PhonePublish/task-list/plan/list.less +87 -0
  55. package/dist/PhonePublish/task-list/plan/operate.d.ts +8 -0
  56. package/dist/PhonePublish/task-list/plan/operate.js +145 -0
  57. package/dist/PhonePublish/task-list/plan/query.d.ts +8 -0
  58. package/dist/PhonePublish/task-list/plan/query.js +89 -0
  59. package/dist/PhonePublish/task-list/plan/query.less +9 -0
  60. package/dist/PhonePublish/task-list/plan/status.d.ts +13 -0
  61. package/dist/PhonePublish/task-list/plan/status.js +53 -0
  62. package/dist/PhonePublish/task-list/query.d.ts +8 -0
  63. package/dist/PhonePublish/task-list/query.js +76 -0
  64. package/dist/PhonePublish/task-list/query.less +19 -0
  65. package/dist/PhonePublish/task-list/who-can-view.d.ts +12 -0
  66. package/dist/PhonePublish/task-list/who-can-view.js +37 -0
  67. package/dist/PhonePublish/video-account/ban/index.d.ts +10 -0
  68. package/dist/PhonePublish/video-account/ban/index.js +94 -0
  69. package/dist/PhonePublish/video-account/ban/index.less +4 -0
  70. package/dist/PhonePublish/video-account/base-info.d.ts +13 -0
  71. package/dist/PhonePublish/video-account/base-info.js +75 -0
  72. package/dist/PhonePublish/video-account/base-info.less +92 -0
  73. package/dist/PhonePublish/video-account/create.d.ts +8 -0
  74. package/dist/PhonePublish/video-account/create.js +174 -0
  75. package/dist/PhonePublish/video-account/group.d.ts +9 -0
  76. package/dist/PhonePublish/video-account/group.js +255 -0
  77. package/dist/PhonePublish/video-account/group.less +10 -0
  78. package/dist/PhonePublish/video-account/index.d.ts +8 -0
  79. package/dist/PhonePublish/video-account/index.js +403 -0
  80. package/dist/PhonePublish/video-account/index.less +92 -0
  81. package/dist/PhonePublish/video-account/query.d.ts +8 -0
  82. package/dist/PhonePublish/video-account/query.js +115 -0
  83. package/dist/PhonePublish/video-account/query.less +18 -0
  84. package/dist/PhonePublish/video-publish-statistic/account-trend/index.d.ts +8 -0
  85. package/dist/PhonePublish/video-publish-statistic/account-trend/index.js +173 -0
  86. package/dist/PhonePublish/video-publish-statistic/account-trend/index.less +3 -0
  87. package/dist/PhonePublish/video-publish-statistic/account-trend/kind-list.d.ts +7 -0
  88. package/dist/PhonePublish/video-publish-statistic/account-trend/kind-list.js +22 -0
  89. package/dist/PhonePublish/video-publish-statistic/account-trend/query.d.ts +9 -0
  90. package/dist/PhonePublish/video-publish-statistic/account-trend/query.js +54 -0
  91. package/dist/PhonePublish/video-publish-statistic/account-trend/query.less +3 -0
  92. package/dist/PhonePublish/video-publish-statistic/index.d.ts +2 -0
  93. package/dist/PhonePublish/video-publish-statistic/index.js +37 -0
  94. package/dist/PhonePublish/video-publish-statistic/kind.d.ts +16 -0
  95. package/dist/PhonePublish/video-publish-statistic/kind.js +57 -0
  96. package/dist/PhonePublish/video-publish-statistic/operation/list.d.ts +7 -0
  97. package/dist/PhonePublish/video-publish-statistic/operation/list.js +242 -0
  98. package/dist/PhonePublish/video-publish-statistic/operation/list.less +10 -0
  99. package/dist/PhonePublish/video-publish-statistic/operation/query.d.ts +8 -0
  100. package/dist/PhonePublish/video-publish-statistic/operation/query.js +56 -0
  101. package/dist/PhonePublish/video-publish-statistic/operation/query.less +3 -0
  102. package/dist/PhonePublish/video-publish-statistic/publish-plan/list.d.ts +8 -0
  103. package/dist/PhonePublish/video-publish-statistic/publish-plan/list.js +257 -0
  104. package/dist/PhonePublish/video-publish-statistic/publish-plan/list.less +105 -0
  105. package/dist/PhonePublish/video-publish-statistic/publish-plan/query.d.ts +9 -0
  106. package/dist/PhonePublish/video-publish-statistic/publish-plan/query.js +79 -0
  107. package/dist/PhonePublish/video-publish-statistic/publish-plan/query.less +3 -0
  108. package/dist/VideoPublish/account-manage/list.js +1 -1
  109. package/dist/index.d.ts +1 -0
  110. package/dist/index.js +1 -0
  111. package/dist/phone/index.d.ts +8 -0
  112. package/dist/phone/index.js +62 -0
  113. package/dist/phone/index.less +170 -0
  114. package/package.json +1 -1
@@ -0,0 +1,136 @@
1
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
+ import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
3
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
4
+ import * as FileController from "../../service/video-api/FileController";
5
+ import Tool from "../../lib/Tool";
6
+ var getVideoGoodsUrl = /*#__PURE__*/function () {
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
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
10
+ while (1) switch (_context.prev = _context.next) {
11
+ case 0:
12
+ resultDataList = [];
13
+ _iterator = _createForOfIteratorHelper(selectList);
14
+ _context.prev = 2;
15
+ _iterator.s();
16
+ case 4:
17
+ if ((_step = _iterator.n()).done) {
18
+ _context.next = 41;
19
+ break;
20
+ }
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:
32
+ resultData = {
33
+ title: '',
34
+ url: ''
35
+ };
36
+ folderPath = Tool.getDirByPath(selectItem.videoFinishUrl);
37
+ _context.next = 13;
38
+ return FileController.getFolderTxtListContent({
39
+ folderPath: folderPath
40
+ }).catch(function (err) {
41
+ console.log('获取视频 文件夹下的 记事本信息错误:' + (err === null || err === void 0 ? void 0 : err.message));
42
+ });
43
+ case 13:
44
+ txtList = _context.sent;
45
+ if (txtList) {
46
+ _context.next = 17;
47
+ break;
48
+ }
49
+ resultDataList.push(resultData);
50
+ return _context.abrupt("continue", 39);
51
+ case 17:
52
+ console.log('txtList:', txtList);
53
+ _iterator2 = _createForOfIteratorHelper(txtList);
54
+ _context.prev = 19;
55
+ _iterator2.s();
56
+ case 21:
57
+ if ((_step2 = _iterator2.n()).done) {
58
+ _context.next = 30;
59
+ break;
60
+ }
61
+ items = _step2.value;
62
+ lineList = items.content.split("\n");
63
+ if (!resultData.url) {
64
+ _context.next = 26;
65
+ break;
66
+ }
67
+ return _context.abrupt("break", 30);
68
+ case 26:
69
+ _iterator3 = _createForOfIteratorHelper(lineList);
70
+ try {
71
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
72
+ text = _step3.value;
73
+ imageUrls = text.match(/https?:\/\/[\da-z-_/.?&#@$%^*:()=+!`~,\[\]|]+/ig) || [];
74
+ url = imageUrls[0] || '';
75
+ if (url) {
76
+ if (url.indexOf('://v.douyin.com') > -1 || url.indexOf('://haohuo.jinritemai.com') > -1) {
77
+ if (!resultData.url) {
78
+ resultData.url = url;
79
+ }
80
+ }
81
+ } else {
82
+ if (text.length >= 3 && text.length <= 10) {
83
+ if (!resultData.title) {
84
+ resultData.title = text;
85
+ }
86
+ }
87
+ }
88
+ }
89
+ } catch (err) {
90
+ _iterator3.e(err);
91
+ } finally {
92
+ _iterator3.f();
93
+ }
94
+ case 28:
95
+ _context.next = 21;
96
+ break;
97
+ case 30:
98
+ _context.next = 35;
99
+ break;
100
+ case 32:
101
+ _context.prev = 32;
102
+ _context.t0 = _context["catch"](19);
103
+ _iterator2.e(_context.t0);
104
+ case 35:
105
+ _context.prev = 35;
106
+ _iterator2.f();
107
+ return _context.finish(35);
108
+ case 38:
109
+ resultDataList.push(resultData);
110
+ case 39:
111
+ _context.next = 4;
112
+ break;
113
+ case 41:
114
+ _context.next = 46;
115
+ break;
116
+ case 43:
117
+ _context.prev = 43;
118
+ _context.t1 = _context["catch"](2);
119
+ _iterator.e(_context.t1);
120
+ case 46:
121
+ _context.prev = 46;
122
+ _iterator.f();
123
+ return _context.finish(46);
124
+ case 49:
125
+ return _context.abrupt("return", resultDataList);
126
+ case 50:
127
+ case "end":
128
+ return _context.stop();
129
+ }
130
+ }, _callee, null, [[2, 43, 46, 49], [19, 32, 35, 38]]);
131
+ }));
132
+ return function getVideoGoodsUrl(_x) {
133
+ return _ref.apply(this, arguments);
134
+ };
135
+ }();
136
+ export default getVideoGoodsUrl;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import "./hour-enabled.less";
3
+ interface Props {
4
+ disabled?: boolean;
5
+ hourEnabled: number[];
6
+ onHourEnabled: (hourEnabled: number[]) => void;
7
+ }
8
+ declare const VideoPublishCreateTaskHourSelect: React.FC<Props>;
9
+ export default VideoPublishCreateTaskHourSelect;
@@ -0,0 +1,42 @@
1
+ import React from "react";
2
+ import "./hour-enabled.less";
3
+ import { Col, Row } from "antd";
4
+ import { jsxs as _jsxs } from "react/jsx-runtime";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ var VideoPublishCreateTaskHourSelect = function VideoPublishCreateTaskHourSelect(_ref) {
7
+ var disabled = _ref.disabled,
8
+ _ref$hourEnabled = _ref.hourEnabled,
9
+ hourEnabled = _ref$hourEnabled === void 0 ? [] : _ref$hourEnabled,
10
+ _ref$onHourEnabled = _ref.onHourEnabled,
11
+ onHourEnabled = _ref$onHourEnabled === void 0 ? function () {} : _ref$onHourEnabled;
12
+ var onHour = function onHour(hour) {
13
+ if (disabled) {
14
+ return;
15
+ }
16
+ var index = hourEnabled.indexOf(hour);
17
+ if (index > -1) {
18
+ hourEnabled.splice(index, 1);
19
+ } else {
20
+ hourEnabled.push(hour);
21
+ }
22
+ onHourEnabled(hourEnabled);
23
+ };
24
+ return /*#__PURE__*/_jsx("div", {
25
+ className: "videoPublishCreatTaskHourSelect",
26
+ children: /*#__PURE__*/_jsx(Row, {
27
+ children: Array(24).join(',').split(',').map(function (item, i) {
28
+ return /*#__PURE__*/_jsx(Col, {
29
+ span: 3,
30
+ children: /*#__PURE__*/_jsxs("div", {
31
+ className: "items-hour ".concat(disabled ? 'disabled' : '', " ").concat(hourEnabled.includes(i) ? 'active' : ''),
32
+ onClick: function onClick() {
33
+ return onHour(i);
34
+ },
35
+ children: [i, ":00"]
36
+ })
37
+ }, i);
38
+ })
39
+ })
40
+ });
41
+ };
42
+ export default VideoPublishCreateTaskHourSelect;
@@ -0,0 +1,24 @@
1
+ .videoPublishCreatTaskHourSelect{
2
+ max-width: 720px;
3
+ .items-hour{
4
+ background-color: #F2F2F2;
5
+ padding: 7px 0;
6
+ line-height: 1em;
7
+ margin: 0 3px 3px 0;
8
+ text-align: center;
9
+ border-radius: 2px;
10
+ -webkit-user-select: none;
11
+ -ms-user-select: none;
12
+ user-select: none;
13
+ cursor: pointer;
14
+ transition: all 0.3s ease-in-out;
15
+ -webkit-transition: all 0.3s ease-in-out;
16
+ &.active{
17
+ background-color: #722ED1;
18
+ color: #FFF;
19
+ }
20
+ &.disabled{
21
+ cursor: not-allowed !important;
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import "./index.less";
3
+ interface Props {
4
+ disabled?: boolean;
5
+ productType: VideoPublish.ProductType;
6
+ apiUrl: string;
7
+ env?: Global.Env;
8
+ notVip: boolean;
9
+ }
10
+ declare const VideoPublishCreateTask: React.FC<Props>;
11
+ export default VideoPublishCreateTask;
@@ -0,0 +1,449 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
3
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
4
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
5
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
6
+ import React, { useState } from "react";
7
+ import "./index.less";
8
+ import { Alert, Button, ConfigProvider, Divider, Form, Input, Radio, Select, Space, Tooltip } from "antd";
9
+ import { CheckOutlined, PlusOutlined, ShoppingCartOutlined, UnorderedListOutlined } from "@ant-design/icons";
10
+ import PageContentWarp from "../../UI/PageContentWarp";
11
+ import isInClient from "../../lib/isInClient";
12
+ import Tool from "../../lib/Tool";
13
+ import VideoPublishTaskList from "./task-list";
14
+ import VideoPublishSelectList from "./select-list";
15
+ import { useRequest } from "@umijs/hooks";
16
+ import * as VideoPublishController from "../../service/api/VideoPublishController";
17
+ import fileSelect from "../../base/fileSelect";
18
+ import VideoPublishCreateTaskBase from "../../VideoPublish/create-task/base";
19
+ import dayjs from "dayjs";
20
+ import VideoKindTag, { VideoKindTagList } from "../../component/videoKindTag";
21
+ import sleep from "../../lib/sleep";
22
+ import getVideoGoodsUrl from "../../VideoPublish/create-task/getVideoGoodsUrl";
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import { jsxs as _jsxs } from "react/jsx-runtime";
25
+ var VideoPublishCreateTask = function VideoPublishCreateTask(_ref) {
26
+ var disabled = _ref.disabled,
27
+ productType = _ref.productType,
28
+ apiUrl = _ref.apiUrl,
29
+ env = _ref.env,
30
+ notVip = _ref.notVip;
31
+ var _Form$useForm = Form.useForm(),
32
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
33
+ form = _Form$useForm2[0];
34
+ var _useState = useState({
35
+ videoFrom: productType ? 'task' : 'local',
36
+ taskFromProductType: productType,
37
+ accountList: [],
38
+ normalVideoRate: 1,
39
+ normalVideoRateType: 'hour',
40
+ normalDayMaxCount: 1,
41
+ normalVideoKindRateType: '',
42
+ whoCanView: '0',
43
+ downloadContent: '1',
44
+ publishCoverFrom: '',
45
+ noTopicIsUserRecommendTopic: true,
46
+ startTime: null,
47
+ publishOrder: '',
48
+ salesVideoRate: 2,
49
+ salesVideoRateType: 'hour',
50
+ salesDayMaxCount: 2,
51
+ salesVideoKindRateType: '',
52
+ hourEnabled: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23],
53
+ videoList: []
54
+ }),
55
+ _useState2 = _slicedToArray(_useState, 2),
56
+ formData = _useState2[0],
57
+ setFormData = _useState2[1];
58
+ var _useState3 = useState(false),
59
+ _useState4 = _slicedToArray(_useState3, 2),
60
+ loadingSelectLocal = _useState4[0],
61
+ setLoadingSelectLocal = _useState4[1];
62
+ var _useState5 = useState([]),
63
+ _useState6 = _slicedToArray(_useState5, 2),
64
+ localSelectList = _useState6[0],
65
+ setLocalSelectList = _useState6[1];
66
+ var _useState7 = useState([]),
67
+ _useState8 = _slicedToArray(_useState7, 2),
68
+ taskSelectList = _useState8[0],
69
+ setTaskSelectList = _useState8[1];
70
+ var _useRequest = useRequest(function (data) {
71
+ return VideoPublishController.taskCreate(data, {
72
+ env: env
73
+ });
74
+ }, {
75
+ manual: true,
76
+ onSuccess: function onSuccess(result) {
77
+ // 清除
78
+ setLocalSelectList([]);
79
+ setTaskSelectList([]);
80
+ Tool.toast('任务提交成功');
81
+ }
82
+ }),
83
+ runTask = _useRequest.run,
84
+ loadingTask = _useRequest.loading,
85
+ errorTask = _useRequest.error;
86
+ var onTaskList = function onTaskList() {
87
+ var dialog = Tool.drawer({
88
+ title: '任务列表',
89
+ content: /*#__PURE__*/_jsx(VideoPublishTaskList, {
90
+ defaultSelectList: [],
91
+ apiUrl: apiUrl,
92
+ productType: productType,
93
+ onFinish: function onFinish(list) {
94
+ setTaskSelectList(list);
95
+ dialog.destroy();
96
+ }
97
+ }),
98
+ width: 980
99
+ });
100
+ };
101
+ var onLocalList = /*#__PURE__*/function () {
102
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
103
+ var result, fileList, goodsUrlInfoList, isMatch;
104
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
105
+ while (1) switch (_context.prev = _context.next) {
106
+ case 0:
107
+ setLoadingSelectLocal(true);
108
+ _context.next = 3;
109
+ return fileSelect('video').catch(function (err) {});
110
+ case 3:
111
+ result = _context.sent;
112
+ if (!(!result || (result === null || result === void 0 ? void 0 : result.filePaths.length) <= 0)) {
113
+ _context.next = 7;
114
+ break;
115
+ }
116
+ setLoadingSelectLocal(false);
117
+ return _context.abrupt("return");
118
+ case 7:
119
+ fileList = result === null || result === void 0 ? void 0 : result.filePaths;
120
+ console.log('list:', fileList);
121
+ // 本地选择,累加
122
+ // const localSelectList: VideoPublish.VideoSelectList[] = [];
123
+ fileList.forEach(function (filePath) {
124
+ localSelectList.push({
125
+ id: 0,
126
+ title: Tool.getTitleByPath(filePath),
127
+ // goodsUrl: '',
128
+ videoSize: 0,
129
+ videoDuration: 0,
130
+ videoFinishUrl: filePath,
131
+ introduction: '',
132
+ videoKindTag: '',
133
+ // shopping | location | minapp
134
+ kindTagValue: '',
135
+ goodsTitle: '',
136
+ publishCoverFrom: '',
137
+ whoCanView: '0',
138
+ downloadContent: '1'
139
+ });
140
+ });
141
+ setLocalSelectList(_toConsumableArray(localSelectList));
142
+ setLoadingSelectLocal(false);
143
+ _context.next = 14;
144
+ return getVideoGoodsUrl(localSelectList).catch(function (err) {});
145
+ case 14:
146
+ goodsUrlInfoList = _context.sent;
147
+ if (goodsUrlInfoList) {
148
+ _context.next = 17;
149
+ break;
150
+ }
151
+ return _context.abrupt("return");
152
+ case 17:
153
+ // 合并
154
+ console.log('goodsUrlInfoList:', goodsUrlInfoList);
155
+ isMatch = false;
156
+ goodsUrlInfoList.forEach(function (items, index) {
157
+ if (!items.url) {
158
+ return;
159
+ }
160
+ isMatch = true;
161
+ localSelectList[index].videoKindTag = 'shopping';
162
+ localSelectList[index].kindTagValue = items.url;
163
+ if (items.title) {
164
+ localSelectList[index].goodsTitle = items.title;
165
+ }
166
+ });
167
+ console.log('localSelectList:', localSelectList);
168
+ if (isMatch) {
169
+ setLocalSelectList(_toConsumableArray(localSelectList));
170
+ }
171
+ case 22:
172
+ case "end":
173
+ return _context.stop();
174
+ }
175
+ }, _callee);
176
+ }));
177
+ return function onLocalList() {
178
+ return _ref2.apply(this, arguments);
179
+ };
180
+ }();
181
+ var onFinish = function onFinish(values) {
182
+ var videoList = [];
183
+ if (formData.videoFrom === 'local') {
184
+ localSelectList.forEach(function (item) {
185
+ videoList.push({
186
+ taskId: 0,
187
+ productType: productType,
188
+ title: item.title,
189
+ // goodsUrl: item.goodsUrl,
190
+ videoUrl: item.videoFinishUrl,
191
+ introduction: item.introduction,
192
+ videoKindTag: item.videoKindTag,
193
+ // shopping | location | minapp
194
+ kindTagValue: item.kindTagValue,
195
+ goodsTitle: item.goodsTitle,
196
+ publishCoverFrom: item.publishCoverFrom,
197
+ whoCanView: item.whoCanView,
198
+ downloadContent: item.downloadContent
199
+ });
200
+ });
201
+ } else {
202
+ taskSelectList.forEach(function (item) {
203
+ videoList.push({
204
+ taskId: item.id,
205
+ productType: productType,
206
+ title: item.title,
207
+ // goodsUrl: item.goodsUrl,
208
+ videoUrl: item.videoFinishUrl,
209
+ introduction: item.introduction,
210
+ videoKindTag: item.videoKindTag,
211
+ // shopping | location | minapp
212
+ kindTagValue: item.kindTagValue,
213
+ goodsTitle: item.goodsTitle,
214
+ publishCoverFrom: item.publishCoverFrom,
215
+ whoCanView: item.whoCanView,
216
+ downloadContent: item.downloadContent
217
+ });
218
+ });
219
+ }
220
+ var data = _objectSpread(_objectSpread(_objectSpread({}, formData), values), {}, {
221
+ videoList: videoList
222
+ });
223
+ if (data.startTime) {
224
+ var _values$startTime;
225
+ data.startTime = values.startTime ? parseInt((((_values$startTime = values.startTime) === null || _values$startTime === void 0 ? void 0 : _values$startTime.valueOf()) * 0.001).toFixed(0)) : 0;
226
+ } else {
227
+ data.startTime = Math.floor(Date.now() * 0.001);
228
+ }
229
+ if (videoList.length === 0) {
230
+ Tool.toastError('视频为空,请选择视频');
231
+ return;
232
+ }
233
+ console.log('create task onFinish values:', data);
234
+ runTask(data);
235
+ };
236
+ var onBatchSet = function onBatchSet(kind) {
237
+ (formData.videoFrom == 'local' ? localSelectList : taskSelectList).forEach(function (items) {
238
+ items[kind] = form.getFieldValue(kind);
239
+ });
240
+ if (formData.videoFrom == 'local') {
241
+ setLocalSelectList(_toConsumableArray(localSelectList));
242
+ } else {
243
+ setTaskSelectList(_toConsumableArray(taskSelectList));
244
+ }
245
+ console.log('taskSelectList:', taskSelectList);
246
+ Tool.toast('已经设置');
247
+ };
248
+ var formLabelSpan = 2;
249
+ return /*#__PURE__*/_jsx("div", {
250
+ className: "videoPublishCreateTask",
251
+ children: /*#__PURE__*/_jsxs(PageContentWarp
252
+ // loading={loading}
253
+ // error={errorAccountList}
254
+ // onReload={runAccountList}
255
+ , {
256
+ children: [notVip && /*#__PURE__*/_jsx(Alert, {
257
+ message: "\u4E0D\u662F\u4F1A\u5458\uFF0C\u6682\u4E0D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD",
258
+ type: "warning",
259
+ showIcon: true,
260
+ style: {
261
+ width: 320
262
+ }
263
+ }), /*#__PURE__*/_jsxs(Form, {
264
+ form: form,
265
+ labelCol: {
266
+ span: formLabelSpan
267
+ },
268
+ initialValues: _objectSpread(_objectSpread({}, formData), {}, {
269
+ startTime: typeof formData.startTime === 'number' && formData.startTime > 946684800 ? dayjs(formData.startTime) : null,
270
+ // 仅仅暂时用,不提交
271
+ videoKindTag: ''
272
+ }),
273
+ disabled: disabled || loadingTask,
274
+ scrollToFirstError: true,
275
+ onFinish: onFinish,
276
+ children: [/*#__PURE__*/_jsx(Divider, {
277
+ orientation: "left",
278
+ children: "\u9009\u62E9\u89C6\u9891"
279
+ }), /*#__PURE__*/_jsx(Form.Item, {
280
+ label: "\u89C6\u9891\u6765\u6E90",
281
+ name: "videoFrom",
282
+ children: /*#__PURE__*/_jsxs(Radio.Group, {
283
+ onChange: function onChange(e) {
284
+ formData.videoFrom = e.target.value;
285
+ setFormData(_objectSpread({}, formData));
286
+ },
287
+ children: [/*#__PURE__*/_jsx(Radio, {
288
+ value: "local",
289
+ disabled: !isInClient(),
290
+ children: "\u672C\u5730\u7535\u8111\u89C6\u9891"
291
+ }), productType && /*#__PURE__*/_jsx(Radio, {
292
+ value: "task",
293
+ children: "\u4EFB\u52A1\u89C6\u9891"
294
+ })]
295
+ })
296
+ }), /*#__PURE__*/_jsxs("div", {
297
+ className: "batchOperate",
298
+ children: [/*#__PURE__*/_jsx("div", {}), /*#__PURE__*/_jsxs(Space, {
299
+ size: 20,
300
+ children: [/*#__PURE__*/_jsx(Tooltip, {
301
+ title: "\u5728\u89C6\u9891\u7684\u540C\u6587\u4EF6\u5939\u653E\u4E00\u4E2A\u6587\u672C\u6587\u4EF6(.txt), \u91CC\u9762\u5199 \u5546\u54C1\u6807\u9898\u3001\u5546\u54C1\u94FE\u63A5\uFF0C\u7A0B\u5E8F\u4F1A\u81EA\u52A8\u8BFB\u51FA\u6765\uFF08\u56DE\u8F66\u6362\u884C\u533A\u5206\uFF09",
302
+ children: /*#__PURE__*/_jsx("a", {
303
+ children: /*#__PURE__*/_jsx(ShoppingCartOutlined, {
304
+ className: "shoppingCar"
305
+ })
306
+ })
307
+ }), /*#__PURE__*/_jsx(Divider, {
308
+ type: "vertical"
309
+ }), /*#__PURE__*/_jsx(Form.Item, {
310
+ name: "title",
311
+ children: /*#__PURE__*/_jsx(Input, {
312
+ placeholder: "\u89C6\u9891\u6807\u9898 \u6279\u91CF\u8BBE\u7F6E\u3001\u6E05\u7A7A ",
313
+ className: "videoTitleInput",
314
+ allowClear: true,
315
+ addonAfter: /*#__PURE__*/_jsx("a", {
316
+ onClick: function onClick() {
317
+ return onBatchSet('title');
318
+ },
319
+ children: /*#__PURE__*/_jsx(CheckOutlined, {})
320
+ })
321
+ // onChange={ e => {
322
+ // batchFormData.title = e.target.value ;
323
+ // setBatchFormData({...batchFormData});
324
+ // }}
325
+ })
326
+ }), /*#__PURE__*/_jsx(Form.Item, {
327
+ name: "videoKindTag",
328
+ children: /*#__PURE__*/_jsxs(Select, {
329
+ className: "videoKindTag",
330
+ onChange: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
331
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
332
+ while (1) switch (_context2.prev = _context2.next) {
333
+ case 0:
334
+ _context2.next = 2;
335
+ return sleep(300);
336
+ case 2:
337
+ onBatchSet('videoKindTag');
338
+ case 3:
339
+ case "end":
340
+ return _context2.stop();
341
+ }
342
+ }, _callee2);
343
+ })),
344
+ children: [/*#__PURE__*/_jsxs(Select.Option, {
345
+ value: "",
346
+ children: [/*#__PURE__*/_jsx(UnorderedListOutlined, {}), " \u6279\u91CF\u8BBE\u7F6E\u6807\u7B7E\u7C7B\u578B"]
347
+ }), VideoKindTagList.map(function (item) {
348
+ return /*#__PURE__*/_jsx(Select.Option, {
349
+ value: item.videoKindTag,
350
+ children: /*#__PURE__*/_jsx(VideoKindTag, {
351
+ videoKindTag: item.videoKindTag
352
+ })
353
+ }, item.videoKindTag);
354
+ })]
355
+ })
356
+ }), /*#__PURE__*/_jsx(Form.Item, {
357
+ name: "goodsTitle",
358
+ children: /*#__PURE__*/_jsx(Input, {
359
+ placeholder: "\u5546\u54C1\u6807\u9898 \u6279\u91CF\u8BBE\u7F6E\u3001\u6E05\u7A7A ",
360
+ className: "goodsTitleInput",
361
+ allowClear: true,
362
+ addonAfter: /*#__PURE__*/_jsx("a", {
363
+ onClick: function onClick() {
364
+ return onBatchSet('goodsTitle');
365
+ },
366
+ children: /*#__PURE__*/_jsx(CheckOutlined, {})
367
+ })
368
+ // onChange={ e => {
369
+ // batchFormData.goodsTitle = e.target.value ;
370
+ // setBatchFormData({...batchFormData});
371
+ // }}
372
+ })
373
+ })]
374
+ })]
375
+ }), formData.videoFrom == 'local' && /*#__PURE__*/_jsxs(Form.Item, {
376
+ wrapperCol: {
377
+ offset: formLabelSpan
378
+ },
379
+ children: [/*#__PURE__*/_jsx(VideoPublishSelectList, {
380
+ from: "local",
381
+ list: localSelectList,
382
+ onList: function onList(list) {
383
+ return setTaskSelectList(list);
384
+ }
385
+ }), /*#__PURE__*/_jsx("div", {
386
+ className: "selectFile",
387
+ children: /*#__PURE__*/_jsx(ConfigProvider, {
388
+ theme: {
389
+ components: {
390
+ Button: {
391
+ colorPrimary: '#2b59a1'
392
+ }
393
+ }
394
+ },
395
+ children: /*#__PURE__*/_jsx(Button, {
396
+ type: "primary",
397
+ size: "small",
398
+ loading: loadingSelectLocal,
399
+ icon: /*#__PURE__*/_jsx(PlusOutlined, {}),
400
+ onClick: function onClick() {
401
+ return onLocalList();
402
+ },
403
+ children: "\u9009\u62E9\u672C\u5730\u89C6\u9891"
404
+ })
405
+ })
406
+ })]
407
+ }), formData.videoFrom == 'task' && /*#__PURE__*/_jsxs(Form.Item, {
408
+ wrapperCol: {
409
+ offset: formLabelSpan
410
+ },
411
+ children: [/*#__PURE__*/_jsx(VideoPublishSelectList, {
412
+ from: "task",
413
+ list: taskSelectList,
414
+ onList: function onList(list) {
415
+ return setTaskSelectList(list);
416
+ }
417
+ }), /*#__PURE__*/_jsx("div", {
418
+ className: "selectFile",
419
+ children: /*#__PURE__*/_jsx(Button, {
420
+ type: "primary",
421
+ size: "small",
422
+ icon: /*#__PURE__*/_jsx(PlusOutlined, {}),
423
+ onClick: function onClick() {
424
+ return onTaskList();
425
+ },
426
+ children: "\u9009\u62E9\u4EFB\u52A1"
427
+ })
428
+ })]
429
+ }), /*#__PURE__*/_jsx(VideoPublishCreateTaskBase, {
430
+ disabled: disabled,
431
+ createBaseData: formData,
432
+ onCreateBaseData: function onCreateBaseData(createBase) {
433
+ setFormData(_objectSpread(_objectSpread({}, formData), createBase));
434
+ },
435
+ env: env
436
+ }), /*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx("div", {
437
+ className: "submits",
438
+ children: /*#__PURE__*/_jsx(Button, {
439
+ type: "primary",
440
+ htmlType: "submit",
441
+ loading: loadingTask,
442
+ children: "\u63D0\u4EA4"
443
+ })
444
+ })]
445
+ })]
446
+ })
447
+ });
448
+ };
449
+ export default VideoPublishCreateTask;