Browse Source

[完善]完善返回按钮

dev
邵佳豪 3 years ago
parent
commit
3d57406d97
  1. 3
      src/app/pages/equipment-info/equipment-info.component.html
  2. 17
      src/app/pages/equipment-info/equipment-info.component.scss
  3. 7
      src/app/pages/equipment-info/equipment-info.component.ts
  4. 7
      src/app/pages/home/home.component.html
  5. 2
      src/app/pages/home/home.component.scss
  6. 32
      src/app/pages/home/home.component.ts
  7. 6
      src/app/pages/oil-station-info/oil-station-info.component.html
  8. 18
      src/app/pages/oil-station-info/oil-station-info.component.scss
  9. 7
      src/app/pages/oil-station-info/oil-station-info.component.ts
  10. 5
      src/app/pages/today-warning/today-warning.component.html
  11. 7
      src/app/pages/today-warning/today-warning.component.scss
  12. 4
      src/app/pages/today-warning/today-warning.component.ts

3
src/app/pages/equipment-info/equipment-info.component.html

@ -80,4 +80,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="backbtn">
<button nz-button (click)="goback()">返回</button>
</div>
</div> </div>

17
src/app/pages/equipment-info/equipment-info.component.scss

@ -3,6 +3,7 @@
height: 100%; height: 100%;
display: flex; display: flex;
justify-content: center; justify-content: center;
position: relative;
} }
.content { .content {
@ -115,3 +116,19 @@
} }
} }
.backbtn {
position: absolute;
right: 66px;
top: 22px;
button {
width: 64px;
height: 32px;
background: rgba(0, 129, 255, 0.3);
border: 1px solid #36A2FF;
border-radius: 0px;
color: #91CCFF;
}
}

7
src/app/pages/equipment-info/equipment-info.component.ts

@ -5,6 +5,7 @@ import { NzMessageService } from 'ng-zorro-antd/message';
import { AddequipmentComponent } from './addequipment/addequipment.component'; import { AddequipmentComponent } from './addequipment/addequipment.component';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { EditequipmentComponent } from './editequipment/editequipment.component'; import { EditequipmentComponent } from './editequipment/editequipment.component';
import { Router, ActivatedRoute } from '@angular/router'
@Component({ @Component({
selector: 'app-equipment-info', selector: 'app-equipment-info',
templateUrl: './equipment-info.component.html', templateUrl: './equipment-info.component.html',
@ -12,7 +13,7 @@ import { EditequipmentComponent } from './editequipment/editequipment.component'
}) })
export class EquipmentInfoComponent implements OnInit { export class EquipmentInfoComponent implements OnInit {
validateForm!: FormGroup; validateForm!: FormGroup;
constructor(private fb: FormBuilder, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService, private http: HttpClient) { } constructor(private router: Router,private fb: FormBuilder, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService, private http: HttpClient) { }
arr = [] arr = []
ngOnInit(): void { ngOnInit(): void {
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
@ -159,4 +160,8 @@ export class EquipmentInfoComponent implements OnInit {
} }
}); });
} }
goback(){
this.router.navigate(['/warning/petrolStation'])
}
} }

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

@ -52,14 +52,9 @@
</ul> </ul>
</nz-dropdown-menu> </nz-dropdown-menu>
</div> </div>
<div class="backbtn" *ngIf="isGasStation"> <div class="backbtn" *ngIf="isGasStationBack">
<button nz-button (click)="goback()">返回</button> <button nz-button (click)="goback()">返回</button>
</div> </div>
<!-- <div class="warningnumber" *ngIf="isWarning">
<img src="../../../assets/images/warningnum.png" alt="">
<span class="num">{{num}}</span>
<span class="today">今日预警</span>
</div> -->
</div> </div>
<div class="content"> <div class="content">
<router-outlet></router-outlet> <router-outlet></router-outlet>

2
src/app/pages/home/home.component.scss

@ -63,7 +63,7 @@
.backbtn { .backbtn {
position: absolute; position: absolute;
right: 26px; left: 205px;
bottom: 6px; bottom: 6px;
button { button {

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

@ -17,12 +17,11 @@ export class HomeComponent implements OnInit {
private cookieService: CookieService, private message: NzMessageService) { } private cookieService: CookieService, private message: NzMessageService) { }
isGasStationNav: boolean isGasStationNav: boolean
isGasStation: boolean isGasStation: boolean
isWarning: boolean = false//是否是今日预警页面 isGasStationBack: boolean
num num
surname: string surname: string
userName: string userName: string
// isGasStation: string
ngOnInit(): void { ngOnInit(): void {
this.navChangeService.getMessage().subscribe((message: any) => { this.navChangeService.getMessage().subscribe((message: any) => {
@ -30,25 +29,21 @@ export class HomeComponent implements OnInit {
if (message.name == 'oilstation') { if (message.name == 'oilstation') {
this.isGasStationNav = true this.isGasStationNav = true
} }
if (message.name == '改变数量') {
this.isWarning = true
this.num = message.num
}
}); });
if (this.router.url.indexOf('warning') != -1) {
this.isWarning = true
} else {
this.isWarning = false
}
if (this.router.url.indexOf('petrolStation') != -1 && sessionStorage.getItem('isGasStation') == 'false') {//控制返回按钮显示 if (this.router.url.indexOf('petrolStation') != -1 && sessionStorage.getItem('isGasStation') == 'false') {//控制返回按钮显示
this.isGasStation = true this.isGasStationBack = true
} else { } else {
this.isGasStation = false this.isGasStationBack = false
} }
// if (this.router.url.indexOf('petrolStation') != -1 && sessionStorage.getItem('isGasStation') == 'true') {
// this.isGasStation = true
// } else {
// this.isGasStation = false
// }
if (sessionStorage.getItem('isGasStation') == 'true') { if (sessionStorage.getItem('isGasStation') == 'true') {
this.isGasStation = true this.isGasStation = true
this.isGasStationNav = true this.isGasStationNav = true
@ -60,15 +55,10 @@ export class HomeComponent implements OnInit {
this.router.events.pipe( this.router.events.pipe(
filter(event => event instanceof NavigationEnd) filter(event => event instanceof NavigationEnd)
).subscribe((event: any) => { ).subscribe((event: any) => {
if (event.url.indexOf('warning') != -1) {//控制今日预警左上角数字显示
} else {
this.isWarning = false
}
if (event.url.indexOf('petrolStation') != -1 && sessionStorage.getItem('isGasStation') == 'false') {//控制返回按钮显示 if (event.url.indexOf('petrolStation') != -1 && sessionStorage.getItem('isGasStation') == 'false') {//控制返回按钮显示
this.isGasStation = true this.isGasStationBack = true
} else { } else {
this.isGasStation = false this.isGasStationBack = false
} }
}); });

6
src/app/pages/oil-station-info/oil-station-info.component.html

@ -139,7 +139,8 @@
<nz-form-item> <nz-form-item>
<nz-form-control> <nz-form-control>
<nz-input-group> <nz-input-group>
<input [(ngModel)]="httpBody.gasStationCount" nz-input type="text" formControlName="gasStationCount" /> <input [(ngModel)]="httpBody.gasStationCount" nz-input type="text"
formControlName="gasStationCount" />
</nz-input-group> </nz-input-group>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
@ -371,4 +372,7 @@
</form> </form>
</div> </div>
</div> </div>
<div class="backbtn">
<button nz-button (click)="goback()">返回</button>
</div>
</div> </div>

18
src/app/pages/oil-station-info/oil-station-info.component.scss

@ -3,6 +3,7 @@
height: 100%; height: 100%;
display: flex; display: flex;
justify-content: center; justify-content: center;
position: relative;
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
@ -149,10 +150,12 @@
border-radius: 0px; border-radius: 0px;
color: #91CCFF; color: #91CCFF;
} }
button:nth-child(1) { button:nth-child(1) {
width: 100px; width: 100px;
margin-left: 16px; margin-left: 16px;
} }
button:nth-child(2) { button:nth-child(2) {
width: 130px; width: 130px;
margin-left: 16px; margin-left: 16px;
@ -160,3 +163,18 @@
} }
} }
} }
.backbtn {
position: absolute;
right: 66px;
top: 22px;
button {
width: 64px;
height: 32px;
background: rgba(0, 129, 255, 0.3);
border: 1px solid #36A2FF;
border-radius: 0px;
color: #91CCFF;
}
}

7
src/app/pages/oil-station-info/oil-station-info.component.ts

@ -5,6 +5,7 @@ import { ObjectsSimpleService } from 'src/app/service/objectsSimple.service';
import { NzMessageService } from 'ng-zorro-antd/message'; import { NzMessageService } from 'ng-zorro-antd/message';
import * as moment from 'moment'; import * as moment from 'moment';
import Viewer from 'viewerjs'; import Viewer from 'viewerjs';
import { Router, ActivatedRoute } from '@angular/router'
@Component({ @Component({
selector: 'app-oil-station-info', selector: 'app-oil-station-info',
templateUrl: './oil-station-info.component.html', templateUrl: './oil-station-info.component.html',
@ -12,7 +13,7 @@ import Viewer from 'viewerjs';
}) })
export class OilStationInfoComponent implements OnInit { export class OilStationInfoComponent implements OnInit {
validateForm!: FormGroup; validateForm!: FormGroup;
constructor(private fb: FormBuilder, private objectsSrv: ObjectsSimpleService, private http: HttpClient, private message: NzMessageService) { } constructor(private router: Router, private fb: FormBuilder, private objectsSrv: ObjectsSimpleService, private http: HttpClient, private message: NzMessageService) { }
userdata: any userdata: any
@ -148,7 +149,9 @@ export class OilStationInfoComponent implements OnInit {
dangerousChemicalLicenseImage: '', dangerousChemicalLicenseImage: '',
gasSellLicenseImage: '' gasSellLicenseImage: ''
} }
goback() {
this.router.navigate(['/warning/petrolStation'])
}
submitForm() { submitForm() {

5
src/app/pages/today-warning/today-warning.component.html

@ -111,7 +111,10 @@
{{item.violateTime | date:"yyyy-MM-dd HH:mm:ss"}} {{item.violateTime | date:"yyyy-MM-dd HH:mm:ss"}}
</div> </div>
<div nz-col nzSpan="2"> <div nz-col nzSpan="2">
<button nz-button (click)="look(item)">查看</button> <button nz-button (click)="look(item)" style="margin-right: 8px;">查看</button>
<button *ngIf="!item.handleTime" nz-button (click)="disposition(item)">处置</button>
<span *ngIf="item.handleTime" class="dispositioned">已处置</span>
<!-- <img style="margin-left: 24px;cursor: pointer;" src="../../../assets/images/excel.png" alt=""> --> <!-- <img style="margin-left: 24px;cursor: pointer;" src="../../../assets/images/excel.png" alt=""> -->
</div> </div>
</div> </div>

7
src/app/pages/today-warning/today-warning.component.scss

@ -87,7 +87,8 @@
color: #91CCFF; color: #91CCFF;
margin-bottom: 12px; margin-bottom: 12px;
background: linear-gradient(180deg, rgba(3, 0, 0, 0) 0%, rgba(0, 46, 91, 0.68) 100%); background: linear-gradient(180deg, rgba(3, 0, 0, 0) 0%, rgba(0, 46, 91, 0.68) 100%);
box-sizing: border-box;
padding-right: 36px;
div { div {
font-size: 15px; font-size: 15px;
text-align: center; text-align: center;
@ -103,6 +104,8 @@
} }
} }
} }
.dispositioned{
color: #23D9FF;
}
} }
} }

4
src/app/pages/today-warning/today-warning.component.ts

@ -128,4 +128,8 @@ export class TodayWarningComponent implements OnInit {
}); });
const instance = modal.getContentComponent(); const instance = modal.getContentComponent();
} }
disposition(item){
}
} }

Loading…
Cancel
Save