fix(用例管理&测试计划): 修复用例管理删除节点默认选中问题
This commit is contained in:
parent
bff79b1868
commit
75f0d83ac8
|
@ -123,7 +123,14 @@
|
||||||
groupKeyword: string; // 搜索关键字
|
groupKeyword: string; // 搜索关键字
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emits = defineEmits(['update:selectedKeys', 'caseNodeSelect', 'init', 'dragUpdate', 'update:groupKeyword']);
|
const emits = defineEmits([
|
||||||
|
'update:selectedKeys',
|
||||||
|
'caseNodeSelect',
|
||||||
|
'init',
|
||||||
|
'dragUpdate',
|
||||||
|
'update:groupKeyword',
|
||||||
|
'deleteNode',
|
||||||
|
]);
|
||||||
|
|
||||||
const currentProjectId = computed(() => appStore.currentProjectId);
|
const currentProjectId = computed(() => appStore.currentProjectId);
|
||||||
|
|
||||||
|
@ -220,12 +227,14 @@
|
||||||
onBeforeOk: async () => {
|
onBeforeOk: async () => {
|
||||||
try {
|
try {
|
||||||
await deleteCaseModuleTree(node.id);
|
await deleteCaseModuleTree(node.id);
|
||||||
|
initModules();
|
||||||
|
if (selectedNodeKeys.value[0] === node.id) {
|
||||||
|
selectedNodeKeys.value = ['all'];
|
||||||
|
emits('update:selectedKeys', selectedNodeKeys.value);
|
||||||
|
emits('caseNodeSelect', selectedNodeKeys.value, []);
|
||||||
|
}
|
||||||
|
emits('deleteNode');
|
||||||
Message.success(t('caseManagement.featureCase.deleteSuccess'));
|
Message.success(t('caseManagement.featureCase.deleteSuccess'));
|
||||||
emits(
|
|
||||||
'init',
|
|
||||||
caseTree.value.map((e) => e.name),
|
|
||||||
true
|
|
||||||
);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,6 +101,7 @@
|
||||||
@case-node-select="caseNodeSelect"
|
@case-node-select="caseNodeSelect"
|
||||||
@init="setRootModules"
|
@init="setRootModules"
|
||||||
@drag-update="dragUpdate"
|
@drag-update="dragUpdate"
|
||||||
|
@delete-node="deleteNode"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -275,12 +276,8 @@
|
||||||
* 设置根模块名称列表
|
* 设置根模块名称列表
|
||||||
* @param names 根模块名称列表
|
* @param names 根模块名称列表
|
||||||
*/
|
*/
|
||||||
function setRootModules(names: string[], isDelete = false) {
|
function setRootModules(names: string[]) {
|
||||||
rootModulesName.value = names;
|
rootModulesName.value = names;
|
||||||
if (isDelete) {
|
|
||||||
caseTreeRef.value?.initModules(true);
|
|
||||||
caseTableRef.value?.initData();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表格搜索参数
|
// 表格搜索参数
|
||||||
|
@ -445,6 +442,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function deleteNode() {
|
||||||
|
caseTableRef.value.initData();
|
||||||
|
}
|
||||||
|
|
||||||
function dragUpdate() {
|
function dragUpdate() {
|
||||||
caseTableRef.value.emitTableParams();
|
caseTableRef.value.emitTableParams();
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,6 +123,7 @@
|
||||||
'dragUpdate',
|
'dragUpdate',
|
||||||
'getNodeName',
|
'getNodeName',
|
||||||
'update:groupKeyword',
|
'update:groupKeyword',
|
||||||
|
'deleteNode',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const currentProjectId = computed(() => appStore.currentProjectId);
|
const currentProjectId = computed(() => appStore.currentProjectId);
|
||||||
|
@ -206,8 +207,14 @@
|
||||||
onBeforeOk: async () => {
|
onBeforeOk: async () => {
|
||||||
try {
|
try {
|
||||||
await deletePlanModuleTree(node.id);
|
await deletePlanModuleTree(node.id);
|
||||||
|
initModules();
|
||||||
|
if (selectedNodeKeys.value[0] === node.id) {
|
||||||
|
selectedNodeKeys.value = ['all'];
|
||||||
|
emits('update:selectedKeys', selectedNodeKeys.value);
|
||||||
|
emits('planTreeNodeSelect', selectedNodeKeys.value, []);
|
||||||
|
}
|
||||||
|
emits('deleteNode');
|
||||||
Message.success(t('common.deleteSuccess'));
|
Message.success(t('common.deleteSuccess'));
|
||||||
initModules(true);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,6 +74,7 @@
|
||||||
@plan-tree-node-select="planNodeSelect"
|
@plan-tree-node-select="planNodeSelect"
|
||||||
@init="setRootModules"
|
@init="setRootModules"
|
||||||
@drag-update="dragUpdate"
|
@drag-update="dragUpdate"
|
||||||
|
@delete-node="deleteNode"
|
||||||
></TestPlanTree>
|
></TestPlanTree>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -272,6 +273,10 @@
|
||||||
planTableRef.value?.emitTableParams();
|
planTableRef.value?.emitTableParams();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function deleteNode() {
|
||||||
|
planTableRef.value?.fetchData();
|
||||||
|
}
|
||||||
|
|
||||||
function createTestPlan(type: string) {
|
function createTestPlan(type: string) {
|
||||||
if (type === 'group') {
|
if (type === 'group') {
|
||||||
showPlanGroupModel.value = true;
|
showPlanGroupModel.value = true;
|
||||||
|
|
Loading…
Reference in New Issue