mirror of
https://github.com/PlayEdu/backend
synced 2025-06-23 18:49:20 +08:00
Merge branch 'fix/11131' into dev
This commit is contained in:
commit
5b124ca821
@ -413,16 +413,6 @@ const DepartmentPage = () => {
|
|||||||
<div className="playedu-main-top mb-24">
|
<div className="playedu-main-top mb-24">
|
||||||
{contextHolder}
|
{contextHolder}
|
||||||
<div className="d-flex">
|
<div className="d-flex">
|
||||||
<PerButton
|
|
||||||
type="primary"
|
|
||||||
text="新建部门"
|
|
||||||
class="mr-16"
|
|
||||||
icon={<PlusOutlined />}
|
|
||||||
p="department-cud"
|
|
||||||
onClick={() => setCreateVisible(true)}
|
|
||||||
disabled={null}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{ldapEnabled ? (
|
{ldapEnabled ? (
|
||||||
<PerButton
|
<PerButton
|
||||||
type="primary"
|
type="primary"
|
||||||
@ -433,7 +423,17 @@ const DepartmentPage = () => {
|
|||||||
onClick={() => ldapSync()}
|
onClick={() => ldapSync()}
|
||||||
disabled={null}
|
disabled={null}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : (
|
||||||
|
<PerButton
|
||||||
|
type="primary"
|
||||||
|
text="新建部门"
|
||||||
|
class="mr-16"
|
||||||
|
icon={<PlusOutlined />}
|
||||||
|
p="department-cud"
|
||||||
|
onClick={() => setCreateVisible(true)}
|
||||||
|
disabled={null}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,6 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
|
|||||||
{
|
{
|
||||||
title: "课时标题",
|
title: "课时标题",
|
||||||
dataIndex: "title",
|
dataIndex: "title",
|
||||||
|
|
||||||
render: (title: string) => (
|
render: (title: string) => (
|
||||||
<>
|
<>
|
||||||
<span>{title}</span>
|
<span>{title}</span>
|
||||||
@ -68,7 +67,6 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "总时长",
|
title: "总时长",
|
||||||
width: 120,
|
|
||||||
dataIndex: "duration",
|
dataIndex: "duration",
|
||||||
render: (duration: number) => (
|
render: (duration: number) => (
|
||||||
<>
|
<>
|
||||||
@ -78,7 +76,6 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "已学习时长",
|
title: "已学习时长",
|
||||||
width: 120,
|
|
||||||
dataIndex: "finished_duration",
|
dataIndex: "finished_duration",
|
||||||
render: (_, record: any) => (
|
render: (_, record: any) => (
|
||||||
<>
|
<>
|
||||||
@ -96,7 +93,6 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "是否学完",
|
title: "是否学完",
|
||||||
width: 100,
|
|
||||||
dataIndex: "is_finished",
|
dataIndex: "is_finished",
|
||||||
render: (_, record: any) => (
|
render: (_, record: any) => (
|
||||||
<>
|
<>
|
||||||
@ -112,7 +108,6 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "开始时间",
|
title: "开始时间",
|
||||||
width: 150,
|
|
||||||
dataIndex: "created_at",
|
dataIndex: "created_at",
|
||||||
render: (_, record: any) => (
|
render: (_, record: any) => (
|
||||||
<>
|
<>
|
||||||
@ -126,7 +121,6 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "学完时间",
|
title: "学完时间",
|
||||||
width: 150,
|
|
||||||
dataIndex: "finished_at",
|
dataIndex: "finished_at",
|
||||||
render: (_, record: any) => (
|
render: (_, record: any) => (
|
||||||
<>
|
<>
|
||||||
@ -142,7 +136,6 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
|
|||||||
title: "操作",
|
title: "操作",
|
||||||
key: "action",
|
key: "action",
|
||||||
fixed: "right",
|
fixed: "right",
|
||||||
width: 70,
|
|
||||||
render: (_, record: any) => (
|
render: (_, record: any) => (
|
||||||
<>
|
<>
|
||||||
{records && records[record.id] ? (
|
{records && records[record.id] ? (
|
||||||
@ -222,7 +215,7 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
|
|||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
footer={null}
|
footer={null}
|
||||||
>
|
>
|
||||||
<div className="w-100 d-flex mt-24">
|
<div className="mt-24">
|
||||||
<PerButton
|
<PerButton
|
||||||
type="primary"
|
type="primary"
|
||||||
text="重置学习记录"
|
text="重置学习记录"
|
||||||
@ -235,10 +228,7 @@ export const MemberLearnProgressDialog: React.FC<PropInterface> = ({
|
|||||||
disabled={null}
|
disabled={null}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div className="mt-24" style={{ maxHeight: 800, overflowY: "auto" }}>
|
||||||
className="w-100 d-flex mt-24"
|
|
||||||
style={{ maxHeight: 800, overflowY: "auto" }}
|
|
||||||
>
|
|
||||||
<Table
|
<Table
|
||||||
columns={column}
|
columns={column}
|
||||||
dataSource={list}
|
dataSource={list}
|
||||||
|
@ -89,13 +89,13 @@ const MemberPage = () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setDid(Number(result.get("did")));
|
if (result.get("refresh")) {
|
||||||
if (Number(result.get("did"))) {
|
resetLocalSearchParams({
|
||||||
let arr = [];
|
page: 1,
|
||||||
arr.push(Number(result.get("did")));
|
});
|
||||||
setDepIds(arr);
|
setRefresh(!refresh);
|
||||||
}
|
}
|
||||||
}, [result.get("did")]);
|
}, [result.get("refresh")]);
|
||||||
|
|
||||||
const columns: ColumnsType<DataType> = [
|
const columns: ColumnsType<DataType> = [
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { Modal, Table, message, Space, Dropdown, Button } from "antd";
|
import {
|
||||||
|
Modal,
|
||||||
|
Table,
|
||||||
|
message,
|
||||||
|
Space,
|
||||||
|
Dropdown,
|
||||||
|
Typography,
|
||||||
|
Input,
|
||||||
|
Button,
|
||||||
|
} from "antd";
|
||||||
import type { MenuProps } from "antd";
|
import type { MenuProps } from "antd";
|
||||||
import { resource } from "../../../api";
|
import { resource } from "../../../api";
|
||||||
import { useLocation } from "react-router-dom";
|
import { useLocation } from "react-router-dom";
|
||||||
@ -63,6 +72,7 @@ const ResourceVideosPage = () => {
|
|||||||
const [multiConfig, setMultiConfig] = useState(false);
|
const [multiConfig, setMultiConfig] = useState(false);
|
||||||
const [updateId, setUpdateId] = useState(0);
|
const [updateId, setUpdateId] = useState(0);
|
||||||
const [playUrl, setPlayUrl] = useState("");
|
const [playUrl, setPlayUrl] = useState("");
|
||||||
|
const [title, setTitle] = useState("");
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setCateId(Number(result.get("cid")));
|
setCateId(Number(result.get("cid")));
|
||||||
@ -231,7 +241,7 @@ const ResourceVideosPage = () => {
|
|||||||
setLoading(true);
|
setLoading(true);
|
||||||
let categoryIds = category_ids.join(",");
|
let categoryIds = category_ids.join(",");
|
||||||
resource
|
resource
|
||||||
.resourceList(page, size, "", "", "", "VIDEO", categoryIds)
|
.resourceList(page, size, "", "", title, "VIDEO", categoryIds)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
setTotal(res.data.result.total);
|
setTotal(res.data.result.total);
|
||||||
setVideoList(res.data.result.data);
|
setVideoList(res.data.result.data);
|
||||||
@ -250,6 +260,7 @@ const ResourceVideosPage = () => {
|
|||||||
setSize(10);
|
setSize(10);
|
||||||
setVideoList([]);
|
setVideoList([]);
|
||||||
setSelectedRowKeys([]);
|
setSelectedRowKeys([]);
|
||||||
|
setTitle("");
|
||||||
setRefresh(!refresh);
|
setRefresh(!refresh);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -328,7 +339,34 @@ const ResourceVideosPage = () => {
|
|||||||
删除
|
删除
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<div className="d-flex"></div>
|
<div className="d-flex">
|
||||||
|
<div className="d-flex mr-24">
|
||||||
|
<Typography.Text>名称:</Typography.Text>
|
||||||
|
<Input
|
||||||
|
value={title}
|
||||||
|
onChange={(e) => {
|
||||||
|
setTitle(e.target.value);
|
||||||
|
}}
|
||||||
|
allowClear
|
||||||
|
style={{ width: 160 }}
|
||||||
|
placeholder="请输入名称关键字"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="d-flex">
|
||||||
|
<Button className="mr-16" onClick={resetVideoList}>
|
||||||
|
重 置
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
onClick={() => {
|
||||||
|
setPage(1);
|
||||||
|
setRefresh(!refresh);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
查 询
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="float-left">
|
<div className="float-left">
|
||||||
{multiConfig ? (
|
{multiConfig ? (
|
||||||
|
@ -39,102 +39,54 @@ export const SystemAdminrolesCreate: React.FC<PropInterface> = ({
|
|||||||
|
|
||||||
const getParams = () => {
|
const getParams = () => {
|
||||||
adminRole.createAdminRole().then((res: any) => {
|
adminRole.createAdminRole().then((res: any) => {
|
||||||
const arr: Option[] = [
|
const arr: any = [];
|
||||||
{
|
const arr2: any = [];
|
||||||
title: "学员",
|
|
||||||
value: "学员-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "管理员",
|
|
||||||
value: "管理员-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
const arr2: Option[] = [
|
|
||||||
{
|
|
||||||
title: "学员",
|
|
||||||
value: "学员-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "管理员",
|
|
||||||
value: "管理员-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "管理员日志",
|
|
||||||
value: "管理员日志-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "管理员角色",
|
|
||||||
value: "管理员角色-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "线上课",
|
|
||||||
value: "线上课-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "分类管理",
|
|
||||||
value: "分类管理-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "资源管理",
|
|
||||||
value: "资源管理-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "资源分类",
|
|
||||||
value: "资源分类-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "部门",
|
|
||||||
value: "部门-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "系统配置",
|
|
||||||
value: "系统配置-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "其它",
|
|
||||||
value: "其它-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "其它权限",
|
|
||||||
value: "其它权限-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
let actions = res.data.perm_action.action;
|
let actions = res.data.perm_action.action;
|
||||||
let permissions = res.data.perm_action.data;
|
let permissions = res.data.perm_action.data;
|
||||||
for (let i = 0; i < permissions.length; i++) {
|
for (let i = 0; i < permissions.length; i++) {
|
||||||
arr.map((item: any) => {
|
const key = arr.findIndex(
|
||||||
if (item.title === permissions[i].group_name) {
|
(it: any) => it.title === permissions[i].group_name
|
||||||
item.children.push({
|
);
|
||||||
|
if (key >= 0) {
|
||||||
|
arr[key].children.push({
|
||||||
title: permissions[i].name,
|
title: permissions[i].name,
|
||||||
value: permissions[i].id,
|
value: permissions[i].id,
|
||||||
});
|
});
|
||||||
}
|
} else {
|
||||||
|
arr.push({
|
||||||
|
title: permissions[i].group_name,
|
||||||
|
value: permissions[i].group_name + "-n",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
title: permissions[i].name,
|
||||||
|
value: permissions[i].id,
|
||||||
|
},
|
||||||
|
],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for (let j = 0; j < actions.length; j++) {
|
for (let j = 0; j < actions.length; j++) {
|
||||||
arr2.map((item: any) => {
|
const key = arr2.findIndex(
|
||||||
if (item.title === actions[j].group_name) {
|
(it: any) => it.title === actions[j].group_name
|
||||||
item.children.push({
|
);
|
||||||
|
if (key >= 0) {
|
||||||
|
arr2[key].children.push({
|
||||||
title: actions[j].name,
|
title: actions[j].name,
|
||||||
value: actions[j].id,
|
value: actions[j].id,
|
||||||
});
|
});
|
||||||
}
|
} else {
|
||||||
|
arr2.push({
|
||||||
|
title: actions[j].group_name,
|
||||||
|
value: actions[j].group_name + "-n",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
title: actions[j].name,
|
||||||
|
value: actions[j].id,
|
||||||
|
},
|
||||||
|
],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
setPermissions(arr);
|
setPermissions(arr);
|
||||||
setActions(arr2);
|
setActions(arr2);
|
||||||
});
|
});
|
||||||
|
@ -53,102 +53,54 @@ export const SystemAdminrolesUpdate: React.FC<PropInterface> = ({
|
|||||||
|
|
||||||
const getParams = () => {
|
const getParams = () => {
|
||||||
adminRole.createAdminRole().then((res: any) => {
|
adminRole.createAdminRole().then((res: any) => {
|
||||||
const arr: Option[] = [
|
const arr: any = [];
|
||||||
{
|
const arr2: any = [];
|
||||||
title: "学员",
|
|
||||||
value: "学员-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "管理员",
|
|
||||||
value: "管理员-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
const arr2: Option[] = [
|
|
||||||
{
|
|
||||||
title: "学员",
|
|
||||||
value: "学员-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "管理员",
|
|
||||||
value: "管理员-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "管理员日志",
|
|
||||||
value: "管理员日志-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "管理员角色",
|
|
||||||
value: "管理员角色-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "线上课",
|
|
||||||
value: "线上课-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "分类管理",
|
|
||||||
value: "分类管理-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "资源管理",
|
|
||||||
value: "资源管理-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "资源分类",
|
|
||||||
value: "资源分类-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "部门",
|
|
||||||
value: "部门-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "系统配置",
|
|
||||||
value: "系统配置-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "其它",
|
|
||||||
value: "其它-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "其它权限",
|
|
||||||
value: "其它权限-n",
|
|
||||||
children: [],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
let actions = res.data.perm_action.action;
|
let actions = res.data.perm_action.action;
|
||||||
let permissions = res.data.perm_action.data;
|
let permissions = res.data.perm_action.data;
|
||||||
for (let i = 0; i < permissions.length; i++) {
|
for (let i = 0; i < permissions.length; i++) {
|
||||||
arr.map((item: any) => {
|
const key = arr.findIndex(
|
||||||
if (item.title === permissions[i].group_name) {
|
(it: any) => it.title === permissions[i].group_name
|
||||||
item.children.push({
|
);
|
||||||
|
if (key >= 0) {
|
||||||
|
arr[key].children.push({
|
||||||
title: permissions[i].name,
|
title: permissions[i].name,
|
||||||
value: permissions[i].id,
|
value: permissions[i].id,
|
||||||
});
|
});
|
||||||
}
|
} else {
|
||||||
|
arr.push({
|
||||||
|
title: permissions[i].group_name,
|
||||||
|
value: permissions[i].group_name + "-n",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
title: permissions[i].name,
|
||||||
|
value: permissions[i].id,
|
||||||
|
},
|
||||||
|
],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for (let j = 0; j < actions.length; j++) {
|
for (let j = 0; j < actions.length; j++) {
|
||||||
arr2.map((item: any) => {
|
const key = arr2.findIndex(
|
||||||
if (item.title === actions[j].group_name) {
|
(it: any) => it.title === actions[j].group_name
|
||||||
item.children.push({
|
);
|
||||||
|
if (key >= 0) {
|
||||||
|
arr2[key].children.push({
|
||||||
title: actions[j].name,
|
title: actions[j].name,
|
||||||
value: actions[j].id,
|
value: actions[j].id,
|
||||||
});
|
});
|
||||||
}
|
} else {
|
||||||
|
arr2.push({
|
||||||
|
title: actions[j].group_name,
|
||||||
|
value: actions[j].group_name + "-n",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
title: actions[j].name,
|
||||||
|
value: actions[j].id,
|
||||||
|
},
|
||||||
|
],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
setPermissions(arr);
|
setPermissions(arr);
|
||||||
setActions(arr2);
|
setActions(arr2);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user