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.
- package/dist/VideoPublish/account-manage/home.d.ts +1 -0
- package/dist/VideoPublish/account-manage/home.js +5 -3
- package/dist/VideoPublish/account-manage/list.d.ts +1 -0
- package/dist/VideoPublish/account-manage/list.js +29 -21
- package/dist/VideoPublish/account-manage/list.less +9 -1
- package/dist/VideoPublish/account-manage/setting/index.js +59 -12
- package/dist/VideoPublish/index.d.ts +1 -0
- package/dist/VideoPublish/index.js +25 -12
- package/dist/VideoPublish/index.less +4 -4
- 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/VideoPublish/video-account/index.less +1 -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/Tool.d.ts +1 -1
- package/dist/lib/accountManageSettingConfig.js +8 -1
- package/dist/service/api/VideoPublishController.js +1 -0
- 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/typings/VideoPublishAccountManageSetting.d.ts +2 -0
- package/dist/window.d.ts +4 -1
- 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,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";
|
package/dist/lib/Tool.d.ts
CHANGED
@@ -161,7 +161,7 @@ declare const Tool: {
|
|
161
161
|
OsPathSeparator(): string;
|
162
162
|
getTitleByPath(path: string): string;
|
163
163
|
h5Pay(query: Pay.H5PayQuery): void;
|
164
|
-
notification(type: "
|
164
|
+
notification(type: "success" | "info" | "warning" | "error", message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
|
165
165
|
notificationSuccess(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
|
166
166
|
notificationError(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
|
167
167
|
notificationWarning(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
|
@@ -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;
|
@@ -12,6 +12,7 @@ var ApiUrls = {
|
|
12
12
|
};
|
13
13
|
export var PublishDomainApi = function PublishDomainApi(apiName, env) {
|
14
14
|
var _ApiUrls$env;
|
15
|
+
console.log('PublishDomainApi:', apiName, env);
|
15
16
|
// @ts-ignore
|
16
17
|
return (((_ApiUrls$env = ApiUrls[env]) === null || _ApiUrls$env === void 0 ? void 0 : _ApiUrls$env.api) || 'https://api-video-publish.shipinlv.com/') + (apiName === null || apiName === void 0 ? void 0 : apiName.toLocaleLowerCase());
|
17
18
|
};
|
@@ -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
|
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
|
170
|
-
return
|
169
|
+
export function saveLoginStatus(_x15, _x16) {
|
170
|
+
return _saveLoginStatus.apply(this, arguments);
|
171
171
|
}
|
172
|
-
function
|
173
|
-
|
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("
|
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
|
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;
|
package/dist/window.d.ts
CHANGED
@@ -13,7 +13,10 @@ 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;
|
17
20
|
};
|
18
21
|
}
|
19
22
|
|