|
@@ -37,16 +37,16 @@ export const confirm = (state,action) =>{
|
|
|
const items = [...exists||[],...withs||[]];
|
|
|
if((!exists||!withs||items.length==0)&&!nones&&!exclusion){ //取消无殊的选中,空白提交
|
|
|
arr[ikey].value = '';
|
|
|
+ arr[ikey].selecteds = [];
|
|
|
res.saveText[ikey] = '';
|
|
|
- res.selecteds.splice(ikey,1);
|
|
|
res.update=Math.random();
|
|
|
return res;
|
|
|
}
|
|
|
//选中互斥项
|
|
|
if(exclusion){
|
|
|
arr[ikey].value = excluName;
|
|
|
+ arr[ikey].selecteds = action.data;
|
|
|
res.saveText[ikey] = excluName;
|
|
|
- res.selecteds[ikey] = action.data;
|
|
|
res.update=Math.random();
|
|
|
return res;
|
|
|
}
|
|
@@ -60,7 +60,7 @@ export const confirm = (state,action) =>{
|
|
|
if(items.length==0&&nones){
|
|
|
arr[ikey-1].value = newPreText;
|
|
|
res.saveText[ikey-1] = newPreText;
|
|
|
- res.selecteds[ikey] = null; //无殊选中状态遗留bug修改
|
|
|
+ //res.selecteds[ikey] = null; //无殊选中状态遗留bug修改
|
|
|
res.update=Math.random();
|
|
|
return res;
|
|
|
}
|
|
@@ -93,7 +93,7 @@ export function setCheckBoxValue(state,action) {
|
|
|
showText = showText.substr(0,showText.length-1);
|
|
|
}
|
|
|
res.data[labelInx].value = showText;
|
|
|
- res.selecteds[labelInx] = action.data;
|
|
|
+ res.data[labelInx].selecteds = action.data;
|
|
|
res.saveText = checkFullfillText(res.data).saveText;
|
|
|
res.update = Math.random();
|
|
|
return res;
|
|
@@ -131,13 +131,9 @@ export function insertLabelData(state,action){
|
|
|
if(searchInEnd){
|
|
|
res.data.splice(index,1,pText,...spreadLabels,text);
|
|
|
res.saveText = checkFullfillText(res.data).saveText;
|
|
|
- //res.saveText.splice(index,1,newText,'','');
|
|
|
- res.selecteds.splice(index,1,null,...new Array(spreadLabels.length).fill(null),null);
|
|
|
}else{
|
|
|
res.data.splice(index,1,text,...spreadLabels,pText);
|
|
|
res.saveText = checkFullfillText(res.data).saveText;
|
|
|
- //res.saveText.splice(index,1,'','',newText);
|
|
|
- res.selecteds.splice(index,1,null,...new Array(spreadLabels.length).fill(null),null);
|
|
|
}
|
|
|
|
|
|
}else{
|
|
@@ -145,11 +141,9 @@ export function insertLabelData(state,action){
|
|
|
if(searchInEnd){
|
|
|
res.data.splice(index+1,0,spreadLabels,text);
|
|
|
res.saveText.splice(index+1,0,'','');
|
|
|
- res.selecteds.splice(index+1,0,null,null);
|
|
|
}else{
|
|
|
res.data.splice(index,0,text,spreadLabels);
|
|
|
res.saveText.splice(index,0,'','');
|
|
|
- res.selecteds.splice(index,0,null,null);
|
|
|
}
|
|
|
}
|
|
|
res.searchData = []; //选中清空搜索内容(即关闭搜索弹窗)
|
|
@@ -206,9 +200,8 @@ export const changeLabelVal = (state,action)=>{//双击标签输入改变值
|
|
|
}
|
|
|
}else{//删除完标签内容则删除该标签
|
|
|
const num = nextIsDot?2:1;
|
|
|
- handleLocalDelTag('4',index,res.data[index],res.selecteds[index]);
|
|
|
+ handleLocalDelTag('4',index,res.data[index]);
|
|
|
res.data.splice(index,num);
|
|
|
- res.selecteds.splice(index,num);//杂音类样式选中状态对应
|
|
|
res.saveText = checkFullfillText(res.data).saveText;
|
|
|
}
|
|
|
res.update = Math.random();
|
|
@@ -225,7 +218,6 @@ export function clearCheckBody(state,action){ //清空
|
|
|
res.preData = [];
|
|
|
res.saveText = action.saveText;
|
|
|
res.isEmpty = action.isEmpty;
|
|
|
- res.selecteds = action.selecteds?action.selecteds:[];
|
|
|
if(action.flg){res.showAll = true}
|
|
|
return res;
|
|
|
}
|
|
@@ -242,13 +234,11 @@ export function backspaceText(state,action){
|
|
|
// data[delIndex].value = text;
|
|
|
}else if(data[inx].tagType==8){
|
|
|
data.splice(delIndex,1);
|
|
|
- res.selecteds.splice(delIndex,1); //杂音类样式选中状态对应
|
|
|
res.saveText.splice(delIndex,1);
|
|
|
}else{
|
|
|
- handleLocalDelTag(4,inx,data[inx],res.selecteds[inx]);
|
|
|
+ handleLocalDelTag(4,inx,data[inx]);
|
|
|
const n = action.text.length>0&&(config.punctuationReg.test(action.text))?1:2;
|
|
|
data.splice(inx,n);
|
|
|
- res.selecteds.splice(inx,n);
|
|
|
res.saveText.splice(inx,n);
|
|
|
}
|
|
|
}else if(flag == 'del'){
|
|
@@ -257,12 +247,10 @@ export function backspaceText(state,action){
|
|
|
|
|
|
}else if(data[inx] && data[inx].tagType==8){
|
|
|
data.splice(delIndex,1);
|
|
|
- res.selecteds.splice(delIndex,1); //杂音类样式选中状态对应
|
|
|
res.saveText.splice(delIndex,1);
|
|
|
}else{
|
|
|
- handleLocalDelTag(4,delIndex,data[inx],res.selecteds[inx]);
|
|
|
+ handleLocalDelTag(4,delIndex,data[inx]);
|
|
|
data.splice(delIndex,2);
|
|
|
- res.selecteds.splice(delIndex,2);
|
|
|
res.saveText.splice(delIndex,2);
|
|
|
}
|
|
|
}
|
|
@@ -280,6 +268,7 @@ export function multipleComfirn(state,action){
|
|
|
let item = data[ikey].questionMapping;
|
|
|
let arr=[];
|
|
|
item[index].value = seleData;
|
|
|
+ item[index].selecteds[ikey] = {[index]:action.data};
|
|
|
item.map((it)=>{
|
|
|
if(it.value){
|
|
|
arr.push(it.labelPrefix+it.value+it.labelSuffix);
|
|
@@ -287,12 +276,11 @@ export function multipleComfirn(state,action){
|
|
|
});
|
|
|
res.saveText[ikey] = arr.join("");
|
|
|
res.update = Math.random();
|
|
|
- res.selecteds[ikey] = {[index]:action.data};
|
|
|
return res;
|
|
|
}
|
|
|
data[ikey].value = seleData;
|
|
|
+ data[ikey].selecteds = action.data;
|
|
|
res.saveText[ikey] = seleData;
|
|
|
- res.selecteds[ikey] = action.data;
|
|
|
res.update = Math.random();
|
|
|
return res;
|
|
|
}
|
|
@@ -324,9 +312,7 @@ export function setImportCheckbodyLabel(state,action) {
|
|
|
export function recoveTag(state,action) {
|
|
|
let res = Object.assign({},state);
|
|
|
let arr = [...res.data];
|
|
|
- let slts = [...res.selecteds];
|
|
|
arr.splice(action.index,0,action.data);
|
|
|
- slts.splice(action.index,0,action.select);
|
|
|
const dataArr = checkFullfillText(arr);
|
|
|
let nextLabel = dataArr.newArr[(+action.index)+1];
|
|
|
//展开收起状态
|
|
@@ -335,7 +321,6 @@ export function recoveTag(state,action) {
|
|
|
}
|
|
|
res.data = dataArr.newArr;
|
|
|
res.saveText = dataArr.saveText;
|
|
|
- res.selecteds = slts;
|
|
|
shiftLocalDelTag();
|
|
|
res.update = Math.random();
|
|
|
return res;
|