From 673491321071d44a2d2e3862049c5bf9cc1cbcd5 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Thu, 2 Dec 2021 11:55:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../change-password.component.html | 27 ++++++++++ .../change-password.component.scss | 0 .../change-password.component.ts | 22 ++++++++ src/app/pages/home/home.component.html | 7 +-- src/app/pages/home/home.component.ts | 50 ++++++++++++++++++- src/app/pages/pages.module.ts | 5 +- 6 files changed, 102 insertions(+), 9 deletions(-) create mode 100644 src/app/pages/change-password/change-password.component.html create mode 100644 src/app/pages/change-password/change-password.component.scss create mode 100644 src/app/pages/change-password/change-password.component.ts diff --git a/src/app/pages/change-password/change-password.component.html b/src/app/pages/change-password/change-password.component.html new file mode 100644 index 0000000..941bb6c --- /dev/null +++ b/src/app/pages/change-password/change-password.component.html @@ -0,0 +1,27 @@ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+
\ No newline at end of file diff --git a/src/app/pages/change-password/change-password.component.scss b/src/app/pages/change-password/change-password.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/change-password/change-password.component.ts b/src/app/pages/change-password/change-password.component.ts new file mode 100644 index 0000000..8735ca7 --- /dev/null +++ b/src/app/pages/change-password/change-password.component.ts @@ -0,0 +1,22 @@ +import { Component, OnInit, Input } from '@angular/core'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { HttpClient } from '@angular/common/http'; +@Component({ + selector: 'app-change-password', + templateUrl: './change-password.component.html', + styleUrls: ['./change-password.component.scss'] +}) +export class ChangePasswordComponent implements OnInit { + + constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { } + validateForm!: FormGroup; + ngOnInit(): void { + this.validateForm = this.fb.group({ + oldpassword: [null, [Validators.required]], + newpassword: [null, [Validators.required]], + affirmpassword: [null, [Validators.required]] + }); + } + +} diff --git a/src/app/pages/home/home.component.html b/src/app/pages/home/home.component.html index 920dece..149c5ef 100644 --- a/src/app/pages/home/home.component.html +++ b/src/app/pages/home/home.component.html @@ -55,6 +55,7 @@ @@ -87,8 +88,4 @@ 忽略 - - \ No newline at end of file + \ No newline at end of file diff --git a/src/app/pages/home/home.component.ts b/src/app/pages/home/home.component.ts index d8498b7..8e2b6b9 100644 --- a/src/app/pages/home/home.component.ts +++ b/src/app/pages/home/home.component.ts @@ -1,6 +1,5 @@ import { Component, OnInit, ViewChild, TemplateRef, ViewContainerRef } from '@angular/core'; -import { Router, NavigationEnd, ActivatedRoute } from '@angular/router'; -import { Title } from '@angular/platform-browser' +import { Router, NavigationEnd } from '@angular/router'; import { filter } from 'rxjs/operators'; import { NavChangeService } from '../../service/navChange.service'; import { CacheTokenService } from '../../service/cache-token.service' //引入服务 @@ -11,6 +10,7 @@ import { NzNotificationService } from 'ng-zorro-antd/notification'; import { GetOutOfLineDetailsComponent } from '../today-warning/get-out-of-line-details/get-out-of-line-details.component'; import { NzModalService } from 'ng-zorro-antd/modal'; import { HttpClient } from '@angular/common/http'; +import { ChangePasswordComponent } from '../change-password/change-password.component'; declare var abp: any @Component({ @@ -260,4 +260,50 @@ export class HomeComponent implements OnInit { } this.isfullscreen = false; } + + + //修改密码 + + changePassword() { + const modal:any = this.modal.create({ + nzTitle: '修改密码', + nzContent: ChangePasswordComponent, + nzViewContainerRef: this.viewContainerRef, + nzWidth: 288, + nzComponentParams: {}, + nzOnOk: async () => { + if (instance.validateForm.valid) { + if (instance.validateForm.value.newpassword != instance.validateForm.value.affirmpassword) { + this.message.create('warning', '两次密码输入不一致!'); + return false + } else { + await new Promise((resolve,reject) => { + let body = { + currentPassword: instance.validateForm.value.oldpassword, + newPassword: instance.validateForm.value.newpassword + } + this.http.post('/api/services/app/User/ChangePassword', body).subscribe(data => { + resolve(data) + this.message.create('success', '修改成功!'); + return true + },err=>{ + this.message.create('warning', err.error.error.message); + modal.config.nzOkLoading = false + return false + }) + }) + } + + } else { + this.message.create('warning', '请填写完整!'); + return false + } + } + }); + const instance = modal.getContentComponent(); + modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!')); + // Return a result when closed + modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result)); + } + } diff --git a/src/app/pages/pages.module.ts b/src/app/pages/pages.module.ts index ae60ed6..5511d88 100644 --- a/src/app/pages/pages.module.ts +++ b/src/app/pages/pages.module.ts @@ -53,11 +53,12 @@ import { DispositionComponent } from './disposition/disposition.component'; import { OilUnloadingProcessComponent } from './oil-unloading-process/oil-unloading-process.component'; import { HomePageComponent } from './home-page/home-page.component'; import { OilUnloadingProcessListComponent } from './oil-unloading-process-list/oil-unloading-process-list.component'; +import { ChangePasswordComponent } from './change-password/change-password.component'; @NgModule({ declarations: [LoginComponent, RegisterComponent, HomeComponent, PlanComponent, TodayWarningComponent, CriminalRecordsComponent, TodayWarningAdminComponent, CriminalRecordsAdminComponent, LeftDomainComponent, EquipmentInfoComponent, OilStationInfoComponent, - AddequipmentComponent, EditequipmentComponent,PlanAdminComponent, GetOutOfLineDetailsComponent, DispositionComponent, OilUnloadingProcessComponent, HomePageComponent, OilUnloadingProcessListComponent], + AddequipmentComponent, EditequipmentComponent,PlanAdminComponent, GetOutOfLineDetailsComponent, DispositionComponent, OilUnloadingProcessComponent, HomePageComponent, OilUnloadingProcessListComponent, ChangePasswordComponent], imports: [ @@ -98,7 +99,7 @@ import { OilUnloadingProcessListComponent } from './oil-unloading-process-list/o NzPopconfirmModule, NzBadgeModule ], - entryComponents: [AddequipmentComponent, EditequipmentComponent,GetOutOfLineDetailsComponent,DispositionComponent,OilUnloadingProcessComponent], + entryComponents: [AddequipmentComponent, EditequipmentComponent,GetOutOfLineDetailsComponent,DispositionComponent,OilUnloadingProcessComponent,ChangePasswordComponent], schemas: [CUSTOM_ELEMENTS_SCHEMA] }) From c6a3adc000beca45044d86d6081fe6b8b846fba1 Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Thu, 2 Dec 2021 14:53:02 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=AD=A3BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/pages/init3D.guard.ts | 3 +-- src/app/pages/left-domain/left-domain.component.html | 4 ++-- src/app/pages/left-domain/left-domain.component.ts | 5 ++++- src/app/pages/plan/plan.component.ts | 2 +- src/styles.scss | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/app/pages/init3D.guard.ts b/src/app/pages/init3D.guard.ts index 82b2034..7aaf270 100644 --- a/src/app/pages/init3D.guard.ts +++ b/src/app/pages/init3D.guard.ts @@ -19,11 +19,10 @@ export class init3DGuard implements CanActivate { let userdata = JSON.parse(sessionStorage.getItem('userdata')) if (userdata.userName == 'superadmin') { //是superadmin,是内部制作账号 ModeManager.s_isMakeMode = true; - return true } else { ModeManager.s_isMakeMode = false; } - if (res.hasBuildingInfo) { + if (userdata.userName == 'superadmin' || res.hasBuildingInfo) { return true } else { this.message.info("当前站点没有数字油站!"); diff --git a/src/app/pages/left-domain/left-domain.component.html b/src/app/pages/left-domain/left-domain.component.html index a0220bb..c7fadf5 100644 --- a/src/app/pages/left-domain/left-domain.component.html +++ b/src/app/pages/left-domain/left-domain.component.html @@ -125,7 +125,7 @@

设计图纸

- +
@@ -156,7 +156,7 @@

设计图纸

- +
diff --git a/src/app/pages/left-domain/left-domain.component.ts b/src/app/pages/left-domain/left-domain.component.ts index 7c15bc1..9b9a86a 100644 --- a/src/app/pages/left-domain/left-domain.component.ts +++ b/src/app/pages/left-domain/left-domain.component.ts @@ -101,6 +101,9 @@ export class LeftDomainComponent implements OnInit { //选中 设备 selectFacility(event, item: FacilityInfoUIItem) { + if (event.target.localName == 'img') { + return + } if (this.selectFacilityId != item.getID()) { this.selectFacilityId = item.getID() FacilityInfoInSceneWindow.instance.selectFacilityItem(item); @@ -128,7 +131,7 @@ export class LeftDomainComponent implements OnInit { PlanComponent.instance.isShowLoading = true //打开遮罩 let institutionKey = `${PlanComponent.instance.companyData.id}` || "ceshi"; //单位id let buildingKey = PlanComponent.instance.buildingUIItems.find(item => { return item.getBuildingID() == PlanComponent.instance.beforeOneBuildingID }) - let url = DataManager.getResPath_facilityProperty(institutionKey, buildingKey.getBuildingID(), item.getType(), item.getID(), null) + let url = DataManager.getResPath_facilityProperty(institutionKey, buildingKey? buildingKey.getBuildingID() : "building", item.getType(), item.getID(), null) ServeManager.instance.openFileSelect(file, url, (name: string, path: string) => { //上传 item.getPropertyData().img = ObjectsService.getFullPath(path + name) if (this.beforeFence === 5) { diff --git a/src/app/pages/plan/plan.component.ts b/src/app/pages/plan/plan.component.ts index 69c01ec..dff2c73 100644 --- a/src/app/pages/plan/plan.component.ts +++ b/src/app/pages/plan/plan.component.ts @@ -471,7 +471,7 @@ export class PlanComponent implements OnInit { let institutionKey = `${this.companyData.id}` || "ceshi"; //单位id let buildingKey = this.buildingUIItems.find(item => { return item.getBuildingID() == this.beforeOneBuildingID }) let facility = this.beforeOnePropertyData - let url = DataManager.getResPath_facilityProperty(institutionKey, buildingKey.getBuildingID(), facility.getType(), facility.getID(), null) + let url = DataManager.getResPath_facilityProperty(institutionKey, buildingKey? buildingKey.getBuildingID() : "building", facility.getType(), facility.getID(), null) ServeManager.instance.openFileSelect(file, url, (name: string, path: string) => { //上传 this.beforeOnePropertyData.getPropertyData().img = ObjectsService.getFullPath(path + name) if (!this.beforeOnePropertyData.getPropertyData().is360) { diff --git a/src/styles.scss b/src/styles.scss index de5f572..b27f4fa 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -132,7 +132,7 @@ h1 { } .videoDialog{ height: 80%; - .ant-modal-footer { padding: 0; } + .ant-modal-body,.ant-modal-footer { padding: 0; } .ant-modal-body,.ant-modal-content { height: 100%; } canvas{ width: 100%; height: 100%; border: none; outline: none; } }