Jelajahi Sumber

选中取消bug

luolei 5 tahun lalu
induk
melakukan
de7bb45e64
2 mengubah file dengan 14 tambahan dan 2 penghapusan
  1. 0 1
      src/components/SpreadDrop/index.jsx
  2. 14 1
      src/store/actions/currentIll.js

+ 0 - 1
src/components/SpreadDrop/index.jsx

@@ -243,7 +243,6 @@ class SpreadDrop extends Component{
         return;
       }
       //未选中互斥项,直接选中该互斥项
-      console.log(id,isExclu,joint,listIndex,selected,exclusion,name)
       let temp = '';
       if(exclusion==''){
         temp = id;

+ 14 - 1
src/store/actions/currentIll.js

@@ -341,6 +341,12 @@ export const confirm = (state,action) =>{
   const {nones,exists,withs,ikey,exclusion,excluName,ban,noneIds,tagType} = action.data;
   let existConpId = [];
   let withConpId = [];
+
+  const items = [...exists||[],...withs||[]];//既往史清空选项
+  if((!exists||!withs||items.length==0)&&!nones&&!exclusion){       //取消无殊的选中,空白提交
+    arr[ikey].value = '';
+    arr[ikey].selecteds = {};
+  }
   //既往史选中互斥项
   if(exclusion){
     arr[ikey].value = excluName;
@@ -386,7 +392,14 @@ export const confirm = (state,action) =>{
   let lengthN = withsArr.length - length1;
   let noneArr = JSON.parse(JSON.stringify(withsArr));  
   if(nones.length>1){//只点无不上去
-    const nonesName = tagType == 6?nones:(nones.slice(0,nones.length-1)+',');
+    let nonesName = ""
+    if(tagType == 6){
+      nonesName = nones
+      noneArr[ikey].value = '';
+      noneArr[ikey].selecteds = {};
+    }else{
+      nonesName = nones.slice(0,nones.length-1)+','
+    }
     const noneObj = Object.assign({},JSON.parse(config.textLabel),{name:nonesName,value:nonesName});
     const none = nones?noneObj:'';
     noneArr.splice(parseInt(ikey)+lengthN,0,none);