111
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { ref, computed } from "vue";
|
||||
import { NODE_TYPE } from '../tools/index.d'
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import i18n from '@/lang'
|
||||
const t = i18n.global.t
|
||||
|
||||
export interface NodesItem {
|
||||
id: string
|
||||
@@ -34,7 +35,6 @@ export class StateManager {
|
||||
flowManager: any
|
||||
nodeManager: any
|
||||
toolManager: any
|
||||
t: any
|
||||
// 设置管理器
|
||||
setManager(options) {
|
||||
options.eventManager && (this.eventManager = options.eventManager)
|
||||
@@ -94,8 +94,6 @@ export class StateManager {
|
||||
return arr
|
||||
})
|
||||
|
||||
this.t = useI18n().t
|
||||
|
||||
}
|
||||
/** 设置激活节点 */
|
||||
setActiveNodeID(id: string) { this.activeNodeID.value = id }
|
||||
@@ -105,16 +103,16 @@ export class StateManager {
|
||||
this.recordState()
|
||||
}
|
||||
/** 删除节点 */
|
||||
async deleteNode(id: string,{ isElMessageBox } = { isElMessageBox: false }) {
|
||||
let deletePromise:any = true
|
||||
if (isElMessageBox){
|
||||
async deleteNode(id: string, { isElMessageBox } = { isElMessageBox: false }) {
|
||||
let deletePromise: any = true
|
||||
if (isElMessageBox) {
|
||||
deletePromise = await new Promise<void>((resolve, reject) => {
|
||||
ElMessageBox.confirm(
|
||||
this.t('flowCanvas.deleteCardConfirm'),
|
||||
t('flowCanvas.deleteCardConfirm'),
|
||||
'',
|
||||
{
|
||||
confirmButtonText: this.t('flowCanvas.confirm'),
|
||||
cancelButtonText: this.t('flowCanvas.cancel'),
|
||||
confirmButtonText: t('flowCanvas.confirm'),
|
||||
cancelButtonText: t('flowCanvas.cancel'),
|
||||
}
|
||||
).then(() => {
|
||||
resolve(true)
|
||||
|
||||
Reference in New Issue
Block a user