From 5e49c359fcfc33fa060b1d177c3a36e83276cca2 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Thu, 1 Jul 2021 18:23:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8A=9F=E8=83=BD=E6=A1=88=E4=BE=8B=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E6=96=87=E4=BB=B6=E5=90=8D=E5=90=AB=E6=9C=89null?= =?UTF-8?q?=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复功能案例导出文件名含有null的缺陷 --- .../track/case/components/TestCaseList.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/frontend/src/business/components/track/case/components/TestCaseList.vue b/frontend/src/business/components/track/case/components/TestCaseList.vue index 7ce0b35f1d..e3f2a7b1b0 100644 --- a/frontend/src/business/components/track/case/components/TestCaseList.vue +++ b/frontend/src/business/components/track/case/components/TestCaseList.vue @@ -217,6 +217,7 @@ export default { }, data() { return { + projectName:"", type: TEST_CASE_LIST, tableHeaderKey:"TRACK_TEST_CASE", screenHeight: 'calc(100vh - 250px)', @@ -326,6 +327,9 @@ export default { this.initTableData(); let redirectParam = this.$route.query.dataSelectRange; this.checkRedirectEditPage(redirectParam); + if(!this.projectName || this.projectName === ""){ + this.getProjectName(); + } }, activated() { this.getTemplateField(); @@ -385,6 +389,14 @@ export default { }); } }, + getProjectName (){ + this.$get('project/get/' + this.projectId, response => { + let project = response.data; + if(project){ + this.projectName = project.name; + } + }); + }, customHeader() { const list = deepClone(this.tableLabel); this.$refs.headerCustom.open(list); @@ -552,7 +564,7 @@ export default { } this.page.result = this.$request(config).then(response => { - const filename = "Metersphere_case_" + localStorage.getItem(PROJECT_NAME) + ".xlsx"; + const filename = "Metersphere_case_" + this.projectName+ ".xlsx"; const blob = new Blob([response.data]); if ("download" in document.createElement("a")) { let aTag = document.createElement('a');