Files
my-bigScreen/screen-vue/src/views/desktop/index.vue

356 lines
7.7 KiB
Vue
Raw Normal View History

2026-02-24 23:26:41 +08:00
<template>
<div class="big-screen-container">
<header class="screen-header">
<div class="title-center">
2026-02-25 15:27:39 +08:00
<h1 class="main-title">{{ screenTitle }}</h1>
2026-02-24 23:26:41 +08:00
</div>
<div class="tabs-container">
<div class="tabs-left">
<div
class="tab-item"
v-for="tab in allTabs"
2026-02-27 14:51:21 +08:00
:key="tab.moduleCode"
:class="{ active: activeTab === tab.moduleCode }"
@click="switchTab(tab.moduleCode)"
2026-02-24 23:26:41 +08:00
>
2026-02-27 14:51:21 +08:00
<span>{{ tab.moduleName }}</span>
2026-02-24 23:26:41 +08:00
</div>
</div>
<div class="query-group">
<el-date-picker
2026-02-26 21:58:09 +08:00
type="year"
2026-02-24 23:26:41 +08:00
v-model="queryDate"
popper-class="dark-date-popper"
2026-02-26 21:58:09 +08:00
value-format="YYYY"
2026-02-24 23:26:41 +08:00
></el-date-picker>
<button class="query-btn" @click="handleQuery">查询</button>
</div>
</div>
</header>
<main class="screen-content">
2026-02-25 15:27:39 +08:00
<div v-if="activeTab === 'home'" class="screen-page">
2026-02-26 21:58:09 +08:00
<HomeIndex :formParams="FormValues" />
2026-02-24 23:26:41 +08:00
</div>
2026-02-25 15:27:39 +08:00
<div v-else-if="activeTab === 'work'" class="screen-page">
2026-02-26 21:58:09 +08:00
<WorkIndex :formParams="FormValues" />
2026-02-24 23:26:41 +08:00
</div>
2026-02-27 14:51:21 +08:00
<div v-else-if="activeTab === 'werp'" class="screen-page">
2026-02-26 21:58:09 +08:00
<ErpIndex :formParams="FormValues" />
2026-02-24 23:26:41 +08:00
</div>
</main>
</div>
</template>
<script setup>
2026-02-26 21:58:09 +08:00
import { ref, onMounted } from 'vue';
2026-02-25 15:27:39 +08:00
import HomeIndex from './screen/Home/index.vue';
import ErpIndex from './screen/Erp/index.vue';
import WorkIndex from './screen/Work/index.vue';
2026-02-27 14:51:21 +08:00
import { getHomeModuleList } from '@/api/bizApi'
2026-02-28 10:59:21 +08:00
const screenTitle = ref('个人数字化可视化看板');
2026-02-26 21:58:09 +08:00
const currentYear = new Date().getFullYear().toString();
2026-02-25 15:27:39 +08:00
const FormValues = ref({
2026-02-26 21:58:09 +08:00
reqParam: currentYear
2026-02-25 15:27:39 +08:00
});
2026-02-24 23:26:41 +08:00
2026-02-27 14:51:21 +08:00
const allTabs = ref([])
2026-02-24 23:26:41 +08:00
2026-02-25 15:27:39 +08:00
const activeTab = ref('home')
2026-02-26 21:58:09 +08:00
const queryDate = ref();
2026-02-24 23:26:41 +08:00
const switchTab = (key) => {
activeTab.value = key
}
const handleQuery = () => {
2026-02-26 21:58:09 +08:00
FormValues.value.reqParam = queryDate.value;
2026-02-24 23:26:41 +08:00
}
2026-02-26 21:58:09 +08:00
2026-02-27 14:51:21 +08:00
async function getList() {
try {
const res = await getHomeModuleList()
allTabs.value = res || []
} catch (error) {
console.error(error)
vList.value = []
}
}
2026-02-26 21:58:09 +08:00
const initApp = () =>{
queryDate.value = currentYear;
2026-02-27 14:51:21 +08:00
getList();
2026-02-26 21:58:09 +08:00
}
onMounted(() => {
initApp();
});
2026-02-24 23:26:41 +08:00
</script>
<style>
.dark-date-popper {
z-index: 9999 !important;
background-color: #0f3460 !important;
border: 1px solid #1a508b !important;
}
.dark-date-popper .el-picker-panel,
.dark-date-popper .el-date-range-picker,
.dark-date-popper .el-date-range-picker__header,
.dark-date-popper .el-date-table,
.dark-date-popper .el-date-table th,
.dark-date-popper .el-date-table td {
background-color: #0f3460 !important;
color: #e0e6ff !important;
border-color: #1a508b !important;
}
.dark-date-popper .el-date-range-picker__content .el-date-range-picker__header {
background-color: #154580 !important;
}
.dark-date-popper .el-date-range-picker__content {
background-color: #0f3460 !important;
}
.dark-date-popper .el-date-table td.current,
.dark-date-popper .el-date-table td.start-date,
.dark-date-popper .el-date-table td.end-date {
background-color: #3c9cff !important;
color: #fff !important;
}
.dark-date-popper .el-date-table td.in-range {
background-color: rgba(60, 156, 255, 0.25) !important;
color: #e0e6ff !important;
}
.dark-date-popper .el-date-table-cell {
background-color: transparent !important;
}
.dark-date-popper .el-date-table-cell::before,
.dark-date-popper .el-date-table-cell::after {
background-color: transparent !important;
opacity: 0 !important;
}
.dark-date-popper .el-date-table td.in-range .el-date-table-cell::before {
background-color: rgba(60, 156, 255, 0.25) !important;
}
</style>
<style scoped>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.big-screen-container {
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
overflow: hidden;
background-color: #0a1929;
background-image: inherit;
background-size: cover;
position: relative;
}
.big-screen-container::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(15, 52, 96, 0.85);
z-index: 1;
}
.screen-header {
height: 75px;
padding: 0 2vw;
border-bottom: 1px solid #1a508b;
background: url('@/assets/images/biaoti.png') no-repeat center center,
linear-gradient(90deg, rgba(15, 52, 96, 0.8), rgba(21, 69, 128, 0.8));
background-size: cover;
position: relative;
z-index: 10;
}
.title-center {
position: absolute;
left: 50%;
2026-02-25 15:27:39 +08:00
top: 50%;
2026-02-24 23:26:41 +08:00
transform: translate(-50%, -50%);
2026-02-25 15:27:39 +08:00
z-index: 9999 !important;
padding: 4px 20px;
border-radius: 8px;
2026-02-24 23:26:41 +08:00
}
.main-title {
font-size: 32px;
font-weight: 720;
2026-02-25 15:27:39 +08:00
background: linear-gradient(90deg, #3c9cff, #82b9ff);
2026-02-24 23:26:41 +08:00
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
white-space: nowrap;
2026-02-25 15:27:39 +08:00
z-index: 9999 !important;
2026-02-24 23:26:41 +08:00
letter-spacing: 2px;
2026-02-25 15:27:39 +08:00
text-shadow: 0 0 8px rgba(60, 156, 255, 0.8);
2026-02-24 23:26:41 +08:00
}
.tabs-container {
position: absolute;
left: 0;
2026-02-25 15:27:39 +08:00
bottom: 0;
2026-02-24 23:26:41 +08:00
width: 100%;
padding: 0 2vw;
display: flex;
justify-content: space-between;
align-items: center;
z-index: 10;
2026-02-25 15:27:39 +08:00
height: 40px;
2026-02-24 23:26:41 +08:00
}
.tabs-left {
display: flex;
gap: 12px;
}
.tab-item {
height: 36px;
line-height: 36px;
padding: 0 20px;
border-radius: 8px;
font-size: 16px;
cursor: pointer;
transition: all 0.3s ease;
background: url('@/assets/images/button1.png') no-repeat center center;
background-size: 100% 100%;
color: #e0e6ff;
text-align: center;
border: none !important;
}
.tab-item:hover {
2026-02-25 15:27:39 +08:00
background: url('@/assets/images/button1.png') no-repeat center center;
2026-02-24 23:26:41 +08:00
background-size: 100% 100%;
color: #fff;
}
.tab-item.active {
background: url('@/assets/images/button2.png') no-repeat center center;
background-size: 100% 100%;
color: #fff;
font-weight: 500;
box-shadow: 0 2px 8px rgba(60, 156, 255, 0.4);
border: none !important;
}
.query-group {
display: flex;
gap: 10px;
align-items: center;
justify-content: flex-end;
height: 100%;
}
:deep(.el-input),
:deep(.el-input__wrapper),
:deep(.el-input__inner) {
background-color: #0f3460 !important;
color: #e0e6ff !important;
box-shadow: none !important;
}
:deep(.el-input.is-focus .el-input__wrapper) {
box-shadow: 0 0 0 1px #3c9cff inset !important;
}
:deep(.el-date-editor .el-range-input) {
color: #e0e6ff !important;
}
:deep(.el-date-editor .el-range-separator) {
color: #e0e6ff !important;
margin-bottom: 5px !important;
}
.query-btn {
height: 36px;
padding: 0 20px;
border-radius: 8px;
background: linear-gradient(90deg, #1a508b, #3c9cff);
border: 1px solid #1a508b;
color: #fff;
font-size: 16px;
cursor: pointer;
transition: all 0.3s ease;
display: inline-flex;
align-items: center;
justify-content: center;
}
.query-btn:hover {
box-shadow: 0 2px 8px rgba(60, 156, 255, 0.6);
background: linear-gradient(90deg, #154580, #2b8ed8);
}
.screen-content {
flex: 1;
padding: 12px;
2026-02-25 15:27:39 +08:00
display: block;
2026-02-24 23:26:41 +08:00
position: relative;
z-index: 10;
2026-02-25 15:27:39 +08:00
overflow: hidden;
height: calc(100vh - 75px);
2026-02-24 23:26:41 +08:00
}
.screen-page {
width: 100%;
height: 100%;
2026-02-25 15:27:39 +08:00
display: block;
2026-02-24 23:26:41 +08:00
background: rgba(15, 52, 96, 0.8);
border: 1px solid #1a508b;
border-radius: 12px;
backdrop-filter: blur(8px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
2026-02-25 15:27:39 +08:00
overflow: hidden;
2026-02-24 23:26:41 +08:00
}
@media (max-width: 1600px) {
.main-title {
font-size: 24px;
}
.tab-item {
padding: 0 18px;
font-size: 14px;
height: 32px;
line-height: 32px;
}
.query-btn {
height: 32px;
font-size: 14px;
padding: 0 18px;
}
}
@media (max-height: 900px) {
.screen-header {
height: 65px;
}
.tabs-container {
2026-02-25 15:27:39 +08:00
height: 36px;
2026-02-24 23:26:41 +08:00
}
.tab-item {
height: 32px;
line-height: 32px;
}
.query-btn {
height: 32px;
}
.screen-content {
2026-02-25 15:27:39 +08:00
padding: 10px;
height: calc(100vh - 65px);
2026-02-24 23:26:41 +08:00
}
}
</style>