2026-06-26 10:51:01 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="common-layout">
|
|
|
|
|
<el-container>
|
2026-06-30 17:32:54 +08:00
|
|
|
<el-header>
|
|
|
|
|
<div class="header-container">
|
|
|
|
|
<div class="back" @click="back">< 返回</div>
|
2026-06-26 10:51:01 +08:00
|
|
|
<div class="left">
|
|
|
|
|
<div class="date">
|
|
|
|
|
<div>{{ currentTime }}</div>
|
|
|
|
|
<div class="week">{{ weekText }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="binary-strip">{{ binaryText }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="application-title">两江鱼复智能网联新能源汽车产业基地上位机</div>
|
|
|
|
|
<div class="right">
|
|
|
|
|
<div class="binary-strip">{{ binaryText }}</div>
|
|
|
|
|
<div class="btn-container">
|
|
|
|
|
<button class="nav-btn" :class="{ active: activePage === 'chassis' }" @click="handleBtn('chassis')">底盘控制</button>
|
|
|
|
|
<button class="nav-btn" :class="{ active: activePage === 'mechanicalArm' }" @click="handleBtn('mechanicalArm')">机械臂控制</button>
|
2026-06-30 17:32:54 +08:00
|
|
|
<button class="nav-btn" :class="{ active: activePage === 'camera' }" @click="handleBtn('camera')">相机</button>
|
2026-06-26 10:51:01 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</el-header>
|
|
|
|
|
<el-main>
|
2026-06-30 17:32:54 +08:00
|
|
|
<Chassis :mapName="mapName" v-if="activePage === 'chassis'" />
|
2026-06-26 10:51:01 +08:00
|
|
|
<MechanicalArm v-if="activePage === 'mechanicalArm'" />
|
2026-06-30 17:32:54 +08:00
|
|
|
<Camera v-if="activePage === 'camera'" />
|
2026-06-26 10:51:01 +08:00
|
|
|
</el-main>
|
|
|
|
|
</el-container>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup>
|
|
|
|
|
import Chassis from './chassis/Chassis.vue';
|
2026-06-29 16:19:37 +08:00
|
|
|
import MechanicalArm from './arm/MechanicalArm.vue';
|
2026-06-30 17:32:54 +08:00
|
|
|
import Camera from './camera/index.vue'
|
|
|
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
|
|
|
|
|
|
|
|
import autofit from 'autofit.js'
|
|
|
|
|
autofit.init()
|
|
|
|
|
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
const route = useRoute()
|
2026-06-26 10:51:01 +08:00
|
|
|
|
|
|
|
|
const currentTime = ref('')
|
|
|
|
|
const weekText = ref('')
|
|
|
|
|
|
|
|
|
|
const binaryText = ref('13513034532438213')
|
|
|
|
|
|
|
|
|
|
const weekNames = ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'];
|
|
|
|
|
const updateClock = () => {
|
|
|
|
|
const now = new Date();
|
|
|
|
|
const y = now.getFullYear();
|
|
|
|
|
const mo = String(now.getMonth()+1).padStart(2,'0');
|
|
|
|
|
const d = String(now.getDate()).padStart(2,'0');
|
|
|
|
|
const h = String(now.getHours()).padStart(2,'0');
|
|
|
|
|
const mi = String(now.getMinutes()).padStart(2,'0');
|
|
|
|
|
const s = String(now.getSeconds()).padStart(2,'0');
|
|
|
|
|
currentTime.value = `${y}-${mo}-${d} ${h}:${mi}:${s}`
|
|
|
|
|
weekText.value = weekNames[now.getDay()]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const genBinary = (len) => {
|
|
|
|
|
let str = '';
|
|
|
|
|
for (let i = 0; i < len; i++) str += Math.round(Math.random()).toString();
|
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const animateBinary = () => {
|
|
|
|
|
binaryText.value = genBinary(30)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const activePage = ref('chassis')
|
|
|
|
|
const handleBtn = (page) => {
|
|
|
|
|
activePage.value = page
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-30 17:32:54 +08:00
|
|
|
const back = () => {
|
|
|
|
|
router.back()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const mapName = ref('')
|
|
|
|
|
|
2026-06-26 10:51:01 +08:00
|
|
|
let clockTimer, binaryTimer;
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
updateClock();
|
|
|
|
|
clockTimer = setInterval(updateClock, 1000);
|
|
|
|
|
animateBinary()
|
|
|
|
|
binaryTimer = setInterval(animateBinary, 400);
|
2026-06-30 17:32:54 +08:00
|
|
|
mapName.value = route.query.mapName
|
2026-06-26 10:51:01 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
onUnmounted(() => {
|
|
|
|
|
clearInterval(clockTimer)
|
|
|
|
|
clearInterval(binaryTimer)
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.common-layout {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
|
|
.el-container {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
background-color: #000d2e;
|
|
|
|
|
|
|
|
|
|
.el-header {
|
|
|
|
|
border-bottom: 1px solid #00c2ff4d;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.header-container {
|
|
|
|
|
height: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 20px;
|
|
|
|
|
margin: 0 20px;
|
|
|
|
|
|
2026-06-30 17:32:54 +08:00
|
|
|
.back {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
color: #00c2ff;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
2026-06-26 10:51:01 +08:00
|
|
|
|
|
|
|
|
.left {
|
|
|
|
|
flex: 1;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-evenly;
|
|
|
|
|
|
|
|
|
|
.date {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
gap: 20px;
|
|
|
|
|
color: #00c2ff;
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
letter-spacing: 2px;
|
|
|
|
|
|
|
|
|
|
.week {
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.application-title {
|
|
|
|
|
flex: 1;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
font-size: 26px;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
text-align: center;
|
|
|
|
|
color: #00c2ff;
|
|
|
|
|
letter-spacing: 4px;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.right {
|
|
|
|
|
flex: 1;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-evenly;
|
|
|
|
|
|
|
|
|
|
.btn-container {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
gap: 12px ;
|
|
|
|
|
|
|
|
|
|
.nav-btn {
|
2026-06-29 16:19:37 +08:00
|
|
|
background: #003c8c80;
|
2026-06-26 10:51:01 +08:00
|
|
|
border: 1px solid rgba(0, 194, 255, 0.35);
|
|
|
|
|
color: #a0d8f0;
|
|
|
|
|
padding: 6px 20px;
|
|
|
|
|
border-radius: 3px;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
transition: all 0.2s;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.active {
|
|
|
|
|
background: rgba(0, 120, 220, 0.7);
|
|
|
|
|
border-color: #00c2ff;
|
|
|
|
|
color: #fff;
|
|
|
|
|
box-shadow: 0 0 10px rgba(0, 194, 255, 0.5);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.binary-strip {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
font-family: 'Orbitron', monospace;
|
2026-06-30 17:32:54 +08:00
|
|
|
font-size: 14px;
|
2026-06-29 16:19:37 +08:00
|
|
|
color: #00c2ff4d;
|
2026-06-26 10:51:01 +08:00
|
|
|
letter-spacing: 2px;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.el-main {
|
|
|
|
|
padding: 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</style>
|