Commit c973ae60 authored by wangxuelai's avatar wangxuelai

''

parent 3beb371b
......@@ -695,6 +695,7 @@ export default {
payload: {
commentList: data.data && data.data.list,
commentListTotal: data.data && data.data.total,
commentParams: newParams,
},
});
} else {
......
......@@ -55,6 +55,7 @@ class CommentListForm extends React.Component {
payload: {
params: {
source_id: staticChartId,
page: 1,
},
},
});
......@@ -72,6 +73,19 @@ class CommentListForm extends React.Component {
},
});
}
sizeChange = (page, perPage) => {
const { dispatch, staticChartId } = this.props;
dispatch({
type: 'coursegatherdetail/searchCourseReply',
payload: {
params: {
page: 1,
perPage,
source_id: staticChartId,
},
},
});
}
handleClickDelete = (record) => {
const { dispatch } = this.props;
Modal.confirm({
......@@ -155,6 +169,7 @@ class CommentListForm extends React.Component {
type: 'coursegatherdetail/searchCourseReply',
payload: {
params: {
page: 1,
source_id: gatherDetail.id,
},
},
......@@ -177,6 +192,14 @@ class CommentListForm extends React.Component {
{
title: '序号',
dataIndex: 'id',
render: (text, record, index) => {
return (
<div className={pageStyle.indexbox}>
{((commentParams.page - 1) * commentParams.perPage) + index + 1}
{record.place_top_at && <div className={pageStyle.placetop}>置顶</div>}
</div>
);
},
},
{
title: '用户',
......@@ -202,6 +225,10 @@ class CommentListForm extends React.Component {
);
},
},
{
title: '评论时间',
dataIndex: 'created_at',
},
{
title: '操作',
dataIndex: 'a',
......@@ -216,7 +243,7 @@ class CommentListForm extends React.Component {
</Tooltip>
}
<Divider type="vertical" />
<span className={pageStyle.hreflink} onClick={() => this.handleClickStick(record)}>置顶</span>
<span className={pageStyle.hreflink} onClick={() => this.handleClickStick(record)}>{record.place_top_at ? '取消置顶' : '置顶'}</span>
<Divider type="vertical" />
<span className={pageStyle.hreflink} onClick={() => this.handleClickDelete(record)}>删除</span>
</div>
......@@ -256,8 +283,12 @@ class CommentListForm extends React.Component {
<div className="tablefooterbox">
<span className="tablefooterstatic">{commentListTotal}条数据</span>
<Pagination
showSizeChanger
showQuickJumper
onShowSizeChange={this.sizeChange}
pageSize={commentParams.perPage}
total={Number(commentListTotal)}
current={Number(commentParams.page)}
onChange={this.changePage}
/>
</div>
......
......@@ -20,3 +20,19 @@
padding: 31px 21px;
min-height: calc(100vh - 280px);
}
.placetop {
width: 36px;
height: 22px;
line-height: 20px;
border-radius: 4px;
border: 1px solid rgba(2,181,255,1);
color: #02B5FF;
font-size: 12px;
background-color: #fff;
text-align: center;
margin-left: 16px;
}
.indexbox {
display: flex;
align-items: center;
}
......@@ -44,7 +44,7 @@ class CommentListForm extends React.Component {
dispatch({
type: 'onlineclasses/commentStick',
payload: {
place_top: 1,
place_top: record.place_top_at ? 2 : 1,
id: record.id,
},
});
......@@ -62,6 +62,19 @@ class CommentListForm extends React.Component {
},
});
}
sizeChange = (page, perPage) => {
const { dispatch, addCourseObj } = this.props;
dispatch({
type: 'onlineclasses/selectComment',
payload: {
params: {
page: 1,
perPage,
source_id: addCourseObj.id,
},
},
});
}
handleClickDelete = (record) => {
const { dispatch } = this.props;
Modal.confirm({
......@@ -137,6 +150,14 @@ class CommentListForm extends React.Component {
{
title: '序号',
dataIndex: 'id',
render: (text, record, index) => {
return (
<div className={pageStyle.indexbox}>
{((commentParams.page - 1) * commentParams.perPage) + index + 1}
{record.place_top_at && <div className={pageStyle.placetop}>置顶</div>}
</div>
);
},
},
{
title: '用户',
......@@ -162,6 +183,10 @@ class CommentListForm extends React.Component {
);
},
},
{
title: '评论时间',
dataIndex: 'created_at',
},
{
title: '操作',
dataIndex: 'a',
......@@ -176,7 +201,7 @@ class CommentListForm extends React.Component {
</Tooltip>
}
<Divider type="vertical" />
<span className={pageStyle.hreflink} onClick={() => this.handleClickStick(record)}>置顶</span>
<span className={pageStyle.hreflink} onClick={() => this.handleClickStick(record)}>{record.place_top_at ? '取消置顶' : '置顶'}</span>
<Divider type="vertical" />
<span className={pageStyle.hreflink} onClick={() => this.handleClickDelete(record)}>删除</span>
</div>
......@@ -196,6 +221,9 @@ class CommentListForm extends React.Component {
<div className="tablefooterbox">
<span className="tablefooterstatic">{commentListTotal}条数据</span>
<Pagination
showSizeChanger
showQuickJumper
onShowSizeChange={this.sizeChange}
pageSize={commentParams.perPage}
total={Number(commentListTotal)}
onChange={this.changePage}
......
......@@ -8,3 +8,19 @@
color:rgba(24,144,255,1);
cursor: pointer;
}
.placetop {
width: 36px;
height: 22px;
line-height: 20px;
border-radius: 4px;
border: 1px solid rgba(2,181,255,1);
color: #02B5FF;
font-size: 12px;
background-color: #fff;
text-align: center;
margin-left: 16px;
}
.indexbox {
display: flex;
align-items: center;
}
\ No newline at end of file
......@@ -821,6 +821,7 @@ function getFileType(type) {
};
}
function getAudioDuration(file) {
console.log(file, 'file');
return new Promise((resolve, reject) => {
const url = URL.createObjectURL(file);
const audioElement = new Audio(url);
......
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