刘向辉 3 years ago
parent
commit
75d42c0fc3
  1. 27
      src/app/pages/change-password/change-password.component.html
  2. 0
      src/app/pages/change-password/change-password.component.scss
  3. 22
      src/app/pages/change-password/change-password.component.ts
  4. 5
      src/app/pages/home/home.component.html
  5. 50
      src/app/pages/home/home.component.ts
  6. 3
      src/app/pages/init3D.guard.ts
  7. 4
      src/app/pages/left-domain/left-domain.component.html
  8. 5
      src/app/pages/left-domain/left-domain.component.ts
  9. 5
      src/app/pages/pages.module.ts
  10. 2
      src/app/pages/plan/plan.component.ts
  11. 2
      src/styles.scss

27
src/app/pages/change-password/change-password.component.html

@ -0,0 +1,27 @@
<div class="box">
<form nz-form [formGroup]="validateForm">
<nz-form-item>
<nz-form-control nzErrorTip="">
<nz-input-group>
<input name="oldpassword" nz-input type="text" formControlName="oldpassword" placeholder="请输入原密码" autocomplete="off" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-control>
<nz-input-group>
<input name="newpassword" nz-input type="password" formControlName="newpassword" placeholder="请输入新密码"
autocomplete="off" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-control>
<nz-input-group>
<input name="affirmpassword" nz-input type="password" formControlName="affirmpassword" placeholder="确认新密码"
autocomplete="new-password" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
</form>
</div>

0
src/app/pages/change-password/change-password.component.scss

22
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]]
});
}
}

5
src/app/pages/home/home.component.html

@ -55,6 +55,7 @@
<ul nz-menu nzSelectable> <ul nz-menu nzSelectable>
<li *ngIf="isGasStation" nz-menu-item (click)="navChange('/oliStationInfo')">基本信息</li> <li *ngIf="isGasStation" nz-menu-item (click)="navChange('/oliStationInfo')">基本信息</li>
<li *ngIf="isGasStation" nz-menu-item (click)="navChange('/equipmentInfo')">器材信息</li> <li *ngIf="isGasStation" nz-menu-item (click)="navChange('/equipmentInfo')">器材信息</li>
<li nz-menu-item (click)="changePassword()">修改密码</li>
<li *ngIf="userName == 'admin'" nz-menu-item (click)="navChange('/system/organization')">系统管理</li> <li *ngIf="userName == 'admin'" nz-menu-item (click)="navChange('/system/organization')">系统管理</li>
<li nz-menu-item (click)="signOut()">退出系统</li> <li nz-menu-item (click)="signOut()">退出系统</li>
</ul> </ul>
@ -88,7 +89,3 @@
</div> </div>
</div> </div>
</ng-template> </ng-template>
<!--
<nz-modal [(nzVisible)]="isVisible">
<app-get-out-of-line-details [data]="modalData"></app-get-out-of-line-details>
</nz-modal> -->

50
src/app/pages/home/home.component.ts

@ -1,6 +1,5 @@
import { Component, OnInit, ViewChild, TemplateRef, ViewContainerRef } from '@angular/core'; import { Component, OnInit, ViewChild, TemplateRef, ViewContainerRef } from '@angular/core';
import { Router, NavigationEnd, ActivatedRoute } from '@angular/router'; import { Router, NavigationEnd } from '@angular/router';
import { Title } from '@angular/platform-browser'
import { filter } from 'rxjs/operators'; import { filter } from 'rxjs/operators';
import { NavChangeService } from '../../service/navChange.service'; import { NavChangeService } from '../../service/navChange.service';
import { CacheTokenService } from '../../service/cache-token.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 { GetOutOfLineDetailsComponent } from '../today-warning/get-out-of-line-details/get-out-of-line-details.component';
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from 'ng-zorro-antd/modal';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { ChangePasswordComponent } from '../change-password/change-password.component';
declare var abp: any declare var abp: any
@Component({ @Component({
@ -260,4 +260,50 @@ export class HomeComponent implements OnInit {
} }
this.isfullscreen = false; 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));
}
} }

3
src/app/pages/init3D.guard.ts

@ -19,11 +19,10 @@ export class init3DGuard implements CanActivate {
let userdata = JSON.parse(sessionStorage.getItem('userdata')) let userdata = JSON.parse(sessionStorage.getItem('userdata'))
if (userdata.userName == 'superadmin') { //是superadmin,是内部制作账号 if (userdata.userName == 'superadmin') { //是superadmin,是内部制作账号
ModeManager.s_isMakeMode = true; ModeManager.s_isMakeMode = true;
return true
} else { } else {
ModeManager.s_isMakeMode = false; ModeManager.s_isMakeMode = false;
} }
if (res.hasBuildingInfo) { if (userdata.userName == 'superadmin' || res.hasBuildingInfo) {
return true return true
} else { } else {
this.message.info("当前站点没有数字油站!"); this.message.info("当前站点没有数字油站!");

4
src/app/pages/left-domain/left-domain.component.html

@ -125,7 +125,7 @@
</div> </div>
<div class="propertyImage" id="pipelineViewer{{item.getID()}}"> <div class="propertyImage" id="pipelineViewer{{item.getID()}}">
<p class="imgTitle">设计图纸</p> <p class="imgTitle">设计图纸</p>
<img [hidden]="!item.getPropertyData().img" [src]="item.getPropertyData().img" [attr.data-original]="item.getPropertyData().img" (click)="stopBubbling($event)"> <img [hidden]="!item.getPropertyData().img" [src]="item.getPropertyData().img" [attr.data-original]="item.getPropertyData().img">
<div class="positionHandleImgVideo" style="width: 120px;" *ngIf="editMode && item.getPropertyData().img" (click)="stopBubbling($event)"> <div class="positionHandleImgVideo" style="width: 120px;" *ngIf="editMode && item.getPropertyData().img" (click)="stopBubbling($event)">
<a href="javascript:;" class="imgAndVideoUpload"><input type="file" accept="image/*" (change)='uploadLeftDomainImg($event, item)'><i nz-icon nzType="upload" nzTheme="outline"></i></a> <a href="javascript:;" class="imgAndVideoUpload"><input type="file" accept="image/*" (change)='uploadLeftDomainImg($event, item)'><i nz-icon nzType="upload" nzTheme="outline"></i></a>
<i nz-icon nzType="delete" nzTheme="outline" (click)="deleteImg(item)"></i> <i nz-icon nzType="delete" nzTheme="outline" (click)="deleteImg(item)"></i>
@ -156,7 +156,7 @@
</div> </div>
<div class="propertyImage" id="orvrViewer{{item.getID()}}"> <div class="propertyImage" id="orvrViewer{{item.getID()}}">
<p class="imgTitle">设计图纸</p> <p class="imgTitle">设计图纸</p>
<img [hidden]="!item.getPropertyData().img" [src]="item.getPropertyData().img" [attr.data-original]="item.getPropertyData().img" (click)="stopBubbling($event)"> <img [hidden]="!item.getPropertyData().img" [src]="item.getPropertyData().img" [attr.data-original]="item.getPropertyData().img">
<div class="positionHandleImgVideo" style="width: 120px;" *ngIf="editMode && item.getPropertyData().img" (click)="stopBubbling($event)"> <div class="positionHandleImgVideo" style="width: 120px;" *ngIf="editMode && item.getPropertyData().img" (click)="stopBubbling($event)">
<a href="javascript:;" class="imgAndVideoUpload"><input type="file" accept="image/*" (change)='uploadLeftDomainImg($event, item)'><i nz-icon nzType="upload" nzTheme="outline"></i></a> <a href="javascript:;" class="imgAndVideoUpload"><input type="file" accept="image/*" (change)='uploadLeftDomainImg($event, item)'><i nz-icon nzType="upload" nzTheme="outline"></i></a>
<i nz-icon nzType="delete" nzTheme="outline" (click)="deleteImg(item)"></i> <i nz-icon nzType="delete" nzTheme="outline" (click)="deleteImg(item)"></i>

5
src/app/pages/left-domain/left-domain.component.ts

@ -102,6 +102,9 @@ export class LeftDomainComponent implements OnInit {
//选中 设备 //选中 设备
selectFacility(event, item: FacilityInfoUIItem) { selectFacility(event, item: FacilityInfoUIItem) {
if (event.target.localName == 'img') {
return
}
if (this.selectFacilityId != item.getID()) { if (this.selectFacilityId != item.getID()) {
this.selectFacilityId = item.getID() this.selectFacilityId = item.getID()
FacilityInfoInSceneWindow.instance.selectFacilityItem(item); FacilityInfoInSceneWindow.instance.selectFacilityItem(item);
@ -130,7 +133,7 @@ export class LeftDomainComponent implements OnInit {
let institutionKey = `${PlanComponent.instance.companyData.id}` || "ceshi"; //单位id let institutionKey = `${PlanComponent.instance.companyData.id}` || "ceshi"; //单位id
console.log(PlanComponent.instance.buildingUIItems, PlanComponent.instance.beforeOneBuildingID); console.log(PlanComponent.instance.buildingUIItems, PlanComponent.instance.beforeOneBuildingID);
let buildingKey = PlanComponent.instance.buildingUIItems.find(item => { return item.getBuildingID() == PlanComponent.instance.beforeOneBuildingID }) 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) => { //上传 ServeManager.instance.openFileSelect(file, url, (name: string, path: string) => { //上传
item.getPropertyData().img = ObjectsService.getFullPath(path + name) item.getPropertyData().img = ObjectsService.getFullPath(path + name)
if (this.beforeFence === 5) { if (this.beforeFence === 5) {

5
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 { OilUnloadingProcessComponent } from './oil-unloading-process/oil-unloading-process.component';
import { HomePageComponent } from './home-page/home-page.component'; import { HomePageComponent } from './home-page/home-page.component';
import { OilUnloadingProcessListComponent } from './oil-unloading-process-list/oil-unloading-process-list.component'; import { OilUnloadingProcessListComponent } from './oil-unloading-process-list/oil-unloading-process-list.component';
import { ChangePasswordComponent } from './change-password/change-password.component';
@NgModule({ @NgModule({
declarations: [LoginComponent, RegisterComponent, HomeComponent, PlanComponent, TodayWarningComponent, CriminalRecordsComponent, declarations: [LoginComponent, RegisterComponent, HomeComponent, PlanComponent, TodayWarningComponent, CriminalRecordsComponent,
TodayWarningAdminComponent, CriminalRecordsAdminComponent, LeftDomainComponent, EquipmentInfoComponent, OilStationInfoComponent, TodayWarningAdminComponent, CriminalRecordsAdminComponent, LeftDomainComponent, EquipmentInfoComponent, OilStationInfoComponent,
AddequipmentComponent, EditequipmentComponent,PlanAdminComponent, GetOutOfLineDetailsComponent, DispositionComponent, OilUnloadingProcessComponent, HomePageComponent, OilUnloadingProcessListComponent], AddequipmentComponent, EditequipmentComponent,PlanAdminComponent, GetOutOfLineDetailsComponent, DispositionComponent, OilUnloadingProcessComponent, HomePageComponent, OilUnloadingProcessListComponent, ChangePasswordComponent],
imports: [ imports: [
@ -98,7 +99,7 @@ import { OilUnloadingProcessListComponent } from './oil-unloading-process-list/o
NzPopconfirmModule, NzPopconfirmModule,
NzBadgeModule NzBadgeModule
], ],
entryComponents: [AddequipmentComponent, EditequipmentComponent,GetOutOfLineDetailsComponent,DispositionComponent,OilUnloadingProcessComponent], entryComponents: [AddequipmentComponent, EditequipmentComponent,GetOutOfLineDetailsComponent,DispositionComponent,OilUnloadingProcessComponent,ChangePasswordComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA] schemas: [CUSTOM_ELEMENTS_SCHEMA]
}) })

2
src/app/pages/plan/plan.component.ts

@ -477,7 +477,7 @@ export class PlanComponent implements OnInit {
let institutionKey = `${this.companyData.id}` || "ceshi"; //单位id let institutionKey = `${this.companyData.id}` || "ceshi"; //单位id
let buildingKey = this.buildingUIItems.find(item => { return item.getBuildingID() == this.beforeOneBuildingID }) let buildingKey = this.buildingUIItems.find(item => { return item.getBuildingID() == this.beforeOneBuildingID })
let facility = this.beforeOnePropertyData 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) => { //上传 ServeManager.instance.openFileSelect(file, url, (name: string, path: string) => { //上传
this.beforeOnePropertyData.getPropertyData().img = ObjectsService.getFullPath(path + name) this.beforeOnePropertyData.getPropertyData().img = ObjectsService.getFullPath(path + name)
if (!this.beforeOnePropertyData.getPropertyData().is360) { if (!this.beforeOnePropertyData.getPropertyData().is360) {

2
src/styles.scss

@ -132,7 +132,7 @@ h1 {
} }
.videoDialog{ .videoDialog{
height: 80%; height: 80%;
.ant-modal-footer { padding: 0; } .ant-modal-body,.ant-modal-footer { padding: 0; }
.ant-modal-body,.ant-modal-content { height: 100%; } .ant-modal-body,.ant-modal-content { height: 100%; }
canvas{ width: 100%; height: 100%; border: none; outline: none; } canvas{ width: 100%; height: 100%; border: none; outline: none; }
} }

Loading…
Cancel
Save