|
|
@ -1096,11 +1096,11 @@ export default { |
|
|
|
openLink(link) { |
|
|
|
openLink(link) { |
|
|
|
window.open(link, "_blank"); |
|
|
|
window.open(link, "_blank"); |
|
|
|
}, |
|
|
|
}, |
|
|
|
async checkAndDeleteTable(table) { |
|
|
|
async checkAndDeleteTable(table, action = 'showDialog') { |
|
|
|
this.dialogDeleteTable.tableName = table.table_name |
|
|
|
this.dialogDeleteTable.tableName = table.table_name |
|
|
|
this.dialogDeleteTable.nodes = table._nodes |
|
|
|
this.dialogDeleteTable.nodes = table._nodes |
|
|
|
this.dialogDeleteTable.id = table.id |
|
|
|
this.dialogDeleteTable.id = table.id |
|
|
|
await this.deleteTable('showDialog') |
|
|
|
await this.deleteTable(action) |
|
|
|
this.$e('c:table:delete') |
|
|
|
this.$e('c:table:delete') |
|
|
|
}, |
|
|
|
}, |
|
|
|
async deleteTable(action = '') { |
|
|
|
async deleteTable(action = '') { |
|
|
@ -1879,7 +1879,7 @@ export default { |
|
|
|
this.selectedNodeForDelete = { |
|
|
|
this.selectedNodeForDelete = { |
|
|
|
dialog: true, |
|
|
|
dialog: true, |
|
|
|
item: item, |
|
|
|
item: item, |
|
|
|
heading: `Click Submit to Delete The ${item._nodes.type}`, |
|
|
|
heading: `Click Submit to Delete The ${item._nodes.type}: ${item.name}`, |
|
|
|
}; |
|
|
|
}; |
|
|
|
} else if (action === "hideDialog") { |
|
|
|
} else if (action === "hideDialog") { |
|
|
|
this.selectedNodeForDelete = { |
|
|
|
this.selectedNodeForDelete = { |
|
|
@ -1890,34 +1890,8 @@ export default { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
item = this.selectedNodeForDelete.item; |
|
|
|
item = this.selectedNodeForDelete.item; |
|
|
|
if (item._nodes.type === "table") { |
|
|
|
if (item._nodes.type === "table") { |
|
|
|
const result = await this.$store.dispatch("sqlMgr/ActSqlOp", [ |
|
|
|
await this.checkAndDeleteTable(item, '') |
|
|
|
{ |
|
|
|
|
|
|
|
env: item._nodes.env, |
|
|
|
|
|
|
|
dbAlias: item._nodes.dbAlias, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
"columnList", |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
table_name: item._nodes.table_name, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await this.sqlMgr.sqlOpPlus( |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
env: item._nodes.env, |
|
|
|
|
|
|
|
dbAlias: item._nodes.dbAlias, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
"tableDelete", |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
table_name: item._nodes.table_name, |
|
|
|
|
|
|
|
columns: columns.data.list, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
await this.loadTablesFromParentTreeNode({ |
|
|
|
|
|
|
|
_nodes: { |
|
|
|
|
|
|
|
...item._nodes, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.$toast.success("Table deleted successfully").goAway(3000); |
|
|
|
|
|
|
|
} else if (item._nodes.type === "view") { |
|
|
|
} else if (item._nodes.type === "view") { |
|
|
|
const view = await this.$store.dispatch("sqlMgr/ActSqlOp", [ |
|
|
|
const view = await this.$store.dispatch("sqlMgr/ActSqlOp", [ |
|
|
|
{ |
|
|
|
{ |
|
|
|