|
@@ -440,6 +440,19 @@ export default {
|
|
|
},
|
|
|
editCheck(index, item) {
|
|
|
|
|
|
+ },
|
|
|
+ setJsonCheck(newItems){
|
|
|
+ let _index = this.checkC.replace("x", "").split("-");
|
|
|
+ let cJson = {}
|
|
|
+ if (this.ctype == 1) {
|
|
|
+ cJson = newItems[_index[0]].json ? JSON.parse(JSON.stringify(newItems[_index[0]].json)) : '';
|
|
|
+ } else if (this.ctype == 2) {
|
|
|
+ cJson = newItems[_index[0]].array[_index[1]].json ? JSON.parse(JSON.stringify(newItems[_index[0]].array[_index[1]].json)) : '';
|
|
|
+ } else if (this.ctype == 3) {
|
|
|
+ cJson = newItems[_index[0]].array[_index[1]].array[_index[2]].json ? JSON.parse(JSON.stringify(newItems[_index[0]].array[_index[1]].array[_index[2]].json)) : '';
|
|
|
+ }
|
|
|
+ this.$emit("update:cJson", cJson)
|
|
|
+ this.$forceUpdate()
|
|
|
},
|
|
|
dragStart(val, i, index) {
|
|
|
if (this.isdrag != index) {
|
|
@@ -478,7 +491,12 @@ export default {
|
|
|
newItems.splice(this.oldIndex, 1);
|
|
|
// 在列表中目标位置增加新的节点
|
|
|
newItems.splice(this.newIndex, 0, this.oldData);
|
|
|
+ console.log('................',...newItems);
|
|
|
+ /* 修改选中的并且切换的题目 */
|
|
|
+ this.setJsonCheck(newItems)
|
|
|
+
|
|
|
this.$emit("changeJson", [...newItems]);
|
|
|
+
|
|
|
this.typeIndex = "";
|
|
|
this.newIndex = "";
|
|
|
this.dragType = "";
|
|
@@ -536,6 +554,11 @@ export default {
|
|
|
} else {
|
|
|
newItems[this.newIndex].array.splice(this.newIndex2, 0, this.oldData);
|
|
|
}
|
|
|
+
|
|
|
+ /* 修改选中的并且切换的题目 */
|
|
|
+ this.setJsonCheck(newItems)
|
|
|
+
|
|
|
+
|
|
|
this.$emit("changeJson", [...newItems]);
|
|
|
this.typeIndex = "";
|
|
|
this.newIndex = "";
|
|
@@ -597,6 +620,11 @@ export default {
|
|
|
} else {
|
|
|
newItems[this.newIndex].array.splice(this.newIndex2, 0, this.oldData);
|
|
|
}
|
|
|
+
|
|
|
+ /* 修改选中的并且切换的题目 */
|
|
|
+ this.setJsonCheck(newItems)
|
|
|
+
|
|
|
+
|
|
|
this.$emit("changeJson", [...newItems]);
|
|
|
this.typeIndex = "";
|
|
|
this.newIndex = "";
|