component-shipinlv 2.0.6 → 2.0.9

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.
@@ -13,6 +13,7 @@ import { useRequest } from "@umijs/hooks";
13
13
  import * as VideoPublishController from "../../../service/api/VideoPublishController";
14
14
  import VideoPlatform from "../../../component/video-platform/logo";
15
15
  import VideoPublishCreateTaskHourEnabled from "../hour-enabled";
16
+ import dayjs from "dayjs";
16
17
  import { jsx as _jsx } from "react/jsx-runtime";
17
18
  import { Fragment as _Fragment } from "react/jsx-runtime";
18
19
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -345,7 +346,7 @@ var VideoPublishCreateTaskBase = function VideoPublishCreateTaskBase(_ref) {
345
346
  children: /*#__PURE__*/_jsx(DatePicker, {
346
347
  showTime: true,
347
348
  disabledDate: function disabledDate(e) {
348
- return e.valueOf() + 86400e3 < Date.now() || e.valueOf() > Date.now() + 86400e3 * 14;
349
+ return e.valueOf() + 86400e3 < Date.now() || e.valueOf() >= dayjs().startOf('date').valueOf() + 86400e3 * 14;
349
350
  },
350
351
  onChange: function onChange(value, dateString) {
351
352
  console.log('Selected Time: ', value);
@@ -4,7 +4,7 @@ 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 { BorderlessTableOutlined, ClockCircleOutlined, FileSearchOutlined, FileTextOutlined, GlobalOutlined, PieChartOutlined, SettingOutlined, UsergroupAddOutlined, VideoCameraAddOutlined } from "@ant-design/icons";
7
+ import { BorderlessTableOutlined, ClockCircleOutlined, FileSearchOutlined, FileTextOutlined, GlobalOutlined, PieChartOutlined, QuestionCircleOutlined, SettingOutlined, UsergroupAddOutlined, VideoCameraAddOutlined } from "@ant-design/icons";
8
8
  import VideoPublishVideoAccount from "./video-account";
9
9
  import VideoPublishTaskList from "./task-list";
10
10
  import VideoPublishLog from "./log";
@@ -16,6 +16,7 @@ import VideoPublishTaskVideoTopic from "./video-topic";
16
16
  import VideoPublishTaskPlanList from "./task-list/plan/list";
17
17
  import VideoPublishStatisticPublish from "./video-publish-statistic";
18
18
  import saveSid from "../lib/saveSid";
19
+ import VideoStudyPage from "../video-study";
19
20
  import { jsx as _jsx } from "react/jsx-runtime";
20
21
  import { jsxs as _jsxs } from "react/jsx-runtime";
21
22
  var VideoPublish = function VideoPublish(_ref) {
@@ -129,6 +130,15 @@ var VideoPublish = function VideoPublish(_ref) {
129
130
  env: env,
130
131
  clientIdentity: clientIdentity
131
132
  })
133
+ }, {
134
+ key: 'video-study',
135
+ icon: /*#__PURE__*/_jsx(QuestionCircleOutlined, {}),
136
+ label: '视频教程',
137
+ children: /*#__PURE__*/_jsx(VideoStudyPage, {
138
+ title: "\u53D1\u5E03\u529F\u80FD \xB7 \u89C6\u9891\u6559\u7A0B",
139
+ productType: "video-publish",
140
+ env: env
141
+ })
132
142
  }];
133
143
  var _onMenu = function _onMenu(key) {
134
144
  setActiveKey(key);
package/dist/index.d.ts CHANGED
@@ -25,3 +25,4 @@ export { default as openInFolder } from './base/openInFolder';
25
25
  export { default as soundInfo } from './base/soundInfo';
26
26
  export { default as fileListContent } from './base/fileListContent';
27
27
  export { default as fileList } from './base/fileList';
28
+ export { default as VideoStudy } from './video-study';
package/dist/index.js CHANGED
@@ -28,4 +28,5 @@ export { default as folderSelect } from "./base/folderSelect";
28
28
  export { default as openInFolder } from "./base/openInFolder";
29
29
  export { default as soundInfo } from "./base/soundInfo";
30
30
  export { default as fileListContent } from "./base/fileListContent";
31
- export { default as fileList } from "./base/fileList";
31
+ export { default as fileList } from "./base/fileList";
32
+ export { default as VideoStudy } from "./video-study";
@@ -162,7 +162,7 @@ declare const Tool: {
162
162
  getTitleByPath(path: string): string;
163
163
  getDirByPath(path: string): string;
164
164
  h5Pay(query: Pay.H5PayQuery): void;
165
- notification(type: "success" | "info" | "warning" | "error", message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
165
+ notification(type: "info" | "error" | "success" | "warning", message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
166
166
  notificationSuccess(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
167
167
  notificationError(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
168
168
  notificationWarning(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
@@ -0,0 +1 @@
1
+ export declare function list(body?: {}, options?: ServicesApi.RequestOptions): Promise<VideoStudy.List[]>;
@@ -0,0 +1,29 @@
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
+ export function list(_x, _x2) {
6
+ return _list.apply(this, arguments);
7
+ }
8
+ function _list() {
9
+ _list = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(body, options) {
10
+ var url;
11
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
12
+ while (1) switch (_context.prev = _context.next) {
13
+ case 0:
14
+ url = "videoStudy/list"; // PublishDomainApi(`videoStudy/list`, options?.env, );
15
+ return _context.abrupt("return", request(url, _objectSpread({
16
+ method: 'POST',
17
+ headers: {
18
+ 'Content-Type': 'application/json'
19
+ },
20
+ data: _objectSpread({}, body)
21
+ }, options || {})));
22
+ case 2:
23
+ case "end":
24
+ return _context.stop();
25
+ }
26
+ }, _callee);
27
+ }));
28
+ return _list.apply(this, arguments);
29
+ }
@@ -0,0 +1,7 @@
1
+ declare namespace VideoStudy {
2
+ interface List {
3
+ title: string;
4
+ id: number;
5
+ videoUrl: string;
6
+ }
7
+ }
File without changes
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import "./index.less";
3
+ interface Props {
4
+ title?: string;
5
+ subtitle?: string;
6
+ productType: string;
7
+ env?: Global.Env;
8
+ }
9
+ declare const VideoStudyPage: React.FC<Props>;
10
+ export default VideoStudyPage;
@@ -0,0 +1,65 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import React, { useState } from "react";
3
+ import "./index.less";
4
+ import { Row, Col } from "antd";
5
+ import PageContentWarp from "../UI/PageContentWarp";
6
+ import { useRequest } from "@umijs/hooks";
7
+ import * as VideoStudyController from "../service/api/VideoStudyController";
8
+ import { PlayCircleFilled } from "@ant-design/icons";
9
+ import Tool from "../lib/Tool";
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ import { jsxs as _jsxs } from "react/jsx-runtime";
12
+ var VideoStudyPage = function VideoStudyPage(_ref) {
13
+ var title = _ref.title,
14
+ subtitle = _ref.subtitle,
15
+ productType = _ref.productType,
16
+ env = _ref.env;
17
+ var _useState = useState([]),
18
+ _useState2 = _slicedToArray(_useState, 2),
19
+ listData = _useState2[0],
20
+ setListData = _useState2[1];
21
+ var _useRequest = useRequest(function () {
22
+ return VideoStudyController.list({
23
+ productType: productType
24
+ }, {
25
+ env: env
26
+ });
27
+ }, {
28
+ onSuccess: function onSuccess(result) {
29
+ setListData(result);
30
+ }
31
+ }),
32
+ run = _useRequest.run,
33
+ loading = _useRequest.loading,
34
+ error = _useRequest.error;
35
+ return /*#__PURE__*/_jsx(PageContentWarp, {
36
+ loading: loading,
37
+ error: error,
38
+ onReload: run,
39
+ title: title || '视频教程',
40
+ subtitle: subtitle,
41
+ className: "videoStudy",
42
+ children: /*#__PURE__*/_jsx("div", {
43
+ className: "warp",
44
+ children: /*#__PURE__*/_jsx(Row, {
45
+ gutter: 24,
46
+ children: listData.map(function (items, index) {
47
+ return /*#__PURE__*/_jsx(Col, {
48
+ span: 6,
49
+ children: /*#__PURE__*/_jsx("div", {
50
+ className: "itemCard",
51
+ onClick: function onClick() {
52
+ Tool.toast('已经开始下载');
53
+ Tool.openWindow(items.videoUrl);
54
+ },
55
+ children: /*#__PURE__*/_jsxs("a", {
56
+ children: [/*#__PURE__*/_jsx(PlayCircleFilled, {}), " ", index + 1, " ", items.title]
57
+ })
58
+ })
59
+ }, items.id);
60
+ })
61
+ })
62
+ })
63
+ });
64
+ };
65
+ export default VideoStudyPage;
@@ -0,0 +1,16 @@
1
+ .videoStudy{
2
+ .itemCard{
3
+ font-size: 16px;
4
+ max-width: 100%;
5
+ overflow: hidden;
6
+ text-overflow: ellipsis;
7
+ word-break: keep-all;
8
+ white-space: nowrap;
9
+ padding: 6px;
10
+ margin: 0 0 16px 0;
11
+ }
12
+ .desc{
13
+ font-size: 12px;
14
+ opacity: 0.6;
15
+ }
16
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "component-shipinlv",
3
- "version": "2.0.6",
3
+ "version": "2.0.9",
4
4
  "description": "",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",