component-shipinlv 1.0.37 → 1.0.51

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. package/dist/VideoPublish/account-manage/home.d.ts +1 -0
  2. package/dist/VideoPublish/account-manage/home.js +5 -3
  3. package/dist/VideoPublish/account-manage/list.d.ts +1 -0
  4. package/dist/VideoPublish/account-manage/list.js +29 -21
  5. package/dist/VideoPublish/account-manage/list.less +9 -1
  6. package/dist/VideoPublish/account-manage/setting/index.js +59 -12
  7. package/dist/VideoPublish/index.d.ts +1 -0
  8. package/dist/VideoPublish/index.js +25 -12
  9. package/dist/VideoPublish/index.less +4 -4
  10. package/dist/VideoPublish/log/index.d.ts +7 -1
  11. package/dist/VideoPublish/log/index.js +27 -10
  12. package/dist/VideoPublish/log/index.less +44 -46
  13. package/dist/VideoPublish/publish-task-plan/index.d.ts +8 -0
  14. package/dist/VideoPublish/publish-task-plan/index.js +16 -0
  15. package/dist/VideoPublish/publish-task-plan/index.less +4 -0
  16. package/dist/VideoPublish/publish-task-plan/tool.d.ts +16 -0
  17. package/dist/VideoPublish/publish-task-plan/tool.js +349 -0
  18. package/dist/VideoPublish/video-account/index.less +1 -0
  19. package/dist/base/fileSelect.d.ts +1 -1
  20. package/dist/base/folderSelect.d.ts +1 -1
  21. package/dist/component/file-select.d.ts +18 -0
  22. package/dist/component/file-select.js +163 -0
  23. package/dist/component/file-select.less +24 -0
  24. package/dist/component/folder-select.d.ts +18 -0
  25. package/dist/component/folder-select.js +190 -0
  26. package/dist/component/folder-select.less +22 -0
  27. package/dist/component/is-installed-chrome.d.ts +2 -0
  28. package/dist/component/is-installed-chrome.js +5 -0
  29. package/dist/index.js +2 -0
  30. package/dist/lib/Tool.d.ts +1 -1
  31. package/dist/lib/accountManageSettingConfig.js +8 -1
  32. package/dist/service/api/VideoPublishController.js +1 -0
  33. package/dist/service/api/VideoPublishCrawlerTaskController.d.ts +2 -0
  34. package/dist/service/api/VideoPublishCrawlerTaskController.js +51 -0
  35. package/dist/service/api/VideoPublishVideoAccountController.d.ts +1 -1
  36. package/dist/service/api/VideoPublishVideoAccountController.js +6 -6
  37. package/dist/service/local/FileController.d.ts +1 -1
  38. package/dist/typings/VideoPublishAccountManageSetting.d.ts +2 -0
  39. package/dist/window.d.ts +4 -1
  40. package/package.json +1 -1
@@ -3,6 +3,7 @@ import './home.less';
3
3
  interface Props {
4
4
  apiUrl: string;
5
5
  env?: Global.Env;
6
+ onMenu: (key: string) => void;
6
7
  canPublish?: boolean;
7
8
  }
8
9
  declare const VideoPublishAccountManageHomePage: React.FC<Props>;
@@ -5,13 +5,14 @@ import "./home.less";
5
5
  import { VideoPlatform } from "../..";
6
6
  import HomePageAccountList from "./list";
7
7
  import Time from "../../UI/Time";
8
- import { PlusCircleOutlined } from "@ant-design/icons";
8
+ import { IeOutlined } from "@ant-design/icons";
9
9
  import { jsx as _jsx } from "react/jsx-runtime";
10
10
  import { Fragment as _Fragment } from "react/jsx-runtime";
11
11
  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
  }
@@ -130,10 +132,10 @@ var VideoPublishAccountManageHomePage = function VideoPublishAccountManageHomePa
130
132
  }
131
133
  },
132
134
  children: /*#__PURE__*/_jsx(Button, {
133
- icon: /*#__PURE__*/_jsx(PlusCircleOutlined, {}),
135
+ icon: /*#__PURE__*/_jsx(IeOutlined, {}),
134
136
  type: "primary",
135
137
  size: "small",
136
- children: "\u6D4F\u89C8\u5668"
138
+ children: "\u624B\u5DE5\u64CD\u4F5C"
137
139
  })
138
140
  }),
139
141
  children: [/*#__PURE__*/_jsxs("div", {
@@ -3,6 +3,7 @@ import './list.less';
3
3
  interface Props {
4
4
  apiUrl: string;
5
5
  env?: Global.Env;
6
+ onMenu: (key: string) => void;
6
7
  onListData: (list: VideoPublishVideoAccount.List[]) => void;
7
8
  onCurrent: (detail: VideoPublishVideoAccount.List) => void;
8
9
  }
@@ -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,
@@ -127,7 +131,9 @@ var HomePageAccountList = function HomePageAccountList(_ref) {
127
131
  onCurrent(listDataRef.current[index]);
128
132
  };
129
133
  var _useRequest3 = useRequest(function (data) {
130
- return VideoPublishVideoAccountController.create(data);
134
+ return VideoPublishVideoAccountController.create(data, {
135
+ env: env
136
+ });
131
137
  }, {
132
138
  manual: true,
133
139
  onSuccess: function onSuccess(result) {
@@ -141,50 +147,49 @@ var HomePageAccountList = function HomePageAccountList(_ref) {
141
147
  var _keyword$replace;
142
148
  var list = (keyword === null || keyword === void 0 || (_keyword$replace = keyword.replace(/\s+/g, '')) === null || _keyword$replace === void 0 ? void 0 : _keyword$replace.split('')) || [];
143
149
  setKeywordList(list);
150
+ run();
144
151
  };
145
152
  var onAdd = /*#__PURE__*/function () {
146
153
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(platform) {
147
- var _window$bridge;
154
+ var _window$bridge, _window;
148
155
  var settingConfig, addAccountResult, postData;
149
156
  return _regeneratorRuntime().wrap(function _callee$(_context) {
150
157
  while (1) switch (_context.prev = _context.next) {
151
158
  case 0:
152
- // if ( ! userInfo.isLogin ){
153
- // const authResult = await goAuth()?.catch( err => {
154
- //
155
- // });
156
- // if( ! authResult ){
157
- // console.log('登录失败' );
158
- // return;
159
- // }
160
- // }
161
-
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:
162
167
  console.log('onAdd:', platform);
163
- toast('正在启动浏览器,请扫码登录', 6);
168
+ toast('正在启动浏览器,请扫码登录', 12);
164
169
 
165
170
  // const platformName = platform ; // == 'kuaishou' ? 'kwai' : '';
166
171
  // const eventName = `amz-${ platform }-publish--add-account`;
167
172
  // console.log('eventName:', eventName );
168
173
  // window.bridge.ipcRenderer.sendMessage( eventName ); // 添加抖音账号
169
174
  settingConfig = AccountManageSettingConfig();
170
- _context.next = 5;
171
- 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) {
172
177
  Notification.notificationError('获取账号信息错误' + ((err === null || err === void 0 ? void 0 : err.message) || JSON.stringify(err)));
173
178
  });
174
- case 5:
179
+ case 9:
175
180
  addAccountResult = _context.sent;
176
181
  if (addAccountResult) {
177
- _context.next = 8;
182
+ _context.next = 12;
178
183
  break;
179
184
  }
180
185
  return _context.abrupt("return");
181
- case 8:
182
- console.log('addAccountResult:', addAccountResult);
186
+ case 12:
187
+ console.log('addAccountResult:', addAccountResult, env);
183
188
  postData = {
184
189
  detail: addAccountResult
185
190
  };
186
191
  runCreate(postData);
187
- case 11:
192
+ case 15:
188
193
  case "end":
189
194
  return _context.stop();
190
195
  }
@@ -208,6 +213,9 @@ var HomePageAccountList = function HomePageAccountList(_ref) {
208
213
  });
209
214
  });
210
215
  setPlatformMenuItems(platformMenuItems);
216
+ event.on('video-publish-auth-change', function () {
217
+ run();
218
+ });
211
219
  }, []);
212
220
  var addButton = function addButton() {
213
221
  return /*#__PURE__*/_jsx("div", {
@@ -374,7 +382,7 @@ var HomePageAccountList = function HomePageAccountList(_ref) {
374
382
  children: [/*#__PURE__*/_jsx(VideoPlatformLogo, {
375
383
  platform: item.platform,
376
384
  size: 14
377
- }), shopName, /*#__PURE__*/_jsx("div", {
385
+ }), shopName, "\u5907\u6CE8", /*#__PURE__*/_jsx("div", {
378
386
  className: "uniqueId",
379
387
  children: item.uniqueId
380
388
  })]
@@ -25,6 +25,14 @@
25
25
  flex: 2;
26
26
  height: 100%; // calc(100vh - 10px);
27
27
  overflow-y: auto;
28
+ padding: 10px;
29
+ &::-webkit-scrollbar {
30
+ width: 2px; /* 滚动条的宽度 */
31
+ }
32
+ &::-webkit-scrollbar-thumb {
33
+ background-color: #DDD; /* 滑块的颜色 */
34
+ border-radius: 4px; /* 滑块的圆角 */
35
+ }
28
36
  .high{
29
37
  color: #C00;
30
38
  font-weight: bold;
@@ -129,7 +137,7 @@
129
137
  }
130
138
  }
131
139
  .submits{
132
- box-shadow: 0 0 5px #EEE;
140
+ //box-shadow: 0 0 5px #EEE;
133
141
  text-align: center;
134
142
  padding: 12px 0 ;
135
143
  display: flex;
@@ -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 _useState = useState(_objectSpread({}, AccountManageSettingConfig())),
18
- _useState2 = _slicedToArray(_useState, 2),
19
- formData = _useState2[0],
20
- setFormData = _useState2[1];
21
- var onFinish = function onFinish(data) {
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__*/_jsx(Form, {
51
+ children: /*#__PURE__*/_jsxs(Form, {
46
52
  form: form,
47
53
  labelCol: {
48
- span: 4
54
+ span: 5
49
55
  },
50
56
  autoComplete: "off",
51
57
  initialValues: _objectSpread({}, formData),
52
- children: /*#__PURE__*/_jsx(Form.Item, {
53
- label: "\u662F\u5426\u663E\u793A\u6D4F\u89C8\u5668",
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
- onFinish(formData);
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
  };
@@ -7,6 +7,7 @@ interface Props {
7
7
  productType: VideoPublish.ProductType;
8
8
  apiUrl: string;
9
9
  env?: Global.Env;
10
+ clientId: string;
10
11
  }
11
12
  declare const VideoPublish: React.FC<Props>;
12
13
  export default VideoPublish;
@@ -7,10 +7,10 @@ import isInClient from "../lib/isInClient";
7
7
  import { ClockCircleOutlined, FileSearchOutlined, SettingOutlined, UsergroupAddOutlined, VideoCameraAddOutlined } from "@ant-design/icons";
8
8
  import VideoPublishVideoAccount from "./video-account";
9
9
  import VideoPublishTaskList from "./task-list";
10
- import PageContentWarp from "../UI/PageContentWarp";
11
10
  import VideoPublishLog from "./log";
12
11
  import VideoPublishAccountManageSettingPage from "./account-manage/setting";
13
12
  import VideoPublishAccountManageHomePage from "./account-manage/home";
13
+ import VideoPublishPublishVideoPlan from "./publish-task-plan";
14
14
  import { jsx as _jsx } from "react/jsx-runtime";
15
15
  import { jsxs as _jsxs } from "react/jsx-runtime";
16
16
  var VideoPublish = function VideoPublish(_ref) {
@@ -20,7 +20,8 @@ var VideoPublish = function VideoPublish(_ref) {
20
20
  contentHeight = _ref.contentHeight,
21
21
  productType = _ref.productType,
22
22
  apiUrl = _ref.apiUrl,
23
- env = _ref.env;
23
+ env = _ref.env,
24
+ clientId = _ref.clientId;
24
25
  var _useState = useState([]),
25
26
  _useState2 = _slicedToArray(_useState, 2),
26
27
  menuList = _useState2[0],
@@ -40,7 +41,10 @@ var VideoPublish = function VideoPublish(_ref) {
40
41
  children: /*#__PURE__*/_jsx(VideoPublishAccountManageHomePage, {
41
42
  apiUrl: apiUrl,
42
43
  env: env,
43
- canPublish: canPublish
44
+ canPublish: canPublish,
45
+ onMenu: function onMenu(key) {
46
+ return _onMenu(key);
47
+ }
44
48
  })
45
49
  }, {
46
50
  key: 'video-account',
@@ -77,13 +81,17 @@ var VideoPublish = function VideoPublish(_ref) {
77
81
  disabled: !canPublish,
78
82
  children: /*#__PURE__*/_jsx(VideoPublishAccountManageSettingPage, {})
79
83
  }, {
80
- key: 'log',
84
+ key: 'publish-log',
81
85
  icon: /*#__PURE__*/_jsx(FileSearchOutlined, {}),
82
- label: '日志',
86
+ label: '发布日志',
83
87
  disabled: !canPublish,
84
- children: /*#__PURE__*/_jsx(VideoPublishLog, {})
88
+ forceRender: canPublish,
89
+ children: /*#__PURE__*/_jsx(VideoPublishLog, {
90
+ env: env,
91
+ clientId: clientId
92
+ })
85
93
  }];
86
- var onMenu = function onMenu(key) {
94
+ var _onMenu = function _onMenu(key) {
87
95
  setActiveKey(key);
88
96
  };
89
97
  var onInit = function onInit() {
@@ -111,9 +119,11 @@ var VideoPublish = function VideoPublish(_ref) {
111
119
  useEffect(function () {
112
120
  onInit();
113
121
  }, []);
114
- return /*#__PURE__*/_jsx(PageContentWarp, {
115
- minHeight: contentHeight ? contentHeight : '100%',
116
- children: /*#__PURE__*/_jsxs("div", {
122
+ return /*#__PURE__*/_jsxs("div", {
123
+ style: {
124
+ minHeight: contentHeight ? contentHeight : '100%'
125
+ },
126
+ children: [/*#__PURE__*/_jsxs("div", {
117
127
  className: "videoPublish",
118
128
  style: {
119
129
  height: contentHeight ? contentHeight : '100%'
@@ -125,7 +135,7 @@ var VideoPublish = function VideoPublish(_ref) {
125
135
  children: /*#__PURE__*/_jsx(Menu, {
126
136
  className: "menu",
127
137
  onClick: function onClick(e) {
128
- return onMenu(e.key);
138
+ return _onMenu(e.key);
129
139
  },
130
140
  style: {
131
141
  width: '100%'
@@ -145,7 +155,10 @@ var VideoPublish = function VideoPublish(_ref) {
145
155
  items: tabsItems
146
156
  })
147
157
  })]
148
- })
158
+ }), /*#__PURE__*/_jsx(VideoPublishPublishVideoPlan, {
159
+ env: env,
160
+ clientId: clientId
161
+ })]
149
162
  });
150
163
  };
151
164
  export default VideoPublish;
@@ -15,14 +15,14 @@
15
15
 
16
16
  .menuWarp{
17
17
  position: fixed;
18
- width: 180px;
19
- padding: 0 0 0 5px;
18
+ width: 170px;
19
+ margin: 0 12px 0 0;
20
20
  }
21
21
  .menu{
22
22
  }
23
23
 
24
24
  .ant-menu {
25
- margin: 10px 0 0;
25
+
26
26
  }
27
27
 
28
28
  .ant-menu-light {
@@ -33,7 +33,7 @@
33
33
 
34
34
  .pageContents {
35
35
  flex: 1;
36
- padding: 16px 16px 16px ;
36
+ padding: 16px 16px 0 0 ;
37
37
  overflow-y: auto;
38
38
 
39
39
  .my-tabs {
@@ -1,2 +1,8 @@
1
+ import React from "react";
1
2
  import './index.less';
2
- export default function VideoPublishLog(): import("react/jsx-runtime").JSX.Element;
3
+ interface Props {
4
+ env?: Global.Env;
5
+ clientId: 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
- export default function VideoPublishLog() {
16
+ var VideoPublishLog = function VideoPublishLog(_ref) {
17
+ var clientId = _ref.clientId,
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
+ clientId: clientId,
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: [lastTaskApplyTime && /*#__PURE__*/_jsx(Time, {
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
- :global{
4
- .created{
5
- margin: 0 6px 0 0;
6
- padding: 2px 4px;
7
- background-color: #F2F2F2;
8
- font-weight: 300;
9
- //opacity: 0.7;
10
- font-size: 13px;
11
- min-width: 62px;
12
- text-align: center;
13
- display: inline-block;
14
- line-height: 1em;
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
- .padVideo-Progress{
79
- width: 200px;
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,8 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ interface Props {
4
+ env?: Global.Env;
5
+ clientId: string;
6
+ }
7
+ declare const VideoPublishPublishVideoPlan: React.FC<Props>;
8
+ export default VideoPublishPublishVideoPlan;
@@ -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
+ clientId = _ref.clientId;
8
+ useEffect(function () {
9
+ var publishTaskPlan = new PublishTaskPlanClass(env, clientId);
10
+ publishTaskPlan.onInit();
11
+ }, []);
12
+ return /*#__PURE__*/_jsx("div", {
13
+ className: "publishVideoPlan"
14
+ });
15
+ };
16
+ export default VideoPublishPublishVideoPlan;
@@ -0,0 +1,4 @@
1
+ .publishVideo{
2
+
3
+
4
+ }
@@ -0,0 +1,16 @@
1
+ declare class PublishTaskPlanClass {
2
+ timeLoopMillisecond: number;
3
+ isPublishing: boolean;
4
+ env: Global.Env | undefined;
5
+ clientId: string;
6
+ constructor(env?: Global.Env, clientId?: 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;