| | |
| | | // 树节点右键单击菜单中删除按钮时触发 |
| | | handleDelete() { |
| | | const that = this |
| | | that.$confirm({ |
| | | const { rightClickSelected: { id, type }, $confirm, url, $notification } = that |
| | | $confirm({ |
| | | title: '提示', |
| | | content: '确认删除此条记录吗?', |
| | | okText: '确认', |
| | | okType: 'danger', |
| | | cancelText: '取消', |
| | | onOk: () => { |
| | | if (!this.url.delete) { |
| | | if (!url.delete) { |
| | | this.$message.error('请设置url.delete属性!') |
| | | return |
| | | } |
| | | deleteAction(that.url.delete, { id: this.rightClickSelected.id }) |
| | | deleteAction(url.delete + `/${id}/${type}`) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | that.getTreeDataByApi() |
| | | that.$notification.success({ |
| | | $notification.success({ |
| | | message: '消息', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | that.$notification.warning({ |
| | | $notification.warning({ |
| | | message: '消息', |
| | | description: res.message |
| | | }) |