From 8d9fd8fba1bee3846f37e2eea1857860be8dec04 Mon Sep 17 00:00:00 2001
From: SHAOJIAHAO <55341701@qq.com>
Date: Thu, 25 May 2023 11:48:17 +0800
Subject: [PATCH 1/3] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E6=9F=A5=E7=9C=8B?=
=?UTF-8?q?=E9=A2=84=E8=AD=A6=E5=A2=9E=E5=8A=A0=E5=AE=89=E4=BF=A1=E6=8E=A8?=
=?UTF-8?q?=E9=80=81=E7=9A=84=E6=9F=A5=E7=9C=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../get-out-of-line-details.component.html | 19 +-
.../get-out-of-line-details.component.scss | 34 +++-
.../get-out-of-line-details.component.ts | 176 ++++++++++++++++++
3 files changed, 226 insertions(+), 3 deletions(-)
diff --git a/src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.html b/src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.html
index 030f76c..1311598 100644
--- a/src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.html
+++ b/src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.html
@@ -18,11 +18,26 @@
预警详情:{{details}}
+
+
+
+
+
+
+
+
-
+
-
+
+
diff --git a/src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.scss b/src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.scss
index ee16da5..32c1ee4 100644
--- a/src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.scss
+++ b/src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.scss
@@ -1,6 +1,6 @@
.box {
width: 100%;
- height: 715px;
+ min-height: 715px;
// overflow-y: auto;
color: #fff;
display: flex;
@@ -76,16 +76,41 @@
padding: 0 12px;
}
+.typecheckbox {
+ box-sizing: border-box;
+ padding: 0 12px;
+ margin-bottom: 6px;
+
+ label {
+ color: #fff;
+ }
+
+}
+
.content {
flex: 1;
overflow: hidden;
+ display: flex;
+ align-items: center;
+ justify-content: center;
.imgbox {
+ box-sizing: border-box;
+ padding: 0 12px;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
+ position: relative;
+ // margin-bottom: 12px;
+
+ #canvas {
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ transform: translate(-50%, -50%);
+ }
img {
max-width: 100%;
@@ -93,6 +118,13 @@
}
}
+ .imgboxAX {
+ img {
+ width: 100%;
+ height: auto;
+ }
+ }
+
.vediobox {
width: 100%;
height: 100%;
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 b282461..bebf449 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
@@ -42,7 +42,67 @@ export class GetOutOfLineDetailsComponent implements OnInit {
isLicenseWarning = false;
isSubmit;
+
+ // 标注安信框选区
+ isAnxin = false;
+ coordinate = []; //完整坐标点信息
+ 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" },
+ ];
+ userName; //登录账号的用户名
+ isShowAxOtherRegion; //控制哪些用户可以看到ax全部
ngOnInit(): void {
+ // 安信框选
+ this.userName = JSON.parse(sessionStorage.getItem("userdata")).userName;
+ if (this.userName === "admin" || this.userName === "superadmin") {
+ this.isShowAxOtherRegion = true;
+ } else {
+ this.isShowAxOtherRegion = false;
+ }
+ if (this.data.violatedItemSnapshot) {
+ this.isAnxin = true;
+ }
+ let dataArr = [];
+ for (const key in JSON.parse(this.data.violatedItemSnapshot)) {
+ const element = JSON.parse(this.data.violatedItemSnapshot)[key];
+ dataArr.push(element);
+ }
+ this.coordinate = dataArr;
+ this.currentCoordinate = JSON.parse(JSON.stringify(this.coordinate));
+ console.log("坐标信息", this.coordinate);
+
+ let checkboxArr = [];
+ this.coordinate.forEach((element) => {
+ checkboxArr.push({ id: element.id, checked: true });
+ });
+
+ for (let i = 0; i < checkboxArr.length; i++) {
+ if (!this.legendList.some((e) => e.id == checkboxArr[i].id))
+ this.legendList.push(checkboxArr[i]);
+ }
+ setTimeout(() => {
+ if (this.isAnxin == true) {
+ this.canvasLabel();
+ }
+ }, 0);
+ // 安信框选
+
console.log("预警信息", this.data);
if (this.data.violation.violationType == "证照资质") {
@@ -106,6 +166,122 @@ export class GetOutOfLineDetailsComponent implements OnInit {
this.isMisinformation = false;
}
}
+
+ canvasWidth = 0;
+ canvasHeight = 0;
+ ctx;
+ canvasLabel() {
+ let imgBg: any = document.getElementById("img");
+ imgBg.onload = () => {
+ this.canvasWidth = imgBg.offsetWidth;
+ this.canvasHeight = imgBg.offsetHeight;
+ const img = new Image();
+ img.src = imgBg.src;
+ img.onload = () => {
+ const canvas: any = document.querySelector("#canvas");
+ this.ctx = canvas.getContext("2d");
+ const cWidth = canvas.width,
+ cHeight = canvas.height;
+ // 以图画底
+ this.ctx.drawImage(img, 0, 0, cWidth, cHeight);
+ this.strokeRect(this.currentCoordinate);
+ };
+ };
+ }
+
+ strokeRect(data) {
+ data.forEach((item) => {
+ let startPoint = [
+ Math.round(this.canvasWidth * item.box[0]),
+ Math.round(this.canvasHeight * item.box[1]),
+ ];
+ let endPoint = [
+ Math.round(this.canvasWidth * item.box[2]),
+ Math.round(this.canvasHeight * item.box[3]),
+ ];
+ if (this.isShowAxOtherRegion) {
+ this.ctx.strokeStyle = this.typeArr[item.id].color;
+ this.ctx.lineWidth = 3;
+ this.ctx.strokeRect(
+ startPoint[0],
+ startPoint[1],
+ endPoint[0] - startPoint[0],
+ endPoint[1] - startPoint[1]
+ );
+ //如果当前矩形区域为错误区域,则左上角增加色块
+ if (item.error) {
+ this.ctx.fillStyle = this.typeArr[item.id].color;
+ this.ctx.fillRect(startPoint[0], startPoint[1], 10, 10);
+ }
+ 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;
+ } else {
+ name = this.typeArr[item.id].name;
+ }
+ this.ctx.fillText(
+ name,
+ startPoint[0],
+ startPoint[1] < 20 || item.id === 2 || item.id === 3
+ ? endPoint[1] + 18
+ : startPoint[1] - 5
+ );
+ } else {
+ if (item.error) {
+ this.ctx.strokeStyle = this.typeArr[item.id].color;
+ this.ctx.lineWidth = 3;
+ this.ctx.strokeRect(
+ startPoint[0],
+ startPoint[1],
+ endPoint[0] - startPoint[0],
+ endPoint[1] - startPoint[1]
+ );
+ this.ctx.fillStyle = this.typeArr[item.id].color;
+ this.ctx.fillRect(startPoint[0], startPoint[1], 10, 10);
+ this.ctx.fillStyle = this.typeArr[item.id].color;
+ this.ctx.font = "16px Verdana";
+ let name = this.typeArr[item.id].name;
+ // this.ctx.fillText(
+ // name,
+ // startPoint[0],
+ // startPoint[1] < 20 || item.id === 2 || item.id === 3
+ // ? endPoint[1] + 18
+ // : startPoint[1] - 5
+ // );
+ }
+ }
+ });
+ }
+ typeChange(item) {
+ if (item.checked) {
+ this.coordinate.forEach((element) => {
+ if (element.id === item.id) {
+ this.currentCoordinate.push(element);
+ }
+ });
+ } else {
+ this.currentCoordinate = this.currentCoordinate.filter(
+ (v) => v.id !== item.id
+ );
+ }
+ this.ctx.clearRect(0, 0, this.canvasWidth, this.canvasHeight);
+ this.strokeRect(this.currentCoordinate);
+ }
+
+ downImg() {
+ const canvasDom: any = document.querySelector("#canvas");
+ const imageData = canvasDom.toDataURL("image/png"); //返回base64的URL
+ const elink = document.createElement("a");
+ elink.download = "图片";
+ elink.style.display = "none";
+ elink.href = imageData;
+ document.body.appendChild(elink);
+ elink.click();
+ URL.revokeObjectURL(elink.href); //释放URL对象
+ document.body.removeChild(elink);
+ }
fileList = [];
isLoadingSave: boolean = false;
From 4e79fdc69f04394561c70bfd88bb038c3cd0ef3d Mon Sep 17 00:00:00 2001
From: SHAOJIAHAO <55341701@qq.com>
Date: Thu, 25 May 2023 15:57:53 +0800
Subject: [PATCH 2/3] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E5=AE=89=E4=BF=A1?=
=?UTF-8?q?=E5=9D=90=E6=A0=87=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../get-out-of-line-details.component.scss | 8 +++-
.../get-out-of-line-details.component.ts | 48 +++++++++++--------
2 files changed, 33 insertions(+), 23 deletions(-)
diff --git a/src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.scss b/src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.scss
index 32c1ee4..e31644a 100644
--- a/src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.scss
+++ b/src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.scss
@@ -93,8 +93,9 @@
display: flex;
align-items: center;
justify-content: center;
-
+ flex-direction: column;
.imgbox {
+ flex: 1;
box-sizing: border-box;
padding: 0 12px;
width: 100%;
@@ -104,7 +105,10 @@
justify-content: center;
position: relative;
// margin-bottom: 12px;
-
+ flex-direction: column;
+ iframe{
+ flex: 1;
+ }
#canvas {
position: absolute;
left: 50%;
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 bebf449..f0f8339 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
@@ -68,6 +68,7 @@ export class GetOutOfLineDetailsComponent implements OnInit {
userName; //登录账号的用户名
isShowAxOtherRegion; //控制哪些用户可以看到ax全部
ngOnInit(): void {
+
// 安信框选
this.userName = JSON.parse(sessionStorage.getItem("userdata")).userName;
if (this.userName === "admin" || this.userName === "superadmin") {
@@ -75,32 +76,37 @@ export class GetOutOfLineDetailsComponent implements OnInit {
} else {
this.isShowAxOtherRegion = false;
}
- if (this.data.violatedItemSnapshot) {
+ if (
+ this.data.violatedItemSnapshot &&
+ this.data.violation.eventSystemName.indexOf("证照") == -1 &&
+ this.data.violation.eventSystemName.indexOf("设备") == -1
+ ) {
this.isAnxin = true;
}
- let dataArr = [];
- for (const key in JSON.parse(this.data.violatedItemSnapshot)) {
- const element = JSON.parse(this.data.violatedItemSnapshot)[key];
- dataArr.push(element);
- }
- this.coordinate = dataArr;
- this.currentCoordinate = JSON.parse(JSON.stringify(this.coordinate));
- console.log("坐标信息", this.coordinate);
+ if (this.isAnxin) {
+ let dataArr = [];
+ for (const key in JSON.parse(this.data.violatedItemSnapshot)) {
+ const element = JSON.parse(this.data.violatedItemSnapshot)[key];
+ dataArr.push(element);
+ }
+ this.coordinate = dataArr;
+ this.currentCoordinate = JSON.parse(JSON.stringify(this.coordinate));
+ console.log("坐标信息", this.coordinate);
- let checkboxArr = [];
- this.coordinate.forEach((element) => {
- checkboxArr.push({ id: element.id, checked: true });
- });
+ let checkboxArr = [];
+ this.coordinate.forEach((element) => {
+ checkboxArr.push({ id: element.id, checked: true });
+ });
- for (let i = 0; i < checkboxArr.length; i++) {
- if (!this.legendList.some((e) => e.id == checkboxArr[i].id))
- this.legendList.push(checkboxArr[i]);
- }
- setTimeout(() => {
- if (this.isAnxin == true) {
- this.canvasLabel();
+ for (let i = 0; i < checkboxArr.length; i++) {
+ if (!this.legendList.some((e) => e.id == checkboxArr[i].id))
+ this.legendList.push(checkboxArr[i]);
}
- }, 0);
+ setTimeout(() => {
+ this.canvasLabel();
+ }, 0);
+ }
+
// 安信框选
console.log("预警信息", this.data);
From 71022db02b72d005d7951dabba5c144d65dc74b9 Mon Sep 17 00:00:00 2001
From: SHAOJIAHAO <55341701@qq.com>
Date: Fri, 26 May 2023 10:33:53 +0800
Subject: [PATCH 3/3] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]superadmin=E8=B4=A6?=
=?UTF-8?q?=E5=8F=B7=E5=8D=B8=E6=B2=B9=E5=A2=9E=E5=8A=A0=E5=88=A0=E9=99=A4?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../oil-unloading-process-list.component.html | 2 +
.../oil-unloading-process-list.component.ts | 38 ++++++++++++++++++-
2 files changed, 39 insertions(+), 1 deletion(-)
diff --git a/src/app/pages/records/oil-unloading-process-list/oil-unloading-process-list.component.html b/src/app/pages/records/oil-unloading-process-list/oil-unloading-process-list.component.html
index b27841f..9bfaea5 100644
--- a/src/app/pages/records/oil-unloading-process-list/oil-unloading-process-list.component.html
+++ b/src/app/pages/records/oil-unloading-process-list/oil-unloading-process-list.component.html
@@ -149,6 +149,8 @@
查看
+ 删除
|
diff --git a/src/app/pages/records/oil-unloading-process-list/oil-unloading-process-list.component.ts b/src/app/pages/records/oil-unloading-process-list/oil-unloading-process-list.component.ts
index c6bbdb8..53c0dc6 100644
--- a/src/app/pages/records/oil-unloading-process-list/oil-unloading-process-list.component.ts
+++ b/src/app/pages/records/oil-unloading-process-list/oil-unloading-process-list.component.ts
@@ -100,6 +100,7 @@ export class OilUnloadingProcessListComponent implements OnInit {
button = false;
tableScrollHeight;
resizeListener;
+ loginUserInfo;
ngOnInit(): void {
this.tableScrollHeight = "100px";
// 页面监听
@@ -126,7 +127,7 @@ export class OilUnloadingProcessListComponent implements OnInit {
loginUserInfo = JSON.parse(sessionStorage.getItem("userdata"));
this.returnLastMenus(false);
}
-
+ this.loginUserInfo = loginUserInfo;
if (
loginUserInfo.roles.find((item) => {
return item.name == "ViolationPositiveCensorer";
@@ -929,6 +930,41 @@ export class OilUnloadingProcessListComponent implements OnInit {
const instance = modal.getContentComponent();
}
+ //删除某个卸油
+ delete(item) {
+ console.log(item);
+ this.modal.confirm({
+ nzTitle: `确认要删除${item.gasStation.stationName}的此条卸油记录吗`,
+ nzOkText: "确定",
+ nzOkType: "primary",
+ nzOkDanger: true,
+ nzOnOk: () => {
+ this.http
+ .delete("/api/services/app/OilUnloadingProcess/Delete", {
+ params: {
+ Id: item.id,
+ },
+ })
+ .subscribe({
+ next: (data) => {
+ this.message.create("success", "删除成功");
+ for (let index = 0; index < this.list.length; index++) {
+ const element = this.list[index];
+ if (element.id == item.id) {
+ this.list.splice(index, 1);
+ this.totalCount = String(Number(this.totalCount) - 1);
+ this.SkipCount = String(Number(this.SkipCount) - 1);
+ this.list = [...this.list];
+ }
+ }
+ },
+ });
+ },
+ nzCancelText: "取消",
+ nzOnCancel: () => console.log("Cancel"),
+ });
+ }
+
gorecordList() {
if (this.router.url.indexOf("petrolStation") != -1) {
this.router.navigate(["/records/petrolStation"]);