修改页面弹窗全屏
This commit is contained in:
@@ -5,8 +5,9 @@
|
|||||||
title="主机详情"
|
title="主机详情"
|
||||||
:showOkBtn="false"
|
:showOkBtn="false"
|
||||||
:showCancelBtn="false"
|
:showCancelBtn="false"
|
||||||
defaultFullscreen="true"
|
defaultFullscreen="true"
|
||||||
width="100%"
|
width="100%"
|
||||||
|
v-if="isModalVisible"
|
||||||
>
|
>
|
||||||
<div class="server-detail-container">
|
<div class="server-detail-container">
|
||||||
<div class="server-info-top">
|
<div class="server-info-top">
|
||||||
@@ -19,7 +20,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- 分隔线 -->
|
<!-- 分隔线 -->
|
||||||
<div class="divider"></div>
|
<div class="divider"></div>
|
||||||
<!-- 下半部分:监控面板 -->
|
|
||||||
<div class="server-info-bottom card-container">
|
<div class="server-info-bottom card-container">
|
||||||
<Monitor :formParams="FormValues" />
|
<Monitor :formParams="FormValues" />
|
||||||
</div>
|
</div>
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, ref } from 'vue';
|
import { defineComponent, ref, watch } from 'vue';
|
||||||
import { BasicModal, useModalInner } from '@jeesite/core/components/Modal';
|
import { BasicModal, useModalInner } from '@jeesite/core/components/Modal';
|
||||||
import { useMessage } from '@jeesite/core/hooks/web/useMessage';
|
import { useMessage } from '@jeesite/core/hooks/web/useMessage';
|
||||||
|
|
||||||
@@ -37,39 +37,52 @@ import RightOut from './Echart/RightOut.vue';
|
|||||||
import Monitor from './Echart/Monitor.vue';
|
import Monitor from './Echart/Monitor.vue';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: { BasicModal, LeftOut, RightOut, Monitor },
|
||||||
BasicModal,
|
|
||||||
LeftOut,
|
|
||||||
RightOut,
|
|
||||||
Monitor
|
|
||||||
},
|
|
||||||
setup() {
|
setup() {
|
||||||
const FormValues = ref<Record<string, any>>({
|
const FormValues = ref<Record<string, any>>({
|
||||||
hostId: ''
|
hostId: '-1'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const isModalVisible = ref(false);
|
||||||
|
|
||||||
const [register, { closeModal }] = useModalInner(async (data: any) => {
|
const [register, { closeModal }] = useModalInner(async (data: any) => {
|
||||||
if (!data || !data.hostId) return;
|
FormValues.value = { hostId: '-1' };
|
||||||
|
isModalVisible.value = false;
|
||||||
|
|
||||||
|
if (!data || !data.hostId) {
|
||||||
|
closeModal();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
FormValues.value.hostId = data.hostId;
|
FormValues.value.hostId = data.hostId;
|
||||||
|
isModalVisible.value = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => isModalVisible.value,
|
||||||
|
(newVal) => {
|
||||||
|
if (!newVal) {
|
||||||
|
FormValues.value = { hostId: '-1' };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
register,
|
register,
|
||||||
closeModal,
|
closeModal,
|
||||||
FormValues
|
FormValues,
|
||||||
|
isModalVisible
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* 模态框容器 - 强制100vh高度 */
|
|
||||||
.server-detail-modal {
|
.server-detail-modal {
|
||||||
height: 100vh !important;
|
height: 100vh !important;
|
||||||
max-height: 100vh !important;
|
max-height: 100vh !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 整体容器 - 100vh高度,上下布局 */
|
|
||||||
.server-detail-container {
|
.server-detail-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -82,21 +95,20 @@ export default defineComponent({
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 上半部分 - 精确50%高度,左右分栏 */
|
|
||||||
.server-info-top {
|
.server-info-top {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
height: calc(50% - 4px); /* 减去gap的一半,保证总高度精准50% */
|
height: calc(50% - 4px);
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 下半部分 - 精确50%高度 */
|
|
||||||
.server-info-bottom {
|
.server-info-bottom {
|
||||||
height: calc(50% - 4px); /* 减去gap的一半,保证总高度精准50% */
|
height: calc(50% - 4px);
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 左侧容器 - 30%宽度,满高 */
|
|
||||||
.server-info-left {
|
.server-info-left {
|
||||||
width: 30%;
|
width: 30%;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
@@ -104,7 +116,7 @@ export default defineComponent({
|
|||||||
min-height: 0;
|
min-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 右侧容器 - 70%宽度,满高 */
|
|
||||||
.server-info-right {
|
.server-info-right {
|
||||||
width: 70%;
|
width: 70%;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
@@ -112,25 +124,24 @@ export default defineComponent({
|
|||||||
min-height: 0;
|
min-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 卡片容器样式 - 美化UI */
|
|
||||||
.card-container {
|
.card-container {
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||||
transition: box-shadow 0.2s ease;
|
transition: box-shadow 0.2s ease;
|
||||||
overflow: hidden; /* 关键修改:禁用滚动,超出内容直接隐藏 */
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-container:hover {
|
.card-container:hover {
|
||||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 分隔线样式 */
|
|
||||||
.divider {
|
.divider {
|
||||||
height: 1px;
|
height: 1px;
|
||||||
background-color: #e5e6eb;
|
background-color: #e5e6eb;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in New Issue
Block a user