|
@@ -1009,14 +1009,14 @@ export default {
|
|
);
|
|
);
|
|
break;
|
|
break;
|
|
case 4: //type 4: 复制组=> 将组id符合的数据复制一份,重置组id和问题id
|
|
case 4: //type 4: 复制组=> 将组id符合的数据复制一份,重置组id和问题id
|
|
- let copyData = this.scaleData.klScaleParent[
|
|
|
|
|
|
+ let copyGroupData = this.scaleData.klScaleParent[
|
|
tableIndex
|
|
tableIndex
|
|
].klScaleSaveGroup.filter((item) => item.groupId === groupId);
|
|
].klScaleSaveGroup.filter((item) => item.groupId === groupId);
|
|
- copyData = JSON.parse(JSON.stringify(copyData));
|
|
|
|
|
|
+ copyGroupData = JSON.parse(JSON.stringify(copyGroupData));
|
|
let newId = new Date().valueOf().toString();
|
|
let newId = new Date().valueOf().toString();
|
|
// 筛选并设置相同的issueId
|
|
// 筛选并设置相同的issueId
|
|
let newIssueIdArr = [];
|
|
let newIssueIdArr = [];
|
|
- copyData.forEach((item, i, arr) => {
|
|
|
|
|
|
+ copyGroupData.forEach((item, i, arr) => {
|
|
item.groupId = newId;
|
|
item.groupId = newId;
|
|
if (i === 0 || item.issueId !== arr[i - 1].issueId) {
|
|
if (i === 0 || item.issueId !== arr[i - 1].issueId) {
|
|
newIssueIdArr.push(
|
|
newIssueIdArr.push(
|
|
@@ -1026,7 +1026,7 @@ export default {
|
|
newIssueIdArr.push(newIssueIdArr[i - 1]);
|
|
newIssueIdArr.push(newIssueIdArr[i - 1]);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- copyData.forEach((item, i) => {
|
|
|
|
|
|
+ copyGroupData.forEach((item, i) => {
|
|
item.issueId = newIssueIdArr[i];
|
|
item.issueId = newIssueIdArr[i];
|
|
});
|
|
});
|
|
let copyGroupIndex;
|
|
let copyGroupIndex;
|
|
@@ -1040,7 +1040,40 @@ export default {
|
|
this.scaleData.klScaleParent[tableIndex].klScaleSaveGroup.splice(
|
|
this.scaleData.klScaleParent[tableIndex].klScaleSaveGroup.splice(
|
|
copyGroupIndex + 1,
|
|
copyGroupIndex + 1,
|
|
0,
|
|
0,
|
|
- ...copyData
|
|
|
|
|
|
+ ...copyGroupData
|
|
|
|
+ );
|
|
|
|
+ break;
|
|
|
|
+ case 5: //type 5: 复制问题 => 将问题id符合的数据复制一份,重置问题id
|
|
|
|
+ let copyIssueData = this.scaleData.klScaleParent[
|
|
|
|
+ tableIndex
|
|
|
|
+ ].klScaleSaveGroup.filter((item) => item.issueId === issueId);
|
|
|
|
+ copyIssueData = JSON.parse(JSON.stringify(copyIssueData));
|
|
|
|
+ console.dir(copyIssueData)
|
|
|
|
+ let newIssueIdArrIssue = [];
|
|
|
|
+ copyIssueData.forEach((item, i, arr) => {
|
|
|
|
+ if (i === 0 || item.issueId !== arr[i - 1].issueId) {
|
|
|
|
+ newIssueIdArrIssue.push(
|
|
|
|
+ groupId + "-" + new Date().valueOf().toString() + "-" + i
|
|
|
|
+ );
|
|
|
|
+ } else if (item.issueId === arr[i - 1].issueId) {
|
|
|
|
+ newIssueIdArrIssue.push(newIssueIdArrIssue[i - 1]);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ copyIssueData.forEach((item, i) => {
|
|
|
|
+ item.issueId = newIssueIdArrIssue[i];
|
|
|
|
+ });
|
|
|
|
+ let copyIssueIndex;
|
|
|
|
+ this.scaleData.klScaleParent[tableIndex].klScaleSaveGroup.forEach(
|
|
|
|
+ (item, i) => {
|
|
|
|
+ if (item.issueId === issueId) {
|
|
|
|
+ copyIssueIndex = i;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ this.scaleData.klScaleParent[tableIndex].klScaleSaveGroup.splice(
|
|
|
|
+ copyIssueIndex + 1,
|
|
|
|
+ 0,
|
|
|
|
+ ...copyIssueData
|
|
);
|
|
);
|
|
break;
|
|
break;
|
|
}
|
|
}
|