Browse Source

子模板不可删除bug修改

zhouna 5 years ago
parent
commit
7187c4a873
2 changed files with 7 additions and 4 deletions
  1. 4 1
      src/modules/HomePage/index.jsx
  2. 3 3
      src/utils/utils.js

+ 4 - 1
src/modules/HomePage/index.jsx

@@ -6,7 +6,7 @@ import BodyContainer from "@components/BodyContainer";
 import {ConfirmModal} from '@commonComp';
 import {ConfirmModal} from '@commonComp';
 import store from '@store';
 import store from '@store';
 
 
-import {HIDEDROP,SETMINSCREEN,SETSYSTEMCONFIG,SETPRE,SETREADDITEMS,RESET_SELECT_TAG} from '@store/types/homePage.js';
+import {HIDEDROP,SETMINSCREEN,SETSYSTEMCONFIG,SETPRE,SETREADDITEMS,RESET_SELECT_TAG,ISREAD} from '@store/types/homePage.js';
 import {billing} from '@store/async-actions/pushMessage';
 import {billing} from '@store/async-actions/pushMessage';
 import {CLEAR_SEARCH,DELETE_MAIN_SELECTED_TAGS} from '@types/mainSuit';
 import {CLEAR_SEARCH,DELETE_MAIN_SELECTED_TAGS} from '@types/mainSuit';
 import {CURRENT_CLEAR,DELETE_CURRENT_SELECTED_TAGS} from '@types/currentIll';
 import {CURRENT_CLEAR,DELETE_CURRENT_SELECTED_TAGS} from '@types/currentIll';
@@ -179,6 +179,9 @@ const mapDispatchToProps = function (dispatch) {
           end,
           end,
           boxMark
           boxMark
         });
         });
+        dispatch({
+          type:ISREAD
+        })
       },
       },
       resetSelect(){
       resetSelect(){
           dispatch({
           dispatch({

+ 3 - 3
src/utils/utils.js

@@ -254,19 +254,19 @@ export function deleteSelectedLabels(state,action){
   const {start,end,boxMark} = action;
   const {start,end,boxMark} = action;
   let n = Math.abs(end-start)+1;
   let n = Math.abs(end-start)+1;
   const arr = res.data;
   const arr = res.data;
-  const sonModule = arr.filter((it)=>it.flag=='3');
+  const sonModuleInx = arr.findIndex((it)=>it.flag=='3');
   const startIsText = arr[start].tagType=='8';
   const startIsText = arr[start].tagType=='8';
   const endIsText = arr[end].tagType=='8';
   const endIsText = arr[end].tagType=='8';
   if(!startIsText&&!endIsText){
   if(!startIsText&&!endIsText){
     n=Math.abs(end-start)+2;
     n=Math.abs(end-start)+2;
   }
   }
   if(start>end){      //从后往前选中
   if(start>end){      //从后往前选中
-    const temp = arr.splice(end,n,...sonModule);
+    const temp = end<sonModuleInx&&sonModuleInx<start?arr.splice(end,n,arr[sonModuleInx]):arr.splice(end,n);
     handleLocalDelTag(boxMark,end,temp);
     handleLocalDelTag(boxMark,end,temp);
   }else if(start===end){
   }else if(start===end){
     return res;
     return res;
   }else{
   }else{
-    const temp = arr.splice(start,n,...sonModule);
+    const temp = start<sonModuleInx&&sonModuleInx<end?arr.splice(start,n,arr[sonModuleInx]):arr.splice(start,n);
     handleLocalDelTag(boxMark,start,temp);
     handleLocalDelTag(boxMark,start,temp);
   }
   }
   const newObj = boxMark=='4'?checkFullfillText(arr):fullfillText(arr);
   const newObj = boxMark=='4'?checkFullfillText(arr):fullfillText(arr);