课程新建组件haul初步

This commit is contained in:
禺狨
2023-03-15 17:34:11 +08:00
parent 8770095727
commit 18634b9c71
3 changed files with 222 additions and 11 deletions

View File

@@ -18,6 +18,7 @@ import { dateFormat } from "../../utils/index";
import { Link, useNavigate } from "react-router-dom";
import { TreeDepartment, TreeCategory, PerButton } from "../../compenents";
import type { TabsProps } from "antd";
import { CourseCreate } from "./compenents/create";
const { confirm } = Modal;
@@ -46,6 +47,10 @@ export const CoursePage = () => {
const [tabKey, setTabKey] = useState(1);
const [pureTotal, setPureTotal] = useState(0);
const [createVisible, setCreateVisible] = useState<boolean>(false);
const [updateVisible, setUpdateVisible] = useState<boolean>(false);
const [cid, setCid] = useState<number>(0);
const items: TabsProps["items"] = [
{
key: "1",
@@ -234,17 +239,15 @@ export const CoursePage = () => {
<div className="playedu-main-title float-left mb-24">{selLabel}</div>
<div className="float-left j-b-flex mb-24">
<div className="d-flex">
<Link style={{ textDecoration: "none" }} to={`/course/create`}>
<PerButton
type="primary"
text="新建课程"
class="mr-16"
icon={<PlusOutlined />}
p="course"
onClick={() => null}
disabled={null}
/>
</Link>
<PerButton
type="primary"
text="新建课程"
class="mr-16"
icon={<PlusOutlined />}
p="course"
onClick={() => setCreateVisible(true)}
disabled={null}
/>
</div>
<div className="d-flex">
<div className="d-flex mr-24">
@@ -282,6 +285,13 @@ export const CoursePage = () => {
pagination={paginationProps}
rowKey={(record) => record.id}
/>
<CourseCreate
open={createVisible}
onCancel={() => {
setCreateVisible(false);
setRefresh(!refresh);
}}
/>
</div>
</div>
</div>