|
@@ -587,7 +587,7 @@ export default {
|
|
|
onEditorChange(e, ref) {
|
|
|
e.quill.deleteText(1000, 4);
|
|
|
console.log(e.quill.getLength());
|
|
|
- this.$refs.scaleFormRef.clearValidate(ref)
|
|
|
+ this.$refs.scaleFormRef.clearValidate(ref);
|
|
|
},
|
|
|
assessCommitTest() {
|
|
|
console.dir(this.formtParams());
|
|
@@ -907,7 +907,7 @@ export default {
|
|
|
},
|
|
|
/**
|
|
|
* 修改表格数据(添加、删除 :组、问题、选项)
|
|
|
- * @param type 类型:1/-1:新增/删除组; 2/-2:新增/删除问题; 3/-3:新增/删除选项
|
|
|
+ * @param type 类型:1/-1:新增/删除组; 2/-2:新增/删除问题; 3/-3:新增/删除选项; 4:复制组; 5:复制问题
|
|
|
* @param tableIndex 单个量表的index
|
|
|
* @param rowIndex 表格 当前行的index
|
|
|
* @param groupId 当前组id
|
|
@@ -1008,6 +1008,41 @@ export default {
|
|
|
rowIndex
|
|
|
);
|
|
|
break;
|
|
|
+ case 4: //type 4: 复制组=> 将组id符合的数据复制一份,重置组id和问题id
|
|
|
+ let copyData = this.scaleData.klScaleParent[
|
|
|
+ tableIndex
|
|
|
+ ].klScaleSaveGroup.filter((item) => item.groupId === groupId);
|
|
|
+ copyData = JSON.parse(JSON.stringify(copyData));
|
|
|
+ let newId = new Date().valueOf().toString();
|
|
|
+ // 筛选并设置相同的issueId
|
|
|
+ let newIssueIdArr = [];
|
|
|
+ copyData.forEach((item, i, arr) => {
|
|
|
+ item.groupId = newId;
|
|
|
+ if (i === 0 || item.issueId !== arr[i - 1].issueId) {
|
|
|
+ newIssueIdArr.push(
|
|
|
+ newId + "-" + new Date().valueOf().toString() + "-" + i
|
|
|
+ ); //加索引 防重复
|
|
|
+ } else if (item.issueId === arr[i - 1].issueId) {
|
|
|
+ newIssueIdArr.push(newIssueIdArr[i - 1]);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ copyData.forEach((item, i) => {
|
|
|
+ item.issueId = newIssueIdArr[i];
|
|
|
+ });
|
|
|
+ let copyGroupIndex;
|
|
|
+ this.scaleData.klScaleParent[tableIndex].klScaleSaveGroup.forEach(
|
|
|
+ (item, i) => {
|
|
|
+ if (item.groupId === groupId) {
|
|
|
+ copyGroupIndex = i;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ this.scaleData.klScaleParent[tableIndex].klScaleSaveGroup.splice(
|
|
|
+ copyGroupIndex + 1,
|
|
|
+ 0,
|
|
|
+ ...copyData
|
|
|
+ );
|
|
|
+ break;
|
|
|
}
|
|
|
},
|
|
|
CHANGE_FORM_DATA(tableIndex, rowIndex, name, val) {
|