From d9850260e9167b90b499aced0323849c72c62981 Mon Sep 17 00:00:00 2001 From: unknown <18119604035@163.com> Date: Mon, 13 Nov 2023 14:20:49 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E8=A7=86=E9=A2=91=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=90=8D=E7=A7=B0=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/member/compenents/progress.tsx | 14 ++------ src/pages/resource/videos/index.tsx | 44 ++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 15 deletions(-) diff --git a/src/pages/member/compenents/progress.tsx b/src/pages/member/compenents/progress.tsx index fba71d8..8fa6e83 100644 --- a/src/pages/member/compenents/progress.tsx +++ b/src/pages/member/compenents/progress.tsx @@ -59,7 +59,6 @@ export const MemberLearnProgressDialog: React.FC = ({ { title: "课时标题", dataIndex: "title", - render: (title: string) => ( <> {title} @@ -68,7 +67,6 @@ export const MemberLearnProgressDialog: React.FC = ({ }, { title: "总时长", - width: 120, dataIndex: "duration", render: (duration: number) => ( <> @@ -78,7 +76,6 @@ export const MemberLearnProgressDialog: React.FC = ({ }, { title: "已学习时长", - width: 120, dataIndex: "finished_duration", render: (_, record: any) => ( <> @@ -96,7 +93,6 @@ export const MemberLearnProgressDialog: React.FC = ({ }, { title: "是否学完", - width: 100, dataIndex: "is_finished", render: (_, record: any) => ( <> @@ -112,7 +108,6 @@ export const MemberLearnProgressDialog: React.FC = ({ }, { title: "开始时间", - width: 150, dataIndex: "created_at", render: (_, record: any) => ( <> @@ -126,7 +121,6 @@ export const MemberLearnProgressDialog: React.FC = ({ }, { title: "学完时间", - width: 150, dataIndex: "finished_at", render: (_, record: any) => ( <> @@ -142,7 +136,6 @@ export const MemberLearnProgressDialog: React.FC = ({ title: "操作", key: "action", fixed: "right", - width: 70, render: (_, record: any) => ( <> {records && records[record.id] ? ( @@ -222,7 +215,7 @@ export const MemberLearnProgressDialog: React.FC = ({ maskClosable={false} footer={null} > -
+
= ({ disabled={null} />
-
+
{ const [multiConfig, setMultiConfig] = useState(false); const [updateId, setUpdateId] = useState(0); const [playUrl, setPlayUrl] = useState(""); + const [title, setTitle] = useState(""); useEffect(() => { setCateId(Number(result.get("cid"))); @@ -231,7 +241,7 @@ const ResourceVideosPage = () => { setLoading(true); let categoryIds = category_ids.join(","); resource - .resourceList(page, size, "", "", "", "VIDEO", categoryIds) + .resourceList(page, size, "", "", title, "VIDEO", categoryIds) .then((res: any) => { setTotal(res.data.result.total); setVideoList(res.data.result.data); @@ -250,6 +260,7 @@ const ResourceVideosPage = () => { setSize(10); setVideoList([]); setSelectedRowKeys([]); + setTitle(""); setRefresh(!refresh); }; @@ -328,7 +339,34 @@ const ResourceVideosPage = () => { 删除 -
+
+
+ 名称: + { + setTitle(e.target.value); + }} + allowClear + style={{ width: 160 }} + placeholder="请输入名称关键字" + /> +
+
+ + +
+
{multiConfig ? ( From 3d6ea85e413d7f5cf0d9308211ed5fbe77e5e2eb Mon Sep 17 00:00:00 2001 From: unknown <18119604035@163.com> Date: Mon, 13 Nov 2023 14:23:25 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=AD=A6=E5=91=98=EF=BC=9B=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=AD=98=E5=82=A8=E9=A1=B5=E7=A0=81=E5=88=B0url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/member/index.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pages/member/index.tsx b/src/pages/member/index.tsx index f9b393d..faf2510 100644 --- a/src/pages/member/index.tsx +++ b/src/pages/member/index.tsx @@ -89,13 +89,13 @@ const MemberPage = () => { ); useEffect(() => { - setDid(Number(result.get("did"))); - if (Number(result.get("did"))) { - let arr = []; - arr.push(Number(result.get("did"))); - setDepIds(arr); + if (result.get("refresh")) { + resetLocalSearchParams({ + page: 1, + }); + setRefresh(!refresh); } - }, [result.get("did")]); + }, [result.get("refresh")]); const columns: ColumnsType = [ { From 2b8e8777c7b7708d088f04a083af7627712544d8 Mon Sep 17 00:00:00 2001 From: unknown <18119604035@163.com> Date: Mon, 13 Nov 2023 14:38:11 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E6=9D=83=E9=99=90=E4=BC=98=E5=8C=96=E7=BB=84=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/adminroles/compenents/create.tsx | 132 ++++++------------ .../system/adminroles/compenents/update.tsx | 132 ++++++------------ 2 files changed, 84 insertions(+), 180 deletions(-) diff --git a/src/pages/system/adminroles/compenents/create.tsx b/src/pages/system/adminroles/compenents/create.tsx index 32e8dbf..edc90b5 100644 --- a/src/pages/system/adminroles/compenents/create.tsx +++ b/src/pages/system/adminroles/compenents/create.tsx @@ -39,101 +39,53 @@ export const SystemAdminrolesCreate: React.FC = ({ const getParams = () => { adminRole.createAdminRole().then((res: any) => { - const arr: Option[] = [ - { - 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: [], - }, - ]; + const arr: any = []; + const arr2: any = []; let actions = res.data.perm_action.action; let permissions = res.data.perm_action.data; for (let i = 0; i < permissions.length; i++) { - arr.map((item: any) => { - if (item.title === permissions[i].group_name) { - item.children.push({ - title: permissions[i].name, - value: permissions[i].id, - }); - } - }); + const key = arr.findIndex( + (it: any) => it.title === permissions[i].group_name + ); + if (key >= 0) { + arr[key].children.push({ + title: permissions[i].name, + 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++) { - arr2.map((item: any) => { - if (item.title === actions[j].group_name) { - item.children.push({ - title: actions[j].name, - value: actions[j].id, - }); - } - }); + const key = arr2.findIndex( + (it: any) => it.title === actions[j].group_name + ); + if (key >= 0) { + arr2[key].children.push({ + title: actions[j].name, + 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); setActions(arr2); diff --git a/src/pages/system/adminroles/compenents/update.tsx b/src/pages/system/adminroles/compenents/update.tsx index 18846a8..89dbd2e 100644 --- a/src/pages/system/adminroles/compenents/update.tsx +++ b/src/pages/system/adminroles/compenents/update.tsx @@ -53,101 +53,53 @@ export const SystemAdminrolesUpdate: React.FC = ({ const getParams = () => { adminRole.createAdminRole().then((res: any) => { - const arr: Option[] = [ - { - 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: [], - }, - ]; + const arr: any = []; + const arr2: any = []; let actions = res.data.perm_action.action; let permissions = res.data.perm_action.data; for (let i = 0; i < permissions.length; i++) { - arr.map((item: any) => { - if (item.title === permissions[i].group_name) { - item.children.push({ - title: permissions[i].name, - value: permissions[i].id, - }); - } - }); + const key = arr.findIndex( + (it: any) => it.title === permissions[i].group_name + ); + if (key >= 0) { + arr[key].children.push({ + title: permissions[i].name, + 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++) { - arr2.map((item: any) => { - if (item.title === actions[j].group_name) { - item.children.push({ - title: actions[j].name, - value: actions[j].id, - }); - } - }); + const key = arr2.findIndex( + (it: any) => it.title === actions[j].group_name + ); + if (key >= 0) { + arr2[key].children.push({ + title: actions[j].name, + 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); setActions(arr2); From e479ec78485adba74cb347bea7303388aeef5e9f Mon Sep 17 00:00:00 2001 From: xxx Date: Mon, 13 Nov 2023 14:39:52 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/member/compenents/progress.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pages/member/compenents/progress.tsx b/src/pages/member/compenents/progress.tsx index 8fa6e83..2d36332 100644 --- a/src/pages/member/compenents/progress.tsx +++ b/src/pages/member/compenents/progress.tsx @@ -215,7 +215,7 @@ export const MemberLearnProgressDialog: React.FC = ({ maskClosable={false} footer={null} > -
+
= ({ disabled={null} />
-
+
Date: Mon, 13 Nov 2023 14:50:20 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E5=AD=A6=E4=B9=A0=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E5=AE=BD=E5=BA=A6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/member/compenents/progress.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/pages/member/compenents/progress.tsx b/src/pages/member/compenents/progress.tsx index 2d36332..8fa6e83 100644 --- a/src/pages/member/compenents/progress.tsx +++ b/src/pages/member/compenents/progress.tsx @@ -215,7 +215,7 @@ export const MemberLearnProgressDialog: React.FC = ({ maskClosable={false} footer={null} > -
+
= ({ disabled={null} />
-
+
Date: Mon, 13 Nov 2023 15:26:11 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E9=83=A8=E9=97=A8=E5=90=8C=E6=AD=A5ldap?= =?UTF-8?q?=E5=90=8E=E4=B8=8D=E6=98=BE=E7=A4=BA=E6=96=B0=E5=BB=BA=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/department/index.tsx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/pages/department/index.tsx b/src/pages/department/index.tsx index 43b8427..d8b4ada 100644 --- a/src/pages/department/index.tsx +++ b/src/pages/department/index.tsx @@ -413,16 +413,6 @@ const DepartmentPage = () => {
{contextHolder}
- } - p="department-cud" - onClick={() => setCreateVisible(true)} - disabled={null} - /> - {ldapEnabled ? ( { onClick={() => ldapSync()} disabled={null} /> - ) : null} + ) : ( + } + p="department-cud" + onClick={() => setCreateVisible(true)} + disabled={null} + /> + )}
}