From 0a6b2699518f478ed3f27ee75093be078581e82f Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Fri, 28 Oct 2022 16:10:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89=E6=96=87=E6=A1=A3=E7=9A=84?= =?UTF-8?q?=E9=AB=98=E7=BA=A7=E8=AE=BE=E7=BD=AE=E4=B8=80=E9=94=AE=E5=B1=95?= =?UTF-8?q?=E5=BC=80=E5=8A=9F=E8=83=BD=E5=A2=9E=E5=8A=A0=E5=AF=B9jsonschem?= =?UTF-8?q?a=E8=8A=82=E7=82=B9=E7=9A=84=E5=B1=95=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1019065 --user=宋天阳 【接口测试】接口定义文档-json请求体/响应体的一键展开/收起按钮没有生效【+github#19202】 https://www.tapd.cn/55049933/s/1282310 --- .../components/JsonSchema/JsonSchemaPanel.vue | 33 +++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/api-test/frontend/src/business/definition/components/document/components/JsonSchema/JsonSchemaPanel.vue b/api-test/frontend/src/business/definition/components/document/components/JsonSchema/JsonSchemaPanel.vue index 35352cc0d1..43a7f48639 100644 --- a/api-test/frontend/src/business/definition/components/document/components/JsonSchema/JsonSchemaPanel.vue +++ b/api-test/frontend/src/business/definition/components/document/components/JsonSchema/JsonSchemaPanel.vue @@ -67,8 +67,7 @@ import {getUUID} from "metersphere-frontend/src/utils"; import {TYPE, TYPE_NAME, TYPES} from "@/business/commons/json-schema/schema/editor/type/type"; import MsMock from "@/business/commons/json-schema/schema/editor/mock/MockComplete"; -import JsonAdvancedSetting - from "@/business/definition/components/document/components/plugin/JsonAdvancedSetting"; +import JsonAdvancedSetting from "@/business/definition/components/document/components/plugin/JsonAdvancedSetting"; export default { name: 'JsonSchemaPanel', @@ -169,19 +168,33 @@ export default { } }, created() { - if (this.pickValue) { - if (this.pickValue.hidden === undefined) { - this.hidden = this.root ? false : true; - } else { - this.hidden = this.root ? false : this.pickValue.hidden; - } + if (this.expandAllParams) { + this.hidden = false; } else { - this.hidden = true; + if (this.pickValue) { + if (this.pickValue.hidden === undefined) { + this.hidden = this.root ? false : true; + } else { + this.hidden = this.root ? false : this.pickValue.hidden; + } + } else { + this.hidden = true; + } } + this.collapseStatus = this.expandAllParams; }, watch: { expandAllParams() { - this.collapseStatus = this.expandAllParams; + if (this.expandAllParams) { + this.hidden = false; + } else { + if (!this.root) { + this.hidden = true; + } + } + this.$nextTick(() => { + this.collapseStatus = this.expandAllParams; + }); } }, methods: {