|
@@ -48,12 +48,13 @@ interface DataItem {
|
|
|
id: string; //课程ID
|
|
id: string; //课程ID
|
|
|
title: string; //标题
|
|
title: string; //标题
|
|
|
subtitle: string; //副标题
|
|
subtitle: string; //副标题
|
|
|
- teacher: string; //UserID
|
|
|
|
|
|
|
+ teacher?: string; //UserID
|
|
|
course_count?: number; //课程数
|
|
course_count?: number; //课程数
|
|
|
|
|
+ member_count: number; //成员数量
|
|
|
type: number; //类型-公开/内部
|
|
type: number; //类型-公开/内部
|
|
|
createdAt: number; //创建时间
|
|
createdAt: number; //创建时间
|
|
|
- updated_at?: number; //修改时间
|
|
|
|
|
- article_id?: number; //文集ID
|
|
|
|
|
|
|
+ updatedAt?: number; //修改时间
|
|
|
|
|
+ article_id?: string; //文集ID
|
|
|
course_start_at?: string; //课程开始时间
|
|
course_start_at?: string; //课程开始时间
|
|
|
course_end_at?: string; //课程结束时间
|
|
course_end_at?: string; //课程结束时间
|
|
|
intro_markdown?: string; //简介
|
|
intro_markdown?: string; //简介
|
|
@@ -97,6 +98,9 @@ const Widget = () => {
|
|
|
/>
|
|
/>
|
|
|
);
|
|
);
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取各种课程的数量
|
|
|
|
|
+ */
|
|
|
const url = `/v2/course-my-course?studio=${studioname}`;
|
|
const url = `/v2/course-my-course?studio=${studioname}`;
|
|
|
get<ICourseNumberResponse>(url).then((json) => {
|
|
get<ICourseNumberResponse>(url).then((json) => {
|
|
|
if (json.ok) {
|
|
if (json.ok) {
|
|
@@ -134,12 +138,14 @@ const Widget = () => {
|
|
|
<Space>
|
|
<Space>
|
|
|
<Image
|
|
<Image
|
|
|
src={`${API_HOST}/${row.cover_img_name}`}
|
|
src={`${API_HOST}/${row.cover_img_name}`}
|
|
|
- width="64"
|
|
|
|
|
|
|
+ width={64}
|
|
|
fallback={`${API_HOST}/app/course/img/default.jpg`}
|
|
fallback={`${API_HOST}/app/course/img/default.jpg`}
|
|
|
/>
|
|
/>
|
|
|
<div>
|
|
<div>
|
|
|
<div>
|
|
<div>
|
|
|
- <Link to={`/course/${row.id}`}>{row.title}</Link>
|
|
|
|
|
|
|
+ <Link to={`/course/show/${row.id}`} target="_blank">
|
|
|
|
|
+ {row.title}
|
|
|
|
|
+ </Link>
|
|
|
</div>
|
|
</div>
|
|
|
<div>{row.subtitle}</div>
|
|
<div>{row.subtitle}</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -147,16 +153,6 @@ const Widget = () => {
|
|
|
);
|
|
);
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
- {
|
|
|
|
|
- //副标题
|
|
|
|
|
- title: intl.formatMessage({
|
|
|
|
|
- id: "forms.fields.subtitle.label",
|
|
|
|
|
- }),
|
|
|
|
|
- dataIndex: "subtitle",
|
|
|
|
|
- key: "subtitle",
|
|
|
|
|
- tip: "过长会自动收缩",
|
|
|
|
|
- ellipsis: true,
|
|
|
|
|
- },
|
|
|
|
|
{
|
|
{
|
|
|
//主讲人
|
|
//主讲人
|
|
|
title: intl.formatMessage({
|
|
title: intl.formatMessage({
|
|
@@ -167,6 +163,12 @@ const Widget = () => {
|
|
|
//tip: "过长会自动收缩",
|
|
//tip: "过长会自动收缩",
|
|
|
ellipsis: true,
|
|
ellipsis: true,
|
|
|
},
|
|
},
|
|
|
|
|
+ {
|
|
|
|
|
+ title: "成员",
|
|
|
|
|
+ dataIndex: "member_count",
|
|
|
|
|
+ key: "member_count",
|
|
|
|
|
+ width: 80,
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
//类型
|
|
//类型
|
|
|
title: intl.formatMessage({
|
|
title: intl.formatMessage({
|
|
@@ -265,6 +267,7 @@ const Widget = () => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const res = await get<ICourseListResponse>(url);
|
|
const res = await get<ICourseListResponse>(url);
|
|
|
|
|
+ console.log("api data", res);
|
|
|
const items: DataItem[] = res.data.rows.map((item, id) => {
|
|
const items: DataItem[] = res.data.rows.map((item, id) => {
|
|
|
const date = new Date(item.created_at);
|
|
const date = new Date(item.created_at);
|
|
|
return {
|
|
return {
|
|
@@ -272,13 +275,14 @@ const Widget = () => {
|
|
|
id: item.id,
|
|
id: item.id,
|
|
|
title: item.title,
|
|
title: item.title,
|
|
|
subtitle: item.subtitle,
|
|
subtitle: item.subtitle,
|
|
|
- teacher: item.teacher.nickName,
|
|
|
|
|
|
|
+ teacher: item.teacher?.nickName,
|
|
|
cover_img_name: item.cover,
|
|
cover_img_name: item.cover,
|
|
|
- type: item.type,
|
|
|
|
|
|
|
+ type: item.publicity,
|
|
|
|
|
+ member_count: item.member_count,
|
|
|
createdAt: date.getTime(),
|
|
createdAt: date.getTime(),
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
|
|
+ console.log(items);
|
|
|
return {
|
|
return {
|
|
|
total: res.data.count,
|
|
total: res.data.count,
|
|
|
succcess: true,
|
|
succcess: true,
|