From d4473116fdf4cacf6710cbe32d13fee9341a87fd Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 23 Sep 2020 11:45:14 +0800 Subject: [PATCH 1/8] =?UTF-8?q?fit:=20=E6=B5=8B=E8=AF=95=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=A0=BC=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/api/report/ApiReportExport.vue | 53 ++++++-------- .../common/components/MsReportTitle.vue | 22 ++++++ .../report/PerformanceReportExport.vue | 54 ++++++++++++++ .../report/PerformanceReportView.vue | 62 ++++------------ .../comonents/report/TestCaseReportView.vue | 73 +++++++++++++++---- frontend/src/business/components/xpack | 2 +- frontend/src/i18n/en-US.js | 3 + frontend/src/i18n/zh-CN.js | 3 + frontend/src/i18n/zh-TW.js | 3 + 9 files changed, 180 insertions(+), 95 deletions(-) create mode 100644 frontend/src/business/components/common/components/MsReportTitle.vue create mode 100644 frontend/src/business/components/performance/report/PerformanceReportExport.vue diff --git a/frontend/src/business/components/api/report/ApiReportExport.vue b/frontend/src/business/components/api/report/ApiReportExport.vue index 5e1ace1bcd..c011bf3747 100644 --- a/frontend/src/business/components/api/report/ApiReportExport.vue +++ b/frontend/src/business/components/api/report/ApiReportExport.vue @@ -1,30 +1,35 @@ - {{$t('commons.save')}} +
+ {{ $t('commons.save') }} +
@@ -82,177 +84,177 @@ From 8028fdcd5fe85e7a0efb3499ac19f4f7b114dad5 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Wed, 23 Sep 2020 14:01:16 +0800 Subject: [PATCH 5/8] =?UTF-8?q?fix(=E7=94=A8=E4=BE=8B=E8=AF=84=E5=AE=A1):?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E5=BC=80=E5=A7=8B=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=E5=90=8E=E6=8C=89=E9=92=AE=E4=B8=8D=E5=8F=AF=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main/java/io/metersphere/xpack | 2 +- .../review/view/components/TestReviewTestCaseEdit.vue | 11 ----------- frontend/src/business/components/xpack | 2 +- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index e51e5704f9..141ee64787 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit e51e5704f9d7fbfb030a8a7d67d0094a9f36c23d +Subproject commit 141ee64787b4a28ef108c5fa4dde90446de01887 diff --git a/frontend/src/business/components/track/review/view/components/TestReviewTestCaseEdit.vue b/frontend/src/business/components/track/review/view/components/TestReviewTestCaseEdit.vue index 8c49aa1e55..5b777316a9 100644 --- a/frontend/src/business/components/track/review/view/components/TestReviewTestCaseEdit.vue +++ b/frontend/src/business/components/track/review/view/components/TestReviewTestCaseEdit.vue @@ -29,17 +29,6 @@ - - {{ $t('test_track.plan_view.pre_case') }} : {{ - testCases[index - 1] ? testCases[index - 1].name : '' - }} - - - {{ $t('test_track.plan_view.next_case') }} : {{ - testCases[index + 1] ? testCases[index + 1].name : '' - }} - - diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index 0368a18889..06d935cd1d 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit 0368a1888936d4ae75554e5341509379982e243c +Subproject commit 06d935cd1d22ab36f09763745c2aff8ad3fb08c1 From 1ba55315c42dbc94c355feb1a93e5856a7129f84 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Wed, 23 Sep 2020 14:36:31 +0800 Subject: [PATCH 6/8] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8Dxmind=E6=A8=A1=E7=89=88=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E8=87=AA=E5=8A=A8=E6=89=93=E5=BC=80=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../track/case/components/TestCaseImport.vue | 10 +++++++++- frontend/src/common/js/ajax.js | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/src/business/components/track/case/components/TestCaseImport.vue b/frontend/src/business/components/track/case/components/TestCaseImport.vue index 0c41e97d6e..16c2f0f723 100644 --- a/frontend/src/business/components/track/case/components/TestCaseImport.vue +++ b/frontend/src/business/components/track/case/components/TestCaseImport.vue @@ -113,6 +113,7 @@ import MsTableButton from '../../../../components/common/components/MsTableButton'; import {listenGoBack, removeGoBackListener} from "../../../../../common/js/utils"; import {TokenKey, WORKSPACE_ID} from '../../../../../common/js/constants'; + import axios from "axios"; export default { name: "TestCaseImport", @@ -188,7 +189,14 @@ this.$fileDownload('/test/case/export/template'); }, downloadXmindTemplate() { - this.$fileDownload('/test/case/export/xmindTemplate'); + axios.get('/test/case/export/xmindTemplate', {responseType: 'blob'}) + .then(response => { + let fileName = window.decodeURI(response.headers['content-disposition'].split('=')[1]); + let link = document.createElement("a"); + link.href = window.URL.createObjectURL(new Blob([response.data])); + link.download = fileName; + link.click(); + }); }, upload(file) { this.isLoading = false; diff --git a/frontend/src/common/js/ajax.js b/frontend/src/common/js/ajax.js index 3dd6792e3e..0e500b68e9 100644 --- a/frontend/src/common/js/ajax.js +++ b/frontend/src/common/js/ajax.js @@ -136,7 +136,7 @@ export default { .then(response => { let fileName = window.decodeURI(response.headers['content-disposition'].split('=')[1]); let link = document.createElement("a"); - link.href = window.URL.createObjectURL(new Blob([response.data])); + link.href = window.URL.createObjectURL(new Blob([response.data], {type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"})); link.download = fileName; link.click(); }); From b8b9e9ac649608c57f48a19c790439daba08e177 Mon Sep 17 00:00:00 2001 From: q4speed Date: Wed, 23 Sep 2020 15:30:17 +0800 Subject: [PATCH 7/8] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E6=9D=A1=E4=BB=B6=E6=8E=A7=E5=88=B6=E5=99=A8=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=A9=BA=E5=92=8C=E9=9D=9E=E7=A9=BA=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../request/condition/IfController.vue | 23 +++++++++++++++++-- .../api/test/model/ScenarioModel.js | 19 +++++++++++++-- frontend/src/i18n/en-US.js | 2 ++ frontend/src/i18n/zh-CN.js | 2 ++ frontend/src/i18n/zh-TW.js | 2 ++ 5 files changed, 44 insertions(+), 4 deletions(-) diff --git a/frontend/src/business/components/api/test/components/request/condition/IfController.vue b/frontend/src/business/components/api/test/components/request/condition/IfController.vue index e8827281cd..afe2911cb3 100644 --- a/frontend/src/business/components/api/test/components/request/condition/IfController.vue +++ b/frontend/src/business/components/api/test/components/request/condition/IfController.vue @@ -6,12 +6,13 @@ - + - + @@ -58,6 +59,14 @@ export default { LT: { label: "commons.adv_search.operators.lt", value: "<" + }, + IS_NULL: { + label: "commons.adv_search.operators.is_null", + value: "is null" + }, + IS_NOT_NULL: { + label: "commons.adv_search.operators.is_not_null", + value: "is not null" } } } @@ -78,6 +87,16 @@ export default { remove() { this.controller = new IfController(); this.visible = false; + }, + change(value) { + if (value.indexOf("null") > 0) { + this.controller.value = ""; + } + } + }, + computed: { + hasNullOperator() { + return !!this.controller.operator && this.controller.operator.indexOf("null") > 0; } } } diff --git a/frontend/src/business/components/api/test/model/ScenarioModel.js b/frontend/src/business/components/api/test/model/ScenarioModel.js index 113b24eab4..33a53a7983 100644 --- a/frontend/src/business/components/api/test/model/ScenarioModel.js +++ b/frontend/src/business/components/api/test/model/ScenarioModel.js @@ -873,14 +873,17 @@ export class IfController extends Controller { } isValid() { + if (!!this.operator && this.operator.indexOf("null") > 0) { + return !!this.variable && !!this.operator; + } return !!this.variable && !!this.operator && !!this.value; } label() { if (this.isValid()) { let label = this.variable; - label += " " + this.operator; - label += " " + this.value; + if (this.operator) label += " " + this.operator; + if (this.value) label += " " + this.value; return label; } return ""; @@ -1234,6 +1237,18 @@ class JMXGenerator { value = "\".*" + value + ".*\""; } + if (operator === "is null") { + variable = "empty(\"" + variable + "\")"; + operator = ""; + value = ""; + } + + if (operator === "is not null") { + variable = "!empty(\"" + variable + "\")"; + operator = ""; + value = ""; + } + let condition = "${__jexl3(" + variable + operator + value + ")}"; let controller = new JMXIfController(name, {condition: condition}); controller.put(sampler); diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index 7081eaaee6..1e0dae601f 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -142,6 +142,8 @@ export default { and: 'All', or: 'any one', operators: { + is_null: "Is null", + is_not_null: "Is not null", like: "Contains", not_like: "Not included", in: "Belong to", diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 845b6e9fa2..c1b7040272 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -142,6 +142,8 @@ export default { and: '所有', or: '任意一个', operators: { + is_null: "空", + is_not_null: "非空", like: "包含", not_like: "不包含", in: "属于", diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 6fdf5ffb7d..999711a3d5 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -142,6 +142,8 @@ export default { and: '所有', or: '任意壹個', operators: { + is_null: "空", + is_not_null: "非空", like: "包含", not_like: "不包含", in: "屬於", From a609ca76389bd8c9945e483956388581b2a9ec2c Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 23 Sep 2020 16:03:14 +0800 Subject: [PATCH 8/8] =?UTF-8?q?feat:=20=E7=99=BB=E5=85=A5=E5=90=8E?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E8=87=B3=E5=8E=9F=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/components/common/router/router.js | 16 ++++++++++++++++ frontend/src/business/components/xpack | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/frontend/src/business/components/common/router/router.js b/frontend/src/business/components/common/router/router.js index 7ac9c4607e..da7d79e786 100644 --- a/frontend/src/business/components/common/router/router.js +++ b/frontend/src/business/components/common/router/router.js @@ -26,6 +26,9 @@ const router = new VueRouter({ }); router.beforeEach((to, from, next) => { + + redirectLoginPath(to.fullPath); + //解决localStorage清空,cookie没失效导致的卡死问题 if (!localStorage.getItem('Admin-Token')) { axios.get("/signout"); @@ -38,4 +41,17 @@ router.beforeEach((to, from, next) => { } }); +// 登入后跳转至原路径 +function redirectLoginPath(originPath) { + let redirectUrl = sessionStorage.getItem('redirectUrl'); + let loginSuccess = sessionStorage.getItem('loginSuccess'); + sessionStorage.setItem('redirectUrl', originPath); + if (redirectUrl && loginSuccess) { + sessionStorage.removeItem('loginSuccess'); + router.push(redirectUrl); + } + sessionStorage.removeItem('loginSuccess'); +} + + export default router diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index 0368a18889..06d935cd1d 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit 0368a1888936d4ae75554e5341509379982e243c +Subproject commit 06d935cd1d22ab36f09763745c2aff8ad3fb08c1