| | |
| | | <template> |
| | | <div class="title"></div> |
| | | <div class="warehouse-dashboard"> |
| | | <!-- å¯¼èªæ --> |
| | | <nav class="navbar"> |
| | | <div class="nav-container"> |
| | | <h1 class="logo">ä»åºè°åº¦ç³»ç»</h1> |
| | | <ul class="nav-links"> |
| | | <li |
| | | v-for="(warehouse, index) in warehouses" |
| | | :key="index" |
| | | :class="{ active: activeWarehouse === index }" |
| | | @click="switchWarehouse(index)" |
| | | > |
| | | {{ warehouse.name }} |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | </nav> |
| | | |
| | | <!-- 主å
å®¹åº - å¨ææ¸²æéä¸çä»åºé¡µé¢ --> |
| | | <main class="content-area"> |
| | | <component :is="currentComponent" class="warehouse-content"></component> |
| | | </main> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { ref, reactive } from 'vue' |
| | | import { ref, computed } from 'vue'; |
| | | // 导å
¥å个ä»åºçç»ä»¶ |
| | | import BoardWarehouse from './deviceMonitoring/BoardWarehouse.vue'; |
| | | import TestFrameWarehouse from './deviceMonitoring/TestFrameWarehouse.vue'; |
| | | import SolderMaskWarehouse from './deviceMonitoring/SolderMaskWarehouse.vue'; |
| | | import PpWarehouse from './deviceMonitoring/PpWarehouse.vue'; |
| | | import InkWarehouse from './deviceMonitoring/InkWarehouse.vue'; |
| | | import AuxiliaryWarehouse from './deviceMonitoring/AuxiliaryWarehouse.vue'; |
| | | import DryFilmWarehouse from './deviceMonitoring/DryFilmWarehouse.vue'; |
| | | |
| | | export default { |
| | | setup() { |
| | | return { |
| | | // å®ä¹ä»åºå表 |
| | | const warehouses = [ |
| | | { name: 'æ¿æä»', component: BoardWarehouse }, |
| | | { name: 'æµè¯æ¶ä»', component: TestFrameWarehouse }, |
| | | { name: 'é»çä»', component: SolderMaskWarehouse }, |
| | | { name: 'PPä»', component: PpWarehouse }, |
| | | { name: '油墨ä»', component: InkWarehouse }, |
| | | { name: 'è¾
æä»', component: AuxiliaryWarehouse }, |
| | | { name: 'æåä»', component: BoardWarehouse }, |
| | | { name: 'å¹²èä»', component: DryFilmWarehouse}, |
| | | ]; |
| | | |
| | | // å½åéä¸çä»åºç´¢å¼ |
| | | const activeWarehouse = ref(0); |
| | | |
| | | // 忢ä»åº |
| | | const switchWarehouse = (index) => { |
| | | activeWarehouse.value = index; |
| | | }; |
| | | |
| | | // æ ¹æ®éä¸çä»åºè·åå½åè¦æ¸²æçç»ä»¶ |
| | | const currentComponent = computed(() => { |
| | | return warehouses[activeWarehouse.value].component; |
| | | }); |
| | | |
| | | return { |
| | | warehouses, |
| | | activeWarehouse, |
| | | switchWarehouse, |
| | | currentComponent |
| | | }; |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .title { |
| | | line-height: 70vh; |
| | | text-align: center; |
| | | font-size: 28px; |
| | | color: orange; |
| | | .warehouse-dashboard { |
| | | display: flex; |
| | | flex-direction: column; |
| | | min-height: 100vh; |
| | | } |
| | | |
| | | .navbar { |
| | | background-color: #2c3e50; |
| | | color: white; |
| | | padding: 0 20px; |
| | | box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); |
| | | } |
| | | |
| | | .nav-container { |
| | | max-width: 1200px; |
| | | margin: 0 auto; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | height: 60px; |
| | | } |
| | | |
| | | .logo { |
| | | margin: 0; |
| | | font-size: 1.5rem; |
| | | font-weight: 600; |
| | | } |
| | | |
| | | .nav-links { |
| | | display: flex; |
| | | list-style: none; |
| | | margin: 0; |
| | | padding: 0; |
| | | gap: 1px; |
| | | } |
| | | |
| | | .nav-links li { |
| | | padding: 0 15px; |
| | | height: 60px; |
| | | display: flex; |
| | | align-items: center; |
| | | cursor: pointer; |
| | | transition: all 0.3s ease; |
| | | background-color: #34495e; |
| | | } |
| | | |
| | | .nav-links li:hover { |
| | | background-color: #3d5a7c; |
| | | } |
| | | |
| | | .nav-links li.active { |
| | | background-color: #3498db; |
| | | font-weight: 500; |
| | | box-shadow: inset 0 -3px 0 #2980b9; |
| | | } |
| | | |
| | | .content-area { |
| | | flex: 1; |
| | | padding: 20px; |
| | | background-color: #f5f7fa; |
| | | } |
| | | |
| | | .warehouse-content { |
| | | background-color: white; |
| | | border-radius: 8px; |
| | | padding: 20px; |
| | | min-height: calc(100vh - 100px); |
| | | box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); |
| | | } |
| | | </style> |