fix(接口测试): 接口定义文档的高级设置一键展开功能增加对jsonschema节点的展开

--bug=1019065 --user=宋天阳
【接口测试】接口定义文档-json请求体/响应体的一键展开/收起按钮没有生效【+github#19202】
https://www.tapd.cn/55049933/s/1282310
This commit is contained in:
song-tianyang 2022-10-28 16:10:31 +08:00 committed by 刘瑞斌
parent f3ac01a948
commit 31a76fb2a5
1 changed files with 23 additions and 10 deletions

View File

@ -67,8 +67,7 @@
import {getUUID} from "metersphere-frontend/src/utils"; import {getUUID} from "metersphere-frontend/src/utils";
import {TYPE, TYPE_NAME, TYPES} from "@/business/commons/json-schema/schema/editor/type/type"; 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 MsMock from "@/business/commons/json-schema/schema/editor/mock/MockComplete";
import JsonAdvancedSetting import JsonAdvancedSetting from "@/business/definition/components/document/components/plugin/JsonAdvancedSetting";
from "@/business/definition/components/document/components/plugin/JsonAdvancedSetting";
export default { export default {
name: 'JsonSchemaPanel', name: 'JsonSchemaPanel',
@ -169,19 +168,33 @@ export default {
} }
}, },
created() { created() {
if (this.pickValue) { if (this.expandAllParams) {
if (this.pickValue.hidden === undefined) { this.hidden = false;
this.hidden = this.root ? false : true;
} else {
this.hidden = this.root ? false : this.pickValue.hidden;
}
} else { } 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: { watch: {
expandAllParams() { 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: { methods: {