isnotmemeber

dev_hjm_a
hjm 5 years ago
parent 2b1b067fd3
commit 3eb64ca02e

@ -137,7 +137,7 @@ function CourseGroupList(props) {
searchValue={ searchValue } searchValue={ searchValue }
onInputSearchChange={onInputSearchChange} onInputSearchChange={onInputSearchChange}
showSearchInput={total_count >= 10} showSearchInput={total_count >= 10}
searchPlaceholder={ '请输入名称进行搜索' } searchPlaceholder={ '请输入分班名称进行搜索' }
firstRowRight={ firstRowRight={
<React.Fragment> <React.Fragment>
{ // pageType !== TYPE_STUDENTS && { // pageType !== TYPE_STUDENTS &&
@ -177,10 +177,13 @@ function CourseGroupList(props) {
padding-bottom: 8px; padding-bottom: 8px;
} }
.drop_down_menu .drop_down_btn{ .drop_down_menu .drop_down_btn{
border-top:none; border-top:none;
} }
.dividerStyle.ant-divider-horizontal{ .dividerStyle.ant-divider-horizontal{
margin: 0px; margin: 0px;
}
.courseGroupList .ant-table-tbody tr:last-child td {
border-bottom: none;
} }
`}</style> `}</style>
{ isAdmin && { isAdmin &&
@ -207,17 +210,28 @@ function CourseGroupList(props) {
onPressEnter={onPressEnter} onPressEnter={onPressEnter}
></Titlesearchsection> ></Titlesearchsection>
<div className="mt20 edu-back-white padding20 courseGroupList"> <div className="mt20 edu-back-white padding20-30 ">
<Spin size="large" spinning={isSpin}> <span>未分班</span>
{course_groups && !!course_groups.length ? <CourseGroupListTable <span style={{color: '#999999'}}>{none_group_member_count}个学生</span>
<WordsBtn style="blue" className="fr "
onClick={() => {props.history.push(`/courses/${courseId}/course_groups/0`)}}>查看</WordsBtn>
</div>
<Spin size="large" spinning={isSpin}>
{course_groups && !!course_groups.length ?
<div className="mt20 edu-back-white padding20 courseGroupList">
<CourseGroupListTable
course_groups={course_groups} course_groups={course_groups}
onOperationSuccess={onOperationSuccess} onOperationSuccess={onOperationSuccess}
current_group_id={current_group_id} current_group_id={current_group_id}
{...props} {...props}
></CourseGroupListTable> : ></CourseGroupListTable>
<NoneData></NoneData>}
</Spin> </div>:
</div> <NoneData></NoneData>}
</Spin>
</React.Fragment> </React.Fragment>
) )
} }

@ -93,29 +93,33 @@ function CourseGroupListTable(props) {
render: (member_manager, record, index) => { render: (member_manager, record, index) => {
return member_manager return member_manager
} }
}, }];
isAdmin ? { if (!isNotMember) {
title: '邀请码', const aCol = (isAdmin ? {
dataIndex: 'invite_code', title: '邀请码',
key: 'invite_code', dataIndex: 'invite_code',
align:'center', key: 'invite_code',
width:"10%", align:'center',
className:"color-grey-6", width:"10%",
render: (invite_code, record, index) => { className:"color-grey-6",
return invite_code render: (invite_code, record, index) => {
} return invite_code
} : { }
title: '你当前所在分班', } : {
dataIndex: 'group', title: '你当前所在分班',
key: 'group', dataIndex: 'group',
align:'center', key: 'group',
width:"20%", align:'center',
className:"color-grey-6", width:"20%",
render: (invite_code, record, index) => { className:"color-grey-6",
return props.current_group_id == record.id && <Badge status="processing" text="" /> render: (invite_code, record, index) => {
} return props.current_group_id == record.id && <Badge status="processing" text="" />
}, }
{ })
columns.push( aCol );
}
columns.push({
title: '操作', title: '操作',
dataIndex: 'setting', dataIndex: 'setting',
key: 'setting', key: 'setting',
@ -124,15 +128,15 @@ function CourseGroupListTable(props) {
className:"color-grey-6", className:"color-grey-6",
render: (none, record, index) => { render: (none, record, index) => {
return <React.Fragment> return <React.Fragment>
{!isCourseEnd && isAdmin && <WordsBtn style2={{ marginRight: '12px' }} onClick={() => onDelete(record)} style={'grey'}>删除</WordsBtn>} {!isCourseEnd && isAdmin && <WordsBtn style2={{ marginRight: '12px' }} onClick={() => onDelete(record)} style={'grey'}>删除分班</WordsBtn>}
{isAdmin && <WordsBtn style2={{ marginRight: '12px' }} data-clipboard-text={record.invite_code} {isAdmin && <WordsBtn style2={{ marginRight: '12px' }} data-clipboard-text={record.invite_code}
className={`copyBtn_${record.id}`} style={''}>复制邀请码</WordsBtn> } className={`copyBtn_${record.id}`} style={''}>复制邀请码</WordsBtn> }
{isStudent && <WordsBtn style2={{ marginRight: '12px' }} onClick={() => addToDir(record)} style={''}>加入分班</WordsBtn>} {isStudent && <WordsBtn style2={{ marginRight: '12px' }} onClick={() => addToDir(record)} style={''}>加入分班</WordsBtn>}
<WordsBtn style2={{ marginRight: '12px' }} onClick={() => onGoDetail(record)} style={''}>查看</WordsBtn> <WordsBtn style2={{ marginRight: '12px' }} onClick={() => onGoDetail(record)} style={''}>查看</WordsBtn>
</React.Fragment> </React.Fragment>
} }
}, })
]
return columns return columns
} }
const addToDir = async (record) => { const addToDir = async (record) => {
@ -180,6 +184,8 @@ function CourseGroupListTable(props) {
const isAdmin = props.isAdmin(); const isAdmin = props.isAdmin();
const isSuperAdmin = props.isSuperAdmin(); const isSuperAdmin = props.isSuperAdmin();
const isStudent = props.isStudent() const isStudent = props.isStudent()
const isNotMember = props.isNotMember()
const isParent = true; const isParent = true;
const isCourseEnd= props.isCourseEnd(); const isCourseEnd= props.isCourseEnd();

Loading…
Cancel
Save