|
|
|
/*
|
|
|
|
* @Descripttion:
|
|
|
|
* @version:
|
|
|
|
* @Author: sueRimn
|
|
|
|
* @Date: 2020-12-25 16:13:50
|
|
|
|
* @LastEditors: sueRimn
|
|
|
|
* @LastEditTime: 2021-01-28 11:30:48
|
|
|
|
*/
|
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
import { FormControl } from '@angular/forms';
|
|
|
|
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
|
|
|
|
import { HttpClient } from '@angular/common/http'
|
|
|
|
import CryptoJS from 'crypto-js/crypto-js'
|
|
|
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
|
|
declare var echarts: any;
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-wait-examineer',
|
|
|
|
templateUrl: './wait-examineer.component.html',
|
|
|
|
styleUrls: ['./wait-examineer.component.scss']
|
|
|
|
})
|
|
|
|
export class WaitExamineerComponent implements OnInit {
|
|
|
|
|
|
|
|
constructor(private http:HttpClient,public snackBar: MatSnackBar,private sanitizer: DomSanitizer) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
|
let level = sessionStorage.getItem("level");
|
|
|
|
if(level == "0"){//如果是总队
|
|
|
|
this.preparelevels = [
|
|
|
|
{name:"总队",value:"1"},
|
|
|
|
{name:"支队",value:"2"},
|
|
|
|
{name:"大队",value:"4"},
|
|
|
|
{name:"中队",value:"8"}
|
|
|
|
]
|
|
|
|
this.PlanLevel=0
|
|
|
|
}
|
|
|
|
if(level == "1"){//如果是支队
|
|
|
|
this.preparelevels = [
|
|
|
|
{name:"支队",value:"1"},
|
|
|
|
{name:"大队",value:"2"},
|
|
|
|
{name:"中队",value:"3"}
|
|
|
|
]
|
|
|
|
this.PlanLevel=1
|
|
|
|
}
|
|
|
|
if(level == "2"){//如果是大队
|
|
|
|
this.preparelevels = [
|
|
|
|
{name:"大队",value:"4"},
|
|
|
|
{name:"中队",value:"8"}
|
|
|
|
]
|
|
|
|
this.PlanLevel=2
|
|
|
|
}
|
|
|
|
if(level == "3"){//如果是中队
|
|
|
|
this.preparelevels = [
|
|
|
|
{name:"中队",value:"8"}
|
|
|
|
]
|
|
|
|
this.PlanLevel=3
|
|
|
|
}
|
|
|
|
var scrollflaga = true;
|
|
|
|
var win=document.getElementById('tbodydiv')
|
|
|
|
/* window.setTimeout(()=>{
|
|
|
|
var a = document.getElementById("table").offsetTop;
|
|
|
|
window.onscroll=function(){
|
|
|
|
if(scrollflaga){
|
|
|
|
if(a>=win.scrollTop&&a<(win.scrollTop+win.offsetHeight)){
|
|
|
|
scrollflaga=false
|
|
|
|
this.getAlltabledate()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}) */
|
|
|
|
|
|
|
|
this.getAlltabledate()
|
|
|
|
this.iframeSrc=this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
|
|
|
|
}
|
|
|
|
ngOnDestroy () {
|
|
|
|
/* this.indexbar.clear()
|
|
|
|
this.indexbar.dispose() */
|
|
|
|
}
|
|
|
|
|
|
|
|
wordShow=true
|
|
|
|
iframeSrc
|
|
|
|
src=''
|
|
|
|
|
|
|
|
preparelevels:any
|
|
|
|
selected = new FormControl(0); //选项卡 实例
|
|
|
|
level=''//操作类型
|
|
|
|
js//组织机构
|
|
|
|
addtime//时间
|
|
|
|
projectlevel//预案级别
|
|
|
|
previewshow=false//预览得分是否显示
|
|
|
|
tableDate
|
|
|
|
isallDate=true//是否显示完成数据,默认显示
|
|
|
|
companyBuiltInGrouping=["基本信息","四周毗邻","消防设施"]
|
|
|
|
indexbar //饼状图实例
|
|
|
|
indexzhu
|
|
|
|
PlanLevel//编制级别
|
|
|
|
count//一共多少条
|
|
|
|
checked//是否选中
|
|
|
|
chuorzhong//判断初审还是终审
|
|
|
|
radioid//选中的id
|
|
|
|
shenheTable=[]//选中要审核的对象
|
|
|
|
|
|
|
|
//获取表格数据
|
|
|
|
getAlltabledate(){
|
|
|
|
|
|
|
|
let paramsdata:any = {
|
|
|
|
Operation:this.level||[],
|
|
|
|
ContentType:Number(this.projectlevel)||[],
|
|
|
|
Level:this.PlanLevel||[],
|
|
|
|
verifyState:[0,3]
|
|
|
|
}
|
|
|
|
this.http.get("/api/ContentVerifies",{params:paramsdata}).subscribe((data:any)=>{
|
|
|
|
//console.log(data)
|
|
|
|
this.tableDate=data.items
|
|
|
|
this.count=data.totalCount
|
|
|
|
})
|
|
|
|
}
|
|
|
|
//提交查询
|
|
|
|
onSubmit(value){
|
|
|
|
//console.log(value)
|
|
|
|
this.getAlltabledate()
|
|
|
|
}
|
|
|
|
//刷新
|
|
|
|
record(){
|
|
|
|
this.level=''
|
|
|
|
this.projectlevel=''
|
|
|
|
let level = sessionStorage.getItem("level");
|
|
|
|
if(level == "0"){//如果是总队
|
|
|
|
this.PlanLevel=0
|
|
|
|
}
|
|
|
|
if(level == "1"){//如果是支队
|
|
|
|
this.PlanLevel=1
|
|
|
|
}
|
|
|
|
if(level == "2"){//如果是大队
|
|
|
|
this.PlanLevel=2
|
|
|
|
}
|
|
|
|
if(level == "3"){//如果是中队
|
|
|
|
this.PlanLevel=3
|
|
|
|
}
|
|
|
|
this.getAlltabledate()
|
|
|
|
}
|
|
|
|
//radio点击事件
|
|
|
|
radioClick(e,item){
|
|
|
|
//e.target.parentElement.bgColor='#2196F3'
|
|
|
|
console.log(e,item)
|
|
|
|
let filename:string
|
|
|
|
let fetchUrl
|
|
|
|
this.http.get(`/api/PlanComponents/${item.itemId}`).subscribe((data:any)=>{
|
|
|
|
fetchUrl=data.attachmentUrls[0]
|
|
|
|
this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{
|
|
|
|
filename=data.fileName
|
|
|
|
let json={
|
|
|
|
doc: {
|
|
|
|
docId: item.id,
|
|
|
|
title: filename,
|
|
|
|
//title: filename,
|
|
|
|
fetchUrl: "http://39.106.78.171:8000/api/Objects/PlanPlatform/"+fetchUrl
|
|
|
|
},
|
|
|
|
user: {
|
|
|
|
uid: "test",
|
|
|
|
nickName: "test",
|
|
|
|
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);
|
|
|
|
this.src=`http://121.5.10.84/apps/editor/openPreview?data=${base64}`
|
|
|
|
this.iframeSrc=this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
|
|
|
|
//window.open(`http://121.5.10.84/apps/editor/openPreview?data=${base64}`)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
if(e.checked){
|
|
|
|
this.shenheTable.push(item)
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
for(var i=0;i<this.shenheTable.length;i++ ){
|
|
|
|
if(this.shenheTable[i].id==item.id){
|
|
|
|
this.shenheTable.splice(i,1)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* this.chuorzhong=item.verifyState
|
|
|
|
this.radioid=item.itemId */
|
|
|
|
}
|
|
|
|
//变更数据和全部数据切换按钮
|
|
|
|
buttonChange(){
|
|
|
|
this.isallDate=!this.isallDate
|
|
|
|
this.previewshow=false
|
|
|
|
}
|
|
|
|
//同意操作
|
|
|
|
agree(){
|
|
|
|
var agreeList=[]
|
|
|
|
const config = new MatSnackBarConfig();
|
|
|
|
config.verticalPosition = 'top';
|
|
|
|
config.duration = 3000
|
|
|
|
/* if(this.chuorzhong==2){
|
|
|
|
this.snackBar.open('审核未通过,请修改后再来审核!','确定',config);
|
|
|
|
} */
|
|
|
|
//console.log(this.shenheTable)
|
|
|
|
if(this.shenheTable.length==0){
|
|
|
|
this.snackBar.open('请选择要审核的预案!','确定',config);
|
|
|
|
}
|
|
|
|
else if(this.shenheTable.length==1){
|
|
|
|
if(this.shenheTable[0].verifyState==0){
|
|
|
|
this.http.put(`/api/PlanAudits/${this.shenheTable[0].itemId}/First`,{auditStatus:16}).subscribe(data=>{
|
|
|
|
this.snackBar.open('操作成功!','确定',config);
|
|
|
|
this.getAlltabledate()
|
|
|
|
})
|
|
|
|
}else if(this.shenheTable[0].verifyState==3){
|
|
|
|
this.http.put(`/api/PlanAudits/${this.radioid}`,{auditStatus:2}).subscribe(data=>{
|
|
|
|
this.snackBar.open('操作成功!','确定',config);
|
|
|
|
this.getAlltabledate()
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
for(var i=0;i<this.shenheTable.length;i++){
|
|
|
|
var cart={
|
|
|
|
planComponentId:this.shenheTable[i].itemId,
|
|
|
|
auditStatus:this.shenheTable[i].verifyState==3?2:16,
|
|
|
|
auditOpinion:''
|
|
|
|
}
|
|
|
|
agreeList.push(cart)
|
|
|
|
}
|
|
|
|
this.http.put(`/api/PlanAudits/Batch`,agreeList).subscribe(data=>{
|
|
|
|
this.snackBar.open('操作成功!','确定',config);
|
|
|
|
this.getAlltabledate()
|
|
|
|
})
|
|
|
|
}
|
|
|
|
this.shenheTable=[]
|
|
|
|
}
|
|
|
|
//拒绝操作
|
|
|
|
refuse(){
|
|
|
|
const config = new MatSnackBarConfig();
|
|
|
|
config.verticalPosition = 'top';
|
|
|
|
config.duration = 3000
|
|
|
|
var refuseList=[]
|
|
|
|
if(this.shenheTable.length==0){
|
|
|
|
this.snackBar.open('请选择要审核的预案!','确定',config);
|
|
|
|
}
|
|
|
|
else if(this.shenheTable.length==1){
|
|
|
|
if(this.shenheTable[0].verifyState==0){
|
|
|
|
this.http.put(`/api/PlanAudits/${this.shenheTable[0].itemId}/First`,{auditStatus:32}).subscribe(data=>{
|
|
|
|
this.snackBar.open('操作成功!','确定',config);
|
|
|
|
this.getAlltabledate()
|
|
|
|
})
|
|
|
|
}else if(this.shenheTable[0].verifyState==3){
|
|
|
|
this.http.put(`/api/PlanAudits/${this.radioid}`,{auditStatus:4}).subscribe(data=>{
|
|
|
|
this.snackBar.open('操作成功!','确定',config);
|
|
|
|
this.getAlltabledate()
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
for(var i=0;i<this.shenheTable.length;i++){
|
|
|
|
var cart={
|
|
|
|
planComponentId:this.shenheTable[i].itemId,
|
|
|
|
auditStatus:this.shenheTable[i].verifyState==3?4:32,
|
|
|
|
auditOpinion:''
|
|
|
|
}
|
|
|
|
refuseList.push(cart)
|
|
|
|
}
|
|
|
|
this.http.put(`/api/PlanAudits/Batch`,refuseList).subscribe(data=>{
|
|
|
|
this.snackBar.open('操作成功!','确定',config);
|
|
|
|
this.getAlltabledate()
|
|
|
|
})
|
|
|
|
}
|
|
|
|
this.shenheTable=[]
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//分数饼状图
|
|
|
|
bar(){
|
|
|
|
var ec = echarts as any;
|
|
|
|
this.indexbar=ec.init(document.getElementById('indexbar'),'light');
|
|
|
|
var option = {
|
|
|
|
tooltip: {
|
|
|
|
trigger: 'item',
|
|
|
|
formatter: '{a} <br/>{b}: {c} ({d}%)'
|
|
|
|
},
|
|
|
|
title: {
|
|
|
|
text: '总分',
|
|
|
|
left: 'center',
|
|
|
|
bottom:70,
|
|
|
|
textStyle:{
|
|
|
|
color:'#FFFFFF',
|
|
|
|
fontSize:16
|
|
|
|
}
|
|
|
|
},
|
|
|
|
series: [
|
|
|
|
{
|
|
|
|
name: '分数',
|
|
|
|
type: 'pie',
|
|
|
|
radius: ['50%', '70%'],
|
|
|
|
bottom:50,
|
|
|
|
avoidLabelOverlap: false,
|
|
|
|
label: {
|
|
|
|
show: true,
|
|
|
|
position: 'center',
|
|
|
|
fontSize:16,
|
|
|
|
color:'#FFFFFF'
|
|
|
|
},
|
|
|
|
|
|
|
|
labelLine: {
|
|
|
|
show: false
|
|
|
|
},
|
|
|
|
data: [
|
|
|
|
{value: 93, name: '93分', itemStyle:{color:'#2196F3'}},
|
|
|
|
{value:7, itemStyle:{color:'#FFFFFF'}}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
this.indexbar.setOption(option);
|
|
|
|
}
|
|
|
|
//分数柱状图
|
|
|
|
zhu(){
|
|
|
|
var ec = echarts as any;
|
|
|
|
this.indexzhu=ec.init(document.getElementById('zhu'),'light');
|
|
|
|
var option={
|
|
|
|
grid: {
|
|
|
|
left: '3%',
|
|
|
|
right: '4%',
|
|
|
|
bottom: '3%',
|
|
|
|
containLabel: true
|
|
|
|
},
|
|
|
|
xAxis: {
|
|
|
|
type: 'value',
|
|
|
|
show:false,
|
|
|
|
axisLine:{
|
|
|
|
show:false
|
|
|
|
},
|
|
|
|
splitLine:{
|
|
|
|
show:false
|
|
|
|
},
|
|
|
|
axisTick:{
|
|
|
|
show:false
|
|
|
|
},
|
|
|
|
},
|
|
|
|
yAxis: {
|
|
|
|
type: 'category',
|
|
|
|
axisTick:{
|
|
|
|
show:false
|
|
|
|
},
|
|
|
|
axisLine:{
|
|
|
|
show:false
|
|
|
|
},
|
|
|
|
axisLabel:{
|
|
|
|
color:"#FFFFFF",
|
|
|
|
fontSize:16
|
|
|
|
},
|
|
|
|
data: ['实战演练记录', '六熟悉记录', '上传CAD', '实景图', '功能分区', '重点单位', '消防设施','四周毗邻','基本信息']
|
|
|
|
},
|
|
|
|
series: [
|
|
|
|
{
|
|
|
|
|
|
|
|
type: 'bar',
|
|
|
|
stack: '总量',
|
|
|
|
showBackground: true,
|
|
|
|
backgroundStyle: {
|
|
|
|
color: '#FFFFFF'
|
|
|
|
},
|
|
|
|
label: {
|
|
|
|
show: true,
|
|
|
|
position: 'inside',
|
|
|
|
fontSize:14,
|
|
|
|
formatter: '{c}分'
|
|
|
|
},
|
|
|
|
data: [
|
|
|
|
{value:18, itemStyle:{color:'#58D091'}},
|
|
|
|
{value:16, itemStyle:{color:'#58D091'}},
|
|
|
|
{value:19, itemStyle:{color:'#58D091'}},
|
|
|
|
{value:16, itemStyle:{color:'#58D091'}},
|
|
|
|
{value:16, itemStyle:{color:'#58D091'}},
|
|
|
|
{value:13, itemStyle:{color:'#FFCC00'}},
|
|
|
|
{value:6, itemStyle:{color:'#FF4D4D'}},
|
|
|
|
{value:19, itemStyle:{color:'#58D091'}},
|
|
|
|
{value:16, itemStyle:{color:'#58D091'}},
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
type: 'bar',
|
|
|
|
stack: '总量',
|
|
|
|
label: {
|
|
|
|
show: false,
|
|
|
|
position: 'insideRight'
|
|
|
|
},
|
|
|
|
data: [2, 4, 1, 4, 4, 7, 14,1,4],
|
|
|
|
itemStyle:{
|
|
|
|
color:"#FFFFFF",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
]
|
|
|
|
}
|
|
|
|
this.indexzhu.setOption(option);
|
|
|
|
}
|
|
|
|
preview(){
|
|
|
|
this.previewshow=!this.previewshow
|
|
|
|
if(this.previewshow){
|
|
|
|
window.setTimeout(()=>{
|
|
|
|
this.bar()
|
|
|
|
this.zhu()
|
|
|
|
},0)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|