线上课课时编辑优化

This commit is contained in:
禺狨 2023-03-22 10:57:46 +08:00
parent b4cb9a0843
commit 3ef7644135
3 changed files with 72 additions and 42 deletions

View File

@ -81,6 +81,10 @@ code {
margin-left: 15px;
}
.ml-42 {
margin-left: 42px;
}
.ml-120 {
margin-left: 120px;
}

View File

@ -1,13 +1,13 @@
.top-content {
width: 502px;
height: 80px;
height: auto;
background: rgba(255, 77, 79, 0.1);
border-radius: 6px;
display: flex;
flex-direction: column;
justify-content: center;
box-sizing: border-box;
padding: 16px;
padding: 8px 16px;
margin: 0 auto;
p {
font-size: 14px;

View File

@ -158,6 +158,14 @@ export const CourseHourUpdate: React.FC<PropInterface> = ({
const delHour = (hid: number) => {
const data = [...treeData];
confirm({
title: "操作确认",
icon: <ExclamationCircleFilled />,
content: "确认删除此课时?",
centered: true,
okText: "确认",
cancelText: "取消",
onOk() {
const index = data.findIndex((i: any) => i.rid === hid);
let delId = data[index].id;
if (index >= 0) {
@ -176,6 +184,11 @@ export const CourseHourUpdate: React.FC<PropInterface> = ({
console.log("ok");
});
}
},
onCancel() {
console.log("Cancel");
},
});
};
const transHour = (arr: any) => {
@ -270,6 +283,14 @@ export const CourseHourUpdate: React.FC<PropInterface> = ({
const delChapterHour = (index: number, hid: number) => {
const keys = [...chapterHours];
const data = [...chapters];
confirm({
title: "操作确认",
icon: <ExclamationCircleFilled />,
content: "确认删除此课时?",
centered: true,
okText: "确认",
cancelText: "取消",
onOk() {
const current = data[index].hours.findIndex((i: any) => i.rid === hid);
let delId = data[index].hours.map((item: any) => item.id);
if (current >= 0) {
@ -291,6 +312,11 @@ export const CourseHourUpdate: React.FC<PropInterface> = ({
console.log("ok");
});
}
},
onCancel() {
console.log("Cancel");
},
});
};
const transChapterHour = (index: number, arr: any) => {
@ -359,7 +385,7 @@ export const CourseHourUpdate: React.FC<PropInterface> = ({
{chapterType === 0 && (
<div className="c-flex">
<Form.Item>
<div className="ml-120">
<div className="ml-42">
<Button
onClick={() => setVideoVisible(true)}
type="primary"
@ -448,7 +474,7 @@ export const CourseHourUpdate: React.FC<PropInterface> = ({
);
})}
<Form.Item>
<div className="ml-120">
<div className="ml-42">
<Button onClick={() => addNewChapter()}></Button>
</div>
</Form.Item>