소스 검색

Merge remote-tracking branch 'origin/dev/liucf' into dev/new1

# Conflicts:
#	src/common/components/EditableSpan/index.jsx
#	src/containers/SpreadDrop.js
zhouna 6 년 전
부모
커밋
bbe85ffa8e

+ 5 - 3
src/common/components/EditableSpan/index.jsx

@@ -3,8 +3,6 @@ import style from './index.less';
 import config from "@config/index";
 import config from "@config/index";
 import {filterArr,isIE} from '@utils/tools.js';
 import {filterArr,isIE} from '@utils/tools.js';
 import Notify from '../Notify/index.js';
 import Notify from '../Notify/index.js';
-
-import $ from 'jquery';
 /*****
 /*****
  * author:zn@2018-12-10
  * author:zn@2018-12-10
  * 自由文本输入组件
  * 自由文本输入组件
@@ -127,6 +125,9 @@ class EditableSpan extends Component{
   }
   }
   handleKeyup(e){
   handleKeyup(e){
      const {boxMark,handleKeydown,i,value} = this.props;
      const {boxMark,handleKeydown,i,value} = this.props;
+     const {preVal,index} = this.state;//console.log(22,i,index);
+    let innerVal = e.target.innerText;
+    if(e.keyCode==8){
      const {preVal,index} = this.state;
      const {preVal,index} = this.state;
     const ev = e||window.event;
     const ev = e||window.event;
     const target = ev.target||ev.srcElement;
     const target = ev.target||ev.srcElement;
@@ -140,7 +141,8 @@ class EditableSpan extends Component{
       if(index!==0 && pattern.test(data)){
       if(index!==0 && pattern.test(data)){
         handleKeydown&&handleKeydown({boxMark,i:index});
         handleKeydown&&handleKeydown({boxMark,i:index});
         this.setState({
         this.setState({
-          index:index-1
+          // index:index-1 //连续往前删除,体验不佳
+          index:null
         })
         })
       }
       }
     }
     }

+ 1 - 0
src/containers/EditableSpan.js

@@ -210,6 +210,7 @@ function mapDispatchToProps(dispatch,state) {
       }
       }
     },
     },
     handleKeydown(obj){//backspace删除
     handleKeydown(obj){//backspace删除
+      if(obj.i==null){return}
       switch (+obj.boxMark){
       switch (+obj.boxMark){
         case 1:
         case 1:
           dispatch({type:DEL_MAIN,delIndex:obj.i});
           dispatch({type:DEL_MAIN,delIndex:obj.i});

+ 6 - 0
src/containers/MainSuit.js

@@ -126,6 +126,12 @@ function mapDispatchToProps(dispatch) {
           type: SAVE_FREE,
           type: SAVE_FREE,
           data:item
           data:item
         })
         })
+        //右侧推送
+          setTimeout(function(){ 
+            if(didPushParamChange()){
+              dispatch(billing);
+            }
+          },500);
       },
       },
       fetchPushInfos(){//文本模式下推送
       fetchPushInfos(){//文本模式下推送
         //调右侧推送
         //调右侧推送

+ 0 - 3
src/containers/SpreadDrop.js

@@ -154,9 +154,6 @@ function otherHisConfirm(dispatch,store,params){
       dispatch({
       dispatch({
         type:ISREAD
         type:ISREAD
       });
       });
-      dispatch({
-        type:ISREAD
-      });
     }
     }
   });
   });
 }
 }

+ 8 - 2
src/store/actions/checkBody.js

@@ -108,8 +108,14 @@ export function setCheckText(state,action) {
 export function setCheckBoxValue(state,action) {
 export function setCheckBoxValue(state,action) {
   let res = Object.assign({},state);
   let res = Object.assign({},state);
   const {labelInx,excluName,existsName,nones,withsName} = action.data;
   const {labelInx,excluName,existsName,nones,withsName} = action.data;
-  res.data[labelInx].value = (excluName||'')+(existsName||'')+(nones||'')+(withsName||'');
-  res.saveText[labelInx] = (excluName||'')+(existsName||'')+(nones||'')+(withsName||'');
+  let showText = (excluName||'')+(existsName||'')+(nones||'')+(withsName||'');
+  // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
+  let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
+  if(pattern.test(showText)){
+    showText = showText.substr(0,showText.length-1);
+  }
+  res.data[labelInx].value = showText;
+  res.saveText[labelInx] = showText;
   res.selecteds[labelInx] = action.data;
   res.selecteds[labelInx] = action.data;
   res.update = Math.random();
   res.update = Math.random();
   return res;
   return res;

+ 9 - 3
src/store/actions/currentIll.js

@@ -254,10 +254,16 @@ export const confirm = (state,action) =>{
 export const setCheckBox = (state,action)=>{
 export const setCheckBox = (state,action)=>{
   const res = Object.assign({},state);
   const res = Object.assign({},state);
   const {exists,labelInx,existsName} = action.data;
   const {exists,labelInx,existsName} = action.data;
+  // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
+  let names=existsName;
+  let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
+  if(pattern.test(existsName)){
+    names = existsName.substr(0,existsName.length-1);
+  }
   let arr = res.data;
   let arr = res.data;
-  arr[labelInx].value = existsName;
-  res.saveText[labelInx] = existsName;
-  res.selecteds[labelInx] = action.data;
+  arr[labelInx].value = names;
+  res.saveText[labelInx] = names;
+  res.selecteds[labelInx] = action.data;console.log(99,res,action);
   res.update=Math.random();
   res.update=Math.random();
   return res;
   return res;
 }
 }

+ 8 - 2
src/store/actions/mainSuit.js

@@ -190,9 +190,15 @@ export const confirm = (state,action) =>{
 export const commConfirm=(state,action)=>{
 export const commConfirm=(state,action)=>{
   const res = Object.assign({},state);
   const res = Object.assign({},state);
   const {exists,ikey,existsName} = action.data;
   const {exists,ikey,existsName} = action.data;
+  // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
+  let names=existsName;
+  let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
+  if(pattern.test(existsName)){
+    names = existsName.substr(0,existsName.length-1);
+  }
   let arr = res.data;
   let arr = res.data;
-  arr[ikey].value = existsName;
-  res.saveText[ikey] = existsName;
+  arr[ikey].value = names;
+  res.saveText[ikey] = names;
   res.selecteds[ikey] = action.data;
   res.selecteds[ikey] = action.data;
   res.update=Math.random();
   res.update=Math.random();
   return res;
   return res;

+ 6 - 1
src/store/actions/otherHistory.js

@@ -150,7 +150,12 @@ export function setOtherInput(state,action){
 export function setCheckBoxValue(state,action) {
 export function setCheckBoxValue(state,action) {
   let res = Object.assign({},state);
   let res = Object.assign({},state);
   const {labelInx,excluName,existsName,nones,withsName} = action.data;
   const {labelInx,excluName,existsName,nones,withsName} = action.data;
-  const showText = (excluName||'')+(existsName||'')+(nones||'')+(withsName||'');
+  let showText = (excluName||'')+(existsName||'')+(nones||'')+(withsName||'');
+  // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
+  let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
+  if(pattern.test(showText)){
+    showText = showText.substr(0,showText.length-1);
+  }
   res.data[labelInx].value = showText;
   res.data[labelInx].value = showText;
   res.saveText[labelInx] = showText;
   res.saveText[labelInx] = showText;
   res.selecteds[labelInx] = action.data;
   res.selecteds[labelInx] = action.data;