component-shipinlv 1.0.36 → 1.0.50

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) 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 +430 -0
  16. package/dist/VideoPublish/account-manage/list.less +162 -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 +43 -13
  22. package/dist/VideoPublish/index.less +4 -4
  23. package/dist/VideoPublish/log/index.d.ts +2 -0
  24. package/dist/VideoPublish/log/index.js +122 -0
  25. package/dist/VideoPublish/log/index.less +83 -0
  26. package/dist/VideoPublish/video-account/index.less +1 -0
  27. package/dist/VideoPublish/video-account/query.js +1 -0
  28. package/dist/component/markdown/github-markdown-light.less +1102 -0
  29. package/dist/component/markdown/index.d.ts +8 -0
  30. package/dist/component/markdown/index.js +69 -0
  31. package/dist/component/markdown/index.less +55 -0
  32. package/dist/component/video-platform/logo.d.ts +1 -0
  33. package/dist/component/video-platform/logo.js +6 -0
  34. package/dist/config/apiUrls.js +1 -1
  35. package/dist/lib/accountManageSettingConfig.d.ts +2 -0
  36. package/dist/lib/accountManageSettingConfig.js +15 -0
  37. package/dist/lib/event.d.ts +7 -0
  38. package/dist/lib/event.js +59 -0
  39. package/dist/lib/getLocalUserInfo.d.ts +2 -0
  40. package/dist/lib/getLocalUserInfo.js +19 -0
  41. package/dist/lib/math.d.ts +38 -0
  42. package/dist/lib/math.js +146 -0
  43. package/dist/lib/sleep.d.ts +2 -0
  44. package/dist/lib/sleep.js +23 -0
  45. package/dist/lib/store.d.ts +7 -0
  46. package/dist/lib/store.js +36 -0
  47. package/dist/lib/toast.d.ts +2 -0
  48. package/dist/lib/toast.js +8 -0
  49. package/dist/lib/toastError.d.ts +2 -0
  50. package/dist/lib/toastError.js +8 -0
  51. package/dist/service/api/VideoPublishController.js +1 -0
  52. package/dist/service/api/VideoPublishVideoAccountController.d.ts +13 -0
  53. package/dist/service/api/VideoPublishVideoAccountController.js +140 -0
  54. package/dist/types/PublishNpm.d.ts +36 -0
  55. package/dist/types/PublishNpm.js +0 -0
  56. package/dist/types/PublishTaskPlan.d.ts +41 -0
  57. package/dist/types/PublishTaskPlan.js +0 -0
  58. package/dist/types/User.d.ts +83 -0
  59. package/dist/types/VideoPublishLog.d.ts +32 -0
  60. package/dist/types/VideoPublishLog.js +0 -0
  61. package/dist/typings/VideoPublishAccountManageSetting.d.ts +5 -0
  62. package/dist/typings/VideoPublishAccountManageSetting.js +0 -0
  63. package/dist/typings/VideoPublishVideoAccount.d.ts +69 -0
  64. package/dist/typings/VideoPublishVideoAccount.js +0 -0
  65. package/dist/window.d.ts +9 -0
  66. package/package.json +2 -1
@@ -4,14 +4,18 @@ 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
- import PageContentWarp from "../UI/PageContentWarp";
10
+ import VideoPublishLog from "./log";
11
+ import VideoPublishAccountManageSettingPage from "./account-manage/setting";
12
+ import VideoPublishAccountManageHomePage from "./account-manage/home";
11
13
  import { jsx as _jsx } from "react/jsx-runtime";
12
14
  import { jsxs as _jsxs } from "react/jsx-runtime";
13
15
  var VideoPublish = function VideoPublish(_ref) {
14
16
  var disabled = _ref.disabled,
17
+ _ref$canPublish = _ref.canPublish,
18
+ canPublish = _ref$canPublish === void 0 ? false : _ref$canPublish,
15
19
  contentHeight = _ref.contentHeight,
16
20
  productType = _ref.productType,
17
21
  apiUrl = _ref.apiUrl,
@@ -29,9 +33,27 @@ var VideoPublish = function VideoPublish(_ref) {
29
33
  tabsItems = _useState6[0],
30
34
  setTabsItems = _useState6[1];
31
35
  var MenuAllList = [{
36
+ key: 'long-video-sales-create',
37
+ icon: /*#__PURE__*/_jsx(VideoCameraAddOutlined, {}),
38
+ label: '添加账号',
39
+ children: /*#__PURE__*/_jsx(VideoPublishAccountManageHomePage, {
40
+ apiUrl: apiUrl,
41
+ env: env,
42
+ canPublish: canPublish
43
+ })
44
+ }, {
45
+ key: 'video-account',
46
+ icon: /*#__PURE__*/_jsx(UsergroupAddOutlined, {}),
47
+ label: '管理账户',
48
+ children: /*#__PURE__*/_jsx(VideoPublishVideoAccount, {
49
+ disabled: disabled,
50
+ env: env
51
+ })
52
+ }, {
32
53
  key: 'creat-task',
33
54
  icon: /*#__PURE__*/_jsx(VideoCameraAddOutlined, {}),
34
- label: '定时发布',
55
+ label: '批量发布',
56
+ disabled: !canPublish,
35
57
  children: /*#__PURE__*/_jsx(VideoPublishCreateTask, {
36
58
  disabled: disabled,
37
59
  productType: productType,
@@ -42,18 +64,23 @@ var VideoPublish = function VideoPublish(_ref) {
42
64
  key: 'task-list',
43
65
  icon: /*#__PURE__*/_jsx(ClockCircleOutlined, {}),
44
66
  label: '发布列表',
67
+ disabled: !canPublish,
45
68
  children: /*#__PURE__*/_jsx(VideoPublishTaskList, {
46
69
  disabled: disabled,
47
70
  env: env
48
71
  })
49
72
  }, {
50
- key: 'video-account',
51
- icon: /*#__PURE__*/_jsx(UsergroupAddOutlined, {}),
52
- label: '短视频账户',
53
- children: /*#__PURE__*/_jsx(VideoPublishVideoAccount, {
54
- disabled: disabled,
55
- env: env
56
- })
73
+ key: 'setting',
74
+ icon: /*#__PURE__*/_jsx(SettingOutlined, {}),
75
+ label: '配置',
76
+ disabled: !canPublish,
77
+ children: /*#__PURE__*/_jsx(VideoPublishAccountManageSettingPage, {})
78
+ }, {
79
+ key: 'log',
80
+ icon: /*#__PURE__*/_jsx(FileSearchOutlined, {}),
81
+ label: '日志',
82
+ disabled: !canPublish,
83
+ children: /*#__PURE__*/_jsx(VideoPublishLog, {})
57
84
  }];
58
85
  var onMenu = function onMenu(key) {
59
86
  setActiveKey(key);
@@ -72,7 +99,8 @@ var VideoPublish = function VideoPublish(_ref) {
72
99
  menuList.push({
73
100
  key: items.key,
74
101
  icon: items.icon,
75
- label: items.label
102
+ label: items.label,
103
+ disabled: items.disabled
76
104
  });
77
105
  });
78
106
  setTabsItems([].concat(tabsItems));
@@ -82,8 +110,10 @@ var VideoPublish = function VideoPublish(_ref) {
82
110
  useEffect(function () {
83
111
  onInit();
84
112
  }, []);
85
- return /*#__PURE__*/_jsx(PageContentWarp, {
86
- minHeight: contentHeight ? contentHeight : '100%',
113
+ return /*#__PURE__*/_jsx("div", {
114
+ style: {
115
+ minHeight: contentHeight ? contentHeight : '100%'
116
+ },
87
117
  children: /*#__PURE__*/_jsxs("div", {
88
118
  className: "videoPublish",
89
119
  style: {
@@ -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 {
@@ -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
+
@@ -3,6 +3,7 @@
3
3
  flex-direction: column;
4
4
  height: 100%;
5
5
 
6
+
6
7
  .userInfo{
7
8
  display: flex;
8
9
  flex-direction: row;
@@ -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