component-shipinlv 1.0.50 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/VideoPublish/account-manage/home.d.ts +1 -0
- package/dist/VideoPublish/account-manage/home.js +2 -0
- package/dist/VideoPublish/account-manage/list.d.ts +1 -0
- package/dist/VideoPublish/account-manage/list.js +25 -19
- package/dist/VideoPublish/account-manage/setting/index.js +59 -12
- package/dist/VideoPublish/create-task/index.js +8 -4
- package/dist/VideoPublish/index.d.ts +1 -0
- package/dist/VideoPublish/index.js +22 -10
- package/dist/VideoPublish/log/index.d.ts +7 -1
- package/dist/VideoPublish/log/index.js +27 -10
- package/dist/VideoPublish/log/index.less +44 -46
- package/dist/VideoPublish/publish-task-plan/index.d.ts +8 -0
- package/dist/VideoPublish/publish-task-plan/index.js +16 -0
- package/dist/VideoPublish/publish-task-plan/index.less +4 -0
- package/dist/VideoPublish/publish-task-plan/tool.d.ts +16 -0
- package/dist/VideoPublish/publish-task-plan/tool.js +349 -0
- package/dist/base/fileSelect.d.ts +1 -1
- package/dist/base/folderSelect.d.ts +1 -1
- package/dist/component/file-select.d.ts +18 -0
- package/dist/component/file-select.js +163 -0
- package/dist/component/file-select.less +24 -0
- package/dist/component/folder-select.d.ts +18 -0
- package/dist/component/folder-select.js +190 -0
- package/dist/component/folder-select.less +22 -0
- package/dist/component/is-installed-chrome.d.ts +2 -0
- package/dist/component/is-installed-chrome.js +5 -0
- package/dist/index.js +2 -0
- package/dist/lib/accountManageSettingConfig.js +8 -1
- package/dist/lib/request.js +6 -2
- package/dist/service/api/VideoPublishCrawlerTaskController.d.ts +2 -0
- package/dist/service/api/VideoPublishCrawlerTaskController.js +51 -0
- package/dist/service/api/VideoPublishVideoAccountController.d.ts +1 -1
- package/dist/service/api/VideoPublishVideoAccountController.js +6 -6
- package/dist/service/local/FileController.d.ts +1 -1
- package/dist/types/PublishTaskPlan.d.ts +1 -0
- package/dist/typings/VideoPublishAccountManageSetting.d.ts +2 -0
- package/dist/typings/VideoPublishVideoAccount.d.ts +1 -1
- package/dist/window.d.ts +5 -1
- package/package.json +1 -1
@@ -12,6 +12,7 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
12
|
var VideoPublishAccountManageHomePage = function VideoPublishAccountManageHomePage(_ref) {
|
13
13
|
var apiUrl = _ref.apiUrl,
|
14
14
|
env = _ref.env,
|
15
|
+
onMenu = _ref.onMenu,
|
15
16
|
canPublish = _ref.canPublish;
|
16
17
|
var _useState = useState({
|
17
18
|
id: 0,
|
@@ -101,6 +102,7 @@ var VideoPublishAccountManageHomePage = function VideoPublishAccountManageHomePa
|
|
101
102
|
// accountListDataRef.current = list;
|
102
103
|
// setAccountListData( list )
|
103
104
|
},
|
105
|
+
onMenu: onMenu,
|
104
106
|
onCurrent: function onCurrent(userInfo) {
|
105
107
|
return setAccountDetail(userInfo);
|
106
108
|
}
|
@@ -18,12 +18,16 @@ import Notification from "../../lib/notification";
|
|
18
18
|
import Money from "../../UI/Money";
|
19
19
|
import AccountManageSettingConfig from "../../lib/accountManageSettingConfig";
|
20
20
|
import VideoPlatform from "../../component/video-platform/logo";
|
21
|
+
import isInstalledChrome from "../../component/is-installed-chrome";
|
22
|
+
import Tool from "../../lib/Tool";
|
21
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
22
24
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
23
25
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
24
26
|
var HomePageAccountList = function HomePageAccountList(_ref) {
|
25
27
|
var apiUrl = _ref.apiUrl,
|
26
28
|
env = _ref.env,
|
29
|
+
_ref$onMenu = _ref.onMenu,
|
30
|
+
onMenu = _ref$onMenu === void 0 ? function () {} : _ref$onMenu,
|
27
31
|
_ref$onListData = _ref.onListData,
|
28
32
|
onListData = _ref$onListData === void 0 ? function () {} : _ref$onListData,
|
29
33
|
_ref$onCurrent = _ref.onCurrent,
|
@@ -143,24 +147,23 @@ var HomePageAccountList = function HomePageAccountList(_ref) {
|
|
143
147
|
var _keyword$replace;
|
144
148
|
var list = (keyword === null || keyword === void 0 || (_keyword$replace = keyword.replace(/\s+/g, '')) === null || _keyword$replace === void 0 ? void 0 : _keyword$replace.split('')) || [];
|
145
149
|
setKeywordList(list);
|
150
|
+
run();
|
146
151
|
};
|
147
152
|
var onAdd = /*#__PURE__*/function () {
|
148
153
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(platform) {
|
149
|
-
var _window$bridge;
|
154
|
+
var _window$bridge, _window;
|
150
155
|
var settingConfig, addAccountResult, postData;
|
151
156
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
152
157
|
while (1) switch (_context.prev = _context.next) {
|
153
158
|
case 0:
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
// }
|
163
|
-
|
159
|
+
if (isInstalledChrome()) {
|
160
|
+
_context.next = 4;
|
161
|
+
break;
|
162
|
+
}
|
163
|
+
Tool.toast('没有安装谷歌浏览器(Chrome),请安装');
|
164
|
+
onMenu('setting');
|
165
|
+
return _context.abrupt("return");
|
166
|
+
case 4:
|
164
167
|
console.log('onAdd:', platform);
|
165
168
|
toast('正在启动浏览器,请扫码登录', 12);
|
166
169
|
|
@@ -169,24 +172,24 @@ var HomePageAccountList = function HomePageAccountList(_ref) {
|
|
169
172
|
// console.log('eventName:', eventName );
|
170
173
|
// window.bridge.ipcRenderer.sendMessage( eventName ); // 添加抖音账号
|
171
174
|
settingConfig = AccountManageSettingConfig();
|
172
|
-
_context.next =
|
173
|
-
return (_window$bridge = window.bridge()) === null || _window$bridge === void 0 ? void 0 : _window$bridge.ipcRenderer.invoke('shipinlv-video-account-add', platform, settingConfig.isChromeOpen).catch(function (err) {
|
175
|
+
_context.next = 9;
|
176
|
+
return (_window$bridge = (_window = window).bridge) === null || _window$bridge === void 0 || (_window$bridge = _window$bridge.call(_window)) === null || _window$bridge === void 0 ? void 0 : _window$bridge.ipcRenderer.invoke('shipinlv-video-account-add', platform, settingConfig.isChromeOpen).catch(function (err) {
|
174
177
|
Notification.notificationError('获取账号信息错误' + ((err === null || err === void 0 ? void 0 : err.message) || JSON.stringify(err)));
|
175
178
|
});
|
176
|
-
case
|
179
|
+
case 9:
|
177
180
|
addAccountResult = _context.sent;
|
178
181
|
if (addAccountResult) {
|
179
|
-
_context.next =
|
182
|
+
_context.next = 12;
|
180
183
|
break;
|
181
184
|
}
|
182
185
|
return _context.abrupt("return");
|
183
|
-
case
|
186
|
+
case 12:
|
184
187
|
console.log('addAccountResult:', addAccountResult, env);
|
185
188
|
postData = {
|
186
189
|
detail: addAccountResult
|
187
190
|
};
|
188
191
|
runCreate(postData);
|
189
|
-
case
|
192
|
+
case 15:
|
190
193
|
case "end":
|
191
194
|
return _context.stop();
|
192
195
|
}
|
@@ -210,6 +213,9 @@ var HomePageAccountList = function HomePageAccountList(_ref) {
|
|
210
213
|
});
|
211
214
|
});
|
212
215
|
setPlatformMenuItems(platformMenuItems);
|
216
|
+
event.on('video-publish-auth-change', function () {
|
217
|
+
run();
|
218
|
+
});
|
213
219
|
}, []);
|
214
220
|
var addButton = function addButton() {
|
215
221
|
return /*#__PURE__*/_jsx("div", {
|
@@ -376,7 +382,7 @@ var HomePageAccountList = function HomePageAccountList(_ref) {
|
|
376
382
|
children: [/*#__PURE__*/_jsx(VideoPlatformLogo, {
|
377
383
|
platform: item.platform,
|
378
384
|
size: 14
|
379
|
-
}), shopName, /*#__PURE__*/_jsx("div", {
|
385
|
+
}), shopName, "\u5907\u6CE8", /*#__PURE__*/_jsx("div", {
|
380
386
|
className: "uniqueId",
|
381
387
|
children: item.uniqueId
|
382
388
|
})]
|
@@ -386,7 +392,7 @@ var HomePageAccountList = function HomePageAccountList(_ref) {
|
|
386
392
|
}), listData.length == 0 && /*#__PURE__*/_jsxs("div", {
|
387
393
|
className: "empty",
|
388
394
|
children: [/*#__PURE__*/_jsx(Empty, {
|
389
|
-
description: "\u6682\u65E0\u7ED1\u5B9A\u8D26\u53F7",
|
395
|
+
description: "\u672C\u673A\u6682\u65E0\u7ED1\u5B9A\u8D26\u53F7",
|
390
396
|
image: Empty.PRESENTED_IMAGE_SIMPLE
|
391
397
|
}), addButton()]
|
392
398
|
})]
|
@@ -4,21 +4,27 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
5
5
|
import _objectDestructuringEmpty from "@babel/runtime/helpers/esm/objectDestructuringEmpty";
|
6
6
|
import React, { useEffect, useState } from 'react';
|
7
|
-
import { Form, Switch } from 'antd';
|
7
|
+
import { ConfigProvider, Form, Switch } from 'antd';
|
8
8
|
import "./index.less";
|
9
9
|
import LayoutContent from "../../../UI/LayoutContent";
|
10
10
|
import AccountManageSettingConfig from "../../../lib/accountManageSettingConfig";
|
11
|
+
import FileSelect from "../../../component/file-select";
|
12
|
+
import Tool from "../../../lib/Tool";
|
11
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
14
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
12
15
|
var AccountManageSettingPage = function AccountManageSettingPage(_ref) {
|
13
16
|
_objectDestructuringEmpty(_ref);
|
17
|
+
var _useState = useState(Tool.getOsName() === 'darwin' ? '.app' : '.exe'),
|
18
|
+
_useState2 = _slicedToArray(_useState, 1),
|
19
|
+
extName = _useState2[0];
|
14
20
|
var _Form$useForm = Form.useForm(),
|
15
21
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
16
22
|
form = _Form$useForm2[0];
|
17
|
-
var
|
18
|
-
|
19
|
-
formData =
|
20
|
-
setFormData =
|
21
|
-
var
|
23
|
+
var _useState3 = useState(_objectSpread({}, AccountManageSettingConfig())),
|
24
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
25
|
+
formData = _useState4[0],
|
26
|
+
setFormData = _useState4[1];
|
27
|
+
var _onFinish = function onFinish(data) {
|
22
28
|
AccountManageSettingConfig(data);
|
23
29
|
};
|
24
30
|
var onInit = /*#__PURE__*/function () {
|
@@ -42,15 +48,40 @@ var AccountManageSettingPage = function AccountManageSettingPage(_ref) {
|
|
42
48
|
title: "\u8BBE\u7F6E",
|
43
49
|
subtitle: "",
|
44
50
|
className: "videoPublishAccountManageSetting",
|
45
|
-
children: /*#__PURE__*/
|
51
|
+
children: /*#__PURE__*/_jsxs(Form, {
|
46
52
|
form: form,
|
47
53
|
labelCol: {
|
48
|
-
span:
|
54
|
+
span: 5
|
49
55
|
},
|
50
56
|
autoComplete: "off",
|
51
57
|
initialValues: _objectSpread({}, formData),
|
52
|
-
children: /*#__PURE__*/_jsx(
|
53
|
-
|
58
|
+
children: [/*#__PURE__*/_jsx(ConfigProvider, {
|
59
|
+
theme: {
|
60
|
+
token: {
|
61
|
+
colorPrimary: '#C00',
|
62
|
+
colorTextQuaternary: '#722ED1'
|
63
|
+
},
|
64
|
+
components: {
|
65
|
+
Switch: {
|
66
|
+
/* 这里是你的组件 token */
|
67
|
+
}
|
68
|
+
}
|
69
|
+
},
|
70
|
+
children: /*#__PURE__*/_jsx(Form.Item, {
|
71
|
+
label: "\u672C\u673A\u505C\u6B62\u63A5\u53D1\u5E03\u4EFB\u52A1",
|
72
|
+
name: "disabledApplyTask",
|
73
|
+
children: /*#__PURE__*/_jsx(Switch, {
|
74
|
+
checkedChildren: "\u7981\u7528\u81EA\u52A8\u53D1\u5E03\u4EFB\u52A1",
|
75
|
+
unCheckedChildren: "\u5F00\u542F\u81EA\u52A8\u53D1\u5E03\u4EFB\u52A1",
|
76
|
+
onChange: function onChange(disabledApplyTask) {
|
77
|
+
formData.disabledApplyTask = disabledApplyTask;
|
78
|
+
setFormData(_objectSpread({}, formData));
|
79
|
+
_onFinish(formData);
|
80
|
+
}
|
81
|
+
})
|
82
|
+
})
|
83
|
+
}), /*#__PURE__*/_jsx(Form.Item, {
|
84
|
+
label: "\u5DE5\u4F5C\u65F6\u662F\u5426\u663E\u793A\u6D4F\u89C8\u5668",
|
54
85
|
name: "isChromeOpen",
|
55
86
|
extra: "\u8C03\u8BD5\u6D4B\u8BD5\u65F6\u6253\u5F00\uFF0C\u6B63\u5E38\u60C5\u51B5\u4E0B \u9690\u85CF\u6D4F\u89C8\u5668",
|
56
87
|
children: /*#__PURE__*/_jsx(Switch, {
|
@@ -59,10 +90,26 @@ var AccountManageSettingPage = function AccountManageSettingPage(_ref) {
|
|
59
90
|
onChange: function onChange(isChromeOpen) {
|
60
91
|
formData.isChromeOpen = isChromeOpen;
|
61
92
|
setFormData(_objectSpread({}, formData));
|
62
|
-
|
93
|
+
_onFinish(formData);
|
94
|
+
}
|
95
|
+
})
|
96
|
+
}), /*#__PURE__*/_jsx(Form.Item, {
|
97
|
+
label: "\u8C37\u6B4C\u6D4F\u89C8\u5668\uFF08Chrome\uFF09\u4F4D\u7F6E"
|
98
|
+
// name="disabledApplyTask"
|
99
|
+
,
|
100
|
+
children: /*#__PURE__*/_jsx(FileSelect, {
|
101
|
+
path: formData.chromePath,
|
102
|
+
disabled: false,
|
103
|
+
placeholder: "\u8BF7\u9009\u62E9 Chrome \u6D4F\u89C8\u5668\u8DEF\u5F84",
|
104
|
+
allowClear: false,
|
105
|
+
extName: extName,
|
106
|
+
onFinish: function onFinish(chromePath) {
|
107
|
+
formData.chromePath = chromePath;
|
108
|
+
setFormData(_objectSpread({}, formData));
|
109
|
+
_onFinish(formData);
|
63
110
|
}
|
64
111
|
})
|
65
|
-
})
|
112
|
+
})]
|
66
113
|
})
|
67
114
|
});
|
68
115
|
};
|
@@ -133,7 +133,6 @@ var VideoPublishCreateTask = function VideoPublishCreateTask(_ref) {
|
|
133
133
|
};
|
134
134
|
}();
|
135
135
|
var onFinish = function onFinish(values) {
|
136
|
-
var _values$startTime;
|
137
136
|
var videoList = [];
|
138
137
|
if (formData.videoFrom === 'local') {
|
139
138
|
localSelectList.forEach(function (item) {
|
@@ -167,14 +166,17 @@ var VideoPublishCreateTask = function VideoPublishCreateTask(_ref) {
|
|
167
166
|
});
|
168
167
|
}
|
169
168
|
var data = _objectSpread(_objectSpread(_objectSpread({}, formData), values), {}, {
|
170
|
-
startTime: values.startTime ? parseInt((((_values$startTime = values.startTime) === null || _values$startTime === void 0 ? void 0 : _values$startTime.valueOf()) * 0.001).toFixed(0)) : 0,
|
171
169
|
videoList: videoList
|
172
170
|
});
|
171
|
+
if (data.startTime) {
|
172
|
+
var _values$startTime;
|
173
|
+
data.startTime = values.startTime ? parseInt((((_values$startTime = values.startTime) === null || _values$startTime === void 0 ? void 0 : _values$startTime.valueOf()) * 0.001).toFixed(0)) : 0;
|
174
|
+
}
|
173
175
|
if (videoList.length === 0) {
|
174
176
|
Tool.toastError('视频为空,请选择视频');
|
175
177
|
return;
|
176
178
|
}
|
177
|
-
console.log('values:', data);
|
179
|
+
console.log('create task onFinish values:', data);
|
178
180
|
runTask(data);
|
179
181
|
};
|
180
182
|
var formLabelSpan = 2;
|
@@ -226,7 +228,9 @@ var VideoPublishCreateTask = function VideoPublishCreateTask(_ref) {
|
|
226
228
|
children: [/*#__PURE__*/_jsx(VideoPublishSelectList, {
|
227
229
|
from: "local",
|
228
230
|
list: localSelectList,
|
229
|
-
onList: function onList() {
|
231
|
+
onList: function onList(list) {
|
232
|
+
return setTaskSelectList(list);
|
233
|
+
}
|
230
234
|
}), /*#__PURE__*/_jsx("div", {
|
231
235
|
className: "selectFile",
|
232
236
|
children: /*#__PURE__*/_jsx(ConfigProvider, {
|
@@ -10,6 +10,7 @@ import VideoPublishTaskList from "./task-list";
|
|
10
10
|
import VideoPublishLog from "./log";
|
11
11
|
import VideoPublishAccountManageSettingPage from "./account-manage/setting";
|
12
12
|
import VideoPublishAccountManageHomePage from "./account-manage/home";
|
13
|
+
import VideoPublishPublishVideoPlan from "./publish-task-plan";
|
13
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
14
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
15
16
|
var VideoPublish = function VideoPublish(_ref) {
|
@@ -19,7 +20,8 @@ var VideoPublish = function VideoPublish(_ref) {
|
|
19
20
|
contentHeight = _ref.contentHeight,
|
20
21
|
productType = _ref.productType,
|
21
22
|
apiUrl = _ref.apiUrl,
|
22
|
-
env = _ref.env
|
23
|
+
env = _ref.env,
|
24
|
+
clientUniqueKey = _ref.clientUniqueKey;
|
23
25
|
var _useState = useState([]),
|
24
26
|
_useState2 = _slicedToArray(_useState, 2),
|
25
27
|
menuList = _useState2[0],
|
@@ -39,7 +41,10 @@ var VideoPublish = function VideoPublish(_ref) {
|
|
39
41
|
children: /*#__PURE__*/_jsx(VideoPublishAccountManageHomePage, {
|
40
42
|
apiUrl: apiUrl,
|
41
43
|
env: env,
|
42
|
-
canPublish: canPublish
|
44
|
+
canPublish: canPublish,
|
45
|
+
onMenu: function onMenu(key) {
|
46
|
+
return _onMenu(key);
|
47
|
+
}
|
43
48
|
})
|
44
49
|
}, {
|
45
50
|
key: 'video-account',
|
@@ -76,13 +81,17 @@ var VideoPublish = function VideoPublish(_ref) {
|
|
76
81
|
disabled: !canPublish,
|
77
82
|
children: /*#__PURE__*/_jsx(VideoPublishAccountManageSettingPage, {})
|
78
83
|
}, {
|
79
|
-
key: 'log',
|
84
|
+
key: 'publish-log',
|
80
85
|
icon: /*#__PURE__*/_jsx(FileSearchOutlined, {}),
|
81
|
-
label: '
|
86
|
+
label: '发布日志',
|
82
87
|
disabled: !canPublish,
|
83
|
-
|
88
|
+
forceRender: canPublish,
|
89
|
+
children: /*#__PURE__*/_jsx(VideoPublishLog, {
|
90
|
+
env: env,
|
91
|
+
clientUniqueKey: clientUniqueKey
|
92
|
+
})
|
84
93
|
}];
|
85
|
-
var
|
94
|
+
var _onMenu = function _onMenu(key) {
|
86
95
|
setActiveKey(key);
|
87
96
|
};
|
88
97
|
var onInit = function onInit() {
|
@@ -110,11 +119,11 @@ var VideoPublish = function VideoPublish(_ref) {
|
|
110
119
|
useEffect(function () {
|
111
120
|
onInit();
|
112
121
|
}, []);
|
113
|
-
return /*#__PURE__*/
|
122
|
+
return /*#__PURE__*/_jsxs("div", {
|
114
123
|
style: {
|
115
124
|
minHeight: contentHeight ? contentHeight : '100%'
|
116
125
|
},
|
117
|
-
children: /*#__PURE__*/_jsxs("div", {
|
126
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
118
127
|
className: "videoPublish",
|
119
128
|
style: {
|
120
129
|
height: contentHeight ? contentHeight : '100%'
|
@@ -126,7 +135,7 @@ var VideoPublish = function VideoPublish(_ref) {
|
|
126
135
|
children: /*#__PURE__*/_jsx(Menu, {
|
127
136
|
className: "menu",
|
128
137
|
onClick: function onClick(e) {
|
129
|
-
return
|
138
|
+
return _onMenu(e.key);
|
130
139
|
},
|
131
140
|
style: {
|
132
141
|
width: '100%'
|
@@ -146,7 +155,10 @@ var VideoPublish = function VideoPublish(_ref) {
|
|
146
155
|
items: tabsItems
|
147
156
|
})
|
148
157
|
})]
|
149
|
-
})
|
158
|
+
}), /*#__PURE__*/_jsx(VideoPublishPublishVideoPlan, {
|
159
|
+
env: env,
|
160
|
+
clientUniqueKey: clientUniqueKey
|
161
|
+
})]
|
150
162
|
});
|
151
163
|
};
|
152
164
|
export default VideoPublish;
|
@@ -1,2 +1,8 @@
|
|
1
|
+
import React from "react";
|
1
2
|
import './index.less';
|
2
|
-
|
3
|
+
interface Props {
|
4
|
+
env?: Global.Env;
|
5
|
+
clientUniqueKey: string;
|
6
|
+
}
|
7
|
+
declare const VideoPublishLog: React.FC<Props>;
|
8
|
+
export default VideoPublishLog;
|
@@ -9,10 +9,13 @@ import { Divider, Empty, Tooltip } from "antd";
|
|
9
9
|
import event from "../../lib/event";
|
10
10
|
import math from "../../lib/math";
|
11
11
|
import Time from "../../UI/Time";
|
12
|
+
import * as VideoPublishVideoAccountController from "../../service/api/VideoPublishVideoAccountController";
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
13
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
14
15
|
var MaxLine = 10000;
|
15
|
-
|
16
|
+
var VideoPublishLog = function VideoPublishLog(_ref) {
|
17
|
+
var clientUniqueKey = _ref.clientUniqueKey,
|
18
|
+
env = _ref.env;
|
16
19
|
var _useState = useState(0),
|
17
20
|
_useState2 = _slicedToArray(_useState, 2),
|
18
21
|
logAmount = _useState2[0],
|
@@ -43,10 +46,23 @@ export default function VideoPublishLog() {
|
|
43
46
|
});
|
44
47
|
setLastTaskApplyTime(Math.floor(Date.now() * 0.001));
|
45
48
|
});
|
46
|
-
event.on('log', function (data) {
|
49
|
+
event.on('shipinlv-video-publish-log', function (data) {
|
47
50
|
console.log('log data:', data);
|
48
|
-
switch (data.code) {
|
51
|
+
switch (data === null || data === void 0 ? void 0 : data.code) {
|
49
52
|
case 'not-login':
|
53
|
+
// 上报
|
54
|
+
VideoPublishVideoAccountController.saveLoginStatus({
|
55
|
+
clientUniqueKey: clientUniqueKey,
|
56
|
+
platformVideoAccountId: data.platformAccountId,
|
57
|
+
platform: data.platform,
|
58
|
+
isLogin: false,
|
59
|
+
loginValidMessage: data.message
|
60
|
+
}, {
|
61
|
+
env: env
|
62
|
+
}).catch(function (err) {
|
63
|
+
console.log("上报登录失败", err === null || err === void 0 ? void 0 : err.message);
|
64
|
+
});
|
65
|
+
event.run('video-publish-auth-change');
|
50
66
|
break;
|
51
67
|
}
|
52
68
|
var logKey = data.logKey ? data.logKey : math.randWord(10);
|
@@ -88,17 +104,17 @@ export default function VideoPublishLog() {
|
|
88
104
|
return function () {};
|
89
105
|
}, []);
|
90
106
|
return /*#__PURE__*/_jsx(LayoutContent, {
|
91
|
-
title: "\u65E5\u5FD7",
|
107
|
+
title: "\u53D1\u5E03\u65E5\u5FD7",
|
92
108
|
extInfo: /*#__PURE__*/_jsxs("div", {
|
93
|
-
children: [
|
94
|
-
time: lastTaskApplyTime
|
95
|
-
}), /*#__PURE__*/_jsx(Divider, {
|
96
|
-
type: "vertical"
|
97
|
-
}), /*#__PURE__*/_jsxs(Tooltip, {
|
109
|
+
children: [/*#__PURE__*/_jsxs(Tooltip, {
|
98
110
|
title: "\u672C\u6B21\u8FD0\u884C\u5171\u8BF7\u6C42\u4EFB\u52A1\u6570",
|
99
111
|
children: [logAmount, " ", /*#__PURE__*/_jsx("small", {
|
100
112
|
children: "\u6B21"
|
101
113
|
})]
|
114
|
+
}), /*#__PURE__*/_jsx(Divider, {
|
115
|
+
type: "vertical"
|
116
|
+
}), lastTaskApplyTime && /*#__PURE__*/_jsx(Time, {
|
117
|
+
time: lastTaskApplyTime
|
102
118
|
})]
|
103
119
|
}),
|
104
120
|
className: "videoPublishLog",
|
@@ -119,4 +135,5 @@ export default function VideoPublishLog() {
|
|
119
135
|
})]
|
120
136
|
})
|
121
137
|
});
|
122
|
-
}
|
138
|
+
};
|
139
|
+
export default VideoPublishLog;
|
@@ -1,23 +1,22 @@
|
|
1
1
|
.videoPublishLog{
|
2
2
|
font-size: 13px;
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
border-radius: 3px;
|
16
|
-
}
|
17
|
-
.ant-progress-line{
|
18
|
-
max-width: 200px;
|
19
|
-
}
|
3
|
+
.created{
|
4
|
+
margin: 0 6px 0 0;
|
5
|
+
padding: 2px 4px;
|
6
|
+
background-color: #F2F2F2;
|
7
|
+
font-weight: 300;
|
8
|
+
//opacity: 0.7;
|
9
|
+
font-size: 13px;
|
10
|
+
min-width: 62px;
|
11
|
+
text-align: center;
|
12
|
+
display: inline-block;
|
13
|
+
line-height: 1em;
|
14
|
+
border-radius: 3px;
|
20
15
|
}
|
16
|
+
.ant-progress-line{
|
17
|
+
max-width: 200px;
|
18
|
+
}
|
19
|
+
|
21
20
|
pre{
|
22
21
|
word-break: break-all;
|
23
22
|
white-space: break-spaces;
|
@@ -48,36 +47,35 @@
|
|
48
47
|
}
|
49
48
|
}
|
50
49
|
}
|
51
|
-
:global{
|
52
|
-
.anticon{
|
53
|
-
margin-right: 5px;
|
54
|
-
//vertical-align: middle;
|
55
|
-
}
|
56
|
-
.ant-tag{
|
57
|
-
padding-inline: 0 5px;
|
58
|
-
padding: 0 5px !important;
|
59
|
-
line-height: 18px !important;
|
60
|
-
}
|
61
|
-
.icon-warn{
|
62
|
-
color: #F60;
|
63
|
-
font-size: 1.05em;
|
64
|
-
}
|
65
|
-
.icon-success{
|
66
|
-
color: green;
|
67
|
-
font-size: 1.05em;
|
68
|
-
}
|
69
|
-
.icon-wait{
|
70
|
-
color: blue;
|
71
|
-
font-size: 1.05em;
|
72
|
-
}
|
73
|
-
.icon-fail{
|
74
|
-
color: #C00;
|
75
|
-
font-size: 1.05em;
|
76
50
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
51
|
+
.anticon{
|
52
|
+
margin-right: 5px;
|
53
|
+
//vertical-align: middle;
|
54
|
+
}
|
55
|
+
.ant-tag{
|
56
|
+
padding-inline: 0 5px;
|
57
|
+
padding: 0 5px !important;
|
58
|
+
line-height: 18px !important;
|
59
|
+
}
|
60
|
+
.icon-warn{
|
61
|
+
color: #F60;
|
62
|
+
font-size: 1.05em;
|
63
|
+
}
|
64
|
+
.icon-success{
|
65
|
+
color: green;
|
66
|
+
font-size: 1.05em;
|
67
|
+
}
|
68
|
+
.icon-wait{
|
69
|
+
color: blue;
|
70
|
+
font-size: 1.05em;
|
71
|
+
}
|
72
|
+
.icon-fail{
|
73
|
+
color: #C00;
|
74
|
+
font-size: 1.05em;
|
75
|
+
|
76
|
+
}
|
77
|
+
.padVideo-Progress{
|
78
|
+
width: 200px;
|
81
79
|
}
|
82
80
|
}
|
83
81
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import React, { useEffect } from 'react';
|
2
|
+
import "./index.less";
|
3
|
+
import PublishTaskPlanClass from "./tool";
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
+
var VideoPublishPublishVideoPlan = function VideoPublishPublishVideoPlan(_ref) {
|
6
|
+
var env = _ref.env,
|
7
|
+
clientUniqueKey = _ref.clientUniqueKey;
|
8
|
+
useEffect(function () {
|
9
|
+
var publishTaskPlan = new PublishTaskPlanClass(env, clientUniqueKey);
|
10
|
+
publishTaskPlan.onInit();
|
11
|
+
}, []);
|
12
|
+
return /*#__PURE__*/_jsx("div", {
|
13
|
+
className: "publishVideoPlan"
|
14
|
+
});
|
15
|
+
};
|
16
|
+
export default VideoPublishPublishVideoPlan;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
declare class PublishTaskPlanClass {
|
2
|
+
timeLoopMillisecond: number;
|
3
|
+
isPublishing: boolean;
|
4
|
+
env: Global.Env | undefined;
|
5
|
+
clientUniqueKey: string;
|
6
|
+
constructor(env?: Global.Env, clientUniqueKey?: string);
|
7
|
+
onInit(): void;
|
8
|
+
getWork(): Promise<void>;
|
9
|
+
doWork(taskDetail: PublishTaskPlan.TaskDetail): Promise<void>;
|
10
|
+
onLog(query: VideoPublishLog.Receive): Promise<void>;
|
11
|
+
doWorkWait(): Promise<void>;
|
12
|
+
onReport(success: boolean, message: string, saveBaseData: PublishTaskPlan.ReportTaskQueryBaseInfo): void;
|
13
|
+
onTaskGet(): Promise<PublishTaskPlan.TaskDetail>;
|
14
|
+
onPublishVideo(platform: Global.VideoPlatformKind, platformVideoAccountId: string, taskInfo: PublishTaskPlan.TaskInfo): Promise<PublishNpm.VideoPublishResult>;
|
15
|
+
}
|
16
|
+
export default PublishTaskPlanClass;
|