陈敬瑜 3 years ago
parent
commit
3452b562da
  1. 25
      src/app/pages/login/login.component.spec.ts
  2. 44
      src/app/pages/login/login.component.ts
  3. 13
      src/app/pages/login/lookUpdateData.html
  4. 0
      src/app/pages/login/lookUpdateData.scss
  5. 6
      src/app/pages/pages.module.ts
  6. 1
      src/app/statistic-analysis/home/home.component.ts
  7. 40
      src/app/tabbar/tabbar.component.html
  8. 25
      src/app/tabbar/tabbar.component.spec.ts
  9. 99
      src/app/tabbar/tabbar.component.ts
  10. 8
      src/index.html

25
src/app/pages/login/login.component.spec.ts

@ -1,25 +0,0 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { LoginComponent } from './login.component';
describe('LoginComponent', () => {
let component: LoginComponent;
let fixture: ComponentFixture<LoginComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LoginComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(LoginComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

44
src/app/pages/login/login.component.ts

@ -47,11 +47,6 @@ export class LoginComponent implements OnInit {
this.router.navigate([`/keyUnit`]) this.router.navigate([`/keyUnit`])
this.dialogChangePassword() this.dialogChangePassword()
return return
data.forEach(item => {
if (item.url) {
}
});
} else { } else {
this.snackBar.open('该用户角色未分配任何菜单', '确定', { this.snackBar.open('该用户角色未分配任何菜单', '确定', {
duration: 3000 duration: 3000
@ -79,9 +74,26 @@ export class LoginComponent implements OnInit {
dialogRef.afterClosed().subscribe((data) => { dialogRef.afterClosed().subscribe((data) => {
sessionStorage.setItem('isDefaultPassword', 'false') sessionStorage.setItem('isDefaultPassword', 'false')
this.lookUpdateData()
}); });
} else {
this.lookUpdateData()
} }
} }
//查看更新内容
lookUpdateData() {
let dialogRef = this.dialog.open(lookUpdateDataComponent,
{ width: '668px' });
dialogRef.afterClosed().subscribe((data) => {
});
}
//7天免登录自动登录 //7天免登录自动登录
automaticLogin() { automaticLogin() {
let isNoLogin = localStorage.getItem("isnologin") let isNoLogin = localStorage.getItem("isnologin")
@ -148,4 +160,26 @@ export class ChangepasswordComponent2 implements OnInit {
}
@Component({
selector: 'app-lookUpdateData',
templateUrl: './lookUpdateData.html',
styleUrls: ['./lookUpdateData.scss']
})
export class lookUpdateDataComponent implements OnInit {
constructor(private http: HttpClient, public snackBar: MatSnackBar,
public dialogRef: MatDialogRef<lookUpdateDataComponent>) { }
ngOnInit() {
}
onSubmit(e) {
}
} }

13
src/app/pages/login/lookUpdateData.html

@ -0,0 +1,13 @@
<p style="text-align: center;">更新公告</p>
<p>更新内容如下:</p>
<p>1.增加V级文本预案模板导入功能;</p>
<p>2.已上传至预案编制管理平台的Ⅴ级文本预案,增加【转在线导入】功能;</p>
<p>3.增加V级文本预案自定义在线编制功能;</p>
<p>为了预案导入功能正常使用,且提高文本预案识别导入的成功率,需要注意以下几点:</p>
<p>1.【转在线导入】功能,仅支持以Ⅴ级文本预案模板做预案的文档,其他文档不支持【转在线导入】功能。</p>
<p>2.Ⅴ级文本预案模板可以随意修改内容,但整体框架不得做任何修改,不允许随意删除、合并、增加单元格,否则影响预案识别导入的内容。</p>
<p>3.文档导入成功后,可在线编辑,也可以自行添加新的功能模块。</p>
<p>4.V级预案模板导入时仅支持微软Office保存并且格式为.docx的文档,其余格式无法导入。</p>
<p>5.V级预案模板文档以及V级预案使用说明、视频可点击右上角帮助进行下载、查看。其中Ⅴ级文本预案模板文件夹内放置九大类型预案模板、V级预案转在线导入文件夹内包含使用说明及视频、V级预案自定义文件夹内包含使用说明及视频、V级在线编制文件夹内包含使用说明及视频。</p>

0
src/app/pages/login/lookUpdateData.scss

6
src/app/pages/pages.module.ts

@ -1,11 +1,9 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { PagesComponent } from './pages.component'; import { PagesComponent } from './pages.component';
import { ChangepasswordComponent2, LoginComponent } from './login/login.component'; import { ChangepasswordComponent2, LoginComponent, lookUpdateDataComponent } from './login/login.component';
import { RegisterComponent } from './register/register.component'; import { RegisterComponent } from './register/register.component';
import { PagesRoutingModule } from './pages-routing.module' import { PagesRoutingModule } from './pages-routing.module'
import {A11yModule} from '@angular/cdk/a11y'; import {A11yModule} from '@angular/cdk/a11y';
import {DragDropModule} from '@angular/cdk/drag-drop'; import {DragDropModule} from '@angular/cdk/drag-drop';
import {PortalModule} from '@angular/cdk/portal'; import {PortalModule} from '@angular/cdk/portal';
@ -54,7 +52,7 @@ import { HomeComponent } from './home/home.component';
import { HomedetailComponent } from './homedetail/homedetail.component'; import { HomedetailComponent } from './homedetail/homedetail.component';
import { UiModule } from '../ui/ui.module'; import { UiModule } from '../ui/ui.module';
@NgModule({ @NgModule({
declarations: [PagesComponent, LoginComponent, RegisterComponent, LockscreenComponent, HomeComponent, HomedetailComponent,ChangepasswordComponent2], declarations: [PagesComponent, LoginComponent, RegisterComponent, LockscreenComponent, HomeComponent, HomedetailComponent,ChangepasswordComponent2,lookUpdateDataComponent],
imports: [ imports: [
PagesRoutingModule, PagesRoutingModule,

1
src/app/statistic-analysis/home/home.component.ts

@ -52,7 +52,6 @@ export class HomeComponent implements OnInit {
this.planState.resize() this.planState.resize()
this.chartDwsjcj.resize() this.chartDwsjcj.resize()
this.chartZdgzqy.resize() this.chartZdgzqy.resize()
} */ } */
//获取数据 //获取数据
ordata ordata

40
src/app/tabbar/tabbar.component.html

@ -214,15 +214,6 @@
</div> </div>
<div class="isUpdates" *ngIf="isUpdates"> <div class="isUpdates" *ngIf="isUpdates">
<!-- <span class="name" (click)="submitAudit()"
*ngIf="!contentVerify || contentVerify.verifyState == 5 || contentVerify.verifyState == 4">提交审核</span>
<span class="name" (click)="cancelAudit()" *ngIf="contentVerify && contentVerify.verifyState == 3">撤销审核</span> -->
<!-- <span class="span" *ngIf="contentVerify && contentVerify.verifyState == 3">(
<span *ngIf="contentVerify.operation == 2" style="color: red;">删除</span>
<span *ngIf="contentVerify.operation == 0">新增</span>
<span *ngIf="contentVerify.operation == 1">更新</span>
待审核)</span> -->
<span [matTooltip]="contentVerify.remark" class="span" <span [matTooltip]="contentVerify.remark" class="span"
*ngIf="contentVerify && contentVerify.verifyState == 4">(审核通过)</span> *ngIf="contentVerify && contentVerify.verifyState == 4">(审核通过)</span>
<span [matTooltip]="contentVerify.remark" class="span" <span [matTooltip]="contentVerify.remark" class="span"
@ -230,19 +221,39 @@
</div> </div>
<div class="spinner" *ngIf="isSpinner"> <!-- <div class="spinner" *ngIf="isSpinner">
<mat-spinner [diameter]='26' color="warn"></mat-spinner> <mat-spinner [diameter]='26' color="warn"></mat-spinner>
<span style="font-size: 13px;margin-left: 6px;">帮助文档下载中,请等待...</span> <span style="font-size: 13px;margin-left: 6px;">帮助文档下载中,请等待...</span>
</div> </div> -->
<!-- 帮助文档按钮 --> <!-- 帮助文档按钮 -->
<button mat-icon-button [matMenuTriggerFor]="appSetHelp" class="help" title="帮助"> <button mat-icon-button [matMenuTriggerFor]="appSetHelp" class="help" title="帮助">
<mat-icon>help</mat-icon> <mat-icon>help</mat-icon>
</button> </button>
<mat-menu #appSetHelp="matMenu" yPosition="below" xPosition="after"> <mat-menu #appSetHelp="matMenu" yPosition="below" xPosition="after">
<button mat-menu-item (click)='downloadHelpFile()'> <button mat-menu-item (click)='lookUpdate()'>
<mat-icon>update</mat-icon>
<span>查看更新内容</span>
</button>
<button mat-menu-item (click)="aFile('/assets/helpword/help.pdf','数字化预案编制管理平台手册.pdf')">
<mat-icon>save_alt</mat-icon> <mat-icon>save_alt</mat-icon>
<span>下载帮助文档</span> <span>下载帮助文档</span>
</button> </button>
<button mat-menu-item (click)="aFile('/assets/helpword/plantemplate.zip','V级文本预案模板.zip')">
<mat-icon>save_alt</mat-icon>
<span>V级文本预案模板</span>
</button>
<button mat-menu-item (click)="aFile('/assets/helpword/plancustom.zip','V级预案自定义.zip')">
<mat-icon>save_alt</mat-icon>
<span>V级预案自定义</span>
</button>
<button mat-menu-item (click)="aFile('/assets/helpword/planonlineedit.zip','V级在线编制.zip')">
<mat-icon>save_alt</mat-icon>
<span>V级在线编制</span>
</button>
<button mat-menu-item (click)="aFile('/assets/helpword/planonlineimport.zip','V级预案转在线导入.zip')">
<mat-icon>save_alt</mat-icon>
<span>V级预案转在线导入</span>
</button>
</mat-menu> </mat-menu>
<!-- 全屏 --> <!-- 全屏 -->
<button mat-button (click)="!isfullscreen?fullscreenToggle():closefullscreen()" class="fullscreen"> <button mat-button (click)="!isfullscreen?fullscreenToggle():closefullscreen()" class="fullscreen">
@ -257,11 +268,6 @@
<!-- 黑夜模式开关 --> <!-- 黑夜模式开关 -->
<mat-slide-toggle (change)='onChange($event.checked)' class="darktheme"></mat-slide-toggle> <mat-slide-toggle (change)='onChange($event.checked)' class="darktheme"></mat-slide-toggle>
<!-- 锁屏按钮 -->
<!-- <button mat-button class="lockscreen" [routerLink]="['/lockscreen']" routerLinkActive="router-link-active" >
<mat-icon>screen_lock_landscape</mat-icon>
</button> -->
<!-- 登录信息按钮 --> <!-- 登录信息按钮 -->
<button mat-icon-button [matMenuTriggerFor]="appMenu" class="login"> <button mat-icon-button [matMenuTriggerFor]="appMenu" class="login">
<mat-icon>account_circle</mat-icon> <mat-icon>account_circle</mat-icon>

25
src/app/tabbar/tabbar.component.spec.ts

@ -1,25 +0,0 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { TabbarComponent } from './tabbar.component';
describe('TabbarComponent', () => {
let component: TabbarComponent;
let fixture: ComponentFixture<TabbarComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ TabbarComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(TabbarComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

99
src/app/tabbar/tabbar.component.ts

@ -1,13 +1,13 @@
import { Component, OnInit,Output,EventEmitter } from '@angular/core'; import { Component, OnInit, Output, EventEmitter, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http' import { HttpClient } from '@angular/common/http'
import { Router, ActivatedRoute, NavigationEnd } from '@angular/router' import { Router, ActivatedRoute, NavigationEnd } from '@angular/router'
import { CacheTokenService } from '../http-interceptors/cache-token.service'//引入服务 import { CacheTokenService } from '../http-interceptors/cache-token.service'//引入服务
import { MatDialog } from '@angular/material/dialog';
import { ChangepasswordComponent } from '../ui/changepassword/changepassword.component' import { ChangepasswordComponent } from '../ui/changepassword/changepassword.component'
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { filter } from 'rxjs/operators'; import { filter } from 'rxjs/operators';
import { TabbarAndScoreService } from '../http-interceptors/tabbar-and-score.service'; import { TabbarAndScoreService } from '../http-interceptors/tabbar-and-score.service';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { lookUpdateDataComponent } from '../pages/login/login.component';
@Component({ @Component({
selector: 'app-tabbar', selector: 'app-tabbar',
templateUrl: './tabbar.component.html', templateUrl: './tabbar.component.html',
@ -81,26 +81,20 @@ export class TabbarComponent implements OnInit {
this.companyIntegrityScore = data.companyIntegrityScore this.companyIntegrityScore = data.companyIntegrityScore
}) })
} }
isSpinner:boolean = false//下载帮助文档进度
//下载帮助文档 aFile(url, name) {
downloadHelpFile () { let a = document.createElement("a");
this.getFileMSG() a.href = url;
a.download = name;
a.click();
} }
helpFile:any = 'api/ObjectMetadata/help/数字化预案编制管理平台手册.pdf'; //下载文件的url地址 lookUpdate() {
download:any; //下载的文件 let dialogRef = this.dialog.open(lookUpdateDataComponent,
{ width: '668px' });
//获取下载文件信息 dialogRef.afterClosed().subscribe((data) => {
getFileMSG () {
this.isSpinner = true });
this.http.get(`${this.helpFile}`).subscribe(data=>{
this.download = data
this.downloadFile()
},err=>{
let config = new MatSnackBarConfig();
config.verticalPosition = 'bottom';
config.duration = 3000
this.snackBar.open('下载失败','确定',config);
})
} }
//提交单位审核 //提交单位审核
submitAudit() { submitAudit() {
@ -140,70 +134,8 @@ export class TabbarComponent implements OnInit {
this.snackBar.open(err, '确定', config); this.snackBar.open(err, '确定', config);
}) })
} }
}
//初始化下载
downloadFile () {
let file = this.download
let fileSize = file.fileLength//下载文件的总大小
let shardSize = 10 * 1024 * 1024 //文件大小是否大于10MB
if (file && fileSize<=shardSize) { //<=10MB时直接下载
this.http.get(`/api/Objects/help/${file.objectName}`,{responseType: 'blob'},).subscribe(data=>{
let url = window.URL.createObjectURL(new Blob([data])); //createObjectURL创建一个下载Blob的url地址
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", '数字化预案编制管理平台手册.pdf');
document.body.appendChild(link);
link.click();
this.isSpinner = false
},err=>{
let config = new MatSnackBarConfig();
config.verticalPosition = 'bottom';
config.duration = 3000
this.snackBar.open('下载失败','确定',config);
})
} else if (file && fileSize>shardSize) { //>10MB时分块下载
this.blockingDownload() //分段下载
}
}
//分段下载并合并
async blockingDownload () {
let file = this.download
let fileSize = file.fileLength //下载文件的总大小
let shardSize = 3 * 1024 * 1024 //3MB一个分片
let allSlice = Math.ceil(fileSize / shardSize) //总文件/3MB===共分多少段
let allFile:any = [] //所有的file分段
for (let i=0;i<allSlice;i++) {
let start = i * shardSize //每次下载文件开始位置
let end = Math.min(fileSize, start + shardSize-1); //每次下载文件结束为止
let result = await new Promise ((result,reject)=>{
this.http.get(`/api/Objects/help/${file.objectName}`,{headers:{'range':`bytes= ${start}-${end}`},responseType:'blob'}).subscribe(data=>{
result(data) })
})
allFile.push(result)
if (allFile.length === allSlice) { //合并文件输出给浏览器
let url = window.URL.createObjectURL(new Blob(allFile)); //createObjectURL创建一个下载Blob的url地址
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", '数字化预案编制管理平台手册.pdf');
document.body.appendChild(link);
link.click();
this.isSpinner = false
}
} //for循环
} }
ngOnDestroy() { ngOnDestroy() {
this.routerEventsListener.unsubscribe() this.routerEventsListener.unsubscribe()
} }
@ -307,3 +239,4 @@ export class TabbarComponent implements OnInit {
} }
} }

8
src/index.html

@ -23,10 +23,10 @@
</body> </body>
<!-- <script type="text/javascript" src="./assets/kmap/kmap-service-main-kd.js"></script> --> <!-- <script type="text/javascript" src="./assets/kmap/kmap-service-main-kd.js"></script> -->
<!-- <script src="http://10.81.73.39:8000/webapi/maps?v=2.0&key=e4b359dc7b03f9418b7497f807131346&plugin=AMap.Driving,AMap.MouseTool,AMap.RangingTool"></script> <script src="http://10.81.73.39:8000/webapi/maps?v=2.0&key=e4b359dc7b03f9418b7497f807131346&plugin=AMap.Driving,AMap.MouseTool,AMap.RangingTool"></script>
<script src="http://10.81.73.39:8000/webapi/ui/1.1/main.js"></script> --> <script src="http://10.81.73.39:8000/webapi/ui/1.1/main.js"></script>
<script src="https://webapi.amap.com/maps?v=2.0&key=e4b359dc7b03f9418b7497f807131346&plugin=AMap.Driving,AMap.MouseTool,AMap.RangingTool"></script> <!-- <script src="https://webapi.amap.com/maps?v=2.0&key=e4b359dc7b03f9418b7497f807131346&plugin=AMap.Driving,AMap.MouseTool,AMap.RangingTool"></script>
<script src="https://webapi.amap.com/ui/1.1/main.js"></script> <script src="https://webapi.amap.com/ui/1.1/main.js"></script> -->
<script src="/assets/html2canvas.js"></script> <script src="/assets/html2canvas.js"></script>
<script type="text/javascript" src="/assets/wordexport/jquery.js"></script> <script type="text/javascript" src="/assets/wordexport/jquery.js"></script>
<script type="text/javascript" src="/assets/wordexport/FileSaver.js"></script> <script type="text/javascript" src="/assets/wordexport/FileSaver.js"></script>

Loading…
Cancel
Save