Commit aebe1bbf authored by 张牧越's avatar 张牧越

bugfix

parent eabd019e
......@@ -15,7 +15,7 @@
</div>
</div>
</div>
<template v-for="(router, index) in leftNav">
<template v-for="(router, index) in totalMenu.slice(0, 3)">
<div
v-if="router.child && router.child.length == 0"
:key="index"
......@@ -63,7 +63,9 @@
</div>
<div class="right-nav">
<div class="invisible"></div>
<template v-for="(router, index) in rightNav">
<template
v-for="(router, index) in totalMenu.slice(3, totalMenu.length)"
>
<router-link
v-if="router.child && router.child.length == 0"
:key="index"
......@@ -235,7 +237,8 @@ export default {
getBaseInfo().then((res) => {
this.screenDetail = res.data;
document.title = res.data.project_name;
let menu = res.data.menu.map((item) => {
this.totalMenu = res.data.menu.map((item) => {
return {
...item,
isActive:
......@@ -244,7 +247,7 @@ export default {
}).length > 0,
};
});
let selectedMenu = menu.filter((item) => {
let selectedMenu = this.totalMenu.filter((item) => {
return item.isActive;
});
if (selectedMenu.length > 0) {
......@@ -256,12 +259,6 @@ export default {
return this.$route.path == item.menu_url;
})[0].right_name;
}
if (res.data.menu.length >= 3) {
this.leftNav = menu.slice(0, 3);
this.rightNav = menu.slice(3, res.data.menu.length);
} else {
this.leftNav = [...menu];
}
});
var isChrome = window.navigator.userAgent.indexOf("Chrome") !== -1;
if (isChrome) {
......@@ -273,6 +270,34 @@ export default {
this.getTime();
}, 1000);
},
watch: {
$route() {
this.totalMenu = this.totalMenu.map((item) => {
return {
...item,
isActive:
item.child.filter((item) => {
return this.$route.path == item.menu_url;
}).length > 0,
};
});
let selectedMenu = this.totalMenu.filter((item) => {
return item.isActive;
});
if (selectedMenu.length > 0) {
this.childRouteName =
selectedMenu[0].child.filter((item) => {
return this.$route.path == item.menu_url;
})[0] &&
selectedMenu[0].child.filter((item) => {
return this.$route.path == item.menu_url;
})[0].right_name;
} else {
this.childRouteName = "";
}
},
},
};
</script>
<style scoped lang="less">
......@@ -300,7 +325,6 @@ export default {
.mid-title {
width: calc(100% / 3);
font-size: 28px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #fefeff;
text-align: center;
......
......@@ -25,7 +25,6 @@ export default {
width: 100%;
text-align: center;
font-size: 20px;
font-family: Microsoft YaHei;
font-weight: bold;
color: #ffffff;
letter-spacing: 2px;
......
......@@ -253,6 +253,7 @@
class="status-count"
v-for="(status, index) in deviceStatus"
:key="index"
@click="jumpPage(status)"
>
<img class="status-img" :src="status.icon_path" alt="" />
<div class="status-detail">
......@@ -455,25 +456,34 @@ export default {
}
);
this.progressDetail.step = this.progressDetail.step + 1;
this.$nextTick(() => {
let wait_step = document
.getElementById("step-scroll")
.getElementsByClassName("el-step");
let wait_line = wait_step[
insertIndex - 1
].getElementsByClassName("el-step__line-inner")[0];
wait_line.style.cssText =
"transition-delay: 150ms; width: 100%!important;border-width:0px!important";
});
} else {
this.progressDetail.progress_data.splice(insertIndex, 0, {
over_date: this.getTime(),
status_text: "当前进度",
name: "当时日期",
});
}
this.$nextTick(() => {
let wait_step = document
.getElementById("step-scroll")
.getElementsByClassName("el-step");
let wait_line = wait_step[insertIndex - 1].getElementsByClassName(
"el-step__line-inner"
)[0];
let wait_line = wait_step[
insertIndex - 1
].getElementsByClassName("el-step__line-inner")[0];
wait_line.style.cssText =
"transition-delay: 150ms; width: 100%!important;";
console.log(wait_line);
"transition-delay: 150ms; width: 100%!important";
});
}
}
this.$nextTick(() => {
const element = document.getElementById("scroll-container");
......@@ -570,6 +580,54 @@ export default {
this.autoScrollX(1, 50, 1500, element);
});
},
jumpPage(item) {
if (item.type == 1) {
this.$router.push({
path: "/tower",
query: { token_code: localStorage.getItem("token") },
});
} else if (item.type == 2) {
this.$router.push({
path: "/supervisory",
query: { token_code: localStorage.getItem("token") },
});
} else if (item.type == 3) {
this.$router.push({
path: "/realname",
query: { token_code: localStorage.getItem("token") },
});
} else if (item.type == 4) {
this.$router.push({
path: "/safecap",
query: { token_code: localStorage.getItem("token") },
});
} else if (item.type == 8) {
this.$router.push({
path: "/earlywarning",
query: { token_code: localStorage.getItem("token") },
});
} else if (item.type == 9) {
this.$router.push({
path: "/noise",
query: { token_code: localStorage.getItem("token") },
});
} else if (item.type == 13) {
this.$router.push({
path: "/fallprotection",
query: { token_code: localStorage.getItem("token") },
});
} else if (item.type == 14) {
this.$router.push({
path: "/unloadingplatform",
query: { token_code: localStorage.getItem("token") },
});
} else if (item.type == 15) {
this.$router.push({
path: "/elevator",
query: { token_code: localStorage.getItem("token") },
});
}
},
},
mounted() {
......@@ -848,6 +906,7 @@ table {
width: calc(100% / 3);
padding: 30px 0px;
text-align: center;
cursor: pointer;
.status-img {
width: 50px;
}
......@@ -977,6 +1036,13 @@ table {
display: inline !important;
}
.el-steps {
// ::v-deep .el-step__head.is-process {
// ::v-deep .el-step__line {
// ::v-deep .el-step__line-inner {
// border-width: 0px !important;
// }
// }
// }
::v-deep .el-step.wait {
.el-step__icon,
.el-step__line {
......
......@@ -805,7 +805,6 @@ export default {
background: rgba(255, 175, 81, 0.1);
border: 1px solid #ffaf51;
font-size: 16px;
font-family: Microsoft YaHei;
font-weight: bold;
color: #ffaf51;
display: inline-block;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment