From 9b744d44bb1a2cf47fdf2e5defba26198424ccb3 Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Sat, 12 Dec 2020 11:04:18 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=20=E7=BC=96=E5=88=B6?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- proxy.config.json | 2 +- src/app/app-routing.module.ts | 2 + src/app/app.component.ts | 6 +- .../http-interceptors/cache-token.service.ts | 5 +- .../lockscreen/lockscreen.component.html | 6 +- .../pages/lockscreen/lockscreen.component.ts | 19 +- src/app/pages/login/login.component.html | 2 +- src/app/pages/login/login.component.ts | 5 +- src/app/tabbar/tabbar.component.ts | 2 +- .../collection-tools.component.html | 310 ++++-------------- .../collection-tools.component.scss | 32 +- .../collection-tools.component.ts | 23 +- src/app/ui/collection-tools/panel.scss | 5 +- src/app/ui/ui-routing.module.ts | 2 - src/assets/css/ngZorroTree.css | 6 +- src/styles.scss | 17 +- 16 files changed, 134 insertions(+), 310 deletions(-) diff --git a/proxy.config.json b/proxy.config.json index b28a11f..f9e430c 100644 --- a/proxy.config.json +++ b/proxy.config.json @@ -1,6 +1,6 @@ { "/api": { - "target": "http://121.37.20.190:8000", + "target": "http://121.37.20.190:8006", "secure": false, "changeOrigin": true } diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 0eac6ce..8dd5e69 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -7,6 +7,7 @@ import { LockscreenComponent } from './pages/lockscreen/lockscreen.component'; //路由守卫 import {AuthGuard} from './auth.guard' import { CreateTestScoreComponent } from './examiner/create-test-score/create-test-score.component'; +import { CollectionToolsComponent } from './ui/collection-tools/collection-tools.component'; @@ -20,6 +21,7 @@ const routes: Routes = [ ] }, { path:'examiner/create-test-score', component:CreateTestScoreComponent,canActivate: [AuthGuard],}, //创建试卷具体分数页面 + { path: 'canvasTool', component:CollectionToolsComponent,canActivate: [AuthGuard], }, //编制工具 { path:'adminLogin', component:LoginComponent}, //管理员登录路由 { path:'login', component:LockscreenComponent}, //教员学员登录路由 diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 5664cce..0a77d73 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -20,12 +20,12 @@ export class AppComponent { let token = sessionStorage.getItem("token"); let refreshToken = sessionStorage.getItem("refreshToken"); if(token && refreshToken) { - this.http.post('/api/Account/RefreshToken', { + this.http.post('/api/ExamAccounts/RefreshToken', { token: token, refreshToken: refreshToken }).subscribe((data:any) => { - sessionStorage.setItem('realName',data.realName) - sessionStorage.setItem('roleType',data.roleType) + sessionStorage.setItem("realName",data.realName); + sessionStorage.setItem("roleType",data.roleType); sessionStorage.setItem("token",data.token); sessionStorage.setItem("refreshToken",data.refreshToken); this.token.startUp() diff --git a/src/app/http-interceptors/cache-token.service.ts b/src/app/http-interceptors/cache-token.service.ts index 5e0b65e..c5a8399 100644 --- a/src/app/http-interceptors/cache-token.service.ts +++ b/src/app/http-interceptors/cache-token.service.ts @@ -17,11 +17,12 @@ export class CacheTokenService { var token = sessionStorage.getItem("token"); var refreshToken = sessionStorage.getItem("refreshToken"); if (token && refreshToken) { - this.http.post('/api/Account/RefreshToken', { + this.http.post('/api/ExamAccounts/RefreshToken', { token: token, refreshToken: refreshToken, }).subscribe((data:any) => { - sessionStorage.setItem('realName',data.realName) + sessionStorage.setItem("realName",data.realName); + sessionStorage.setItem("roleType",data.roleType); sessionStorage.setItem("token",data.token); sessionStorage.setItem("refreshToken",data.refreshToken); }) diff --git a/src/app/pages/lockscreen/lockscreen.component.html b/src/app/pages/lockscreen/lockscreen.component.html index 5a296cc..2a5c0b5 100644 --- a/src/app/pages/lockscreen/lockscreen.component.html +++ b/src/app/pages/lockscreen/lockscreen.component.html @@ -13,13 +13,13 @@
- - + +
account_box - +
diff --git a/src/app/pages/lockscreen/lockscreen.component.ts b/src/app/pages/lockscreen/lockscreen.component.ts index 5894d66..19a09b4 100644 --- a/src/app/pages/lockscreen/lockscreen.component.ts +++ b/src/app/pages/lockscreen/lockscreen.component.ts @@ -20,21 +20,22 @@ export class LockscreenComponent implements OnInit { } - roleType:string = '2'; //登录角色 + roleType:string = '1'; //登录角色 errmsg :string = ''; //错误信息 //登录 onSubmit(e){ - // let params = { roleType: this.roleType } - // this.http.post('/api/Account/SignIn',e,{params}).subscribe((data:any)=>{ - // sessionStorage.setItem("realName",data.realName); - // sessionStorage.setItem("token",data.token); - // sessionStorage.setItem("refreshToken",data.refreshToken); - // this.token.startUp(); //登陆成功启动定时器刷新token - // this.router.navigate(['/home/createexam']) //登陆成功跳转页面 - // },(err) => {this.errmsg = err}) + let params = { roleType: this.roleType } + this.http.post('/api/ExamAccounts/SignIn',e,{params}).subscribe((data:any)=>{ + sessionStorage.setItem("realName",data.realName); + sessionStorage.setItem("roleType",data.roleType); + sessionStorage.setItem("token",data.token); + sessionStorage.setItem("refreshToken",data.refreshToken); + this.token.startUp(); //登陆成功启动定时器刷新token + this.router.navigate(['/home/createexam']) //登陆成功跳转页面 + },(err) => {this.errmsg = err}) } //切换登录角色 diff --git a/src/app/pages/login/login.component.html b/src/app/pages/login/login.component.html index 443f290..7517352 100644 --- a/src/app/pages/login/login.component.html +++ b/src/app/pages/login/login.component.html @@ -9,7 +9,7 @@
account_box - +
diff --git a/src/app/pages/login/login.component.ts b/src/app/pages/login/login.component.ts index d15cdfd..d5bef70 100644 --- a/src/app/pages/login/login.component.ts +++ b/src/app/pages/login/login.component.ts @@ -27,9 +27,10 @@ export class LoginComponent implements OnInit { //登录 onSubmit(e){ - // let params = { roleType: '0' },{params} - this.http.post('/api/Account/SignIn',e).subscribe((data:any)=>{ + let params = { roleType: '2' } + this.http.post('/api/ExamAccounts/SignIn',e,{params}).subscribe((data:any)=>{ sessionStorage.setItem("realName",data.realName); + sessionStorage.setItem("roleType",data.roleType); sessionStorage.setItem("token",data.token); sessionStorage.setItem("refreshToken",data.refreshToken); this.token.startUp(); //登陆成功启动定时器刷新token diff --git a/src/app/tabbar/tabbar.component.ts b/src/app/tabbar/tabbar.component.ts index f1566b9..b49916f 100644 --- a/src/app/tabbar/tabbar.component.ts +++ b/src/app/tabbar/tabbar.component.ts @@ -40,7 +40,7 @@ export class TabbarComponent implements OnInit { signOut () { let out = confirm("您确定要退出吗") if(out) { - this.http.post('/api/Account/SignOut',{}).subscribe(data=>{ + this.http.post('/api/ExamAccounts/SignOut',{}).subscribe(data=>{ sessionStorage.clear() this.token.delete() this.router.navigate(['/login']) diff --git a/src/app/ui/collection-tools/collection-tools.component.html b/src/app/ui/collection-tools/collection-tools.component.html index a7798e7..aa7377e 100644 --- a/src/app/ui/collection-tools/collection-tools.component.html +++ b/src/app/ui/collection-tools/collection-tools.component.html @@ -1,176 +1,46 @@
- - - 图标大小 - - - 正常 - 放大2倍 - 放大4倍 - - - - - - - - 基本信息名称 - visibility - - - 想定作业名称 - visibility - -
- - 基本信息编辑 - - - 想定作业编辑 - -
- - tv - create - description - -
- - -
- - - - -
-
- keyboard_arrow_right - keyboard_arrow_left - 天气 - - 气温 -
- - -
- 风力 - - 风向 - -
-
+
- +
- -
-
- -
-
- keyboard_arrow_up - keyboard_arrow_down - - +
+ + +
+
+ keyboard_arrow_up + keyboard_arrow_down + +
-
-
- - - - - - - - - - photo_size_select_actual - - - - - - -
-

- keyboard_arrow_up -

-

- edit - delete -

-

- cached - library_books -

-

- keyboard_arrow_down -

+
+ + + +
+ +
- -
+ +
+
@@ -200,35 +70,46 @@
- -
-
- keyboard_arrow_up - keyboard_arrow_down - - + +
+
+ keyboard_arrow_up + keyboard_arrow_down +
-
- - - -
- -
- edit - add - library_books - delete_forever -
-
-
+
+ + + + + + {{node.name}} + + ({{node.children.length}}) + visibility + + + + + + {{node.name}} + + ({{node.children.length}}) + visibility + + + +
- +
@@ -236,7 +117,7 @@
-
+
属性 @@ -387,67 +268,10 @@
- -
- -
- -
-
- 消防要素 -
-
- -
- - - - - - - {{node.name}} - - ({{node.children.length}}) - visibility - - - - - - - {{node.name}} - - ({{node.children.length}}) - visibility - - - -
-
-
-
-
-
- 节点详情 -
-
- 注意事项 -
-
-
- - -
-
+
\ No newline at end of file diff --git a/src/app/ui/collection-tools/collection-tools.component.scss b/src/app/ui/collection-tools/collection-tools.component.scss index 19402a6..557f5fc 100644 --- a/src/app/ui/collection-tools/collection-tools.component.scss +++ b/src/app/ui/collection-tools/collection-tools.component.scss @@ -1,16 +1,12 @@ @import './panel.scss'; -.icongray{ - color: #D9D0DC; -} .content { width: 100%; height: 100%; overflow: hidden; box-sizing: border-box; - padding: 1px; + padding: 3px; display: flex; flex-direction: column; - .buildingbtnchecked{ background-color: #34A6FD; color: white; @@ -25,6 +21,7 @@ align-items:center; min-height: 40px; background-color: #fff; + box-shadow: inset 0px -3px 5px 0px rgb(165, 163, 163); .nameShow{ cursor: pointer; user-select: none; @@ -109,7 +106,7 @@ top: 0; } .functionalDomain { - flex: 90%; + flex: 95%; overflow: hidden; .functionalDomainContent { position: relative; @@ -309,13 +306,6 @@ .firecategoriesTree{ overflow-y: auto; height: 100%; - mat-tree-node{ - position: relative; - } - .isLookCss{ - position: absolute; - right: 6px; - } } } @@ -337,13 +327,19 @@ div:focus { margin-right: 3px; } - // tree +.isLookCss{ + margin-left: auto; + color: #07CDCF; + .icongray{ + color: #D9D0DC; + } +} .mat-tree-node{ - min-height: 0; - height: 32px; - line-height: 32px; - font-size: 13px; + padding-right: 3px; + min-height: 30px; + height: 30px; + font-size: 12px; cursor: pointer; } .treeNode:hover{ diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts index 2b9a6b4..16cc996 100644 --- a/src/app/ui/collection-tools/collection-tools.component.ts +++ b/src/app/ui/collection-tools/collection-tools.component.ts @@ -147,7 +147,7 @@ export class CollectionToolsComponent implements OnInit { this.isImgNumCss = false } } - pattern:boolean = true//默认为基本信息编辑 + pattern:boolean = false//默认为基本信息编辑 yyy(){ @@ -634,7 +634,7 @@ export class CollectionToolsComponent implements OnInit { sessionStorage.setItem('planId','5fa8b0b8f8eb762cb03c6c30') sessionStorage.setItem('buildingTypeId','5e7c9018a3050b1a840ed4b7') - this.getAllLibrary() //获取素材库 + this.getAllLibrary('plan') //获取素材库 this.getAllBuildings() //获取所有建筑 this.getAllFirePlan() //获取当前单位灾情 @@ -1316,7 +1316,6 @@ export class CollectionToolsComponent implements OnInit { isRefresh? this.canvasData.isChange = false : null //服务中 数据是否改动 改为false isRefresh? this.isShowProperty = true : null isRefresh? this.isShowAttribute = true : null - !this.pattern? this.mateFireForce() : null //刷新 建筑楼层 火源/力量图标 let beforeOneId = this.selectingSitePlan.id || '' //当前 选中 平面图 楼层/区域 id let companyBuildingData = JSON.parse(JSON.stringify( this.canvasData.originalcompanyBuildingData || {} )) // 当前 单位/建筑 数据 @@ -1876,17 +1875,11 @@ export class CollectionToolsComponent implements OnInit { } this.http.post('/api/Disasters',msg).subscribe(data=>{ this.allFirePlan.push(data) - let params = {disasterId: this.allFirePlan[0].id || ''} - this.http.get('/api/DisposalNodes',{params:params}).subscribe(data=>{ //所有处置节点 - this.canvasData.allDisposalNode = data - }) + this.getDisposalNode() }) } else { //单位 有灾情时 this.allFirePlan = data - let params = {disasterId: this.allFirePlan[0].id || ''} - this.http.get('/api/DisposalNodes',{params:params}).subscribe(data=>{ //所有处置节点 - this.canvasData.allDisposalNode = data - }) + this.getDisposalNode() } }) } @@ -1895,10 +1888,10 @@ export class CollectionToolsComponent implements OnInit { getDisposalNode () { this.selectDisposalNode = '' let params = {disasterId: this.allFirePlan[0].id || ''} - this.http.get('/api/DisasterData/Markers',{params:params}).subscribe(data=>{ //灾情标签信息 - this.canvasData.allNodeMarkers = data - this.mateFireForce() - }) + // this.http.get('/api/DisasterData/Markers',{params:params}).subscribe(data=>{ //灾情标签信息 + // this.canvasData.allNodeMarkers = data + // this.mateFireForce() + // }) this.http.get('/api/DisposalNodes',{params:params}).subscribe(data=>{ //处置节点 this.canvasData.allDisposalNode = data this.handleHybridTree() diff --git a/src/app/ui/collection-tools/panel.scss b/src/app/ui/collection-tools/panel.scss index f0ae073..287a991 100644 --- a/src/app/ui/collection-tools/panel.scss +++ b/src/app/ui/collection-tools/panel.scss @@ -17,8 +17,8 @@ font-family: Roboto, "Helvetica Neue", sans-serif; font-size: 15px; font-weight: 400; - color: #000; - background: linear-gradient(to top,#cdced1,#FFF); + color: #fff; + background: #07CDCF; } //平面图头部字体图标样式 .hover { @@ -207,6 +207,7 @@ margin: 1px 0; } //素材库图片flex +.mat-expansion-panel-header {background-color: #d6f4f5;} #panelLibrary .text{ box-sizing: border-box; margin-left: 10px; diff --git a/src/app/ui/ui-routing.module.ts b/src/app/ui/ui-routing.module.ts index 3040846..003f889 100644 --- a/src/app/ui/ui-routing.module.ts +++ b/src/app/ui/ui-routing.module.ts @@ -10,7 +10,6 @@ import { LookOverTestComponent } from './look-over-test/look-over-test.component import { StatisticAnalysisComponent } from './statistic-analysis/statistic-analysis.component'; import { JoinExamComponent } from './join-exam/join-exam.component'; import { TestRecordsComponent } from './test-records/test-records.component'; -import { CollectionToolsComponent } from './collection-tools/collection-tools.component' const routes: Routes = [ { path: '', component:CreateExamComponent }, @@ -21,7 +20,6 @@ const routes: Routes = [ { path: 'testRecords', component:TestRecordsComponent }, { path: 'teachear', component:TeacherManagementComponent }, //管理员 教员页面 { path: 'examinee', component:EnterpriseuserComponent }, //管理员 考生页面 - { path: 'canvasTool', component:CollectionToolsComponent }, //编制工具 ] @NgModule({ imports: [RouterModule.forChild(routes)], diff --git a/src/assets/css/ngZorroTree.css b/src/assets/css/ngZorroTree.css index d04cca9..3f270a6 100644 --- a/src/assets/css/ngZorroTree.css +++ b/src/assets/css/ngZorroTree.css @@ -336,10 +336,10 @@ .ant-tree .ant-tree-switcher { flex: none; - width: 24px; - height: 35px; + width: 20px; + height: 34px; margin: 0; - line-height: 22px; + line-height: 34px; font-size: 18px; text-align: center; cursor: pointer diff --git a/src/styles.scss b/src/styles.scss index 6ba0a06..6ac0f08 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -64,7 +64,14 @@ table td.mat-footer-cell:last-of-type{ align-items: center; } - +//滚动条样式 +::-webkit-scrollbar{ + width: 5px; + background-color: white; +} +::-webkit-scrollbar-thumb{ + background-color: #999; +} //x轴滚动条隐藏 .example-sidenav-content { @@ -73,7 +80,7 @@ table td.mat-footer-cell:last-of-type{ } - + .mat-tab-body-wrapper{ height: 100%; } @@ -81,12 +88,12 @@ table td.mat-footer-cell:last-of-type{ overflow: hidden!important; } .mat-select-panel { - width: 210px; - font-size: 13px!important; + width: 210px; + font-size: 13px!important; } .mat-drawer-container{ - background-color: none; + background-color: none; } //可展开面板按钮颜色