|
@@ -22,9 +22,31 @@ export const setMainMoudle = (state,action) => {
|
|
|
const res = Object.assign({},state);
|
|
|
// const emptySpan = JSON.parse(config.textLabel);
|
|
|
// let data = action.data.push(emptySpan);
|
|
|
- res.moduleData = action.data;
|
|
|
+ // 处理tagType=4的类型
|
|
|
+ // const originalData = JSON.parse(JSON.stringify(action.data));
|
|
|
+ const originalData = action.data;
|
|
|
+ const originalSonData = action.addSymptom;
|
|
|
+ let spreadLabels=[];
|
|
|
+ let sonSpreadLabels=[];//子模板
|
|
|
+ for(let i=0; i<originalData.length;i++){
|
|
|
+ if(originalData[i].tagType==4){
|
|
|
+ spreadLabels.push(...originalData[i].questionMapping);
|
|
|
+ }else{
|
|
|
+ spreadLabels.push(originalData[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for(let j=0; j<originalSonData.length;j++){
|
|
|
+ if(originalSonData[j].tagType==4){
|
|
|
+ sonSpreadLabels.push(...originalSonData[j].questionMapping);
|
|
|
+ }else{
|
|
|
+ sonSpreadLabels.push(originalSonData[j]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // res.moduleData = action.data;
|
|
|
+ // res.addSmoduleData = action.addSymptom;
|
|
|
+ res.moduleData = spreadLabels;
|
|
|
res.saveText = res.save||[];
|
|
|
- res.addSmoduleData = action.addSymptom;
|
|
|
+ res.addSmoduleData = sonSpreadLabels;
|
|
|
res.addModuleName = action.addModuleName;
|
|
|
res.update=Math.random();
|
|
|
return res;
|