|
|
|
@ -1,4 +1,4 @@ |
|
|
|
|
import { Component } from '@angular/core'; |
|
|
|
|
import {AfterViewInit, Component} from '@angular/core'; |
|
|
|
|
import {Router, RouterLink, RouterOutlet} from "@angular/router"; |
|
|
|
|
import { |
|
|
|
|
NzContentComponent, |
|
|
|
@ -10,7 +10,7 @@ import { |
|
|
|
|
import {NzBreadCrumbComponent, NzBreadCrumbItemComponent} from "ng-zorro-antd/breadcrumb"; |
|
|
|
|
import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; |
|
|
|
|
import {NzMenuDirective, NzMenuGroupComponent, NzMenuItemComponent, NzSubMenuComponent} from "ng-zorro-antd/menu"; |
|
|
|
|
import {NgClass, NgForOf} from "@angular/common"; |
|
|
|
|
import {DatePipe, NgClass, NgForOf, NgIf} from "@angular/common"; |
|
|
|
|
import {NzIconDirective} from "ng-zorro-antd/icon"; |
|
|
|
|
import {NzTabComponent, NzTabSetComponent} from "ng-zorro-antd/tabs"; |
|
|
|
|
import {TabComponent} from "../tab/tab.component"; |
|
|
|
@ -22,6 +22,22 @@ import {Dictionary, dictionaryData} from "../../../data/common/dictionary.namesp |
|
|
|
|
import {CommonService} from "../../../services/common/common.service"; |
|
|
|
|
import {LoginService} from "../../../services/login/login.service"; |
|
|
|
|
import {NzConfigService} from "ng-zorro-antd/core/config"; |
|
|
|
|
import {NzPopoverDirective} from "ng-zorro-antd/popover"; |
|
|
|
|
import {NzListItemComponent, NzListItemMetaComponent, NzListModule} from "ng-zorro-antd/list"; |
|
|
|
|
import {NzTypographyComponent} from "ng-zorro-antd/typography"; |
|
|
|
|
import {IconService} from "../../../services/common/icon.service"; |
|
|
|
|
import {FileService} from "../../../services/file/file.service"; |
|
|
|
|
import {DataUtilsPipe} from "../../../pipes/common/data-utils.pipe"; |
|
|
|
|
import {GoodsListComponent} from "../../trade/goods-list/goods-list.component"; |
|
|
|
|
import {Subject} from "rxjs"; |
|
|
|
|
import {CommunicationService} from "../../../services/common/communication.service"; |
|
|
|
|
import {NzModalComponent, NzModalContentDirective, NzModalModule} from "ng-zorro-antd/modal"; |
|
|
|
|
import {NzResultComponent} from "ng-zorro-antd/result"; |
|
|
|
|
import {NzSpinComponent} from "ng-zorro-antd/spin"; |
|
|
|
|
import {NzTimelineComponent, NzTimelineItemComponent} from "ng-zorro-antd/timeline"; |
|
|
|
|
import {NzTableComponent, NzTableModule} from "ng-zorro-antd/table"; |
|
|
|
|
import {BusinessTypePipe} from "../../../pipes/file/business-type.pipe"; |
|
|
|
|
import {StatusPipe} from "../../../pipes/file/status.pipe"; |
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-index', |
|
|
|
@ -37,6 +53,7 @@ import {NzConfigService} from "ng-zorro-antd/core/config"; |
|
|
|
|
NzRowDirective, |
|
|
|
|
NzColDirective, |
|
|
|
|
NzMenuItemComponent, |
|
|
|
|
NzModalModule, |
|
|
|
|
NzMenuDirective, |
|
|
|
|
RouterLink, |
|
|
|
|
NzSubMenuComponent, |
|
|
|
@ -44,12 +61,31 @@ import {NzConfigService} from "ng-zorro-antd/core/config"; |
|
|
|
|
NgClass, |
|
|
|
|
NzIconDirective, |
|
|
|
|
NzTabComponent, |
|
|
|
|
NzListModule, |
|
|
|
|
NzTabSetComponent, |
|
|
|
|
TabComponent, |
|
|
|
|
NzSiderComponent, |
|
|
|
|
NzMenuGroupComponent, |
|
|
|
|
NzDropDownDirective, |
|
|
|
|
NzDropdownMenuComponent |
|
|
|
|
NzDropdownMenuComponent, |
|
|
|
|
NgIf, |
|
|
|
|
NzPopoverDirective, |
|
|
|
|
NzListItemComponent, |
|
|
|
|
NzListItemMetaComponent, |
|
|
|
|
NzTypographyComponent, |
|
|
|
|
NzTableModule, |
|
|
|
|
DataUtilsPipe, |
|
|
|
|
GoodsListComponent, |
|
|
|
|
DatePipe, |
|
|
|
|
NzModalComponent, |
|
|
|
|
NzResultComponent, |
|
|
|
|
NzSpinComponent, |
|
|
|
|
NzTimelineComponent, |
|
|
|
|
NzTimelineItemComponent, |
|
|
|
|
NzTableComponent, |
|
|
|
|
NzModalContentDirective, |
|
|
|
|
BusinessTypePipe, |
|
|
|
|
StatusPipe |
|
|
|
|
], |
|
|
|
|
templateUrl: './index.component.html', |
|
|
|
|
styleUrl: './index.component.less', |
|
|
|
@ -60,22 +96,39 @@ export class IndexComponent { |
|
|
|
|
'menuName' : '首页', |
|
|
|
|
'selected' : true, |
|
|
|
|
}]; |
|
|
|
|
// 表单页数
|
|
|
|
|
tablePageNum = 1; |
|
|
|
|
// 表单数据
|
|
|
|
|
tableData: any; |
|
|
|
|
userInfo: any; |
|
|
|
|
// 左侧菜单栏数据
|
|
|
|
|
leftMenuData: any = []; |
|
|
|
|
// 侧边菜单展示开关
|
|
|
|
|
isCollapse = true; |
|
|
|
|
loading = false; |
|
|
|
|
isVisible = false; |
|
|
|
|
// 当前顶级菜单
|
|
|
|
|
currentParentMenu: any = {}; |
|
|
|
|
|
|
|
|
|
downloadType = 1; |
|
|
|
|
interval: any; |
|
|
|
|
constructor( |
|
|
|
|
private commonService: CommonService, |
|
|
|
|
private storage: BrowserStorageService, |
|
|
|
|
private communicationService: CommunicationService, |
|
|
|
|
private nzConfigService: NzConfigService, |
|
|
|
|
private iconService: IconService, |
|
|
|
|
private fileService: FileService, |
|
|
|
|
private message: NzMessageService, |
|
|
|
|
private router: Router, // 路由
|
|
|
|
|
private login: LoginService |
|
|
|
|
) { |
|
|
|
|
|
|
|
|
|
this.communicationService.currentMessage.subscribe(message => { |
|
|
|
|
this.fileRecords(); |
|
|
|
|
this.findFileRecords(message.id); |
|
|
|
|
this.downloadType = 2; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.nzConfigService.set('button', { nzSize: 'large' }) |
|
|
|
|
this.nzConfigService.set('treeSelect', { nzSize: 'large' }) |
|
|
|
|
// 缓存数据字典
|
|
|
|
@ -99,6 +152,7 @@ export class IndexComponent { |
|
|
|
|
|
|
|
|
|
this.menuData = this.menuData.concat(this.storage.get(DATA)['menuTree']); |
|
|
|
|
this.userInfo = this.storage.get(DATA)['account']; |
|
|
|
|
this.fileRecords(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 选择操作
|
|
|
|
@ -131,4 +185,58 @@ export class IndexComponent { |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 弹出下载记录
|
|
|
|
|
public getFileRecords() { |
|
|
|
|
this.loading = true; |
|
|
|
|
this.isVisible = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 查询下载记录
|
|
|
|
|
public fileRecords() { |
|
|
|
|
let searchForm = { |
|
|
|
|
time: new Date().getTime() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.fileService.getFileRecordsList(searchForm , (data: any) => { |
|
|
|
|
if (data['return_code'] == '000000') { |
|
|
|
|
this.tableData = data['return_data']; |
|
|
|
|
} else { |
|
|
|
|
this.message.error(data['return_msg']); |
|
|
|
|
} |
|
|
|
|
this.loading = false; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 查询详情
|
|
|
|
|
public findFileRecords(id: number) { |
|
|
|
|
this.interval = setInterval(() => this.fileService.findFileRecords(id, (data: any) => { |
|
|
|
|
if (data['return_code'] == '000000') { |
|
|
|
|
if (data['return_data'].status == 1) { |
|
|
|
|
clearTimeout(this.interval); |
|
|
|
|
console.log("完成"); |
|
|
|
|
this.downloadType = 1; |
|
|
|
|
this.fileRecords(); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
clearTimeout(this.interval); |
|
|
|
|
this.fileRecords(); |
|
|
|
|
this.downloadType = 1; |
|
|
|
|
} |
|
|
|
|
}), 1000); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 下载
|
|
|
|
|
public getDownLoad(id: number) { |
|
|
|
|
this.fileService.getDownLoad(id, (data: any) => { |
|
|
|
|
if (data['return_code'] == '000000') { |
|
|
|
|
window.location.href = data['return_data']; |
|
|
|
|
}else { |
|
|
|
|
this.message.error(data['return_msg']); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|