From 9e0fd88801e45c343f3e38f45e951e6f4c9cb532 Mon Sep 17 00:00:00 2001
From: username <1105965053@qq.com>
Date: Mon, 21 Sep 2020 09:16:03 +0800
Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=20=E5=B9=B3=E9=9D=A2?=
=?UTF-8?q?=E5=9B=BE=20=E5=AE=8C=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/app/http-interceptors/base-interceptor.ts | 1 +
.../http-interceptors/cache-token.service.ts | 6 +--
src/app/navigation/navigation.component.html | 2 +-
src/app/navigation/navigation.component.scss | 45 +++++++++----------
src/app/ui/plan/collection-tools.component.ts | 17 +++----
.../working-area/working-area.component.ts | 12 ++---
6 files changed, 40 insertions(+), 43 deletions(-)
diff --git a/src/app/http-interceptors/base-interceptor.ts b/src/app/http-interceptors/base-interceptor.ts
index 971bc44..76b39b8 100644
--- a/src/app/http-interceptors/base-interceptor.ts
+++ b/src/app/http-interceptors/base-interceptor.ts
@@ -47,6 +47,7 @@ export class BaseInterceptor implements HttpInterceptor {
this.token.delete()
sessionStorage.clear()
window.localStorage.clear()
+ this.router.navigate(['ui/plan'])
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
diff --git a/src/app/http-interceptors/cache-token.service.ts b/src/app/http-interceptors/cache-token.service.ts
index 3360241..ec040d3 100644
--- a/src/app/http-interceptors/cache-token.service.ts
+++ b/src/app/http-interceptors/cache-token.service.ts
@@ -15,9 +15,9 @@ export class CacheTokenService {
login () {
return new Promise ((resolve,reject)=>{
- sessionStorage.setItem("buildingTypeId",'5e7c9027a3050b1a840ed4b8'); //建筑类型
- sessionStorage.setItem("planId",'5f52fd529e91f4410005eac5'); //预案ID
- sessionStorage.setItem("companyId",'5e9964caa760a059e84512e9'); //单位ID
+ sessionStorage.setItem("buildingTypeId",'5e7c9078a3050b1a840ed4ba'); //建筑类型
+ sessionStorage.setItem("planId",''); //预案ID
+ sessionStorage.setItem("companyId",'5f67042b9e91f4410005f55c'); //单位ID
this.http.post('/api/Account/SignIn',this.loginData).subscribe((data:any)=>{
sessionStorage.setItem("level",data.level);
sessionStorage.setItem("token",data.token);
diff --git a/src/app/navigation/navigation.component.html b/src/app/navigation/navigation.component.html
index 24d0ee1..2518959 100644
--- a/src/app/navigation/navigation.component.html
+++ b/src/app/navigation/navigation.component.html
@@ -1,7 +1,7 @@
- 着火单位: 高科技创业园
+ 着火单位: 贵港油库
diff --git a/src/app/navigation/navigation.component.scss b/src/app/navigation/navigation.component.scss
index 138ec9f..8b66e7e 100644
--- a/src/app/navigation/navigation.component.scss
+++ b/src/app/navigation/navigation.component.scss
@@ -5,7 +5,7 @@
-moz-background-size:100% 100%;
background-size:100% 100%;
box-sizing: border-box;
- padding: 5px 25px;
+ padding: 10px 38px 28px;
overflow: hidden;
display: flex;
flex-direction: column;
@@ -15,43 +15,42 @@
header {
width: 100%;
height: 80px;
- border: 1px solid #30bbec;
- border-top: none;;
+ border-bottom: 1px solid #30bbec;
+ overflow: hidden;
.title {
width: 100%;
height: 25px;
- line-height: 25px;
text-align: center;
- font-size: 18px;
+ font-size: 20px;
font-weight: 550;
color: red;
}
.router{
width: 100%;
height: 55px;
- outline: none;
- .routerText {
- display: inline-block;
- margin: 7px 15px;
- width: 150px;
- height: 37px;
- line-height: 37px;
- font-size: 20px;
- text-align: center;
- border-top-left-radius: 15px;
- border-bottom-right-radius: 15px;
- cursor:pointer;
- outline: none;
- border: 2px solid #999;
- color: #999;
- }
}
}
+//路由DIV
+.routerText {
+ display: inline-block;
+ margin: 7px 15px;
+ width: 150px;
+ height: 37px;
+ line-height: 37px;
+ font-size: 20px;
+ text-align: center;
+ border-top-left-radius: 15px;
+ border-bottom-right-radius: 15px;
+ cursor:pointer;
+ outline: none;
+ border: 2px solid #fff;
+ color: #fff;
+}
//路由选中样式
.routerLinkActive {
- background-color: rgba(240,136,14,0.3);
- outline: none;
+ border: 2px solid rgb(248, 161, 62);
+ background-color: rgba(240,136,14,0.65);
}
//中间区域
diff --git a/src/app/ui/plan/collection-tools.component.ts b/src/app/ui/plan/collection-tools.component.ts
index d7b63f0..86eb500 100644
--- a/src/app/ui/plan/collection-tools.component.ts
+++ b/src/app/ui/plan/collection-tools.component.ts
@@ -639,24 +639,21 @@ export class planComponent implements OnInit {
//计算 可视区域内宽度, 是否缩放背景图
backGroundScale () {
let that = this
- let dad = document.querySelector('.functionalDomainContent').clientWidth
- let dadHeight = document.querySelector('.functionalDomainContent').clientHeight
- let left = document.querySelector('.functionalDomainLeft').clientWidth
- let right = document.querySelector('.functionalDomainRight').clientWidth
- let imgWidth = dad - left - right//可视区域内 宽度
+ let dadWidth = document.querySelector('.canvas').clientWidth
+ let dadHeight = document.querySelector('.canvas').clientHeight
let img = new Image()
img.src = this.selectingSitePlan.imageUrl;
img.onload = function(){
- if (img.height > dadHeight && img.width > imgWidth) {
- let width = imgWidth/img.width
+ if (img.height > dadHeight && img.width > dadWidth) {
+ let width = dadWidth/img.width
let height = dadHeight/img.height
that.canvas.setBackgroundScale((width>height? height : width)-0.005)
return
} else if (img.height > dadHeight) {
that.canvas.setBackgroundScale((dadHeight/img.height)-0.005)
return
- } else if (img.width > imgWidth) {
- that.canvas.setBackgroundScale((imgWidth/img.width)-0.005)
+ } else if (img.width > dadWidth) {
+ that.canvas.setBackgroundScale((dadWidth/img.width)-0.005)
return
}
};
@@ -695,7 +692,7 @@ export class planComponent implements OnInit {
//陈鹏飞↓↓↓
//陈鹏飞↓↓↓
//陈鹏飞↓↓↓
- params = {companyId: "5e9964caa760a059e84512e9"}
+ params = {companyId: sessionStorage.getItem('companyId')}
allFireElements:any = []; //当前 单位/建筑 下的消防要素
isShowAttribute:boolean = true; //属性栏 是否显示 默认数据
diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts
index a32bf2d..fd1f759 100644
--- a/src/app/working-area/working-area.component.ts
+++ b/src/app/working-area/working-area.component.ts
@@ -115,16 +115,16 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
isLogin () {
let token = sessionStorage.getItem('token') // 判断 是否登录状态
if (token) {
- this.init.getAllLibrary()
- this.init.getAllBuildings()
- this.init.getAllFirePlan()
+ // this.init.getAllLibrary() //获取素材库
+ this.init.getAllBuildings() //获取所有建筑
+ this.init.getAllFirePlan() //获取所有灾情
this.init.getSitePlan() //调用父组件 初始化方法
} else {
this.token.login().then(res=>{
this.init.params.companyId = sessionStorage.getItem('companyId')
- this.init.getAllLibrary()
- this.init.getAllBuildings()
- this.init.getAllFirePlan()
+ // this.init.getAllLibrary() //获取素材库
+ this.init.getAllBuildings() //获取所有建筑
+ this.init.getAllFirePlan() //获取所有灾情
this.init.getSitePlan() //调用父组件 初始化方法
})
}