From fc9682c31dbc13caffcb85d20a02fbf9e82c842c Mon Sep 17 00:00:00 2001 From: unknown <18119604035@163.com> Date: Wed, 6 Sep 2023 09:42:06 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=BF=E4=B8=8A=E8=AF=BE=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=B8=8A=E6=9E=B6=E6=97=B6=E9=97=B4=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/course/compenents/create.tsx | 2 +- src/pages/course/compenents/update.tsx | 23 ++++++++++++----------- src/pages/course/index.tsx | 4 ++-- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/pages/course/compenents/create.tsx b/src/pages/course/compenents/create.tsx index 07ce256..c0d1dce 100644 --- a/src/pages/course/compenents/create.tsx +++ b/src/pages/course/compenents/create.tsx @@ -695,7 +695,7 @@ export const CourseCreate: React.FC = ({ form.setFieldsValue({ thumb: url }); }} > - + (推荐尺寸:400x300px) diff --git a/src/pages/course/compenents/update.tsx b/src/pages/course/compenents/update.tsx index 33cc846..485d47c 100644 --- a/src/pages/course/compenents/update.tsx +++ b/src/pages/course/compenents/update.tsx @@ -96,8 +96,8 @@ export const CourseUpdate: React.FC = ({ type: type, short_desc: res.data.course.short_desc, hasChapter: chapterType, - published_at: res.data.published_at - ? dayjs(res.data.published_at, "YYYY-MM-DD HH:mm:ss") + published_at: res.data.course.published_at + ? dayjs(res.data.course.published_at, "YYYY-MM-DD HH:mm:ss") : "", }); setType(type); @@ -188,6 +188,10 @@ export const CourseUpdate: React.FC = ({ setType(e.target.value); }; + const disabledDate = (current: any) => { + return current && current >= moment().add(0, "days"); // 选择时间要大于等于当前天。若今天不能被选择,去掉等号即可。 + }; + return ( <> {open ? ( @@ -388,7 +392,7 @@ export const CourseUpdate: React.FC = ({ form.setFieldsValue({ thumb: url }); }} > - + (推荐尺寸:400x300px) @@ -403,22 +407,19 @@ export const CourseUpdate: React.FC = ({ maxLength={200} /> - + - + - -
- 上架时间越晚,排序越靠前 +
+ (上架时间越晚,排序越靠前)
diff --git a/src/pages/course/index.tsx b/src/pages/course/index.tsx index 3d433da..42e103c 100644 --- a/src/pages/course/index.tsx +++ b/src/pages/course/index.tsx @@ -200,8 +200,8 @@ const CoursePage = () => { ), }, { - title: "创建时间", - dataIndex: "created_at", + title: "上架时间", + dataIndex: "published_at", render: (text: string) => {dateFormat(text)}, }, {