From 16569746c1a63089fb91354876772ee988338f66 Mon Sep 17 00:00:00 2001 From: Sjh <55341701@qq.com> Date: Fri, 10 Nov 2023 15:08:45 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E9=A2=84=E8=AD=A6=E6=A1=86?= =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../get-out-of-line-details.component.ts | 66 ++++++++++++------- 1 file changed, 44 insertions(+), 22 deletions(-) diff --git a/src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.ts b/src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.ts index 8c6ab74..0adda6e 100644 --- a/src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.ts +++ b/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 = []; //当前需要标绘坐标点信息 legendList: any = []; typeArr = [ - { id: 0, name: "工装", color: "#91CCFF" }, - { id: 2, name: "便装", color: "#46DFFF" }, - { id: 2, name: "抽烟", color: "#36A2FF" }, - { id: 3, name: "打电话", color: "#FF6181" }, - { id: 4, name: "隔离锥", color: "#000000" }, - { id: 5, name: "手持灭火器", color: "#ffffff" }, - { id: 6, name: "推车灭火器", color: "#B4C3FF" }, - { id: 7, name: "静电接地", color: "#FF9963" }, - { id: 8, name: "输油管(连接)", color: "#5A9CFF" }, - { id: 9, name: "输油管连接车", color: "#4BFFD4" }, - { id: 10, name: "输油管连接卸油口", color: "red" }, - { id: 11, name: "卸油口盖子", color: "green" }, - { id: 12, name: "卸油车", color: "yellow" }, - { id: 13, name: "私家车", color: "black" }, - { id: 14, name: "断开的卸油管", color: "blue" }, - { id: 15, name: "烟雾预警", color: "#B4C3FF" }, - { id: 16, name: "火灾报警", color: "red" }, - { id: 17, name: "延长工装", color: "blue" }, - { id: 18, name: "江苏工装", color: "blue" }, - { id: 19, name: "经理工装", color: "yellow" }, + // { id: 0, name: "工装", color: "#91CCFF" }, + // { id: 2, name: "便装", color: "#46DFFF" }, + // { id: 2, name: "抽烟", color: "#36A2FF" }, + // { id: 3, name: "打电话", color: "#FF6181" }, + // { id: 4, name: "隔离锥", color: "#000000" }, + // { id: 5, name: "手持灭火器", color: "#ffffff" }, + // { id: 6, name: "推车灭火器", color: "#B4C3FF" }, + // { id: 7, name: "静电接地", color: "#FF9963" }, + // { id: 8, name: "输油管(连接)", color: "#5A9CFF" }, + // { id: 9, name: "输油管连接车", color: "#4BFFD4" }, + // { id: 10, name: "输油管连接卸油口", color: "red" }, + // { id: 11, name: "卸油口盖子", color: "green" }, + // { id: 12, name: "卸油车", color: "yellow" }, + // { id: 13, name: "私家车", color: "black" }, + // { id: 14, name: "断开的卸油管", color: "blue" }, + // { id: 15, name: "烟雾预警", color: "#B4C3FF" }, + // { id: 16, name: "火灾报警", color: "red" }, + // { id: 17, name: "延长工装", color: "blue" }, + // { id: 18, name: "江苏工装", color: "blue" }, + // { 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; //登录账号的用户名 isShowAxOtherRegion; //控制哪些用户可以看到ax全部 @@ -276,10 +283,24 @@ export class GetOutOfLineDetailsComponent implements OnInit { this.ctx.fillStyle = this.typeArr[item.id].color; this.ctx.font = "16px Verdana"; let name = ""; + // ⛑️ 戴了 + // 👷‍♂️ 没戴 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 { - 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( name, @@ -290,6 +311,7 @@ export class GetOutOfLineDetailsComponent implements OnInit { ); } else { if (item.error) { + console.log("走了几遍222", this.typeArr[item.id].name); this.ctx.strokeStyle = this.typeArr[item.id].color; this.ctx.lineWidth = 3; this.ctx.strokeRect(