From b76a6a16e9c3c765e13b49b27e3bea96f259fcf1 Mon Sep 17 00:00:00 2001 From: liangdaliang Date: Wed, 5 Mar 2025 18:00:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E6=B5=8B=E8=AF=95=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E7=BC=96=E6=8E=92=E6=8B=96=E6=9B=B3=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E3=80=81=E8=A7=A3=E5=86=B3=E7=94=A8=E4=BE=8B=E7=BC=96=E6=8E=92?= =?UTF-8?q?=E6=AD=A5=E9=AA=A4=E5=BC=95=E5=85=A5=E6=8E=A5=E5=8F=A3=E5=90=8E?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=B2=A1=E6=9C=89=E5=B8=A6=E5=85=A5=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E6=97=A0=E6=B3=95=E5=88=A0=E9=99=A4=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E3=80=81=E8=A7=A3=E5=86=B3=E7=82=B9=E5=87=BB=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E7=94=A8=E4=BE=8B=E8=B0=83=E6=95=B4=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E7=BC=96=E6=8E=92=E9=A1=B5=E9=9D=A2=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/TestCaseStepController.java | 3 +++ test-ui/src/views/test/case/detail/page1.vue | 25 ++++++++++++------- test-ui/src/views/test/case/detail/step.vue | 24 ++++++++++++++++-- test-ui/src/views/test/case/index.vue | 4 +-- test-ui/src/views/test/task/index.vue | 4 +-- 5 files changed, 45 insertions(+), 15 deletions(-) diff --git a/test-test/src/main/java/com/test/test/controller/TestCaseStepController.java b/test-test/src/main/java/com/test/test/controller/TestCaseStepController.java index dd2293a..96a0a3e 100644 --- a/test-test/src/main/java/com/test/test/controller/TestCaseStepController.java +++ b/test-test/src/main/java/com/test/test/controller/TestCaseStepController.java @@ -60,6 +60,9 @@ public class TestCaseStepController extends BaseController { @Log(title = "步骤", businessType = BusinessType.UPDATE) @PostMapping("/edit") public AjaxResult edit(@RequestBody TestCaseStep testCaseStep) { + if (testCaseStep.getId() == null) { + return null; + } return toAjax(testCaseStepService.updateTestCaseStep(testCaseStep)); } diff --git a/test-ui/src/views/test/case/detail/page1.vue b/test-ui/src/views/test/case/detail/page1.vue index 0f2bfc3..19019f5 100644 --- a/test-ui/src/views/test/case/detail/page1.vue +++ b/test-ui/src/views/test/case/detail/page1.vue @@ -229,15 +229,22 @@ export default { value: "", }] } + if (row.param && JSON.parse(row.param).length) { - this.form.requestParam = JSON.parse(row.param); - this.form.requestParam.push([{}]) + this.form.requestParams = JSON.parse(row.param); + this.form.requestParams.push([{}]) } else { - this.form.requestParam = [{ + this.form.requestParams = [{ key: "", value: "", }] } + + if (row.body) { + this.form.requestBody = row.body; + } else { + this.form.requestBody = ''; + } } }, apiHttpIdHandleChange(e) { @@ -271,16 +278,16 @@ export default { }, handleTableEdit(e, flag, scope) { if (flag === "header") { - if (e && this.form.header.length === scope.$index + 1) { - this.form.header.push({ + if (e && this.form.requestHeader.length === scope.$index + 1) { + this.form.requestHeader.push({ key: "", value: "" }) } } if (flag === "param") { - if (e && this.form.param.length === scope.$index + 1) { - this.form.param.push({ + if (e && this.form.requestParams.length === scope.$index + 1) { + this.form.requestParams.push({ key: "", value: "" }) @@ -289,10 +296,10 @@ export default { }, handleDelete(flag, scope) { if (flag === "header") { - this.form.header.splice(scope.$index, 1) + this.form.requestHeader.splice(scope.$index, 1) } if (flag === "param") { - this.form.param.splice(scope.$index, 1) + this.form.requestParams.splice(scope.$index, 1) } if (flag === "assignment") { this.form.assignment.splice(scope.$index, 1) diff --git a/test-ui/src/views/test/case/detail/step.vue b/test-ui/src/views/test/case/detail/step.vue index 919625c..1ccee85 100644 --- a/test-ui/src/views/test/case/detail/step.vue +++ b/test-ui/src/views/test/case/detail/step.vue @@ -8,7 +8,10 @@ +
+
+ 删除 @@ -23,6 +27,7 @@ +