Commit e09e893d authored by krysent's avatar krysent

5.6

parent d146a050
...@@ -8,7 +8,7 @@ import editorIsNull from "@/utils/editorIsNull"; ...@@ -8,7 +8,7 @@ import editorIsNull from "@/utils/editorIsNull";
import { Box, Container, Grid, Link, Stack, Typography } from "@mui/material"; import { Box, Container, Grid, Link, Stack, Typography } from "@mui/material";
import { useParams } from "@umijs/max"; import { useParams } from "@umijs/max";
import { useRequest } from "ahooks"; import { useRequest } from "ahooks";
import { message, Tabs } from "antd"; import { message, Tabs ,Badge} from "antd";
import { useEffect, useMemo, useRef, useState } from "react"; import { useEffect, useMemo, useRef, useState } from "react";
import { history } from "umi"; import { history } from "umi";
import "./index.less"; import "./index.less";
...@@ -65,11 +65,7 @@ function Dolessons() { ...@@ -65,11 +65,7 @@ function Dolessons() {
} }
}; };
useEffect(() => {
if (courseContent?.id) {
alert(0)
}
}, [courseContent?.id]);
const edit = (text, row, _, action) => { const edit = (text, row, _, action) => {
return ( return (
...@@ -144,7 +140,7 @@ function Dolessons() { ...@@ -144,7 +140,7 @@ function Dolessons() {
title: "问题内容", title: "问题内容",
dataIndex: "question", dataIndex: "question",
key: "question", key: "question",
width:400, width: 400,
formItemProps: { rules: [{ required: true, message: "此项为必填项" }] }, formItemProps: { rules: [{ required: true, message: "此项为必填项" }] },
}, },
{ {
...@@ -260,7 +256,6 @@ function Dolessons() { ...@@ -260,7 +256,6 @@ function Dolessons() {
}, },
}, },
]} ]}
onFinish={(val) => { onFinish={(val) => {
const data = { ...val }; const data = { ...val };
if (editorIsNull(data?.trainContent)) { if (editorIsNull(data?.trainContent)) {
...@@ -286,7 +281,11 @@ function Dolessons() { ...@@ -286,7 +281,11 @@ function Dolessons() {
}, },
{ {
key: "2", key: "2",
label: "查看实验", label: (
<Badge count={lessonDetail?.experimentNum} size="small" offset={[6, 0]}>
查看实验
</Badge>
),
children: ( children: (
<Box boxShadow={"0 0 18px #f0f0f0"} borderRadius={2}> <Box boxShadow={"0 0 18px #f0f0f0"} borderRadius={2}>
<AutoTable <AutoTable
......
...@@ -64,7 +64,6 @@ function Lessons() { ...@@ -64,7 +64,6 @@ function Lessons() {
params: { courseId: row?.id }, params: { courseId: row?.id },
}).then((res) => { }).then((res) => {
if (res.code === "0000") { if (res.code === "0000") {
console.log(res?.data?.dataList);
setdialogprops({ setdialogprops({
open: true, open: true,
maxWidth: "xl", maxWidth: "xl",
...@@ -126,7 +125,7 @@ function Lessons() { ...@@ -126,7 +125,7 @@ function Lessons() {
dialogprops={dialogprops} dialogprops={dialogprops}
maxWidth={dialogprops?.maxWidth ?? "xs"} maxWidth={dialogprops?.maxWidth ?? "xs"}
> >
{dialogprops?.title === "编辑" ? ( {dialogprops?.title === "编辑" || dialogprops?.title === "新增课程" ? (
<InitForm <InitForm
fields={columns} fields={columns}
defaultFormValue={dialogprops?.defaultFormValue} defaultFormValue={dialogprops?.defaultFormValue}
...@@ -195,7 +194,6 @@ function Lessons() { ...@@ -195,7 +194,6 @@ function Lessons() {
}, },
]} ]}
onFinish={(val) => { onFinish={(val) => {
console.log(val);
const teacherIdList = val?.teacherIdList?.map((it) => it?.id); const teacherIdList = val?.teacherIdList?.map((it) => it?.id);
runAsync({ runAsync({
url: "/sysCourseTeacher/relationCourseTeacher", url: "/sysCourseTeacher/relationCourseTeacher",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment