refactor: 用例列表全屏显示

This commit is contained in:
chenjianxing 2021-01-13 15:02:14 +08:00
parent 6f67e89a9d
commit b4d1b25cdf
2 changed files with 66 additions and 25 deletions

View File

@ -817,6 +817,7 @@
}
})
// csv
if (this.currentScenario.variables) {
this.currentScenario.variables.forEach(param => {
if (param.type === 'CSV' && param.files) {
param.files.forEach(item => {
@ -832,6 +833,7 @@
})
}
})
}
return bodyUploadFiles;
},
editScenario(showMessage) {
@ -869,6 +871,7 @@
this.currentEnvironmentId = obj.environmentId;
this.currentScenario.variables = [];
let index = 1;
if (obj.variables) {
obj.variables.forEach(item => {
//
if (item.name) {
@ -881,6 +884,7 @@
index++;
}
})
}
this.enableCookieShare = obj.enableCookieShare;
this.scenarioDefinition = obj.hashTree;
}

View File

@ -8,6 +8,8 @@
<div class="ms-drawer-header">
<slot name="header"></slot>
<i class="el-icon-close" @click="close"/>
<font-awesome-icon v-if="!isFullScreen && showFullScreen" class="alt-ico" :icon="['fa', 'expand-alt']" size="lg" @click="fullScreen"/>
<font-awesome-icon v-if="isFullScreen && showFullScreen" class="alt-ico" :icon="['fa', 'compress-alt']" size="lg" @click="unFullScreen"/>
</div>
<div class="ms-drawer-body">
<slot></slot>
@ -32,6 +34,9 @@
h: 100,
directionStyle: 'left-style',
dragBarDirection: 'vertical',
isFullScreen: false,
originalW: 100,
originalH: 100,
}
},
props: {
@ -52,6 +57,12 @@
default() {
return 40;
}
},
showFullScreen: {
type: Boolean,
default() {
return true;
}
}
},
mounted() {
@ -101,6 +112,18 @@
getHeightPercentage(per) {
return document.body.clientHeight * per / 100.0;
},
fullScreen() {
this.originalW = this.w;
this.originalH = this.h;
this.w = document.body.clientWidth;
this.h = document.body.clientHeight;
this.isFullScreen = true;
},
unFullScreen() {
this.w = this.originalW;
this.h = this.originalH;
this.isFullScreen = false;
},
close() {
this.$emit('close')
}
@ -177,4 +200,18 @@
color: red;
}
.alt-ico {
position: absolute;
font-size: 15px;
right: 40px;
top: 15px;
color: #8c939d;
}
.alt-ico:hover {
color: black;
font-size: 18px;
}
</style>