Jelajahi Sumber

查体显示区有默认值未收起bug修改(773)

zhouna 6 tahun lalu
induk
melakukan
13936fb5f5

+ 1 - 1
src/components/CheckBody/index.jsx

@@ -34,7 +34,7 @@ class CheckBody extends Component{
     let arr = [],list=[];//console.log(data,saveText)
     const {boxMark,showAll} = this.state;//console.log(data)
     const moreNum =data.length-[...data].reverse().findIndex((it)=>it.showInCheck)-1;//被隐藏的位置
-    console.log(moreNum);
+    //console.log(moreNum,this.props.defaultShowAll,showAll);
     const moreText = filterDataArr([...saveText].splice(moreNum));      //被收起的标签中是否有有值得,有则不能再收起showMoreBtn?more:''
     const more = this.props.defaultShowAll||showAll?<span className={style['more']} onClick={this.showHide}>收起<img src={hideImg} /></span>:<span className={style['more']} onClick={this.showHide}>展开<img src={showImg} /></span>;
     const showMoreBtn = data.length>moreNum&&!moreText;

+ 1 - 1
src/store/actions/checkBody.js

@@ -5,7 +5,7 @@ export function set(state,action){
   let res = Object.assign({},state);
   const {data} = action;
   const obj = fullfillText(data,false,false,false);
-  res.data = [...data];
+  res.data = obj.newArr;
   res.saveText = obj.saveText;//存逗号
   res.showAll = obj.checkHiddenDefault;
   res.update = Math.random();

+ 3 - 3
src/store/async-actions/fetchModules.js

@@ -147,11 +147,11 @@ export function getInitData(){
     json(api.getBigPush,param).then((res)=>{
       if(+res.data.code === 0){
         const data = res.data.data&&res.data.data.vital;
-        const str = JSON.stringify(data);
-        const arr = fullfillText(JSON.parse(str),false,false,false).newArr;
+        //const str = JSON.stringify(data);
+        //const arr = fullfillText(JSON.parse(str),false,false,false).newArr;
         dispatch({
           type:SET,
-          data:[...arr],
+          data:[...data],
           isEmpty:false
         });
       }else{