component-shipinlv 1.0.36 → 1.0.37

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. package/dist/UI/LayoutContent.d.ts +18 -0
  2. package/dist/UI/LayoutContent.js +73 -0
  3. package/dist/UI/LayoutContent.less +60 -0
  4. package/dist/UI/PageContentWarp.less +1 -1
  5. package/dist/UI/PageLoading.d.ts +3 -0
  6. package/dist/UI/PageLoading.js +11 -0
  7. package/dist/UI/PageLoading.less +7 -0
  8. package/dist/VideoPublish/account-manage/home.d.ts +9 -0
  9. package/dist/VideoPublish/account-manage/home.js +170 -0
  10. package/dist/VideoPublish/account-manage/home.less +58 -0
  11. package/dist/VideoPublish/account-manage/index.d.ts +3 -0
  12. package/dist/VideoPublish/account-manage/index.js +56 -0
  13. package/dist/VideoPublish/account-manage/index.less +59 -0
  14. package/dist/VideoPublish/account-manage/list.d.ts +10 -0
  15. package/dist/VideoPublish/account-manage/list.js +428 -0
  16. package/dist/VideoPublish/account-manage/list.less +154 -0
  17. package/dist/VideoPublish/account-manage/setting/index.d.ts +6 -0
  18. package/dist/VideoPublish/account-manage/setting/index.js +69 -0
  19. package/dist/VideoPublish/account-manage/setting/index.less +9 -0
  20. package/dist/VideoPublish/index.d.ts +1 -0
  21. package/dist/VideoPublish/index.js +39 -10
  22. package/dist/VideoPublish/log/index.d.ts +2 -0
  23. package/dist/VideoPublish/log/index.js +122 -0
  24. package/dist/VideoPublish/log/index.less +83 -0
  25. package/dist/VideoPublish/video-account/query.js +1 -0
  26. package/dist/component/markdown/github-markdown-light.less +1102 -0
  27. package/dist/component/markdown/index.d.ts +8 -0
  28. package/dist/component/markdown/index.js +69 -0
  29. package/dist/component/markdown/index.less +55 -0
  30. package/dist/component/video-platform/logo.d.ts +1 -0
  31. package/dist/component/video-platform/logo.js +6 -0
  32. package/dist/config/apiUrls.js +1 -1
  33. package/dist/lib/accountManageSettingConfig.d.ts +2 -0
  34. package/dist/lib/accountManageSettingConfig.js +15 -0
  35. package/dist/lib/event.d.ts +7 -0
  36. package/dist/lib/event.js +59 -0
  37. package/dist/lib/getLocalUserInfo.d.ts +2 -0
  38. package/dist/lib/getLocalUserInfo.js +19 -0
  39. package/dist/lib/math.d.ts +38 -0
  40. package/dist/lib/math.js +146 -0
  41. package/dist/lib/sleep.d.ts +2 -0
  42. package/dist/lib/sleep.js +23 -0
  43. package/dist/lib/store.d.ts +7 -0
  44. package/dist/lib/store.js +36 -0
  45. package/dist/lib/toast.d.ts +2 -0
  46. package/dist/lib/toast.js +8 -0
  47. package/dist/lib/toastError.d.ts +2 -0
  48. package/dist/lib/toastError.js +8 -0
  49. package/dist/service/api/VideoPublishVideoAccountController.d.ts +13 -0
  50. package/dist/service/api/VideoPublishVideoAccountController.js +140 -0
  51. package/dist/types/PublishNpm.d.ts +36 -0
  52. package/dist/types/PublishNpm.js +0 -0
  53. package/dist/types/PublishTaskPlan.d.ts +41 -0
  54. package/dist/types/PublishTaskPlan.js +0 -0
  55. package/dist/types/User.d.ts +83 -0
  56. package/dist/types/VideoPublishLog.d.ts +32 -0
  57. package/dist/types/VideoPublishLog.js +0 -0
  58. package/dist/typings/VideoPublishAccountManageSetting.d.ts +5 -0
  59. package/dist/typings/VideoPublishAccountManageSetting.js +0 -0
  60. package/dist/typings/VideoPublishVideoAccount.d.ts +69 -0
  61. package/dist/typings/VideoPublishVideoAccount.js +0 -0
  62. package/dist/window.d.ts +9 -0
  63. package/package.json +2 -1
@@ -4,14 +4,19 @@ import "./index.less";
4
4
  import { Menu, Tabs } from "antd";
5
5
  import VideoPublishCreateTask from "./create-task";
6
6
  import isInClient from "../lib/isInClient";
7
- import { ClockCircleOutlined, UsergroupAddOutlined, VideoCameraAddOutlined } from "@ant-design/icons";
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
10
  import PageContentWarp from "../UI/PageContentWarp";
11
+ import VideoPublishLog from "./log";
12
+ import VideoPublishAccountManageSettingPage from "./account-manage/setting";
13
+ import VideoPublishAccountManageHomePage from "./account-manage/home";
11
14
  import { jsx as _jsx } from "react/jsx-runtime";
12
15
  import { jsxs as _jsxs } from "react/jsx-runtime";
13
16
  var VideoPublish = function VideoPublish(_ref) {
14
17
  var disabled = _ref.disabled,
18
+ _ref$canPublish = _ref.canPublish,
19
+ canPublish = _ref$canPublish === void 0 ? false : _ref$canPublish,
15
20
  contentHeight = _ref.contentHeight,
16
21
  productType = _ref.productType,
17
22
  apiUrl = _ref.apiUrl,
@@ -29,9 +34,27 @@ var VideoPublish = function VideoPublish(_ref) {
29
34
  tabsItems = _useState6[0],
30
35
  setTabsItems = _useState6[1];
31
36
  var MenuAllList = [{
37
+ key: 'long-video-sales-create',
38
+ icon: /*#__PURE__*/_jsx(VideoCameraAddOutlined, {}),
39
+ label: '添加账号',
40
+ children: /*#__PURE__*/_jsx(VideoPublishAccountManageHomePage, {
41
+ apiUrl: apiUrl,
42
+ env: env,
43
+ canPublish: canPublish
44
+ })
45
+ }, {
46
+ key: 'video-account',
47
+ icon: /*#__PURE__*/_jsx(UsergroupAddOutlined, {}),
48
+ label: '管理账户',
49
+ children: /*#__PURE__*/_jsx(VideoPublishVideoAccount, {
50
+ disabled: disabled,
51
+ env: env
52
+ })
53
+ }, {
32
54
  key: 'creat-task',
33
55
  icon: /*#__PURE__*/_jsx(VideoCameraAddOutlined, {}),
34
- label: '定时发布',
56
+ label: '批量发布',
57
+ disabled: !canPublish,
35
58
  children: /*#__PURE__*/_jsx(VideoPublishCreateTask, {
36
59
  disabled: disabled,
37
60
  productType: productType,
@@ -42,18 +65,23 @@ var VideoPublish = function VideoPublish(_ref) {
42
65
  key: 'task-list',
43
66
  icon: /*#__PURE__*/_jsx(ClockCircleOutlined, {}),
44
67
  label: '发布列表',
68
+ disabled: !canPublish,
45
69
  children: /*#__PURE__*/_jsx(VideoPublishTaskList, {
46
70
  disabled: disabled,
47
71
  env: env
48
72
  })
49
73
  }, {
50
- key: 'video-account',
51
- icon: /*#__PURE__*/_jsx(UsergroupAddOutlined, {}),
52
- label: '短视频账户',
53
- children: /*#__PURE__*/_jsx(VideoPublishVideoAccount, {
54
- disabled: disabled,
55
- env: env
56
- })
74
+ key: 'setting',
75
+ icon: /*#__PURE__*/_jsx(SettingOutlined, {}),
76
+ label: '配置',
77
+ disabled: !canPublish,
78
+ children: /*#__PURE__*/_jsx(VideoPublishAccountManageSettingPage, {})
79
+ }, {
80
+ key: 'log',
81
+ icon: /*#__PURE__*/_jsx(FileSearchOutlined, {}),
82
+ label: '日志',
83
+ disabled: !canPublish,
84
+ children: /*#__PURE__*/_jsx(VideoPublishLog, {})
57
85
  }];
58
86
  var onMenu = function onMenu(key) {
59
87
  setActiveKey(key);
@@ -72,7 +100,8 @@ var VideoPublish = function VideoPublish(_ref) {
72
100
  menuList.push({
73
101
  key: items.key,
74
102
  icon: items.icon,
75
- label: items.label
103
+ label: items.label,
104
+ disabled: items.disabled
76
105
  });
77
106
  });
78
107
  setTabsItems([].concat(tabsItems));
@@ -0,0 +1,2 @@
1
+ import './index.less';
2
+ export default function VideoPublishLog(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,122 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
+ import React, { useState, useEffect, useRef } from "react";
4
+ import "./index.less";
5
+ import LayoutContent from "../../UI/LayoutContent";
6
+ import dayjs from "dayjs";
7
+ import Markdown from "../../component/markdown";
8
+ import { Divider, Empty, Tooltip } from "antd";
9
+ import event from "../../lib/event";
10
+ import math from "../../lib/math";
11
+ import Time from "../../UI/Time";
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { jsxs as _jsxs } from "react/jsx-runtime";
14
+ var MaxLine = 10000;
15
+ export default function VideoPublishLog() {
16
+ var _useState = useState(0),
17
+ _useState2 = _slicedToArray(_useState, 2),
18
+ logAmount = _useState2[0],
19
+ setLogAmount = _useState2[1];
20
+ var _useState3 = useState(0),
21
+ _useState4 = _slicedToArray(_useState3, 2),
22
+ lastTaskApplyTime = _useState4[0],
23
+ setLastTaskApplyTime = _useState4[1];
24
+ var textRef = useRef([
25
+ // '22 <Tag>1213132</Tag> 11 <Button type="primary">dddddd</Button>'
26
+ ]);
27
+ var _useState5 = useState([
28
+ // '<span class="created">10:01:20</span> ddddddddddd'
29
+ ]),
30
+ _useState6 = _slicedToArray(_useState5, 2),
31
+ textList = _useState6[0],
32
+ setTextList = _useState6[1];
33
+ var LogStatusDict = {
34
+ wait: '<ClockCircleOutlined class="icon icon-wait" />',
35
+ warn: '<WarningFilled class="icon icon-warn" />',
36
+ fail: '<CloseSquareFilled class="icon icon-fail" />',
37
+ success: '<CheckCircleFilled class="icon icon-success" />'
38
+ };
39
+ var onLog = function onLog() {
40
+ event.on('task-apply', function () {
41
+ setLogAmount(function (n) {
42
+ return n + 1;
43
+ });
44
+ setLastTaskApplyTime(Math.floor(Date.now() * 0.001));
45
+ });
46
+ event.on('log', function (data) {
47
+ console.log('log data:', data);
48
+ switch (data.code) {
49
+ case 'not-login':
50
+ break;
51
+ }
52
+ var logKey = data.logKey ? data.logKey : math.randWord(10);
53
+ var messageData = {
54
+ platform: data.platform,
55
+ platformAccountId: data.platformAccountId,
56
+ taskId: data.taskId,
57
+ id: logKey,
58
+ logStatus: data.status,
59
+ content: data.message || '',
60
+ created: Date.now()
61
+ };
62
+ var index = findIndex(logKey);
63
+ if (index < 0) {
64
+ textRef.current.unshift(messageData);
65
+ } else {
66
+ // 不更新时间
67
+ textRef.current[index].content = messageData.content;
68
+ textRef.current[index].logStatus = messageData.logStatus;
69
+ }
70
+ if (textRef.current.length > MaxLine) {
71
+ // textRef.current = textRef.current.slice( textRef.current.length - MaxLine );
72
+ textRef.current = textRef.current.slice(0, MaxLine);
73
+ }
74
+ setTextList(_toConsumableArray(textRef.current));
75
+ });
76
+ };
77
+ var findIndex = function findIndex(id) {
78
+ for (var index in textRef.current) {
79
+ var item = textRef.current[index];
80
+ if (id === item.id) {
81
+ return parseInt(index);
82
+ }
83
+ }
84
+ return -1;
85
+ };
86
+ useEffect(function () {
87
+ onLog();
88
+ return function () {};
89
+ }, []);
90
+ return /*#__PURE__*/_jsx(LayoutContent, {
91
+ title: "\u65E5\u5FD7",
92
+ extInfo: /*#__PURE__*/_jsxs("div", {
93
+ children: [lastTaskApplyTime && /*#__PURE__*/_jsx(Time, {
94
+ time: lastTaskApplyTime
95
+ }), /*#__PURE__*/_jsx(Divider, {
96
+ type: "vertical"
97
+ }), /*#__PURE__*/_jsxs(Tooltip, {
98
+ title: "\u672C\u6B21\u8FD0\u884C\u5171\u8BF7\u6C42\u4EFB\u52A1\u6570",
99
+ children: [logAmount, " ", /*#__PURE__*/_jsx("small", {
100
+ children: "\u6B21"
101
+ })]
102
+ })]
103
+ }),
104
+ className: "videoPublishLog",
105
+ children: /*#__PURE__*/_jsxs("div", {
106
+ className: "warp",
107
+ children: [textList.map(function (items, i) {
108
+ var logStatus = LogStatusDict[items.logStatus] || '';
109
+ var time = dayjs(items.created).format('MM-DD HH:mm:ss');
110
+ return /*#__PURE__*/_jsx("div", {
111
+ className: "line ".concat('line-' + items.logStatus),
112
+ children: /*#__PURE__*/_jsx(Markdown, {
113
+ content: "<span class=\"created\">".concat(time, "</span> <VideoPlatform platform=\"").concat(items.platform, "\" /> <Tooltip title='\u4EFB\u52A1\u7F16\u53F7'><Tag color='blue'>").concat(items.taskId, "</Tag></Tooltip> <Tag>").concat(items.platformAccountId || '', "</Tag> ").concat(logStatus, " <span class=\"content\">").concat(items.content, "</span>")
114
+ })
115
+ }, "".concat(items.id, "-").concat(i));
116
+ }), textList.length === 0 && /*#__PURE__*/_jsx(Empty, {
117
+ description: "\u6682\u65E0\u64CD\u4F5C\u65E5\u5FD7",
118
+ image: Empty.PRESENTED_IMAGE_SIMPLE
119
+ })]
120
+ })
121
+ });
122
+ }
@@ -0,0 +1,83 @@
1
+ .videoPublishLog{
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
+ }
20
+ }
21
+ pre{
22
+ word-break: break-all;
23
+ white-space: break-spaces;
24
+
25
+ //font-size: 12px;
26
+ line-height: 1.5em;
27
+ font-weight: 300;
28
+ color: #555;
29
+ }
30
+ .warp{
31
+ height: calc(100vh - 195px);
32
+ overflow-y: auto;
33
+ }
34
+ .line, p{
35
+ margin: 4px 0 6px;
36
+ word-break: break-all;
37
+ white-space: break-spaces;
38
+ //font-size: 12px;
39
+ line-height: 1.6em;
40
+ font-weight: 400;
41
+ color: #555;
42
+ padding: 0;
43
+ &.line-fail{
44
+ :global{
45
+ .content{
46
+ color: #C00;
47
+ }
48
+ }
49
+ }
50
+ }
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
+
77
+ }
78
+ .padVideo-Progress{
79
+ width: 200px;
80
+ }
81
+ }
82
+ }
83
+
@@ -42,6 +42,7 @@ var VideoPublishVideoAccountListQuery = function VideoPublishVideoAccountListQue
42
42
  }), VideoPlatformList.map(function (item) {
43
43
  return /*#__PURE__*/_jsx(Select, {
44
44
  value: item.platform,
45
+ disabled: item.disabled,
45
46
  children: /*#__PURE__*/_jsx(VideoPlatform, {
46
47
  platform: item.platform,
47
48
  showName: true