component-shipinlv 1.0.10 → 1.0.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. package/dist/AuthClient/qr/index.css.js +1 -1
  2. package/dist/UI/DialogDrawerFooter.css.js +1 -1
  3. package/dist/UI/FileSize.css.d.ts +5 -0
  4. package/dist/UI/FileSize.css.js +6 -0
  5. package/dist/UI/FileSize.d.ts +10 -0
  6. package/dist/UI/FileSize.js +63 -0
  7. package/dist/UI/LoadError.css.js +1 -1
  8. package/dist/UI/PageContentWarp.d.ts +1 -1
  9. package/dist/UI/PageContentWarp.js +1 -1
  10. package/dist/UI/Time.d.ts +8 -0
  11. package/dist/UI/Time.js +19 -0
  12. package/dist/UI/duration.css.d.ts +5 -0
  13. package/dist/UI/duration.css.js +6 -0
  14. package/dist/UI/duration.d.ts +6 -0
  15. package/dist/UI/duration.js +49 -0
  16. package/dist/UI/text-input.d.ts +13 -0
  17. package/dist/UI/text-input.js +108 -0
  18. package/dist/UI/text-input.less +19 -0
  19. package/dist/VideoPublish/creat-task/index.css.d.ts +5 -0
  20. package/dist/VideoPublish/creat-task/index.css.js +6 -0
  21. package/dist/VideoPublish/creat-task/index.d.ts +9 -0
  22. package/dist/VideoPublish/creat-task/index.js +462 -0
  23. package/dist/VideoPublish/creat-task/select-list.css.d.ts +5 -0
  24. package/dist/VideoPublish/creat-task/select-list.css.js +6 -0
  25. package/dist/VideoPublish/creat-task/select-list.d.ts +8 -0
  26. package/dist/VideoPublish/creat-task/select-list.js +257 -0
  27. package/dist/VideoPublish/creat-task/task-list.css.d.ts +5 -0
  28. package/dist/VideoPublish/creat-task/task-list.css.js +6 -0
  29. package/dist/VideoPublish/creat-task/task-list.d.ts +9 -0
  30. package/dist/VideoPublish/creat-task/task-list.js +300 -0
  31. package/dist/VideoPublish/index.css.d.ts +5 -0
  32. package/dist/VideoPublish/index.css.js +6 -0
  33. package/dist/VideoPublish/index.d.ts +11 -0
  34. package/dist/VideoPublish/index.js +122 -0
  35. package/dist/VideoPublish/index.less +52 -0
  36. package/dist/VideoPublish/task-list/index.d.ts +8 -0
  37. package/dist/VideoPublish/task-list/index.js +121 -0
  38. package/dist/VideoPublish/task-list/index.less +5 -0
  39. package/dist/VideoPublish/video-account/index.d.ts +8 -0
  40. package/dist/VideoPublish/video-account/index.js +110 -0
  41. package/dist/VideoPublish/video-account/index.less +5 -0
  42. package/dist/asset/image/platform/bilibili.png +0 -0
  43. package/dist/asset/image/platform/douyin.png +0 -0
  44. package/dist/asset/image/platform/douyu.png +0 -0
  45. package/dist/asset/image/platform/huya.png +0 -0
  46. package/dist/asset/image/platform/kuaishou.png +0 -0
  47. package/dist/asset/image/platform/youtube.png +0 -0
  48. package/dist/component/media-kind.d.ts +10 -0
  49. package/dist/component/media-kind.js +24 -0
  50. package/dist/component/media-show.d.ts +13 -0
  51. package/dist/component/media-show.js +84 -0
  52. package/dist/component/media-show.less +53 -0
  53. package/dist/component/video-platform/logo.d.ts +22 -0
  54. package/dist/component/video-platform/logo.js +72 -0
  55. package/dist/component/video-platform/logo.less +42 -0
  56. package/dist/component/videoKindTag/index.d.ts +13 -0
  57. package/dist/component/videoKindTag/index.js +44 -0
  58. package/dist/global.less +4 -0
  59. package/dist/index.d.ts +5 -0
  60. package/dist/index.js +5 -0
  61. package/dist/join-client/index.css.js +1 -1
  62. package/dist/lib/Tool.d.ts +4 -1
  63. package/dist/lib/Tool.js +39 -0
  64. package/dist/lib/component/getImageUrl.d.ts +2 -0
  65. package/dist/lib/component/getImageUrl.js +8 -0
  66. package/dist/lib/component/getSoundUrl.d.ts +2 -0
  67. package/dist/lib/component/getSoundUrl.js +9 -0
  68. package/dist/lib/component/getVideoUrl.d.ts +2 -0
  69. package/dist/lib/component/getVideoUrl.js +9 -0
  70. package/dist/lib/isInClient.js +2 -1
  71. package/dist/lib/request.js +1 -1
  72. package/dist/service/api/VideoPublishController.d.ts +11 -0
  73. package/dist/service/api/VideoPublishController.js +85 -0
  74. package/dist/service/api/VideoPublishTaskController.d.ts +8 -0
  75. package/dist/service/api/VideoPublishTaskController.js +29 -0
  76. package/dist/types/VideoPublish.d.ts +112 -0
  77. package/dist/types/VideoPublish.js +0 -0
  78. package/dist/typings.d.ts +3 -0
  79. package/package.json +1 -1
@@ -0,0 +1,122 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import React, { useEffect, useState } from "react";
3
+ import "./index.less";
4
+ import { Menu, Tabs } from "antd";
5
+ import VideoPublishCreateTask from "./creat-task";
6
+ import isInClient from "../lib/isInClient";
7
+ import { ClockCircleOutlined, UsergroupAddOutlined, VideoCameraAddOutlined } from "@ant-design/icons";
8
+ import VideoPublishVideoAccount from "./video-account";
9
+ import VideoPublishTaskList from "./task-list";
10
+ import PageContentWarp from "../UI/PageContentWarp";
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ import { jsxs as _jsxs } from "react/jsx-runtime";
13
+ var VideoPublish = function VideoPublish(_ref) {
14
+ var disabled = _ref.disabled,
15
+ contentHeight = _ref.contentHeight,
16
+ productType = _ref.productType,
17
+ apiUrl = _ref.apiUrl,
18
+ env = _ref.env;
19
+ var _useState = useState([]),
20
+ _useState2 = _slicedToArray(_useState, 2),
21
+ menuList = _useState2[0],
22
+ setMenuList = _useState2[1];
23
+ var _useState3 = useState(''),
24
+ _useState4 = _slicedToArray(_useState3, 2),
25
+ activeKey = _useState4[0],
26
+ setActiveKey = _useState4[1];
27
+ var _useState5 = useState([]),
28
+ _useState6 = _slicedToArray(_useState5, 2),
29
+ tabsItems = _useState6[0],
30
+ setTabsItems = _useState6[1];
31
+ var MenuAllList = [{
32
+ key: 'creat-task',
33
+ icon: /*#__PURE__*/_jsx(VideoCameraAddOutlined, {}),
34
+ label: '定时发布',
35
+ children: /*#__PURE__*/_jsx(VideoPublishCreateTask, {
36
+ disabled: disabled,
37
+ productType: productType,
38
+ apiUrl: apiUrl,
39
+ env: env
40
+ })
41
+ }, {
42
+ key: 'task-list',
43
+ icon: /*#__PURE__*/_jsx(ClockCircleOutlined, {}),
44
+ label: '发布任务',
45
+ children: /*#__PURE__*/_jsx(VideoPublishTaskList, {
46
+ disabled: disabled,
47
+ env: env
48
+ })
49
+ }, {
50
+ key: 'video-account',
51
+ icon: /*#__PURE__*/_jsx(UsergroupAddOutlined, {}),
52
+ label: '短视频账户',
53
+ children: /*#__PURE__*/_jsx(VideoPublishVideoAccount, {
54
+ disabled: disabled,
55
+ env: env
56
+ })
57
+ }];
58
+ var onMenu = function onMenu(key) {
59
+ setActiveKey(key);
60
+ };
61
+ var onInit = function onInit() {
62
+ var _menuList$;
63
+ var tabsItems = [];
64
+ var menuList = [];
65
+ var isClient = isInClient();
66
+ MenuAllList.forEach(function (items) {
67
+ // 不渲染
68
+ if (isClient && items.key === 'media-space') {
69
+ return;
70
+ }
71
+ tabsItems.push(items);
72
+ menuList.push({
73
+ key: items.key,
74
+ icon: items.icon,
75
+ label: items.label
76
+ });
77
+ });
78
+ setTabsItems([].concat(tabsItems));
79
+ setMenuList([].concat(menuList));
80
+ setActiveKey(((_menuList$ = menuList[0]) === null || _menuList$ === void 0 ? void 0 : _menuList$.key) || '');
81
+ };
82
+ useEffect(function () {
83
+ onInit();
84
+ }, []);
85
+ return /*#__PURE__*/_jsx(PageContentWarp, {
86
+ minHeight: contentHeight ? contentHeight : '100%',
87
+ children: /*#__PURE__*/_jsxs("div", {
88
+ className: "videoPublish",
89
+ style: {
90
+ height: contentHeight ? contentHeight : '100%'
91
+ },
92
+ children: [/*#__PURE__*/_jsx("div", {
93
+ className: "menuBox",
94
+ children: /*#__PURE__*/_jsx("div", {
95
+ className: "menuWarp",
96
+ children: /*#__PURE__*/_jsx(Menu, {
97
+ className: "menu",
98
+ onClick: function onClick(e) {
99
+ return onMenu(e.key);
100
+ },
101
+ style: {
102
+ width: '100%'
103
+ },
104
+ mode: "inline"
105
+ // defaultSelectedKeys={[ activeKey ]}
106
+ ,
107
+ selectedKeys: [activeKey],
108
+ items: menuList
109
+ })
110
+ })
111
+ }), /*#__PURE__*/_jsx("div", {
112
+ className: "pageContents",
113
+ children: /*#__PURE__*/_jsx(Tabs, {
114
+ activeKey: activeKey,
115
+ className: "my-tabs",
116
+ items: tabsItems
117
+ })
118
+ })]
119
+ })
120
+ });
121
+ };
122
+ export default VideoPublish;
@@ -0,0 +1,52 @@
1
+ .videoPublish {
2
+ display: flex;
3
+ flex-direction: row;
4
+ height: 100%;
5
+ position: static;
6
+
7
+ .menuBox {
8
+ display: flex;
9
+ flex-direction: column;
10
+ width: 180px;
11
+ //margin: 0 12px 0 0;
12
+ padding: 0 10px 0 0;
13
+ min-height: 100%;
14
+ border-right: 1px solid #E8E8E8;
15
+
16
+ .menuWarp{
17
+ position: fixed;
18
+ width: 180px;
19
+ padding: 0 0 0 5px;
20
+ }
21
+ .menu{
22
+ }
23
+
24
+ .ant-menu {
25
+ margin: 10px 0 0;
26
+ }
27
+
28
+ .ant-menu-light {
29
+ background-color: transparent !important;
30
+ border-right: none !important;
31
+ }
32
+ }
33
+
34
+ .pageContents {
35
+ flex: 1;
36
+ padding: 16px 16px 16px ;
37
+ overflow-y: auto;
38
+
39
+ .my-tabs {
40
+ width: 100%;
41
+ .ktv-ai-pageContentBox{
42
+ >h2{
43
+ margin-top: 0;
44
+ }
45
+ }
46
+
47
+ > .ant-tabs-nav {
48
+ display: none;
49
+ }
50
+ }
51
+ }
52
+ }
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import "./index.less";
3
+ interface Props {
4
+ disabled?: boolean;
5
+ env?: Global.Env;
6
+ }
7
+ declare const VideoPublishTaskList: React.FC<Props>;
8
+ export default VideoPublishTaskList;
@@ -0,0 +1,121 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import React, { useState } from "react";
3
+ import "./index.less";
4
+ import PageContentWarp from "../../UI/PageContentWarp";
5
+ import { useRequest } from "@umijs/hooks";
6
+ import * as VideoPublishController from "../../service/api/VideoPublishController";
7
+ import { Popover, Table, Tag } from "antd";
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ import { jsxs as _jsxs } from "react/jsx-runtime";
10
+ import { Fragment as _Fragment } from "react/jsx-runtime";
11
+ var VideoPublishTaskList = function VideoPublishTaskList(_ref) {
12
+ var disabled = _ref.disabled,
13
+ env = _ref.env;
14
+ var _useState = useState([]),
15
+ _useState2 = _slicedToArray(_useState, 2),
16
+ listData = _useState2[0],
17
+ setListData = _useState2[1];
18
+ var _useState3 = useState({
19
+ current: 1,
20
+ pageSize: 20,
21
+ total: 0,
22
+ simple: true
23
+ }),
24
+ _useState4 = _slicedToArray(_useState3, 2),
25
+ pagination = _useState4[0],
26
+ setPagination = _useState4[1];
27
+ var columns = [{
28
+ title: '序号',
29
+ dataIndex: '-',
30
+ key: '-',
31
+ render: function render(_, _1) {
32
+ var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
33
+ return index + 1;
34
+ }
35
+ }, {
36
+ title: '编号',
37
+ dataIndex: 'id',
38
+ key: 'id'
39
+ }, {
40
+ title: '平台',
41
+ dataIndex: 'platform',
42
+ key: 'platform'
43
+ }, {
44
+ title: '名称',
45
+ dataIndex: 'nickname',
46
+ key: 'nickname',
47
+ render: function render(nickname, record) {
48
+ return /*#__PURE__*/_jsx(Popover, {
49
+ title: "\u6807\u9898",
50
+ content: nickname,
51
+ children: /*#__PURE__*/_jsxs("div", {
52
+ className: "title",
53
+ children: [nickname, /*#__PURE__*/_jsx("div", {
54
+ children: record === null || record === void 0 ? void 0 : record.accountId
55
+ })]
56
+ })
57
+ });
58
+ }
59
+ }, {
60
+ title: /*#__PURE__*/_jsx(_Fragment, {
61
+ children: "\u662F\u5426\u767B\u5F55"
62
+ }),
63
+ dataIndex: 'isLoginValid',
64
+ key: 'isLoginValid',
65
+ render: function render(isLoginValid, record) {
66
+ return isLoginValid ? /*#__PURE__*/_jsx(Tag, {
67
+ color: "green",
68
+ children: "\u5DF2\u767B\u5F55"
69
+ }) : /*#__PURE__*/_jsx(Tag, {
70
+ color: "red",
71
+ children: "\u672A\u767B\u5F55"
72
+ });
73
+ }
74
+ }, {
75
+ title: /*#__PURE__*/_jsx(_Fragment, {
76
+ children: "\u89C6\u9891\u6570\u91CF"
77
+ }),
78
+ dataIndex: 'videoCount',
79
+ key: 'videoCount'
80
+ }, {
81
+ title: '粉丝数',
82
+ dataIndex: 'followerCount',
83
+ key: 'followerCount'
84
+ }];
85
+ var _useRequest = useRequest(function () {
86
+ var current = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : pagination.current;
87
+ return VideoPublishController.taskList({
88
+ current: 1,
89
+ pageSize: pagination.pageSize
90
+ }, {
91
+ env: env
92
+ });
93
+ }, {
94
+ onSuccess: function onSuccess(result) {
95
+ setListData(result.list);
96
+ setPagination(result.pagination);
97
+ }
98
+ }),
99
+ runTaskList = _useRequest.run,
100
+ loadingTaskList = _useRequest.loading,
101
+ errorTaskList = _useRequest.error;
102
+ return /*#__PURE__*/_jsx(PageContentWarp, {
103
+ loading: loadingTaskList,
104
+ error: errorTaskList,
105
+ onReload: runTaskList,
106
+ title: "\u53D1\u5E03\u4EFB\u52A1",
107
+ className: "videoPublishTaskList",
108
+ children: /*#__PURE__*/_jsx(Table, {
109
+ size: "small",
110
+ bordered: true,
111
+ rowKey: function rowKey(record) {
112
+ return "".concat(record.id);
113
+ },
114
+ loading: false,
115
+ columns: columns,
116
+ dataSource: listData,
117
+ pagination: false
118
+ })
119
+ });
120
+ };
121
+ export default VideoPublishTaskList;
@@ -0,0 +1,5 @@
1
+ .videoPublishVideoAccountList{
2
+ display: flex;
3
+ flex-direction: column;
4
+ height: 100%;
5
+ }
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import "./index.less";
3
+ interface Props {
4
+ disabled?: boolean;
5
+ env?: Global.Env;
6
+ }
7
+ declare const VideoPublishVideoAccount: React.FC<Props>;
8
+ export default VideoPublishVideoAccount;
@@ -0,0 +1,110 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import React, { useState } from "react";
3
+ import "./index.less";
4
+ import PageContentWarp from "../../UI/PageContentWarp";
5
+ import { useRequest } from "@umijs/hooks";
6
+ import * as VideoPublishController from "../../service/api/VideoPublishController";
7
+ import { Popover, Table, Tag } from "antd";
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ import { jsxs as _jsxs } from "react/jsx-runtime";
10
+ import { Fragment as _Fragment } from "react/jsx-runtime";
11
+ var VideoPublishVideoAccount = function VideoPublishVideoAccount(_ref) {
12
+ var disabled = _ref.disabled,
13
+ env = _ref.env;
14
+ var _useState = useState([]),
15
+ _useState2 = _slicedToArray(_useState, 2),
16
+ listData = _useState2[0],
17
+ setListData = _useState2[1];
18
+ var columns = [{
19
+ title: '序号',
20
+ dataIndex: '-',
21
+ key: '-',
22
+ render: function render(_, _1) {
23
+ var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
24
+ return index + 1;
25
+ }
26
+ }, {
27
+ title: '编号',
28
+ dataIndex: 'id',
29
+ key: 'id'
30
+ }, {
31
+ title: '平台',
32
+ dataIndex: 'platform',
33
+ key: 'platform'
34
+ }, {
35
+ title: '名称',
36
+ dataIndex: 'nickname',
37
+ key: 'nickname',
38
+ render: function render(nickname, record) {
39
+ return /*#__PURE__*/_jsx(Popover, {
40
+ title: "\u6807\u9898",
41
+ content: nickname,
42
+ children: /*#__PURE__*/_jsxs("div", {
43
+ className: "title",
44
+ children: [nickname, /*#__PURE__*/_jsx("div", {
45
+ children: record === null || record === void 0 ? void 0 : record.accountId
46
+ })]
47
+ })
48
+ });
49
+ }
50
+ }, {
51
+ title: /*#__PURE__*/_jsx(_Fragment, {
52
+ children: "\u662F\u5426\u767B\u5F55"
53
+ }),
54
+ dataIndex: 'isLoginValid',
55
+ key: 'isLoginValid',
56
+ render: function render(isLoginValid, record) {
57
+ return isLoginValid ? /*#__PURE__*/_jsx(Tag, {
58
+ color: "green",
59
+ children: "\u5DF2\u767B\u5F55"
60
+ }) : /*#__PURE__*/_jsx(Tag, {
61
+ color: "red",
62
+ children: "\u672A\u767B\u5F55"
63
+ });
64
+ }
65
+ }, {
66
+ title: /*#__PURE__*/_jsx(_Fragment, {
67
+ children: "\u89C6\u9891\u6570\u91CF"
68
+ }),
69
+ dataIndex: 'videoCount',
70
+ key: 'videoCount'
71
+ }, {
72
+ title: '粉丝数',
73
+ dataIndex: 'followerCount',
74
+ key: 'followerCount'
75
+ }];
76
+ var _useRequest = useRequest(function () {
77
+ return VideoPublishController.videoAccountList({
78
+ current: 1,
79
+ pageSize: 300 // 服务器 固定死了 300;
80
+ }, {
81
+ env: env
82
+ });
83
+ }, {
84
+ onSuccess: function onSuccess(result) {
85
+ setListData(result.list);
86
+ }
87
+ }),
88
+ runVideoAccount = _useRequest.run,
89
+ loadingVideoAccount = _useRequest.loading,
90
+ errorVideoAccount = _useRequest.error;
91
+ return /*#__PURE__*/_jsx(PageContentWarp, {
92
+ loading: loadingVideoAccount,
93
+ error: errorVideoAccount,
94
+ onReload: runVideoAccount,
95
+ title: "\u77ED\u89C6\u9891\u8D26\u6237",
96
+ className: "videoPublishVideoAccountList",
97
+ children: /*#__PURE__*/_jsx(Table, {
98
+ size: "small",
99
+ bordered: true,
100
+ rowKey: function rowKey(record) {
101
+ return "".concat(record.id);
102
+ },
103
+ loading: false,
104
+ columns: columns,
105
+ dataSource: listData,
106
+ pagination: false
107
+ })
108
+ });
109
+ };
110
+ export default VideoPublishVideoAccount;
@@ -0,0 +1,5 @@
1
+ .videoPublishVideoAccountList{
2
+ display: flex;
3
+ flex-direction: column;
4
+ height: 100%;
5
+ }
@@ -0,0 +1,10 @@
1
+ export declare const MediaSourceMineTypeList: {
2
+ image: string[];
3
+ video: string[];
4
+ audio: string[];
5
+ font: string[];
6
+ subtitle: string[];
7
+ };
8
+ type TypeKind = '' | 'image' | 'video' | 'audio' | 'font';
9
+ export declare const GetMineTypeByUrl: (url: string) => TypeKind;
10
+ export {};
@@ -0,0 +1,24 @@
1
+ import Tool from "../lib/Tool";
2
+ export var MediaSourceMineTypeList = {
3
+ image: ['image/jpeg', 'image/jpg', 'image/png', 'image/webp', 'image/gif', '.png', '.jpg', '.webp', '.gif'],
4
+ video: ['video/mp4', 'video/webm', '.mp4', '.webm', '.wmv', '.mov', '.mpeg', '.avi', '.mv4'],
5
+ audio: ['audio/mp3', '.mp3', '.wav', '.wma', '.aac', '.ogg', '.ape', '.flac'],
6
+ font: ['.ttf'],
7
+ subtitle: ['.txt'
8
+ // '.srt',
9
+ ]
10
+ };
11
+
12
+ export var GetMineTypeByUrl = function GetMineTypeByUrl(url) {
13
+ var fileExt = '.' + Tool.getFileExt(url).toLocaleLowerCase();
14
+ var typeKind = '';
15
+ for (var kind in MediaSourceMineTypeList) {
16
+ // @ts-ignore
17
+ var item = MediaSourceMineTypeList[kind];
18
+ if (item !== null && item !== void 0 && item.includes(fileExt)) {
19
+ // @ts-ignore
20
+ typeKind = kind;
21
+ }
22
+ }
23
+ return typeKind;
24
+ };
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import './media-show.less';
3
+ interface Prop {
4
+ title?: string;
5
+ className?: string;
6
+ url: string;
7
+ width: number;
8
+ height: number;
9
+ }
10
+ type TypeKind = 'video' | "image" | "font" | 'audio';
11
+ export declare const onMediaShowView: (title: string, url: string, typeKind: '' | TypeKind) => void;
12
+ declare const MediaShow: React.FC<Prop>;
13
+ export default MediaShow;
@@ -0,0 +1,84 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import React, { useState } from "react";
3
+ import "./media-show.less";
4
+ import Tool from "../lib/Tool";
5
+ import { PlayCircleOutlined, SoundOutlined } from "@ant-design/icons";
6
+ import { GetMineTypeByUrl } from "./media-kind";
7
+ import getVideoUrl from "../lib/component/getVideoUrl";
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ import { jsxs as _jsxs } from "react/jsx-runtime";
10
+ export var onMediaShowView = function onMediaShowView(title, url, typeKind) {
11
+ var mediaUrl = getVideoUrl(url);
12
+ Tool.drawer({
13
+ title: title,
14
+ content: /*#__PURE__*/_jsxs("div", {
15
+ className: "mediaShow",
16
+ children: [["image", "font"].includes(typeKind) && /*#__PURE__*/_jsx("div", {
17
+ className: "image",
18
+ style: {
19
+ backgroundImage: "url(\"".concat(mediaUrl, "\")")
20
+ }
21
+ }), typeKind === "audio" && /*#__PURE__*/_jsx("div", {
22
+ className: "audio",
23
+ children: /*#__PURE__*/_jsx("audio", {
24
+ controls: true,
25
+ autoPlay: true,
26
+ children: /*#__PURE__*/_jsx("source", {
27
+ src: mediaUrl
28
+ })
29
+ })
30
+ }), typeKind === "video" && /*#__PURE__*/_jsx("div", {
31
+ className: "video",
32
+ children: /*#__PURE__*/_jsx("video", {
33
+ width: "100%",
34
+ height: "100%",
35
+ controls: true,
36
+ autoPlay: true,
37
+ children: /*#__PURE__*/_jsx("source", {
38
+ src: mediaUrl
39
+ })
40
+ })
41
+ })]
42
+ }),
43
+ width: 580
44
+ });
45
+ };
46
+ var MediaShow = function MediaShow(_ref) {
47
+ var _ref$title = _ref.title,
48
+ title = _ref$title === void 0 ? '' : _ref$title,
49
+ className = _ref.className,
50
+ url = _ref.url,
51
+ width = _ref.width,
52
+ height = _ref.height;
53
+ var _useState = useState(GetMineTypeByUrl(url)),
54
+ _useState2 = _slicedToArray(_useState, 1),
55
+ typeKind = _useState2[0];
56
+ var ThumbUrlQuery = "?imageView2/0/w/".concat(width * 2);
57
+ return /*#__PURE__*/_jsxs("div", {
58
+ className: "mediaShow ".concat(className, " ").concat(url === '' ? 'hidden' : '', " "),
59
+ style: {
60
+ width: width,
61
+ height: height
62
+ },
63
+ onClick: function onClick() {
64
+ return onMediaShowView(title, url, typeKind);
65
+ },
66
+ children: [typeKind === "image" && /*#__PURE__*/_jsx("div", {
67
+ className: "image",
68
+ style: {
69
+ backgroundImage: "url(\"".concat(url).concat(ThumbUrlQuery, "\")")
70
+ }
71
+ }), typeKind === "audio" && /*#__PURE__*/_jsx("div", {
72
+ className: "audio",
73
+ children: /*#__PURE__*/_jsx(SoundOutlined, {
74
+ className: "icon"
75
+ })
76
+ }), typeKind === "video" && /*#__PURE__*/_jsx("div", {
77
+ className: "video",
78
+ children: /*#__PURE__*/_jsx(PlayCircleOutlined, {
79
+ className: "icon"
80
+ })
81
+ })]
82
+ });
83
+ };
84
+ export default MediaShow;
@@ -0,0 +1,53 @@
1
+ .mediaShow{
2
+ background-color: #F2F2F2;
3
+ display: flex;
4
+ flex-direction: column;
5
+ height: 100%;
6
+ cursor: pointer;
7
+ &.hidden{
8
+ display: none;
9
+ }
10
+ .image{
11
+ background-position: center;
12
+ background-repeat: no-repeat;
13
+ background-size: contain;
14
+ display: flex;
15
+ flex-direction: column;
16
+ height: 100%;
17
+ justify-content: center;
18
+ }
19
+
20
+ .audio{
21
+ position: relative;
22
+ display: flex;
23
+ flex-direction: column;
24
+ justify-content: center;
25
+ text-align: center;
26
+ border-radius: 3px;
27
+ margin: auto 0;
28
+ .icon{
29
+ margin: 0 auto;
30
+ color: #000;
31
+ font-size: 30px;
32
+ padding: 6px 0;
33
+ opacity: 0.8;
34
+ }
35
+ }
36
+
37
+ .video{
38
+ position: relative;
39
+ display: flex;
40
+ flex-direction: column;
41
+ height: 100%;
42
+ justify-content: center;
43
+ text-align: center;
44
+ background-color: #000;
45
+ border-radius: 3px;
46
+ .icon{
47
+ margin: 0 auto;
48
+ color: #FFF;
49
+ font-size: 28px;
50
+ opacity: 0.8;
51
+ }
52
+ }
53
+ }
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import './logo.less';
3
+ interface Props {
4
+ platform: Global.VideoPlatformKind | '';
5
+ size?: number | string;
6
+ showName?: boolean;
7
+ className?: string;
8
+ disabled?: boolean;
9
+ }
10
+ interface VideoPlatformLogoList {
11
+ platform: Global.VideoPlatformKind;
12
+ name: string;
13
+ videoWebSiteUrl: string;
14
+ allowMainDomainList: string[];
15
+ }
16
+ interface VideoPlatformLogoDict {
17
+ [name: string]: VideoPlatformLogoList;
18
+ }
19
+ export declare const VideoPlatformLogoList: VideoPlatformLogoList[];
20
+ export declare const VideoPlatformLogoDict: VideoPlatformLogoDict;
21
+ declare const VideoPlatformLogo: React.FC<Props>;
22
+ export default VideoPlatformLogo;