component-shipinlv 1.0.50 → 1.1.0

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 (39) hide show
  1. package/dist/VideoPublish/account-manage/home.d.ts +1 -0
  2. package/dist/VideoPublish/account-manage/home.js +2 -0
  3. package/dist/VideoPublish/account-manage/list.d.ts +1 -0
  4. package/dist/VideoPublish/account-manage/list.js +25 -19
  5. package/dist/VideoPublish/account-manage/setting/index.js +59 -12
  6. package/dist/VideoPublish/create-task/index.js +8 -4
  7. package/dist/VideoPublish/index.d.ts +1 -0
  8. package/dist/VideoPublish/index.js +22 -10
  9. package/dist/VideoPublish/log/index.d.ts +7 -1
  10. package/dist/VideoPublish/log/index.js +27 -10
  11. package/dist/VideoPublish/log/index.less +44 -46
  12. package/dist/VideoPublish/publish-task-plan/index.d.ts +8 -0
  13. package/dist/VideoPublish/publish-task-plan/index.js +16 -0
  14. package/dist/VideoPublish/publish-task-plan/index.less +4 -0
  15. package/dist/VideoPublish/publish-task-plan/tool.d.ts +16 -0
  16. package/dist/VideoPublish/publish-task-plan/tool.js +349 -0
  17. package/dist/base/fileSelect.d.ts +1 -1
  18. package/dist/base/folderSelect.d.ts +1 -1
  19. package/dist/component/file-select.d.ts +18 -0
  20. package/dist/component/file-select.js +163 -0
  21. package/dist/component/file-select.less +24 -0
  22. package/dist/component/folder-select.d.ts +18 -0
  23. package/dist/component/folder-select.js +190 -0
  24. package/dist/component/folder-select.less +22 -0
  25. package/dist/component/is-installed-chrome.d.ts +2 -0
  26. package/dist/component/is-installed-chrome.js +5 -0
  27. package/dist/index.js +2 -0
  28. package/dist/lib/accountManageSettingConfig.js +8 -1
  29. package/dist/lib/request.js +6 -2
  30. package/dist/service/api/VideoPublishCrawlerTaskController.d.ts +2 -0
  31. package/dist/service/api/VideoPublishCrawlerTaskController.js +51 -0
  32. package/dist/service/api/VideoPublishVideoAccountController.d.ts +1 -1
  33. package/dist/service/api/VideoPublishVideoAccountController.js +6 -6
  34. package/dist/service/local/FileController.d.ts +1 -1
  35. package/dist/types/PublishTaskPlan.d.ts +1 -0
  36. package/dist/typings/VideoPublishAccountManageSetting.d.ts +2 -0
  37. package/dist/typings/VideoPublishVideoAccount.d.ts +1 -1
  38. package/dist/window.d.ts +5 -1
  39. package/package.json +1 -1
@@ -0,0 +1,190 @@
1
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
+ import React, { useEffect, useState } from 'react';
5
+ import Tool from "../lib/Tool";
6
+ import "./folder-select.less";
7
+ import { Button, Input, Space } from "antd";
8
+ import { FolderOpenOutlined, FolderOutlined } from "@ant-design/icons";
9
+ import { folderSelect, folderOpen } from "./..";
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ import { jsxs as _jsxs } from "react/jsx-runtime";
12
+ var FolderSelect = function FolderSelect(_ref) {
13
+ var _ref$defaultPath = _ref.defaultPath,
14
+ defaultPath = _ref$defaultPath === void 0 ? '' : _ref$defaultPath,
15
+ _ref$path = _ref.path,
16
+ path = _ref$path === void 0 ? '' : _ref$path,
17
+ size = _ref.size,
18
+ allowClear = _ref.allowClear,
19
+ _ref$label = _ref.label,
20
+ label = _ref$label === void 0 ? '' : _ref$label,
21
+ disabled = _ref.disabled,
22
+ _ref$placeholder = _ref.placeholder,
23
+ placeholder = _ref$placeholder === void 0 ? '请选择文件夹' : _ref$placeholder,
24
+ _ref$hiddenOpenDir = _ref.hiddenOpenDir,
25
+ hiddenOpenDir = _ref$hiddenOpenDir === void 0 ? false : _ref$hiddenOpenDir,
26
+ _ref$disabledChangeDi = _ref.disabledChangeDir,
27
+ disabledChangeDir = _ref$disabledChangeDi === void 0 ? false : _ref$disabledChangeDi,
28
+ onBeforeSelect = _ref.onBeforeSelect,
29
+ _ref$onFinish = _ref.onFinish,
30
+ onFinish = _ref$onFinish === void 0 ? function () {} : _ref$onFinish;
31
+ var _useState = useState(defaultPath),
32
+ _useState2 = _slicedToArray(_useState, 2),
33
+ folderPath = _useState2[0],
34
+ setFolderPath = _useState2[1];
35
+ var _useState3 = useState(false),
36
+ _useState4 = _slicedToArray(_useState3, 2),
37
+ loadingSelectDir = _useState4[0],
38
+ setLoadingSelectDir = _useState4[1];
39
+ var _useState5 = useState(false),
40
+ _useState6 = _slicedToArray(_useState5, 2),
41
+ loadingOpenDir = _useState6[0],
42
+ setLoadingOpenDir = _useState6[1];
43
+ var onSelectDir = /*#__PURE__*/function () {
44
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
45
+ var _fileResul$filePaths;
46
+ var beforeSelectResult, fileResul, filePaths, selectFolderPath;
47
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
48
+ while (1) switch (_context.prev = _context.next) {
49
+ case 0:
50
+ setLoadingSelectDir(true);
51
+ if (!(typeof onBeforeSelect === 'function')) {
52
+ _context.next = 8;
53
+ break;
54
+ }
55
+ _context.next = 4;
56
+ return onBeforeSelect().catch(function (err) {});
57
+ case 4:
58
+ beforeSelectResult = _context.sent;
59
+ if (!(beforeSelectResult === false)) {
60
+ _context.next = 8;
61
+ break;
62
+ }
63
+ setLoadingSelectDir(false);
64
+ return _context.abrupt("return");
65
+ case 8:
66
+ _context.next = 10;
67
+ return folderSelect(defaultPath).catch(function (err) {
68
+ Tool.toastError('选取文件夹失败:' + (err === null || err === void 0 ? void 0 : err.message));
69
+ });
70
+ case 10:
71
+ fileResul = _context.sent;
72
+ setTimeout(function () {
73
+ setLoadingSelectDir(false);
74
+ }, 1e3);
75
+ if (fileResul) {
76
+ _context.next = 14;
77
+ break;
78
+ }
79
+ return _context.abrupt("return");
80
+ case 14:
81
+ filePaths = (fileResul === null || fileResul === void 0 ? void 0 : fileResul.filePaths) || [];
82
+ if (!(filePaths.length <= 0)) {
83
+ _context.next = 17;
84
+ break;
85
+ }
86
+ return _context.abrupt("return");
87
+ case 17:
88
+ selectFolderPath = (fileResul === null || fileResul === void 0 || (_fileResul$filePaths = fileResul.filePaths) === null || _fileResul$filePaths === void 0 ? void 0 : _fileResul$filePaths[0]) || '';
89
+ console.log("selectFolderPath 2:", selectFolderPath);
90
+ if (selectFolderPath) {
91
+ Tool.toast('已选择文件夹');
92
+ onFinish(selectFolderPath);
93
+ onDir(selectFolderPath);
94
+ }
95
+ case 20:
96
+ case "end":
97
+ return _context.stop();
98
+ }
99
+ }, _callee);
100
+ }));
101
+ return function onSelectDir() {
102
+ return _ref2.apply(this, arguments);
103
+ };
104
+ }();
105
+ var onDir = function onDir(folderPath) {
106
+ setFolderPath(folderPath);
107
+ onFinish(folderPath);
108
+ };
109
+ var onOpenDir = /*#__PURE__*/function () {
110
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
111
+ var fileResul;
112
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
113
+ while (1) switch (_context2.prev = _context2.next) {
114
+ case 0:
115
+ setLoadingOpenDir(true);
116
+ _context2.next = 3;
117
+ return folderOpen(folderPath).catch(function (err) {
118
+ Tool.toastError('选取文件夹失败:' + (err === null || err === void 0 ? void 0 : err.message));
119
+ });
120
+ case 3:
121
+ fileResul = _context2.sent;
122
+ setTimeout(function () {
123
+ setLoadingOpenDir(false);
124
+ }, 1e3);
125
+ case 5:
126
+ case "end":
127
+ return _context2.stop();
128
+ }
129
+ }, _callee2);
130
+ }));
131
+ return function onOpenDir() {
132
+ return _ref3.apply(this, arguments);
133
+ };
134
+ }();
135
+ useEffect(function () {
136
+ setFolderPath(path);
137
+ }, [path]);
138
+ return /*#__PURE__*/_jsx("div", {
139
+ className: "folderSelect",
140
+ children: /*#__PURE__*/_jsx("div", {
141
+ className: "savePathContent",
142
+ children: /*#__PURE__*/_jsxs("div", {
143
+ className: "savePathWarp",
144
+ children: [/*#__PURE__*/_jsx(Input, {
145
+ value: /^\d+$/g.test(folderPath) ? '[已选择 - 文件空间文件夹]' : folderPath,
146
+ allowClear: allowClear,
147
+ disabled: disabled,
148
+ addonBefore: label,
149
+ placeholder: placeholder,
150
+ size: size,
151
+ onChange: function onChange(e) {
152
+ var inputPath = e.target.value;
153
+ // 只允许 清空
154
+ if (!inputPath) {
155
+ onDir(inputPath);
156
+ }
157
+ },
158
+ className: "input"
159
+ }), /*#__PURE__*/_jsx("div", {
160
+ className: "option",
161
+ children: /*#__PURE__*/_jsxs(Space, {
162
+ children: [/*#__PURE__*/_jsx(Button, {
163
+ onClick: onSelectDir,
164
+ loading: loadingSelectDir,
165
+ icon: /*#__PURE__*/_jsx(FolderOutlined, {}),
166
+ disabled: disabled || disabledChangeDir,
167
+ size: size,
168
+ children: folderPath ? '更改' : '选择'
169
+ }), !hiddenOpenDir && /*#__PURE__*/_jsx(Button, {
170
+ onClick: onOpenDir,
171
+ loading: loadingOpenDir,
172
+ disabled: !folderPath || disabled,
173
+ icon: /*#__PURE__*/_jsx(FolderOpenOutlined, {}),
174
+ size: size,
175
+ children: "\u6253\u5F00"
176
+ })]
177
+ })
178
+ })]
179
+ })
180
+ })
181
+ })
182
+ // <div
183
+ // onClick={ () => onSelectFile() }
184
+ // >
185
+ // { children }
186
+ // </div>
187
+ ;
188
+ };
189
+
190
+ export default FolderSelect;
@@ -0,0 +1,22 @@
1
+ .folderSelect{
2
+ .savePathContent{
3
+ z-index: 30;
4
+ .savePathWarp{
5
+ display: flex;
6
+ flex-direction: row;
7
+ .option{
8
+ padding: 0 0 0 8px;
9
+ }
10
+ }
11
+ .ant-input{
12
+ font-size: 12px;
13
+ color: #555;
14
+
15
+
16
+ }
17
+ }
18
+ .input{
19
+
20
+ }
21
+ }
22
+
@@ -0,0 +1,2 @@
1
+ declare const isInstalledChrome: () => boolean;
2
+ export default isInstalledChrome;
@@ -0,0 +1,5 @@
1
+ var isInstalledChrome = function isInstalledChrome() {
2
+ var _window$bridge, _window;
3
+ return !!((_window$bridge = (_window = window).bridge) !== null && _window$bridge !== void 0 && _window$bridge.call(_window).getChromiumPath());
4
+ };
5
+ export default isInstalledChrome;
package/dist/index.js CHANGED
@@ -14,6 +14,8 @@ export { default as DealerUrlDict } from "./base/DealerUrlDict";
14
14
  export { default as VideoPlatform, VideoPlatformList, VideoPlatformDict } from "./component/video-platform/logo";
15
15
  export { default as VipList } from "./VipList";
16
16
  export { default as VideoPublish } from "./VideoPublish";
17
+ // export { default as VideoPublishPublishVideoPlan } from './VideoPublish/publish-task-plan';
18
+
17
19
  export { default as VideoPublishCreateTask } from "./VideoPublish/create-task";
18
20
  export { default as VideoPublishVideoAccount } from "./VideoPublish/video-account";
19
21
  export { default as VideoKindTag } from "./component/videoKindTag";
@@ -2,14 +2,21 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import store from "./store";
3
3
  var AccountManageSettingConfigKey = 'account-manage-setting';
4
4
  var AccountManageSettingConfig = function AccountManageSettingConfig(data) {
5
+ var _window$bridge, _window;
5
6
  if (data) {
6
7
  store.set(AccountManageSettingConfigKey, _objectSpread({}, data));
7
8
  return data;
8
9
  }
9
10
  console.log('AccountManageSettingConfig get');
11
+ var chromePath = (_window$bridge = (_window = window).bridge) === null || _window$bridge === void 0 ? void 0 : _window$bridge.call(_window).getChromiumPath();
10
12
  var outData = _objectSpread({
11
- isChromeOpen: false
13
+ isChromeOpen: false,
14
+ disabledApplyTask: false,
15
+ chromePath: ''
12
16
  }, store.get(AccountManageSettingConfigKey));
17
+ if (!outData.chromePath) {
18
+ outData.chromePath = chromePath;
19
+ }
13
20
  return outData;
14
21
  };
15
22
  export default AccountManageSettingConfig;
@@ -6,6 +6,7 @@ import getApiUrl, { getApiEnv, getMainPort } from "./getApiUrl";
6
6
  import goAuth from "./goAuth";
7
7
  import Tool from "./Tool";
8
8
  var requestApi = function requestApi() {
9
+ var _window$bridge, _window, _window$bridge$call$g, _window$bridge$call;
9
10
  var api = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
10
11
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
11
12
  // 要请求的 url
@@ -18,6 +19,9 @@ var requestApi = function requestApi() {
18
19
  var token = userInfo.sid;
19
20
  var postUrl = url + (url.indexOf('?') === -1 ? '?' : '&') + '_token_=' + token;
20
21
 
22
+ // clientId
23
+ postUrl += "&clientUniqueKey=".concat(((_window$bridge = (_window = window).bridge) === null || _window$bridge === void 0 || (_window$bridge$call$g = (_window$bridge$call = _window$bridge.call(_window)).getClientUniqueKey) === null || _window$bridge$call$g === void 0 ? void 0 : _window$bridge$call$g.call(_window$bridge$call)) || '');
24
+
21
25
  // 追加环境参数
22
26
  var env = getApiEnv(options === null || options === void 0 ? void 0 : options.env);
23
27
  if (env !== 'prod') {
@@ -83,7 +87,7 @@ var requestApi = function requestApi() {
83
87
  });
84
88
  };
85
89
  var onError = function onError(pageUrl) {
86
- var _window;
90
+ var _window2;
87
91
  var apiUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
88
92
  var title = arguments.length > 2 ? arguments[2] : undefined;
89
93
  var content = arguments.length > 3 ? arguments[3] : undefined;
@@ -91,7 +95,7 @@ var onError = function onError(pageUrl) {
91
95
  if (silent) {
92
96
  return;
93
97
  }
94
- (_window = window) === null || _window === void 0 || (_window = _window.__recordError) === null || _window === void 0 || _window.create([{
98
+ (_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.__recordError) === null || _window2 === void 0 || _window2.create([{
95
99
  title: title,
96
100
  siteUserId: Tool.getLocalUserInfo().id,
97
101
  errorLevel: 1,
@@ -0,0 +1,2 @@
1
+ export declare function apply(body?: {}, options?: Global.RequestOptions): Promise<PublishTaskPlan.TaskDetail>;
2
+ export declare function report(body: PublishTaskPlan.ReportTaskQuery, options?: Global.RequestOptions): Promise<boolean>;
@@ -0,0 +1,51 @@
1
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
4
+ import request from "../../lib/request";
5
+ import { PublishDomainApi } from "./VideoPublishController";
6
+ export function apply(_x, _x2) {
7
+ return _apply.apply(this, arguments);
8
+ }
9
+ function _apply() {
10
+ _apply = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(body, options) {
11
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
12
+ while (1) switch (_context.prev = _context.next) {
13
+ case 0:
14
+ return _context.abrupt("return", request(PublishDomainApi("crawler/task/apply", options === null || options === void 0 ? void 0 : options.env), _objectSpread({
15
+ method: 'POST',
16
+ headers: {
17
+ 'Content-Type': 'application/json'
18
+ },
19
+ data: _objectSpread({}, body)
20
+ }, options || {})));
21
+ case 1:
22
+ case "end":
23
+ return _context.stop();
24
+ }
25
+ }, _callee);
26
+ }));
27
+ return _apply.apply(this, arguments);
28
+ }
29
+ export function report(_x3, _x4) {
30
+ return _report.apply(this, arguments);
31
+ }
32
+ function _report() {
33
+ _report = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(body, options) {
34
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
35
+ while (1) switch (_context2.prev = _context2.next) {
36
+ case 0:
37
+ return _context2.abrupt("return", request(PublishDomainApi("crawler/task/report", options === null || options === void 0 ? void 0 : options.env), _objectSpread({
38
+ method: 'POST',
39
+ headers: {
40
+ 'Content-Type': 'application/json'
41
+ },
42
+ data: _objectSpread({}, body)
43
+ }, options || {})));
44
+ case 1:
45
+ case "end":
46
+ return _context2.stop();
47
+ }
48
+ }, _callee2);
49
+ }));
50
+ return _report.apply(this, arguments);
51
+ }
@@ -12,4 +12,4 @@ export declare function del(body: {
12
12
  id: number;
13
13
  }>;
14
14
  export declare function detail(body: VideoPublishVideoAccount.DetailQuery, options?: Global.RequestOptions): Promise<VideoPublishVideoAccount.Detail>;
15
- export declare function SaveLoginStatus(body: VideoPublishVideoAccount.SaveLoginStatus, options?: Global.RequestOptions): Promise<boolean>;
15
+ export declare function saveLoginStatus(body: VideoPublishVideoAccount.SaveLoginStatus, options?: Global.RequestOptions): Promise<boolean>;
@@ -166,15 +166,15 @@ function _detail() {
166
166
  }));
167
167
  return _detail.apply(this, arguments);
168
168
  }
169
- export function SaveLoginStatus(_x15, _x16) {
170
- return _SaveLoginStatus.apply(this, arguments);
169
+ export function saveLoginStatus(_x15, _x16) {
170
+ return _saveLoginStatus.apply(this, arguments);
171
171
  }
172
- function _SaveLoginStatus() {
173
- _SaveLoginStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(body, options) {
172
+ function _saveLoginStatus() {
173
+ _saveLoginStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(body, options) {
174
174
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
175
175
  while (1) switch (_context8.prev = _context8.next) {
176
176
  case 0:
177
- return _context8.abrupt("return", request(PublishDomainApi("/crawler/videoaccount/saveloginstatus", options === null || options === void 0 ? void 0 : options.env), _objectSpread({
177
+ return _context8.abrupt("return", request(PublishDomainApi("crawler/videoAccount/saveLoginStatus", options === null || options === void 0 ? void 0 : options.env), _objectSpread({
178
178
  method: 'POST',
179
179
  headers: {
180
180
  'Content-Type': 'application/json'
@@ -187,5 +187,5 @@ function _SaveLoginStatus() {
187
187
  }
188
188
  }, _callee8);
189
189
  }));
190
- return _SaveLoginStatus.apply(this, arguments);
190
+ return _saveLoginStatus.apply(this, arguments);
191
191
  }
@@ -5,7 +5,7 @@ export declare function fileList(body: {
5
5
  extTypes?: string[];
6
6
  }, options?: ServicesApi.RequestOptions): Promise<string[][]>;
7
7
  export declare function fileSelect(body: {
8
- fileType: 'video' | 'video+image' | 'image' | 'sound' | '';
8
+ fileType: 'video' | 'video+image' | 'image' | 'sound' | string;
9
9
  }, optionsQuery?: ServicesApi.RequestOptions): Promise<LocalFile.FileSelect>;
10
10
  export declare function folderSelect(body: {
11
11
  defaultPath: string;
@@ -23,6 +23,7 @@ declare namespace PublishTaskPlan {
23
23
  videoKindTag: VideoKindTag;
24
24
  kindTagValue: string;
25
25
  videoUrl: string;
26
+ publishCoverUrl: string;
26
27
  publishTime: number;
27
28
  }
28
29
  interface TaskDetailComment {
@@ -1,5 +1,7 @@
1
1
  declare namespace VideoPublishAccountManageSetting {
2
2
  interface Config {
3
3
  isChromeOpen: boolean;
4
+ disabledApplyTask: boolean;
5
+ chromePath: string;
4
6
  }
5
7
  }
@@ -17,7 +17,7 @@ declare namespace VideoPublishVideoAccount {
17
17
  totalVideoCount: number;
18
18
  }
19
19
  interface SaveLoginStatus {
20
- clientId: string;
20
+ clientUniqueKey: string;
21
21
  platformVideoAccountId: string;
22
22
  platform: string;
23
23
  isLogin: boolean;
package/dist/window.d.ts CHANGED
@@ -13,7 +13,11 @@ declare interface Window{
13
13
  bridge: () => {
14
14
  ipcRenderer: {
15
15
  invoke: ( name: string, ...arg) => Promise<any>;
16
- }
16
+ },
17
+ videoPublish: ( query: any ) => Promise<any>;
18
+ onLog: ( log: ( query: any ) => void ) => void;
19
+ getChromiumPath: () => string;
20
+ getClientUniqueKey: () => string;
17
21
  };
18
22
  }
19
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "component-shipinlv",
3
- "version": "1.0.50",
3
+ "version": "1.1.0",
4
4
  "description": "",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",