Browse Source

[完善]预警框完善

beijing
邵佳豪 1 year ago
parent
commit
16569746c1
  1. 66
      src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.ts

66
src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.ts

@ -49,26 +49,33 @@ export class GetOutOfLineDetailsComponent implements OnInit {
currentCoordinate = []; //当前需要标绘坐标点信息 currentCoordinate = []; //当前需要标绘坐标点信息
legendList: any = []; legendList: any = [];
typeArr = [ typeArr = [
{ id: 0, name: "工装", color: "#91CCFF" }, // { id: 0, name: "工装", color: "#91CCFF" },
{ id: 2, name: "便装", color: "#46DFFF" }, // { id: 2, name: "便装", color: "#46DFFF" },
{ id: 2, name: "抽烟", color: "#36A2FF" }, // { id: 2, name: "抽烟", color: "#36A2FF" },
{ id: 3, name: "打电话", color: "#FF6181" }, // { id: 3, name: "打电话", color: "#FF6181" },
{ id: 4, name: "隔离锥", color: "#000000" }, // { id: 4, name: "隔离锥", color: "#000000" },
{ id: 5, name: "手持灭火器", color: "#ffffff" }, // { id: 5, name: "手持灭火器", color: "#ffffff" },
{ id: 6, name: "推车灭火器", color: "#B4C3FF" }, // { id: 6, name: "推车灭火器", color: "#B4C3FF" },
{ id: 7, name: "静电接地", color: "#FF9963" }, // { id: 7, name: "静电接地", color: "#FF9963" },
{ id: 8, name: "输油管(连接)", color: "#5A9CFF" }, // { id: 8, name: "输油管(连接)", color: "#5A9CFF" },
{ id: 9, name: "输油管连接车", color: "#4BFFD4" }, // { id: 9, name: "输油管连接车", color: "#4BFFD4" },
{ id: 10, name: "输油管连接卸油口", color: "red" }, // { id: 10, name: "输油管连接卸油口", color: "red" },
{ id: 11, name: "卸油口盖子", color: "green" }, // { id: 11, name: "卸油口盖子", color: "green" },
{ id: 12, name: "卸油车", color: "yellow" }, // { id: 12, name: "卸油车", color: "yellow" },
{ id: 13, name: "私家车", color: "black" }, // { id: 13, name: "私家车", color: "black" },
{ id: 14, name: "断开的卸油管", color: "blue" }, // { id: 14, name: "断开的卸油管", color: "blue" },
{ id: 15, name: "烟雾预警", color: "#B4C3FF" }, // { id: 15, name: "烟雾预警", color: "#B4C3FF" },
{ id: 16, name: "火灾报警", color: "red" }, // { id: 16, name: "火灾报警", color: "red" },
{ id: 17, name: "延长工装", color: "blue" }, // { id: 17, name: "延长工装", color: "blue" },
{ id: 18, name: "江苏工装", color: "blue" }, // { id: 18, name: "江苏工装", color: "blue" },
{ id: 19, name: "经理工装", color: "yellow" }, // { id: 19, name: "经理工装", color: "yellow" },
{ id: 0, name: "安全帽", color: "yellow" },
{ id: 1, name: "清醒人", color: "blue" },
{ id: 2, name: "睡觉人", color: "blue" },
{ id: 3, name: "抽烟", color: "red" },
{ id: 4, name: "打电话", color: "pink" },
{ id: 5, name: "灭火器", color: "green" },
{ id: 6, name: "隔离锥", color: "gray" },
]; ];
userName; //登录账号的用户名 userName; //登录账号的用户名
isShowAxOtherRegion; //控制哪些用户可以看到ax全部 isShowAxOtherRegion; //控制哪些用户可以看到ax全部
@ -276,10 +283,24 @@ export class GetOutOfLineDetailsComponent implements OnInit {
this.ctx.fillStyle = this.typeArr[item.id].color; this.ctx.fillStyle = this.typeArr[item.id].color;
this.ctx.font = "16px Verdana"; this.ctx.font = "16px Verdana";
let name = ""; let name = "";
// ⛑ 戴了
// 👷 没戴
if (this.isShowAxOtherRegion) { if (this.isShowAxOtherRegion) {
name = this.typeArr[item.id].name + item.scores; if (this.typeArr[item.id].name.indexOf("人") !== -1) {
let icon;
item.helmet_person ? (icon = "⛑") : (icon = "👷");
name = icon + this.typeArr[item.id].name + item.scores;
} else {
name = this.typeArr[item.id].name + item.scores;
}
} else { } else {
name = this.typeArr[item.id].name; if (this.typeArr[item.id].name.indexOf("人") !== -1) {
let icon;
item.helmet_person ? (icon = "⛑") : (icon = "👷");
name = icon + this.typeArr[item.id].name;
} else {
name = this.typeArr[item.id].name;
}
} }
this.ctx.fillText( this.ctx.fillText(
name, name,
@ -290,6 +311,7 @@ export class GetOutOfLineDetailsComponent implements OnInit {
); );
} else { } else {
if (item.error) { if (item.error) {
console.log("走了几遍222", this.typeArr[item.id].name);
this.ctx.strokeStyle = this.typeArr[item.id].color; this.ctx.strokeStyle = this.typeArr[item.id].color;
this.ctx.lineWidth = 3; this.ctx.lineWidth = 3;
this.ctx.strokeRect( this.ctx.strokeRect(

Loading…
Cancel
Save