111
This commit is contained in:
@@ -51,7 +51,7 @@ export class EventManager {
|
|||||||
handleDelete(event: any, activeNodeID: string) {
|
handleDelete(event: any, activeNodeID: string) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
if (!activeNodeID) return console.warn('没有选中节点')
|
if (!activeNodeID) return console.warn('没有选中节点')
|
||||||
this.stateManager.nodeManager.deleteNode(activeNodeID)
|
this.stateManager.deleteNode(activeNodeID, { isElMessageBox: true })
|
||||||
}
|
}
|
||||||
/** 处理键盘事件 */
|
/** 处理键盘事件 */
|
||||||
handleKeyDown(event: any) {
|
handleKeyDown(event: any) {
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import { ref, computed } from "vue";
|
import { ref, computed } from "vue";
|
||||||
import { NODE_TYPE } from '../tools/index.d'
|
import { NODE_TYPE } from '../tools/index.d'
|
||||||
import { ElMessageBox } from 'element-plus'
|
import { ElMessageBox } from 'element-plus'
|
||||||
import { useI18n } from 'vue-i18n'
|
import i18n from '@/lang'
|
||||||
|
const t = i18n.global.t
|
||||||
|
|
||||||
export interface NodesItem {
|
export interface NodesItem {
|
||||||
id: string
|
id: string
|
||||||
@@ -34,7 +35,6 @@ export class StateManager {
|
|||||||
flowManager: any
|
flowManager: any
|
||||||
nodeManager: any
|
nodeManager: any
|
||||||
toolManager: any
|
toolManager: any
|
||||||
t: any
|
|
||||||
// 设置管理器
|
// 设置管理器
|
||||||
setManager(options) {
|
setManager(options) {
|
||||||
options.eventManager && (this.eventManager = options.eventManager)
|
options.eventManager && (this.eventManager = options.eventManager)
|
||||||
@@ -94,8 +94,6 @@ export class StateManager {
|
|||||||
return arr
|
return arr
|
||||||
})
|
})
|
||||||
|
|
||||||
this.t = useI18n().t
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/** 设置激活节点 */
|
/** 设置激活节点 */
|
||||||
setActiveNodeID(id: string) { this.activeNodeID.value = id }
|
setActiveNodeID(id: string) { this.activeNodeID.value = id }
|
||||||
@@ -110,11 +108,11 @@ export class StateManager {
|
|||||||
if (isElMessageBox) {
|
if (isElMessageBox) {
|
||||||
deletePromise = await new Promise<void>((resolve, reject) => {
|
deletePromise = await new Promise<void>((resolve, reject) => {
|
||||||
ElMessageBox.confirm(
|
ElMessageBox.confirm(
|
||||||
this.t('flowCanvas.deleteCardConfirm'),
|
t('flowCanvas.deleteCardConfirm'),
|
||||||
'',
|
'',
|
||||||
{
|
{
|
||||||
confirmButtonText: this.t('flowCanvas.confirm'),
|
confirmButtonText: t('flowCanvas.confirm'),
|
||||||
cancelButtonText: this.t('flowCanvas.cancel'),
|
cancelButtonText: t('flowCanvas.cancel'),
|
||||||
}
|
}
|
||||||
).then(() => {
|
).then(() => {
|
||||||
resolve(true)
|
resolve(true)
|
||||||
|
|||||||
Reference in New Issue
Block a user