refactor(测试跟踪): 去掉全量导出用例选项
This commit is contained in:
parent
a213eeff50
commit
c076a5ab3d
|
@ -22,22 +22,6 @@
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</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>
|
</div>
|
||||||
|
|
||||||
<!-- public, trash back header -->
|
<!-- public, trash back header -->
|
||||||
|
@ -55,10 +39,8 @@
|
||||||
:show-operator="false"
|
:show-operator="false"
|
||||||
:public-total="publicTotal"
|
:public-total="publicTotal"
|
||||||
:case-condition="condition"
|
:case-condition="condition"
|
||||||
@handleExportCheck="handleExportCheck"
|
|
||||||
@refreshTable="refresh"
|
@refreshTable="refresh"
|
||||||
@setTreeNodes="setTreeNodes"
|
@setTreeNodes="setTreeNodes"
|
||||||
@exportTestCase="exportTestCase"
|
|
||||||
@refreshAll="refreshAll"
|
@refreshAll="refreshAll"
|
||||||
@enableTrash="enableTrash"
|
@enableTrash="enableTrash"
|
||||||
@enablePublic="enablePublic"
|
@enablePublic="enablePublic"
|
||||||
|
@ -108,7 +90,6 @@
|
||||||
:public-enable="false"
|
:public-enable="false"
|
||||||
:current-version="currentVersion"
|
:current-version="currentVersion"
|
||||||
:version-enable.sync="versionEnable"
|
:version-enable.sync="versionEnable"
|
||||||
@closeExport="closeExport"
|
|
||||||
@refreshTable="refresh"
|
@refreshTable="refresh"
|
||||||
@getTrashList="getTrashList"
|
@getTrashList="getTrashList"
|
||||||
@getPublicList="getPublicList"
|
@getPublicList="getPublicList"
|
||||||
|
@ -117,7 +98,6 @@
|
||||||
@setCondition="setCondition"
|
@setCondition="setCondition"
|
||||||
@decrease="decrease"
|
@decrease="decrease"
|
||||||
@search="refreshTreeByCaseFilter"
|
@search="refreshTreeByCaseFilter"
|
||||||
@openExcelExport="openExportDialog"
|
|
||||||
ref="testCaseList">
|
ref="testCaseList">
|
||||||
</test-case-list>
|
</test-case-list>
|
||||||
<test-case-minder
|
<test-case-minder
|
||||||
|
@ -172,16 +152,12 @@
|
||||||
</ms-main-container>
|
</ms-main-container>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- dialog -->
|
|
||||||
<!-- export case -->
|
|
||||||
<test-case-export-to-excel @exportTestCase="exportTestCase" ref="exportExcel" class="export-case-layout"/>
|
|
||||||
<!-- import case -->
|
<!-- import case -->
|
||||||
<test-case-common-import-new ref="caseImport" @refreshAll="refreshAll"/>
|
<test-case-common-import-new ref="caseImport" @refreshAll="refreshAll"/>
|
||||||
</ms-container>
|
</ms-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import TestCaseExportToExcel from "@/business/case/components/export/TestCaseExportToExcel";
|
|
||||||
import TestCaseCommonImportNew from "@/business/case/components/import/TestCaseCommonImportNew";
|
import TestCaseCommonImportNew from "@/business/case/components/import/TestCaseCommonImportNew";
|
||||||
import TestCaseList from "./components/TestCaseList";
|
import TestCaseList from "./components/TestCaseList";
|
||||||
import SelectMenu from "../common/SelectMenu";
|
import SelectMenu from "../common/SelectMenu";
|
||||||
|
@ -215,7 +191,7 @@ export default {
|
||||||
components: {
|
components: {
|
||||||
PublicTestCaseList, TestCaseTrashNodeTree, TestCasePublicNodeTree, IsChangeConfirm, TestCaseMinder, MsTabButton, TestCaseNodeTree,
|
PublicTestCaseList, TestCaseTrashNodeTree, TestCasePublicNodeTree, IsChangeConfirm, TestCaseMinder, MsTabButton, TestCaseNodeTree,
|
||||||
MsMainContainer, MsAsideContainer, MsContainer, TestCaseList, SelectMenu, TestCaseEditShow, 'VersionSelect': MxVersionSelect,
|
MsMainContainer, MsAsideContainer, MsContainer, TestCaseList, SelectMenu, TestCaseEditShow, 'VersionSelect': MxVersionSelect,
|
||||||
MsMainButtonGroup, TestCaseExportToExcel, TestCaseCommonImportNew
|
MsMainButtonGroup, TestCaseCommonImportNew
|
||||||
},
|
},
|
||||||
comments: {},
|
comments: {},
|
||||||
data() {
|
data() {
|
||||||
|
@ -364,22 +340,6 @@ export default {
|
||||||
break;
|
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() {
|
getTrashList() {
|
||||||
testCaseNodeTrashCount(this.projectId)
|
testCaseNodeTrashCount(this.projectId)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
|
@ -438,21 +398,6 @@ export default {
|
||||||
}
|
}
|
||||||
return true;
|
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) {
|
publicNodeChange(node, nodeIds, pNodes) {
|
||||||
if (this.$refs.testCasePublicList) {
|
if (this.$refs.testCasePublicList) {
|
||||||
this.$refs.testCasePublicList.initTableData(nodeIds);
|
this.$refs.testCasePublicList.initTableData(nodeIds);
|
||||||
|
@ -737,7 +682,6 @@ export default {
|
||||||
position: relative;
|
position: relative;
|
||||||
top: -5px;
|
top: -5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.edit-layout :deep(.el-button--small span){
|
.edit-layout :deep(.el-button--small span){
|
||||||
font-family: 'PingFang SC';
|
font-family: 'PingFang SC';
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
|
|
|
@ -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() {
|
openNewTab() {
|
||||||
if (this.editable || !this.form.id || this.isPublicShow) {
|
if (this.editable || !this.form.id || this.isPublicShow) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -237,6 +237,9 @@
|
||||||
|
|
||||||
<!-- 删除接口提示 -->
|
<!-- 删除接口提示 -->
|
||||||
<list-item-delete-confirm ref="apiDeleteConfirm" @handleDelete="_handleDeleteVersion"/>
|
<list-item-delete-confirm ref="apiDeleteConfirm" @handleDelete="_handleDeleteVersion"/>
|
||||||
|
|
||||||
|
<test-case-export-to-excel @exportTestCase="exportTestCase" ref="exportExcel" class="export-case-layout"/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
@ -312,12 +315,14 @@ import {
|
||||||
getProjectMemberOption
|
getProjectMemberOption
|
||||||
} from "@/business/utils/sdk-utils";
|
} from "@/business/utils/sdk-utils";
|
||||||
import {getTagToolTips, initTestCaseConditionComponents, openCaseEdit, parseColumnTag} from "@/business/case/test-case";
|
import {getTagToolTips, initTestCaseConditionComponents, openCaseEdit, parseColumnTag} from "@/business/case/test-case";
|
||||||
|
import TestCaseExportToExcel from "@/business/case/components/export/TestCaseExportToExcel";
|
||||||
|
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TestCaseList",
|
name: "TestCaseList",
|
||||||
components: {
|
components: {
|
||||||
|
TestCaseExportToExcel,
|
||||||
TestPlanCaseStatusTableItem, RelateDemand, TestCaseReviewStatusTableItem,
|
TestPlanCaseStatusTableItem, RelateDemand, TestCaseReviewStatusTableItem,
|
||||||
MsCreateTimeColumn, MsUpdateTimeColumn, MsNewUiSearch,
|
MsCreateTimeColumn, MsUpdateTimeColumn, MsNewUiSearch,
|
||||||
ListItemDeleteConfirm,
|
ListItemDeleteConfirm,
|
||||||
|
@ -1031,7 +1036,6 @@ export default {
|
||||||
}
|
}
|
||||||
this.$refs.testCaseImport.open();
|
this.$refs.testCaseImport.open();
|
||||||
},
|
},
|
||||||
|
|
||||||
exportTestCase(exportType, fieldParam) {
|
exportTestCase(exportType, fieldParam) {
|
||||||
if (!this.projectId) {
|
if (!this.projectId) {
|
||||||
this.$warning(this.$t('commons.check_project_tip'));
|
this.$warning(this.$t('commons.check_project_tip'));
|
||||||
|
@ -1132,7 +1136,7 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleBatchExportToExcel() {
|
handleBatchExportToExcel() {
|
||||||
this.$emit("openExcelExport", this.selectCounts, false);
|
this.$refs.exportExcel.open(this.selectCounts, false);
|
||||||
},
|
},
|
||||||
handleBatchExportToXmind() {
|
handleBatchExportToXmind() {
|
||||||
this.exportTestCase("xmind", {exportAll: false})
|
this.exportTestCase("xmind", {exportAll: false})
|
||||||
|
@ -1250,6 +1254,16 @@ span.version-select {
|
||||||
width: 140px!important;
|
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) {
|
:deep(button.el-button.el-button--default.el-button--mini) {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
width: 32px;
|
width: 32px;
|
||||||
|
|
|
@ -493,7 +493,7 @@ export default {
|
||||||
this._save(reset);
|
this._save(reset);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
buildPram() {
|
buildParam() {
|
||||||
let param = {};
|
let param = {};
|
||||||
Object.assign(param, this.form);
|
Object.assign(param, this.form);
|
||||||
param.projectId = this.projectId;
|
param.projectId = this.projectId;
|
||||||
|
@ -537,7 +537,7 @@ export default {
|
||||||
return param;
|
return param;
|
||||||
},
|
},
|
||||||
_save(reset) {
|
_save(reset) {
|
||||||
let param = this.buildPram();
|
let param = this.buildParam();
|
||||||
this.parseOldFields(param);
|
this.parseOldFields(param);
|
||||||
let option = this.getOption(param);
|
let option = this.getOption(param);
|
||||||
saveOrUpdateIssue(option.url, option.data).then((response) => {
|
saveOrUpdateIssue(option.url, option.data).then((response) => {
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
:visible.sync="dialogVisible"
|
:visible.sync="dialogVisible"
|
||||||
width="40%"
|
width="40%"
|
||||||
custom-class="export-dialog"
|
custom-class="export-dialog"
|
||||||
|
append-to-body
|
||||||
@close="close">
|
@close="close">
|
||||||
<span class="select-row">{{!exportAll ? $t('test_track.batch_operate_select_row_count', [size]) : $t('test_track.select_all_row')}}</span>
|
<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
|
<test-case-export-field-select-table
|
||||||
|
@ -36,7 +37,7 @@ import {useStore} from "@/store";
|
||||||
import {mapState} from "pinia";
|
import {mapState} from "pinia";
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
export default {
|
export default {
|
||||||
name: "TestCaseImport",
|
name: "TestCaseExportToExcel",
|
||||||
components: {TestCaseExportFieldSelectTable, ElUploadList, MsTableButton},
|
components: {TestCaseExportFieldSelectTable, ElUploadList, MsTableButton},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -527,7 +527,7 @@ export default {
|
||||||
this._save();
|
this._save();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
buildPram() {
|
buildParam() {
|
||||||
let param = {};
|
let param = {};
|
||||||
Object.assign(param, this.form);
|
Object.assign(param, this.form);
|
||||||
param.projectId = this.projectId;
|
param.projectId = this.projectId;
|
||||||
|
@ -574,7 +574,7 @@ export default {
|
||||||
return param;
|
return param;
|
||||||
},
|
},
|
||||||
_save() {
|
_save() {
|
||||||
let param = this.buildPram();
|
let param = this.buildParam();
|
||||||
this.parseOldFields(param);
|
this.parseOldFields(param);
|
||||||
let option = this.getOption(param);
|
let option = this.getOption(param);
|
||||||
this.result.loading = true;
|
this.result.loading = true;
|
||||||
|
|
|
@ -21,10 +21,6 @@
|
||||||
@filter="filter"
|
@filter="filter"
|
||||||
ref="nodeTree">
|
ref="nodeTree">
|
||||||
<template v-slot:header>
|
<template v-slot:header>
|
||||||
<ms-search-bar
|
|
||||||
:show-operator="showOperator"
|
|
||||||
:condition="condition"
|
|
||||||
:commands="operators"/>
|
|
||||||
<module-public-button
|
<module-public-button
|
||||||
v-if="showPublicBtn"
|
v-if="showPublicBtn"
|
||||||
:condition="condition"
|
:condition="condition"
|
||||||
|
@ -50,7 +46,6 @@
|
||||||
import MsNodeTree from "metersphere-frontend/src/components/new-ui/MsNodeTree";
|
import MsNodeTree from "metersphere-frontend/src/components/new-ui/MsNodeTree";
|
||||||
import TestCaseCreate from "@/business/case/components/TestCaseCreate";
|
import TestCaseCreate from "@/business/case/components/TestCaseCreate";
|
||||||
import TestCaseImport from "@/business/case/components/import/TestCaseImport";
|
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 MsSearchBar from "metersphere-frontend/src/components/new-ui/MsSearchBar";
|
||||||
import {buildTree, buildNodePath} from "metersphere-frontend/src/model/NodeTree";
|
import {buildTree, buildNodePath} from "metersphere-frontend/src/model/NodeTree";
|
||||||
import {getCurrentProjectID} from "metersphere-frontend/src/utils/token";
|
import {getCurrentProjectID} from "metersphere-frontend/src/utils/token";
|
||||||
|
@ -74,7 +69,6 @@ export default {
|
||||||
IsChangeConfirm,
|
IsChangeConfirm,
|
||||||
MsSearchBar,
|
MsSearchBar,
|
||||||
TestCaseImport,
|
TestCaseImport,
|
||||||
TestCaseExport,
|
|
||||||
TestCaseCreate,
|
TestCaseCreate,
|
||||||
MsNodeTree,
|
MsNodeTree,
|
||||||
ModuleTrashButton,
|
ModuleTrashButton,
|
||||||
|
@ -93,23 +87,6 @@ export default {
|
||||||
trashEnable: false,
|
trashEnable: false,
|
||||||
publicEnable: 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: {}
|
currentNode: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -158,13 +135,6 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
addTestCase() {
|
|
||||||
if (!this.projectId) {
|
|
||||||
this.$warning(this.$t('commons.check_project_tip'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.$refs.testCaseCreate.open(this.currentModule)
|
|
||||||
},
|
|
||||||
filter() {
|
filter() {
|
||||||
this.$refs.nodeTree.filter(this.condition.filterText);
|
this.$refs.nodeTree.filter(this.condition.filterText);
|
||||||
},
|
},
|
||||||
|
@ -277,28 +247,6 @@ export default {
|
||||||
this.list();
|
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) {
|
remove(nodeIds) {
|
||||||
testCaseNodeDelete(nodeIds)
|
testCaseNodeDelete(nodeIds)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
@ -370,11 +318,6 @@ export default {
|
||||||
},
|
},
|
||||||
changeConfirm(isSave) {
|
changeConfirm(isSave) {
|
||||||
this.$emit('importChangeConfirm', isSave);
|
this.$emit('importChangeConfirm', isSave);
|
||||||
},
|
|
||||||
closeExport() {
|
|
||||||
if (this.$refs.testCaseExport) {
|
|
||||||
this.$refs.testCaseExport.close();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue