fix(项目设置): 修复环境编辑缺少全屏按钮的缺陷

--bug=1018538 --user=王孝刚 【项目设置】项目设置-项目环境-配置环境缺少全屏展示按钮
https://www.tapd.cn/55049933/s/1269812
This commit is contained in:
wxg0103 2022-10-20 16:31:38 +08:00 committed by wxg0103
parent f557a88d31
commit 6ab16db891
3 changed files with 34 additions and 10 deletions

View File

@ -3,6 +3,13 @@
<div class="msDialogHeader">
<span style="float: left;font-size: 18px;color: #303133;">{{ title }}</span>
<div style="float: right; margin-right: 30px">
<el-tooltip effect="dark" :content="$t('commons.full_screen_editing')"
placement="top-start">
<font-awesome-icon class="alt-ico" :icon="['fa', 'expand-alt']" size="lg" @click="fullScreen"/>
</el-tooltip>
</div>
<div v-if="!hideButton" style="float: right;width: fit-content;">
<div style="float: left; margin-right: 8px;">
<slot name="other"></slot>
@ -39,6 +46,9 @@ export default {
},
confirm() {
this.$emit("confirm");
},
fullScreen() {
this.$emit("fullScreen");
}
}
}
@ -53,4 +63,9 @@ export default {
.msDialogHeader {
margin-bottom: 5px;
}
.alt-ico {
font-size: 13px;
color: #8c939d;
}
</style>

View File

@ -59,11 +59,12 @@
</el-card>
<!-- 创建编辑复制环境时的对话框 -->
<el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="66%" top="50px">
<el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" width="66%" top="50px"
:fullscreen="isFullScreen">
<template #title>
<ms-dialog-header :title="dialogTitle" :hide-button="true"
@cancel="dialogVisible = false"
@confirm="save"/>
@confirm="save" @fullScreen="fullScreen"/>
</template>
<environment-edit
:if-create="ifCreate"
@ -77,7 +78,8 @@
@refreshAfterSave="refresh">
</environment-edit>
</el-dialog>
<environment-import :project-list="projectList" :to-import-project-id="currentProjectId" @refresh="refresh" ref="envImport"></environment-import>
<environment-import :project-list="projectList" :to-import-project-id="currentProjectId" @refresh="refresh"
ref="envImport"></environment-import>
<el-dialog title="域名列表" :visible.sync="domainVisible">
<el-table :data="conditions">
@ -139,7 +141,7 @@ import EnvironmentEdit from "metersphere-frontend/src/components/environment/Env
import MsAsideItem from "metersphere-frontend/src/components/MsAsideItem";
import MsAsideContainer from "metersphere-frontend/src/components/MsAsideContainer";
import ProjectSwitch from "metersphere-frontend/src/components/head/ProjectSwitch";
import {downloadFile} from "metersphere-frontend/src/utils";
import {downloadFile, operationConfirm} from "metersphere-frontend/src/utils";
import {getCurrentProjectID} from "metersphere-frontend/src/utils/token";
import EnvironmentImport from "./EnvironmentImport";
import MsMainContainer from "metersphere-frontend/src/components/MsMainContainer";
@ -147,7 +149,6 @@ import MsContainer from "metersphere-frontend/src/components/MsContainer";
import MsDialogHeader from "metersphere-frontend/src/components/MsDialogHeader";
import {listAllProject} from "../../../api/project";
import {delEnvironmentById, getEnvironmentPages} from "../../../api/environment";
import {operationConfirm} from "metersphere-frontend/src/utils";
export default {
name: "EnvironmentList",
@ -191,6 +192,7 @@ export default {
projectFilters: [],
screenHeight: 'calc(100vh - 155px)',
ifCreate: false, //
isFullScreen: false //
}
},
created() {
@ -201,6 +203,9 @@ export default {
},
methods: {
fullScreen() {
this.isFullScreen = !this.isFullScreen;
},
showInfo(row) {
const config = JSON.parse(row.config);
this.conditions = config.httpConfig.conditions;

View File

@ -64,11 +64,12 @@
</el-card>
<!-- 创建编辑复制环境时的对话框 -->
<el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" top="50px" width="66%">
<el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" top="50px" width="66%"
:fullscreen="isFullScreen">
<template #title>
<ms-dialog-header :title="dialogTitle"
@cancel="dialogVisible = false"
@confirm="save"/>
@confirm="save" @fullScreen="fullScreen"/>
</template>
<environment-edit
:if-create="ifCreate"
@ -136,7 +137,7 @@ import MsTableOperatorButton from "metersphere-frontend/src/components/MsTableOp
import MsTablePagination from "metersphere-frontend/src/components/pagination/TablePagination";
import {Environment, parseEnvironment} from "metersphere-frontend/src/model/EnvironmentModel";
import ProjectSwitch from "metersphere-frontend/src/components/head/ProjectSwitch";
import {downloadFile, strMapToObj} from "metersphere-frontend/src/utils";
import {downloadFile, operationConfirm, strMapToObj} from "metersphere-frontend/src/utils";
import EnvironmentImport from "./EnvironmentImport";
import ShowMoreBtn from "metersphere-frontend/src/components/table/ShowMoreBtn";
import {
@ -150,7 +151,6 @@ import MsDialogHeader from "metersphere-frontend/src/components/MsDialogHeader";
import EnvironmentEdit from "metersphere-frontend/src/components/environment/EnvironmentEdit"
import {listAllProject} from "../../../api/project";
import {batchAddEnvGroup, delEnvironmentById, getEnvironmentPages} from "../../../api/environment";
import {operationConfirm} from "metersphere-frontend/src/utils";
export default {
@ -204,6 +204,7 @@ export default {
},
],
ifCreate: false, //
isFullScreen: false //
};
},
created() {
@ -228,6 +229,9 @@ export default {
},
methods: {
fullScreen() {
this.isFullScreen = !this.isFullScreen;
},
showInfo(row) {
const config = JSON.parse(row.config);
this.conditions = config.httpConfig.conditions;
@ -427,7 +431,7 @@ export default {
if (obj.protocol && obj.socket) {
return obj.protocol + "://" + obj.socket;
}
} else if (config.httpConfig && config.httpConfig.conditions.length > 1) {
} else if (config.httpConfig && config.httpConfig.conditions.length > 1) {
return "SHOW_INFO";
} else if (config.tcpConfig && config.tcpConfig.server) {
return config.tcpConfig.server;