大屏页面初始化

This commit is contained in:
2026-03-10 17:46:33 +08:00
parent 904ef23fbe
commit e6f7af148b
5 changed files with 360 additions and 5 deletions

View File

@@ -17,6 +17,7 @@
"v-scale-screen": "^2.3.0",
"vue": "^3.5.28",
"vue-router": "^5.0.3",
"vue3-draggable-next": "^4.1.4",
"xlsx": "^0.18.5"
},
"devDependencies": {
@@ -59,6 +60,7 @@
"integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@babel/code-frame": "^7.29.0",
"@babel/generator": "^7.29.0",
@@ -1405,6 +1407,7 @@
"resolved": "https://registry.npmmirror.com/@types/lodash-es/-/lodash-es-4.17.12.tgz",
"integrity": "sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==",
"license": "MIT",
"peer": true,
"dependencies": {
"@types/lodash": "*"
}
@@ -1904,6 +1907,7 @@
}
],
"license": "MIT",
"peer": true,
"dependencies": {
"baseline-browser-mapping": "^2.9.0",
"caniuse-lite": "^1.0.30001759",
@@ -2656,13 +2660,15 @@
"version": "4.17.23",
"resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.23.tgz",
"integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==",
"license": "MIT"
"license": "MIT",
"peer": true
},
"node_modules/lodash-es": {
"version": "4.17.23",
"resolved": "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.17.23.tgz",
"integrity": "sha512-kVI48u3PZr38HdYz98UmfPnXl2DXrpdctLrFLCd3kOx1xUkOmpFPx7gCWWM5MPkL/fD8zb+Ph0QzjGFs4+hHWg==",
"license": "MIT"
"license": "MIT",
"peer": true
},
"node_modules/lodash-unified": {
"version": "1.0.3",
@@ -3175,6 +3181,12 @@
"node": ">=18"
}
},
"node_modules/sortablejs": {
"version": "1.14.0",
"resolved": "https://registry.npmmirror.com/sortablejs/-/sortablejs-1.14.0.tgz",
"integrity": "sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w==",
"license": "MIT"
},
"node_modules/source-map-js": {
"version": "1.2.1",
"resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.1.tgz",
@@ -3347,6 +3359,7 @@
"integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"esbuild": "^0.27.0",
"fdir": "^6.5.0",
@@ -3525,6 +3538,7 @@
"resolved": "https://registry.npmmirror.com/vue/-/vue-3.5.28.tgz",
"integrity": "sha512-BRdrNfeoccSoIZeIhyPBfvWSLFP4q8J3u8Ju8Ug5vu3LdD+yTM13Sg4sKtljxozbnuMu1NB1X5HBHRYUzFocKg==",
"license": "MIT",
"peer": true,
"dependencies": {
"@vue/compiler-dom": "3.5.28",
"@vue/compiler-sfc": "3.5.28",
@@ -3586,6 +3600,18 @@
}
}
},
"node_modules/vue3-draggable-next": {
"version": "4.1.4",
"resolved": "https://registry.npmmirror.com/vue3-draggable-next/-/vue3-draggable-next-4.1.4.tgz",
"integrity": "sha512-29wEVebHRk0ybJEvmcQ+R/Or7Ogtp5/jc1WhVk5nEhDR7uq+iWHodScxWjG4xg4jrfA1KGWltcaGyklPpFC0qQ==",
"license": "MIT",
"dependencies": {
"sortablejs": "1.14.0"
},
"peerDependencies": {
"vue": "^3.0.1"
}
},
"node_modules/webpack-virtual-modules": {
"version": "0.6.2",
"resolved": "https://registry.npmmirror.com/webpack-virtual-modules/-/webpack-virtual-modules-0.6.2.tgz",

View File

@@ -18,6 +18,7 @@
"v-scale-screen": "^2.3.0",
"vue": "^3.5.28",
"vue-router": "^5.0.3",
"vue3-draggable-next": "^4.1.4",
"xlsx": "^0.18.5"
},
"devDependencies": {

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@@ -0,0 +1,277 @@
<template>
<div class="work-layout-container">
<div class="work-left-sidebar">
<div class="menu-title">
<h3>指标配置</h3>
</div>
<div class="menu-list">
<div
class="menu-item"
:class="{ active: activeMenu === item.key }"
v-for="item in menuList"
:key="item.key"
@click="activeMenu = item.key"
>
{{ item.label }}
</div>
</div>
</div>
<div class="work-section work-main-section">
</div>
</div>
</template>
<script setup>
import { ref, watch } from 'vue';
const menuList = ref([
{ key: 1, label: '指标一' },
{ key: 2, label: '指标二' },
{ key: 3, label: '指标三' },
{ key: 4, label: '指标四' },
])
const activeMenu = ref(1)
</script>
<style scoped>
/* 你原来的全部样式 100% 保留,我只加左侧样式 */
.work-layout-container {
width: 100%;
height: 100%;
display: flex;
flex-direction: row; /* 只改这一个字column → row */
gap: 6px;
padding: 8px;
margin: 0 !important;
box-sizing: border-box;
background-color: transparent;
overflow: hidden;
}
.work-section {
width: 100%;
display: flex;
gap: 6px;
box-sizing: border-box;
overflow: hidden;
}
.work-top-header {
height: 10%;
}
.work-main-section {
height: 100%;
flex: 1;
}
.work-col {
height: 100%;
box-sizing: border-box;
overflow: hidden;
}
.work-col-1-3 {
width: calc((100% - 12px) / 3);
}
.work-left-col, .work-middle-col, .work-right-col {
display: flex;
flex-direction: column;
gap: 6px;
}
.work-card-1-3 {
height: calc((100% - 12px) / 3);
}
.work-card-2-3 {
height: calc(2 * ((100% - 12px) / 3) + 6px);
}
.work-card {
width: 100%;
background-color: rgba(15, 52, 96, 0.1);
border: 1px solid rgba(26, 80, 139, 0.3);
border-radius: 8px;
padding: 2px;
box-sizing: border-box;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: #e0e6ff;
backdrop-filter: blur(2px);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
min-height: 0;
}
.full-card {
width: 100%;
height: 100%;
}
.work-card:hover {
box-shadow: 0 4px 12px rgba(60, 156, 255, 0.2);
border-color: rgba(60, 156, 255, 0.6);
transition: all 0.3s ease;
}
.work-card h3 {
font-size: 16px;
margin-bottom: 8px;
letter-spacing: 1px;
background: #3c9cff;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-weight: 600;
}
.work-card p {
font-size: 13px;
opacity: 0.75;
color: #b4c7e7;
text-align: center;
line-height: 1.5;
}
.work-left-sidebar {
width: 15%;
height: 100%;
display: flex;
flex-direction: column;
gap: 6px;
background: transparent;
}
.menu-title {
height: 10%;
background: rgba(15, 52, 96, 0.1);
border: 1px solid rgba(26, 80, 139, 0.3);
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
color: #e0e6ff;
backdrop-filter: blur(2px);
}
.menu-title h3 {
margin: 0;
font-size: 16px;
letter-spacing: 1px;
background: #3c9cff;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-weight: 600;
}
.menu-list {
height: 90%;
display: flex;
flex-direction: column;
gap: 6px;
}
.menu-item {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
background: rgba(15, 52, 96, 0.1);
border: 1px solid rgba(26, 80, 139, 0.3);
border-radius: 8px;
color: #e0e6ff;
cursor: pointer;
font-size: 14px;
transition: all 0.3s ease;
}
.menu-item.active {
border-color: rgba(60, 156, 255, 0.6);
box-shadow: 0 4px 12px rgba(60, 156, 255, 0.2);
background: rgba(60, 156, 255, 0.1);
}
/* 你原来的媒体查询我完全不动 */
@media (max-width: 1600px) {
.work-layout-container {
padding: 6px;
gap: 4px;
}
.work-section {
gap: 4px;
}
.work-col-1-3 {
width: calc((100% - 8px) / 3);
}
.work-card-1-3 {
height: calc((100% - 8px) / 3);
}
.work-card-2-3 {
height: calc(2 * ((100% - 8px) / 3) + 4px);
}
.work-card {
padding: 10px;
}
.work-card h3 {
font-size: 14px;
}
.work-card p {
font-size: 12px;
}
}
@media (max-width: 768px) {
.work-layout-container {
flex-direction: column;
height: auto;
min-height: 100%;
padding: 6px;
gap: 6px;
overflow-y: auto;
}
.work-section {
flex-direction: column;
height: auto !important;
min-height: 120px;
gap: 6px;
}
.work-col-1-3 {
width: 100%;
height: auto;
}
.work-left-col, .work-middle-col, .work-right-col {
flex-direction: column;
height: auto;
}
.work-card-1-3, .work-card-2-3 {
height: 120px;
margin-bottom: 6px;
}
.work-card {
padding: 8px;
}
}
@media (max-height: 900px) {
.work-layout-container {
padding: 6px;
gap: 4px;
}
.work-section {
gap: 4px;
}
.work-card {
padding: 8px;
}
.work-card h3 {
font-size: 14px;
margin-bottom: 6px;
}
.work-card p {
font-size: 12px;
}
}
</style>

View File

@@ -31,6 +31,7 @@
value-format="YYYY"
></el-date-picker>
<button class="query-btn" @click="handleQuery">查询</button>
<img src="@/assets/images/setting.png" class="setting-btn" @click="handleSetting" />
</div>
</div>
</header>
@@ -50,7 +51,7 @@
<script setup>
import { ref, onMounted, computed } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import { ElMessage } from 'element-plus';
import { ElMessage, ElMessageBox } from 'element-plus';
import { getHomeModuleList } from '@/api/bizApi'
import HomePage from './Home/index.vue'
@@ -112,6 +113,11 @@ const handleQuery = () => {
});
};
// 新增设置按钮点击事件
const handleSetting = () => {
router.push('/screen/Setting/index');
};
async function getList() {
try {
const res = await getHomeModuleList();
@@ -186,6 +192,24 @@ onMounted(() => {
.dark-date-popper .el-date-table td.in-range .el-date-table-cell::before {
background-color: rgba(60, 156, 255, 0.25) !important;
}
/* 新增设置弹窗样式 */
.dark-message-box {
background-color: #0f3460 !important;
border: 1px solid #1a508b !important;
}
.dark-message-box .el-message-box__header,
.dark-message-box .el-message-box__content {
background-color: #0f3460 !important;
color: #e0e6ff !important;
}
.dark-message-box .el-message-box__title {
color: #e0e6ff !important;
}
.confirm-btn {
background: linear-gradient(90deg, #1a508b, #3c9cff) !important;
border: 1px solid #1a508b !important;
}
</style>
<style scoped>
@@ -350,6 +374,26 @@ onMounted(() => {
background: linear-gradient(90deg, #154580, #2b8ed8);
}
.setting-btn {
height: 36px;
width: 36px;
border-radius: 8px;
background: linear-gradient(90deg, #1a508b, #3c9cff);
border: 1px solid #1a508b;
color: #fff;
font-size: 18px;
cursor: pointer;
transition: all 0.3s ease;
display: inline-flex;
align-items: center;
justify-content: center;
}
.setting-btn:hover {
box-shadow: 0 2px 8px rgba(60, 156, 255, 0.6);
background: linear-gradient(90deg, #154580, #2b8ed8);
}
.screen-content {
flex: 1;
padding: 1px;
@@ -396,11 +440,15 @@ onMounted(() => {
height: 32px;
line-height: 32px;
}
.query-btn {
.query-btn, .setting-btn {
height: 32px;
font-size: 14px;
padding: 0 18px;
}
.setting-btn {
width: 32px;
font-size: 16px;
}
}
@media (max-height: 900px) {
@@ -414,9 +462,12 @@ onMounted(() => {
height: 32px;
line-height: 32px;
}
.query-btn {
.query-btn, .setting-btn {
height: 32px;
}
.setting-btn {
width: 32px;
}
.screen-content {
padding: 10px;
height: calc(100vh - 65px);