mirror of
https://github.com/PlayEdu/backend
synced 2025-07-19 08:11:48 +08:00
学员、线上课编辑优化
This commit is contained in:
parent
8fd8b597f5
commit
f34c57dc30
@ -55,6 +55,7 @@ const items = [
|
||||
<SettingOutlined />,
|
||||
[
|
||||
getItem("管理人员", "/system/administrator", null, null, null),
|
||||
getItem("系统配置", "/system/index", null, null, null),
|
||||
getItem("角色配置", "/system/adminroles", null, null, null),
|
||||
],
|
||||
null
|
||||
@ -72,6 +73,7 @@ const children2Parent: any = {
|
||||
|
||||
"/system/administrator": ["6"],
|
||||
"/system/adminroles": ["6"],
|
||||
"/system/index": ["6"],
|
||||
};
|
||||
|
||||
export const LeftMenu: React.FC = () => {
|
||||
|
@ -56,7 +56,9 @@ export const CourseUpdatePage: React.FC = () => {
|
||||
for (let i = 0; i < box.length; i++) {
|
||||
let item = checkChild(deps, box[i]);
|
||||
let arr: any[] = [];
|
||||
if (item.parent_chain === "") {
|
||||
if (item === undefined) {
|
||||
arr.push(box[i]);
|
||||
} else if (item.parent_chain === "") {
|
||||
arr.push(box[i]);
|
||||
} else {
|
||||
let new_arr = item.parent_chain.split(",");
|
||||
@ -76,7 +78,9 @@ export const CourseUpdatePage: React.FC = () => {
|
||||
for (let i = 0; i < box2.length; i++) {
|
||||
let item = checkChild(cats, box2[i]);
|
||||
let arr: any[] = [];
|
||||
if (item.parent_chain === "") {
|
||||
if (item === undefined) {
|
||||
arr.push(box2[i]);
|
||||
} else if (item.parent_chain === "") {
|
||||
arr.push(box2[i]);
|
||||
} else {
|
||||
let new_arr = item.parent_chain.split(",");
|
||||
|
@ -10,6 +10,7 @@ export * from "./member/index";
|
||||
export * from "./member/create";
|
||||
export * from "./member/update";
|
||||
export * from "./member/import";
|
||||
export * from "./system/index";
|
||||
export * from "./system/administrator/index";
|
||||
export * from "./system/administrator/create";
|
||||
export * from "./system/administrator/update";
|
||||
|
@ -44,7 +44,9 @@ export const MemberUpdatePage: React.FC = () => {
|
||||
for (let i = 0; i < box.length; i++) {
|
||||
let item = checkChild(deps, box[i]);
|
||||
let arr: any[] = [];
|
||||
if (item.parent_chain === "") {
|
||||
if (item === undefined) {
|
||||
arr.push(box[i]);
|
||||
} else if (item.parent_chain === "") {
|
||||
arr.push(box[i]);
|
||||
} else {
|
||||
let new_arr = item.parent_chain.split(",");
|
||||
|
45
src/pages/system/index.module.less
Normal file
45
src/pages/system/index.module.less
Normal file
@ -0,0 +1,45 @@
|
||||
.title {
|
||||
width: 100%;
|
||||
height: 16px;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
line-height: 16px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
.body {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
box-sizing: border-box;
|
||||
display: grid;
|
||||
gap: 20px;
|
||||
grid-template-columns: repeat(5, minmax(0, 1fr));
|
||||
.item {
|
||||
width: auto;
|
||||
height: 88px;
|
||||
background: #f3f4f5;
|
||||
box-shadow: 0px 2px 4px 0px rgba(102, 102, 102, 0.05);
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
padding-left: 30px;
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
img {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
span {
|
||||
height: 16px;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
line-height: 16px;
|
||||
}
|
||||
}
|
||||
}
|
92
src/pages/system/index.tsx
Normal file
92
src/pages/system/index.tsx
Normal file
@ -0,0 +1,92 @@
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { Button, Space, Col, Empty } from "antd";
|
||||
import type { ColumnsType } from "antd/es/table";
|
||||
import styles from "./index.module.less";
|
||||
import { PlusOutlined, ReloadOutlined } from "@ant-design/icons";
|
||||
import { appConfig } from "../../api/index";
|
||||
import { dateFormat } from "../../utils/index";
|
||||
import { Link, useNavigate } from "react-router-dom";
|
||||
|
||||
interface DataType {
|
||||
id: React.Key;
|
||||
name: string;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
export const SystemIndexPage: React.FC = () => {
|
||||
const navigate = useNavigate();
|
||||
const [loading, setLoading] = useState<boolean>(true);
|
||||
const [list, setList] = useState<any>([]);
|
||||
const [refresh, setRefresh] = useState(false);
|
||||
|
||||
const columns: ColumnsType<DataType> = [
|
||||
{
|
||||
title: "角色名",
|
||||
dataIndex: "name",
|
||||
render: (text: string) => <span>{text}</span>,
|
||||
},
|
||||
{
|
||||
title: "时间",
|
||||
dataIndex: "created_at",
|
||||
render: (text: string) => <span>{text && dateFormat(text)}</span>,
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
fixed: "right",
|
||||
width: 160,
|
||||
render: (_, record) => (
|
||||
<Space size="small">
|
||||
<Button
|
||||
type="link"
|
||||
danger
|
||||
className="b-link c-red"
|
||||
onClick={() => navigate(`/system/adminroles/update/${record.id}`)}
|
||||
>
|
||||
详情
|
||||
</Button>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
useEffect(() => {
|
||||
getData();
|
||||
}, [refresh]);
|
||||
|
||||
const getData = () => {
|
||||
setLoading(true);
|
||||
appConfig.appConfig().then((res: any) => {
|
||||
setList(res.data);
|
||||
setLoading(false);
|
||||
});
|
||||
};
|
||||
|
||||
const resetData = () => {
|
||||
setList([]);
|
||||
setRefresh(!refresh);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="playedu-main-body">
|
||||
<div className={styles["title"]}>基本配置</div>
|
||||
{list.length === 0 && (
|
||||
<Col span={24}>
|
||||
<Empty description="暂无配置" />
|
||||
</Col>
|
||||
)}
|
||||
<div className={styles["body"]}>
|
||||
{list.map((item: any, index: number) => {
|
||||
return (
|
||||
<div key={index} className={styles["item"]}>
|
||||
<img src={item.images} />
|
||||
<span>{item.name}</span>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
@ -27,6 +27,7 @@ import {
|
||||
ResourceCategoryCreatePage,
|
||||
ResourceCategoryUpdatePage,
|
||||
ResourceVideosPage,
|
||||
SystemIndexPage
|
||||
} from "../pages";
|
||||
|
||||
const routes: RouteObject[] = [
|
||||
@ -91,6 +92,10 @@ const routes: RouteObject[] = [
|
||||
path: "/member/import",
|
||||
element: <MemberImportPage />,
|
||||
},
|
||||
{
|
||||
path: "/system/index",
|
||||
element: <SystemIndexPage />,
|
||||
},
|
||||
{
|
||||
path: "/system/administrator",
|
||||
element: <SystemAdministratorPage />,
|
||||
|
Loading…
x
Reference in New Issue
Block a user