diff --git a/src/views/CodeEdit.vue b/src/views/CodeEdit.vue
index e432501..e2d6946 100644
--- a/src/views/CodeEdit.vue
+++ b/src/views/CodeEdit.vue
@@ -19,9 +19,9 @@
-
-
+
+
@@ -32,7 +32,7 @@
newFile()">
新文件
-
+ newIp()">
新IP核
newFolder()">
@@ -48,7 +48,7 @@
保存
@@ -171,7 +171,17 @@ endmodule\n"},
confirmButtonText: "确定",
cancelButtonText: "取消",
}).then(({ value }) => {
- node.children.push({ "label": value, "text": "" })
+ node.children.push({ label: value, type: "file", text: "" })
+ this.notsaved = true
+ })
+ },
+ newIp() {
+ var node = this.$refs.DeviceGroupTree.getCurrentNode()
+ this.$prompt("请输入ip组件名", "ip组件名", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ }).then(({ value }) => {
+ node.children.push({ label: value, type: "ipcore", params: {} })
this.notsaved = true
})
},
@@ -181,7 +191,7 @@ endmodule\n"},
confirmButtonText: "确定",
cancelButtonText: "取消",
}).then(({ value }) => {
- node.children.push({ "label": value, "children": [] })
+ node.children.push({ label: value, type: "folder", children: [] })
this.notsaved = true
})
},
@@ -191,7 +201,7 @@ endmodule\n"},
const children = node.parent.childNodes;
const index = children.findIndex(d => d.id === node.id);
children.splice(index, 1);
-
+ this.notsaved = true
},
clickRename() {
this.$prompt("请输入新名字", "新名字", {