Commit 25bee3c9 authored by baixian's avatar baixian

d

parent b731ad00
...@@ -26,6 +26,8 @@ export default { ...@@ -26,6 +26,8 @@ export default {
}, },
subjectNumList: [], subjectNumList: [],
subjectCount: 0, subjectCount: 0,
memberVisible: false,
memberRecord: {},
}, },
subscriptions: { subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line setup({ dispatch, history }) { // eslint-disable-line
...@@ -71,11 +73,20 @@ export default { ...@@ -71,11 +73,20 @@ export default {
} }
}, },
* handleTickOut({ payload }, { call, put, select }) { * handleTickOut({ payload }, { call, put, select }) {
const { record } = payload; const { record, type } = payload;
const data = yield call(memberListAjax.deleteSubjectStudent, { const data = yield call(memberListAjax.deleteSubjectStudent, {
id: record.id, id: record.id,
type,
}); });
if (data.code == 200) { if (data.code == 200) {
message.success('操作成功', 0.5);
yield put({
type: 'updateState',
payload: {
memberVisible: false,
memberRecord: {},
},
});
yield put({ yield put({
type: 'queryList', type: 'queryList',
payload: { payload: {
...@@ -208,6 +219,8 @@ export default { ...@@ -208,6 +219,8 @@ export default {
}, },
subjectNumList: [], subjectNumList: [],
subjectCount: 0, subjectCount: 0,
memberVisible: false,
memberRecord: {},
}, },
}); });
}, },
......
...@@ -42,19 +42,31 @@ class LiveClass extends React.Component { ...@@ -42,19 +42,31 @@ class LiveClass extends React.Component {
} }
handleTickOut = (record) => { handleTickOut = (record) => {
const { dispatch } = this.props; const { dispatch } = this.props;
Modal.confirm({ dispatch({
title: '提示', type: 'clockmember/updateState',
content: '该学生将从此打卡活动活动中踢出,此次打卡记录也将会清除。', payload: {
okText: '确定', memberVisible: true,
cancelText: '取消', memberRecord: record,
icon: <Icon type="info-circle" theme="filled" style={{ color: '#1890ff', fontSize: 30 }} />, },
onOk() { });
dispatch({ }
type: 'clockmember/handleTickOut', handleCancelMember = () => {
payload: { const { dispatch } = this.props;
record, dispatch({
}, type: 'clockmember/updateState',
}); payload: {
memberVisible: false,
memberRecord: {},
},
});
}
handleClearPerson = (type) => {
const { dispatch, memberRecord } = this.props;
dispatch({
type: 'clockmember/handleTickOut',
payload: {
record: memberRecord,
type,
}, },
}); });
} }
...@@ -114,6 +126,8 @@ class LiveClass extends React.Component { ...@@ -114,6 +126,8 @@ class LiveClass extends React.Component {
clockList, clockList,
subjectNumList, subjectNumList,
subjectCount, subjectCount,
memberRecord,
memberVisible,
} = this.props; } = this.props;
const columns = [ const columns = [
{ {
...@@ -215,6 +229,30 @@ class LiveClass extends React.Component { ...@@ -215,6 +229,30 @@ class LiveClass extends React.Component {
/> />
</div> </div>
</div> </div>
<Modal
visible={memberVisible}
onCancel={this.handleCancelMember}
footer={null}
record={memberRecord}
maskClosable={false}
className={pageStyle.modalMember}
bodyStyle={{ padding: '32px 32px 24px' }}
width={387}
>
<div className={pageStyle.memberWrap}>
<div className={pageStyle.body}>
<div className={pageStyle.infoFlex}>
<Icon style={{ color: '#1890ff', fontSize: 30, marginRight: 16 }} type="info-circle" theme="filled" />
<span className={pageStyle.infoTitle}>提示</span>
</div>
<div className={pageStyle.infoContent}>该学生将从此打卡活动中踢出,是否要清除该学生在 当前打卡的历史记录。</div>
</div>
<div className={pageStyle.infoBtn}>
<Button type="primary" style={{ marginRight: 34 }} onClick={() => this.handleClearPerson(2)}>不清除</Button>
<Button type="danger" onClick={() => this.handleClearPerson(1)}>清除</Button>
</div>
</div>
</Modal>
</div> </div>
); );
} }
...@@ -231,6 +269,8 @@ function mapStateToProps(state) { ...@@ -231,6 +269,8 @@ function mapStateToProps(state) {
clockList, clockList,
subjectNumList, subjectNumList,
subjectCount, subjectCount,
memberRecord,
memberVisible,
} = state.clockmember; } = state.clockmember;
const { const {
guideStep, guideStep,
...@@ -250,7 +290,8 @@ function mapStateToProps(state) { ...@@ -250,7 +290,8 @@ function mapStateToProps(state) {
clockList, clockList,
subjectNumList, subjectNumList,
subjectCount, subjectCount,
memberRecord,
memberVisible,
}; };
} }
export default connect(mapStateToProps)(LiveClassForm); export default connect(mapStateToProps)(LiveClassForm);
...@@ -172,3 +172,34 @@ ...@@ -172,3 +172,34 @@
.formList { .formList {
margin: 10px 0; margin: 10px 0;
} }
.modalMember {
.memberWrap {
.body {
min-height: 130px;
.infoFlex {
display: flex;
align-items: center;
}
.infoTitle {
color: rgba(0,0,0,.85);
font-weight: 600;
font-size: 16px;
line-height: 1.4;
}
.infoContent {
margin-left: 38px;
margin-top: 8px;
color: rgba(0,0,0,.65);
font-size: 14px;
}
}
.infoBtn {
text-align: right;
}
}
:global {
.ant-modal-close-x {
font-size: 30px;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment