diff --git a/src/app/plan-management/meet-plan/meet-plan.component.html b/src/app/plan-management/meet-plan/meet-plan.component.html index 5a47d5f..97682f5 100644 --- a/src/app/plan-management/meet-plan/meet-plan.component.html +++ b/src/app/plan-management/meet-plan/meet-plan.component.html @@ -1,6 +1,6 @@
-
+
@@ -14,32 +14,37 @@
- - Ⅰ级 - Ⅱ级 + + 国家级 + 市级
- +
- + 🠊 - +
- - + + + 卡片预案 + 二维预案 + 三维预案 + 其他预案 +
@@ -82,42 +87,44 @@
- - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + diff --git a/src/app/plan-management/meet-plan/meet-plan.component.scss b/src/app/plan-management/meet-plan/meet-plan.component.scss index 95d2d38..d963db0 100644 --- a/src/app/plan-management/meet-plan/meet-plan.component.scss +++ b/src/app/plan-management/meet-plan/meet-plan.component.scss @@ -114,5 +114,8 @@ .mat-column-jurisdictionsquadron{ width: 10%; } + span:hover{ + text-decoration:underline + } } } \ No newline at end of file diff --git a/src/app/plan-management/meet-plan/meet-plan.component.ts b/src/app/plan-management/meet-plan/meet-plan.component.ts index ba3f1ed..12cc226 100644 --- a/src/app/plan-management/meet-plan/meet-plan.component.ts +++ b/src/app/plan-management/meet-plan/meet-plan.component.ts @@ -47,10 +47,9 @@ export class MeetPlanComponent implements OnInit { {name:"中队",value:"8"} ] } - this.url=window.location.href.substring(window.location.href.length-1,window.location.href.length) + this.getAlltabledate() } - url preparelevels:any plcheck:boolean //编制级别勾选框 displayedColumns: string[] = ['unitname','level','addname','addtime', 'plantype', 'passstate','isopen','projectlevel','operation']; @@ -59,6 +58,8 @@ export class MeetPlanComponent implements OnInit { level//预案级别 addname//添加人 addtime//添加时间 + endtime + reservePlanType//预案类型 unittype//预案类型 unitstate//审核状态 projectlevel//编制级别 @@ -71,21 +72,162 @@ export class MeetPlanComponent implements OnInit { pageSizeOptions: number[] = [10] //设置每页条数 PageNumber:any; //第几页 - //获得所有预案信息 - getAllPlanInfo(){ + + + //获取表格数据 + getAlltabledate(){ + let reservePlanType + this.reservePlanType ? reservePlanType = JSON.parse(JSON.stringify(this.reservePlanType)) : reservePlanType = '' + if(this.reservePlanType && this.reservePlanType.length != 0){ + reservePlanType = eval(this.reservePlanType.join("|")) + } let paramsdata:any = { - HasChildrenPlanLevel: this.plcheck || '', + Name:this.unitname||'', + planCategories:this.level||[6,7], + PlanType:reservePlanType||'', + CreatorName:this.addname||'', + AuditStatus:this.unitstate|| '', + QueryStartTime:this.addtime||'', + QueryEndTime:this.endtime||'', + PlanLevel:this.projectlevel||'', + HasChildrenPlanLevel:this.plcheck||'', PageNumber: this.PageNumber || '1', PageSize: this.pageSizeOptions[0], + } - this.http.get("/api/Plans",{params:paramsdata}).subscribe((data:any)=>{ - + this.http.get("/api/PlanComponentsMajor",{params:paramsdata}).subscribe((data:any)=>{ this.length = data.totalCount - //this.allPlanInfo = data - - //this.tabledataSource = new MatTableDataSource(data.items) - console.log(this.tabledataSource) + this.tabledataSource = data.items + }) + } + + //查询 + 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){ + 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); }) + } + + } + + //下载↓ + 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) { + 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) + this.download = data + this.downloadFile() + }) + }) + + } + + //初始化下载 + downloadFile () { + this.downloadProgress = 0 + let file = this.download + let fileSize = file.fileLength//下载文件的总大小 + let shardSize = 10 * 1024 * 1024 //文件大小是否大于10MB + + if (file && fileSize<=shardSize) { //<=10MB时直接下载 + this.downloadisLoading = true + // this.setFileLoading() + 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); + document.body.appendChild(link); + link.click(); + this.downloadisLoading = false + // this.setFileLoading() + }) + } else if (file && fileSize > shardSize) { //>10MB时分块下载 + this.blockingDownload() //分段下载 + this.downloadisLoading = true + // this.setFileLoading() + } + + } + + //分段下载并合并 + 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{ + 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 + + 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); + document.body.appendChild(link); + link.click(); + // this.downloadProgress = 0 + this.downloadisLoading = false + // this.setFileLoading() + } + + } //for循环 + + } + + //取消分块下载 + cancelDowload () { } //重置 @@ -94,17 +236,24 @@ export class MeetPlanComponent implements OnInit { this.level='' this.addname='' this.addtime='' - this.unittype='' + this.endtime='' + this.reservePlanType='' this.unitstate='' this.projectlevel='' + this.plcheck=false + this.getAlltabledate() } //新增预案弹窗 addunit(){ const dialogRef = this.dialog.open(newunitMeet, { width: '340px', - height:'430px' + height:'505px' //data: paperDataInfo }); + dialogRef.afterClosed().subscribe(result => { + this.getAlltabledate() + } + ); } } @@ -119,9 +268,189 @@ export class newunitMeet{ level//预案级别 addname//添加人 addtime//添加时间 - unittype//预案类型 + reservePlanType//预案类型 unitstate//审核状态 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 //本地上传 + defaultisshow = '0' //默认显示上传input框 + + //上传 + upload(){ + document.getElementById('up').click() + } +//上传文件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一个分片 + + if (file && fileSize<=shardSize) { //上传文件<=5MB时 + let formData = new FormData() + formData.append("file",file) + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + 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)||'', + PlanType: Number(this.reservePlanType), + PlanLevel:1, + PlanMode:1, + attachmentUrls:[`${this.objectName}`] + } + 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); + }) + } 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=[]; //每次返回需要保存的信息 + //开始分段上传 + 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循环 + + } + + //完成分块上传 + 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 body:any = { + Name:this.unitname||'', + PlanCategory:Number(this.level)||'', + PlanType: Number(this.reservePlanType), + PlanLevel:1, + PlanMode:1, + 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 () { + const config = new MatSnackBarConfig(); + 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; + (document.getElementById('up')).value = null + this.PartNumberETag =[] //清空保存返回的信息 + this.snackBar.open('取消上传成功!','确定',config); + this.uploadover = false + this.file = null + }) + } + + + //创建预案 + newplan(){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + if(this.unitname==undefined||this.unitname==''){ + 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.file==undefined){ + this.snackBar.open('请先上传文件!','确定',config); + } + else{ + if(this.reservePlanType!='1'){ + this.startUploading("非二维") + } + else{this.startUploading("二维")} + + + } + + + } + //取消 close(){ this.dialogRef.close(); } diff --git a/src/app/plan-management/meet-plan/newunit.html b/src/app/plan-management/meet-plan/newunit.html index c770a48..65e54f7 100644 --- a/src/app/plan-management/meet-plan/newunit.html +++ b/src/app/plan-management/meet-plan/newunit.html @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2020-12-24 16:26:16 * @LastEditors: sueRimn - * @LastEditTime: 2021-01-06 09:34:26 + * @LastEditTime: 2021-01-11 13:56:29 -->
@@ -13,30 +13,42 @@
- +
- - + + + 卡片预案 + 二维预案 + 三维预案 + 其他预案 +
- - 国家级 - 市级 + + 国家级 + 市级
- - + + + +
+
+ 上传中... + +
+
- +
\ No newline at end of file diff --git a/src/app/plan-management/meet-plan/newunit.scss b/src/app/plan-management/meet-plan/newunit.scss index 7e78e9c..b99389b 100644 --- a/src/app/plan-management/meet-plan/newunit.scss +++ b/src/app/plan-management/meet-plan/newunit.scss @@ -7,7 +7,7 @@ .queryField { margin: 3px 5px; input { - width: 50px; + width: 100%; height: 18px; line-height: 18px; border-radius: 3px;} diff --git a/src/app/plan-management/onetwo-entry-plan/newunit.html b/src/app/plan-management/onetwo-entry-plan/newunit.html index 356b5e6..47919d3 100644 --- a/src/app/plan-management/onetwo-entry-plan/newunit.html +++ b/src/app/plan-management/onetwo-entry-plan/newunit.html @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2020-12-24 16:26:16 * @LastEditors: sueRimn - * @LastEditTime: 2020-12-28 11:47:01 + * @LastEditTime: 2021-01-11 13:55:40 -->
@@ -13,30 +13,34 @@
- +
- - + + + 卡片预案 + 二维预案 + 三维预案 + 其他预案 +
+
- - - - Ⅰ级 - Ⅱ级 - - -
-
- + + +
+
+ 上传中... + + +
- +
\ No newline at end of file diff --git a/src/app/plan-management/onetwo-entry-plan/newunit.scss b/src/app/plan-management/onetwo-entry-plan/newunit.scss index 7e78e9c..b99389b 100644 --- a/src/app/plan-management/onetwo-entry-plan/newunit.scss +++ b/src/app/plan-management/onetwo-entry-plan/newunit.scss @@ -7,7 +7,7 @@ .queryField { margin: 3px 5px; input { - width: 50px; + width: 100%; height: 18px; line-height: 18px; border-radius: 3px;} diff --git a/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.html b/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.html index ca64906..0c01d45 100644 --- a/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.html +++ b/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.html @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2020-12-24 14:15:10 * @LastEditors: sueRimn - * @LastEditTime: 2021-01-08 09:47:51 + * @LastEditTime: 2021-01-09 10:37:36 -->
@@ -39,7 +39,7 @@
- + 卡片预案 二维预案 三维预案 @@ -88,44 +88,44 @@
预案名称{{element.unitname}}预案名称{{element.name}} 预案级别{{url=='2'?'Ⅱ级':'Ⅰ级'}}预案级别{{element.planCategory=='6'?'国家级':'市级'}} 添加人{{element.addname}}添加人{{element.creatorName}} 添加时间{{element.addtime}}添加时间{{element.creationTime|date:'yyyy-MM-dd'}} 预案类型{{element.plantype}}预案类型{{element.planType=='1'?'二维预案':element.planType=='2'?'三维预案':element.planType=='4'?'其他预案':'卡片预案'}} 审核状态{{element.passstate}}审核状态{{element.auditStatus=='8'?'未提交审核':element.auditStatus=='1'?'审核中':element.auditStatus=='2'?'审核通过':'审核退回'}} 是否公开{{element.isopen}}是否公开{{element.openRange}} 编制级别{{element.projectlevel}}编制级别{{element.planLevel=='1'?'总队':element.planLevel=='2'?'支队':element.planLevel=='4'?'大队':'中队'}} 操作 - 查看预案 + 操作 + 查看预案 + 下载 + 删除
- + - + - + - + - + - + - + - - + + - - + diff --git a/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.scss b/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.scss index 95d2d38..d963db0 100644 --- a/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.scss +++ b/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.scss @@ -114,5 +114,8 @@ .mat-column-jurisdictionsquadron{ width: 10%; } + span:hover{ + text-decoration:underline + } } } \ No newline at end of file diff --git a/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts b/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts index 34e21aa..7a0debf 100644 --- a/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts +++ b/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2020-12-24 14:15:10 * @LastEditors: sueRimn - * @LastEditTime: 2021-01-08 09:48:06 + * @LastEditTime: 2021-01-11 14:04:49 */ import { Component, OnInit, ViewChild, Inject } from '@angular/core'; import { HttpClient } from '@angular/common/http' @@ -84,29 +84,23 @@ export class OnetwoEntryPlanComponent implements OnInit { pageSizeOptions: number[] = [10] //设置每页条数 PageNumber:any; //第几页 - //获得所有预案信息 - getAllPlanInfo(){ - let paramsdata:any = { - HasChildrenPlanLevel: this.plcheck || '', - PageNumber: this.PageNumber || '1', - PageSize: this.pageSizeOptions[0], - } - this.http.get("/api/Plans",{params:paramsdata}).subscribe((data:any)=>{ - - this.length = data.totalCount - //this.allPlanInfo = data - - //this.tabledataSource = new MatTableDataSource(data.items) - console.log(this.tabledataSource) - }) - } - //获取表格数据 getAlltabledate(){ + let reservePlanType + this.reservePlanType ? reservePlanType = JSON.parse(JSON.stringify(this.reservePlanType)) : reservePlanType = '' + if(this.reservePlanType && this.reservePlanType.length != 0){ + reservePlanType = eval(this.reservePlanType.join("|")) + } let paramsdata:any = { - PlanCategory:this.url=='2'?2:1, - PlanType:this.projectlevel||'', + Name:this.unitname||'', + planCategories:this.url=='2'?2:1, + PlanType:reservePlanType||'', + CreatorName:this.addname||'', AuditStatus:this.unitstate|| '', + QueryStartTime:this.addtime||'', + QueryEndTime:this.endtime||'', + PlanLevel:this.projectlevel||'', + HasChildrenPlanLevel:this.plcheck||'', PageNumber: this.PageNumber || '1', PageSize: this.pageSizeOptions[0], @@ -114,7 +108,6 @@ export class OnetwoEntryPlanComponent implements OnInit { this.http.get("/api/PlanComponentsMajor",{params:paramsdata}).subscribe((data:any)=>{ this.length = data.totalCount this.tabledataSource = data.items - console.log(this.tabledataSource) }) } @@ -124,29 +117,160 @@ export class OnetwoEntryPlanComponent implements OnInit { this.level='' this.addname='' this.addtime='' - //this.unittype='' + this.endtime='' + this.reservePlanType='' this.unitstate='' this.projectlevel='' + this.plcheck=false + this.getAlltabledate() } //查询 onSubmit (value) { - this.PageNumber = 1 - this.pageEvent.pageIndex = 0 - this.getAlltabledate(); + //console.log(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){ + 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); + }) + } + } //新增预案弹窗 addunit(){ const dialogRef = this.dialog.open(newunitComponent, { width: '340px', - height:'430px' + height:'440px' //data: paperDataInfo }); + dialogRef.afterClosed().subscribe(result => { + this.getAlltabledate() + } + ); + } + //下载↓ + 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) { + 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) + //console.log(data) + this.download = data + this.downloadFile() + }) + }) + } + + //初始化下载 + downloadFile () { + this.downloadProgress = 0 + let file = this.download + let fileSize = file.fileLength//下载文件的总大小 + let shardSize = 10 * 1024 * 1024 //文件大小是否大于10MB + + if (file && fileSize<=shardSize) { //<=10MB时直接下载 + this.downloadisLoading = true + // this.setFileLoading() + 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); + document.body.appendChild(link); + link.click(); + this.downloadisLoading = false + // this.setFileLoading() + }) + } else if (file && fileSize > shardSize) { //>10MB时分块下载 + this.blockingDownload() //分段下载 + this.downloadisLoading = true + // this.setFileLoading() + } + + } + + //分段下载并合并 + 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{ + 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 + + 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); + document.body.appendChild(link); + link.click(); + // this.downloadProgress = 0 + this.downloadisLoading = false + // this.setFileLoading() + } + + } //for循环 + + } + + //取消分块下载 + cancelDowload () { + } + + //查看预案按钮跳转 routerTo(element){ - console.log(element) sessionStorage.setItem("companyName",element.unitname) window.open(`/planManagement/entryPlandetail?unitId=${element.company.id}&unitTypeId=${element.company.buildingTypes.length == 0 ? null :element.company.buildingTypes[0].id}&operation=true&pagetype=entryplan&unitName=${element.company.name}&orName=${element.company.organizationName}&unitType=${element.company.buildingTypes.length == 0 ? null :element.company.buildingTypes[0].name}&unitAdd=${element.company.address}`); } @@ -160,13 +284,190 @@ export class OnetwoEntryPlanComponent implements OnInit { }) export class newunitComponent{ constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) {} + ngOnInit(): void { + this.url=window.location.href.substring(window.location.href.length-1,window.location.href.length) + } + url unitname//预案名称 level//预案级别 addname//添加人 addtime//添加时间 - unittype//预案类型 + reservePlanType//预案类型 unitstate//审核状态 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 //本地上传 + defaultisshow = '0' //默认显示上传input框 + + //上传 + upload(){ + document.getElementById('up').click() + } +//上传文件input + filechange(e){ + this.file = e.target.files[0] || null //上传的文件 + } + + //上传文件 + 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(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.http.post(this.url=='2'?`/api/Objects/PlanPlatform/twoClass`:'/api/Objects/PlanPlatform/oneClass',formData).subscribe((data:any)=>{ + this.objectName = data.objectName + //this.snackBar.open('上传成功!','确定',config); + + let body:any = { + Name:this.unitname||'', + PlanCategory:this.url=='2'?2:1, + PlanType: Number(this.reservePlanType), + PlanLevel:1, + PlanMode:1, + attachmentUrls:[`${this.objectName}`] + } + this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{ + this.snackBar.open('创建成功!','确定',config); + this.dialogRef.close(); + },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(this.url=='2'?`/api/NewMultipartUpload/PlanPlatform/twoClass`:'/api/NewMultipartUpload/PlanPlatform/oneClass',{},{params:data}).subscribe((data:any)=>{ //初始化分段上传 + this.objectName = data.objectName + this.uploadId = data.uploadId + this.subsectionUploading(planType) + }) + } + + } + PartNumberETag:any=[]; //每次返回需要保存的信息 + //开始分段上传 + 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循环 + + } + + //完成分块上传 + 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 body:any = { + Name:this.unitname||'', + PlanCategory:this.url=='2'?2:1, + PlanType: Number(this.reservePlanType), + PlanLevel:1, + PlanMode:1, + 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 () { + this.http.delete(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}`).subscribe(data=>{ + this.uploadProgress = 0; + this.uploadisLoading= false; + (document.getElementById('up')).value = null + this.PartNumberETag =[] //清空保存返回的信息 + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('取消上传成功!','确定',config); + this.uploadover = false + this.file = null + }) + } + + + //创建预案 + newplan(){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + if(this.unitname==undefined||this.reservePlanType==undefined){ + this.snackBar.open('请输入预案名称或类型!','确定',config); + } + else if(this.file==undefined){ + this.snackBar.open('请先上传文件!','确定',config); + } + else{ + if(this.reservePlanType!='1'){ + this.startUploading("非二维") + } + else{this.startUploading("二维")} + + + } + + + } + //取消按钮 close(){ this.dialogRef.close(); } diff --git a/src/app/plan-management/type-plan/newunit.html b/src/app/plan-management/type-plan/newunit.html index 4953720..519b63d 100644 --- a/src/app/plan-management/type-plan/newunit.html +++ b/src/app/plan-management/type-plan/newunit.html @@ -4,29 +4,33 @@ * @Author: sueRimn * @Date: 2020-12-24 16:26:16 * @LastEditors: sueRimn - * @LastEditTime: 2021-01-06 15:16:50 + * @LastEditTime: 2021-01-11 13:57:06 -->
-
- 新增预案 +
+ 新增预案 +
+
+ + + +
+ +
- - - - + + + +
+
+ 上传中... + +
-
- - - - -
-
- -
+
+ + +
\ No newline at end of file diff --git a/src/app/plan-management/type-plan/newunit.scss b/src/app/plan-management/type-plan/newunit.scss index 880da22..42ff2b4 100644 --- a/src/app/plan-management/type-plan/newunit.scss +++ b/src/app/plan-management/type-plan/newunit.scss @@ -7,7 +7,7 @@ .queryField { margin: 3px 5px; input { - width: 50px; + width: 100%; height: 18px; line-height: 18px; border-radius: 3px;} @@ -26,7 +26,7 @@ } } .bottom{ - margin: 30px 30px; + margin: 10% 30px; button{ width: 80px; height: 36px; diff --git a/src/app/plan-management/type-plan/type-plan.component.html b/src/app/plan-management/type-plan/type-plan.component.html index 67109d3..5982abd 100644 --- a/src/app/plan-management/type-plan/type-plan.component.html +++ b/src/app/plan-management/type-plan/type-plan.component.html @@ -1,6 +1,6 @@
- +
@@ -13,17 +13,17 @@
- +
- + 🠊 - +
@@ -68,39 +68,41 @@
预案名称预案名称 {{element.name}} 预案级别预案级别 {{url=='2'?'Ⅱ级':'Ⅰ级'}} 添加人添加人 {{element.creatorName}} 添加时间添加时间 {{element.creationTime|date:'yyyy-MM-dd'}} 预案类型预案类型 {{element.planType=='1'?'二维预案':element.planType=='2'?'三维预案':element.planType=='4'?'其他预案':'卡片预案'}} 审核状态审核状态 {{element.auditStatus=='8'?'未提交审核':element.auditStatus=='1'?'审核中':element.auditStatus=='2'?'审核通过':'审核退回'}} 是否公开是否公开 {{element.openRange}} 编制级别{{element.planLevel=='0'?'总队':element.planLevel=='1'?'支队':element.planLevel=='2'?'大队':'中队'}}编制级别{{element.planLevel=='1'?'总队':element.planLevel=='2'?'支队':element.planLevel=='4'?'大队':'中队'}} 操作 - 查看预案 - 下载 - 删除 + 操作 + 查看预案 + 下载 + 删除
- - + + - - + + - - + + - + - - + + - - + + - - + + - - + diff --git a/src/app/plan-management/type-plan/type-plan.component.scss b/src/app/plan-management/type-plan/type-plan.component.scss index 95d2d38..d963db0 100644 --- a/src/app/plan-management/type-plan/type-plan.component.scss +++ b/src/app/plan-management/type-plan/type-plan.component.scss @@ -114,5 +114,8 @@ .mat-column-jurisdictionsquadron{ width: 10%; } + span:hover{ + text-decoration:underline + } } } \ No newline at end of file diff --git a/src/app/plan-management/type-plan/type-plan.component.ts b/src/app/plan-management/type-plan/type-plan.component.ts index e579495..9e104cc 100644 --- a/src/app/plan-management/type-plan/type-plan.component.ts +++ b/src/app/plan-management/type-plan/type-plan.component.ts @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2021-01-06 09:47:43 * @LastEditors: sueRimn - * @LastEditTime: 2021-01-06 15:12:30 + * @LastEditTime: 2021-01-11 14:01:30 */ import { Component, OnInit, ViewChild, Inject } from '@angular/core'; import { HttpClient } from '@angular/common/http' @@ -55,6 +55,7 @@ export class TypePlanComponent implements OnInit { {name:"中队",value:"8"} ] } + this.getAlltabledate() } preparelevels:any @@ -65,6 +66,7 @@ export class TypePlanComponent implements OnInit { level//预案级别 addname//添加人 addtime//添加时间 + endtime unittype//预案类型 unitstate//审核状态 projectlevel//编制级别 @@ -77,23 +79,183 @@ export class TypePlanComponent implements OnInit { pageSizeOptions: number[] = [10] //设置每页条数 PageNumber:any; //第几页 + //获取表格数据 + getAlltabledate(){ + let paramsdata:any = { + Name:this.unitname||'', + planCategories:8, + CreatorName:this.addname||'', + AuditStatus:this.unitstate|| '', + QueryStartTime:this.addtime||'', + QueryEndTime:this.endtime||'', + PlanLevel:this.projectlevel||'', + HasChildrenPlanLevel:this.plcheck||'', + PageNumber: this.PageNumber || '1', + PageSize: this.pageSizeOptions[0], + + } + this.http.get("/api/PlanComponentsMajor",{params:paramsdata}).subscribe((data:any)=>{ + this.length = data.totalCount + this.tabledataSource = data.items + }) + } + //重置 reset(){ this.unitname='' this.level='' this.addname='' this.addtime='' - this.unittype='' + this.endtime='' this.unitstate='' this.projectlevel='' + this.plcheck=false + 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{ + this.PageNumber = 1 + this.pageEvent.pageIndex = 0 + this.getAlltabledate(); + } + } + + //删除预案 + 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); + }) + } + + } + //新增预案弹窗 addunit(){ const dialogRef = this.dialog.open(newunitType, { width: '340px', - height:'300px' + height:'370px' //data: paperDataInfo }); + dialogRef.afterClosed().subscribe(result => { + this.getAlltabledate() + } + ); + + } + + //下载↓ + 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) { + 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) + //console.log(data) + this.download = data + this.downloadFile() + }) + }) + + } + + //初始化下载 + downloadFile () { + this.downloadProgress = 0 + let file = this.download + let fileSize = file.fileLength//下载文件的总大小 + let shardSize = 10 * 1024 * 1024 //文件大小是否大于10MB + + if (file && fileSize<=shardSize) { //<=10MB时直接下载 + this.downloadisLoading = true + // this.setFileLoading() + 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); + document.body.appendChild(link); + link.click(); + this.downloadisLoading = false + // this.setFileLoading() + }) + } else if (file && fileSize > shardSize) { //>10MB时分块下载 + this.blockingDownload() //分段下载 + this.downloadisLoading = true + // this.setFileLoading() + } + + } + + //分段下载并合并 + 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{ + 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 + + 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); + document.body.appendChild(link); + link.click(); + // this.downloadProgress = 0 + this.downloadisLoading = false + // this.setFileLoading() + } + + } //for循环 + + } + + //取消分块下载 + cancelDowload () { } } @@ -112,14 +274,177 @@ export class newunitType{ unittype//预案类型 unitstate//审核状态 projectlevel//编制级别 - close(){ - this.dialogRef.close(); - } + reservePlanType//预案类型 //上传 upload(){ document.getElementById('up').click() } - upchange(e){ - console.log(e) + + //上传文件↓ + 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框 + //上传文件input + filechange(e){ + this.file = e.target.files[0] || null //上传的文件 + } + + //上传文件 + 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(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.http.post(`/api/Objects/PlanPlatform/typeClass`,formData).subscribe((data:any)=>{ + this.objectName = data.objectName + //console.log('上传成功') + + let body:any = { + Name:this.unitname||'', + PlanCategory:8, + PlanLevel:1, + PlanMode:1, + attachmentUrls:[`${this.objectName}`] + } + this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{ + this.snackBar.open('创建成功!','确定',config); + this.dialogRef.close(); + },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/typeClass`,{},{params:data}).subscribe((data:any)=>{ //初始化分段上传 + this.objectName = data.objectName + this.uploadId = data.uploadId + this.subsectionUploading(planType) + }) + } + + } + PartNumberETag:any=[]; //每次返回需要保存的信息 + //开始分段上传 + 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循环 + + } + + //完成分块上传 + 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 + //console.log('创建成功') + this.uploadProgress = 0; + this.uploadisLoading = false + this.PartNumberETag =[] //清空保存返回的信息 + this.uploadover = true + + let body:any = { + Name:this.unitname||'', + PlanCategory:8, + PlanLevel:1, + PlanMode:1, + 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 () { + this.http.delete(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}`).subscribe(data=>{ + this.uploadProgress = 0; + this.uploadisLoading= false; + (document.getElementById('up')).value = null + this.PartNumberETag =[] //清空保存返回的信息 + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('取消上传成功!','确定',config); + this.uploadover = false + this.file = null + }) + } + + //创建预案 + newplan(){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + if(this.unitname==undefined||this.unitname==''){ + this.snackBar.open('请输入预案名称!','确定',config); + } + else if(this.file==undefined){ + this.snackBar.open('请先上传文件!','确定',config); + } + else{ + if(this.reservePlanType!='1'){ + this.startUploading("非二维") + } + else{this.startUploading("二维")} + + + } + + + } + //取消按钮 + close(){ + this.dialogRef.close(); } }
预案名称{{element.unitname}}预案名称{{element.name}} 添加人{{element.addname}}添加人{{element.creatorName}} 添加时间{{element.addtime}}添加时间{{element.creationTime|date:'yyyy-MM-dd'}} 预案类型预案类型 类型预案 审核状态{{element.passstate}}审核状态{{element.auditStatus=='8'?'未提交审核':element.auditStatus=='1'?'审核中':element.auditStatus=='2'?'审核通过':'审核退回'}} 是否公开{{element.isopen}}是否公开{{element.openRange}} 编制级别{{element.projectlevel}}编制级别{{element.planLevel=='1'?'总队':element.planLevel=='2'?'支队':element.planLevel=='4'?'大队':'中队'}} 操作 - 查看预案 + 操作 + 查看预案 + 下载 + 删除