Commit c3995bdb by zangsuyun

fix:修改上下移规则

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