2023-07-12 09:56:31 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="largeScreen" ref="dataScreenRef">
|
|
|
|
|
<div class="header">
|
|
|
|
|
<span class="projectTitle">
|
|
|
|
|
<p>数字化项目监管平台</p>
|
|
|
|
|
</span>
|
2023-07-28 19:43:56 +08:00
|
|
|
<div class="rightIcon" @click.stop>
|
2023-07-14 11:24:26 +08:00
|
|
|
<div class="time">{{ nowTime }}</div>
|
2023-07-28 19:43:56 +08:00
|
|
|
<!-- <div class="Icon">
|
2023-07-12 09:56:31 +08:00
|
|
|
<img src="@/assets/images/dustNoise/jobIcon.png" alt="" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="Icon">
|
|
|
|
|
<img src="@/assets/images/dustNoise/ysbfIcon.png" alt="" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="Icon">
|
|
|
|
|
<img src="@/assets/images/dustNoise/sjzxIcon.png" alt="" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="Icon">
|
|
|
|
|
<img src="@/assets/images/dustNoise/dpIcon.png" alt="" />
|
2023-07-28 19:43:56 +08:00
|
|
|
</div> -->
|
2023-07-12 09:56:31 +08:00
|
|
|
<div class="Icon">
|
|
|
|
|
<img src="@/assets/images/dustNoise/tbsjIcon.png" alt="" />
|
|
|
|
|
</div>
|
2023-07-28 19:43:56 +08:00
|
|
|
<div class="Icon" @click="showUserBox = !showUserBox">
|
2023-07-12 09:56:31 +08:00
|
|
|
<img src="@/assets/images/dustNoise/ryIcon.png" alt="" />
|
|
|
|
|
</div>
|
2023-07-28 19:43:56 +08:00
|
|
|
|
|
|
|
|
<!-- <el-dropdown trigger="click">
|
|
|
|
|
|
|
|
|
|
<template #dropdown>
|
|
|
|
|
<div class="userDialog" @click="loginOut">退出登录</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dropdown> -->
|
|
|
|
|
</div>
|
|
|
|
|
<div class="userBox" v-show="showUserBox">
|
|
|
|
|
<div class="userItem">
|
|
|
|
|
<div class="sanJiao"></div>
|
|
|
|
|
<div class="userIcon">
|
|
|
|
|
<div class="icon"><img src="@/assets/images/dustNoise/userIcon.png" /></div>
|
|
|
|
|
<div class="userName">{{ adminName }}</div>
|
|
|
|
|
</div>
|
2023-09-04 14:43:33 +08:00
|
|
|
<div class="loginOut" @click="jumpBgd">
|
|
|
|
|
<div class="loginOutIcon"><img src="@/assets/images/dustNoise/jumpIcon.png" /></div>
|
|
|
|
|
<div class="userName">项目后台</div>
|
|
|
|
|
</div>
|
2023-07-28 19:43:56 +08:00
|
|
|
<div class="loginOut" @click="loginOut">
|
|
|
|
|
<div class="loginOutIcon"><img src="@/assets/images/dustNoise/loginOut.png" /></div>
|
|
|
|
|
<div class="userName">退出登录</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2023-07-12 09:56:31 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="menuList">
|
|
|
|
|
<div
|
2023-09-04 14:43:33 +08:00
|
|
|
v-for="(item, index) in menuList"
|
2023-07-12 09:56:31 +08:00
|
|
|
:key="index"
|
|
|
|
|
:class="{
|
2023-09-04 14:43:33 +08:00
|
|
|
right: index > (menuList.length - 1) / 2,
|
|
|
|
|
active: activeIndex == index ? 'active' : ''
|
2023-07-12 09:56:31 +08:00
|
|
|
}"
|
|
|
|
|
@click="menuClick(item, index)"
|
|
|
|
|
>
|
|
|
|
|
{{ item.moduleName }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="dataBoardContent">
|
|
|
|
|
<router-view></router-view>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
2023-07-14 11:24:26 +08:00
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { ref, reactive, onMounted, onBeforeUnmount } from "vue";
|
2023-07-12 09:56:31 +08:00
|
|
|
import { useRouter } from "vue-router";
|
2023-07-28 19:43:56 +08:00
|
|
|
import { GlobalStore } from "@/stores";
|
|
|
|
|
const store = GlobalStore();
|
2023-07-14 11:24:26 +08:00
|
|
|
let nowTime = ref("2023-04-16 09:22:12" as any);
|
2023-07-28 19:43:56 +08:00
|
|
|
let showUserBox = ref(false as any);
|
|
|
|
|
let adminName = ref("" as any);
|
2023-09-04 14:43:33 +08:00
|
|
|
let menuList = ref([
|
|
|
|
|
{ moduleName: "扬尘噪声", modulePath: "/headNoise" },
|
|
|
|
|
{ moduleName: "劳务管理", modulePath: "/laborManagement" },
|
|
|
|
|
{ moduleName: "视频管理", modulePath: "/videoManagement" },
|
|
|
|
|
{ moduleName: "配电箱监测", modulePath: "/distributionMonitoring" },
|
|
|
|
|
{ moduleName: "车辆管理", modulePath: "/vehicleManagement" },
|
|
|
|
|
{ moduleName: "塔吊监测", modulePath: "/towerCraneMonitoring" },
|
|
|
|
|
{ moduleName: "升降机监测", modulePath: "/elevatorMonitoring" },
|
|
|
|
|
{ moduleName: "BIM模型", modulePath: "/bImModel" }
|
|
|
|
|
]);
|
|
|
|
|
const activeIndex=ref(0)
|
2023-07-14 11:24:26 +08:00
|
|
|
const router = useRouter();
|
2023-07-12 09:56:31 +08:00
|
|
|
|
2023-07-14 11:24:26 +08:00
|
|
|
const menuClick = (item, index) => {
|
2023-09-04 14:43:33 +08:00
|
|
|
activeIndex.value = index;
|
2023-07-14 11:24:26 +08:00
|
|
|
console.log("点击了tab", item);
|
|
|
|
|
if (item.modulePath.includes("/")) {
|
|
|
|
|
router.push(item.modulePath);
|
2023-07-12 09:56:31 +08:00
|
|
|
}
|
|
|
|
|
};
|
2023-09-04 14:43:33 +08:00
|
|
|
const moduleListData = ref([] as any);//动态路由
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
//数据看板跳转免登录
|
|
|
|
|
if (window.location.href.indexOf("token") != -1) {
|
|
|
|
|
const token = window.location.href.split("token=")[1];
|
|
|
|
|
const res = await fetch(import.meta.env.VITE_API_URL + "/xmgl/base/getLoginInfoByToken", {
|
|
|
|
|
method: "POST",
|
|
|
|
|
headers: {
|
|
|
|
|
"Content-Type": "application/json"
|
|
|
|
|
},
|
|
|
|
|
body: JSON.stringify({ token: token })
|
|
|
|
|
});
|
|
|
|
|
const data = await res.json();
|
|
|
|
|
console.log("调用免登录接口返回的数据", data);
|
|
|
|
|
// let arr = data.result.menuAuthority.moduleList;
|
|
|
|
|
// arr.forEach((item: any) => {
|
|
|
|
|
// if (item.moduleType == 4) {
|
|
|
|
|
// moduleListData.value.push(item);
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// console.log("当前项目的看板数据::", moduleListData.value);
|
|
|
|
|
store.setSN(data.result.sn);
|
|
|
|
|
store.setToken(data.result.token);
|
|
|
|
|
store.setAccount(data.result.account);
|
|
|
|
|
store.setAccountType(data.result.accountType);
|
|
|
|
|
}
|
2023-07-28 19:43:56 +08:00
|
|
|
// console.log("进入页面, ");
|
|
|
|
|
adminName.value = store.account;
|
|
|
|
|
// console.log("store数据", store.account);
|
2023-09-04 14:43:33 +08:00
|
|
|
menuClick(menuList.value[0], activeIndex.value);
|
2023-07-14 11:24:26 +08:00
|
|
|
getNowTime();
|
2023-07-28 19:43:56 +08:00
|
|
|
document.addEventListener("click", bodyCloseMenus);
|
2023-07-14 11:24:26 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
let timer = ref(null as any);
|
|
|
|
|
onBeforeUnmount(() => {
|
|
|
|
|
clearInterval(timer);
|
2023-07-28 19:43:56 +08:00
|
|
|
document.removeEventListener("click", bodyCloseMenus);
|
2023-07-14 11:24:26 +08:00
|
|
|
});
|
|
|
|
|
|
2023-07-28 19:43:56 +08:00
|
|
|
function bodyCloseMenus() {
|
|
|
|
|
if (showUserBox.value === true) {
|
|
|
|
|
showUserBox.value = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-14 11:24:26 +08:00
|
|
|
function getNowTime() {
|
|
|
|
|
let speed = 1000;
|
|
|
|
|
let theNowTime = function () {
|
|
|
|
|
nowTime.value = timeNumber();
|
|
|
|
|
};
|
|
|
|
|
timer.value = setInterval(theNowTime, speed);
|
|
|
|
|
}
|
|
|
|
|
function timeNumber() {
|
|
|
|
|
let today = new Date();
|
|
|
|
|
let date = today.getFullYear() + "-" + twoDigits(today.getMonth() + 1) + "-" + twoDigits(today.getDate());
|
|
|
|
|
let time = twoDigits(today.getHours()) + ":" + twoDigits(today.getMinutes()) + ":" + twoDigits(today.getSeconds());
|
|
|
|
|
return date + " " + time;
|
|
|
|
|
}
|
|
|
|
|
function twoDigits(val: any) {
|
|
|
|
|
if (val < 10) return "0" + val;
|
|
|
|
|
return val;
|
|
|
|
|
}
|
2023-07-28 19:43:56 +08:00
|
|
|
|
|
|
|
|
function loginOut() {
|
|
|
|
|
localStorage.removeItem("GlobalState");
|
|
|
|
|
location.reload();
|
|
|
|
|
router.push("/login");
|
|
|
|
|
}
|
2023-09-04 14:43:33 +08:00
|
|
|
//跳转后台
|
|
|
|
|
function jumpBgd() {
|
|
|
|
|
window.location.replace("http://192.168.34.226:8081/#/projectIndex");
|
|
|
|
|
}
|
2023-07-12 09:56:31 +08:00
|
|
|
</script>
|
|
|
|
|
|
2023-07-28 19:43:56 +08:00
|
|
|
<style>
|
|
|
|
|
.el-popper__arrow {
|
|
|
|
|
background-color: #112d59;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
2023-07-12 09:56:31 +08:00
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.largeScreen {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
background: url("@/assets/images/bigImg.gif") no-repeat;
|
|
|
|
|
background-size: 100% 100%;
|
2023-09-04 14:43:33 +08:00
|
|
|
|
2023-07-12 09:56:31 +08:00
|
|
|
.header {
|
|
|
|
|
width: 100vw;
|
|
|
|
|
height: 12%;
|
|
|
|
|
background: url("@/assets/images/headerImg.webp") no-repeat;
|
|
|
|
|
background-size: 100% 100%;
|
|
|
|
|
.projectTitle {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
font-size: calc(100vw * 42 / 1920);
|
|
|
|
|
color: #fff;
|
|
|
|
|
font-family: YouSheBiaoTiHei;
|
|
|
|
|
line-height: 4vh;
|
|
|
|
|
}
|
|
|
|
|
.rightIcon {
|
|
|
|
|
position: absolute;
|
|
|
|
|
display: flex;
|
|
|
|
|
width: 30%;
|
|
|
|
|
left: 70%;
|
|
|
|
|
color: #fff;
|
|
|
|
|
top: 1%;
|
|
|
|
|
.time {
|
|
|
|
|
font-size: calc(100vw * 12 / 1920);
|
|
|
|
|
font-family: sadigitalNumber;
|
|
|
|
|
margin-left: 10%;
|
2023-07-28 19:43:56 +08:00
|
|
|
margin-right: 40%;
|
2023-07-12 09:56:31 +08:00
|
|
|
}
|
|
|
|
|
.Icon {
|
|
|
|
|
margin-right: 2%;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.menuList {
|
|
|
|
|
display: flex;
|
|
|
|
|
height: 6%;
|
|
|
|
|
color: #ccc;
|
|
|
|
|
line-height: 55px;
|
|
|
|
|
margin: -4% auto 0 2%;
|
|
|
|
|
font-family: pmzd;
|
|
|
|
|
div {
|
|
|
|
|
margin-top: 1%;
|
|
|
|
|
height: 60%;
|
|
|
|
|
width: 10%;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
text-align: center;
|
|
|
|
|
line-height: 36px;
|
|
|
|
|
font-size: calc(100vw * 20 / 1920);
|
|
|
|
|
}
|
|
|
|
|
:nth-child(5) {
|
|
|
|
|
margin-left: 35%;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.dataBoardContent {
|
2023-07-13 15:37:02 +08:00
|
|
|
height: 83%;
|
2023-07-12 09:56:31 +08:00
|
|
|
// height: calc(100% - 15px - 50px - 60px - 20px);
|
|
|
|
|
margin: 15px auto 16px auto;
|
|
|
|
|
width: calc(100% - 40px);
|
|
|
|
|
// background-color: #01131F;
|
|
|
|
|
// opacity: 0.9;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.active {
|
|
|
|
|
height: 100%;
|
|
|
|
|
width: 20%;
|
|
|
|
|
// background: pink;
|
|
|
|
|
background: url("@/assets/images/dustNoise/menuImg.png") no-repeat;
|
|
|
|
|
background-size: 100% 100%;
|
|
|
|
|
}
|
2023-07-28 19:43:56 +08:00
|
|
|
.userDialog {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
width: 70px;
|
|
|
|
|
height: 25px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
background-color: #112d59;
|
|
|
|
|
color: #5d75a0;
|
|
|
|
|
font-size: calc(100vw * 12 / 1920);
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.userBox {
|
|
|
|
|
.userItem {
|
|
|
|
|
position: absolute;
|
|
|
|
|
width: 100px;
|
2023-09-04 14:43:33 +08:00
|
|
|
height: 100px;
|
2023-07-28 19:43:56 +08:00
|
|
|
right: 3%;
|
|
|
|
|
top: 4%;
|
|
|
|
|
background: #112d59;
|
|
|
|
|
border-radius: 0px 0px 0px 0px;
|
|
|
|
|
border: 0px solid #405e97;
|
|
|
|
|
.sanJiao {
|
|
|
|
|
position: absolute;
|
|
|
|
|
width: 0;
|
|
|
|
|
height: 0;
|
|
|
|
|
right: 0%;
|
|
|
|
|
top: -10%;
|
|
|
|
|
border-left: 6px solid transparent; /* 左边框透明 */
|
|
|
|
|
border-right: 6px solid transparent; /* 右边框透明 */
|
|
|
|
|
border-bottom: 6px solid #405e97; /* 底部边框颜色 */
|
|
|
|
|
transform: rotate(0deg); /* 旋转45度 */
|
|
|
|
|
}
|
|
|
|
|
.userIcon {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-evenly;
|
|
|
|
|
height: 38px;
|
|
|
|
|
border-bottom: 1px solid #405e97;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
.icon {
|
|
|
|
|
width: 18px;
|
|
|
|
|
height: 18px;
|
|
|
|
|
img {
|
|
|
|
|
width: 100&;
|
|
|
|
|
height: 100%;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.userName {
|
|
|
|
|
width: 40px;
|
|
|
|
|
font-size: calc(100vw * 12 / 1920);
|
|
|
|
|
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
|
|
|
|
color: #a9bce6;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.loginOut {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-evenly;
|
|
|
|
|
align-items: center;
|
|
|
|
|
height: 26px;
|
2023-09-04 14:43:33 +08:00
|
|
|
padding-left: 5px;
|
2023-07-28 19:43:56 +08:00
|
|
|
cursor: pointer;
|
2023-09-04 14:43:33 +08:00
|
|
|
height: 30px;
|
2023-07-28 19:43:56 +08:00
|
|
|
.loginOutIcon {
|
|
|
|
|
width: 12px;
|
|
|
|
|
height: 12px;
|
|
|
|
|
img {
|
|
|
|
|
width: 100&;
|
|
|
|
|
height: 100%;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.userName {
|
|
|
|
|
width: 50px;
|
|
|
|
|
font-size: calc(100vw * 12 / 1920);
|
|
|
|
|
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
|
|
|
|
color: #a9bce6;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.loginOut:hover {
|
|
|
|
|
background-color: #2758c0;
|
|
|
|
|
}
|
2023-07-12 09:56:31 +08:00
|
|
|
</style>
|