|
|
|
@ -164,7 +164,11 @@
@@ -164,7 +164,11 @@
|
|
|
|
|
state.templateObjs = state.templateObjs.filter(item => (item.index || item.id) != targetKey); |
|
|
|
|
// 当前选择需要删除的tab时候设置自动选择上一个tab |
|
|
|
|
if (state.typeActiveKey == '0') { |
|
|
|
|
if (mainTemplateObjs.value.length && state.mainActiveKey === targetKey) { |
|
|
|
|
if (!mainTemplateObjs.value.length) { |
|
|
|
|
state.mainActiveKey = ''; |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (state.mainActiveKey === targetKey) { |
|
|
|
|
if (lastIndex >= 0) { |
|
|
|
|
const mainTemplate = mainTemplateObjs.value[lastIndex]; |
|
|
|
|
state.mainActiveKey = (mainTemplate.index || mainTemplate.id)!; |
|
|
|
@ -174,7 +178,11 @@
@@ -174,7 +178,11 @@
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if (childTemplateObjs.value.length && state.childActiveKey === targetKey) { |
|
|
|
|
if (!childTemplateObjs.value.length) { |
|
|
|
|
state.childActiveKey = ''; |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (state.childActiveKey === targetKey) { |
|
|
|
|
if (lastIndex >= 0) { |
|
|
|
|
const childTemplate = childTemplateObjs.value[lastIndex]; |
|
|
|
|
state.childActiveKey = (childTemplate.index || childTemplate.id)!; |
|
|
|
@ -191,6 +199,7 @@
@@ -191,6 +199,7 @@
|
|
|
|
|
const template: templateTypePartial = { |
|
|
|
|
name, |
|
|
|
|
contents: '', |
|
|
|
|
defaultContents: '', |
|
|
|
|
isChild: state.typeActiveKey, |
|
|
|
|
index: `t${Date.now()}` |
|
|
|
|
}; |
|
|
|
|