|
@@ -107,8 +107,14 @@ export function setCheckText(state,action) {
|
|
|
export function setCheckBoxValue(state,action) {
|
|
|
let res = Object.assign({},state);
|
|
|
const {labelInx,excluName,existsName,nones,withsName} = action.data;
|
|
|
- res.data[labelInx].value = (excluName||'')+(existsName||'')+(nones||'')+(withsName||'');
|
|
|
- res.saveText[labelInx] = (excluName||'')+(existsName||'')+(nones||'')+(withsName||'');
|
|
|
+ const 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.update = Math.random();
|
|
|
return res;
|