分布和趋势布局调整,卡片布局大小适配

This commit is contained in:
龚皓 2024-10-22 15:59:56 +08:00
parent 13425be2ca
commit 1d550b8952
7 changed files with 50 additions and 26 deletions

View File

@ -18,10 +18,9 @@ export default {
padding: 0px; padding: 0px;
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow-x: auto;
} }
/* .app-container{ /* .app-container{
margin: 0; margin: 0;
padding: 0; padding: 0;
} */ } */
</style> </style>

View File

@ -487,8 +487,8 @@ watch(monthlyCounts, () => {
background-color: #304555; background-color: #304555;
color: #fff; color: #fff;
border-radius: 8px; border-radius: 8px;
padding: 0; /* padding: 10px; */
margin: 0; /* margin: 10px; */
} }
.alert-header { .alert-header {
@ -498,7 +498,9 @@ watch(monthlyCounts, () => {
} }
.chart-container { .chart-container {
height: 350px; /* min-height: 350px; */
min-height: 41vh;
min-width: 40vw;
} }
::v-deep .el-tabs__item { ::v-deep .el-tabs__item {

View File

@ -7,7 +7,7 @@
<el-card class="channel-card" shadow="hover"> <el-card class="channel-card" shadow="hover">
<div class="section-title">通道</div> <div class="section-title">通道</div>
<div class="scroll-container"> <div class="scroll-container">
<el-table :data="cameras" height="250"> <el-table :data="cameras" height="220">
<el-table-column prop="id" label="ID" width="100" align="center"></el-table-column> <el-table-column prop="id" label="ID" width="100" align="center"></el-table-column>
<el-table-column prop="name" label="名称" align="center"></el-table-column> <el-table-column prop="name" label="名称" align="center"></el-table-column>
<!-- 添加点播按钮的列 --> <!-- 添加点播按钮的列 -->
@ -278,6 +278,7 @@ onMounted(() => {
.scroll-container { .scroll-container {
height: 170px; height: 170px;
height: 27vh;
/* overflow-y: auto; */ /* overflow-y: auto; */
} }
@ -285,7 +286,7 @@ onMounted(() => {
.status-summary-chart, .status-summary-chart,
.camera-count-chart { .camera-count-chart {
/* width: 100%; */ /* width: 100%; */
height: 170px; height: 27vh;
} }
.loading-container { .loading-container {
@ -324,7 +325,8 @@ onMounted(() => {
} }
.camera-row { .camera-row {
max-height: 250px; max-height: 37vh;
/* max-height: 250px; */
/* max-width: 1680px; */ /* max-width: 1680px; */
overflow-x: auto; overflow-x: auto;
/* gap: 1px; */ /* gap: 1px; */

View File

@ -117,7 +117,7 @@ const initChart = () => {
name: '告警类型', name: '告警类型',
type: 'pie', type: 'pie',
radius: '50%', radius: '50%',
center: ['50%', '150px'], center: ['50%', '50%'],
data: seriesData.value, data: seriesData.value,
data: [], data: [],
emphasis: { emphasis: {
@ -177,8 +177,8 @@ onMounted(async () => {
/* background: linear-gradient(to top, rgba(16, 84, 194, 0.6), rgba(31, 48, 207, 0.7)); */ /* background: linear-gradient(to top, rgba(16, 84, 194, 0.6), rgba(31, 48, 207, 0.7)); */
color: #fff; color: #fff;
border-radius: 8px; border-radius: 8px;
margin: 0; /* margin: 10px; */
padding: 0; /* padding: 10px; */
/* height: 100vh; */ /* height: 100vh; */
} }
@ -190,13 +190,15 @@ onMounted(async () => {
} }
.stats-row { .stats-row {
margin-top: 20px; margin-top: 10px;
margin-bottom: 10px; margin-bottom: 34px;
} }
.chart { .chart {
width: 100%; width: 100%;
height: 365px; /* min-height: 365px; */
height: 41vh;
min-width: 40vw;
/* height: 445px; */ /* height: 445px; */
} }
</style> </style>

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="alert-container"> <div class="alert-container" >
<el-row class="bottom-pan"> <el-row class="bottom-pan">
<el-col class="panel-bottom"> <el-col class="panel-bottom">
<Cameras/> <Cameras/>
@ -20,7 +20,7 @@
</template> </template>
<script setup> <script setup>
import { ref, reactive, onMounted } from 'vue'; import { ref, reactive, onMounted,computed, onBeforeUnmount} from 'vue';
import Statistics from '@/components/Statistics.vue'; import Statistics from '@/components/Statistics.vue';
import AlertChart from '@/components/AlertChart.vue'; import AlertChart from '@/components/AlertChart.vue';
import Cameras from '@/components/Cameras.vue'; import Cameras from '@/components/Cameras.vue';
@ -30,6 +30,19 @@ import { BoxApi } from '@/utils/boxApi.ts'; // 导入 BoxApi
const boxApi = new BoxApi(); const boxApi = new BoxApi();
const typeMapping = reactive({}); const typeMapping = reactive({});
const token = ref(null); const token = ref(null);
// const scale = ref(1);
// const scaleStyle = computed(() => ({
// transform: `scale(${scale.value})`,
// transformOrigin: 'top left',
// width: `${100 / scale.value}%`,
// }));
// const handleResize = () => {
// const clientWidth = document.documentElement.clientWidth;
// const scaleFactor = clientWidth / 1920;
// scale.value = scaleFactor < 1 ? scaleFactor : 1;
// };
// //
const fetchTypeMapping = async (token) => { const fetchTypeMapping = async (token) => {
@ -47,7 +60,13 @@ const fetchTypeMapping = async (token) => {
onMounted(async () => { onMounted(async () => {
token.value = localStorage.getItem('alertToken'); token.value = localStorage.getItem('alertToken');
await fetchTypeMapping(token.value); await fetchTypeMapping(token.value);
// handleResize();
// window.addEventListener('resize', handleResize);
}); });
// onBeforeUnmount(() => {
// window.removeEventListener('resize', handleResize);
// });
</script> </script>
<style scoped> <style scoped>
@ -56,8 +75,9 @@ onMounted(async () => {
padding: 0; padding: 0;
margin: 0; margin: 0;
background-color: #f5f7fa; background-color: #f5f7fa;
overflow: auto; overflow-x: hidden;
height: 100vh; height: 100vh;
width: 100%;
} }
.top-pan { .top-pan {
@ -69,13 +89,16 @@ onMounted(async () => {
/* overflow: hidden; */ /* overflow: hidden; */
/* height: 55vh; */ /* height: 55vh; */
/* max-height: 450px; */ /* max-height: 450px; */
padding-left: 10px; /* padding-left: 1vh; */
padding-right:10px ; /* padding-right:1vh ; */
overflow-y: auto; /* overflow: hidden; */
height: 55vh;
margin-top: 60px;
} }
.bottom-pan{ .bottom-pan{
margin: 0; margin: 0;
padding: 0; padding: 0;
height: 33vh;
} }
.panel-top-left { .panel-top-left {
@ -88,7 +111,7 @@ onMounted(async () => {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 20px; /* gap: 20px; */
} }
.panel-bottom{ .panel-bottom{

View File

@ -160,10 +160,6 @@ onMounted(() => {
<style scoped> <style scoped>
.camera-container { .camera-container {
display: flex; display: flex;
overflow-x: auto;
/* 横向滚动条 */
min-width: 0;
/* 避免内容挤压 */
} }
.camera-list { .camera-list {

View File

@ -36,7 +36,7 @@
<el-col :span="24"> <el-col :span="24">
<div class="table-part"> <div class="table-part">
<el-table v-loading="loading" :data="tableData" <el-table v-loading="loading" :data="tableData"
class="user-table" border max-height="550px"> class="user-table" border max-height="700px">
<el-table-column v-if="getColumnVisibility('selection')" type="selection" <el-table-column v-if="getColumnVisibility('selection')" type="selection"
min-width="55"></el-table-column> min-width="55"></el-table-column>
<el-table-column v-if="getColumnVisibility('id')" prop="id" label="序号" <el-table-column v-if="getColumnVisibility('id')" prop="id" label="序号"