fix: 测试跟踪从vuex获取项目id

This commit is contained in:
chenjianxing 2021-03-23 20:10:55 +08:00
parent 8993e53b70
commit b2514df363
24 changed files with 163 additions and 124 deletions

View File

@ -41,7 +41,6 @@
</template>
<script>
import {getCurrentProjectID} from "@/common/js/utils";
import MsTag from "@/business/components/common/components/MsTag";
export default {
@ -58,10 +57,14 @@ export default {
loading: false
}
},
computed: {
projectId() {
return this.$store.state.projectId
},
},
methods: {
search() {
let projectID = getCurrentProjectID();
let projectID = this.projectId;
this.result = this.$get("/api/faliureCaseAboutTestPlan/"+projectID+"/10", response => {
this.tableData = response.data;
});

View File

@ -57,7 +57,7 @@
</template>
<script>
import {checkoutTestManagerOrTestUser, getCurrentProjectID} from "@/common/js/utils";
import {checkoutTestManagerOrTestUser} from "@/common/js/utils";
import MsTag from "@/business/components/common/components/MsTag";
export default {
name: "MsRunningTaskList",
@ -80,12 +80,15 @@ export default {
computed:{
isReadOnly(){
return !checkoutTestManagerOrTestUser();
}
},
projectId() {
return this.$store.state.projectId
},
},
methods: {
search() {
let projectID = getCurrentProjectID();
let projectID = this.projectId;
this.result = this.$get("/api/runningTask/"+projectID+"/"+this.callFrom, response => {
this.tableData = response.data;
});

View File

@ -99,7 +99,7 @@ import SelectMenu from "../common/SelectMenu";
import MsContainer from "../../common/components/MsContainer";
import MsAsideContainer from "../../common/components/MsAsideContainer";
import MsMainContainer from "../../common/components/MsMainContainer";
import {checkoutTestManagerOrTestUser, getCurrentProjectID, getUUID} from "../../../../common/js/utils";
import {checkoutTestManagerOrTestUser, getUUID} from "../../../../common/js/utils";
import TestCaseNodeTree from "../common/TestCaseNodeTree";
import MsTabButton from "@/business/components/common/components/MsTabButton";
@ -132,12 +132,10 @@ export default {
loading: false,
type:'',
activeDom: 'left',
projectId: ""
}
},
mounted() {
this.init(this.$route);
this.projectId = getCurrentProjectID();
},
watch: {
redirectID() {
@ -151,7 +149,6 @@ export default {
this.init(to);
if (to.path.indexOf('/track/case/all') == -1) {
if (this.$refs && this.$refs.autoScenarioConfig) {
console.log(this.$refs.autoScenarioConfig);
this.$refs.autoScenarioConfig.forEach(item => {
/*item.removeListener();*/
});
@ -168,7 +165,10 @@ export default {
isRedirectEdit: function () {
let redirectParam = this.$route.params.dataSelectRange;
return redirectParam;
}
},
projectId() {
return this.$store.state.projectId
},
},
methods: {
handleCommand(e) {
@ -197,7 +197,6 @@ export default {
}
},
addTab(tab) {
this.projectId=getCurrentProjectID();
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
return;
@ -238,6 +237,10 @@ export default {
}
},
exportTestCase(){
if (this.activeDom !== 'left') {
this.$warning('请切换成接口列表导出!');
return;
}
this.$refs.testCaseList.exportTestCase()
},
addListener() {
@ -258,7 +261,6 @@ export default {
this.testCaseReadOnly = true;
}
let caseId = this.$route.params.caseId;
this.projectId=getCurrentProjectID();
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
return;

View File

@ -58,7 +58,7 @@
</template>
<script>
import {getCurrentProjectID, getCurrentUser, getUUID} from "@/common/js/utils";
import {getCurrentUser} from "@/common/js/utils";
import {WORKSPACE_ID} from "@/common/js/constants";
import MsDialogFooter from "@/business/components/common/components/MsDialogFooter";
import {buildNodePath} from "@/business/components/api/definition/model/NodeTree";
@ -97,15 +97,20 @@ export default {
this.getModuleOptions();
},
},
computed: {
projectId() {
return this.$store.state.projectId
},
},
methods: {
saveTestCase(saveAs) {
this.$refs['testCaseForm'].validate((valid) => {
if (valid) {
let path = "/test/case/save";
this.testCaseForm.projectId = getCurrentProjectID();
this.testCaseForm.projectId = this.projectId;
this.testCaseForm.type = "";
this.testCaseForm.priority = "P0";
if (this.currentModule !== undefined || this.currentModule !== null || this.currentModule !== 0 || this.currentModule !== "") {
if (this.currentModule && this.currentModule !== 0) {
this.testCaseForm.nodePath = this.currentModule.path;
this.testCaseForm.nodeId = this.currentModule.id;
} else {

View File

@ -287,10 +287,8 @@
import {TokenKey, WORKSPACE_ID} from '@/common/js/constants';
import MsDialogFooter from '../../../common/components/MsDialogFooter'
import {getCurrentUser, listenGoBack, removeGoBackListener} from "@/common/js/utils";
import {LIST_CHANGE, TrackEvent} from "@/business/components/common/head/ListEvent";
import {Message} from "element-ui";
import TestCaseAttachment from "@/business/components/track/case/components/TestCaseAttachment";
import {getCurrentProjectID} from "../../../../../common/js/utils";
import {buildNodePath} from "../../../api/definition/model/NodeTree";
import CaseComment from "@/business/components/track/case/components/CaseComment";
import MsInputTag from "@/business/components/api/automation/scenario/MsInputTag";
@ -324,11 +322,9 @@ export default {
resolve(nodes)
}
if(node.level==1){
this.projectId = getCurrentProjectID()
this.testOptions = [];
let url = '';
this.form.type=node.data.value
console.log(this.form.type)
if (this.form.type === 'testcase' || this.form.type === 'automation') {
url = '/api/' + this.form.type + '/list/' + this.projectId
} else if (this.form.type === 'performance' || this.form.type === 'api') {
@ -354,7 +350,6 @@ export default {
statuOptions:API_STATUS,
comments: [],
result: {},
projectId: "",
dialogFormVisible: false,
form: {
name: '',
@ -434,6 +429,11 @@ export default {
},
type: String
},
computed: {
projectId() {
return this.$store.state.projectId
},
},
mounted() {
this.getSelectOptions();
if (this.type === 'edit' || this.type === 'copy') {
@ -499,9 +499,6 @@ export default {
this.$nextTick(() => (this.isStepTableAlive = true));
},
open(testCase) {
console.log("测试用例")
console.log(testCase)
this.projectId = getCurrentProjectID();
if (window.history && window.history.pushState) {
history.pushState(null, null, document.URL);
window.addEventListener('popstate', this.close);
@ -587,7 +584,6 @@ export default {
/*
this.form.testId=testCase.selected
*/
console.log(this.form.selected)
this.getFileMetaData(testCase);
},
setTestCaseExtInfo(testCase) {
@ -692,7 +688,6 @@ export default {
buildParam() {
let param = {};
Object.assign(param, this.form);
console.log(this.form)
param.steps = JSON.stringify(this.form.steps);
param.nodeId = this.form.module;
this.moduleOptions.forEach(item => {
@ -781,7 +776,6 @@ export default {
});
},
getTestOptions(val) {
this.projectId = getCurrentProjectID()
this.testOptions = [];
let url = '';
if (this.form.type === 'testcase' || this.form.type === 'automation') {
@ -803,7 +797,6 @@ export default {
},
getDemandOptions() {
if (this.demandOptions.length === 0) {
this.projectId = getCurrentProjectID();
this.result = {loading : true};
this.$get("demand/list/" + this.projectId).then(response => {
this.demandOptions = response.data.data;

View File

@ -210,7 +210,6 @@ import {LIST_CHANGE, TrackEvent} from "@/business/components/common/head/ListEve
import StatusTableItem from "@/business/components/track/common/tableItems/planview/StatusTableItem";
import TestCaseDetail from "./TestCaseDetail";
import ReviewStatus from "@/business/components/track/case/components/ReviewStatus";
import {downloadFile, getCurrentProjectID, getCurrentUser} from "../../../../../common/js/utils";
import MsTag from "@/business/components/common/components/MsTag";
import {
_filter,
@ -330,7 +329,6 @@ export default {
maintainer: [],
},
currentCaseId: null,
projectId: "",
selectDataCounts: 0,
selectDataRange: "all"
}
@ -353,6 +351,11 @@ export default {
default: false,
}
},
computed: {
projectId() {
return this.$store.state.projectId
},
},
created: function () {
this.$emit('setCondition', this.condition);
if (this.trashEnable) {
@ -390,7 +393,6 @@ export default {
this.selectDataRange = dataType === 'case' ? dataRange : 'all';
},
initTableData() {
this.projectId = getCurrentProjectID();
this.condition.planId = "";
this.condition.nodeIds = [];
initCondition(this.condition);
@ -538,14 +540,14 @@ export default {
this.selectDataCounts = getSelectDataCounts(this.condition, this.total, this.selectRows);
},
importTestCase() {
if (!getCurrentProjectID()) {
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
return;
}
this.$refs.testCaseImport.open();
},
exportTestCase() {
if (!getCurrentProjectID()) {
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
return;
}

View File

@ -44,9 +44,7 @@
<script>
import NodeEdit from "./NodeEdit";
import {getCurrentProjectID} from "../../../../common/js/utils";
import MsNodeTree from "./NodeTree";
import {buildNodePath} from "@/business/components/api/definition/model/NodeTree";
import TestCaseCreate from "@/business/components/track/case/components/TestCaseCreate";
import TestCaseImport from "@/business/components/track/case/components/TestCaseImport";
@ -61,7 +59,6 @@ export default {
},
result: {},
treeNodes: [],
projectId: "",
condition: {
filterText: "",
trashEnable: false
@ -83,12 +80,16 @@ export default {
},
},
mounted() {
this.projectId = getCurrentProjectID();
this.list();
},
computed: {
projectId() {
return this.$store.state.projectId
},
},
methods: {
addTestCase(){
if (!getCurrentProjectID()) {
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
return;
}
@ -109,7 +110,7 @@ export default {
this.addTestCase();
break;
case "import":
if (!getCurrentProjectID()) {
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
return;
}

View File

@ -124,7 +124,7 @@ name: "TestCaseMinder",
if (isChange) {
saveCases.push(testCase);
}
if (testCase.nodeId.length < 15) {
if (testCase.nodeId !== 'root' && testCase.nodeId.length < 15) {
let tip = this.$t('test_track.case.create_case') + "'" + testCase.name + "'" + this.$t('test_track.case.minder_create_tip');
this.$error(tip)
throw new Error(tip);

View File

@ -1,39 +1,41 @@
export function getTestCaseDataMap(testCase, isDisable, setParamCallback) {
let dataMap = new Map();
testCase.forEach(item => {
item.steps = JSON.parse(item.steps);
// if (item.tags && item.tags.length > 0) {
// item.tags = JSON.parse(item.tags);
// }
let mapItem = dataMap.get(item.nodeId);
let nodeItem = {
data: {
id: item.id,
text: item.name,
priority: Number.parseInt(item.priority.substring(item.priority.length - 1 )) + 1,
resource: ["用例"],
type: item.type,
method: item.method,
maintainer: item.maintainer
if (testCase) {
testCase.forEach(item => {
item.steps = JSON.parse(item.steps);
// if (item.tags && item.tags.length > 0) {
// item.tags = JSON.parse(item.tags);
// }
let mapItem = dataMap.get(item.nodeId);
let nodeItem = {
data: {
id: item.id,
text: item.name,
priority: Number.parseInt(item.priority.substring(item.priority.length - 1 )) + 1,
resource: ["用例"],
type: item.type,
method: item.method,
maintainer: item.maintainer
}
}
}
if (setParamCallback) {
setParamCallback(nodeItem.data, item);
}
if (isDisable) {
nodeItem.data.disable = true;
// 用例节点可以打标签
nodeItem.data.allowDisabledTag = true;
}
parseChildren(nodeItem, item, isDisable);
if (mapItem) {
mapItem.push(nodeItem);
} else {
mapItem = [];
mapItem.push(nodeItem);
dataMap.set(item.nodeId, mapItem);
}
})
if (setParamCallback) {
setParamCallback(nodeItem.data, item);
}
if (isDisable) {
nodeItem.data.disable = true;
// 用例节点可以打标签
nodeItem.data.allowDisabledTag = true;
}
parseChildren(nodeItem, item, isDisable);
if (mapItem) {
mapItem.push(nodeItem);
} else {
mapItem = [];
mapItem.push(nodeItem);
dataMap.set(item.nodeId, mapItem);
}
})
}
return dataMap;
}
@ -41,14 +43,16 @@ function parseChildren(nodeItem, item, isDisable) {
nodeItem.children = [];
let children = [];
_parseChildren(children, item.prerequisite, "前置条件", isDisable);
item.steps.forEach((step) => {
let descNode = _parseChildren(children, step.desc, undefined, isDisable);
if (descNode) {
descNode.data.num = step.num;
descNode.children = [];
_parseChildren(descNode.children, step.result, undefined, isDisable);
}
});
if (item.steps) {
item.steps.forEach((step) => {
let descNode = _parseChildren(children, step.desc, undefined, isDisable);
if (descNode) {
descNode.data.num = step.num;
descNode.children = [];
_parseChildren(descNode.children, step.result, undefined, isDisable);
}
});
}
_parseChildren(children, item.remark, "备注", isDisable);
nodeItem.children = children;
}

View File

@ -73,7 +73,6 @@ import MsMainContainer from "@/business/components/common/components/MsMainConta
import MsContainer from "@/business/components/common/components/MsContainer";
import CaseCountCard from "@/business/components/track/home/components/CaseCountCard";
import RelevanceCaseCard from "@/business/components/track/home/components/RelevanceCaseCard";
import {getCurrentProjectID,getUUID} from "@/common/js/utils";
import CaseMaintenance from "@/business/components/track/home/components/CaseMaintenance";
import {COUNT_NUMBER, COUNT_NUMBER_SHALLOW} from "@/common/js/constants";
import BugCountCard from "@/business/components/track/home/components/BugCountCard";
@ -108,13 +107,18 @@ export default {
this.checkTipsType();
this.init();
},
computed: {
projectId() {
return this.$store.state.projectId
},
},
methods: {
checkTipsType() {
let random = Math.floor(Math.random() * (4 - 1 + 1)) + 1;
this.tipsType = random + "";
},
init() {
let selectProjectId = getCurrentProjectID();
let selectProjectId = this.projectId;
this.$get("/track/count/" + selectProjectId, response => {
this.trackCountData = response.data;
@ -191,7 +195,12 @@ export default {
// this.$router.push('/track/plan/view/'+selectType);
switch (page){
case "case":
this.$router.push({name:'testCase',params:{dataType:dataType,dataSelectRange:selectType, projectId: getCurrentProjectID()}});
this.$router.push({
name:'testCase',
params:{
dataType:dataType,dataSelectRange:selectType, projectId: this.projectId
}
});
break;
}
}

View File

@ -20,7 +20,6 @@
import TestPlanEdit from './components/TestPlanEdit';
import MsContainer from "../../common/components/MsContainer";
import MsMainContainer from "../../common/components/MsMainContainer";
import {getCurrentProjectID} from "../../../../common/js/utils";
export default {
name: "TestPlan",
@ -29,6 +28,11 @@
return {
}
},
computed: {
projectId() {
return this.$store.state.projectId
},
},
mounted() {
if (this.$route.path.indexOf("/track/plan/create") >= 0){
this.openTestPlanEditDialog();
@ -38,7 +42,7 @@
watch: {
'$route'(to, from) {
if (to.path.indexOf("/track/plan/create") >= 0){
if (!getCurrentProjectID()) {
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
return;
}

View File

@ -125,7 +125,7 @@
import {WORKSPACE_ID} from '@/common/js/constants';
import TestPlanStatusButton from "../common/TestPlanStatusButton";
import {getCurrentProjectID, listenGoBack, removeGoBackListener} from "@/common/js/utils";
import {listenGoBack, removeGoBackListener} from "@/common/js/utils";
import {LIST_CHANGE, TrackEvent} from "@/business/components/common/head/ListEvent";
import MsInputTag from "@/business/components/api/automation/scenario/MsInputTag";

View File

@ -220,11 +220,10 @@ import TestCaseReportView from "../view/comonents/report/TestCaseReportView";
import MsDeleteConfirm from "../../../common/components/MsDeleteConfirm";
import {TEST_PLAN_CONFIGS} from "../../../common/components/search/search-components";
import {LIST_CHANGE, TrackEvent} from "@/business/components/common/head/ListEvent";
import {getCurrentProjectID} from "../../../../../common/js/utils";
import MsScheduleMaintain from "@/business/components/api/automation/schedule/ScheduleMaintain"
import {_filter, _sort, getLabel} from "@/common/js/tableUtils";
import {TEST_CASE_LIST, TEST_PLAN_LIST} from "@/common/js/constants";
import {Test_Plan_List, Track_Test_Case} from "@/business/components/common/model/JsonData";
import {TEST_PLAN_LIST} from "@/common/js/constants";
import {Test_Plan_List} from "@/business/components/common/model/JsonData";
import HeaderCustom from "@/business/components/common/head/HeaderCustom";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
import MsTag from "@/business/components/common/components/MsTag";
@ -282,6 +281,9 @@ export default {
},
created() {
this.projectId = this.$route.params.projectId;
if (!this.projectId) {
this.projectId = this.$store.state.projectId;
}
this.isTestManagerOrTestUser = checkoutTestManagerOrTestUser();
this.initTableData();
},
@ -296,7 +298,7 @@ export default {
if (this.selectNodeIds && this.selectNodeIds.length > 0) {
this.condition.nodeIds = this.selectNodeIds;
}
if (!getCurrentProjectID()) {
if (!this.projectId) {
return;
}
this.result = this.$post(this.buildPagePath(this.queryPath), this.condition, response => {
@ -320,7 +322,7 @@ export default {
return path + "/" + this.currentPage + "/" + this.pageSize;
},
testPlanCreate() {
if (!getCurrentProjectID()) {
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
return;
}

View File

@ -151,7 +151,7 @@ import MsBottomContainer from "../../../../../api/definition/components/BottomCo
import ShowMoreBtn from "../../../../case/components/ShowMoreBtn";
import BatchEdit from "@/business/components/track/case/components/BatchEdit";
import {API_METHOD_COLOUR, CASE_PRIORITY, RESULT_MAP} from "../../../../../api/definition/model/JsonData";
import {getCurrentProjectID, strMapToObj} from "@/common/js/utils";
import {strMapToObj} from "@/common/js/utils";
import ApiListContainer from "../../../../../api/definition/components/list/ApiListContainer";
import PriorityTableItem from "../../../../common/tableItems/planview/PriorityTableItem";
import {getBodyUploadFiles, getUUID} from "../../../../../../../common/js/utils";
@ -539,7 +539,7 @@ export default {
},
getProjectId() {
if (!this.isRelevanceModel) {
return getCurrentProjectID();
return this.$store.state.projectId;
} else {
return this.currentCaseProjectId;
}

View File

@ -103,7 +103,7 @@ import MsTableHeader from "@/business/components/common/components/MsTableHeader
import MsTablePagination from "@/business/components/common/pagination/TablePagination";
import ShowMoreBtn from "@/business/components/track/case/components/ShowMoreBtn";
import MsTag from "../../../../../common/components/MsTag";
import {getUUID, getCurrentProjectID, getCurrentUser, strMapToObj} from "@/common/js/utils";
import {getUUID, strMapToObj} from "@/common/js/utils";
import MsApiReportDetail from "../../../../../api/automation/report/ApiReportDetail";
import MsTableMoreBtn from "../../../../../api/automation/scenario/TableMoreBtn";
import MsScenarioExtendButtons from "@/business/components/api/automation/scenario/ScenarioExtendBtns";
@ -162,7 +162,6 @@ export default {
status: 'default',
infoDb: false,
runVisible: false,
projectId: "",
runData: [],
buttons: [
{
@ -182,8 +181,12 @@ export default {
},
}
},
computed: {
projectId() {
return this.$store.state.projectId
},
},
created() {
this.projectId = getCurrentProjectID();
this.search();
},
watch: {

View File

@ -94,7 +94,7 @@
this.result = this.$get("/project/listAll", res => {
let data = res.data;
if (data) {
const index = data.findIndex(d => d.id === getCurrentProjectID());
const index = data.findIndex(d => d.id === this.$store.state.projectId);
this.projects = data;
if (index !== -1) {
this.projectId = data[index].id;

View File

@ -1,7 +1,5 @@
<template>
<div class="card-container">
<!-- <el-card class="card-content" v-loading="result.loading">-->
<!-- <template v-slot:header>-->
<ms-table-header :is-tester-permission="true" :condition.sync="condition" @search="initTableData"
:show-create="false" :tip="$t('commons.search_by_id_name_tag')">
@ -18,14 +16,8 @@
<ms-table-button :is-tester-permission="true" icon="el-icon-connection"
:content="$t('test_track.plan_view.relevance_test_case')"
@click="$emit('openTestCaseRelevanceDialog')"/>
<!-- 删除 取消全部关联 按钮-->
<!-- <ms-table-button :is-tester-permission="true" icon="el-icon-document-remove"-->
<!-- :content="$t('test_track.plan_view.cancel_all_relevance')" @click="handleDeleteBatch"/>-->
</template>
</ms-table-header>
<!-- </template>-->
<executor-edit ref="executorEdit" :select-ids="new Set(Array.from(this.selectRows).map(row => row.id))"
@refresh="initTableData"/>
@ -712,4 +704,8 @@ export default {
.el-tag {
margin-left: 10px;
}
.ms-table-header >>> .table-title {
height: 0px;
}
</style>

View File

@ -51,7 +51,6 @@
import FunctionalTestCaseList from "./FunctionalTestCaseList";
import MsTabButton from "@/business/components/common/components/MsTabButton";
import TestPlanMinder from "@/business/components/track/common/minder/TestPlanMinder";
import {getCurrentProjectID} from "@/common/js/utils";
export default {
name: "TestPlanFunctional",
@ -71,7 +70,6 @@
selectParentNodes: [],
treeNodes: [],
activeDom: 'left',
projectId: ""
}
},
props: [
@ -80,9 +78,13 @@
'clickType'
],
mounted() {
this.projectId = getCurrentProjectID();
this.initData();
},
computed: {
projectId() {
return this.$store.state.projectId
},
},
activated(){
this.initData();
this.openTestCaseEdit(this.$route.path);

View File

@ -13,7 +13,6 @@
import TestPlanReportList from './components/TestPlanReportList';
import MsContainer from "../../common/components/MsContainer";
import MsMainContainer from "../../common/components/MsMainContainer";
import {getCurrentProjectID} from "../../../../common/js/utils";
export default {
name: "TestPlanReport",

View File

@ -66,7 +66,6 @@ import MsTableOperatorButton from "../../../common/components/MsTableOperatorBut
import MsTableOperator from "../../../common/components/MsTableOperator";
import {checkoutTestManagerOrTestUser} from "@/common/js/utils";
import {TEST_PLAN_REPORT_CONFIGS} from "../../../common/components/search/search-components";
import {getCurrentProjectID} from "../../../../../common/js/utils";
import TestPlanReportView from "@/business/components/track/report/components/TestPlanReportView";
import ReportTriggerModeItem from "@/business/components/common/tableItem/ReportTriggerModeItem";
import MsTag from "@/business/components/common/components/MsTag";
@ -124,6 +123,9 @@ export default {
},
created() {
this.projectId = this.$route.params.projectId;
if (!this.projectId) {
this.projectId = this.$store.state.projectId;
}
this.isTestManagerOrTestUser = checkoutTestManagerOrTestUser();
this.initTableData();
},
@ -139,7 +141,7 @@ export default {
if (this.selectNodeIds && this.selectNodeIds.length > 0) {
this.condition.nodeIds = this.selectNodeIds;
}
if (!getCurrentProjectID()) {
if (!this.projectId) {
return;
}
this.result = this.$post(this.buildPagePath(this.queryPath), this.condition, response => {
@ -214,7 +216,7 @@ export default {
let deleteParam = {};
let ids = Array.from(this.selectRows).map(row => row.id);
deleteParam.dataIds = ids;
deleteParam.projectId = getCurrentProjectID();
deleteParam.projectId = this.projectId;
deleteParam.selectAllDate = this.isSelectAllDate;
deleteParam.unSelectIds = this.unSelection;
deleteParam = Object.assign(deleteParam, this.condition);

View File

@ -18,7 +18,6 @@ import TestCaseReviewList from "./components/TestCaseReviewList";
import TestCaseReviewEdit from "./components/TestCaseReviewEdit";
import MsMainContainer from "../../common/components/MsMainContainer";
import MsContainer from "../../common/components/MsContainer";
import {getCurrentProjectID} from "../../../../common/js/utils";
export default {
name: "TestCaseReview",
@ -33,6 +32,11 @@ export default {
}
},
computed: {
projectId() {
return this.$store.state.projectId
},
},
mounted() {
if (this.$route.path.indexOf("/track/review/create") >= 0){
this.openCaseReviewEditDialog();
@ -42,7 +46,7 @@ export default {
watch: {
'$route'(to) {
if (to.path.indexOf("/track/review/create") >= 0){
if (!getCurrentProjectID()) {
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
return;
}

View File

@ -101,7 +101,7 @@
import TestPlanStatusButton from "../../plan/common/TestPlanStatusButton";
import {WORKSPACE_ID} from "@/common/js/constants";
import {getCurrentProjectID, listenGoBack, removeGoBackListener} from "@/common/js/utils";
import {listenGoBack, removeGoBackListener} from "@/common/js/utils";
import MsInputTag from "@/business/components/api/automation/scenario/MsInputTag";
export default {

View File

@ -120,7 +120,6 @@ import MsCreateBox from "../../../settings/CreateBox";
import MsTablePagination from "../../../common/pagination/TablePagination";
import {
checkoutTestManagerOrTestUser,
getCurrentProjectID, getCurrentUser,
getCurrentWorkspaceId
} from "../../../../../common/js/utils";
import {_filter, _sort, getLabel} from "@/common/js/tableUtils";
@ -176,6 +175,11 @@ export default {
this.isTestManagerOrTestUser = checkoutTestManagerOrTestUser();
this.initTableData();
},
computed: {
projectId() {
return this.$store.state.projectId
},
},
methods: {
customHeader() {
this.$refs.headerCustom.open(this.tableLabel)
@ -185,10 +189,10 @@ export default {
getLabel(this, TEST_CASE_REVIEW_LIST);
let lastWorkspaceId = getCurrentWorkspaceId();
this.condition.workspaceId = lastWorkspaceId;
if (!getCurrentProjectID()) {
if (!this.projectId) {
return;
}
this.condition.projectId = getCurrentProjectID();
this.condition.projectId = this.projectId;
this.result = this.$post("/test/case/review/list/" + this.currentPage + "/" + this.pageSize, this.condition, response => {
let data = response.data;
this.total = data.itemCount;
@ -219,7 +223,7 @@ export default {
this.$router.push('/track/review/view/' + row.id);
},
testCaseReviewCreate() {
if (!getCurrentProjectID()) {
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
return;
}

View File

@ -49,7 +49,6 @@ import TestReviewRelevance from "@/business/components/track/review/view/compone
import TestReviewTestCaseList from "@/business/components/track/review/view/components/TestReviewTestCaseList";
import MsTabButton from "@/business/components/common/components/MsTabButton";
import TestReviewMinder from "@/business/components/track/common/minder/TestReviewMinder";
import {getCurrentProjectID} from "@/common/js/utils";
export default {
name: "TestReviewFunction",
@ -69,7 +68,6 @@ export default {
treeNodes: [],
isMenuShow: true,
activeDom: 'left',
projectId: ""
}
},
props: [
@ -79,11 +77,14 @@ export default {
],
mounted() {
this.getNodeTreeByReviewId()
this.projectId = getCurrentProjectID();
},
activated() {
this.getNodeTreeByReviewId()
},
computed: {
projectId() {
return this.$store.state.projectId
},
},
methods: {
refresh() {