From 49b94329f79c9258c70911f7b878f1786e231ccc Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Mon, 9 Sep 2024 10:01:20 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=B8=89=E4=B8=AA=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=9B=8F=E5=BD=A2=EF=BC=88=E5=BE=85=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AE=8C=E5=96=84=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/LogApi.ts | 29 ++++++++ src/components/SysMenu.vue | 15 ++++ src/pages/AlarmRecord.vue | 138 ++++++++++++++++++++++++++++++++++++ src/pages/LoginRecord.vue | 138 ++++++++++++++++++++++++++++++++++++ src/pages/OperateRecord.vue | 138 ++++++++++++++++++++++++++++++++++++ src/router/routes.ts | 24 +++++++ 6 files changed, 482 insertions(+) create mode 100644 src/api/LogApi.ts create mode 100644 src/pages/AlarmRecord.vue create mode 100644 src/pages/LoginRecord.vue create mode 100644 src/pages/OperateRecord.vue diff --git a/src/api/LogApi.ts b/src/api/LogApi.ts new file mode 100644 index 0000000..59c7381 --- /dev/null +++ b/src/api/LogApi.ts @@ -0,0 +1,29 @@ +import { api } from 'src/boot/axios'; +import { PageDto, PageQueryDto } from './ApiCommon'; + +const LogUriBase = '/api/log'; + +export interface Record { + id: number; + eventType: string; + fromUserId: number; + mobile: string; + userName: string; + createDateTime: string; +} + +export class PagingQueryParams extends PageQueryDto {} + +/** + * 分页查询事件信息列表 + * @param params + * @returns + */ +export async function pageQuery( + params: PagingQueryParams +): Promise> { + const response = await api.get(`${LogUriBase}/paging`, { + params: params, + }); + return response.data; +} diff --git a/src/components/SysMenu.vue b/src/components/SysMenu.vue index ee26e73..d05e70c 100644 --- a/src/components/SysMenu.vue +++ b/src/components/SysMenu.vue @@ -109,6 +109,21 @@ const list = reactive([ label: '权限接口管理', icon: 'menu_open', }, + { + path: '/sysManage/loginRecord', + label: '登录记录', + icon: 'description', + }, + { + path: '/sysManage/operateRecord', + label: '操作记录', + icon: 'receipt', + }, + { + path: '/sysManage/alarmRecord', + label: '报警记录', + icon: 'alarm_on', + }, ], }, ]); diff --git a/src/pages/AlarmRecord.vue b/src/pages/AlarmRecord.vue new file mode 100644 index 0000000..e7a312b --- /dev/null +++ b/src/pages/AlarmRecord.vue @@ -0,0 +1,138 @@ + + + diff --git a/src/pages/LoginRecord.vue b/src/pages/LoginRecord.vue new file mode 100644 index 0000000..e7a312b --- /dev/null +++ b/src/pages/LoginRecord.vue @@ -0,0 +1,138 @@ + + + diff --git a/src/pages/OperateRecord.vue b/src/pages/OperateRecord.vue new file mode 100644 index 0000000..e7a312b --- /dev/null +++ b/src/pages/OperateRecord.vue @@ -0,0 +1,138 @@ + + + diff --git a/src/router/routes.ts b/src/router/routes.ts index e25f7a1..393a86e 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -86,6 +86,30 @@ const routes: RouteRecordRaw[] = [ }, component: () => import('pages/AuthPathManage.vue'), }, + { + path: 'loginRecord', + name: 'loginRecord', + meta: { + description: '登录记录', + }, + component: () => import('pages/LoginRecord.vue'), + }, + { + path: 'operateRecord', + name: 'operateRecord', + meta: { + description: '操作记录', + }, + component: () => import('pages/OperateRecord.vue'), + }, + { + path: 'alarmRecord', + name: 'alarmRecord', + meta: { + description: '报警记录', + }, + component: () => import('pages/AlarmRecord.vue'), + }, ], }, { From aaf8b932a5988a7eec9707171599bfe5231f669a Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Mon, 23 Sep 2024 09:12:28 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=8C=BA=E6=AE=B5=E6=94=BE=E5=BC=80?= =?UTF-8?q?=E7=9B=AE=E7=9A=84=E5=9C=B0=E5=90=97=E4=BD=8D=E7=BD=AE=E5=81=8F?= =?UTF-8?q?=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graphics/section/Section.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/graphics/section/Section.ts b/src/graphics/section/Section.ts index 3ab5e19..d1e7ab3 100644 --- a/src/graphics/section/Section.ts +++ b/src/graphics/section/Section.ts @@ -148,17 +148,17 @@ export class Section extends JlGraphic implements ILineGraphic { const destinationCodePosition = this.datas.childTransforms?.find( (t) => t.name === this.destinationCodeGraphic.name )?.transform.position; - // if (destinationCodePosition) { - // this.destinationCodeGraphic.position.set( - // destinationCodePosition.x, - // destinationCodePosition.y - // ); - // } else { - this.destinationCodeGraphic.position.set( - this.datas.points[0].x, - this.datas.points[0].y - 20 - ); - // } + if (destinationCodePosition) { + this.destinationCodeGraphic.position.set( + destinationCodePosition.x, + destinationCodePosition.y + ); + } else { + this.destinationCodeGraphic.position.set( + this.datas.points[0].x, + this.datas.points[0].y - 20 + ); + } } } From 7b06dee5be47e8d63517a40f3113ec5f576cf890 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Mon, 23 Sep 2024 13:55:11 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=9E=84=E5=BB=BA=E5=85=B3=E8=81=94?= =?UTF-8?q?=E5=85=B3=E7=B3=BB=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graphics/section/Section.ts | 11 +++-- src/graphics/turnout/Turnout.ts | 88 +++++++++++++++++---------------- 2 files changed, 51 insertions(+), 48 deletions(-) diff --git a/src/graphics/section/Section.ts b/src/graphics/section/Section.ts index d1e7ab3..a2586d4 100644 --- a/src/graphics/section/Section.ts +++ b/src/graphics/section/Section.ts @@ -8,7 +8,6 @@ import { distance2, splitLineEvenly, ILineGraphic, - epsilon, Vector2, } from 'jl-graphic'; import { @@ -29,6 +28,8 @@ export enum SectionPort { B = 'B', } +const sectionEpsilon = 0.1; + export interface ISectionData extends GraphicData { get code(): string; // 编号 set code(v: string); @@ -244,7 +245,7 @@ export class Section extends JlGraphic implements ILineGraphic { distance2( this.localToCanvasPoint(this.getStartPoint()), section.localToCanvasPoint(section.getStartPoint()) - ) <= epsilon + ) <= sectionEpsilon ) { param = [SectionPort.A, SectionPort.A]; } @@ -252,7 +253,7 @@ export class Section extends JlGraphic implements ILineGraphic { distance2( this.localToCanvasPoint(this.getEndPoint()), section.localToCanvasPoint(section.getStartPoint()) - ) <= epsilon + ) <= sectionEpsilon ) { param = [SectionPort.B, SectionPort.A]; } @@ -260,7 +261,7 @@ export class Section extends JlGraphic implements ILineGraphic { distance2( this.localToCanvasPoint(this.getStartPoint()), section.localToCanvasPoint(section.getEndPoint()) - ) <= epsilon + ) <= sectionEpsilon ) { param = [SectionPort.A, SectionPort.B]; } @@ -268,7 +269,7 @@ export class Section extends JlGraphic implements ILineGraphic { distance2( this.localToCanvasPoint(this.getEndPoint()), section.localToCanvasPoint(section.getEndPoint()) - ) <= epsilon + ) <= sectionEpsilon ) { param = [SectionPort.B, SectionPort.B]; } diff --git a/src/graphics/turnout/Turnout.ts b/src/graphics/turnout/Turnout.ts index 3075798..ef06875 100644 --- a/src/graphics/turnout/Turnout.ts +++ b/src/graphics/turnout/Turnout.ts @@ -10,7 +10,6 @@ import { angleOfIncludedAngle, distance2, getParallelOfPolyline, - epsilon, Vector2, } from 'jl-graphic'; import { Section, SectionPort, SectionType } from '../section/Section'; @@ -22,6 +21,7 @@ import { import { KilometerSystem } from '../signal/Signal'; import { Station } from '../station/Station'; +const turnoutEpsilon = 0.1; export interface ITurnoutData extends GraphicData { get code(): string; set code(code: string); @@ -541,47 +541,45 @@ export class Turnout extends JlGraphic { buildRelation(): void { this.relationManage.deleteRelationOfGraphic(this); - /** 道岔和区段 */ - this.queryStore.queryByType
(Section.Type) - .forEach((section) => { - if (section.datas.sectionType === SectionType.TurnoutPhysical) { - if (section.datas.children.includes(this.datas.id)) { - this.relationManage.addRelation(this, section) - } - return + this.queryStore.queryByType
(Section.Type).forEach((section) => { + if (section.datas.sectionType === SectionType.TurnoutPhysical) { + if (section.datas.children.includes(this.datas.id)) { + this.relationManage.addRelation(this, section); + } + return; + } + this.getPortPoints().forEach((port, i) => { + if ( + distance2( + section.localToCanvasPoint(section.getStartPoint()), + this.localToCanvasPoint(port[port.length - 1]) + ) <= turnoutEpsilon + ) { + this.relationManage.addRelation( + new GraphicRelationParam( + this, + [TurnoutPort.A, TurnoutPort.B, TurnoutPort.C][i] + ), + new GraphicRelationParam(section, SectionPort.A) + ); + } + if ( + distance2( + section.localToCanvasPoint(section.getEndPoint()), + this.localToCanvasPoint(port[port.length - 1]) + ) <= turnoutEpsilon + ) { + this.relationManage.addRelation( + new GraphicRelationParam( + this, + [TurnoutPort.A, TurnoutPort.B, TurnoutPort.C][i] + ), + new GraphicRelationParam(section, SectionPort.B) + ); } - this.getPortPoints().forEach((port, i) => { - if ( - distance2( - section.localToCanvasPoint(section.getStartPoint()), - this.localToCanvasPoint(port[port.length - 1]) - ) <= epsilon - ) { - this.relationManage.addRelation( - new GraphicRelationParam( - this, - [TurnoutPort.A, TurnoutPort.B, TurnoutPort.C][i] - ), - new GraphicRelationParam(section, SectionPort.A) - ); - } - if ( - distance2( - section.localToCanvasPoint(section.getEndPoint()), - this.localToCanvasPoint(port[port.length - 1]) - ) <= epsilon - ) { - this.relationManage.addRelation( - new GraphicRelationParam( - this, - [TurnoutPort.A, TurnoutPort.B, TurnoutPort.C][i] - ), - new GraphicRelationParam(section, SectionPort.B) - ); - } - }); }); + }); /** 道岔和道岔 */ this.getPortPoints().forEach((thisPort, i) => { @@ -594,7 +592,7 @@ export class Turnout extends JlGraphic { distance2( this.localToCanvasPoint(thisPort[thisPort.length - 1]), turnout.localToCanvasPoint(otherPort[otherPort.length - 1]) - ) <= epsilon + ) <= turnoutEpsilon ) { const angle = angleOfIncludedAngle( this.localToCanvasPoint(thisPort[thisPort.length - 1]) /* 交点 */, @@ -668,9 +666,13 @@ export class Turnout extends JlGraphic { const pcRelation = this.relationManage .getRelationsOfGraphic(this) .find( - (relation) => relation.getRelationParam(this).param === TurnoutPort.C - && (!(relation.getOtherGraphic(this) instanceof Section - && relation.getOtherGraphic
(this).datas.sectionType !== SectionType.TurnoutPhysical)) + (relation) => + relation.getRelationParam(this).param === TurnoutPort.C && + !( + relation.getOtherGraphic(this) instanceof Section && + relation.getOtherGraphic
(this).datas.sectionType !== + SectionType.TurnoutPhysical + ) ); const pcDevice = pcRelation?.getOtherGraphic
(this); if (pcDevice) {