Commit 1d675900 by liuwange1

更改要暖色

parent 8d379460
...@@ -113,7 +113,7 @@ export default { ...@@ -113,7 +113,7 @@ export default {
url: require("./assets/image/icon5.png"), url: require("./assets/image/icon5.png"),
label: "智慧能耗", label: "智慧能耗",
routerName: "nengyuan", routerName: "nengyuan",
menuCode: "NF", menuCode: "NH",
}, },
{ {
url: require("./assets/image/icon6.png"), url: require("./assets/image/icon6.png"),
...@@ -346,6 +346,8 @@ export default { ...@@ -346,6 +346,8 @@ export default {
}; };
websocket.onmessage = function (event) { websocket.onmessage = function (event) {
console.log("event: ", event);
console.log(JSON.parse(event.data));
try { try {
let data = JSON.parse(event.data); let data = JSON.parse(event.data);
data.data.isNew = true; data.data.isNew = true;
......
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
<div <div
class="btn2" class="btn2"
:class="{ active: monitorIndex == index }" :class="{ active: monitorIndex == index }"
:style="{ color: '1px solid' + getColor(item.monitorStatus) }"
v-for="(item, index) in optionsList" v-for="(item, index) in optionsList"
:key="index + 'list'" :key="index + 'list'"
@click="monitorChange(index)" @click="monitorChange(index)"
...@@ -141,7 +142,7 @@ export default { ...@@ -141,7 +142,7 @@ export default {
return { return {
options: ["监控摄像头", "AI智能摄像头"], options: ["监控摄像头", "AI智能摄像头"],
optionKeys: ["CAMERA_MONITOR", "CAMERA_AI"], optionKeys: ["CAMERA_MONITOR", "CAMERA_AI"],
optionActiveIndex: 0, optionActiveIndex: -1,
osc: 11, osc: 11,
oscName: "/EZ_AF", oscName: "/EZ_AF",
roadList: [], roadList: [],
...@@ -173,6 +174,17 @@ export default { ...@@ -173,6 +174,17 @@ export default {
this.listL = buildList; this.listL = buildList;
this.listR = this.listL[0].child || []; this.listR = this.listL[0].child || [];
}, },
getColor(type) {
if (type == "故障") {
return "red";
} else if (type == "异常") {
return "#dc68dc";
} else if (type == "离线") {
return "#c2c2c2";
} else {
return "";
}
},
changeOption(index) { changeOption(index) {
this.optionActiveIndex = index; this.optionActiveIndex = index;
if (index) { if (index) {
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
class="btn2" class="btn2"
:class="{ active: activeIndex == index }" :class="{ active: activeIndex == index }"
v-for="(item, index) in equipmentList" v-for="(item, index) in equipmentList"
:style="{ color: '1px solid' + getColor(item.deviceStatus) }"
@click="equipmentClickHandle(index)" @click="equipmentClickHandle(index)"
:key="item.deviceStandCode" :key="item.deviceStandCode"
> >
...@@ -75,6 +76,17 @@ export default { ...@@ -75,6 +76,17 @@ export default {
}; };
}, },
methods: { methods: {
getColor(type) {
if (type == "故障") {
return "red";
} else if (type == "异常") {
return "#dc68dc";
} else if (type == "离线") {
return "#c2c2c2";
} else {
return "";
}
},
changeOption(index) { changeOption(index) {
this.optionActiveIndex = index; this.optionActiveIndex = index;
this.$axios this.$axios
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
<div <div
class="btn2" class="btn2"
:class="{ active: activeIndex == index }" :class="{ active: activeIndex == index }"
:style="{ color: '1px solid' + getColor(item.deviceStatus) }"
v-for="(item, index) in equipmentList" v-for="(item, index) in equipmentList"
@click="equipmentClickHandle(index)" @click="equipmentClickHandle(index)"
:key="item.deviceStandCode" :key="item.deviceStandCode"
...@@ -72,6 +73,17 @@ export default { ...@@ -72,6 +73,17 @@ export default {
}, },
created() {}, created() {},
methods: { methods: {
getColor(type) {
if (type == "故障") {
return "red";
} else if (type == "异常") {
return "#dc68dc";
} else if (type == "离线") {
return "#c2c2c2";
} else {
return "";
}
},
changeOption(index) { changeOption(index) {
this.optionActiveIndex = index; this.optionActiveIndex = index;
this.$axios this.$axios
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
<div <div
class="btn2 ww" class="btn2 ww"
:class="{ active: activeIndex == index }" :class="{ active: activeIndex == index }"
:style="{ color: '1px solid' + getColor(item.deviceStatus) }"
v-for="(item, index) in equipmentList" v-for="(item, index) in equipmentList"
@click="equipmentClickHandle(index)" @click="equipmentClickHandle(index)"
:key="item.deviceStandCode" :key="item.deviceStandCode"
...@@ -92,6 +93,17 @@ export default { ...@@ -92,6 +93,17 @@ export default {
this.ids = e; this.ids = e;
this.getEquipmentList(); this.getEquipmentList();
}, },
getColor(type) {
if (type == "故障") {
return "red";
} else if (type == "异常") {
return "#dc68dc";
} else if (type == "离线") {
return "#c2c2c2";
} else {
return "";
}
},
changeOption(index) { changeOption(index) {
this.optionActiveIndex = index; this.optionActiveIndex = index;
this.activeIndex = -1; this.activeIndex = -1;
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
class="btn2" class="btn2"
:class="{ active: activeIndex == index }" :class="{ active: activeIndex == index }"
v-for="(item, index) in equipmentList" v-for="(item, index) in equipmentList"
:style="{ color: '1px solid' + getColor(item.deviceStatus) }"
@click="equipmentClickHandle(index)" @click="equipmentClickHandle(index)"
:key="item.deviceStandCode" :key="item.deviceStandCode"
> >
...@@ -52,7 +53,21 @@ export default { ...@@ -52,7 +53,21 @@ export default {
activeIndex: -1, activeIndex: -1,
}; };
}, },
created() {
this.buildListChange({});
},
methods: { methods: {
getColor(type) {
if (type == "故障") {
return "red";
} else if (type == "异常") {
return "#dc68dc";
} else if (type == "离线") {
return "#c2c2c2";
} else {
return "";
}
},
changeOption(index) { changeOption(index) {
this.optionActiveIndex = index; this.optionActiveIndex = index;
this.$axios this.$axios
......
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 sign in to comment