|
@@ -22,6 +22,11 @@ import { ISetStatus, setStatus } from "./UserAction";
|
|
|
import { IChannel } from "../channel/Channel";
|
|
import { IChannel } from "../channel/Channel";
|
|
|
import CourseInvite from "./CourseInvite";
|
|
import CourseInvite from "./CourseInvite";
|
|
|
|
|
|
|
|
|
|
+interface IParam {
|
|
|
|
|
+ role?: string;
|
|
|
|
|
+ status?: string[];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
interface IRoleTag {
|
|
interface IRoleTag {
|
|
|
title: string;
|
|
title: string;
|
|
|
color: string;
|
|
color: string;
|
|
@@ -73,7 +78,7 @@ const CourseMemberListWidget = ({ courseId, onSelect }: IWidget) => {
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<>
|
|
<>
|
|
|
- <ProList<ICourseMember>
|
|
|
|
|
|
|
+ <ProList<ICourseMember, IParam>
|
|
|
actionRef={ref}
|
|
actionRef={ref}
|
|
|
search={{
|
|
search={{
|
|
|
filterType: "light",
|
|
filterType: "light",
|
|
@@ -94,6 +99,7 @@ const CourseMemberListWidget = ({ courseId, onSelect }: IWidget) => {
|
|
|
search: false,
|
|
search: false,
|
|
|
},
|
|
},
|
|
|
avatar: {
|
|
avatar: {
|
|
|
|
|
+ search: false,
|
|
|
render(dom, entity, index, action, schema) {
|
|
render(dom, entity, index, action, schema) {
|
|
|
return <User {...entity.user} showName={false} />;
|
|
return <User {...entity.user} showName={false} />;
|
|
|
},
|
|
},
|
|
@@ -150,14 +156,7 @@ const CourseMemberListWidget = ({ courseId, onSelect }: IWidget) => {
|
|
|
"reject",
|
|
"reject",
|
|
|
"block",
|
|
"block",
|
|
|
];
|
|
];
|
|
|
- /*
|
|
|
|
|
|
|
|
|
|
- const undo = {
|
|
|
|
|
- key: "undo",
|
|
|
|
|
- label: "撤销上次操作",
|
|
|
|
|
- disabled: !canUndo,
|
|
|
|
|
- };
|
|
|
|
|
- */
|
|
|
|
|
const items: ItemType[] = actions.map((item) => {
|
|
const items: ItemType[] = actions.map((item) => {
|
|
|
return {
|
|
return {
|
|
|
key: item,
|
|
key: item,
|
|
@@ -224,23 +223,96 @@ const CourseMemberListWidget = ({ courseId, onSelect }: IWidget) => {
|
|
|
];
|
|
];
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
- role: {
|
|
|
|
|
|
|
+ status: {
|
|
|
// 自己扩展的字段,主要用于筛选,不在列表中显示
|
|
// 自己扩展的字段,主要用于筛选,不在列表中显示
|
|
|
- title: "角色",
|
|
|
|
|
- valueType: "select",
|
|
|
|
|
|
|
+ title: "状态",
|
|
|
|
|
+ valueType: "checkbox",
|
|
|
valueEnum: {
|
|
valueEnum: {
|
|
|
- all: {
|
|
|
|
|
|
|
+ joined: {
|
|
|
text: intl.formatMessage({
|
|
text: intl.formatMessage({
|
|
|
- id: "forms.fields.publicity.all.label",
|
|
|
|
|
|
|
+ id: "course.member.status.joined.label",
|
|
|
}),
|
|
}),
|
|
|
status: "Default",
|
|
status: "Default",
|
|
|
},
|
|
},
|
|
|
|
|
+ applied: {
|
|
|
|
|
+ text: intl.formatMessage({
|
|
|
|
|
+ id: "course.member.status.applied.label",
|
|
|
|
|
+ }),
|
|
|
|
|
+ status: "Success",
|
|
|
|
|
+ },
|
|
|
|
|
+ invited: {
|
|
|
|
|
+ text: intl.formatMessage({
|
|
|
|
|
+ id: "course.member.status.invited.label",
|
|
|
|
|
+ }),
|
|
|
|
|
+ status: "Success",
|
|
|
|
|
+ },
|
|
|
|
|
+ canceled: {
|
|
|
|
|
+ text: intl.formatMessage({
|
|
|
|
|
+ id: "course.member.status.canceled.label",
|
|
|
|
|
+ }),
|
|
|
|
|
+ status: "Success",
|
|
|
|
|
+ },
|
|
|
|
|
+ revoked: {
|
|
|
|
|
+ text: intl.formatMessage({
|
|
|
|
|
+ id: "course.member.status.revoked.label",
|
|
|
|
|
+ }),
|
|
|
|
|
+ status: "Success",
|
|
|
|
|
+ },
|
|
|
|
|
+ agreed: {
|
|
|
|
|
+ text: intl.formatMessage({
|
|
|
|
|
+ id: "course.member.status.agreed.label",
|
|
|
|
|
+ }),
|
|
|
|
|
+ status: "Success",
|
|
|
|
|
+ },
|
|
|
|
|
+ accepted: {
|
|
|
|
|
+ text: intl.formatMessage({
|
|
|
|
|
+ id: "course.member.status.accepted.label",
|
|
|
|
|
+ }),
|
|
|
|
|
+ status: "Success",
|
|
|
|
|
+ },
|
|
|
|
|
+ disagreed: {
|
|
|
|
|
+ text: intl.formatMessage({
|
|
|
|
|
+ id: "course.member.status.disagreed.label",
|
|
|
|
|
+ }),
|
|
|
|
|
+ status: "Success",
|
|
|
|
|
+ },
|
|
|
|
|
+ rejected: {
|
|
|
|
|
+ text: intl.formatMessage({
|
|
|
|
|
+ id: "course.member.status.rejected.label",
|
|
|
|
|
+ }),
|
|
|
|
|
+ status: "Success",
|
|
|
|
|
+ },
|
|
|
|
|
+ left: {
|
|
|
|
|
+ text: intl.formatMessage({
|
|
|
|
|
+ id: "course.member.status.left.label",
|
|
|
|
|
+ }),
|
|
|
|
|
+ status: "Success",
|
|
|
|
|
+ },
|
|
|
|
|
+ blocked: {
|
|
|
|
|
+ text: intl.formatMessage({
|
|
|
|
|
+ id: "course.member.status.blocked.label",
|
|
|
|
|
+ }),
|
|
|
|
|
+ status: "Success",
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ role: {
|
|
|
|
|
+ // 自己扩展的字段,主要用于筛选,不在列表中显示
|
|
|
|
|
+ title: "角色",
|
|
|
|
|
+ valueType: "select",
|
|
|
|
|
+ valueEnum: {
|
|
|
student: {
|
|
student: {
|
|
|
text: intl.formatMessage({
|
|
text: intl.formatMessage({
|
|
|
id: "auth.role.student",
|
|
id: "auth.role.student",
|
|
|
}),
|
|
}),
|
|
|
status: "Default",
|
|
status: "Default",
|
|
|
},
|
|
},
|
|
|
|
|
+ manager: {
|
|
|
|
|
+ text: intl.formatMessage({
|
|
|
|
|
+ id: "auth.role.manager",
|
|
|
|
|
+ }),
|
|
|
|
|
+ status: "Success",
|
|
|
|
|
+ },
|
|
|
assistant: {
|
|
assistant: {
|
|
|
text: intl.formatMessage({
|
|
text: intl.formatMessage({
|
|
|
id: "auth.role.assistant",
|
|
id: "auth.role.assistant",
|
|
@@ -264,6 +336,12 @@ const CourseMemberListWidget = ({ courseId, onSelect }: IWidget) => {
|
|
|
) {
|
|
) {
|
|
|
url += "&search=" + params.keyword;
|
|
url += "&search=" + params.keyword;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (params.role) {
|
|
|
|
|
+ url += `&role=${params.role}`;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (params.status) {
|
|
|
|
|
+ url += `&status=${params.status}`;
|
|
|
|
|
+ }
|
|
|
console.info("api request", url);
|
|
console.info("api request", url);
|
|
|
const res = await get<ICourseMemberListResponse>(url);
|
|
const res = await get<ICourseMemberListResponse>(url);
|
|
|
if (res.ok) {
|
|
if (res.ok) {
|