This commit is contained in:
X1627315083@163.com
2026-03-24 15:34:07 +08:00
parent dd4b67c898
commit 0bebb58645
5 changed files with 11 additions and 7 deletions

View File

@@ -93,7 +93,7 @@ export class StateManager {
this.nodes.value.forEach((node, index) => {
const superiorID = node.data.superiorID;
const isSuperior = this.nodes.value.some((v) => v.id === superiorID)
if (superiorID && isSuperior) {
if (isSuperior) {
const source = node.data.superiorID
const target = node.id
arr.push({
@@ -101,7 +101,7 @@ export class StateManager {
source: source,
target: target,
selectable: false,
visible: (node.data.isActive),
visible: (node.data.type == NODE_DATATYPE.RESULT_IMAGE && node.data.isActive) || node.data.type !== NODE_DATATYPE.RESULT_IMAGE,
type: 'default'
})
}
@@ -148,6 +148,7 @@ export class StateManager {
if (node.data.disableDelete) return ElMessage.error(t('flowCanvas.initialNodeProhibited'))
const result = [node]
const findChildren = (parentId: string) => {
const children = this.nodes.value.filter(item => item.data.superiorID === parentId)
children.forEach(child => {
@@ -157,11 +158,12 @@ export class StateManager {
findChildren(child.id)
})
}
findChildren(id)
let deletePromise: any = true
if (isElMessageBox && result.length > 1) {
if (isElMessageBox) {
deletePromise = await new Promise<void>((resolve, reject) => {
ElMessageBox.confirm(
t('flowCanvas.deleteSubordinateCard'),
result.length > 1 ? t('flowCanvas.deleteSubordinateCard') : t('flowCanvas.deleteCardConfirm'),
'',
{
confirmButtonText: t('flowCanvas.confirm'),