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

bugfix

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