@cqsjjb/course-res-design 0.1.0-beta.4 → 0.1.0-beta.6

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.
package/CourseInfo.js CHANGED
@@ -3,6 +3,26 @@ import { Descriptions } from 'antd';
3
3
  import './CourseInfo.less';
4
4
  import { getLabelName } from './utils/tools';
5
5
  import { getCourseInfo, typePageAction } from './api/courseLibrary';
6
+
7
+ /** 资源渠道 */
8
+ export const COURSE_CHANNEL_ENUM = {
9
+ '01': '自有',
10
+ '02': '购买',
11
+ '03': '其他'
12
+ };
13
+ /** 资源形式 */
14
+ export const COURSE_MODE_ENUM = {
15
+ '01': '高清大屏',
16
+ '02': '慕课',
17
+ '03': '动画',
18
+ '04': 'PPT',
19
+ '05': '音频',
20
+ '06': '录屏',
21
+ '07': '情景剧',
22
+ '08': '实操',
23
+ '15': '微课',
24
+ '16': '微视频'
25
+ };
6
26
  /** 内置字段 labelTypeCode -> { label, valueKey, enumMap } */
7
27
  const INNER_FIELD_MAP = {
8
28
  INDUSTRY: {
@@ -7,7 +7,7 @@ import { getApiBaseName } from './utils';
7
7
  * @returns {Promise}
8
8
  */
9
9
  export const getResources = params => {
10
- return request.get(`/${getApiBaseName()}/course/getResExam/${params.fileId}`);
10
+ return request.get(`/${getApiBaseName(params?.apiBaseName)}/course/getResExam/${params.fileId}`);
11
11
  };
12
12
 
13
13
  /**
@@ -16,7 +16,7 @@ export const getResources = params => {
16
16
  * @returns {Promise}
17
17
  */
18
18
  export const getTemplateHour = params => {
19
- return request.post(`/${getApiBaseName()}/course/getResourceHour`, params);
19
+ return request.post(`/${getApiBaseName(params?.apiBaseName)}/course/getResourceHour`, params);
20
20
  };
21
21
 
22
22
  /**
package/api/global.js CHANGED
@@ -7,7 +7,7 @@ import { getApiBaseName } from './utils';
7
7
  * @returns {Promise}
8
8
  */
9
9
  export const getResUrlAction = params => {
10
- return request.get(`/${getApiBaseName()}/course/getVideoUrlByFileId/${params.fileId}`);
10
+ return request.get(`/${getApiBaseName(params?.apiBaseName)}/course/getVideoUrlByFileId/${params.fileId}`);
11
11
  };
12
12
 
13
13
  /**
@@ -17,6 +17,6 @@ export const getResUrlAction = params => {
17
17
  */
18
18
  export const getVideoCaption = params => {
19
19
  return request.get(
20
- `/${getApiBaseName()}/course/getCaptionListByFileId/${params.fileId}`
20
+ `/${getApiBaseName(params?.apiBaseName)}/course/getCaptionListByFileId/${params.fileId}`
21
21
  );
22
22
  };
package/api/utils.js CHANGED
@@ -2,7 +2,10 @@ const inIframe = () => {
2
2
  return window.self !== window.top;
3
3
  }
4
4
 
5
- export const getApiBaseName = () => {
5
+ export const getApiBaseName = (baseName) => {
6
+ if(baseName) {
7
+ return baseName;
8
+ }
6
9
  try {
7
10
  const location = inIframe() ? window.parent.location : window.location;
8
11
  return location.pathname.match(/^\/(\w+)\/[C|c]ontainer/)[1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cqsjjb/course-res-design",
3
- "version": "0.1.0-beta.4",
3
+ "version": "0.1.0-beta.6",
4
4
  "description": "课程资源设计组件库",
5
5
  "main": "index.js",
6
6
  "author": "jiaoxiwei",