refactor(测试跟踪): 导入用例前提示保存脑图

--bug=1013915 --user=陈建星 【测试跟踪】脑图模式下,导入xmind用例页面没有刷新 https://www.tapd.cn/55049933/s/1178369
This commit is contained in:
chenjianxing 2022-06-10 11:04:05 +08:00 committed by jianxing
parent f2bd7664cc
commit c339a73c15
11 changed files with 63 additions and 12 deletions

View File

@ -27,7 +27,20 @@ export default {
}
}
},
props: ['title','tip', 'versionEnable'],
props: {
title: {
type: String,
default() {
return this.$t('test_track.case.minder_save_confirm_title');
}
},
tip: {
type: String,
default() {
return this.$t('test_track.case.minder_save_confirm_tip');
}
}
},
methods: {
open(item, temWorkspaceId) {
this.visible = true;

View File

@ -20,8 +20,6 @@
@save="save"
/>
<is-change-confirm
:title="'请保存脑图'"
:tip="'脑图未保存,确认保存脑图吗?'"
@confirm="changeConfirm"
ref="isChangeConfirm"/>
</div>

View File

@ -18,6 +18,7 @@
:total='total'
:public-total="publicTotal"
ref="nodeTree"
@importChangeConfirm="importChangeConfirm"
/>
</ms-aside-container>
@ -187,8 +188,6 @@
</el-tabs>
<is-change-confirm
:title="'请保存脑图'"
:tip="'脑图未保存,确认保存脑图吗?'"
@confirm="changeConfirm"
ref="isChangeConfirm"/>
</ms-main-container>
@ -385,6 +384,16 @@ export default {
updateActiveDom(activeDom) {
openMinderConfirm(this, activeDom);
},
importChangeConfirm(isSave) {
this.$store.commit('setIsTestCaseMinderChanged', false);
if (isSave) {
this.$refs.minder.save(() => {
this.$refs.nodeTree.handleImport();
});
} else {
this.$refs.nodeTree.handleImport();
}
},
changeConfirm(isSave, temWorkspaceId) {
if (isSave) {
this.$refs.minder.save(() => {
@ -681,6 +690,9 @@ export default {
if (this.$refs.testCaseList) {
this.$refs.testCaseList.initTableData();
}
if (this.$refs.minder) {
this.$refs.minder.initData();
}
this.$refs.nodeTree.list();
this.setTable(data);
},

View File

@ -46,6 +46,12 @@
@createCase="createCase"
@refresh="refresh"
ref="testCaseCreate"/>
<is-change-confirm
:tip="$t('test_track.case.minder_import_save_confirm_tip')"
@confirm="changeConfirm"
ref="isChangeConfirm"/>
</div>
</template>
@ -63,10 +69,12 @@ import {getCurrentProjectID} from "@/common/js/utils";
import ModuleTrashButton from "@/business/components/api/definition/components/module/ModuleTrashButton";
import ModulePublicButton from "@/business/components/api/definition/components/module/ModulePublicButton";
import {getTestCaseNodes} from "@/network/testCase";
import IsChangeConfirm from "@/business/components/common/components/IsChangeConfirm";
export default {
name: "TestCaseNodeTree",
components: {
IsChangeConfirm,
MsSearchBar,
TestCaseImport,
TestCaseExport,
@ -223,7 +231,9 @@ export default {
this.$warning(this.$t('commons.check_project_tip'));
return;
}
this.$refs.testCaseImport.open();
if (!this.openMinderConfirm()) {
this.$refs.testCaseImport.open();
}
},
handleExport() {
if (!this.projectId) {
@ -274,6 +284,16 @@ export default {
this.$emit("nodeSelectEvent", node, nodeIds, pNodes);
}
},
openMinderConfirm() {
let isTestCaseMinderChanged = this.$store.state.isTestCaseMinderChanged;
if (isTestCaseMinderChanged) {
this.$refs.isChangeConfirm.open();
}
return isTestCaseMinderChanged;
},
changeConfirm(isSave) {
this.$emit('importChangeConfirm', isSave);
}
}
};
</script>

View File

@ -136,6 +136,9 @@ name: "TestCaseMinder",
}
},
methods: {
initData() {
this.$refs.minder.initData();
},
getMinderTreeExtraNodeCount() {
return getMinderTreeExtraNodeCount;
},

View File

@ -30,8 +30,6 @@
<test-plan-report-content class="plan-report" v-if="activeIndex === 'report'" :plan-id="planId" :version-enable="versionEnable"/>
<is-change-confirm
:title="'请保存脑图'"
:tip="'脑图未保存,确认保存脑图吗?'"
@confirm="changeConfirm"
ref="isChangeConfirm"/>

View File

@ -49,8 +49,6 @@
ref="testCaseRelevance"/>
<is-change-confirm
:title="'请保存脑图'"
:tip="'脑图未保存,确认保存脑图吗?'"
@confirm="changeConfirm"
ref="isChangeConfirm"/>
</ms-test-plan-common-component>

View File

@ -47,8 +47,6 @@
ref="testReviewRelevance"/>
<is-change-confirm
:title="'请保存脑图'"
:tip="'脑图未保存,确认保存脑图吗?'"
:version-enable="versionEnable"
@confirm="changeConfirm"
ref="isChangeConfirm"/>

View File

@ -2018,6 +2018,9 @@ export default {
minder_is_module_tip: "{0} is a module and cannot be modified as a use ca",
minder_not_module_tip: "Module {0}, cannot be created under a non-module node",
minder_all_module_tip: 'All case are virtual modules. Please create use cases in other modules',
minder_save_confirm_title: 'Please save the minder',
minder_save_confirm_tip: 'The minder is not saved. Are you sure to save?',
minder_import_save_confirm_tip: 'Will the minder be refreshed after successful import and confirm to save minder?',
input_test_case: 'Please enter the associated case name',
test_name: 'TestName',
other: '--Other--',

View File

@ -2016,6 +2016,11 @@ export default {
minder_not_module_tip: "模块{0},不能创建在非模块节点下",
minder_all_module_tip: "全部用例为虚拟模块,请在其他模块创建用例",
minder_issue_delete_tip: "取消缺陷关联成功",
minder_save_confirm_title: '请保存脑图',
minder_save_confirm_tip: '脑图未保存,确认保存脑图吗?',
minder_import_save_confirm_tip: '导入成功后会刷新脑图,确认保存脑图吗?',
check_select: "请勾选用例",
export_all_cases: '确定要导出全部用例吗?',
input_test_case: '请输入关联用例名称',

View File

@ -2016,6 +2016,9 @@ export default {
minder_not_module_tip: "模塊{0},不能創建在非模塊節點下",
minder_all_module_tip: "全部用例為虛擬模塊,請在其他模塊創建用例",
minder_issue_delete_tip: "取消缺陷關聯成功",
minder_save_confirm_title: '請保存腦圖',
minder_save_confirm_tip: '腦圖未保存,確認保存腦圖嗎?',
minder_import_save_confirm_tip: '導入成功後會刷新腦圖,確認保存腦圖嗎?',
check_select: "請勾選用例",
export_all_cases: '確定要導出全部用例嗎?',
input_test_case: '請輸入關聯用例名稱',