|
|
|
@ -4,7 +4,7 @@ import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree'
|
|
|
|
|
import { MatPaginator } from '@angular/material/paginator'; |
|
|
|
|
import { FlatTreeControl } from '@angular/cdk/tree'; |
|
|
|
|
import { FormControl } from '@angular/forms'; |
|
|
|
|
import { Router,ActivatedRoute } from '@angular/router' |
|
|
|
|
import { Router, ActivatedRoute } from '@angular/router' |
|
|
|
|
import { PageEvent } from '@angular/material/paginator'; |
|
|
|
|
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; |
|
|
|
|
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; |
|
|
|
@ -17,56 +17,56 @@ declare var CryptoJS
|
|
|
|
|
}) |
|
|
|
|
export class MeetPlanComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog,public snackBar: MatSnackBar) { } |
|
|
|
|
constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, private tree: TreeService, public dialog: MatDialog, public snackBar: MatSnackBar) { } |
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
|
//console.log(window.matchMedia("(max-width: 1300px)").matches&&window.matchMedia("(max-height: 700px)").matches)
|
|
|
|
|
if(window.matchMedia("(max-width: 1400px)").matches){ |
|
|
|
|
this.pcMore=false |
|
|
|
|
this.padMore=true |
|
|
|
|
this.pcfind=false |
|
|
|
|
this.padjt=true |
|
|
|
|
}else{ |
|
|
|
|
this.pcfind=true |
|
|
|
|
this.pcMore=true |
|
|
|
|
this.padMore=false |
|
|
|
|
this.padjt=false |
|
|
|
|
if (window.matchMedia("(max-width: 1400px)").matches) { |
|
|
|
|
this.pcMore = false |
|
|
|
|
this.padMore = true |
|
|
|
|
this.pcfind = false |
|
|
|
|
this.padjt = true |
|
|
|
|
} else { |
|
|
|
|
this.pcfind = true |
|
|
|
|
this.pcMore = true |
|
|
|
|
this.padMore = false |
|
|
|
|
this.padjt = false |
|
|
|
|
} |
|
|
|
|
this.levels = sessionStorage.getItem("level"); |
|
|
|
|
if(this.levels == "0"){//如果是总队
|
|
|
|
|
if (this.levels == "0") {//如果是总队
|
|
|
|
|
this.preparelevels = [ |
|
|
|
|
{name:"总队",value:"1"}, |
|
|
|
|
{name:"支队",value:"2"}, |
|
|
|
|
{name:"大队",value:"4"}, |
|
|
|
|
{name:"中队",value:"8"} |
|
|
|
|
{ name: "总队", value: "1" }, |
|
|
|
|
{ name: "支队", value: "2" }, |
|
|
|
|
{ name: "大队", value: "4" }, |
|
|
|
|
{ name: "中队", value: "8" } |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
if(this.levels == "1"){//如果是支队
|
|
|
|
|
if (this.levels == "1") {//如果是支队
|
|
|
|
|
this.preparelevels = [ |
|
|
|
|
{name:"支队",value:"2"}, |
|
|
|
|
{name:"大队",value:"4"}, |
|
|
|
|
{name:"中队",value:"8"} |
|
|
|
|
{ name: "支队", value: "2" }, |
|
|
|
|
{ name: "大队", value: "4" }, |
|
|
|
|
{ name: "中队", value: "8" } |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
if(this.levels == "2"){//如果是大队
|
|
|
|
|
if (this.levels == "2") {//如果是大队
|
|
|
|
|
this.preparelevels = [ |
|
|
|
|
{name:"大队",value:"4"}, |
|
|
|
|
{name:"中队",value:"8"} |
|
|
|
|
{ name: "大队", value: "4" }, |
|
|
|
|
{ name: "中队", value: "8" } |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
if(this.levels == "3"){//如果是中队
|
|
|
|
|
if (this.levels == "3") {//如果是中队
|
|
|
|
|
this.preparelevels = [ |
|
|
|
|
{name:"中队",value:"8"} |
|
|
|
|
{ name: "中队", value: "8" } |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
this.getAlltabledate() |
|
|
|
|
} |
|
|
|
|
//生成word
|
|
|
|
|
word(id,fileName){ |
|
|
|
|
word(id, fileName) { |
|
|
|
|
/* id :文档dom节点 fileName:文件名称(.doc) */ |
|
|
|
|
var header = "<html xmlns:o='urn:schemas-microsoft-com:office:office' " + |
|
|
|
|
"xmlns:w='urn:schemas-microsoft-com:office:word' >" + |
|
|
|
|
"<head><meta charset='utf-8'><title>Export HTML to Word Document with JavaScript</title></head><body>" |
|
|
|
|
"xmlns:w='urn:schemas-microsoft-com:office:word' >" + |
|
|
|
|
"<head><meta charset='utf-8'><title>Export HTML to Word Document with JavaScript</title></head><body>" |
|
|
|
|
var footer = '</body></html>' |
|
|
|
|
var sourceHTML = header + document.getElementById(id).innerHTML + footer |
|
|
|
|
|
|
|
|
@ -77,12 +77,12 @@ export class MeetPlanComponent implements OnInit {
|
|
|
|
|
fileDownload.download = fileName // 下载名称
|
|
|
|
|
fileDownload.click() |
|
|
|
|
document.body.removeChild(fileDownload) |
|
|
|
|
} |
|
|
|
|
levels
|
|
|
|
|
} |
|
|
|
|
levels |
|
|
|
|
|
|
|
|
|
preparelevels:any |
|
|
|
|
plcheck:boolean //编制级别勾选框
|
|
|
|
|
displayedColumns: string[] = ['unitname','level','addname','addtime', 'plantype', 'passstate','isopen','projectlevel','operation']; |
|
|
|
|
preparelevels: any |
|
|
|
|
plcheck: boolean //编制级别勾选框
|
|
|
|
|
displayedColumns: string[] = ['unitname', 'level', 'addname', 'addtime', 'plantype', 'passstate', 'isopen', 'projectlevel', 'operation']; |
|
|
|
|
tabledataSource |
|
|
|
|
typePlan//新预案类型
|
|
|
|
|
unitname//预案名称
|
|
|
|
@ -95,97 +95,97 @@ export class MeetPlanComponent implements OnInit {
|
|
|
|
|
unitstate//审核状态
|
|
|
|
|
projectlevel//编制级别
|
|
|
|
|
//分页
|
|
|
|
|
@ViewChild(MatPaginator, {static: true})
|
|
|
|
|
@ViewChild(MatPaginator, { static: true }) |
|
|
|
|
pageEvent: PageEvent; |
|
|
|
|
paginator: MatPaginator; |
|
|
|
|
length:any; //共多少条数据
|
|
|
|
|
pageSize:any; //每页条数
|
|
|
|
|
length: any; //共多少条数据
|
|
|
|
|
pageSize: any; //每页条数
|
|
|
|
|
pageSizeOptions: number[] = [10] //设置每页条数
|
|
|
|
|
PageNumber:any; //第几页
|
|
|
|
|
|
|
|
|
|
PageNumber: any; //第几页
|
|
|
|
|
|
|
|
|
|
pcMore//pc更多
|
|
|
|
|
pcput=false//pc收起
|
|
|
|
|
pcput = false//pc收起
|
|
|
|
|
pcfind//pc查询
|
|
|
|
|
padjt=false |
|
|
|
|
padMore=true//pad收缩控制
|
|
|
|
|
padput=false//pad收起按钮
|
|
|
|
|
imgsrcopen="../../../assets/images/routdown2.png" |
|
|
|
|
imgsrcdown="../../../assets/images/routup2.png" |
|
|
|
|
pcInfo(){ |
|
|
|
|
this.pcMore=!this.pcMore |
|
|
|
|
this.pcput=!this.pcput |
|
|
|
|
padjt = false |
|
|
|
|
padMore = true//pad收缩控制
|
|
|
|
|
padput = false//pad收起按钮
|
|
|
|
|
imgsrcopen = "../../../assets/images/routdown2.png" |
|
|
|
|
imgsrcdown = "../../../assets/images/routup2.png" |
|
|
|
|
pcInfo() { |
|
|
|
|
this.pcMore = !this.pcMore |
|
|
|
|
this.pcput = !this.pcput |
|
|
|
|
} |
|
|
|
|
padInfo(){ |
|
|
|
|
this.padMore=!this.padMore |
|
|
|
|
this.padput=!this.padput |
|
|
|
|
padInfo() { |
|
|
|
|
this.padMore = !this.padMore |
|
|
|
|
this.padput = !this.padput |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//获取表格数据
|
|
|
|
|
getAlltabledate(){ |
|
|
|
|
getAlltabledate() { |
|
|
|
|
let reservePlanType |
|
|
|
|
this.reservePlanType ? reservePlanType = JSON.parse(JSON.stringify(this.reservePlanType)) : reservePlanType = '' |
|
|
|
|
if(this.reservePlanType && this.reservePlanType.length != 0){ |
|
|
|
|
if (this.reservePlanType && this.reservePlanType.length != 0) { |
|
|
|
|
reservePlanType = eval(this.reservePlanType.join("|")) |
|
|
|
|
}
|
|
|
|
|
let paramsdata:any = { |
|
|
|
|
Name:this.unitname||'', |
|
|
|
|
planCategories:this.level||[6,7], |
|
|
|
|
} |
|
|
|
|
let paramsdata: any = { |
|
|
|
|
Name: this.unitname || '', |
|
|
|
|
planCategories: this.level || [6, 7], |
|
|
|
|
//PlanType:reservePlanType||'',
|
|
|
|
|
DisasterType:this.typePlan||'', |
|
|
|
|
CreatorName:this.addname||'', |
|
|
|
|
AuditStatus:this.unitstate|| '', |
|
|
|
|
CreationTimeRangeStart:this.addtime||'', |
|
|
|
|
CreationTimeRangeEnd:this.endtime||'', |
|
|
|
|
PlanLevel:this.projectlevel||'', |
|
|
|
|
HasChildrenPlanLevel:this.plcheck||'', |
|
|
|
|
DisasterType: this.typePlan || '', |
|
|
|
|
CreatorName: this.addname || '', |
|
|
|
|
AuditStatus: this.unitstate || '', |
|
|
|
|
CreationTimeRangeStart: this.addtime || '', |
|
|
|
|
CreationTimeRangeEnd: this.endtime || '', |
|
|
|
|
PlanLevel: this.projectlevel || '', |
|
|
|
|
HasChildrenPlanLevel: this.plcheck || '', |
|
|
|
|
PageNumber: this.PageNumber || '1', |
|
|
|
|
PageSize: this.pageSizeOptions[0], |
|
|
|
|
|
|
|
|
|
PageSize: this.pageSizeOptions[0], |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
this.http.get("/api/PlanComponentsMajor",{params:paramsdata}).subscribe((data:any)=>{ |
|
|
|
|
this.http.get("/api/PlanComponentsMajor", { params: paramsdata }).subscribe((data: any) => { |
|
|
|
|
this.length = data.totalCount |
|
|
|
|
this.tabledataSource = data.items |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
//分页事件
|
|
|
|
|
changePage(e){ |
|
|
|
|
this.PageNumber = e.pageIndex+1 |
|
|
|
|
changePage(e) { |
|
|
|
|
this.PageNumber = e.pageIndex + 1 |
|
|
|
|
this.getAlltabledate() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//查询
|
|
|
|
|
onSubmit (value) { |
|
|
|
|
if(this.endtime!=undefined&&this.addtime>this.endtime){ |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('开始时间不能大于结束时间!','确定',config); |
|
|
|
|
}else{ |
|
|
|
|
onSubmit(value) { |
|
|
|
|
if (this.endtime != undefined && this.addtime > this.endtime) { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('开始时间不能大于结束时间!', '确定', config); |
|
|
|
|
} else { |
|
|
|
|
this.PageNumber = 1 |
|
|
|
|
this.pageEvent.pageIndex = 0 |
|
|
|
|
this.getAlltabledate(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//删除预案
|
|
|
|
|
deletePlan(id){ |
|
|
|
|
deletePlan(id) { |
|
|
|
|
let isTrue = confirm('您确定要删除吗') |
|
|
|
|
if(isTrue){ |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.http.delete(`/api/PlanComponentsMajor/${id}`).subscribe(data=>{ |
|
|
|
|
this.snackBar.open('删除成功!','确定',config); |
|
|
|
|
this.getAlltabledate() |
|
|
|
|
},err => { |
|
|
|
|
this.snackBar.open(err,'确定',config); |
|
|
|
|
}) |
|
|
|
|
if (isTrue) { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.http.delete(`/api/PlanComponentsMajor/${id}`).subscribe(data => { |
|
|
|
|
this.snackBar.open('删除成功!', '确定', config); |
|
|
|
|
this.getAlltabledate() |
|
|
|
|
}, err => { |
|
|
|
|
this.snackBar.open(err, '确定', config); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//提交审核
|
|
|
|
|
submitAudit(element){ |
|
|
|
|
submitAudit(element) { |
|
|
|
|
// console.log(element)
|
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
@ -193,115 +193,96 @@ export class MeetPlanComponent implements OnInit {
|
|
|
|
|
/* if(element.auditStatus == 4){ |
|
|
|
|
this.snackBar.open('审核退回的预案需要修改后方可再次提交审核!','确定',config); |
|
|
|
|
} */ |
|
|
|
|
this.http.put(`/api/PlanComponentsMajor/${element.id}/Commit`,"").subscribe(data=>{ |
|
|
|
|
this.getAlltabledate() |
|
|
|
|
},err => { |
|
|
|
|
this.snackBar.open(err,'确定',config); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.http.put(`/api/PlanComponentsMajor/${element.id}/Commit`, "").subscribe(data => { |
|
|
|
|
this.getAlltabledate() |
|
|
|
|
}, err => { |
|
|
|
|
this.snackBar.open(err, '确定', config); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//撤销审核
|
|
|
|
|
cancelAudit(element){ |
|
|
|
|
cancelAudit(element) { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.http.put(`/api/PlanComponentsMajor/${element.id}/Cancel`,"").subscribe(data=>{ |
|
|
|
|
this.http.put(`/api/PlanComponentsMajor/${element.id}/Cancel`, "").subscribe(data => { |
|
|
|
|
this.getAlltabledate() |
|
|
|
|
},err => { |
|
|
|
|
this.snackBar.open(err,'确定',config); |
|
|
|
|
}, err => { |
|
|
|
|
this.snackBar.open(err, '确定', config); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查看预案
|
|
|
|
|
openPlan(element){ |
|
|
|
|
//fetchUrl: `http://172.18.0.1:8000/api/Objects/PlanPlatform/`+fetchUrl
|
|
|
|
|
let filename:string |
|
|
|
|
openPlan(element) { |
|
|
|
|
let fetchUrl = element.attachmentUrls[0] |
|
|
|
|
let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl); |
|
|
|
|
let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); |
|
|
|
|
let jwt = sessionStorage.getItem("token"); |
|
|
|
|
let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); |
|
|
|
|
let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); |
|
|
|
|
let identityJsonparse=JSON.parse(identityJson) |
|
|
|
|
this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{ |
|
|
|
|
filename=data.fileName
|
|
|
|
|
let json={ |
|
|
|
|
doc: { |
|
|
|
|
docId: docId, |
|
|
|
|
title: filename, |
|
|
|
|
fetchUrl: `http://172.18.0.1:8000/api/Objects/PlanPlatform/`+fetchUrl, |
|
|
|
|
}, |
|
|
|
|
user: { |
|
|
|
|
uid: identityJsonparse.sub, |
|
|
|
|
nickName: identityJsonparse.name, |
|
|
|
|
avatar: "", |
|
|
|
|
privilege:element.auditStatus!='1'&&element.auditStatus!='16'?[ |
|
|
|
|
'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT'
|
|
|
|
|
]:[ |
|
|
|
|
'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT'
|
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
var stringjson=JSON.stringify(json) |
|
|
|
|
var wordArray = CryptoJS.enc.Utf8.parse(stringjson); |
|
|
|
|
var base64 = CryptoJS.enc.Base64.stringify(wordArray); |
|
|
|
|
window.open(`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`) |
|
|
|
|
}) |
|
|
|
|
let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase() |
|
|
|
|
if (suffix == 'docx' || suffix == 'doc') { |
|
|
|
|
let arr = fetchUrl.split('.') |
|
|
|
|
arr[arr.length - 1] = 'pdf' |
|
|
|
|
window.open(`/api/Objects/PlanPlatform/` + arr.join('.')) |
|
|
|
|
} else if (suffix == 'pdf') { |
|
|
|
|
window.open(`/api/Objects/PlanPlatform/` + fetchUrl) |
|
|
|
|
} else { |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('该文件类型暂不支持在线查看', '确定', config); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//下载↓
|
|
|
|
|
selectDownloadFile:any; //选择下载的文件
|
|
|
|
|
download:any; //下载文件元数据
|
|
|
|
|
downloadisLoading:boolean = false; //进度条loading加载
|
|
|
|
|
downloadProgress:number=0; //进度条进度
|
|
|
|
|
downloadFileName:any |
|
|
|
|
fileUrls:any //当前预案附件地址
|
|
|
|
|
fileDatas:any = [] |
|
|
|
|
selectedFileIndex : any = 0 |
|
|
|
|
selectedFileData : any
|
|
|
|
|
|
|
|
|
|
uploadFileLonging:any |
|
|
|
|
selectDownloadFile: any; //选择下载的文件
|
|
|
|
|
download: any; //下载文件元数据
|
|
|
|
|
downloadisLoading: boolean = false; //进度条loading加载
|
|
|
|
|
downloadProgress: number = 0; //进度条进度
|
|
|
|
|
downloadFileName: any |
|
|
|
|
fileUrls: any //当前预案附件地址
|
|
|
|
|
fileDatas: any = [] |
|
|
|
|
selectedFileIndex: any = 0 |
|
|
|
|
selectedFileData: any |
|
|
|
|
|
|
|
|
|
uploadFileLonging: any |
|
|
|
|
//读取下载文件信息
|
|
|
|
|
readFile (element) { |
|
|
|
|
readFile(element) { |
|
|
|
|
this.uploadFileLonging = element |
|
|
|
|
element.attachmentUrls.forEach(item=>{ |
|
|
|
|
this.http.get('/api/ObjectMetadata/PlanPlatform/'+item).subscribe((data:any)=>{ |
|
|
|
|
data.filePige = (data.fileLength / (1024*1024)).toFixed(2) |
|
|
|
|
element.attachmentUrls.forEach(item => { |
|
|
|
|
this.http.get('/api/ObjectMetadata/PlanPlatform/' + item).subscribe((data: any) => { |
|
|
|
|
data.filePige = (data.fileLength / (1024 * 1024)).toFixed(2) |
|
|
|
|
this.download = data |
|
|
|
|
this.downloadFile() |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//初始化下载
|
|
|
|
|
downloadFile () { |
|
|
|
|
downloadFile() { |
|
|
|
|
this.downloadProgress = 0 |
|
|
|
|
let file = this.download |
|
|
|
|
let fileSize = file.fileLength//下载文件的总大小
|
|
|
|
|
let shardSize = 10 * 1024 * 1024 //文件大小是否大于10MB
|
|
|
|
|
|
|
|
|
|
if (file && fileSize<=shardSize) { //<=10MB时直接下载
|
|
|
|
|
if (file && fileSize <= shardSize) { //<=10MB时直接下载
|
|
|
|
|
this.downloadisLoading = true |
|
|
|
|
// this.setFileLoading()
|
|
|
|
|
this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{responseType: 'blob'},).subscribe(data=>{ |
|
|
|
|
this.http.get(`/api/Objects/PlanPlatform/${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; |
|
|
|
|
|
|
|
|
|
let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ; |
|
|
|
|
link.setAttribute("download", file.fileName + "-" +this.uploadFileLonging.name + "." + suffix); |
|
|
|
|
let suffix = file.objectName.substring(file.objectName.lastIndexOf(".") + 1, file.objectName.length); |
|
|
|
|
link.setAttribute("download", file.fileName + "-" + this.uploadFileLonging.name + "." + suffix); |
|
|
|
|
document.body.appendChild(link); |
|
|
|
|
link.click(); |
|
|
|
|
this.downloadisLoading = false |
|
|
|
|
// this.setFileLoading()
|
|
|
|
|
}) |
|
|
|
|
} else if (file && fileSize > shardSize) { //>10MB时分块下载
|
|
|
|
|
} else if (file && fileSize > shardSize) { //>10MB时分块下载
|
|
|
|
|
this.blockingDownload() //分段下载
|
|
|
|
|
this.downloadisLoading = true |
|
|
|
|
// this.setFileLoading()
|
|
|
|
@ -310,31 +291,32 @@ export class MeetPlanComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//分段下载并合并
|
|
|
|
|
async 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分段
|
|
|
|
|
let allFile: any = [] //所有的file分段
|
|
|
|
|
|
|
|
|
|
for (let i=0;i<allSlice;i++) { |
|
|
|
|
for (let i = 0; i < allSlice; i++) { |
|
|
|
|
let start = i * shardSize //每次下载文件开始位置
|
|
|
|
|
let end = Math.min(fileSize, start + shardSize-1); //每次下载文件结束为止
|
|
|
|
|
let end = Math.min(fileSize, start + shardSize - 1); //每次下载文件结束为止
|
|
|
|
|
|
|
|
|
|
let result = await new Promise ((result,reject)=>{ |
|
|
|
|
this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{headers:{'range':`bytes= ${start}-${end}`},responseType:'blob'}).subscribe(data=>{ |
|
|
|
|
result(data) })
|
|
|
|
|
let result = await new Promise((result, reject) => { |
|
|
|
|
this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`, { headers: { 'range': `bytes= ${start}-${end}` }, responseType: 'blob' }).subscribe(data => { |
|
|
|
|
result(data) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
allFile.push(result) |
|
|
|
|
this.downloadProgress = Number((i/allSlice).toFixed(2))*100 |
|
|
|
|
this.downloadProgress = Number((i / allSlice).toFixed(2)) * 100 |
|
|
|
|
|
|
|
|
|
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; |
|
|
|
|
let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ; |
|
|
|
|
link.setAttribute("download", file.fileName + "-" +this.uploadFileLonging.name + "." + suffix); |
|
|
|
|
let suffix = file.objectName.substring(file.objectName.lastIndexOf(".") + 1, file.objectName.length); |
|
|
|
|
link.setAttribute("download", file.fileName + "-" + this.uploadFileLonging.name + "." + suffix); |
|
|
|
|
document.body.appendChild(link); |
|
|
|
|
link.click(); |
|
|
|
|
// this.downloadProgress = 0
|
|
|
|
@ -347,29 +329,29 @@ export class MeetPlanComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//取消分块下载
|
|
|
|
|
cancelDowload () { |
|
|
|
|
cancelDowload() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//重置
|
|
|
|
|
reset(){ |
|
|
|
|
this.typePlan='' |
|
|
|
|
this.unitname='' |
|
|
|
|
this.level='' |
|
|
|
|
this.addname='' |
|
|
|
|
this.addtime='' |
|
|
|
|
this.endtime='' |
|
|
|
|
this.reservePlanType='' |
|
|
|
|
this.unitstate='' |
|
|
|
|
this.projectlevel='' |
|
|
|
|
this.plcheck=false |
|
|
|
|
reset() { |
|
|
|
|
this.typePlan = '' |
|
|
|
|
this.unitname = '' |
|
|
|
|
this.level = '' |
|
|
|
|
this.addname = '' |
|
|
|
|
this.addtime = '' |
|
|
|
|
this.endtime = '' |
|
|
|
|
this.reservePlanType = '' |
|
|
|
|
this.unitstate = '' |
|
|
|
|
this.projectlevel = '' |
|
|
|
|
this.plcheck = false |
|
|
|
|
this.getAlltabledate() |
|
|
|
|
} |
|
|
|
|
//新增预案弹窗
|
|
|
|
|
addunit(){ |
|
|
|
|
addunit() { |
|
|
|
|
const dialogRef = this.dialog.open(newunitMeet, { |
|
|
|
|
width: '340px', |
|
|
|
|
height:'490px', |
|
|
|
|
disableClose:true |
|
|
|
|
height: '490px', |
|
|
|
|
disableClose: true |
|
|
|
|
//data: paperDataInfo
|
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe(result => { |
|
|
|
@ -379,12 +361,12 @@ export class MeetPlanComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//审核结果
|
|
|
|
|
auditResult(element){ |
|
|
|
|
auditResult(element) { |
|
|
|
|
// console.log(element)
|
|
|
|
|
const dialogRef = this.dialog.open(meetAuditResult, { |
|
|
|
|
width:"400px", |
|
|
|
|
width: "400px", |
|
|
|
|
//height:"300px",
|
|
|
|
|
data: {element:element} |
|
|
|
|
data: { element: element } |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -396,8 +378,8 @@ export class MeetPlanComponent implements OnInit {
|
|
|
|
|
templateUrl: './newunit.html', |
|
|
|
|
styleUrls: ['./newunit.scss'] |
|
|
|
|
}) |
|
|
|
|
export class newunitMeet{ |
|
|
|
|
constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef<newunitMeet>,@Inject(MAT_DIALOG_DATA) public data: any) {} |
|
|
|
|
export class newunitMeet { |
|
|
|
|
constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef<newunitMeet>, @Inject(MAT_DIALOG_DATA) public data: any) { } |
|
|
|
|
unitname//预案名称
|
|
|
|
|
level//预案级别
|
|
|
|
|
addname//添加人
|
|
|
|
@ -407,182 +389,184 @@ export class newunitMeet{
|
|
|
|
|
projectlevel//编制级别
|
|
|
|
|
|
|
|
|
|
//上传文件↓
|
|
|
|
|
file:any; //上传的文件
|
|
|
|
|
fileName:any; //上传文件name
|
|
|
|
|
uploadisLoading:boolean = false; //进度条loading加载
|
|
|
|
|
uploadProgress:number=0; //进度条进度
|
|
|
|
|
objectName:any; //上传对象名
|
|
|
|
|
uploadId:any; //上传分块上传事件编号
|
|
|
|
|
uploadover:any = false //上传完成之后提示
|
|
|
|
|
selectedPLanType:any//所选预案类型
|
|
|
|
|
selectedPLanName:any//所选预案名称
|
|
|
|
|
localup:boolean = false //本地上传
|
|
|
|
|
file: any; //上传的文件
|
|
|
|
|
fileName: any; //上传文件name
|
|
|
|
|
uploadisLoading: boolean = false; //进度条loading加载
|
|
|
|
|
uploadProgress: number = 0; //进度条进度
|
|
|
|
|
objectName: any; //上传对象名
|
|
|
|
|
uploadId: any; //上传分块上传事件编号
|
|
|
|
|
uploadover: any = false //上传完成之后提示
|
|
|
|
|
selectedPLanType: any//所选预案类型
|
|
|
|
|
selectedPLanName: any//所选预案名称
|
|
|
|
|
localup: boolean = false //本地上传
|
|
|
|
|
defaultisshow = '0' //默认显示上传input框
|
|
|
|
|
|
|
|
|
|
//上传
|
|
|
|
|
upload(){ |
|
|
|
|
document.getElementById('up').click() |
|
|
|
|
upload() { |
|
|
|
|
document.getElementById('up').click() |
|
|
|
|
} |
|
|
|
|
//上传文件input
|
|
|
|
|
filechange(e){ |
|
|
|
|
this.file = e.target.files[0] || null //上传的文件
|
|
|
|
|
//console.log(this.file)
|
|
|
|
|
//上传文件input
|
|
|
|
|
filechange(e) { |
|
|
|
|
this.file = e.target.files[0] || null //上传的文件
|
|
|
|
|
//console.log(this.file)
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//上传文件
|
|
|
|
|
startUploading (planType) { |
|
|
|
|
let file = this.file || null //获取上传的文件
|
|
|
|
|
let fileSize = file.size || null //上传文件的总大小
|
|
|
|
|
let shardSize = 5 * 1024 * 1024 //5MB一个分片
|
|
|
|
|
//上传文件
|
|
|
|
|
startUploading(planType) { |
|
|
|
|
let file = this.file || null //获取上传的文件
|
|
|
|
|
let fileSize = file.size || null //上传文件的总大小
|
|
|
|
|
let shardSize = 5 * 1024 * 1024 //5MB一个分片
|
|
|
|
|
|
|
|
|
|
if (file && fileSize<=shardSize) { //上传文件<=5MB时
|
|
|
|
|
let formData = new FormData() |
|
|
|
|
formData.append("file",file) |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
if (file && fileSize <= shardSize) { //上传文件<=5MB时
|
|
|
|
|
let formData = new FormData() |
|
|
|
|
formData.append("file", file) |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
let level = sessionStorage.getItem("level") |
|
|
|
|
// console.log(level)
|
|
|
|
|
let PlanLevel
|
|
|
|
|
if(level == '0'){ |
|
|
|
|
PlanLevel = 1
|
|
|
|
|
} |
|
|
|
|
if(level == '1'){ |
|
|
|
|
PlanLevel = 2
|
|
|
|
|
} |
|
|
|
|
if(level == '2'){ |
|
|
|
|
PlanLevel = 4
|
|
|
|
|
} |
|
|
|
|
if(level == '3'){ |
|
|
|
|
PlanLevel = 8
|
|
|
|
|
} |
|
|
|
|
this.http.post('/api/Objects/PlanPlatform/meetClass',formData).subscribe((data:any)=>{ |
|
|
|
|
this.objectName = data.objectName |
|
|
|
|
//this.snackBar.open('上传成功!','确定',config);
|
|
|
|
|
|
|
|
|
|
let body:any = { |
|
|
|
|
Name:this.unitname||'', |
|
|
|
|
PlanCategory:Number(this.level)||'', |
|
|
|
|
disasterType: this.reservePlanType, |
|
|
|
|
PlanLevel:PlanLevel, |
|
|
|
|
PlanMode:1, |
|
|
|
|
planType:16, |
|
|
|
|
attachmentUrls:[`${this.objectName}`] |
|
|
|
|
// console.log(level)
|
|
|
|
|
let PlanLevel |
|
|
|
|
if (level == '0') { |
|
|
|
|
PlanLevel = 1 |
|
|
|
|
} |
|
|
|
|
if (level == '1') { |
|
|
|
|
PlanLevel = 2 |
|
|
|
|
} |
|
|
|
|
if (level == '2') { |
|
|
|
|
PlanLevel = 4 |
|
|
|
|
} |
|
|
|
|
// console.log(body)
|
|
|
|
|
this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{ |
|
|
|
|
this.snackBar.open('创建成功!','确定',config); |
|
|
|
|
//console.log(data)
|
|
|
|
|
this.dialogRef.close();
|
|
|
|
|
},err=>{ |
|
|
|
|
this.snackBar.open('创建失败!','确定',config); |
|
|
|
|
if (level == '3') { |
|
|
|
|
PlanLevel = 8 |
|
|
|
|
} |
|
|
|
|
this.http.post('/api/Objects/PlanPlatform/meetClass', formData).subscribe((data: any) => { |
|
|
|
|
this.objectName = data.objectName |
|
|
|
|
//this.snackBar.open('上传成功!','确定',config);
|
|
|
|
|
|
|
|
|
|
let body: any = { |
|
|
|
|
Name: this.unitname || '', |
|
|
|
|
PlanCategory: Number(this.level) || '', |
|
|
|
|
disasterType: this.reservePlanType, |
|
|
|
|
PlanLevel: PlanLevel, |
|
|
|
|
PlanMode: 1, |
|
|
|
|
planType: 16, |
|
|
|
|
attachmentUrls: [`${this.objectName}`] |
|
|
|
|
} |
|
|
|
|
// console.log(body)
|
|
|
|
|
this.http.post("/api/PlanComponentsMajor", body).subscribe((data: any) => { |
|
|
|
|
this.snackBar.open('创建成功!', '确定', config); |
|
|
|
|
//console.log(data)
|
|
|
|
|
this.dialogRef.close(); |
|
|
|
|
}, err => { |
|
|
|
|
this.snackBar.open('创建失败!', '确定', config); |
|
|
|
|
}) |
|
|
|
|
}, err => { |
|
|
|
|
this.snackBar.open('上传失败!', '确定', config); |
|
|
|
|
}) |
|
|
|
|
},err=>{ |
|
|
|
|
this.snackBar.open('上传失败!','确定',config); |
|
|
|
|
}) |
|
|
|
|
} else if (file && fileSize>shardSize) { //上传文件>5MB时,分块上传
|
|
|
|
|
let data = {filename: file.name} |
|
|
|
|
this.uploadisLoading = true |
|
|
|
|
this.http.post('/api/NewMultipartUpload/PlanPlatform/meetClass',{},{params:data}).subscribe((data:any)=>{ //初始化分段上传
|
|
|
|
|
this.objectName = data.objectName |
|
|
|
|
this.uploadId = data.uploadId |
|
|
|
|
this.subsectionUploading(planType) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} else if (file && fileSize > shardSize) { //上传文件>5MB时,分块上传
|
|
|
|
|
let data = { filename: file.name } |
|
|
|
|
this.uploadisLoading = true |
|
|
|
|
this.http.post('/api/NewMultipartUpload/PlanPlatform/meetClass', {}, { params: data }).subscribe((data: any) => { //初始化分段上传
|
|
|
|
|
this.objectName = data.objectName |
|
|
|
|
this.uploadId = data.uploadId |
|
|
|
|
this.subsectionUploading(planType) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
PartNumberETag:any=[]; //每次返回需要保存的信息
|
|
|
|
|
PartNumberETag: any = []; //每次返回需要保存的信息
|
|
|
|
|
//开始分段上传
|
|
|
|
|
async subsectionUploading (planType) { |
|
|
|
|
async subsectionUploading(planType) { |
|
|
|
|
let file = this.file || null //获取上传的文件
|
|
|
|
|
let fileSize = file.size || null //上传文件的总大小
|
|
|
|
|
let shardSize = 5 * 1024 * 1024 //5MB一个分片
|
|
|
|
|
let allSlice = Math.ceil(fileSize / shardSize) //总文件/5MB===共分多少段 向上取整
|
|
|
|
|
|
|
|
|
|
for (let i = 0;i < allSlice;i++) { //循环分段上传
|
|
|
|
|
let start = i * shardSize //切割文件开始位置
|
|
|
|
|
let end = Math.min(fileSize, start + shardSize); //切割文件结束位置 (对比取小数)
|
|
|
|
|
let formData = new FormData() |
|
|
|
|
formData.append("file",file.slice(start, end)) |
|
|
|
|
|
|
|
|
|
//同步写法实现异步调用
|
|
|
|
|
let result = await new Promise((resolve, reject) => { |
|
|
|
|
// await 需要后面返回一个 promise 对象
|
|
|
|
|
this.http.post(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}&partNumber=${i+1}`,formData).subscribe((data:any)=>{ |
|
|
|
|
let msg = { |
|
|
|
|
"partNumber":data.partNumber || null, |
|
|
|
|
"eTag": data.eTag || null} |
|
|
|
|
resolve(msg) // 调用 promise 内置方法处理成功
|
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
this.PartNumberETag.push(result) |
|
|
|
|
this.uploadProgress = Number((i/allSlice).toFixed(2))*100 |
|
|
|
|
|
|
|
|
|
if (this.PartNumberETag.length === allSlice) { |
|
|
|
|
this.uploadProgress = 100 |
|
|
|
|
this.endUploading(planType)} |
|
|
|
|
for (let i = 0; i < allSlice; i++) { //循环分段上传
|
|
|
|
|
let start = i * shardSize //切割文件开始位置
|
|
|
|
|
let end = Math.min(fileSize, start + shardSize); //切割文件结束位置 (对比取小数)
|
|
|
|
|
let formData = new FormData() |
|
|
|
|
formData.append("file", file.slice(start, end)) |
|
|
|
|
|
|
|
|
|
//同步写法实现异步调用
|
|
|
|
|
let result = await new Promise((resolve, reject) => { |
|
|
|
|
// await 需要后面返回一个 promise 对象
|
|
|
|
|
this.http.post(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}&partNumber=${i + 1}`, formData).subscribe((data: any) => { |
|
|
|
|
let msg = { |
|
|
|
|
"partNumber": data.partNumber || null, |
|
|
|
|
"eTag": data.eTag || null |
|
|
|
|
} |
|
|
|
|
resolve(msg) // 调用 promise 内置方法处理成功
|
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
this.PartNumberETag.push(result) |
|
|
|
|
this.uploadProgress = Number((i / allSlice).toFixed(2)) * 100 |
|
|
|
|
|
|
|
|
|
if (this.PartNumberETag.length === allSlice) { |
|
|
|
|
this.uploadProgress = 100 |
|
|
|
|
this.endUploading(planType) |
|
|
|
|
} |
|
|
|
|
}//for循环
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//完成分块上传
|
|
|
|
|
endUploading (planType) { |
|
|
|
|
endUploading(planType) { |
|
|
|
|
let data = this.PartNumberETag |
|
|
|
|
let paramsData = {uploadId:this.uploadId} |
|
|
|
|
this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`,data,{params:paramsData}).subscribe(data=>{ |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
//this.snackBar.open('上传成功!','确定',config);
|
|
|
|
|
this.uploadProgress = 0; |
|
|
|
|
this.uploadisLoading = false |
|
|
|
|
this.PartNumberETag =[] //清空保存返回的信息
|
|
|
|
|
this.uploadover = true |
|
|
|
|
let level = sessionStorage.getItem("level") |
|
|
|
|
// console.log(level)
|
|
|
|
|
let PlanLevel
|
|
|
|
|
if(level == '0'){ |
|
|
|
|
PlanLevel = 1
|
|
|
|
|
} |
|
|
|
|
if(level == '1'){ |
|
|
|
|
PlanLevel = 2
|
|
|
|
|
} |
|
|
|
|
if(level == '2'){ |
|
|
|
|
PlanLevel = 4
|
|
|
|
|
} |
|
|
|
|
if(level == '3'){ |
|
|
|
|
PlanLevel = 8
|
|
|
|
|
} |
|
|
|
|
let paramsData = { uploadId: this.uploadId } |
|
|
|
|
this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`, data, { params: paramsData }).subscribe(data => { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
//this.snackBar.open('上传成功!','确定',config);
|
|
|
|
|
this.uploadProgress = 0; |
|
|
|
|
this.uploadisLoading = false |
|
|
|
|
this.PartNumberETag = [] //清空保存返回的信息
|
|
|
|
|
this.uploadover = true |
|
|
|
|
let level = sessionStorage.getItem("level") |
|
|
|
|
// console.log(level)
|
|
|
|
|
let PlanLevel |
|
|
|
|
if (level == '0') { |
|
|
|
|
PlanLevel = 1 |
|
|
|
|
} |
|
|
|
|
if (level == '1') { |
|
|
|
|
PlanLevel = 2 |
|
|
|
|
} |
|
|
|
|
if (level == '2') { |
|
|
|
|
PlanLevel = 4 |
|
|
|
|
} |
|
|
|
|
if (level == '3') { |
|
|
|
|
PlanLevel = 8 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let body:any = { |
|
|
|
|
Name:this.unitname||'', |
|
|
|
|
PlanCategory:Number(this.level)||'', |
|
|
|
|
disasterType: this.reservePlanType, |
|
|
|
|
PlanLevel:PlanLevel, |
|
|
|
|
PlanMode:1, |
|
|
|
|
planType:16, |
|
|
|
|
attachmentUrls:[`${this.objectName}`] |
|
|
|
|
} |
|
|
|
|
this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{ |
|
|
|
|
this.snackBar.open('创建成功!','确定',config); |
|
|
|
|
this.dialogRef.close();
|
|
|
|
|
},err=>{ |
|
|
|
|
this.snackBar.open('创建失败!','确定',config); |
|
|
|
|
}) |
|
|
|
|
let body: any = { |
|
|
|
|
Name: this.unitname || '', |
|
|
|
|
PlanCategory: Number(this.level) || '', |
|
|
|
|
disasterType: this.reservePlanType, |
|
|
|
|
PlanLevel: PlanLevel, |
|
|
|
|
PlanMode: 1, |
|
|
|
|
planType: 16, |
|
|
|
|
attachmentUrls: [`${this.objectName}`] |
|
|
|
|
} |
|
|
|
|
this.http.post("/api/PlanComponentsMajor", body).subscribe((data: any) => { |
|
|
|
|
this.snackBar.open('创建成功!', '确定', config); |
|
|
|
|
this.dialogRef.close(); |
|
|
|
|
}, err => { |
|
|
|
|
this.snackBar.open('创建失败!', '确定', config); |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//取消分块上传
|
|
|
|
|
cancel () { |
|
|
|
|
cancel() { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000; |
|
|
|
|
this.http.delete(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}`).subscribe(data=>{ |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000; |
|
|
|
|
this.http.delete(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}`).subscribe(data => { |
|
|
|
|
this.uploadProgress = 0; |
|
|
|
|
this.uploadisLoading= false; |
|
|
|
|
(<HTMLInputElement>document.getElementById('up')).value = null
|
|
|
|
|
this.PartNumberETag =[] //清空保存返回的信息
|
|
|
|
|
this.snackBar.open('取消上传成功!','确定',config); |
|
|
|
|
this.uploadisLoading = false; |
|
|
|
|
(<HTMLInputElement>document.getElementById('up')).value = null |
|
|
|
|
this.PartNumberETag = [] //清空保存返回的信息
|
|
|
|
|
this.snackBar.open('取消上传成功!', '确定', config); |
|
|
|
|
this.uploadover = false |
|
|
|
|
this.file = null |
|
|
|
|
}) |
|
|
|
@ -590,35 +574,35 @@ export class newunitMeet{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//创建预案
|
|
|
|
|
newplan(){ |
|
|
|
|
newplan() { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
if(this.unitname==undefined||this.unitname==''){ |
|
|
|
|
this.snackBar.open('请输入预案名称!','确定',config); |
|
|
|
|
if (this.unitname == undefined || this.unitname == '') { |
|
|
|
|
this.snackBar.open('请输入预案名称!', '确定', config); |
|
|
|
|
} |
|
|
|
|
else if(this.reservePlanType==undefined||this.reservePlanType==''){ |
|
|
|
|
this.snackBar.open('请输入预案类型!','确定',config); |
|
|
|
|
else if (this.reservePlanType == undefined || this.reservePlanType == '') { |
|
|
|
|
this.snackBar.open('请输入预案类型!', '确定', config); |
|
|
|
|
} |
|
|
|
|
else if(this.level==undefined||this.level==''){ |
|
|
|
|
this.snackBar.open('请输入预案级别!','确定',config); |
|
|
|
|
else if (this.level == undefined || this.level == '') { |
|
|
|
|
this.snackBar.open('请输入预案级别!', '确定', config); |
|
|
|
|
} |
|
|
|
|
else if(this.file==undefined){ |
|
|
|
|
this.snackBar.open('请先上传文件!','确定',config); |
|
|
|
|
else if (this.file == undefined) { |
|
|
|
|
this.snackBar.open('请先上传文件!', '确定', config); |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
if(this.reservePlanType!='1'){ |
|
|
|
|
else { |
|
|
|
|
if (this.reservePlanType != '1') { |
|
|
|
|
this.startUploading("非二维") |
|
|
|
|
} |
|
|
|
|
else{this.startUploading("二维")} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else { this.startUploading("二维") } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//取消
|
|
|
|
|
close(){ |
|
|
|
|
close() { |
|
|
|
|
this.dialogRef.close(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -629,15 +613,15 @@ export class newunitMeet{
|
|
|
|
|
templateUrl: './resultmeetPlan.html', |
|
|
|
|
styleUrls: ['./meet-plan.component.scss'] |
|
|
|
|
}) |
|
|
|
|
export class meetAuditResult{ |
|
|
|
|
constructor(private http: HttpClient,public dialogRef: MatDialogRef<meetAuditResult>,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} |
|
|
|
|
planName:any = this.data.element.name |
|
|
|
|
commitTime:any = this.data.element.committedTime |
|
|
|
|
commitOrganizationName:any = this.data.element.committerOrganizationName |
|
|
|
|
|
|
|
|
|
auditOrganizationName:any = this.data.element.auditorOrganizationName |
|
|
|
|
auditResult:any = this.data.element.auditStatus |
|
|
|
|
auditOpinion:any = this.data.element.auditOpinion |
|
|
|
|
export class meetAuditResult { |
|
|
|
|
constructor(private http: HttpClient, public dialogRef: MatDialogRef<meetAuditResult>, @Inject(MAT_DIALOG_DATA) public data, public snackBar: MatSnackBar) { } |
|
|
|
|
planName: any = this.data.element.name |
|
|
|
|
commitTime: any = this.data.element.committedTime |
|
|
|
|
commitOrganizationName: any = this.data.element.committerOrganizationName |
|
|
|
|
|
|
|
|
|
auditOrganizationName: any = this.data.element.auditorOrganizationName |
|
|
|
|
auditResult: any = this.data.element.auditStatus |
|
|
|
|
auditOpinion: any = this.data.element.auditOpinion |
|
|
|
|
ngOnInit(): void { |
|
|
|
|
} |
|
|
|
|
onNoClick(): void { |
|
|
|
|