refactor(测试跟踪): 去掉全量导出用例选项

This commit is contained in:
chenjianxing 2023-03-15 16:46:59 +08:00 committed by jianxing
parent a213eeff50
commit c076a5ab3d
7 changed files with 23 additions and 134 deletions

View File

@ -22,22 +22,6 @@
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-dropdown @command="handleExportCommand" placement="bottom-start" style="margin-left: 12px" class="btn-dropdown">
<el-button size="small" v-permission="['PROJECT_TRACK_CASE:READ+EXPORT']">
<svg-icon icon-class="icon_download_outlined"/>
{{$t('commons.export')}}
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="excel">
<span class="export-model">{{$t('test_track.case.export.export_to_excel')}}</span>
<span class="export-tips">{{$t('test_track.case.export.export_to_excel_tips')}}</span>
</el-dropdown-item>
<el-dropdown-item style="margin-top: 10px" command="xmind" divided>
<span class="export-model">{{$t('test_track.case.export.export_to_xmind')}}</span>
<span class="export-tips">{{$t('test_track.case.export.export_to_xmind_tips')}}</span>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<!-- public, trash back header -->
@ -55,10 +39,8 @@
:show-operator="false"
:public-total="publicTotal"
:case-condition="condition"
@handleExportCheck="handleExportCheck"
@refreshTable="refresh"
@setTreeNodes="setTreeNodes"
@exportTestCase="exportTestCase"
@refreshAll="refreshAll"
@enableTrash="enableTrash"
@enablePublic="enablePublic"
@ -108,7 +90,6 @@
:public-enable="false"
:current-version="currentVersion"
:version-enable.sync="versionEnable"
@closeExport="closeExport"
@refreshTable="refresh"
@getTrashList="getTrashList"
@getPublicList="getPublicList"
@ -117,7 +98,6 @@
@setCondition="setCondition"
@decrease="decrease"
@search="refreshTreeByCaseFilter"
@openExcelExport="openExportDialog"
ref="testCaseList">
</test-case-list>
<test-case-minder
@ -172,16 +152,12 @@
</ms-main-container>
</div>
<!-- dialog -->
<!-- export case -->
<test-case-export-to-excel @exportTestCase="exportTestCase" ref="exportExcel" class="export-case-layout"/>
<!-- import case -->
<test-case-common-import-new ref="caseImport" @refreshAll="refreshAll"/>
</ms-container>
</template>
<script>
import TestCaseExportToExcel from "@/business/case/components/export/TestCaseExportToExcel";
import TestCaseCommonImportNew from "@/business/case/components/import/TestCaseCommonImportNew";
import TestCaseList from "./components/TestCaseList";
import SelectMenu from "../common/SelectMenu";
@ -215,7 +191,7 @@ export default {
components: {
PublicTestCaseList, TestCaseTrashNodeTree, TestCasePublicNodeTree, IsChangeConfirm, TestCaseMinder, MsTabButton, TestCaseNodeTree,
MsMainContainer, MsAsideContainer, MsContainer, TestCaseList, SelectMenu, TestCaseEditShow, 'VersionSelect': MxVersionSelect,
MsMainButtonGroup, TestCaseExportToExcel, TestCaseCommonImportNew
MsMainButtonGroup, TestCaseCommonImportNew
},
comments: {},
data() {
@ -364,22 +340,6 @@ export default {
break;
}
},
handleExportCommand(e) {
switch (e) {
case "excel":
this.openExportDialog(0, true)
break;
case "xmind":
if (store.isTestCaseExporting) {
return;
}
this.exportTestCase(e, {exportAll: true})
break;
}
},
openExportDialog(size, isExportAll) {
this.$refs.exportExcel.open(size, isExportAll);
},
getTrashList() {
testCaseNodeTrashCount(this.projectId)
.then(response => {
@ -438,21 +398,6 @@ export default {
}
return true;
},
handleExportCheck() {
if (this.$refs.testCaseList.checkSelected()) {
this.$refs.nodeTree.openExport();
}
},
exportTestCase(type, param) {
if (this.activeDom !== 'left') {
this.$warning(this.$t('test_track.case.export.xmind_export_tip'), false);
return;
}
this.$refs.testCaseList.exportTestCase(type, param);
},
closeExport() {
this.$refs.nodeTree.closeExport();
},
publicNodeChange(node, nodeIds, pNodes) {
if (this.$refs.testCasePublicList) {
this.$refs.testCasePublicList.initTableData(nodeIds);
@ -737,7 +682,6 @@ export default {
position: relative;
top: -5px;
}
.edit-layout :deep(.el-button--small span){
font-family: 'PingFang SC';
font-style: normal;

View File

@ -861,19 +861,6 @@ export default {
});
}
},
back() {
if (this.editable) {
this.$confirm(this.$t('case.back_tips'), this.$t('commons.prompt'), {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.$router.push('/track/case/all');
});
} else {
this.$router.push('/track/case/all');
}
},
openNewTab() {
if (this.editable || !this.form.id || this.isPublicShow) {
return;

View File

@ -237,6 +237,9 @@
<!-- 删除接口提示 -->
<list-item-delete-confirm ref="apiDeleteConfirm" @handleDelete="_handleDeleteVersion"/>
<test-case-export-to-excel @exportTestCase="exportTestCase" ref="exportExcel" class="export-case-layout"/>
</div>
</template>
@ -312,12 +315,14 @@ import {
getProjectMemberOption
} from "@/business/utils/sdk-utils";
import {getTagToolTips, initTestCaseConditionComponents, openCaseEdit, parseColumnTag} from "@/business/case/test-case";
import TestCaseExportToExcel from "@/business/case/components/export/TestCaseExportToExcel";
const store = useStore();
export default {
name: "TestCaseList",
components: {
TestCaseExportToExcel,
TestPlanCaseStatusTableItem, RelateDemand, TestCaseReviewStatusTableItem,
MsCreateTimeColumn, MsUpdateTimeColumn, MsNewUiSearch,
ListItemDeleteConfirm,
@ -1031,7 +1036,6 @@ export default {
}
this.$refs.testCaseImport.open();
},
exportTestCase(exportType, fieldParam) {
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
@ -1132,7 +1136,7 @@ export default {
});
},
handleBatchExportToExcel() {
this.$emit("openExcelExport", this.selectCounts, false);
this.$refs.exportExcel.open(this.selectCounts, false);
},
handleBatchExportToXmind() {
this.exportTestCase("xmind", {exportAll: false})
@ -1250,6 +1254,16 @@ span.version-select {
width: 140px!important;
}
.export-case-layout :deep(.el-button--small span) {
font-family: 'PingFang SC';
font-style: normal;
font-weight: 400;
font-size: 14px;
line-height: 22px;
position: relative;
top: -5px;
}
:deep(button.el-button.el-button--default.el-button--mini) {
box-sizing: border-box;
width: 32px;

View File

@ -493,7 +493,7 @@ export default {
this._save(reset);
}
},
buildPram() {
buildParam() {
let param = {};
Object.assign(param, this.form);
param.projectId = this.projectId;
@ -537,7 +537,7 @@ export default {
return param;
},
_save(reset) {
let param = this.buildPram();
let param = this.buildParam();
this.parseOldFields(param);
let option = this.getOption(param);
saveOrUpdateIssue(option.url, option.data).then((response) => {

View File

@ -5,6 +5,7 @@
:visible.sync="dialogVisible"
width="40%"
custom-class="export-dialog"
append-to-body
@close="close">
<span class="select-row">{{!exportAll ? $t('test_track.batch_operate_select_row_count', [size]) : $t('test_track.select_all_row')}}</span>
<test-case-export-field-select-table
@ -36,7 +37,7 @@ import {useStore} from "@/store";
import {mapState} from "pinia";
const store = useStore();
export default {
name: "TestCaseImport",
name: "TestCaseExportToExcel",
components: {TestCaseExportFieldSelectTable, ElUploadList, MsTableButton},
data() {
return {

View File

@ -527,7 +527,7 @@ export default {
this._save();
}
},
buildPram() {
buildParam() {
let param = {};
Object.assign(param, this.form);
param.projectId = this.projectId;
@ -574,7 +574,7 @@ export default {
return param;
},
_save() {
let param = this.buildPram();
let param = this.buildParam();
this.parseOldFields(param);
let option = this.getOption(param);
this.result.loading = true;

View File

@ -21,10 +21,6 @@
@filter="filter"
ref="nodeTree">
<template v-slot:header>
<ms-search-bar
:show-operator="showOperator"
:condition="condition"
:commands="operators"/>
<module-public-button
v-if="showPublicBtn"
:condition="condition"
@ -50,7 +46,6 @@
import MsNodeTree from "metersphere-frontend/src/components/new-ui/MsNodeTree";
import TestCaseCreate from "@/business/case/components/TestCaseCreate";
import TestCaseImport from "@/business/case/components/import/TestCaseImport";
import TestCaseExport from "@/business/case/components/export/TestCaseExport";
import MsSearchBar from "metersphere-frontend/src/components/new-ui/MsSearchBar";
import {buildTree, buildNodePath} from "metersphere-frontend/src/model/NodeTree";
import {getCurrentProjectID} from "metersphere-frontend/src/utils/token";
@ -74,7 +69,6 @@ export default {
IsChangeConfirm,
MsSearchBar,
TestCaseImport,
TestCaseExport,
TestCaseCreate,
MsNodeTree,
ModuleTrashButton,
@ -93,23 +87,6 @@ export default {
trashEnable: false,
publicEnable: false
},
operators: [
{
label: this.$t('test_track.case.create'),
callback: this.addTestCase,
permissions: ['PROJECT_TRACK_CASE:READ+CREATE']
},
{
label: this.$t('api_test.api_import.label'),
callback: this.handleImport,
permissions: ['PROJECT_TRACK_CASE:READ+IMPORT']
},
{
label: this.$t('api_test.export_config'),
callback: this.handleExport,
permissions: ['PROJECT_TRACK_CASE:READ+EXPORT']
}
],
currentNode: {}
};
},
@ -158,13 +135,6 @@ export default {
}
},
methods: {
addTestCase() {
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
return;
}
this.$refs.testCaseCreate.open(this.currentModule)
},
filter() {
this.$refs.nodeTree.filter(this.condition.filterText);
},
@ -277,28 +247,6 @@ export default {
this.list();
});
},
handleImport() {
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
return;
}
if (!this.openMinderConfirm()) {
this.$refs.testCaseImport.open();
}
},
handleExport() {
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
return;
}
this.$emit('handleExportCheck')
},
openExport() {
this.$refs.testCaseExport.open();
},
exportTestCase(type, param) {
this.$emit('exportTestCase', type, param);
},
remove(nodeIds) {
testCaseNodeDelete(nodeIds)
.then(() => {
@ -370,11 +318,6 @@ export default {
},
changeConfirm(isSave) {
this.$emit('importChangeConfirm', isSave);
},
closeExport() {
if (this.$refs.testCaseExport) {
this.$refs.testCaseExport.close();
}
}
}
};