Browse Source

[新增]待审核联动力量页面

zhuzhou
邵佳豪 4 years ago
parent
commit
e5db8fd919
  1. 2
      src/app/data-collection/fire-force/fire-force.component.scss
  2. 8
      src/app/data-collection/fire-force/fire-force.component.ts
  3. 2
      src/app/data-collection/linkage-forces/linkage-forces.component.scss
  4. 9
      src/app/data-collection/linkage-forces/linkage-forces.component.ts
  5. 160
      src/app/plan-audit/linkageforces-audit/linkageforces-audit.component.html
  6. 330
      src/app/plan-audit/linkageforces-audit/linkageforces-audit.component.scss
  7. 220
      src/app/plan-audit/linkageforces-audit/linkageforces-audit.component.ts
  8. 21
      src/app/plan-audit/wait-examineer/wait-examineer.component.html

2
src/app/data-collection/fire-force/fire-force.component.scss

@ -123,7 +123,7 @@
height: 20px;
cursor: pointer;
font-size: 20px;
vertical-align: text-top;
vertical-align: middle;
color: rgba(49, 46, 46, 0.144);
}
mat-icon:hover{

8
src/app/data-collection/fire-force/fire-force.component.ts

@ -792,7 +792,9 @@ export class FireForceComponent implements OnInit {
this.isMasklayer = true
let formData = new FormData()
formData.append("file",file)
this.http.post(`/api/Objects/PlanPlatform/FireForce/${this.selectedFireForce.id}`,formData).subscribe((data:any)=>{
let storageFolderId //要存储到服务器的文件夹id 一般为当前选中单位的id 如果新创建的话就存到public文件夹
this.selectedFireForce.id ? storageFolderId = this.selectedFireForce.id : storageFolderId = 'public'
this.http.post(`/api/Objects/PlanPlatform/FireForce/${storageFolderId}`,formData).subscribe((data:any)=>{
let obj = {
objectName:data.objectName,
fileName:data.fileName,
@ -808,7 +810,9 @@ export class FireForceComponent implements OnInit {
} else if (file && fileSize>shardSize) { //上传文件>5MB时,分块上传
this.isMasklayerUploading = true
let data = {filename: file.name}
this.http.post(`/api/NewMultipartUpload/PlanPlatform/FireForce/${this.selectedFireForce.id}`,{},{params:data}).subscribe((data:any)=>{ //初始化分段上传
let storageFolderId //要存储到服务器的文件夹id 一般为当前选中单位的id 如果新创建的话就存到public文件夹
this.selectedFireForce.id ? storageFolderId = this.selectedFireForce.id : storageFolderId = 'public'
this.http.post(`/api/NewMultipartUpload/PlanPlatform/FireForce/${storageFolderId}`,{},{params:data}).subscribe((data:any)=>{ //初始化分段上传
this.objectName = data.objectName
this.uploadId = data.uploadId
this.subsectionUploading()

2
src/app/data-collection/linkage-forces/linkage-forces.component.scss

@ -129,7 +129,7 @@
height: 20px;
cursor: pointer;
font-size: 20px;
vertical-align: text-top;
vertical-align: middle;
color: rgba(49, 46, 46, 0.144);
}
mat-icon:hover{

9
src/app/data-collection/linkage-forces/linkage-forces.component.ts

@ -411,7 +411,6 @@ export class LinkageForcesComponent implements OnInit {
}else{
this.LinkageForceDetailInfo.location = null
}
this.LinkageForceDetailInfo.relevantInfomationData = JSON.stringify(this.LinkageForceDetailInfo.relevantInfomationData)
let body = this.LinkageForceDetailInfo
if(this.LinkageForceDetailInfo.id){
this.http.put(`/api/LinkageForces/${this.LinkageForceDetailInfo.id}`,body).subscribe((data:any) =>{
@ -563,7 +562,9 @@ export class LinkageForcesComponent implements OnInit {
let formData = new FormData()
formData.append("file",file)
//this.selectedFireForce.id 选择的组织机构的id
this.http.post(`/api/Objects/PlanPlatform/LinkageForce/${this.LinkageForceDetailInfo.id}`,formData).subscribe((data:any)=>{
let storageFolderId //要存储到服务器的文件夹id 一般为当前选中单位的id 如果新创建的话就存到public文件夹
this.LinkageForceDetailInfo.id ? storageFolderId = this.LinkageForceDetailInfo.id : storageFolderId = 'public'
this.http.post(`/api/Objects/PlanPlatform/LinkageForce/${storageFolderId}`,formData).subscribe((data:any)=>{
// this.objectName = data.objectName
let obj = {
objectName:data.objectName,
@ -580,7 +581,9 @@ export class LinkageForcesComponent implements OnInit {
} else if (file && fileSize>shardSize) { //上传文件>5MB时,分块上传
this.isMasklayerUploading = true
let data = {filename: file.name}
this.http.post(`/api/NewMultipartUpload/PlanPlatform/LinkageForce/${this.LinkageForceDetailInfo.id}`,{},{params:data}).subscribe((data:any)=>{ //初始化分段上传
let storageFolderId //要存储到服务器的文件夹id 一般为当前选中单位的id 如果新创建的话就存到public文件夹
this.LinkageForceDetailInfo.id ? storageFolderId = this.LinkageForceDetailInfo.id : storageFolderId = 'public'
this.http.post(`/api/NewMultipartUpload/PlanPlatform/LinkageForce/${storageFolderId}`,{},{params:data}).subscribe((data:any)=>{ //初始化分段上传
this.objectName = data.objectName
this.uploadId = data.uploadId
this.subsectionUploading()

160
src/app/plan-audit/linkageforces-audit/linkageforces-audit.component.html

@ -1 +1,159 @@
<!-- 联动力量审核 -->
<!-- 联动力量审核 -->
<div class="box" style="width: 100%;height: 100%;overflow: hidden;">
<div class="mapbox" id="linkageForcesSwiper">
<div id="container"></div>
<div class="detailsbox" *ngIf="LinkageForceDetailInfo.linkageForceType || LinkageForceDetailInfo.linkageForceType == '0'">
<div class="masklayer" *ngIf="isMasklayer">
<mat-spinner [diameter]='30'></mat-spinner>
<span>请等待...</span>
</div>
<div class="masklayer" *ngIf="isMasklayerDownload">
<mat-progress-bar class="progressbar" mode="determinate" [value]="progressBarValue"></mat-progress-bar>
<span>下载中...({{progressBarValue}}%)</span>
</div>
<div class="tabsbox">
<div class="tabs">
<div (click)="selectedTab(1)" [ngClass]="{'selectedBtn': tabIndex == 1}">
<span>详情</span>
</div>
<div (click)="selectedTab(2)" [ngClass]="{'selectedBtn': tabIndex == 2}">
<span>相关资料</span>
</div>
</div>
</div>
<!-- 详情 -->
<div class="contant" *ngIf="tabIndex == 1">
<div>
<p>基本信息</p>
<mat-grid-list cols="6" rowHeight="40px">
<mat-grid-tile colspan='3' rowspan='1'>
<span>
<span style="color: red;">*</span>
类型:
</span>
<select disabled style="width: 67.7%;" [(ngModel)]="LinkageForceDetailInfo.linkageForceType">
<option *ngFor="let item of checkBoxList" [value]="item.id">{{item.name}}</option>
</select>
</mat-grid-tile>
<mat-grid-tile colspan='3' rowspan='1'>
<span>
<span style="color: red;">*</span>
名称:
</span>
<input type="text" style="width: 63%;" [(ngModel)]="LinkageForceDetailInfo.name">
</mat-grid-tile>
<mat-grid-tile colspan='3' rowspan='1'>
<span>
单位联系电话:
</span>
<input type="text" [(ngModel)]="LinkageForceDetailInfo.phoneNumber">
</mat-grid-tile>
<mat-grid-tile colspan='3' rowspan='1'>
<span>
单位传真:
</span>
<input type="text" [(ngModel)]="LinkageForceDetailInfo.faxNumber">
</mat-grid-tile>
<mat-grid-tile colspan='6' rowspan='2'>
<span>
备注:
</span>
<textarea [(ngModel)]="LinkageForceDetailInfo.remark" style="height: 80%;width: 84.5%;" name="" id="" cols="30" rows="10"></textarea>
</mat-grid-tile>
</mat-grid-list>
<p>位置信息</p>
<mat-grid-list cols="6" rowHeight="40px">
<mat-grid-tile colspan='3' rowspan='1'>
<span>
行政区:
</span>
<input type="text" style="width: 26%;margin-right: 6%;" [(ngModel)]="LinkageForceDetailInfo.administrativeRegion">
<span>
地址:
</span>
<input type="text" style="width: 26%;margin-right: 6%;" [(ngModel)]="LinkageForceDetailInfo.address">
</mat-grid-tile>
<mat-grid-tile colspan='3' rowspan='1'>
<span>
经度:
</span>
<input [(ngModel)]="LinkageForceDetailInfo.location.x" disabled type="text" style="width: 26%;margin-right: 6%;">
<span>
纬度:
</span>
<input [(ngModel)]="LinkageForceDetailInfo.location.y" disabled type="text" style="width: 26%;margin-right: 6%;">
</mat-grid-tile>
</mat-grid-list>
<p>联系人</p>
<mat-grid-list cols="6" rowHeight="40px">
<mat-grid-tile colspan='2' rowspan='1'>
<span>
联系人:
</span>
<input type="text" [(ngModel)]="LinkageForceDetailInfo.contactName">
</mat-grid-tile>
<mat-grid-tile colspan='2' rowspan='1'>
<span>
职务:
</span>
<input type="text" [(ngModel)]="LinkageForceDetailInfo.contactTitle">
</mat-grid-tile>
<mat-grid-tile colspan='2' rowspan='1'>
<span>
电话:
</span>
<input type="text" [(ngModel)]="LinkageForceDetailInfo.contactPhone">
</mat-grid-tile>
</mat-grid-list>
<p>应急信息</p>
<mat-grid-list cols="6" rowHeight="40px">
<mat-grid-tile colspan='3' rowspan='2'>
<span>
服务内容:
</span>
<textarea style="height: 80%;width: 70%;" name="" id="" cols="30" rows="10" [(ngModel)]="LinkageForceDetailInfo.serviceContent"></textarea>
</mat-grid-tile>
<mat-grid-tile colspan='3' rowspan='2'>
<span>
资源说明:
</span>
<textarea style="height: 80%;width: 70%;" name="" id="" cols="30" rows="10" [(ngModel)]="LinkageForceDetailInfo.resourceRemark"></textarea>
</mat-grid-tile>
</mat-grid-list>
</div>
</div>
<!-- 相关资料 -->
<div class="contant" *ngIf="tabIndex == 2">
<div class="fileDivBox" *ngFor="let item of AttachmentArr" >
<div class="imgbox">
<img *ngIf="item.fileName.split('.')[item.fileName.split('.').length-1] == 'png'
|| item.fileName.split('.')[item.fileName.split('.').length-1] == 'jpg'
|| item.fileName.split('.')[item.fileName.split('.').length-1] == 'JPG'"
class="thumbnailImg" src="/api/Objects/PlanPlatform/{{item.objectName}}" alt="">
<img *ngIf="item.fileName.split('.')[item.fileName.split('.').length-1] == 'docx'
|| item.fileName.split('.')[item.fileName.split('.').length-1] == 'doc'"
class="thumbnailImg" src="/assets/images/word.jpg" alt="">
<img *ngIf="item.fileName.split('.')[item.fileName.split('.').length-1] == 'pdf'"
class="thumbnailImg" src="/assets/images/pdf.jpg" alt="">
<img *ngIf="item.fileName.split('.')[item.fileName.split('.').length-1] == 'txt'"
class="thumbnailImg" src="/assets/images/txt.jpg" alt="">
<img *ngIf="item.fileName.split('.')[item.fileName.split('.').length-1] == 'mp4'"
class="thumbnailImg" src="/assets/images/vedio.jpg" alt="">
</div>
<span [title]="item.fileName">{{item.fileName}}</span>
<button (click)="clickFile(item)" class="btn btn1" mat-flat-button color="primary">查看</button>
<button (click)="download (item)" class="btn btn2" mat-flat-button color="primary">下载</button>
</div>
</div>
</div>
</div>
</div>
<div id="viewerjs" style="display:none">
</div>

330
src/app/plan-audit/linkageforces-audit/linkageforces-audit.component.scss

@ -0,0 +1,330 @@
.box{
width: 100%;
height: 100%;
background-color: #F2F4F6;
display: flex;
box-sizing: border-box;
padding: 10px;
font-size: 16px;
// font-family: Source Han Sans CN;
font-weight: 400;
color: #000000;
}
.mapbox{
flex: 1;
margin-left: 10px;
background-color: #fff;
display: flex;
overflow: hidden;
flex-direction: column;
#container{
width: 100%;
height: 220px;
}
.detailsbox{
width: 100%;
flex: 1;
position: relative;
.tabsbox{
width: 100%;
height: 40px;
overflow: hidden;
overflow-x: auto;
line-height: 40px;
display: flex;
justify-content: space-between;
font-size: 15px;
.tabs{
div{
float: left;
width: 120px;
text-align: center;
cursor: pointer;
color: #000000;
opacity: 0.4;
border-right: 1px solid #F2F4F6;
}
.selectedBtn{
background-color: #2196F3;
color: #fff;
opacity: 1;
}
}
.btnbox{
display: flex;
align-items: center;
.uploadAttachment{
display: inline-block;
margin-right: 20px;
width: 120px;
text-align: center;
height: 28px;
line-height: 28px;
position: relative;
button{
width: 100%;
height: 28px;
line-height: 28px;
mat-icon{
transform: rotate(25deg);
font-size: 20px;
width: 20px;
height: 20px;
}
}
.a-upload{
display: inline-block;
position: absolute;
left: 0;
top: 0;
display: inline-block;
width: 100%;
height: 100%;
opacity: 0;
input{
width: 100%;
height: 100%;
cursor: pointer;
}
}
}
span{
display: inline-block;
cursor: pointer;
color: #2196F3;
mat-icon{
vertical-align: sub;
font-size: 20px;
width: 20px;
height: 20px;
}
}
span:hover{
text-decoration: underline;
}
.submitAudit{
margin: 0 30px;
}
.close{
margin-right: 30px;
}
}
}
.contant{
width: 100%;
height:460px;
overflow-y: auto;
p{
color: #2196F3;
background-color: #F2F4F6;
height: 33px;
line-height: 33px;
box-sizing: border-box;
padding-left: 20px;
font-size: 15px;
}
span{
font-size: 15px;
}
input,select{
height: 30px;
line-height: 30px;
box-sizing: border-box;
padding: 0 12px;
width: 60%;
margin-left: 5px;
border: 1px solid #EBEBEB;
border-radius: 5px;
}
textarea{
width: 89%;
margin-left: 5px;
height: 85%;
border: 1px solid #EBEBEB;
border-radius: 5px;
}
.longinput{
width: 74%;
}
.unitDiv{
width: 60%;
position: relative;
input,select{
width: 100%;
box-sizing: border-box;
padding-right: 50px;
}
.unit{
position: absolute;
right: 13px;
top: 4px;
color: #000000;
opacity: 0.4;
}
}
.smallwidth{
width: 30%;
}
// 相关资料
.fileDivBox{
position: relative;
float: left;
border: 1px solid #EBEBEB;
width: 160px;
height: 162px;
box-sizing: border-box;
padding: 16px 16px 0;
display: flex;
flex-direction: column;
margin: 12px;
align-items: center;
cursor: pointer;
.imgbox{
width: 134px;
height: 110px;
display: flex;
justify-content: center;
align-items: center;
.thumbnailImg{
width: 134px;
height: 110px;
}
}
span{
width: 100%;
text-align: center;
margin-top: 5px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
color: gray;
font-size: 14px;
}
.deleteFile{
position: absolute;
right: 0;
top: 0;
width: 18px;
height: 18px;
font-size: 18px;
display: none;
}
.btn{
position: absolute;
height: 30px;
line-height: 30px;
font-size: 14px;
display: none;
}
.btn1{
top: 37px;
}
.btn2{
top: 78px;
}
}
.fileDivBox:hover{
border: 1px solid #000;
.deleteFile{
display: block;
}
.deleteFile:hover{
color: red;
}
.btn{
display: block;
}
}
}
.masklayer{
position: absolute;
left: 0;
top: 0;
z-index: 2000;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.2);
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
span{
font-size: 14px;
margin-top: 5px;
}
.progressbar{
width: 15%;
}
.cancelbtn{
height: 32px;
line-height: 32px;
font-size: 14px;
margin-top: 12px;
}
}
}
}
.addLinkageForceBox{
width: 530px;
height: 262px;
display: flex;
flex-direction: column;
.topbox{
width: 100%;
height: 40px;
line-height: 40px;
background-color: #2196F3;
text-align: center;
color: #FFFFFF;
font-size: 15px;
}
.contant{
flex: 1;
box-sizing: border-box;
padding:20px 30px;
div{
width:86px;
margin: 3px;
height: 36px;
float: left;
line-height: 36px;
text-align: center;
background-color: #F2F4F6;
font-size: 14px;
cursor: pointer;
border: 1px solid #fff;
border-radius: 4px;
display: flex;
justify-content: center;
align-items: center;
img{
margin-right: 3px;
}
}
.selectedDiv{
background-color: #fff;
border: 1px solid #2196F3;
}
}
.btnbox{
width: 100%;
height: 50px;
box-sizing: border-box;
padding: 0px 30px;
display: flex;
align-items: flex-start;;
justify-content: center;
button{
width: 80px;
height: 36px;
line-height: 36px;
margin: 0 20px;
}
}
}

220
src/app/plan-audit/linkageforces-audit/linkageforces-audit.component.ts

@ -1,5 +1,11 @@
import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { ViewDetailsComponent } from '../view-details/view-details.component';
import Viewer from 'viewerjs'
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatDialog } from '@angular/material/dialog';
declare var CryptoJS
declare var AMap: any;
@Component({
selector: 'app-linkageforces-audit',
templateUrl: './linkageforces-audit.component.html',
@ -7,9 +13,219 @@ import { Component, OnInit } from '@angular/core';
})
export class LinkageforcesAuditComponent implements OnInit {
constructor() { }
constructor(public snackBar: MatSnackBar,private http:HttpClient,public dialog: MatDialog) { }
LinkageForceDetailInfo:any = {
id: "600a736de10e6bf0ec592522",
linkageForceType: 5,
createTime: "2021-01-22T14:40:45.258345",
creatorId: "5e8eced2aaca5f7c1025309b",
name: "交通",
phoneNumber: "13864340193",
faxNumber: "110",
remark: "这是备注",
address: "小高",
location: {
x: 117.913928,
y: 36.457997
},
administrativeRegion: "淄博",
contactName: "张三",
contactTitle: "119",
contactPhone: "112",
serviceContent: "为人民服务",
resourceRemark: "宇宙资源",
relevantInfomationData: "[{\"fileName\":\"楼层区域.png\",\"fileLength\":4079,\"objectName\":\"LinkageForce/undefined/601e3f957cea2c03587c4c78.png\"},{\"fileName\":\"完整度规划20200724.docx\",\"fileLength\":16480,\"objectName\":\"LinkageForce/undefined/601e3f997cea2c03587c4c79.docx\"},{\"fileName\":\"李志 《天空之城》.mp4\",\"fileLength\":56362628,\"objectName\":\"LinkageForce/undefined/601e3f9d7cea2c03587c4c7a.mp4\"}]",
integrityScore: 0.16666667
}
checkBoxList:any[] = [
{id:0,name:'安监',imgUrl:'/assets/linkageForces/安监.png',isChecked:false},
{id:1,name:'电力局',imgUrl:'/assets/linkageForces/电力局.png',isChecked:false},
{id:2,name:'公安',imgUrl:'/assets/linkageForces/公安.png',isChecked:false},
{id:3,name:'海事',imgUrl:'/assets/linkageForces/海事.png',isChecked:false},
{id:4,name:'环保局',imgUrl:'/assets/linkageForces/环保局.png',isChecked:false},
{id:5,name:'交通',imgUrl:'/assets/linkageForces/交通.png',isChecked:false},
{id:6,name:'民政',imgUrl:'/assets/linkageForces/民政.png',isChecked:false},
{id:7,name:'气象局',imgUrl:'/assets/linkageForces/气象局.png',isChecked:false},
{id:8,name:'燃气局',imgUrl:'/assets/linkageForces/燃气局.png',isChecked:false},
{id:9,name:'市政',imgUrl:'/assets/linkageForces/市政.png',isChecked:false},
{id:10,name:'水利',imgUrl:'/assets/linkageForces/水利.png',isChecked:false},
{id:11,name:'通信',imgUrl:'/assets/linkageForces/通信.png',isChecked:false},
{id:12,name:'医疗',imgUrl:'/assets/linkageForces/医疗.png',isChecked:false},
{id:13,name:'应急管理',imgUrl:'/assets/linkageForces/应急管理.png',isChecked:false},
{id:14,name:'住建',imgUrl:'/assets/linkageForces/住建.png',isChecked:false}
]
AttachmentArr:any//附件
map:any
newPositionMarker:any
newPositionMarkerContent:any =
'<div class="custom-content-marker">' +
' <img style="width:20px;height:24px" src="/assets/images/定位.png">' +
'</div>'
ngOnInit(): void {
this.AttachmentArr = JSON.parse(this.LinkageForceDetailInfo.relevantInfomationData)
setTimeout(() => {
this.map = new AMap.Map('container', {
zoom:18
})
if(this.LinkageForceDetailInfo.location && this.LinkageForceDetailInfo.location.x){
this.map.setCenter([this.LinkageForceDetailInfo.location.x,this.LinkageForceDetailInfo.location.y]);
this.newPositionMarker = new AMap.Marker({
position: [this.LinkageForceDetailInfo.location.x,this.LinkageForceDetailInfo.location.y],
content: this.newPositionMarkerContent,
offset: new AMap.Pixel(-10, -12)
})
// 将 markers 添加到地图
this.map.add(this.newPositionMarker);
}else{
this.map.setCity('上海市');
}
}, 0);
}
objectName:any
progressBarValue:any = 0//分块上传进度
isMasklayer:boolean = false//圆圈遮罩层是否打开
isMasklayerDownload:boolean = false//下载进度条遮罩层是否打开
//下载
download (e) {
this.isMasklayerDownload = true //开启下载进度条
let file = e //传递过来的文件元数据
let fileSize = file.fileLength //下载文件的总大小
let shardSize = 3 * 1024 * 1024 //文件大小是否大于10MB
if (file && fileSize<=shardSize) { //<=3MB时直接下载
this.progressBarValue = 60
this.http.get(`/api/Objects/PlanPlatform/${e.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 fileName = e.fileName ? e.fileName : e.objectName.split('/')[e.objectName.split('/').length-1]
link.setAttribute("download", fileName);
document.body.appendChild(link);
link.click();
this.isMasklayerDownload = false //关闭下载进度条
this.progressBarValue = 0 //初始化进度条
})
} else if (file && fileSize>shardSize) { //>3MB时分块下载
this.blockingDownload(e) //分段下载
}
}
//分段下载并合并
async blockingDownload (e) {
let file = e //传递过来的文件元数据
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/PlanPlatform/${e.objectName}`,{headers:{'range':`bytes= ${start}-${end}`},responseType:'blob'}).subscribe(data=>{
result(data) })
})
allFile.push(result)
// this.progressBarValue = Number((i/allSlice).toFixed(2))*100 //文件进度数
this.progressBarValue = this.accMul(Number((i/allSlice).toFixed(2))*100,1,0)
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 fileName = e.fileName ? e.fileName : e.objectName.split('/')[e.objectName.split('/').length-1]
link.setAttribute("download", fileName);
document.body.appendChild(link);
link.click();
this.isMasklayerDownload = false //关闭下载进度条
this.progressBarValue = 0 //初始化进度条
}
} //for循环结束
}
//js乘法
accMul(arg1,arg2,fix) {
if(!parseInt(fix)==fix)
{
return;
}
var m=0,s1=arg1.toString(),s2=arg2.toString();
try{m+=s1.split(".")[1].length}catch(e){}
try{m+=s2.split(".")[1].length}catch(e){}
if(m>fix){
return (Math.round(Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m-fix))/Math.pow(10,fix));
}else if(m<=fix){
return (Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m)).toFixed(fix);
}else{
return (arg1*arg2).toFixed(fix).toString();
}
}
//当前点击tab页面第几个
tabIndex:any = 1
selectedTab(index){
this.tabIndex = index
}
//点击文件
clickFile(item){
let suffix = item.fileName.split('.')[item.fileName.split('.').length-1]
if(suffix == 'png' || suffix == 'jpg' || suffix == 'JPG'){
let dom = document.getElementById(`viewerjs`)
let pObjs = dom.childNodes;
let node = document.createElement("img")
node.style.display = "none";
node.src = "/api/Objects/PlanPlatform/" + item.objectName;
node.id = 'img'
dom.appendChild(node)
setTimeout(() => {
let viewer = new Viewer(document.getElementById(`viewerjs`), {
hidden:()=>{
dom.removeChild(pObjs[0]);
viewer.destroy();
}
});
node.click();
}, 0);
}
if(suffix == 'docx' || suffix == 'doc' || suffix == 'pdf'){
let fetchUrl = item.objectName
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)
let json={
doc: {
docId: docId,
title: item.fileName,
fetchUrl: `http://${location.host}/api/Objects/PlanPlatform/`+fetchUrl
},
user: {
uid: identityJsonparse.sub,
nickName: identityJsonparse.name,
avatar: "",
privilege: [
'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://121.5.10.84/apps/editor/openPreview?data=${base64}`)
}
if(suffix == 'mp4'){
const dialogRef = this.dialog.open(ViewDetailsComponent, {//调用open方法打开对话框并且携带参数过去
data: {item:item,type:"video"},
id:'videodialog'
});
dialogRef.afterClosed().subscribe();
}
}
}

21
src/app/plan-audit/wait-examineer/wait-examineer.component.html

@ -130,17 +130,6 @@
<app-cad-draw></app-cad-draw>
</ng-template>
</mat-tab>
<!-- <mat-tab label="六熟悉">
<ng-template matTabContent>
六熟悉
</ng-template>
</mat-tab>
<mat-tab label="实战演练">
<ng-template matTabContent>
实战演练
</ng-template>
</mat-tab> -->
</mat-tab-group>
<div id="firefacilities" *ngIf="showtype==3 && !isallDate" style="margin: 10px;">
<mat-accordion class="tableContent" >
@ -280,13 +269,13 @@
<app-water-audit></app-water-audit>
</div> -->
<!-- 消防力量审核 -->
<div class="fireForceAudit">
<!-- <div class="fireForceAudit">
<app-fireforce-audit></app-fireforce-audit>
</div>
<!-- 联动力量审核 -->
<!-- <div class="LinkageForcesAudit">
</div> -->
<!-- 联动力量审核 -->
<div class="LinkageForcesAudit">
<app-linkageforces-audit></app-linkageforces-audit>
</div>
</div>
</div>
<div class="echarts" *ngIf="previewshow" ><!-- [style.display]="previewshow==true?'block':'none'" -->

Loading…
Cancel
Save