262 lines
7.0 KiB
Vue
Raw Normal View History

2023-11-22 18:30:06 +08:00
<template>
2023-11-24 19:32:45 +08:00
<div class="headers">
<div class="logo">
</div>
<div class="tab">
2023-11-25 18:35:23 +08:00
<div class="tab-li">
<img @click="showFn(0, '/')" class="tab-img" v-if="show[0]" style="width: 6vw;height:2vh;" :src="u('SY')"
alt="">
<img @click="showFn(0, '/')" class="tab-img" v-else style="width: 7vw; height: 3vh;" :src="u('SYXZ')"
alt="">
</div>
<div class="tab-li">
<img @click="showFn(1, '/commodity')" class="tab-img" v-if="show[1]" style="width: 6vw;height:2vh;"
:src="u('SP')" alt="">
<img @click="showFn(1, '/commodity')" class="tab-img" v-else style="width: 7vw;height:3vh;" :src="u('SPXZ')"
alt="">
</div>
<div class="tab-li">
<img @click="showFn(2, '/Businesses')" class="tab-img" v-if="show[2]" style="width: 6vw;height:2vh;"
:src="u('SH')" alt="">
<img @click="showFn(2, '/Businesses')" class="tab-img" v-else style="width: 7vw;height:3vh;"
:src="u('SHXZ')" alt="">
</div>
<div class="tab-li">
<img @click="showFn(3, '/order')" class="tab-img" v-if="show[3]" style="width: 6vw;height:2vh;"
:src="u('DD')" alt="">
<img @click="showFn(3, '/order')" class="tab-img" v-else style="width: 7vw;height:3vh;" :src="u('DDXZ')"
alt="">
2023-11-24 19:32:45 +08:00
2023-11-25 18:35:23 +08:00
</div>
<div class="tab-li">
<img @click="showFn(4, '/finance')" class="tab-img" v-if="show[4]" style="width: 6vw;height:2vh;"
:src="u('CW')" alt="">
<img @click="showFn(4, '/finance')" class="tab-img" v-else style="width: 7vw;height:3vh;" :src="u('CWXZ')"
alt="">
2023-11-24 19:32:45 +08:00
2023-11-25 18:35:23 +08:00
</div>
2023-11-24 19:32:45 +08:00
</div>
<div class="right">
2023-11-28 15:26:40 +08:00
<div class="rigth-li" @click="choseArea = true"> <img style="width: 1VW;height:1VW;margin-right: 0.5vw;"
2023-11-27 18:34:57 +08:00
:src="u('DW')" alt=""> 泸县
</div>
2023-11-28 15:26:40 +08:00
<areaList :choseArea="choseArea" @offAreaList="offAreaList"></areaList>
2023-11-24 19:32:45 +08:00
<div class="right-line">
<span></span>
<span></span>
</div>
2023-11-28 15:26:40 +08:00
<div class="rigth-li" id="time">15:33:26</div>
2023-11-24 19:32:45 +08:00
<div class="right-line"> <span></span>
<span></span>
</div>
2023-11-28 15:26:40 +08:00
<div class="rigth-li" id="days">2023-11-28</div>
2023-11-24 19:32:45 +08:00
<div class="right-line">
<span></span>
<span></span>
</div>
2023-11-28 15:26:40 +08:00
<div class="rigth-li" @click="out"><img style="width: 1VW;height:1VW;margin-right: 0.5vw;" :src="u('GJ')"
alt=""></div>
2023-11-24 19:32:45 +08:00
<div class="right-line">
<span></span>
<span></span>
</div>
2023-11-23 19:39:47 +08:00
</div>
2023-11-22 18:30:06 +08:00
</div>
</template>
2023-11-28 15:26:40 +08:00
<script setup>
import { ref, reactive, onMounted } from "vue"
import areaList from "./areaList.vue";
2023-11-24 19:32:45 +08:00
import { useRouter } from 'vue-router'
const u = (name) => {
return `/static/index/${name}.png`
2023-11-23 19:39:47 +08:00
}
2023-11-24 19:32:45 +08:00
const route = useRouter()
// 标题
const show = reactive([false, true, true, true, true])
const showFn = (index, src) => {
show.forEach((item, i) => {
show[i] = true
})
show[index] = !show[index]
2023-11-28 15:26:40 +08:00
route.replace(src)
2023-11-23 19:39:47 +08:00
}
2023-11-24 19:32:45 +08:00
// 选额镇
2023-11-28 15:26:40 +08:00
const choseArea = ref(false)
// 关闭
const offAreaList = () => {
choseArea.value = false
}
const out = () => {
//@ts-ignore
window.open("about:blank", "_top").close()
//@ts-ignore
// window.open('file:///C:\WINDOWS\system32\Shutdown.exe-r', 'File')
}
const updateTime = () => {
var date = new Date();
var hours = date.getHours();
var minutes = date.getMinutes();
var seconds = date.getSeconds();
var years = date.getFullYear()
var month = date.getMonth()
var days = date.getDate()
// alert(days)
// 添加前导零
hours = (hours < 10 ? "0" : "") + hours;
minutes = (minutes < 10 ? "0" : "") + minutes;
seconds = (seconds < 10 ? "0" : "") + seconds;
var currentTime = hours + ":" + minutes + ":" + seconds;
var currentDays = years + '-' + (month >= 10 ? month + 1 : "0" + (month + 1)) + "-" + days
// alert(days)
2023-11-24 19:32:45 +08:00
2023-11-28 15:26:40 +08:00
// 将时间显示在指定的DOM元素中
document.getElementById("time").innerHTML = currentTime;
document.getElementById("days").innerHTML = currentDays;
2023-11-23 19:39:47 +08:00
}
2023-11-24 19:32:45 +08:00
2023-11-28 15:26:40 +08:00
onMounted(() => {
setInterval(updateTime, 1000)
})
2023-11-24 19:32:45 +08:00
</script>
<style lang="scss" scoped>
.headers {
display: flex;
color: #B0C7D1;
height: 6vh;
align-items: center;
justify-content: space-between;
2023-11-25 18:35:23 +08:00
background-image: url('/static/index/LOGO.png');
2023-11-24 19:32:45 +08:00
background-color: #000C14;
background-size: cover;
.logo {
width: 20vw;
// margin-right: 30px;
height: 40px;
align-items: center;
}
.tab {
display: flex;
align-items: center;
margin-left: 120px;
width: 50vw;
2023-11-25 18:35:23 +08:00
height: 100%;
// background-color: white;
2023-11-24 19:32:45 +08:00
.tab-li {
2023-11-25 18:35:23 +08:00
width: 8vw;
border-left: 1px solid #4AB9D0;
text-align: center;
2023-11-24 19:32:45 +08:00
cursor: pointer;
2023-11-25 18:35:23 +08:00
height: 1.5vh;
position: relative;
// background-color: red;
.tab-img {
position: absolute;
top: 50%;
left: 50%;
transform: (translate(-50%, -50%));
}
2023-11-24 19:32:45 +08:00
}
}
.right {
display: flex;
font-size: 15px;
margin-right: 30px;
2023-11-23 19:39:47 +08:00
position: relative;
2023-11-24 19:32:45 +08:00
.address {
left: 1vw;
top: 18px;
2023-11-23 19:39:47 +08:00
position: absolute;
2023-11-24 19:32:45 +08:00
width: 8vw;
height: 18vh;
background-color: #001E32;
color: #C7DBE3;
z-index: 9999;
overflow-y: auto;
box-sizing: border-box;
padding: 5px;
.address-li {
padding: 2px 5px;
cursor: pointer;
border-bottom: 0.1px solid #0E293C;
}
}
.address::-webkit-scrollbar {
width: 10px;
background-color: #153041;
}
.address::-webkit-scrollbar-track {
background-color: #153041;
}
::-webkit-scrollbar-thumb {
background-color: #4AB9D0;
border-radius: 5px;
}
.rigth-li {
height: 15px;
line-height: 15px;
padding: 0 10px;
cursor: pointer;
2023-11-27 18:34:57 +08:00
display: flex;
align-items: center;
2023-11-24 19:32:45 +08:00
}
.right-line {
width: 1px;
height: 15px;
display: flex;
flex-direction: column;
justify-content: space-between;
span {
width: 1px;
height: 7px;
background-color: #4BB9D0;
}
2023-11-23 19:39:47 +08:00
}
}
}
2023-11-24 19:32:45 +08:00
.v-enter-active,
.v-leave-active {
transition: opacity 0.5s ease;
2023-11-23 19:39:47 +08:00
}
2023-11-24 19:32:45 +08:00
.v-enter-from,
.v-leave-to {
opacity: 0;
}
</style>