fix(接口测试): 修复抽屉样式频繁切换全屏操作时会发生无法窗口化的问题

--bug=1010482 --user=宋天阳 【接口测试】-【接口定义】-操作-编辑-mock-操作-编辑-点击缩小窗口未生效
https://www.tapd.cn/55049933/s/1108874
This commit is contained in:
song-tianyang 2022-02-23 16:52:08 +08:00 committed by CountryBuilder
parent 6a9983903d
commit 3f9627cc4d
3 changed files with 234 additions and 227 deletions

View File

@ -70,9 +70,11 @@ export default {
}
},
created() {
if(this.jsr223Processor){
if (!this.jsr223Processor.scriptLanguage) {
this.jsr223Processor.scriptLanguage = "beanshell";
}
}
if (this.showApi) {
this.baseCodeTemplates = this.httpCodeTemplates;
} else {

View File

@ -47,7 +47,7 @@
</el-row>
<div class="text-container" style="border:1px #DCDFE6 solid; height: 100%;border-radius: 4px ;width: 100%">
<div style="padding: 15px 0;">
<mock-api-script-editor :jsr223-processor="response.body.scriptObject"/>
<mock-api-script-editor v-if="response.body.scriptObject" :jsr223-processor="response.body.scriptObject"/>
</div>
</div>
</div>

View File

@ -1,5 +1,6 @@
<template>
<div v-if="visible" id="ms-drawer" class="ms-drawer" :class="directionStyle" :style="{width: w + 'px', height: h + 'px'}" ref="msDrawer">
<div v-if="visible" id="ms-drawer" class="ms-drawer" :class="directionStyle"
:style="{width: w + 'px', height: h + 'px'}" ref="msDrawer">
<ms-bottom2-top-drag-bar v-if="direction == 'bottom'"/>
@ -7,7 +8,6 @@
<ms-right2-left-drag-bar v-if="direction == 'default'"/>
<div class="ms-drawer-header">
<slot name="header"></slot>
<i v-if="isShowClose" class="el-icon-close" @click="close"/>
@ -26,6 +26,7 @@
import MsLeft2RightDragBar from "./dragbar/MsLeft2RightDragBar";
import MsBottom2TopDragBar from "./dragbar/MsBottom2TopDragBar";
import MsFullScreenButton from "@/business/components/common/components/MsFullScreenButton";
export default {
name: "MsDrawer",
components: {MsFullScreenButton, MsBottom2TopDragBar, MsLeft2RightDragBar, MsRight2LeftDragBar},
@ -38,8 +39,8 @@
directionStyle: 'left-style',
dragBarDirection: 'vertical',
isFullScreen: false,
originalW: 100,
originalH: 100,
originalW: 0,
originalH: 0,
}
},
props: {
@ -88,10 +89,10 @@
},
methods: {
setfullScreen() {
if(this.isFullScreen){
this.fullScreen();
}else {
if (!this.isFullScreen) {
this.$nextTick(() => {
this.isFullScreen = true;
})
}
},
init() {
@ -147,8 +148,12 @@
return document.body.clientHeight * per / 100.0;
},
fullScreen() {
if (this.originalW === 0) {
this.originalW = this.w;
}
if (this.originalH === 0) {
this.originalH = this.h;
}
this.w = document.body.clientWidth;
this.h = document.body.clientHeight;
},