Commit c3995bdb by zangsuyun

fix:修改上下移规则

parent 810f03c4
......@@ -3,7 +3,7 @@
* @Author: zangsuyun
* @Date: 2021-03-12 14:49:40
* @LastEditors: zangsuyun
* @LastEditTime: 2021-03-31 10:25:56
* @LastEditTime: 2021-04-02 10:54:24
* @Copyright: © 2020 杭州杰竞科技有限公司 版权所有
*/
......@@ -43,7 +43,7 @@ class KnowledgeBaseList extends React.Component {
};
handleUp = (index, record) => {
if (index === 0) {
if (index === 0 && this.props.query.current === 1) {
return;
}
const params = {
......@@ -63,10 +63,7 @@ class KnowledgeBaseList extends React.Component {
const { query, totalCount } = this.props;
const { current, size } = query;
if (
index === query.size - 1 ||
totalCount === size * (current - 1) + index + 1
) {
if (totalCount === size * (current - 1) + index + 1) {
return;
}
......@@ -324,7 +321,9 @@ class KnowledgeBaseList extends React.Component {
<div className="operate">
<div
className={
index === 0 ? "operate__item disable" : "operate__item"
index === 0 && current === 1
? "operate__item disable"
: "operate__item"
}
onClick={() => this.handleUp(index, record)}
>
......@@ -333,7 +332,6 @@ class KnowledgeBaseList extends React.Component {
<span className="operate__item split"> | </span>
<div
className={
index === size - 1 ||
totalCount === size * (current - 1) + index + 1
? "operate__item disable"
: "operate__item"
......
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