From 51e820d697fc5e47753e0dc312fe0fdaf678c3f2 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Wed, 24 Mar 2021 21:55:41 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):?= =?UTF-8?q?=20=E5=88=A0=E6=8E=89=E4=B8=8D=E7=94=A8=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../track/case/components/TestCaseEdit.vue | 23 +++++++++++-------- .../track/case/components/TestCaseList.vue | 9 -------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/frontend/src/business/components/track/case/components/TestCaseEdit.vue b/frontend/src/business/components/track/case/components/TestCaseEdit.vue index eac63f1e15..25c572e192 100644 --- a/frontend/src/business/components/track/case/components/TestCaseEdit.vue +++ b/frontend/src/business/components/track/case/components/TestCaseEdit.vue @@ -62,14 +62,14 @@ - - - - - - - - + + + + + + + + @@ -463,6 +463,9 @@ export default { } else if (this.form.type === 'performance' || this.form.type === 'api') { url = '/' + this.form.type + '/list/' + this.projectId } + if (!url) { + return; + } return new Promise((resolve, reject) => { this.$get(url).then(res => { console.log(res.data.data) @@ -475,7 +478,7 @@ export default { }).catch((err) => { reject(err) }) - }) + }); }, /* lazyLoad(node, resolve){ const { level } = node; @@ -769,7 +772,7 @@ export default { if (this.form.tags instanceof Array) { this.form.tags = JSON.stringify(this.form.tags); } - param.testId=JSON.stringify(this.form.selected) + param.testId = JSON.stringify(this.form.selected) param.tags = this.form.tags; param.type = 'functional' return param; diff --git a/frontend/src/business/components/track/case/components/TestCaseList.vue b/frontend/src/business/components/track/case/components/TestCaseList.vue index 0a62011f1f..e74a54cd16 100644 --- a/frontend/src/business/components/track/case/components/TestCaseList.vue +++ b/frontend/src/business/components/track/case/components/TestCaseList.vue @@ -206,7 +206,6 @@ import {TEST_CASE_CONFIGS} from "../../../common/components/search/search-compon import ShowMoreBtn from "./ShowMoreBtn"; import BatchEdit from "./BatchEdit"; import {PROJECT_NAME, TEST_CASE_LIST, WORKSPACE_ID} from "@/common/js/constants"; -import {LIST_CHANGE, TrackEvent} from "@/business/components/common/head/ListEvent"; import StatusTableItem from "@/business/components/track/common/tableItems/planview/StatusTableItem"; import TestCaseDetail from "./TestCaseDetail"; import ReviewStatus from "@/business/components/track/case/components/ReviewStatus"; @@ -500,8 +499,6 @@ export default { this.selectRows.clear(); this.$emit("refresh"); this.$success(this.$t('commons.delete_success')); - // 发送广播,刷新 head 上的最新列表 - TrackEvent.$emit(LIST_CHANGE); }); } } @@ -512,8 +509,6 @@ export default { this.$post('/test/case/delete/' + testCaseId, {}, () => { this.initTableData(); this.$success(this.$t('commons.delete_success')); - // 发送广播,刷新 head 上的最新列表 - TrackEvent.$emit(LIST_CHANGE); }); }, refresh() { @@ -607,8 +602,6 @@ export default { this.$post('/test/case/batch/edit', param, () => { this.$success(this.$t('commons.save_success')); this.refresh(); - // 发送广播,刷新 head 上的最新列表 - TrackEvent.$emit(LIST_CHANGE); }); }, filter(filters) { @@ -660,8 +653,6 @@ export default { this.result = this.$post('/test/case/batch/edit', param, () => { this.$success(this.$t('commons.save_success')); this.$refs.testBatchMove.close(); - // 发送广播,刷新 head 上的最新列表 - TrackEvent.$emit(LIST_CHANGE); this.refresh(); }); }