Browse Source

[修改]弃用毕生

tangshan
邵佳豪 4 years ago
parent
commit
6736d776a8
  1. 24
      src/app/data-collection/fire-force/fire-force.component.ts
  2. 24
      src/app/data-collection/linkage-forces/linkage-forces.component.ts
  3. 43
      src/app/external-links-plan/external-links-plan.component.ts
  4. 4
      src/app/key-unit/basicinfo/basicinfo.component.ts
  5. 31
      src/app/plan-audit/fireforce-audit/fireforce-audit.component.ts
  6. 31
      src/app/plan-audit/linkageforces-audit/linkageforces-audit.component.ts
  7. 324
      src/app/plan-audit/plan-record/plan-record.component.ts
  8. 62
      src/app/plan-audit/wait-examineer/wait-examineer.component.ts
  9. 2
      src/app/plan-management/entry-plan-look/entry-plan-look.component.html
  10. 136
      src/app/plan-management/entry-plan-look/entry-plan-look.component.ts
  11. 698
      src/app/plan-management/meet-plan/meet-plan.component.ts
  12. 673
      src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts
  13. 294
      src/app/plan-management/open-plan/open-plan.component.ts
  14. 464
      src/app/plan-management/pass-plan/pass-plan.component.ts
  15. 659
      src/app/plan-management/type-plan/type-plan.component.ts
  16. 122
      src/app/statistic-analysis/all-plan/all-plan.component.ts
  17. 46
      src/app/statistic-analysis/plan-analysis-by-synthesis/plan-analysis-by-synthesis.component.ts
  18. 39
      src/app/tabbar/tabbar.component.html
  19. 4
      src/app/ui/collection-tools-plan/addPlaneFigure.html
  20. 13
      src/index.html

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

@ -1143,25 +1143,13 @@ export class FireForceComponent implements OnInit {
} }
if(suffix == 'docx' || suffix == 'doc' || suffix == 'pdf'){ if(suffix == 'docx' || suffix == 'doc' || suffix == 'pdf'){
let fetchUrl = item.objectName let fetchUrl = item.objectName
let json={ if (suffix == 'docx' || suffix == 'doc') {
doc: { let arr = fetchUrl.split('.')
docId: new Date(), arr[arr.length - 1] = 'pdf'
title: item.fileName, window.open(`/api/Objects/PlanPlatform/` + arr.join('.'))
fetchUrl: `http://172.18.0.1:8000/api/Objects/PlanPlatform/`+fetchUrl }else if (suffix == 'pdf') {
}, window.open(`/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);
window.open(`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`)
} }
if(suffix == 'mp4'){ if(suffix == 'mp4'){
const dialogRef = this.dialog.open(ViewDetails, {//调用open方法打开对话框并且携带参数过去 const dialogRef = this.dialog.open(ViewDetails, {//调用open方法打开对话框并且携带参数过去

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

@ -867,25 +867,13 @@ export class LinkageForcesComponent implements OnInit {
} }
if(suffix == 'docx' || suffix == 'doc' || suffix == 'pdf'){ if(suffix == 'docx' || suffix == 'doc' || suffix == 'pdf'){
let fetchUrl = item.objectName let fetchUrl = item.objectName
let json={ if (suffix == 'docx' || suffix == 'doc') {
doc: { let arr = fetchUrl.split('.')
docId: new Date(), arr[arr.length - 1] = 'pdf'
title: item.fileName, window.open(`/api/Objects/PlanPlatform/` + arr.join('.'))
fetchUrl: `http://172.18.0.1:8000/api/Objects/PlanPlatform/`+fetchUrl }else if (suffix == 'pdf') {
}, window.open(`/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);
window.open(`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`)
} }
if(suffix == 'mp4'){ if(suffix == 'mp4'){
const dialogRef = this.dialog.open(ViewDetails2, {//调用open方法打开对话框并且携带参数过去 const dialogRef = this.dialog.open(ViewDetails2, {//调用open方法打开对话框并且携带参数过去

43
src/app/external-links-plan/external-links-plan.component.ts

@ -73,38 +73,17 @@ export class ExternalLinksPlanComponent implements OnInit {
iframeSrc//毕生服务器链接 iframeSrc//毕生服务器链接
src//文件存储地址 src//文件存储地址
lookWord() { lookWord() {
let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + this.fetchUrl); this.showType = 0
let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); let src
let jwt = sessionStorage.getItem("token"); let suffix = this.fetchUrl.split('.')[this.fetchUrl.split('.').length - 1].toLowerCase()
let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); if (suffix == 'docx' || suffix == 'doc') {
let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); let arr = this.fetchUrl.split('.')
let identityJsonparse = JSON.parse(identityJson) arr[arr.length - 1] = 'pdf'
let filename: string src = `/api/Objects/PlanPlatform/` + arr.join('.')
this.http.get(`/api/ObjectMetadata/PlanPlatform/${this.fetchUrl}`).subscribe((data: any) => { }else if (suffix == 'pdf') {
filename = data.fileName src = `/api/Objects/PlanPlatform/` + this.fetchUrl
let json = { }
doc: { this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(src);
docId: docId,
title: filename,
//title: filename,
fetchUrl: `http://172.18.0.1:8000/api/Objects/PlanPlatform/` + this.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);
this.src = `http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`
this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
this.showType = 0
})
} }
companyData//当前公司信息 companyData//当前公司信息

4
src/app/key-unit/basicinfo/basicinfo.component.ts

@ -1048,10 +1048,6 @@ export class BasicinfoComponent implements OnInit {
//提交建筑信息 //提交建筑信息
onSubmitBuildingInfo(value, item, key, invalid) { onSubmitBuildingInfo(value, item, key, invalid) {
// console.log(1,item)
// console.log(2,invalid)
// console.log(3,value)
// console.log(4,this.allunittype)
if (invalid) { if (invalid) {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';

31
src/app/plan-audit/fireforce-audit/fireforce-audit.component.ts

@ -161,32 +161,13 @@ export class FireforceAuditComponent implements OnInit {
} }
if(suffix == 'docx' || suffix == 'doc' || suffix == 'pdf'){ if(suffix == 'docx' || suffix == 'doc' || suffix == 'pdf'){
let fetchUrl = item.objectName let fetchUrl = item.objectName
let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl); if (suffix == 'docx' || suffix == 'doc') {
let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); let arr = fetchUrl.split('.')
arr[arr.length - 1] = 'pdf'
let jwt = sessionStorage.getItem("token"); window.open(`/api/Objects/PlanPlatform/` + arr.join('.'))
let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); }else if (suffix == 'pdf') {
let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); window.open(`/api/Objects/PlanPlatform/` + fetchUrl)
let identityJsonparse=JSON.parse(identityJson)
let json={
doc: {
docId: docId,
title: item.fileName,
fetchUrl: `http://172.18.0.1:8000/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://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`)
} }
if(suffix == 'mp4'){ if(suffix == 'mp4'){
const dialogRef = this.dialog.open(ViewDetailsComponent, {//调用open方法打开对话框并且携带参数过去 const dialogRef = this.dialog.open(ViewDetailsComponent, {//调用open方法打开对话框并且携带参数过去

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

@ -171,32 +171,13 @@ export class LinkageforcesAuditComponent implements OnInit {
} }
if(suffix == 'docx' || suffix == 'doc' || suffix == 'pdf'){ if(suffix == 'docx' || suffix == 'doc' || suffix == 'pdf'){
let fetchUrl = item.objectName let fetchUrl = item.objectName
let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl); if (suffix == 'docx' || suffix == 'doc') {
let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); let arr = fetchUrl.split('.')
arr[arr.length - 1] = 'pdf'
let jwt = sessionStorage.getItem("token"); window.open(`/api/Objects/PlanPlatform/` + arr.join('.'))
let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); }else if (suffix == 'pdf') {
let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); window.open(`/api/Objects/PlanPlatform/` + fetchUrl)
let identityJsonparse=JSON.parse(identityJson)
let json={
doc: {
docId: docId,
title: item.fileName,
fetchUrl: `http://172.18.0.1:8000/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://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`)
} }
if(suffix == 'mp4'){ if(suffix == 'mp4'){
const dialogRef = this.dialog.open(ViewDetailsComponent, {//调用open方法打开对话框并且携带参数过去 const dialogRef = this.dialog.open(ViewDetailsComponent, {//调用open方法打开对话框并且携带参数过去

324
src/app/plan-audit/plan-record/plan-record.component.ts

@ -6,10 +6,10 @@
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2021-04-22 10:47:06 * @LastEditTime: 2021-04-22 10:47:06
*/ */
import { Component, OnInit,Inject } from '@angular/core'; import { Component, OnInit, Inject } from '@angular/core';
import { FormControl } from '@angular/forms'; import { FormControl } from '@angular/forms';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog'; import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { HttpClient } from '@angular/common/http' import { HttpClient } from '@angular/common/http'
import { DomSanitizer } from '@angular/platform-browser'; import { DomSanitizer } from '@angular/platform-browser';
import { Viewer } from 'photo-sphere-viewer'; import { Viewer } from 'photo-sphere-viewer';
@ -22,69 +22,69 @@ declare var CryptoJS
}) })
export class PlanRecordComponent implements OnInit { export class PlanRecordComponent implements OnInit {
constructor(private http:HttpClient,public snackBar: MatSnackBar,private sanitizer: DomSanitizer,public dialog: MatDialog) { } constructor(private http: HttpClient, public snackBar: MatSnackBar, private sanitizer: DomSanitizer, public dialog: MatDialog) { }
pcshow pcshow
ngOnInit(): void { ngOnInit(): void {
if(window.matchMedia("(max-width: 1300px)").matches){ if (window.matchMedia("(max-width: 1300px)").matches) {
this.pcshow=false this.pcshow = false
}else{ } else {
this.pcshow=true this.pcshow = true
} }
let level = sessionStorage.getItem("level"); let level = sessionStorage.getItem("level");
if(level == "0"){//如果是总队 if (level == "0") {//如果是总队
this.preparelevels = [ this.preparelevels = [
{name:"总队",value:"0"}, { name: "总队", value: "0" },
{name:"支队",value:"1"}, { name: "支队", value: "1" },
{name:"大队",value:"2"}, { name: "大队", value: "2" },
{name:"中队",value:"3"} { name: "中队", value: "3" }
] ]
} }
if(level == "1"){//如果是支队 if (level == "1") {//如果是支队
this.preparelevels = [ this.preparelevels = [
{name:"支队",value:"1"}, { name: "支队", value: "1" },
{name:"大队",value:"2"}, { name: "大队", value: "2" },
{name:"中队",value:"3"} { name: "中队", value: "3" }
] ]
} }
if(level == "2"){//如果是大队 if (level == "2") {//如果是大队
this.preparelevels = [ this.preparelevels = [
{name:"大队",value:"2"}, { name: "大队", value: "2" },
{name:"中队",value:"3"} { name: "中队", value: "3" }
] ]
} }
if(level == "3"){//如果是中队 if (level == "3") {//如果是中队
this.preparelevels = [ this.preparelevels = [
{name:"中队",value:"3"} { name: "中队", value: "3" }
] ]
} }
this.iframeSrc=this.sanitizer.bypassSecurityTrustResourceUrl(this.src); this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
this.getAlltabledate() this.getAlltabledate()
} }
wordShow=true wordShow = true
iframeSrc iframeSrc
src='' src = ''
selected = new FormControl(0); //选项卡 实例 selected = new FormControl(0); //选项卡 实例
preparelevels:any preparelevels: any
level=''//类型 level = ''//类型
verifyState=''//审核状态 verifyState = ''//审核状态
projectlevel//组织机构 projectlevel//组织机构
PlanLevel//编制级别 PlanLevel//编制级别
addtime//时间 addtime//时间
endtime//结束时间 endtime//结束时间
count//一共多少条 count//一共多少条
tableDate tableDate
showPvt=false//全景图是否显示 showPvt = false//全景图是否显示
shenheTable=[]//选中要审核的对象 shenheTable = []//选中要审核的对象
chuorzhong//判断初审还是终审 chuorzhong//判断初审还是终审
radioid//选中的id radioid//选中的id
showtype=-1//0:word,1:全景图,2:二维三维,3:重点单位 showtype = -1//0:word,1:全景图,2:二维三维,3:重点单位
compantData={name:'',buildingTypes:[],address:''} compantData = { name: '', buildingTypes: [], address: '' }
organizationName organizationName
planData planData
id id
@ -94,179 +94,157 @@ export class PlanRecordComponent implements OnInit {
companyName companyName
//获取表格数据 //获取表格数据
getAlltabledate(){ getAlltabledate() {
let paramsdata:any = { let paramsdata: any = {
Operation:this.level||[], Operation: this.level || [],
ContentType:Number(this.projectlevel)||[], ContentType: Number(this.projectlevel) || [],
Level:this.PlanLevel||[], Level: this.PlanLevel || [],
verifyState:this.verifyState||[1,2,4,5], verifyState: this.verifyState || [1, 2, 4, 5],
QueryStartTime:this.addtime||'', QueryStartTime: this.addtime || '',
QueryEndTime:this.endtime||'' QueryEndTime: this.endtime || ''
} }
this.http.get("/api/ContentVerifies",{params:paramsdata}).subscribe((data:any)=>{ this.http.get("/api/ContentVerifies", { params: paramsdata }).subscribe((data: any) => {
//console.log(data) //console.log(data)
this.tableDate=data.items this.tableDate = data.items
this.count=data.totalCount this.count = data.totalCount
}) })
} }
//提交查询 //提交查询
onSubmit(value){ onSubmit(value) {
//console.log(value) //console.log(value)
this.getAlltabledate() this.getAlltabledate()
} }
//刷新 //刷新
record(){ record() {
this.verifyState='' this.verifyState = ''
this.level='' this.level = ''
this.projectlevel='' this.projectlevel = ''
this.addtime='' this.addtime = ''
this.endtime='' this.endtime = ''
let level = sessionStorage.getItem("level"); let level = sessionStorage.getItem("level");
this.PlanLevel='' this.PlanLevel = ''
this.getAlltabledate() this.getAlltabledate()
} }
//表格点击事件 //表格点击事件
viewer//全景图对象 viewer//全景图对象
waterData:any//需要传递给子组件的水源信息 waterData: any//需要传递给子组件的水源信息
LinkageForceDetailInfo:any//需要传递给子组件的联动力量信息 LinkageForceDetailInfo: any//需要传递给子组件的联动力量信息
fireForceDetailInfo:any//需要传递给子组件的消防力量信息 fireForceDetailInfo: any//需要传递给子组件的消防力量信息
postlevel:any postlevel: any
tableClick(e,item){ tableClick(e, item) {
this.showtype = -1 this.showtype = -1
//e.target.parentElement.bgColor='#2196F3' //e.target.parentElement.bgColor='#2196F3'
// console.log(item) // console.log(item)
this.organizationName='' this.organizationName = ''
this.itemid=item.itemId this.itemid = item.itemId
this.id=item.id this.id = item.id
this.fetchUrl='' this.fetchUrl = ''
this.viewer={} this.viewer = {}
if(item.contentType == 11){ if (item.contentType == 11) {
window.setTimeout(()=>{ window.setTimeout(() => {
this.showtype = 3 this.showtype = 3
sessionStorage.setItem('companyId',item.itemId) sessionStorage.setItem('companyId', item.itemId)
},0) }, 0)
}else if(item.contentType == 12){ } else if (item.contentType == 12) {
//水源 //水源
this.http.get(`/api/WaterSources/${item.itemId}`).subscribe((data)=>{ this.http.get(`/api/WaterSources/${item.itemId}`).subscribe((data) => {
this.waterData = data this.waterData = data
this.showtype = 12 this.showtype = 12
}) })
}else if(item.contentType == 13){ } else if (item.contentType == 13) {
//消防力量 //消防力量
this.http.get(`/api/CustomFireForce/${item.itemId}`).subscribe((data:any)=>{ this.http.get(`/api/CustomFireForce/${item.itemId}`).subscribe((data: any) => {
if(data.forceType != 0){//如果是其他消防力量 if (data.forceType != 0) {//如果是其他消防力量
this.postlevel = 4 this.postlevel = 4
}else{ } else {
this.postlevel = data.level this.postlevel = data.level
} }
// console.log('xxx',data) // console.log('xxx',data)
data.fireForceDetailInfo.location ? null : data.fireForceDetailInfo.location={x:null,y:null} data.fireForceDetailInfo.location ? null : data.fireForceDetailInfo.location = { x: null, y: null }
this.fireForceDetailInfo = data.fireForceDetailInfo this.fireForceDetailInfo = data.fireForceDetailInfo
this.showtype = 13 this.showtype = 13
}) })
}else if(item.contentType == 14){ } else if (item.contentType == 14) {
//联动力量 //联动力量
this.http.get(`/api/LinkageForces/${item.itemId}`).subscribe((data:any)=>{ this.http.get(`/api/LinkageForces/${item.itemId}`).subscribe((data: any) => {
data.location ? null : data.location={x:null,y:null} data.location ? null : data.location = { x: null, y: null }
this.LinkageForceDetailInfo = data this.LinkageForceDetailInfo = data
this.showtype = 14 this.showtype = 14
}) })
}else{ } else {
this.http.get(`/api/PlanComponents/${item.itemId}`).subscribe((data:any)=>{ this.http.get(`/api/PlanComponents/${item.itemId}`).subscribe((data: any) => {
this.companyId=data.companyId this.companyId = data.companyId
this.companyName=data.companyName this.companyName = data.companyName
if(data.planType!=2&&data.planType!=1){ if (data.planType != 2 && data.planType != 1) {
this.fetchUrl=data.attachmentUrls[0] this.fetchUrl = data.attachmentUrls[0]
var index=this.fetchUrl.indexOf("\/") var index = this.fetchUrl.indexOf("\/")
if(this.fetchUrl.substr(0,index)=='psw'){ if (this.fetchUrl.substr(0, index) == 'psw') {
this.showtype=1 this.showtype = 1
var obj=document.getElementById('viewer') var obj = document.getElementById('viewer')
if(obj!=null){ if (obj != null) {
obj.innerHTML='' obj.innerHTML = ''
} }
window.setTimeout(()=>{ window.setTimeout(() => {
this.viewer = new Viewer({ this.viewer = new Viewer({
container: document.querySelector('#viewer'), container: document.querySelector('#viewer'),
panorama:'/api/Objects/PlanPlatform/'+ this.fetchUrl, panorama: '/api/Objects/PlanPlatform/' + this.fetchUrl,
}); });
}) })
}else{ } else {
this.lookWord() this.lookWord()
} }
}else{ } else {
this.organizationName=item.organizationName this.organizationName = item.organizationName
this.planData = data this.planData = data
this.handleData() this.handleData()
return return
//this.src=`/planAudit/planpass?id=${data.companyId}&companyName=${data.companyName}&auditPlanId=${data.id}&auditStatus=${data.auditStatus}&planType=1` //this.src=`/planAudit/planpass?id=${data.companyId}&companyName=${data.companyName}&auditPlanId=${data.id}&auditStatus=${data.auditStatus}&planType=1`
//this.iframeSrc=this.sanitizer.bypassSecurityTrustResourceUrl(this.src); //this.iframeSrc=this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
//window.open(`/planAudit/planpass?id=${data.companyId}&companyName=${data.companyName}&auditPlanId=${data.id}&auditStatus=${data.auditStatus}&planType=1`) //window.open(`/planAudit/planpass?id=${data.companyId}&companyName=${data.companyName}&auditPlanId=${data.id}&auditStatus=${data.auditStatus}&planType=1`)
} }
}) })
} }
if(e.checked){ if (e.checked) {
this.shenheTable.push(item) this.shenheTable.push(item)
} }
else{ else {
for(var i=0;i<this.shenheTable.length;i++ ){ for (var i = 0; i < this.shenheTable.length; i++) {
if(this.shenheTable[i].id==item.id){ if (this.shenheTable[i].id == item.id) {
this.shenheTable.splice(i,1) this.shenheTable.splice(i, 1)
} }
} }
} }
this.radioid=item.itemId this.radioid = item.itemId
/* this.chuorzhong=item.verifyState /* this.chuorzhong=item.verifyState
this.radioid=item.itemId */ this.radioid=item.itemId */
} }
//毕升 //毕升
lookWord(){ lookWord() {
this.showtype=0 this.showtype = 0
let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + this.fetchUrl); let src
let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); let suffix = this.fetchUrl.split('.')[this.fetchUrl.split('.').length - 1].toLowerCase()
let jwt = sessionStorage.getItem("token"); if (suffix == 'docx' || suffix == 'doc') {
let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); let arr = this.fetchUrl.split('.')
let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); arr[arr.length - 1] = 'pdf'
let identityJsonparse=JSON.parse(identityJson) src = `/api/Objects/PlanPlatform/` + arr.join('.')
let filename:string }else if (suffix == 'pdf') {
this.http.get(`/api/ObjectMetadata/PlanPlatform/${this.fetchUrl}`).subscribe((data:any)=>{ src = `/api/Objects/PlanPlatform/` + this.fetchUrl
filename=data.fileName }
let json={ this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(src);
doc: {
docId: docId,
title: filename,
//title: filename,
fetchUrl: `http://172.18.0.1:8000/api/Objects/PlanPlatform/`+this.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);
this.src=`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`
this.iframeSrc=this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
//window.open(`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`)
})
} }
//查看按钮跳转 //查看按钮跳转
lookNew(){ lookNew() {
window.open(this.src) window.open(this.src)
} }
@ -274,37 +252,37 @@ export class PlanRecordComponent implements OnInit {
thirdPartyURL thirdPartyURL
planType planType
twoOrthree twoOrthree
handleData () { handleData() {
this.compantData={name:'',buildingTypes:[],address:''} this.compantData = { name: '', buildingTypes: [], address: '' }
this.planType = this.planData.planMode this.planType = this.planData.planMode
let data = this.planData let data = this.planData
// console.log(data) // console.log(data)
if(data.planType==1){ if (data.planType == 1) {
this.twoOrthree=2 this.twoOrthree = 2
}else if(data.planType==2){ } else if (data.planType == 2) {
this.twoOrthree=3 this.twoOrthree = 3
} }
if (this.planData.planMode==0) { //预案planMode=0时, 查看word if (this.planData.planMode == 0) { //预案planMode=0时, 查看word
//this.lookWord() //this.lookWord()
} else if (this.planData.planMode==1) { //预案planMode=1时, 解析文档 } else if (this.planData.planMode == 1) { //预案planMode=1时, 解析文档
} else if (this.planData.planMode==2) { //预案planMode=2时, 跳查看页面组件 } else if (this.planData.planMode == 2) { //预案planMode=2时, 跳查看页面组件
this.showtype=2 this.showtype = 2
this.http.get(`/api/Plans/${data.companyId}`).subscribe((data:any)=>{ this.http.get(`/api/Plans/${data.companyId}`).subscribe((data: any) => {
data && data.company? this.compantData = data.company : null data && data.company ? this.compantData = data.company : null
}) })
sessionStorage.setItem("buildingTypeId", this.compantData.buildingTypes.length? this.compantData.buildingTypes[0].id: undefined); sessionStorage.setItem("buildingTypeId", this.compantData.buildingTypes.length ? this.compantData.buildingTypes[0].id : undefined);
sessionStorage.setItem("companyId",this.companyId); sessionStorage.setItem("companyId", this.companyId);
sessionStorage.setItem("planId",this.itemid); sessionStorage.setItem("planId", this.itemid);
sessionStorage.setItem("editable",'0'); sessionStorage.setItem("editable", '0');
sessionStorage.setItem("planName",data.name) sessionStorage.setItem("planName", data.name)
let companyId = sessionStorage.getItem("companyId") let companyId = sessionStorage.getItem("companyId")
this.thirdPartyURL=this.sanitizer.bypassSecurityTrustResourceUrl(`/keyUnit/viewunitinfoplans?id=${companyId}`); this.thirdPartyURL = this.sanitizer.bypassSecurityTrustResourceUrl(`/keyUnit/viewunitinfoplans?id=${companyId}`);
//window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`) //window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`)
} else if (this.planData.planMode==3) { //预案planMode=3时, 第三方网址' } else if (this.planData.planMode == 3) { //预案planMode=3时, 第三方网址'
this.showtype=2 this.showtype = 2
this.http.get(`/api/Plans/${data.companyId}`).subscribe((data:any)=>{ this.http.get(`/api/Plans/${data.companyId}`).subscribe((data: any) => {
data && data.company? this.compantData = data.company : null data && data.company ? this.compantData = data.company : null
}) })
//this.dialog.open(show3D,{width:'1350px',height:'700px',data:{url:data.url}}); //打开图片弹窗 //this.dialog.open(show3D,{width:'1350px',height:'700px',data:{url:data.url}}); //打开图片弹窗
this.thirdPartyURL = this.sanitizer.bypassSecurityTrustResourceUrl(data.url) this.thirdPartyURL = this.sanitizer.bypassSecurityTrustResourceUrl(data.url)
@ -313,8 +291,8 @@ export class PlanRecordComponent implements OnInit {
} }
//打开三维预案弹窗 //打开三维预案弹窗
oopen3Dshow(){ oopen3Dshow() {
this.dialog.open(recordshow3D,{width:'1650px',height:'850px',data:{url:this.thirdPartyURL,twoOrthree:this.twoOrthree}}); this.dialog.open(recordshow3D, { width: '1650px', height: '850px', data: { url: this.thirdPartyURL, twoOrthree: this.twoOrthree } });
} }
} }
@ -324,11 +302,11 @@ export class PlanRecordComponent implements OnInit {
templateUrl: './show3D.html', templateUrl: './show3D.html',
styleUrls: ['./plan-record.component.scss'] styleUrls: ['./plan-record.component.scss']
}) })
export class recordshow3D{ export class recordshow3D {
constructor(private sanitizer: DomSanitizer,public dialogRef: MatDialogRef<recordshow3D>,@Inject(MAT_DIALOG_DATA) public data,public dialog: MatDialog) {} constructor(private sanitizer: DomSanitizer, public dialogRef: MatDialogRef<recordshow3D>, @Inject(MAT_DIALOG_DATA) public data, public dialog: MatDialog) { }
ngOnInit(): void { ngOnInit(): void {
// console.log(this.data) // console.log(this.data)
this.threedUrl=this.sanitizer.bypassSecurityTrustResourceUrl(this.data.url.changingThisBreaksApplicationSecurity) this.threedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(this.data.url.changingThisBreaksApplicationSecurity)
} }
threedUrl threedUrl
} }

62
src/app/plan-audit/wait-examineer/wait-examineer.component.ts

@ -14,7 +14,7 @@ import { HttpClient } from '@angular/common/http'
declare var CryptoJS declare var CryptoJS
import { DomSanitizer } from '@angular/platform-browser'; import { DomSanitizer } from '@angular/platform-browser';
import { Viewer as photoViewer } from 'photo-sphere-viewer'; import { Viewer as photoViewer } from 'photo-sphere-viewer';
import Viewer from 'viewerjs'; import Viewer from 'viewerjs';
declare var echarts: any; declare var echarts: any;
@ -61,7 +61,7 @@ export class WaitExamineerComponent implements OnInit {
] ]
} }
this.getAlltabledate() this.getAlltabledate()
this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.src); this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
} }
planTypeIndex //平面图类型 选择是总平面图还是层平面图 planTypeIndex //平面图类型 选择是总平面图还是层平面图
@ -133,9 +133,9 @@ export class WaitExamineerComponent implements OnInit {
this.getAlltabledate() this.getAlltabledate()
} }
lookImg(imgUrl){ lookImg(imgUrl) {
console.log(imgUrl) console.log(imgUrl)
let dom = document.getElementById(`viewerjs`) let dom = document.getElementById(`viewerjs`)
let pObjs = dom.childNodes; let pObjs = dom.childNodes;
let node = document.createElement("img") let node = document.createElement("img")
node.style.display = "none"; node.style.display = "none";
@ -144,7 +144,7 @@ export class WaitExamineerComponent implements OnInit {
dom.appendChild(node) dom.appendChild(node)
setTimeout(() => { setTimeout(() => {
let viewer = new Viewer(document.getElementById(`viewerjs`), { let viewer = new Viewer(document.getElementById(`viewerjs`), {
hidden:()=>{ hidden: () => {
dom.removeChild(pObjs[0]); dom.removeChild(pObjs[0]);
viewer.destroy(); viewer.destroy();
} }
@ -169,15 +169,15 @@ export class WaitExamineerComponent implements OnInit {
this.selectedItem = item this.selectedItem = item
console.log(item) console.log(item)
// console.log('当前选择的信息',JSON.parse(this.selectedItem.differentContent) ) // console.log('当前选择的信息',JSON.parse(this.selectedItem.differentContent) )
if(item.contentType == 11 && this.selectedItem.differentContent){ if (item.contentType == 11 && this.selectedItem.differentContent) {
let differentContent = JSON.parse(this.selectedItem.differentContent) let differentContent = JSON.parse(this.selectedItem.differentContent)
// 单位信息 // 单位信息
this.differentContentOfUnitInfo = differentContent.filter(item => item.propertyName == 'basicInfo') this.differentContentOfUnitInfo = differentContent.filter(item => item.propertyName == 'basicInfo')
// 实景图 // 实景图
this.differentContentOfPicture = differentContent.filter(item => item.propertyName == 'realityImageGroups') this.differentContentOfPicture = differentContent.filter(item => item.propertyName == 'realityImageGroups')
//建筑信息 //建筑信息
this.differentContentOfBuildingsInfo = JSON.parse(JSON.stringify(differentContent.filter(item => item.propertyName == 'buildings')[0])) this.differentContentOfBuildingsInfo = JSON.parse(JSON.stringify(differentContent.filter(item => item.propertyName == 'buildings')[0]))
this.differentContentOfBuildingsInfo.childrens.forEach(element => { this.differentContentOfBuildingsInfo.childrens.forEach(element => {
@ -196,7 +196,7 @@ export class WaitExamineerComponent implements OnInit {
}); });
} }
// console.log('功能分区', this.differentContentOfFunction) // console.log('功能分区', this.differentContentOfFunction)
@ -303,38 +303,16 @@ export class WaitExamineerComponent implements OnInit {
//毕升 //毕升
lookWord() { lookWord() {
this.showtype = 0 this.showtype = 0
let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + this.fetchUrl); let src
let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); let suffix = this.fetchUrl.split('.')[this.fetchUrl.split('.').length - 1].toLowerCase()
let jwt = sessionStorage.getItem("token"); if (suffix == 'docx' || suffix == 'doc') {
let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); let arr = this.fetchUrl.split('.')
let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); arr[arr.length - 1] = 'pdf'
let identityJsonparse=JSON.parse(identityJson) src = `/api/Objects/PlanPlatform/` + arr.join('.')
let filename:string }else if (suffix == 'pdf') {
this.http.get(`/api/ObjectMetadata/PlanPlatform/${this.fetchUrl}`).subscribe((data:any)=>{ src = `/api/Objects/PlanPlatform/` + this.fetchUrl
filename=data.fileName }
let json={ this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(src);
doc: {
docId: docId,
title: filename,
//title: filename,
fetchUrl: `http://172.18.0.1:8000/api/Objects/PlanPlatform/`+this.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);
this.src=`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`
this.iframeSrc=this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
//window.open(`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`)
})
} }
//查看按钮跳转 //查看按钮跳转
lookNew() { lookNew() {

2
src/app/plan-management/entry-plan-look/entry-plan-look.component.html

@ -80,7 +80,7 @@
<span (click)="changeName(element)" *ngIf="element.auditStatus==8">改名</span> <span (click)="changeName(element)" *ngIf="element.auditStatus==8">改名</span>
<span (click)="editPlan(element)" <span (click)="editPlan(element)"
[ngClass]="{'grey': !(element.auditStatus!='16' && element.auditStatus != '1')}">编辑</span> [ngClass]="{'grey': !(element.auditStatus!='16' && element.auditStatus != '1')}">编辑</span>
<span (click)="lookPlan(element)" *ngIf="element.planType == 2">查看</span> <span (click)="lookPlan(element)" *ngIf="element.planType == 2 || element.planType == 16">查看</span>
<span (click)="readFile(element)" <span (click)="readFile(element)"
[ngClass]="{'grey': element.planMode == '2' || element.planMode == '3'}">下载</span> [ngClass]="{'grey': element.planMode == '2' || element.planMode == '3'}">下载</span>
<span (click)="deletePlan(element)" *ngIf="element.auditStatus==8">删除</span> <span (click)="deletePlan(element)" *ngIf="element.auditStatus==8">删除</span>

136
src/app/plan-management/entry-plan-look/entry-plan-look.component.ts

@ -106,8 +106,8 @@ export class EntryPlanLookComponent implements OnInit {
} }
//查看预案 //查看预案
lookPlan(e) { lookPlan(e) {
console.log(e)
if (e.planType == 16 || e.planType == 4 || e.planType == 8) { if (e.planType == 16 || e.planType == 4 || e.planType == 8) {
// console.log(e.attachmentUrls)
var index = e.attachmentUrls[0].indexOf("\/") var index = e.attachmentUrls[0].indexOf("\/")
if (e.attachmentUrls[0].substr(0, index) == 'psw') { if (e.attachmentUrls[0].substr(0, index) == 'psw') {
const dialogRef = this.dialog.open(PsViewer, { const dialogRef = this.dialog.open(PsViewer, {
@ -121,54 +121,27 @@ export class EntryPlanLookComponent implements OnInit {
data: data.attachmentUrls, data: data.attachmentUrls,
}); });
dialogRef.afterClosed().subscribe(); dialogRef.afterClosed().subscribe();
} } else {
else /* if(e.attachmentUrls[0].substr(e.attachmentUrls[0].length-4,e.attachmentUrls[0].length-1)=='docx'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='pdf'
||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='doc'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='DOC'
||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='txt'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='JPG') */ {
let filename: string
let fetchUrl = e.attachmentUrls[0] let fetchUrl = e.attachmentUrls[0]
let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl); if (fetchUrl) {
let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase()
let jwt = sessionStorage.getItem("token"); if (suffix == 'docx' || suffix == 'doc') {
let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); let arr = fetchUrl.split('.')
let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); arr[arr.length - 1] = 'pdf'
let identityJsonparse = JSON.parse(identityJson) window.open(`/api/Objects/PlanPlatform/` + arr.join('.'))
this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data: any) => { } else if (suffix == 'pdf') {
filename = data.fileName window.open(`/api/Objects/PlanPlatform/` + fetchUrl)
let json = { } else {
doc: { let config = new MatSnackBarConfig();
docId: docId, config.verticalPosition = 'top';
title: filename, config.duration = 3000
fetchUrl: `http://172.18.0.1:8000/api/Objects/PlanPlatform/` + fetchUrl, this.snackBar.open('该文件类型暂不支持在线查看', '确定', config);
},
user: {
uid: identityJsonparse.sub,
nickName: identityJsonparse.name,
avatar: "",
privilege: e.auditStatus != '1' && e.auditStatus != '16' ? [
'FILE_READ', 'FILE_WRITE', 'FILE_DOWNLOAD', 'FILE_PRINT'
] : [
'FILE_READ', 'FILE_DOWNLOAD', 'FILE_PRINT'
],
},
} }
var stringjson = JSON.stringify(json) } else {
var wordArray = CryptoJS.enc.Utf8.parse(stringjson); window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}`)
var base64 = CryptoJS.enc.Base64.stringify(wordArray); }
window.open(`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`)
})
} }
} }
/* if(e.planType == 4){
var index=e.attachmentUrls[0].indexOf("\/")
if(e.attachmentUrls[0].substr(0,index)=='psw'){
const dialogRef = this.dialog.open(PsViewer, {
width: '1500px',
height:'800px',
data: e.attachmentUrls[0]
});
}
} */
if (e.planType == 1) { //如果是在线编辑 if (e.planType == 1) { //如果是在线编辑
let id = e.id let id = e.id
sessionStorage.setItem("planId", id) sessionStorage.setItem("planId", id)
@ -193,7 +166,7 @@ export class EntryPlanLookComponent implements OnInit {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
if(e.auditStatus==8){ if (e.auditStatus == 8) {
if (e.planType == 1) { //如果是在线编辑 if (e.planType == 1) { //如果是在线编辑
let id = e.id let id = e.id
sessionStorage.setItem("planId", id) sessionStorage.setItem("planId", id)
@ -206,7 +179,6 @@ export class EntryPlanLookComponent implements OnInit {
} }
else if (e.planType == 16) { else if (e.planType == 16) {
if (e.attachmentUrls == null) { if (e.attachmentUrls == null) {
console.log(this.compantData)
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}`) window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}`)
} }
else { else {
@ -231,49 +203,49 @@ export class EntryPlanLookComponent implements OnInit {
this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config);
} }
}else{ } else {
let isTrue = confirm('编辑后审核状态会成为未审核状态,您确定要编辑吗') let isTrue = confirm('编辑后审核状态会成为未审核状态,您确定要编辑吗')
if (isTrue) { if (isTrue) {
if (e.planType == 1) { //如果是在线编辑 if (e.planType == 1) { //如果是在线编辑
let id = e.id let id = e.id
sessionStorage.setItem("planId", id) sessionStorage.setItem("planId", id)
sessionStorage.setItem("companyId", this.companyId) sessionStorage.setItem("companyId", this.companyId)
sessionStorage.setItem("buildingTypeId", this.unittypeId) sessionStorage.setItem("buildingTypeId", this.unittypeId)
sessionStorage.setItem("editable", "1") sessionStorage.setItem("editable", "1")
sessionStorage.setItem("planName", e.name) sessionStorage.setItem("planName", e.name)
let companyId = sessionStorage.getItem("companyId") let companyId = sessionStorage.getItem("companyId")
window.open(`/keyUnit/editunitinfo?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`); window.open(`/keyUnit/editunitinfo?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`);
}
else if (e.planType == 16) {
if (e.attachmentUrls == null) {
console.log(this.compantData)
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}`)
} }
else { else if (e.planType == 16) {
let body = {}; if (e.attachmentUrls == null) {
let resetAudit = true console.log(this.compantData)
let headers = new HttpHeaders({ window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}`)
'Content-Type': 'text/json' }
}); else {
let options = { let body = {};
headers let resetAudit = true
}; let headers = new HttpHeaders({
this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => { 'Content-Type': 'text/json'
this.getAllPlanComponents() });
this.lookPlan(e) let options = {
}/* ,err => { headers
};
this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => {
this.getAllPlanComponents()
this.lookPlan(e)
}/* ,err => {
this.snackBar.open(err,'确定',config); this.snackBar.open(err,'确定',config);
} */) } */)
} }
} }
else { else {
this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config);
}
} }
} }
}
} }
allPlanComponents: any //所有预案组件 allPlanComponents: any //所有预案组件

698
src/app/plan-management/meet-plan/meet-plan.component.ts

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

673
src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts

@ -13,7 +13,7 @@ import { MatPaginator } from '@angular/material/paginator';
import { FlatTreeControl } from '@angular/cdk/tree'; import { FlatTreeControl } from '@angular/cdk/tree';
import { FormControl } from '@angular/forms'; import { FormControl } from '@angular/forms';
import { Router,ActivatedRoute } from '@angular/router' import { Router, ActivatedRoute } from '@angular/router'
import { PageEvent } from '@angular/material/paginator'; import { PageEvent } from '@angular/material/paginator';
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
@ -30,72 +30,72 @@ declare var CryptoJS
}) })
export class OnetwoEntryPlanComponent implements OnInit { export class OnetwoEntryPlanComponent 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 { ngOnInit(): void {
if(window.matchMedia("(max-width: 1400px)").matches){ if (window.matchMedia("(max-width: 1400px)").matches) {
this.pcMore=false this.pcMore = false
this.padMore=true this.padMore = true
this.pcfind=false this.pcfind = false
this.padjt=true this.padjt = true
}else{ } else {
this.pcfind=true this.pcfind = true
this.pcMore=true this.pcMore = true
this.padMore=false this.padMore = false
this.padjt=false this.padjt = false
} }
this.levels = sessionStorage.getItem("level"); this.levels = sessionStorage.getItem("level");
if(this.levels == "0"){//如果是总队 if (this.levels == "0") {//如果是总队
this.preparelevels = [ this.preparelevels = [
{name:"总队",value:"1"}, { name: "总队", value: "1" },
{name:"支队",value:"2"}, { name: "支队", value: "2" },
{name:"大队",value:"4"}, { name: "大队", value: "4" },
{name:"中队",value:"8"} { name: "中队", value: "8" }
] ]
} }
if(this.levels == "1"){//如果是支队 if (this.levels == "1") {//如果是支队
this.preparelevels = [ this.preparelevels = [
{name:"支队",value:"2"}, { name: "支队", value: "2" },
{name:"大队",value:"4"}, { name: "大队", value: "4" },
{name:"中队",value:"8"} { name: "中队", value: "8" }
] ]
} }
if(this.levels == "2"){//如果是大队 if (this.levels == "2") {//如果是大队
this.preparelevels = [ this.preparelevels = [
{name:"大队",value:"4"}, { name: "大队", value: "4" },
{name:"中队",value:"8"} { name: "中队", value: "8" }
] ]
} }
if(this.levels == "3"){//如果是中队 if (this.levels == "3") {//如果是中队
this.preparelevels = [ this.preparelevels = [
{name:"中队",value:"8"} { name: "中队", value: "8" }
] ]
} }
this.url=window.location.href.substring(window.location.href.length-1,window.location.href.length) this.url = window.location.href.substring(window.location.href.length - 1, window.location.href.length)
this.getAlltabledate() this.getAlltabledate()
} }
pcMore//pc更多 pcMore//pc更多
pcput=false//pc收起 pcput = false//pc收起
pcfind//pc查询 pcfind//pc查询
padjt=false padjt = false
padMore=true//pad收缩控制 padMore = true//pad收缩控制
padput=false//pad收起按钮 padput = false//pad收起按钮
imgsrcopen="../../../assets/images/routdown2.png" imgsrcopen = "../../../assets/images/routdown2.png"
imgsrcdown="../../../assets/images/routup2.png" imgsrcdown = "../../../assets/images/routup2.png"
pcInfo(){ pcInfo() {
this.pcMore=!this.pcMore this.pcMore = !this.pcMore
this.pcput=!this.pcput this.pcput = !this.pcput
} }
padInfo(){ padInfo() {
this.padMore=!this.padMore this.padMore = !this.padMore
this.padput=!this.padput this.padput = !this.padput
} }
levels levels
url url
preparelevels:any preparelevels: any
plcheck:boolean //编制级别勾选框 plcheck: boolean //编制级别勾选框
displayedColumns: string[] = ['unitname','level','addname','addtime', 'plantype', 'passstate','isopen','projectlevel','operation']; displayedColumns: string[] = ['unitname', 'level', 'addname', 'addtime', 'plantype', 'passstate', 'isopen', 'projectlevel', 'operation'];
tabledataSource tabledataSource
unitname//预案名称 unitname//预案名称
level//预案级别 level//预案级别
@ -107,96 +107,96 @@ export class OnetwoEntryPlanComponent implements OnInit {
projectlevel//编制级别 projectlevel//编制级别
typePlan//新预案类型 typePlan//新预案类型
//分页 //分页
@ViewChild(MatPaginator, {static: true}) @ViewChild(MatPaginator, { static: true })
pageEvent: PageEvent; pageEvent: PageEvent;
paginator: MatPaginator; paginator: MatPaginator;
length:any; //共多少条数据 length: any; //共多少条数据
pageSize:any; //每页条数 pageSize: any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数 pageSizeOptions: number[] = [10] //设置每页条数
PageNumber:any; //第几页 PageNumber: any; //第几页
//获取表格数据 //获取表格数据
getAlltabledate(){ getAlltabledate() {
let reservePlanType let reservePlanType
this.reservePlanType ? reservePlanType = JSON.parse(JSON.stringify(this.reservePlanType)) : 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("|")) reservePlanType = eval(this.reservePlanType.join("|"))
} }
let paramsdata:any = { let paramsdata: any = {
Name:this.unitname||'', Name: this.unitname || '',
planCategories:this.url=='2'?2:1, planCategories: this.url == '2' ? 2 : 1,
//PlanType:reservePlanType||'', //PlanType:reservePlanType||'',
DisasterType:this.typePlan||'', DisasterType: this.typePlan || '',
CreatorName:this.addname||'', CreatorName: this.addname || '',
AuditStatus:this.unitstate|| '', AuditStatus: this.unitstate || '',
CreationTimeRangeStart:this.addtime||'', CreationTimeRangeStart: this.addtime || '',
CreationTimeRangeEnd:this.endtime||'', CreationTimeRangeEnd: this.endtime || '',
PlanLevel:this.projectlevel||'', PlanLevel: this.projectlevel || '',
HasChildrenPlanLevel:this.plcheck||'', HasChildrenPlanLevel: this.plcheck || '',
PageNumber: this.PageNumber || '1', 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.length = data.totalCount
this.tabledataSource = data.items this.tabledataSource = data.items
}) })
} }
//分页事件 //分页事件
changePage(e){ changePage(e) {
this.PageNumber = e.pageIndex+1 this.PageNumber = e.pageIndex + 1
this.getAlltabledate() this.getAlltabledate()
} }
//重置 //重置
reset(){ reset() {
this.typePlan='' this.typePlan = ''
this.unitname='' this.unitname = ''
this.level='' this.level = ''
this.addname='' this.addname = ''
this.addtime='' this.addtime = ''
this.endtime='' this.endtime = ''
this.reservePlanType='' this.reservePlanType = ''
this.unitstate='' this.unitstate = ''
this.projectlevel='' this.projectlevel = ''
this.plcheck=false this.plcheck = false
this.getAlltabledate() this.getAlltabledate()
} }
//查询 //查询
onSubmit (value) { onSubmit(value) {
//console.log(value) //console.log(value)
if(this.endtime!=undefined&&this.addtime>this.endtime){ if (this.endtime != undefined && this.addtime > this.endtime) {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
this.snackBar.open('开始时间不能大于结束时间!','确定',config); this.snackBar.open('开始时间不能大于结束时间!', '确定', config);
}else{ } else {
this.PageNumber = 1 this.PageNumber = 1
this.pageEvent.pageIndex = 0 this.pageEvent.pageIndex = 0
this.getAlltabledate(); this.getAlltabledate();
} }
} }
//删除预案 //删除预案
deletePlan(id){ deletePlan(id) {
let isTrue = confirm('您确定要删除吗') let isTrue = confirm('您确定要删除吗')
if(isTrue){ if (isTrue) {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
this.http.delete(`/api/PlanComponentsMajor/${id}`).subscribe(data=>{ this.http.delete(`/api/PlanComponentsMajor/${id}`).subscribe(data => {
this.snackBar.open('删除成功!','确定',config); this.snackBar.open('删除成功!', '确定', config);
this.getAlltabledate() this.getAlltabledate()
},err => { }, err => {
this.snackBar.open(err,'确定',config); this.snackBar.open(err, '确定', config);
}) })
} }
} }
//提交审核 //提交审核
submitAudit(element){ submitAudit(element) {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
@ -206,69 +206,49 @@ export class OnetwoEntryPlanComponent implements OnInit {
config.duration = 3000 config.duration = 3000
this.snackBar.open('审核退回的预案需要修改后方可再次提交审核!','确定',config); this.snackBar.open('审核退回的预案需要修改后方可再次提交审核!','确定',config);
} */ } */
this.http.put(`/api/PlanComponentsMajor/${element.id}/Commit`,"").subscribe(data=>{ this.http.put(`/api/PlanComponentsMajor/${element.id}/Commit`, "").subscribe(data => {
this.getAlltabledate() this.getAlltabledate()
},err => { }, err => {
this.snackBar.open(err,'确定',config); this.snackBar.open(err, '确定', config);
}) })
} }
//撤销审核 //撤销审核
cancelAudit(element){ cancelAudit(element) {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 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() this.getAlltabledate()
},err => { }, err => {
this.snackBar.open(err,'确定',config); this.snackBar.open(err, '确定', config);
}) })
} }
//查看预案 //查看预案
openPlan(element){ openPlan(element) {
let filename:string
let fetchUrl = element.attachmentUrls[0] let fetchUrl = element.attachmentUrls[0]
let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl); let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase()
let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); if (suffix == 'docx' || suffix == 'doc') {
let jwt = sessionStorage.getItem("token"); let arr = fetchUrl.split('.')
let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); arr[arr.length - 1] = 'pdf'
let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); window.open(`/api/Objects/PlanPlatform/` + arr.join('.'))
let identityJsonparse=JSON.parse(identityJson) }else if (suffix == 'pdf') {
this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{ window.open(`/api/Objects/PlanPlatform/` + element.attachmentUrls[0])
filename=data.fileName }else{
let json={ let config = new MatSnackBarConfig();
doc: { config.verticalPosition = 'top';
docId: docId, config.duration = 3000
title: filename, this.snackBar.open('该文件类型暂不支持在线查看', '确定', config);
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}`)
})
} }
//新增预案弹窗 //新增预案弹窗
addunit(){ addunit() {
const dialogRef = this.dialog.open(newunitComponent, { const dialogRef = this.dialog.open(newunitComponent, {
width: '340px', width: '340px',
height:'410px', height: '410px',
disableClose:true disableClose: true
//data: paperDataInfo //data: paperDataInfo
}); });
dialogRef.afterClosed().subscribe(result => { dialogRef.afterClosed().subscribe(result => {
@ -278,66 +258,66 @@ export class OnetwoEntryPlanComponent implements OnInit {
} }
//审核结果 //审核结果
auditResult(element){ auditResult(element) {
// console.log(element) // console.log(element)
const dialogRef = this.dialog.open(onetwoAuditResult, { const dialogRef = this.dialog.open(onetwoAuditResult, {
width:"400px", width: "400px",
//height:"300px", //height:"300px",
data: {element:element} data: { element: element }
}); });
} }
//下载↓ //下载↓
selectDownloadFile:any; //选择下载的文件 selectDownloadFile: any; //选择下载的文件
download:any; //下载文件元数据 download: any; //下载文件元数据
downloadisLoading:boolean = false; //进度条loading加载 downloadisLoading: boolean = false; //进度条loading加载
downloadProgress:number=0; //进度条进度 downloadProgress: number = 0; //进度条进度
downloadFileName:any downloadFileName: any
fileUrls:any //当前预案附件地址 fileUrls: any //当前预案附件地址
fileDatas:any = [] fileDatas: any = []
selectedFileIndex : any = 0 selectedFileIndex: any = 0
selectedFileData : any selectedFileData: any
uploadFileLonging:any uploadFileLonging: any
//读取下载文件信息 //读取下载文件信息
readFile (element) { readFile(element) {
this.uploadFileLonging = element this.uploadFileLonging = element
element.attachmentUrls.forEach(item=>{ element.attachmentUrls.forEach(item => {
this.http.get('/api/ObjectMetadata/PlanPlatform/'+item).subscribe((data:any)=>{ this.http.get('/api/ObjectMetadata/PlanPlatform/' + item).subscribe((data: any) => {
data.filePige = (data.fileLength / (1024*1024)).toFixed(2) data.filePige = (data.fileLength / (1024 * 1024)).toFixed(2)
//console.log(data) //console.log(data)
this.download = data this.download = data
this.downloadFile() this.downloadFile()
}) })
}) })
} }
//初始化下载 //初始化下载
downloadFile () { downloadFile() {
this.downloadProgress = 0 this.downloadProgress = 0
let file = this.download let file = this.download
let fileSize = file.fileLength//下载文件的总大小 let fileSize = file.fileLength//下载文件的总大小
let shardSize = 10 * 1024 * 1024 //文件大小是否大于10MB let shardSize = 10 * 1024 * 1024 //文件大小是否大于10MB
if (file && fileSize<=shardSize) { //<=10MB时直接下载 if (file && fileSize <= shardSize) { //<=10MB时直接下载
this.downloadisLoading = true this.downloadisLoading = true
// this.setFileLoading() // 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 url = window.URL.createObjectURL(new Blob([data])); //createObjectURL创建一个下载Blob的url地址
let link = document.createElement("a"); let link = document.createElement("a");
link.style.display = "none"; link.style.display = "none";
link.href = url; link.href = url;
let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ; let suffix = file.objectName.substring(file.objectName.lastIndexOf(".") + 1, file.objectName.length);
link.setAttribute("download", file.fileName + "-" +this.uploadFileLonging.name + "." + suffix); link.setAttribute("download", file.fileName + "-" + this.uploadFileLonging.name + "." + suffix);
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
this.downloadisLoading = false this.downloadisLoading = false
// this.setFileLoading() // this.setFileLoading()
}) })
} else if (file && fileSize > shardSize) { //>10MB时分块下载 } else if (file && fileSize > shardSize) { //>10MB时分块下载
this.blockingDownload() //分段下载 this.blockingDownload() //分段下载
this.downloadisLoading = true this.downloadisLoading = true
// this.setFileLoading() // this.setFileLoading()
@ -346,31 +326,32 @@ export class OnetwoEntryPlanComponent implements OnInit {
} }
//分段下载并合并 //分段下载并合并
async blockingDownload () { async blockingDownload() {
let file = this.download let file = this.download
let fileSize = file.fileLength //下载文件的总大小 let fileSize = file.fileLength //下载文件的总大小
let shardSize = 3 * 1024 * 1024 //3MB一个分片 let shardSize = 3 * 1024 * 1024 //3MB一个分片
let allSlice = Math.ceil(fileSize / shardSize) //总文件/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 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)=>{ let result = await new Promise((result, reject) => {
this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{headers:{'range':`bytes= ${start}-${end}`},responseType:'blob'}).subscribe(data=>{ this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`, { headers: { 'range': `bytes= ${start}-${end}` }, responseType: 'blob' }).subscribe(data => {
result(data) }) result(data)
})
}) })
allFile.push(result) allFile.push(result)
this.downloadProgress = Number((i/allSlice).toFixed(2))*100 this.downloadProgress = Number((i / allSlice).toFixed(2)) * 100
if (allFile.length === allSlice) { //合并文件输出给浏览器 if (allFile.length === allSlice) { //合并文件输出给浏览器
let url = window.URL.createObjectURL(new Blob(allFile)); //createObjectURL创建一个下载Blob的url地址 let url = window.URL.createObjectURL(new Blob(allFile)); //createObjectURL创建一个下载Blob的url地址
let link = document.createElement("a"); let link = document.createElement("a");
link.style.display = "none"; link.style.display = "none";
link.href = url; link.href = url;
let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ; let suffix = file.objectName.substring(file.objectName.lastIndexOf(".") + 1, file.objectName.length);
link.setAttribute("download", file.fileName + "-" +this.uploadFileLonging.name + "." + suffix); link.setAttribute("download", file.fileName + "-" + this.uploadFileLonging.name + "." + suffix);
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
// this.downloadProgress = 0 // this.downloadProgress = 0
@ -383,14 +364,14 @@ export class OnetwoEntryPlanComponent implements OnInit {
} }
//取消分块下载 //取消分块下载
cancelDowload () { cancelDowload() {
} }
//查看预案按钮跳转 //查看预案按钮跳转
routerTo(element){ routerTo(element) {
sessionStorage.setItem("companyName",element.unitname) 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}`); 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}`);
} }
} }
@ -401,10 +382,10 @@ export class OnetwoEntryPlanComponent implements OnInit {
templateUrl: './newunit.html', templateUrl: './newunit.html',
styleUrls: ['./newunit.scss'] styleUrls: ['./newunit.scss']
}) })
export class newunitComponent{ export class newunitComponent {
constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef<newunitComponent>,@Inject(MAT_DIALOG_DATA) public data: any) {} constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef<newunitComponent>, @Inject(MAT_DIALOG_DATA) public data: any) { }
ngOnInit(): void { ngOnInit(): void {
this.url=window.location.href.substring(window.location.href.length-1,window.location.href.length) this.url = window.location.href.substring(window.location.href.length - 1, window.location.href.length)
} }
url url
unitname//预案名称 unitname//预案名称
@ -416,180 +397,182 @@ export class newunitComponent{
projectlevel//编制级别 projectlevel//编制级别
//上传文件↓ //上传文件↓
file:any; //上传的文件 file: any; //上传的文件
fileName:any; //上传文件name fileName: any; //上传文件name
uploadisLoading:boolean = false; //进度条loading加载 uploadisLoading: boolean = false; //进度条loading加载
uploadProgress:number=0; //进度条进度 uploadProgress: number = 0; //进度条进度
objectName:any; //上传对象名 objectName: any; //上传对象名
uploadId:any; //上传分块上传事件编号 uploadId: any; //上传分块上传事件编号
uploadover:any = false //上传完成之后提示 uploadover: any = false //上传完成之后提示
selectedPLanType:any//所选预案类型 selectedPLanType: any//所选预案类型
selectedPLanName:any//所选预案名称 selectedPLanName: any//所选预案名称
localup:boolean = false //本地上传 localup: boolean = false //本地上传
defaultisshow = '0' //默认显示上传input框 defaultisshow = '0' //默认显示上传input框
//上传 //上传
upload(){ upload() {
document.getElementById('up').click() document.getElementById('up').click()
} }
//上传文件input //上传文件input
filechange(e){ filechange(e) {
this.file = e.target.files[0] || null //上传的文件 this.file = e.target.files[0] || null //上传的文件
} }
//上传文件 //上传文件
startUploading (planType) { startUploading(planType) {
let file = this.file || null //获取上传的文件 let file = this.file || null //获取上传的文件
let fileSize = file.size || null //上传文件的总大小 let fileSize = file.size || null //上传文件的总大小
let shardSize = 5 * 1024 * 1024 //5MB一个分片 let shardSize = 5 * 1024 * 1024 //5MB一个分片
if (file && fileSize<=shardSize) { //上传文件<=5MB时 if (file && fileSize <= shardSize) { //上传文件<=5MB时
let formData = new FormData() let formData = new FormData()
formData.append("file",file) formData.append("file", file)
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
this.http.post(this.url=='2'?`/api/Objects/PlanPlatform/twoClass`:'/api/Objects/PlanPlatform/oneClass',formData).subscribe((data:any)=>{ this.http.post(this.url == '2' ? `/api/Objects/PlanPlatform/twoClass` : '/api/Objects/PlanPlatform/oneClass', formData).subscribe((data: any) => {
this.objectName = data.objectName this.objectName = data.objectName
//this.snackBar.open('上传成功!','确定',config); //this.snackBar.open('上传成功!','确定',config);
let level = sessionStorage.getItem("level") let level = sessionStorage.getItem("level")
// console.log(level) // console.log(level)
let PlanLevel let PlanLevel
if(level == '0'){ if (level == '0') {
PlanLevel = 1 PlanLevel = 1
} }
if(level == '1'){ if (level == '1') {
PlanLevel = 2 PlanLevel = 2
} }
if(level == '2'){ if (level == '2') {
PlanLevel = 4 PlanLevel = 4
} }
if(level == '3'){ if (level == '3') {
PlanLevel = 8 PlanLevel = 8
} }
let body:any = { let body: any = {
Name:this.unitname||'', Name: this.unitname || '',
PlanCategory:this.url=='2'?2:1, PlanCategory: this.url == '2' ? 2 : 1,
disasterType: this.reservePlanType, disasterType: this.reservePlanType,
PlanLevel:PlanLevel, PlanLevel: PlanLevel,
PlanMode:1, PlanMode: 1,
planType:16, planType: 16,
attachmentUrls:[`${this.objectName}`] attachmentUrls: [`${this.objectName}`]
} }
this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{ this.http.post("/api/PlanComponentsMajor", body).subscribe((data: any) => {
this.snackBar.open('创建成功!','确定',config); this.snackBar.open('创建成功!', '确定', config);
this.dialogRef.close(); this.dialogRef.close();
},err=>{ }, err => {
this.snackBar.open('创建失败!','确定',config); this.snackBar.open('创建失败!', '确定', config);
})
}, err => {
this.snackBar.open('上传失败!', '确定', config);
}) })
},err=>{ } else if (file && fileSize > shardSize) { //上传文件>5MB时,分块上传
this.snackBar.open('上传失败!','确定',config); let data = { filename: file.name }
}) this.uploadisLoading = true
} else if (file && fileSize>shardSize) { //上传文件>5MB时,分块上传 this.http.post(this.url == '2' ? `/api/NewMultipartUpload/PlanPlatform/twoClass` : '/api/NewMultipartUpload/PlanPlatform/oneClass', {}, { params: data }).subscribe((data: any) => { //初始化分段上传
let data = {filename: file.name} this.objectName = data.objectName
this.uploadisLoading = true this.uploadId = data.uploadId
this.http.post(this.url=='2'?`/api/NewMultipartUpload/PlanPlatform/twoClass`:'/api/NewMultipartUpload/PlanPlatform/oneClass',{},{params:data}).subscribe((data:any)=>{ //初始化分段上传 this.subsectionUploading(planType)
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 file = this.file || null //获取上传的文件
let fileSize = file.size || null //上传文件的总大小 let fileSize = file.size || null //上传文件的总大小
let shardSize = 5 * 1024 * 1024 //5MB一个分片 let shardSize = 5 * 1024 * 1024 //5MB一个分片
let allSlice = Math.ceil(fileSize / shardSize) //总文件/5MB===共分多少段 向上取整 let allSlice = Math.ceil(fileSize / shardSize) //总文件/5MB===共分多少段 向上取整
for (let i = 0;i < allSlice;i++) { //循环分段上传 for (let i = 0; i < allSlice; i++) { //循环分段上传
let start = i * shardSize //切割文件开始位置 let start = i * shardSize //切割文件开始位置
let end = Math.min(fileSize, start + shardSize); //切割文件结束位置 (对比取小数) let end = Math.min(fileSize, start + shardSize); //切割文件结束位置 (对比取小数)
let formData = new FormData() let formData = new FormData()
formData.append("file",file.slice(start, end)) formData.append("file", file.slice(start, end))
//同步写法实现异步调用 //同步写法实现异步调用
let result = await new Promise((resolve, reject) => { let result = await new Promise((resolve, reject) => {
// await 需要后面返回一个 promise 对象 // await 需要后面返回一个 promise 对象
this.http.post(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}&partNumber=${i+1}`,formData).subscribe((data:any)=>{ this.http.post(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}&partNumber=${i + 1}`, formData).subscribe((data: any) => {
let msg = { let msg = {
"partNumber":data.partNumber || null, "partNumber": data.partNumber || null,
"eTag": data.eTag || null} "eTag": data.eTag || null
resolve(msg) // 调用 promise 内置方法处理成功 }
}) resolve(msg) // 调用 promise 内置方法处理成功
}); })
this.PartNumberETag.push(result) });
this.uploadProgress = Number((i/allSlice).toFixed(2))*100 this.PartNumberETag.push(result)
this.uploadProgress = Number((i / allSlice).toFixed(2)) * 100
if (this.PartNumberETag.length === allSlice) {
this.uploadProgress = 100 if (this.PartNumberETag.length === allSlice) {
this.endUploading(planType)} this.uploadProgress = 100
this.endUploading(planType)
}
}//for循环 }//for循环
} }
//完成分块上传 //完成分块上传
endUploading (planType) { endUploading(planType) {
let data = this.PartNumberETag let data = this.PartNumberETag
let paramsData = {uploadId:this.uploadId} let paramsData = { uploadId: this.uploadId }
this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`,data,{params:paramsData}).subscribe(data=>{ this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`, data, { params: paramsData }).subscribe(data => {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
//this.snackBar.open('上传成功!','确定',config); //this.snackBar.open('上传成功!','确定',config);
this.uploadProgress = 0; this.uploadProgress = 0;
this.uploadisLoading = false this.uploadisLoading = false
this.PartNumberETag =[] //清空保存返回的信息 this.PartNumberETag = [] //清空保存返回的信息
this.uploadover = true this.uploadover = true
let level = sessionStorage.getItem("level") let level = sessionStorage.getItem("level")
// console.log(level) // console.log(level)
let PlanLevel let PlanLevel
if(level == '0'){ if (level == '0') {
PlanLevel = 1 PlanLevel = 1
} }
if(level == '1'){ if (level == '1') {
PlanLevel = 2 PlanLevel = 2
} }
if(level == '2'){ if (level == '2') {
PlanLevel = 4 PlanLevel = 4
} }
if(level == '3'){ if (level == '3') {
PlanLevel = 8 PlanLevel = 8
} }
let body:any = { let body: any = {
Name:this.unitname||'', Name: this.unitname || '',
PlanCategory:this.url=='2'?2:1, PlanCategory: this.url == '2' ? 2 : 1,
disasterType: this.reservePlanType, disasterType: this.reservePlanType,
PlanLevel:PlanLevel, PlanLevel: PlanLevel,
PlanMode:1, PlanMode: 1,
planType:16, planType: 16,
attachmentUrls:[`${this.objectName}`] attachmentUrls: [`${this.objectName}`]
} }
this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{ this.http.post("/api/PlanComponentsMajor", body).subscribe((data: any) => {
this.snackBar.open('创建成功!','确定',config); this.snackBar.open('创建成功!', '确定', config);
this.dialogRef.close(); this.dialogRef.close();
},err=>{ }, err => {
this.snackBar.open('创建失败!','确定',config); this.snackBar.open('创建失败!', '确定', config);
}) })
}) })
} }
//取消分块上传 //取消分块上传
cancel () { cancel() {
this.http.delete(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}`).subscribe(data=>{ this.http.delete(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}`).subscribe(data => {
this.uploadProgress = 0; this.uploadProgress = 0;
this.uploadisLoading= false; this.uploadisLoading = false;
(<HTMLInputElement>document.getElementById('up')).value = null (<HTMLInputElement>document.getElementById('up')).value = null
this.PartNumberETag =[] //清空保存返回的信息 this.PartNumberETag = [] //清空保存返回的信息
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
this.snackBar.open('取消上传成功!','确定',config); this.snackBar.open('取消上传成功!', '确定', config);
this.uploadover = false this.uploadover = false
this.file = null this.file = null
}) })
@ -597,29 +580,29 @@ export class newunitComponent{
//创建预案 //创建预案
newplan(){ newplan() {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
if(this.unitname==undefined||this.reservePlanType==undefined){ if (this.unitname == undefined || this.reservePlanType == undefined) {
this.snackBar.open('请输入预案名称或类型!','确定',config); this.snackBar.open('请输入预案名称或类型!', '确定', config);
} }
else if(this.file==undefined){ else if (this.file == undefined) {
this.snackBar.open('请先上传文件!','确定',config); this.snackBar.open('请先上传文件!', '确定', config);
} }
else{ else {
if(this.reservePlanType!='1'){ if (this.reservePlanType != '1') {
this.startUploading("非二维") this.startUploading("非二维")
} }
else{this.startUploading("二维")} else { this.startUploading("二维") }
} }
} }
//取消按钮 //取消按钮
close(){ close() {
this.dialogRef.close(); this.dialogRef.close();
} }
} }
@ -630,15 +613,15 @@ export class newunitComponent{
templateUrl: './resultPlanonetwo.html', templateUrl: './resultPlanonetwo.html',
styleUrls: ['./onetwo-entry-plan.component.scss'] styleUrls: ['./onetwo-entry-plan.component.scss']
}) })
export class onetwoAuditResult{ export class onetwoAuditResult {
constructor(private http: HttpClient,public dialogRef: MatDialogRef<onetwoAuditResult>,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} constructor(private http: HttpClient, public dialogRef: MatDialogRef<onetwoAuditResult>, @Inject(MAT_DIALOG_DATA) public data, public snackBar: MatSnackBar) { }
planName:any = this.data.element.name planName: any = this.data.element.name
commitTime:any = this.data.element.committedTime commitTime: any = this.data.element.committedTime
commitOrganizationName:any = this.data.element.committerOrganizationName commitOrganizationName: any = this.data.element.committerOrganizationName
auditOrganizationName:any = this.data.element.auditorOrganizationName auditOrganizationName: any = this.data.element.auditorOrganizationName
auditResult:any = this.data.element.auditStatus auditResult: any = this.data.element.auditStatus
auditOpinion:any = this.data.element.auditOpinion auditOpinion: any = this.data.element.auditOpinion
ngOnInit(): void { ngOnInit(): void {
} }
onNoClick(): void { onNoClick(): void {

294
src/app/plan-management/open-plan/open-plan.component.ts

@ -4,7 +4,7 @@ import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree'
import { MatPaginator } from '@angular/material/paginator'; import { MatPaginator } from '@angular/material/paginator';
import { FlatTreeControl } from '@angular/cdk/tree'; import { FlatTreeControl } from '@angular/cdk/tree';
import { FormControl } from '@angular/forms'; import { FormControl } from '@angular/forms';
import { Router,ActivatedRoute } from '@angular/router' import { Router, ActivatedRoute } from '@angular/router'
import { PageEvent } from '@angular/material/paginator'; import { PageEvent } from '@angular/material/paginator';
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
@ -18,8 +18,8 @@ declare var CryptoJS
}) })
export class OpenPlanComponent implements OnInit { export class OpenPlanComponent 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) { }
private _transformer = (node, level: number) => { //初始化tree private _transformer = (node, level: number) => { //初始化tree
return { return {
expandable: !!node.children && node.children.length > 0, expandable: !!node.children && node.children.length > 0,
@ -35,145 +35,145 @@ export class OpenPlanComponent implements OnInit {
dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
myControl = new FormControl(); myControl = new FormControl();
hasChild = (_: number, node: any) => node.expandable; hasChild = (_: number, node: any) => node.expandable;
//分页 //分页
@ViewChild(MatPaginator, {static: true}) @ViewChild(MatPaginator, { static: true })
pageEvent: PageEvent; pageEvent: PageEvent;
paginator: MatPaginator; paginator: MatPaginator;
length:any; //共多少条数据 length: any; //共多少条数据
pageSize:any; //每页条数 pageSize: any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数 pageSizeOptions: number[] = [10] //设置每页条数
PageNumber:any; //第几页 PageNumber: any; //第几页
displayedColumns: string[] = ['unitname', 'planname', 'addpeople', 'addtime', 'plantype', 'auditStatus', 'openRange', 'projectlevel', 'operation'];
displayedColumns: string[] = ['unitname', 'planname', 'addpeople','addtime','plantype','auditStatus','openRange','projectlevel','operation']; allorganizations: any //所有组织机构
allunittype: any //所有单位类型
allorganizations:any //所有组织机构 tabledataSource: any //表格数据
allunittype:any //所有单位类型 preparelevels: any //编制级别
tabledataSource:any //表格数据
preparelevels:any //编制级别
ngOnInit(): void { ngOnInit(): void {
if(window.matchMedia("(max-width: 1400px)").matches){ if (window.matchMedia("(max-width: 1400px)").matches) {
this.pcMore=false this.pcMore = false
this.padMore=true this.padMore = true
this.pcfind=false this.pcfind = false
this.padjt=true this.padjt = true
}else{ } else {
this.pcfind=true this.pcfind = true
this.pcMore=true this.pcMore = true
this.padMore=false this.padMore = false
this.padjt=false this.padjt = false
} }
this.getunitdata(); this.getunitdata();
this.getOrganizations(); this.getOrganizations();
this.getUnittype(); this.getUnittype();
this.getAllPlanInfo(); //得到所有单位 this.getAllPlanInfo(); //得到所有单位
let level = sessionStorage.getItem("level"); let level = sessionStorage.getItem("level");
if(level == "0"){//如果是总队 if (level == "0") {//如果是总队
this.preparelevels = [ this.preparelevels = [
{name:"总队",value:"1"}, { name: "总队", value: "1" },
{name:"支队",value:"2"}, { name: "支队", value: "2" },
{name:"大队",value:"4"}, { name: "大队", value: "4" },
{name:"中队",value:"8"} { name: "中队", value: "8" }
] ]
} }
if(level == "1"){//如果是支队 if (level == "1") {//如果是支队
this.preparelevels = [ this.preparelevels = [
{name:"支队",value:"2"}, { name: "支队", value: "2" },
{name:"大队",value:"4"}, { name: "大队", value: "4" },
{name:"中队",value:"8"} { name: "中队", value: "8" }
] ]
} }
if(level == "2"){//如果是大队 if (level == "2") {//如果是大队
this.preparelevels = [ this.preparelevels = [
{name:"大队",value:"4"}, { name: "大队", value: "4" },
{name:"中队",value:"8"} { name: "中队", value: "8" }
] ]
} }
if(level == "3"){//如果是中队 if (level == "3") {//如果是中队
this.preparelevels = [ this.preparelevels = [
{name:"中队",value:"8"} { name: "中队", value: "8" }
] ]
} }
} }
pcMore//pc更多 pcMore//pc更多
pcput=false//pc收起 pcput = false//pc收起
pcfind//pc查询 pcfind//pc查询
padjt=false padjt = false
padMore=true//pad收缩控制 padMore = true//pad收缩控制
padput=false//pad收起按钮 padput = false//pad收起按钮
imgsrcopen="../../../assets/images/routdown2.png" imgsrcopen = "../../../assets/images/routdown2.png"
imgsrcdown="../../../assets/images/routup2.png" imgsrcdown = "../../../assets/images/routup2.png"
pcInfo(){ pcInfo() {
this.pcMore=!this.pcMore this.pcMore = !this.pcMore
this.pcput=!this.pcput this.pcput = !this.pcput
} }
padInfo(){ padInfo() {
this.padMore=!this.padMore this.padMore = !this.padMore
this.padput=!this.padput this.padput = !this.padput
} }
allPlanInfo:any //存储所有预案信息 allPlanInfo: any //存储所有预案信息
//获得所有预案信息 //获得所有预案信息
getAllPlanInfo(){ getAllPlanInfo() {
let paramsdata:any = { let paramsdata: any = {
CompanyName: this.companyName || '', CompanyName: this.companyName || '',
OrganizationId: '', OrganizationId: '',
HasChildrenOrganization:'', HasChildrenOrganization: '',
BuildingTypeId: this.unittype || '', BuildingTypeId: this.unittype || '',
PlanType: this.reservePlanType || '', PlanType: this.reservePlanType || '',
AuditStatus:'', //审核状态 AuditStatus: '', //审核状态
PlanLevel: this.preparelevel || '', PlanLevel: this.preparelevel || '',
HasChildrenPlanLevel: this.plcheck || '', HasChildrenPlanLevel: this.plcheck || '',
PageNumber: this.PageNumber || '1', PageNumber: this.PageNumber || '1',
PageSize: this.pageSizeOptions[0], PageSize: this.pageSizeOptions[0],
Sort: '' Sort: ''
} }
this.http.get("/api/PublicPlans",{params:paramsdata}).subscribe((data:any)=>{ this.http.get("/api/PublicPlans", { params: paramsdata }).subscribe((data: any) => {
// console.log(111,data) // console.log(111,data)
this.length = data.totalCount this.length = data.totalCount
this.allPlanInfo = data this.allPlanInfo = data
this.tabledataSource = data.items this.tabledataSource = data.items
}) })
} }
//得到当前单位信息 //得到当前单位信息
getunitdata(){ getunitdata() {
this.http.get("/api/Account/Profiles").subscribe( this.http.get("/api/Account/Profiles").subscribe(
(data:any)=>{ (data: any) => {
this.organizationName = data.organizationName this.organizationName = data.organizationName
} }
) )
} }
organizationName:any //当前单位组织机构名称 organizationName: any //当前单位组织机构名称
treedata:any //组织机构树型数据 treedata: any //组织机构树型数据
newArr:any = [] newArr: any = []
newallorganizations:any //用于存储在原始数据基础上的每个机构增加children字段 newallorganizations: any //用于存储在原始数据基础上的每个机构增加children字段
//得到当前单位所在组织机构的tree型数据 //得到当前单位所在组织机构的tree型数据
getpresentOrganization(){ getpresentOrganization() {
this.newallorganizations = this.allorganizations this.newallorganizations = this.allorganizations
this.newallorganizations.forEach(item => { this.newallorganizations.forEach(item => {
item.children = [] item.children = []
this.newallorganizations.forEach(element => { this.newallorganizations.forEach(element => {
if(element.parentId == item.id){ if (element.parentId == item.id) {
item.children.push(element) item.children.push(element)
} }
}); });
}); });
// console.log(666,this.organizationName) // console.log(666,this.organizationName)
if(this.organizationName){ if (this.organizationName) {
this.newallorganizations.forEach(item => { this.newallorganizations.forEach(item => {
if(item.name == this.organizationName){ if (item.name == this.organizationName) {
this.dataSource.data = [item] this.dataSource.data = [item]
} }
}); });
}else{ } else {
this.dataSource.data = this.tree.toTree(this.treedata); this.dataSource.data = this.tree.toTree(this.treedata);
} }
} }
//获得所有组织机构 //获得所有组织机构
getOrganizations(){ getOrganizations() {
this.http.get('/api/Organizations').subscribe( this.http.get('/api/Organizations').subscribe(
(data:any)=>{ (data: any) => {
this.allorganizations = data this.allorganizations = data
this.treedata = this.tree.toTree(data); this.treedata = this.tree.toTree(data);
this.getpresentOrganization(); this.getpresentOrganization();
@ -182,87 +182,69 @@ export class OpenPlanComponent implements OnInit {
} }
//获得所有单位类型 //获得所有单位类型
getUnittype(){ getUnittype() {
this.http.get('/api/BuildingTypes/Simple').subscribe( this.http.get('/api/BuildingTypes/Simple').subscribe(
data=>{ data => {
this.allunittype = data this.allunittype = data
} }
) )
} }
//跳转查看预案页面 公开预案 //跳转查看预案页面 公开预案
routerTo(e){ routerTo(e) {
/* sessionStorage.setItem("companyName",element.companyName) /* sessionStorage.setItem("companyName",element.companyName)
window.open(`/planAudit/planpass?id=${element.companyId}&companyName=${element.companyName}&auditPlanId=${element.id}&auditStatus=${element.auditStatus}&type=6&planType=2`); */ window.open(`/planAudit/planpass?id=${element.companyId}&companyName=${element.companyName}&auditPlanId=${element.id}&auditStatus=${element.auditStatus}&type=6&planType=2`); */
// console.log(e) // console.log(e)
if(e.planMode == 0||e.planMode == 1){ if (e.planMode == 0 || e.planMode == 1) {
//console.log(e.attachmentUrls) //console.log(e.attachmentUrls)
var index=e.attachmentUrls[0].indexOf("\/") var index = e.attachmentUrls[0].indexOf("\/")
if(e.attachmentUrls[0].substr(0,index)=='psw'){ if (e.attachmentUrls[0].substr(0, index) == 'psw') {
const dialogRef = this.dialog.open(GkhtmlPsViewer, { const dialogRef = this.dialog.open(GkhtmlPsViewer, {
width: '1500px', width: '1500px',
height:'800px', height: '800px',
data: e.attachmentUrls[0] data: e.attachmentUrls[0]
}); });
}
else /* if(e.attachmentUrls[0].substr(e.attachmentUrls[0].length-4,e.attachmentUrls[0].length-1)=='docx'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='pdf'
||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='doc'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='DOC'
||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='txt'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='JPG') */{
let filename:string
let fetchUrl = e.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: [
'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}`)
})
}
} }
else {
if(e.planMode == 2){ //如果是在线编辑 let fetchUrl = e.attachmentUrls[0]
let id = e.id let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase()
sessionStorage.setItem("planId",id) if (suffix == 'docx' || suffix == 'doc') {
sessionStorage.setItem("companyId",e.companyId) let arr = fetchUrl.split('.')
//sessionStorage.setItem("buildingTypeId",this.unittypeId) arr[arr.length - 1] = 'pdf'
sessionStorage.setItem("editable","0") window.open(`/api/Objects/PlanPlatform/` + arr.join('.'))
sessionStorage.setItem("planName",e.name) } else if (suffix == 'pdf') {
let companyId = sessionStorage.getItem("companyId") window.open(`/api/Objects/PlanPlatform/` + fetchUrl)
window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`); } else {
} let config = new MatSnackBarConfig();
if(e.planMode == 3){ //如果是跳转网页 config.verticalPosition = 'top';
sessionStorage.setItem("url",e.url) config.duration = 3000
window.open(`/planManagement/webLook`) this.snackBar.open('该文件类型暂不支持在线查看', '确定', config);
}
} }
}
if (e.planMode == 2) { //如果是在线编辑
let id = e.id
sessionStorage.setItem("planId", id)
sessionStorage.setItem("companyId", e.companyId)
//sessionStorage.setItem("buildingTypeId",this.unittypeId)
sessionStorage.setItem("editable", "0")
sessionStorage.setItem("planName", e.name)
let companyId = sessionStorage.getItem("companyId")
window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`);
}
if (e.planMode == 3) { //如果是跳转网页
sessionStorage.setItem("url", e.url)
window.open(`/planManagement/webLook`)
}
} }
//分页事件 //分页事件
chagePage(e){ chagePage(e) {
this.PageNumber = e.pageIndex+1 this.PageNumber = e.pageIndex + 1
this.getAllPlanInfo(); this.getAllPlanInfo();
} }
//辖区中队div是否显示 //辖区中队div是否显示
isorganizationbox:boolean = false isorganizationbox: boolean = false
//点击辖区中队树,将选择的辖区中队添加到变量 //点击辖区中队树,将选择的辖区中队添加到变量
add(node) { add(node) {
this.isorganizationbox = false this.isorganizationbox = false
@ -278,23 +260,23 @@ export class OpenPlanComponent implements OnInit {
this.isorganizationbox = true this.isorganizationbox = true
} }
//关闭出现的组织机构div //关闭出现的组织机构div
closediv(){ closediv() {
this.isorganizationbox = false this.isorganizationbox = false
} }
//查询 //查询
onSubmit (e) { onSubmit(e) {
this.getAllPlanInfo() this.getAllPlanInfo()
} }
companyName:any //单位名称 companyName: any //单位名称
js:any //所选组织机构 js: any //所选组织机构
jsId:any //所选组织机构的id jsId: any //所选组织机构的id
// jscheck:boolean //所选组织机构勾选框 // jscheck:boolean //所选组织机构勾选框
unittype:any //单位类型 unittype: any //单位类型
reservePlanType:any //预案类型 reservePlanType: any //预案类型
preparelevel:any //编制级别 preparelevel: any //编制级别
plcheck:boolean //编制级别勾选框 plcheck: boolean //编制级别勾选框
//重置 //重置
reset(){ reset() {
this.companyName = '' this.companyName = ''
// this.js = '' // this.js = ''
// this.jsId = '' // this.jsId = ''
@ -307,7 +289,7 @@ export class OpenPlanComponent implements OnInit {
this.pageEvent.pageIndex = 0 this.pageEvent.pageIndex = 0
this.PageNumber = 1 this.PageNumber = 1
this.getAllPlanInfo(); this.getAllPlanInfo();
} }
} }
@ -316,14 +298,14 @@ export class OpenPlanComponent implements OnInit {
templateUrl: './PsvShow.html', templateUrl: './PsvShow.html',
styleUrls: ['./open-plan.component.scss'] styleUrls: ['./open-plan.component.scss']
}) })
export class GkhtmlPsViewer{ export class GkhtmlPsViewer {
constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef<GkhtmlPsViewer>,@Inject(MAT_DIALOG_DATA) public data: any) {} constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef<GkhtmlPsViewer>, @Inject(MAT_DIALOG_DATA) public data: any) { }
ngOnInit(): void { ngOnInit(): void {
// console.log(this.data) // console.log(this.data)
const viewer = new Viewer({ const viewer = new Viewer({
container: document.querySelector('#viewer'), container: document.querySelector('#viewer'),
panorama:'/api/Objects/PlanPlatform/'+ this.data, panorama: '/api/Objects/PlanPlatform/' + this.data,
}); });
} }
} }

464
src/app/plan-management/pass-plan/pass-plan.component.ts

@ -4,7 +4,7 @@ import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree'
import { MatPaginator } from '@angular/material/paginator'; import { MatPaginator } from '@angular/material/paginator';
import { FlatTreeControl } from '@angular/cdk/tree'; import { FlatTreeControl } from '@angular/cdk/tree';
import { FormControl } from '@angular/forms'; import { FormControl } from '@angular/forms';
import { Router,ActivatedRoute } from '@angular/router' import { Router, ActivatedRoute } from '@angular/router'
import { PageEvent } from '@angular/material/paginator'; import { PageEvent } from '@angular/material/paginator';
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
@ -18,8 +18,8 @@ declare var CryptoJS
}) })
export class PassPlanComponent implements OnInit { export class PassPlanComponent 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) { }
private _transformer = (node, level: number) => { //初始化tree private _transformer = (node, level: number) => { //初始化tree
return { return {
expandable: !!node.children && node.children.length > 0, expandable: !!node.children && node.children.length > 0,
@ -35,239 +35,239 @@ export class PassPlanComponent implements OnInit {
dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
myControl = new FormControl(); myControl = new FormControl();
hasChild = (_: number, node: any) => node.expandable; hasChild = (_: number, node: any) => node.expandable;
//分页 //分页
@ViewChild(MatPaginator, {static: true}) @ViewChild(MatPaginator, { static: true })
pageEvent: PageEvent; pageEvent: PageEvent;
paginator: MatPaginator; paginator: MatPaginator;
length:any; //共多少条数据 length: any; //共多少条数据
pageSize:any; //每页条数 pageSize: any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数 pageSizeOptions: number[] = [10] //设置每页条数
PageNumber:any; //第几页 PageNumber: any; //第几页
displayedColumns: string[] = ['planname', 'addpeople','level','addtime','plantype','auditStatus','openRange','projectlevel','operation']; displayedColumns: string[] = ['planname', 'addpeople', 'level', 'addtime', 'plantype', 'auditStatus', 'openRange', 'projectlevel', 'operation'];
allorganizations:any //所有组织机构 allorganizations: any //所有组织机构
allunittype:any //所有单位类型 allunittype: any //所有单位类型
tabledataSource:any //表格数据 tabledataSource: any //表格数据
url url
preparelevels:any preparelevels: any
ngOnInit(): void { ngOnInit(): void {
if(window.matchMedia("(max-width: 1400px)").matches){ if (window.matchMedia("(max-width: 1400px)").matches) {
this.pcMore=false this.pcMore = false
this.padMore=true this.padMore = true
this.pcfind=false this.pcfind = false
this.padjt=true this.padjt = true
}else{ } else {
this.pcfind=true this.pcfind = true
this.pcMore=true this.pcMore = true
this.padMore=false this.padMore = false
this.padjt=false this.padjt = false
} }
this.getunitdata(); this.getunitdata();
this.getOrganizations(); this.getOrganizations();
this.getUnittype(); this.getUnittype();
this.getAllPlanInfo(); this.getAllPlanInfo();
let level = sessionStorage.getItem("level"); let level = sessionStorage.getItem("level");
if(level == "0"){//如果是总队 if (level == "0") {//如果是总队
this.preparelevels = [ this.preparelevels = [
{name:"总队",value:"1"}, { name: "总队", value: "1" },
{name:"支队",value:"2"}, { name: "支队", value: "2" },
{name:"大队",value:"4"}, { name: "大队", value: "4" },
{name:"中队",value:"8"} { name: "中队", value: "8" }
] ]
} }
if(level == "1"){//如果是支队 if (level == "1") {//如果是支队
this.preparelevels = [ this.preparelevels = [
{name:"支队",value:"2"}, { name: "支队", value: "2" },
{name:"大队",value:"4"}, { name: "大队", value: "4" },
{name:"中队",value:"8"} { name: "中队", value: "8" }
] ]
} }
if(level == "2"){//如果是大队 if (level == "2") {//如果是大队
this.preparelevels = [ this.preparelevels = [
{name:"大队",value:"4"}, { name: "大队", value: "4" },
{name:"中队",value:"8"} { name: "中队", value: "8" }
] ]
} }
if(level == "3"){//如果是中队 if (level == "3") {//如果是中队
this.preparelevels = [ this.preparelevels = [
{name:"中队",value:"8"} { name: "中队", value: "8" }
] ]
} }
this.url=window.location.href.substring(window.location.href.length-1,window.location.href.length) this.url = window.location.href.substring(window.location.href.length - 1, window.location.href.length)
//console.log(this.url) //console.log(this.url)
} }
pcMore//pc更多 pcMore//pc更多
pcput=false//pc收起 pcput = false//pc收起
pcfind//pc查询 pcfind//pc查询
padjt=false padjt = false
padMore=true//pad收缩控制 padMore = true//pad收缩控制
padput=false//pad收起按钮 padput = false//pad收起按钮
imgsrcopen="../../../assets/images/routdown2.png" imgsrcopen = "../../../assets/images/routdown2.png"
imgsrcdown="../../../assets/images/routup2.png" imgsrcdown = "../../../assets/images/routup2.png"
pcInfo(){ pcInfo() {
this.pcMore=!this.pcMore this.pcMore = !this.pcMore
this.pcput=!this.pcput this.pcput = !this.pcput
} }
padInfo(){ padInfo() {
this.padMore=!this.padMore this.padMore = !this.padMore
this.padput=!this.padput this.padput = !this.padput
} }
allPlanInfo:any //存储所有预案信息 allPlanInfo: any //存储所有预案信息
//获得所有预案信息 //获得所有预案信息
getAllPlanInfo(){ getAllPlanInfo() {
let reservePlanType let reservePlanType
this.reservePlanType ? reservePlanType = JSON.parse(JSON.stringify(this.reservePlanType)) : 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("|")) reservePlanType = eval(this.reservePlanType.join("|"))
} }
let paramsdata:any = { let paramsdata: any = {
CompanyName: this.companyName || '', CompanyName: this.companyName || '',
OrganizationId: this.jsId || '', OrganizationId: this.jsId || '',
HasChildrenOrganization:this.jscheck || '', HasChildrenOrganization: this.jscheck || '',
BuildingTypeId: this.unittype || '', BuildingTypeId: this.unittype || '',
PlanType: this.reservePlanType || '', PlanType: this.reservePlanType || '',
AuditStatus:'', //审核状态 AuditStatus: '', //审核状态
PlanLevel: this.preparelevel || '', PlanLevel: this.preparelevel || '',
HasChildrenPlanLevel: this.plcheck || '', HasChildrenPlanLevel: this.plcheck || '',
CreationTimeRangeStart:this.addtime||'', CreationTimeRangeStart: this.addtime || '',
CreationTimeRangeEnd:this.endtime||'', CreationTimeRangeEnd: this.endtime || '',
PageNumber: this.PageNumber || '1', PageNumber: this.PageNumber || '1',
PageSize: this.pageSizeOptions[0], PageSize: this.pageSizeOptions[0],
Sort: '', Sort: '',
PlanCategories:this.planCategory PlanCategories: this.planCategory
} }
this.http.get("/api/ApprovedPlans",{params:paramsdata}).subscribe((data:any)=>{ this.http.get("/api/ApprovedPlans", { params: paramsdata }).subscribe((data: any) => {
this.length = data.totalCount this.length = data.totalCount
this.allPlanInfo = data this.allPlanInfo = data
this.tabledataSource = data.items this.tabledataSource = data.items
}) })
} }
colorRgb(sColor){ colorRgb(sColor) {
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
var sColor = sColor.toLowerCase(); var sColor = sColor.toLowerCase();
if (sColor && reg.test(sColor)) { if (sColor && reg.test(sColor)) {
if (sColor.length === 4) { if (sColor.length === 4) {
var sColorNew = "#"; var sColorNew = "#";
for (var i = 1; i < 4; i += 1) { for (var i = 1; i < 4; i += 1) {
sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1)); sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
}
sColor = sColorNew;
} }
//处理六位的颜色值 sColor = sColorNew;
var sColorChange = []; }
for (var i = 1; i < 7; i += 2) { //处理六位的颜色值
sColorChange.push(parseInt("0x" + sColor.slice(i, i + 2))); var sColorChange = [];
} for (var i = 1; i < 7; i += 2) {
return sColorChange; sColorChange.push(parseInt("0x" + sColor.slice(i, i + 2)));
}
return sColorChange;
} else { } else {
return sColor; return sColor;
} }
} }
colorHex(rgb){ colorHex(rgb) {
var _this = rgb; var _this = rgb;
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
if (/^(rgb|RGB)/.test(_this)) { if (/^(rgb|RGB)/.test(_this)) {
var aColor = _this.replace(/(?:(|)|rgb|RGB)*/g, "").split(","); var aColor = _this.replace(/(?:(|)|rgb|RGB)*/g, "").split(",");
var strHex = "#"; var strHex = "#";
for (var i = 0; i < aColor.length; i++) { for (var i = 0; i < aColor.length; i++) {
var hex:any = Number(aColor[i]).toString(16); var hex: any = Number(aColor[i]).toString(16);
hex = hex < 10 ? 0 + '' + hex : hex;// 保证每个rgb的值为2位 hex = hex < 10 ? 0 + '' + hex : hex;// 保证每个rgb的值为2位
if (hex === "0") { if (hex === "0") {
hex += hex; hex += hex;
}
strHex += hex;
}
if (strHex.length !== 7) {
strHex = _this;
} }
return strHex; strHex += hex;
}
if (strHex.length !== 7) {
strHex = _this;
}
return strHex;
} else if (reg.test(_this)) { } else if (reg.test(_this)) {
var aNum = _this.replace(/#/, "").split(""); var aNum = _this.replace(/#/, "").split("");
if (aNum.length === 6) { if (aNum.length === 6) {
return _this; return _this;
} else if (aNum.length === 3) { } else if (aNum.length === 3) {
var numHex = "#"; var numHex = "#";
for (var i = 0; i < aNum.length; i += 1) { for (var i = 0; i < aNum.length; i += 1) {
numHex += (aNum[i] + aNum[i]); numHex += (aNum[i] + aNum[i]);
}
return numHex;
} }
return numHex;
}
} else { } else {
return _this; return _this;
} }
} }
gradientColor(startColor, endColor, step) { gradientColor(startColor, endColor, step) {
let _this = this let _this = this
let startRGB = _this.colorRgb(startColor);//转换为rgb数组模式 let startRGB = _this.colorRgb(startColor);//转换为rgb数组模式
let startR = startRGB[0]; let startR = startRGB[0];
let startG = startRGB[1]; let startG = startRGB[1];
let startB = startRGB[2]; let startB = startRGB[2];
let endRGB = _this.colorRgb(endColor); let endRGB = _this.colorRgb(endColor);
let endR = endRGB[0]; let endR = endRGB[0];
let endG = endRGB[1]; let endG = endRGB[1];
let endB = endRGB[2]; let endB = endRGB[2];
let sR = (endR - startR) / step;//总差值 let sR = (endR - startR) / step;//总差值
let sG = (endG - startG) / step; let sG = (endG - startG) / step;
let sB = (endB - startB) / step; let sB = (endB - startB) / step;
var colorArr = []; var colorArr = [];
for (var i = 0; i < step; i++) { for (var i = 0; i < step; i++) {
//计算每一步的hex值 //计算每一步的hex值
var hex = _this.colorHex('rgb('+ parseInt((sR * i + startR))+ ',' + parseInt((sG * i + startG))+ ',' + parseInt((sB * i + startB)) + ')'); var hex = _this.colorHex('rgb(' + parseInt((sR * i + startR)) + ',' + parseInt((sG * i + startG)) + ',' + parseInt((sB * i + startB)) + ')');
colorArr.push(hex); colorArr.push(hex);
} }
return colorArr; return colorArr;
} }
integrity(width){ integrity(width) {
let _this = this let _this = this
let style:any = {} let style: any = {}
style.width = width +'%'; style.width = width + '%';
if(width < 30){ if (width < 30) {
let colorArr = this.gradientColor('#D50000', '#E53935', 30); let colorArr = this.gradientColor('#D50000', '#E53935', 30);
for(let i = 0; i < 30; i++){ for (let i = 0; i < 30; i++) {
if( i == width){ if (i == width) {
style.background = colorArr[i] style.background = colorArr[i]
} }
} }
} }
if(width >= 30 && width < 60){ if (width >= 30 && width < 60) {
let colorArr = this.gradientColor('#FF9800', '#E65100', 30); let colorArr = this.gradientColor('#FF9800', '#E65100', 30);
for(let i = 30; i < 60; i++){ for (let i = 30; i < 60; i++) {
if( i == width){ if (i == width) {
style.background = colorArr[i-30] style.background = colorArr[i - 30]
} }
} }
} }
if(width >= 60){ if (width >= 60) {
let colorArr = this.gradientColor('#81C784', '#2E7D32', 41); let colorArr = this.gradientColor('#81C784', '#2E7D32', 41);
for(let i = 60; i <= 100; i++){ for (let i = 60; i <= 100; i++) {
if( i == width){ if (i == width) {
style.background = colorArr[i-60] style.background = colorArr[i - 60]
} }
} }
} }
return style return style
} }
integrityDetails(width,zong){ integrityDetails(width, zong) {
let style:any = {} let style: any = {}
style.width = (width/zong)*100 +'%'; style.width = (width / zong) * 100 + '%';
return style return style
} }
//得到当前单位信息 //得到当前单位信息
getunitdata(){ getunitdata() {
this.http.get("/api/Account/Profiles").subscribe( this.http.get("/api/Account/Profiles").subscribe(
(data:any)=>{ (data: any) => {
this.organizationName = data.organizationName this.organizationName = data.organizationName
} }
) )
} }
@ -275,41 +275,41 @@ export class PassPlanComponent implements OnInit {
endtime//结束时间 endtime//结束时间
integrityScoreMin//完整度最小值 integrityScoreMin//完整度最小值
integrityScoreMax//完整度最大值 integrityScoreMax//完整度最大值
organizationName:any //当前单位组织机构名称 organizationName: any //当前单位组织机构名称
treedata:any //组织机构树型数据 treedata: any //组织机构树型数据
newArr:any = [] newArr: any = []
newallorganizations:any //用于存储在原始数据基础上的每个机构增加children字段 newallorganizations: any //用于存储在原始数据基础上的每个机构增加children字段
//得到当前单位所在组织机构的tree型数据 //得到当前单位所在组织机构的tree型数据
getpresentOrganization(){ getpresentOrganization() {
this.newallorganizations = this.allorganizations this.newallorganizations = this.allorganizations
this.newallorganizations.forEach(item => { this.newallorganizations.forEach(item => {
item.children = [] item.children = []
this.newallorganizations.forEach(element => { this.newallorganizations.forEach(element => {
if(element.parentId == item.id){ if (element.parentId == item.id) {
item.children.push(element) item.children.push(element)
} }
}); });
}); });
this.http.get("/api/Account/Profiles").subscribe( this.http.get("/api/Account/Profiles").subscribe(
(data:any)=>{ (data: any) => {
this.organizationName = data.organizationName this.organizationName = data.organizationName
if(this.organizationName){ if (this.organizationName) {
this.newallorganizations.forEach(item => { this.newallorganizations.forEach(item => {
if(item.name == this.organizationName){ if (item.name == this.organizationName) {
this.dataSource.data = [item] this.dataSource.data = [item]
} }
}); });
}else{ } else {
this.dataSource.data = this.tree.toTree(this.treedata); this.dataSource.data = this.tree.toTree(this.treedata);
} }
} }
) )
} }
//获得所有组织机构 //获得所有组织机构
getOrganizations(){ getOrganizations() {
this.http.get('/api/Organizations').subscribe( this.http.get('/api/Organizations').subscribe(
(data:any)=>{ (data: any) => {
this.allorganizations = data this.allorganizations = data
this.treedata = this.tree.toTree(data); this.treedata = this.tree.toTree(data);
this.getpresentOrganization(); this.getpresentOrganization();
@ -318,120 +318,102 @@ export class PassPlanComponent implements OnInit {
} }
//获得所有单位类型 //获得所有单位类型
getUnittype(){ getUnittype() {
this.http.get('/api/BuildingTypes/Simple').subscribe( this.http.get('/api/BuildingTypes/Simple').subscribe(
data=>{ data => {
this.allunittype = data this.allunittype = data
} }
) )
} }
//查看单位信息 //查看单位信息
lookUnitInfo(element){ lookUnitInfo(element) {
// console.log(element) // console.log(element)
// const dialogRef = this.dialog.open(UnitInfo, { // const dialogRef = this.dialog.open(UnitInfo, {
// width: '1500px', // width: '1500px',
// height:'800px' // height:'800px'
// }); // });
sessionStorage.setItem("editable","0") sessionStorage.setItem("editable", "0")
sessionStorage.setItem("companyName",element.company.name) sessionStorage.setItem("companyName", element.company.name)
sessionStorage.setItem("companyId",element.company.id) sessionStorage.setItem("companyId", element.company.id)
sessionStorage.setItem(element.company.id,JSON.stringify(element.company.companyIntegrityScore)) sessionStorage.setItem(element.company.id, JSON.stringify(element.company.companyIntegrityScore))
window.open(`/keyUnit/viewunitinfo?id=${element.company.id}&usci=${element.company.usci}`,'_blank'); window.open(`/keyUnit/viewunitinfo?id=${element.company.id}&usci=${element.company.usci}`, '_blank');
} }
//跳转查看预案页面 审核通过预案 //跳转查看预案页面 审核通过预案
routerTo(e){ routerTo(e) {
// console.log(e) // console.log(e)
if(e.planMode == 0||e.planMode == 1){ if (e.planMode == 0 || e.planMode == 1) {
//console.log(e.attachmentUrls) //console.log(e.attachmentUrls)
var index=e.attachmentUrls[0].indexOf("\/") var index = e.attachmentUrls[0].indexOf("\/")
if(e.attachmentUrls[0].substr(0,index)=='psw'){ if (e.attachmentUrls[0].substr(0, index) == 'psw') {
const dialogRef = this.dialog.open(GkPsViewer, { const dialogRef = this.dialog.open(GkPsViewer, {
width: '1500px', width: '1500px',
height:'800px', height: '800px',
data: e.attachmentUrls[0] data: e.attachmentUrls[0]
}); });
} }
else /* if(e.attachmentUrls[0].substr(e.attachmentUrls[0].length-4,e.attachmentUrls[0].length-1)=='docx'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='pdf' else {
||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='doc'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='DOC' let fetchUrl = e.attachmentUrls[0]
||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='txt'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='JPG') */{ let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase()
let filename:string if (suffix == 'docx' || suffix == 'doc') {
let fetchUrl = e.attachmentUrls[0] let arr = fetchUrl.split('.')
let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl); arr[arr.length - 1] = 'pdf'
let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); window.open(`/api/Objects/PlanPlatform/` + arr.join('.'))
let jwt = sessionStorage.getItem("token"); } else if (suffix == 'pdf') {
let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); window.open(`/api/Objects/PlanPlatform/` + fetchUrl)
let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); } else {
let identityJsonparse=JSON.parse(identityJson) let config = new MatSnackBarConfig();
this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{ config.verticalPosition = 'top';
filename=data.fileName config.duration = 3000
let json={ this.snackBar.open('该文件类型暂不支持在线查看', '确定', config);
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: [
'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}`)
})
} }
} }
}
if(e.planMode == 2){ //如果是在线编辑
let id = e.id if (e.planMode == 2) { //如果是在线编辑
sessionStorage.setItem("planId",id) let id = e.id
sessionStorage.setItem("companyId",e.companyId) sessionStorage.setItem("planId", id)
sessionStorage.setItem("companyId", e.companyId)
//sessionStorage.setItem("buildingTypeId",this.unittypeId) //sessionStorage.setItem("buildingTypeId",this.unittypeId)
sessionStorage.setItem("editable","0") sessionStorage.setItem("editable", "0")
sessionStorage.setItem("planName",e.name) sessionStorage.setItem("planName", e.name)
let companyId = sessionStorage.getItem("companyId") let companyId = sessionStorage.getItem("companyId")
window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`); window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`);
} }
if(e.planMode == 3){ //如果是跳转网页 if (e.planMode == 3) { //如果是跳转网页
sessionStorage.setItem("url",e.url) sessionStorage.setItem("url", e.url)
window.open(`/planManagement/webLook`) window.open(`/planManagement/webLook`)
} }
} }
//预案公开 //预案公开
openReserve (e) { openReserve(e) {
this.http.put(`/api/PlanAudits/${e.id}/Public`,[]).subscribe(data=>{ this.http.put(`/api/PlanAudits/${e.id}/Public`, []).subscribe(data => {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
this.snackBar.open('预案已公开','确定',config); this.snackBar.open('预案已公开', '确定', config);
}) })
} }
//预案取消公开 //预案取消公开
closeReserve (e) { closeReserve(e) {
this.http.put(`/api/PlanAudits/${e.id}/Unpublic`,[]).subscribe(data=>{ this.http.put(`/api/PlanAudits/${e.id}/Unpublic`, []).subscribe(data => {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
this.snackBar.open('预案已取消公开','确定',config); this.snackBar.open('预案已取消公开', '确定', config);
}) })
} }
//分页事件 //分页事件
chagePage(e){ chagePage(e) {
this.PageNumber = e.pageIndex+1 this.PageNumber = e.pageIndex + 1
this.getAllPlanInfo(); this.getAllPlanInfo();
} }
//辖区中队div是否显示 //辖区中队div是否显示
isorganizationbox:boolean = false isorganizationbox: boolean = false
//点击辖区中队树,将选择的辖区中队添加到变量 //点击辖区中队树,将选择的辖区中队添加到变量
add(node) { add(node) {
this.isorganizationbox = false this.isorganizationbox = false
@ -447,26 +429,26 @@ export class PassPlanComponent implements OnInit {
this.isorganizationbox = true this.isorganizationbox = true
} }
//关闭出现的组织机构div //关闭出现的组织机构div
closediv(){ closediv() {
this.isorganizationbox = false this.isorganizationbox = false
} }
//查询 //查询
onSubmit (e) { onSubmit(e) {
this.PageNumber = 1 this.PageNumber = 1
this.pageEvent.pageIndex = 0 this.pageEvent.pageIndex = 0
this.getAllPlanInfo(); this.getAllPlanInfo();
} }
companyName:any //单位名称 companyName: any //单位名称
js:any //所选组织机构 js: any //所选组织机构
jsId:any //所选组织机构的id jsId: any //所选组织机构的id
jscheck:boolean //所选组织机构勾选框 jscheck: boolean //所选组织机构勾选框
unittype:any //单位类型 unittype: any //单位类型
reservePlanType:any //预案类型 reservePlanType: any //预案类型
preparelevel:any //编制级别 preparelevel: any //编制级别
plcheck:boolean //编制级别勾选框 plcheck: boolean //编制级别勾选框
planCategory=[]//预案级别 planCategory = []//预案级别
//重置 //重置
reset(){ reset() {
this.companyName = '' this.companyName = ''
this.js = '' this.js = ''
this.jsId = '' this.jsId = ''
@ -474,13 +456,13 @@ export class PassPlanComponent implements OnInit {
this.unittype = '' this.unittype = ''
this.reservePlanType = '' this.reservePlanType = ''
this.preparelevel = '' this.preparelevel = ''
this.addtime='' this.addtime = ''
this.endtime='' this.endtime = ''
this.plcheck = false this.plcheck = false
//重新获取初始化列表 //重新获取初始化列表
this.pageEvent.pageIndex = 0 this.pageEvent.pageIndex = 0
this.PageNumber = 1 this.PageNumber = 1
this.planCategory=[] this.planCategory = []
this.getAllPlanInfo(); this.getAllPlanInfo();
} }
} }
@ -490,14 +472,14 @@ export class PassPlanComponent implements OnInit {
templateUrl: './PsvShow.html', templateUrl: './PsvShow.html',
styleUrls: ['./pass-plan.component.scss'] styleUrls: ['./pass-plan.component.scss']
}) })
export class GkPsViewer{ export class GkPsViewer {
constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef<GkPsViewer>,@Inject(MAT_DIALOG_DATA) public data: any) {} constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef<GkPsViewer>, @Inject(MAT_DIALOG_DATA) public data: any) { }
ngOnInit(): void { ngOnInit(): void {
// console.log(this.data) // console.log(this.data)
const viewer = new Viewer({ const viewer = new Viewer({
container: document.querySelector('#viewer'), container: document.querySelector('#viewer'),
panorama:'/api/Objects/PlanPlatform/'+ this.data, panorama: '/api/Objects/PlanPlatform/' + this.data,
}); });
} }
} }
@ -508,8 +490,8 @@ export class GkPsViewer{
templateUrl: './unitInfo.html', templateUrl: './unitInfo.html',
styleUrls: ['./pass-plan.component.scss'] styleUrls: ['./pass-plan.component.scss']
}) })
export class UnitInfo{ export class UnitInfo {
constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef<UnitInfo>,@Inject(MAT_DIALOG_DATA) public data: any) {} constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef<UnitInfo>, @Inject(MAT_DIALOG_DATA) public data: any) { }
ngOnInit(): void { ngOnInit(): void {
// console.log(this.data) // console.log(this.data)
} }

659
src/app/plan-management/type-plan/type-plan.component.ts

@ -12,7 +12,7 @@ import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree'
import { MatPaginator } from '@angular/material/paginator'; import { MatPaginator } from '@angular/material/paginator';
import { FlatTreeControl } from '@angular/cdk/tree'; import { FlatTreeControl } from '@angular/cdk/tree';
import { FormControl } from '@angular/forms'; import { FormControl } from '@angular/forms';
import { Router,ActivatedRoute } from '@angular/router' import { Router, ActivatedRoute } from '@angular/router'
import { PageEvent } from '@angular/material/paginator'; import { PageEvent } from '@angular/material/paginator';
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
@ -26,70 +26,70 @@ declare var CryptoJS
}) })
export class TypePlanComponent implements OnInit { export class TypePlanComponent 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 { ngOnInit(): void {
if(window.matchMedia("(max-width: 1400px)").matches){ if (window.matchMedia("(max-width: 1400px)").matches) {
this.pcMore=false this.pcMore = false
this.padMore=true this.padMore = true
this.pcfind=false this.pcfind = false
this.padjt=true this.padjt = true
}else{ } else {
this.pcfind=true this.pcfind = true
this.pcMore=true this.pcMore = true
this.padMore=false this.padMore = false
this.padjt=false this.padjt = false
} }
this.levels = sessionStorage.getItem("level"); this.levels = sessionStorage.getItem("level");
if(this.levels == "0"){//如果是总队 if (this.levels == "0") {//如果是总队
this.preparelevels = [ this.preparelevels = [
{name:"总队",value:"1"}, { name: "总队", value: "1" },
{name:"支队",value:"2"}, { name: "支队", value: "2" },
{name:"大队",value:"4"}, { name: "大队", value: "4" },
{name:"中队",value:"8"} { name: "中队", value: "8" }
] ]
} }
if(this.levels == "1"){//如果是支队 if (this.levels == "1") {//如果是支队
this.preparelevels = [ this.preparelevels = [
{name:"支队",value:"2"}, { name: "支队", value: "2" },
{name:"大队",value:"4"}, { name: "大队", value: "4" },
{name:"中队",value:"8"} { name: "中队", value: "8" }
] ]
} }
if(this.levels == "2"){//如果是大队 if (this.levels == "2") {//如果是大队
this.preparelevels = [ this.preparelevels = [
{name:"大队",value:"4"}, { name: "大队", value: "4" },
{name:"中队",value:"8"} { name: "中队", value: "8" }
] ]
} }
if(this.levels == "3"){//如果是中队 if (this.levels == "3") {//如果是中队
this.preparelevels = [ this.preparelevels = [
{name:"中队",value:"8"} { name: "中队", value: "8" }
] ]
} }
this.getAlltabledate() this.getAlltabledate()
} }
pcMore//pc更多 pcMore//pc更多
pcput=false//pc收起 pcput = false//pc收起
pcfind//pc查询 pcfind//pc查询
padjt=false padjt = false
padMore=true//pad收缩控制 padMore = true//pad收缩控制
padput=false//pad收起按钮 padput = false//pad收起按钮
imgsrcopen="../../../assets/images/routdown2.png" imgsrcopen = "../../../assets/images/routdown2.png"
imgsrcdown="../../../assets/images/routup2.png" imgsrcdown = "../../../assets/images/routup2.png"
pcInfo(){ pcInfo() {
this.pcMore=!this.pcMore this.pcMore = !this.pcMore
this.pcput=!this.pcput this.pcput = !this.pcput
} }
padInfo(){ padInfo() {
this.padMore=!this.padMore this.padMore = !this.padMore
this.padput=!this.padput this.padput = !this.padput
} }
levels levels
preparelevels:any preparelevels: any
plcheck:boolean //编制级别勾选框 plcheck: boolean //编制级别勾选框
displayedColumns: string[] = ['unitname','addname','addtime', 'plantype', 'passstate','isopen','projectlevel','operation']; displayedColumns: string[] = ['unitname', 'addname', 'addtime', 'plantype', 'passstate', 'isopen', 'projectlevel', 'operation'];
tabledataSource tabledataSource
unitname//预案名称 unitname//预案名称
level//预案级别 level//预案级别
@ -100,225 +100,205 @@ export class TypePlanComponent implements OnInit {
unitstate//审核状态 unitstate//审核状态
projectlevel//编制级别 projectlevel//编制级别
//分页 //分页
@ViewChild(MatPaginator, {static: true}) @ViewChild(MatPaginator, { static: true })
pageEvent: PageEvent; pageEvent: PageEvent;
paginator: MatPaginator; paginator: MatPaginator;
length:any; //共多少条数据 length: any; //共多少条数据
pageSize:any; //每页条数 pageSize: any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数 pageSizeOptions: number[] = [10] //设置每页条数
PageNumber:any; //第几页 PageNumber: any; //第几页
//获取表格数据 //获取表格数据
getAlltabledate(){ getAlltabledate() {
let paramsdata:any = { let paramsdata: any = {
Name:this.unitname||'', Name: this.unitname || '',
planCategories:8, planCategories: 8,
CreatorName:this.addname||'', CreatorName: this.addname || '',
AuditStatus:this.unitstate|| '', AuditStatus: this.unitstate || '',
CreationTimeRangeStart:this.addtime||'', CreationTimeRangeStart: this.addtime || '',
CreationTimeRangeEnd:this.endtime||'', CreationTimeRangeEnd: this.endtime || '',
PlanLevel:this.projectlevel||'', PlanLevel: this.projectlevel || '',
HasChildrenPlanLevel:this.plcheck||'', HasChildrenPlanLevel: this.plcheck || '',
PageNumber: this.PageNumber || '1', 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.length = data.totalCount
this.tabledataSource = data.items this.tabledataSource = data.items
}) })
} }
//分页事件 //分页事件
changePage(e){ changePage(e) {
this.PageNumber = e.pageIndex+1 this.PageNumber = e.pageIndex + 1
this.getAlltabledate() this.getAlltabledate()
} }
//重置 //重置
reset(){ reset() {
this.unitname='' this.unitname = ''
this.level='' this.level = ''
this.addname='' this.addname = ''
this.addtime='' this.addtime = ''
this.endtime='' this.endtime = ''
this.unitstate='' this.unitstate = ''
this.projectlevel='' this.projectlevel = ''
this.plcheck=false this.plcheck = false
this.getAlltabledate() this.getAlltabledate()
} }
//查询 //查询
onSubmit (value) { onSubmit(value) {
if(this.endtime!=undefined&&this.addtime>this.endtime){ if (this.endtime != undefined && this.addtime > this.endtime) {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
this.snackBar.open('开始时间不能大于结束时间!','确定',config); this.snackBar.open('开始时间不能大于结束时间!', '确定', config);
}else{ } else {
this.PageNumber = 1 this.PageNumber = 1
this.pageEvent.pageIndex = 0 this.pageEvent.pageIndex = 0
this.getAlltabledate(); this.getAlltabledate();
} }
} }
//删除预案 //删除预案
deletePlan(id){ deletePlan(id) {
let isTrue = confirm('您确定要删除吗') let isTrue = confirm('您确定要删除吗')
if(isTrue){ if (isTrue) {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
this.http.delete(`/api/PlanComponentsMajor/${id}`).subscribe(data=>{ this.http.delete(`/api/PlanComponentsMajor/${id}`).subscribe(data => {
this.snackBar.open('删除成功!','确定',config); this.snackBar.open('删除成功!', '确定', config);
this.getAlltabledate() this.getAlltabledate()
},err => { }, err => {
this.snackBar.open(err,'确定',config); this.snackBar.open(err, '确定', config);
}) })
} }
} }
//提交审核 //提交审核
submitAudit(element){ submitAudit(element) {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
/* if(element.auditStatus == 4){ /* if(element.auditStatus == 4){
this.snackBar.open('审核退回的预案需要修改后方可再次提交审核!','确定',config); this.snackBar.open('审核退回的预案需要修改后方可再次提交审核!','确定',config);
} */ } */
this.http.put(`/api/PlanComponentsMajor/${element.id}/Commit`,"").subscribe(data=>{ this.http.put(`/api/PlanComponentsMajor/${element.id}/Commit`, "").subscribe(data => {
this.getAlltabledate() this.getAlltabledate()
},err => { }, err => {
this.snackBar.open(err,'确定',config); this.snackBar.open(err, '确定', config);
}) })
} }
//撤销审核 //撤销审核
cancelAudit(element){ cancelAudit(element) {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 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() this.getAlltabledate()
},err => { }, err => {
this.snackBar.open(err,'确定',config); this.snackBar.open(err, '确定', config);
}) })
} }
//查看预案 //查看预案
openPlan(element){ openPlan(element) {
let filename:string
let fetchUrl = element.attachmentUrls[0] let fetchUrl = element.attachmentUrls[0]
let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl); let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase()
let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); if (suffix == 'docx' || suffix == 'doc') {
let jwt = sessionStorage.getItem("token"); let arr = fetchUrl.split('.')
let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); arr[arr.length - 1] = 'pdf'
let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); window.open(`/api/Objects/PlanPlatform/` + arr.join('.'))
let identityJsonparse=JSON.parse(identityJson) } else if (suffix == 'pdf') {
this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{ window.open(`/api/Objects/PlanPlatform/` + fetchUrl)
filename=data.fileName } else {
let json={ let config = new MatSnackBarConfig();
doc: { config.verticalPosition = 'top';
docId: docId, config.duration = 3000
title: filename, this.snackBar.open('该文件类型暂不支持在线查看', '确定', config);
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}`)
})
} }
//新增预案弹窗 //新增预案弹窗
addunit(){ addunit() {
const dialogRef = this.dialog.open(newunitType, { const dialogRef = this.dialog.open(newunitType, {
width: '340px', width: '340px',
height:'330px', height: '330px',
disableClose:true disableClose: true
//data: paperDataInfo //data: paperDataInfo
}); });
dialogRef.afterClosed().subscribe(result => { dialogRef.afterClosed().subscribe(result => {
this.getAlltabledate() this.getAlltabledate()
} }
); );
} }
//审核结果 //审核结果
auditResult(element){ auditResult(element) {
// console.log(element) // console.log(element)
const dialogRef = this.dialog.open(typeAuditResult, { const dialogRef = this.dialog.open(typeAuditResult, {
width:"400px", width: "400px",
//height:"300px", //height:"300px",
data: {element:element} data: { element: element }
}); });
} }
//下载↓ //下载↓
selectDownloadFile:any; //选择下载的文件 selectDownloadFile: any; //选择下载的文件
download:any; //下载文件元数据 download: any; //下载文件元数据
downloadisLoading:boolean = false; //进度条loading加载 downloadisLoading: boolean = false; //进度条loading加载
downloadProgress:number=0; //进度条进度 downloadProgress: number = 0; //进度条进度
downloadFileName:any downloadFileName: any
fileUrls:any //当前预案附件地址 fileUrls: any //当前预案附件地址
fileDatas:any = [] fileDatas: any = []
selectedFileIndex : any = 0 selectedFileIndex: any = 0
selectedFileData : any selectedFileData: any
uploadFileLonging:any uploadFileLonging: any
//读取下载文件信息 //读取下载文件信息
readFile (element) { readFile(element) {
this.uploadFileLonging = element this.uploadFileLonging = element
element.attachmentUrls.forEach(item=>{ element.attachmentUrls.forEach(item => {
this.http.get('/api/ObjectMetadata/PlanPlatform/'+item).subscribe((data:any)=>{ this.http.get('/api/ObjectMetadata/PlanPlatform/' + item).subscribe((data: any) => {
data.filePige = (data.fileLength / (1024*1024)).toFixed(2) data.filePige = (data.fileLength / (1024 * 1024)).toFixed(2)
//console.log(data) //console.log(data)
this.download = data this.download = data
this.downloadFile() this.downloadFile()
}) })
}) })
} }
//初始化下载 //初始化下载
downloadFile () { downloadFile() {
this.downloadProgress = 0 this.downloadProgress = 0
let file = this.download let file = this.download
let fileSize = file.fileLength//下载文件的总大小 let fileSize = file.fileLength//下载文件的总大小
let shardSize = 10 * 1024 * 1024 //文件大小是否大于10MB let shardSize = 10 * 1024 * 1024 //文件大小是否大于10MB
if (file && fileSize<=shardSize) { //<=10MB时直接下载 if (file && fileSize <= shardSize) { //<=10MB时直接下载
this.downloadisLoading = true this.downloadisLoading = true
// this.setFileLoading() // 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 url = window.URL.createObjectURL(new Blob([data])); //createObjectURL创建一个下载Blob的url地址
let link = document.createElement("a"); let link = document.createElement("a");
link.style.display = "none"; link.style.display = "none";
link.href = url; link.href = url;
let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ; let suffix = file.objectName.substring(file.objectName.lastIndexOf(".") + 1, file.objectName.length);
link.setAttribute("download", file.fileName + "-" +this.uploadFileLonging.name + "." + suffix); link.setAttribute("download", file.fileName + "-" + this.uploadFileLonging.name + "." + suffix);
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
this.downloadisLoading = false this.downloadisLoading = false
// this.setFileLoading() // this.setFileLoading()
}) })
} else if (file && fileSize > shardSize) { //>10MB时分块下载 } else if (file && fileSize > shardSize) { //>10MB时分块下载
this.blockingDownload() //分段下载 this.blockingDownload() //分段下载
this.downloadisLoading = true this.downloadisLoading = true
// this.setFileLoading() // this.setFileLoading()
@ -327,31 +307,32 @@ export class TypePlanComponent implements OnInit {
} }
//分段下载并合并 //分段下载并合并
async blockingDownload () { async blockingDownload() {
let file = this.download let file = this.download
let fileSize = file.fileLength //下载文件的总大小 let fileSize = file.fileLength //下载文件的总大小
let shardSize = 3 * 1024 * 1024 //3MB一个分片 let shardSize = 3 * 1024 * 1024 //3MB一个分片
let allSlice = Math.ceil(fileSize / shardSize) //总文件/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 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)=>{ let result = await new Promise((result, reject) => {
this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{headers:{'range':`bytes= ${start}-${end}`},responseType:'blob'}).subscribe(data=>{ this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`, { headers: { 'range': `bytes= ${start}-${end}` }, responseType: 'blob' }).subscribe(data => {
result(data) }) result(data)
})
}) })
allFile.push(result) allFile.push(result)
this.downloadProgress = Number((i/allSlice).toFixed(2))*100 this.downloadProgress = Number((i / allSlice).toFixed(2)) * 100
if (allFile.length === allSlice) { //合并文件输出给浏览器 if (allFile.length === allSlice) { //合并文件输出给浏览器
let url = window.URL.createObjectURL(new Blob(allFile)); //createObjectURL创建一个下载Blob的url地址 let url = window.URL.createObjectURL(new Blob(allFile)); //createObjectURL创建一个下载Blob的url地址
let link = document.createElement("a"); let link = document.createElement("a");
link.style.display = "none"; link.style.display = "none";
link.href = url; link.href = url;
let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ; let suffix = file.objectName.substring(file.objectName.lastIndexOf(".") + 1, file.objectName.length);
link.setAttribute("download", file.fileName + "-" +this.uploadFileLonging.name + "." + suffix); link.setAttribute("download", file.fileName + "-" + this.uploadFileLonging.name + "." + suffix);
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
// this.downloadProgress = 0 // this.downloadProgress = 0
@ -364,7 +345,7 @@ export class TypePlanComponent implements OnInit {
} }
//取消分块下载 //取消分块下载
cancelDowload () { cancelDowload() {
} }
} }
@ -375,8 +356,8 @@ export class TypePlanComponent implements OnInit {
templateUrl: './newunit.html', templateUrl: './newunit.html',
styleUrls: ['./newunit.scss'] styleUrls: ['./newunit.scss']
}) })
export class newunitType{ export class newunitType {
constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef<newunitType>,@Inject(MAT_DIALOG_DATA) public data: any) {} constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef<newunitType>, @Inject(MAT_DIALOG_DATA) public data: any) { }
unitname//预案名称 unitname//预案名称
level//预案级别 level//预案级别
addname//添加人 addname//添加人
@ -386,209 +367,211 @@ export class newunitType{
projectlevel//编制级别 projectlevel//编制级别
reservePlanType//预案类型 reservePlanType//预案类型
//上传 //上传
upload(){ upload() {
document.getElementById('up').click() document.getElementById('up').click()
} }
//上传文件↓ //上传文件↓
file:any; //上传的文件 file: any; //上传的文件
fileName:any; //上传文件name fileName: any; //上传文件name
uploadisLoading:boolean = false; //进度条loading加载 uploadisLoading: boolean = false; //进度条loading加载
uploadProgress:number=0; //进度条进度 uploadProgress: number = 0; //进度条进度
objectName:any; //上传对象名 objectName: any; //上传对象名
uploadId:any; //上传分块上传事件编号 uploadId: any; //上传分块上传事件编号
uploadover:any = false //上传完成之后提示 uploadover: any = false //上传完成之后提示
selectedPLanType:any//所选预案类型 selectedPLanType: any//所选预案类型
selectedPLanName:any//所选预案名称 selectedPLanName: any//所选预案名称
localup:boolean = false //本地上传 localup: boolean = false //本地上传
defaultisshow = '0' //默认显示上传input框 defaultisshow = '0' //默认显示上传input框
//上传文件input //上传文件input
filechange(e){ filechange(e) {
this.file = e.target.files[0] || null //上传的文件 this.file = e.target.files[0] || null //上传的文件
} }
//上传文件 //上传文件
startUploading (planType) { startUploading(planType) {
let file = this.file || null //获取上传的文件 let file = this.file || null //获取上传的文件
let fileSize = file.size || null //上传文件的总大小 let fileSize = file.size || null //上传文件的总大小
let shardSize = 5 * 1024 * 1024 //5MB一个分片 let shardSize = 5 * 1024 * 1024 //5MB一个分片
if (file && fileSize<=shardSize) { //上传文件<=5MB时 if (file && fileSize <= shardSize) { //上传文件<=5MB时
let formData = new FormData() let formData = new FormData()
formData.append("file",file) formData.append("file", file)
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
let level = sessionStorage.getItem("level") let level = sessionStorage.getItem("level")
// console.log(level) // console.log(level)
let PlanLevel let PlanLevel
if(level == '0'){ if (level == '0') {
PlanLevel = 1 PlanLevel = 1
} }
if(level == '1'){ if (level == '1') {
PlanLevel = 2 PlanLevel = 2
}
if(level == '2'){
PlanLevel = 4
}
if(level == '3'){
PlanLevel = 8
}
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:PlanLevel,
PlanMode:1,
PlanType:8,
planType:16,
attachmentUrls:[`${this.objectName}`]
} }
this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{ if (level == '2') {
this.snackBar.open('创建成功!','确定',config); PlanLevel = 4
this.dialogRef.close(); }
},err=>{ if (level == '3') {
this.snackBar.open('创建失败!','确定',config); PlanLevel = 8
}
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: PlanLevel,
PlanMode: 1,
PlanType: 8,
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);
})
}, err => {
this.snackBar.open('上传失败!', '确定', config);
}) })
},err=>{ } else if (file && fileSize > shardSize) { //上传文件>5MB时,分块上传
this.snackBar.open('上传失败!','确定',config); let data = { filename: file.name }
}) this.uploadisLoading = true
} else if (file && fileSize>shardSize) { //上传文件>5MB时,分块上传 this.http.post(`/api/NewMultipartUpload/PlanPlatform/typeClass`, {}, { params: data }).subscribe((data: any) => { //初始化分段上传
let data = {filename: file.name} this.objectName = data.objectName
this.uploadisLoading = true this.uploadId = data.uploadId
this.http.post(`/api/NewMultipartUpload/PlanPlatform/typeClass`,{},{params:data}).subscribe((data:any)=>{ //初始化分段上传 this.subsectionUploading(planType)
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 file = this.file || null //获取上传的文件
let fileSize = file.size || null //上传文件的总大小 let fileSize = file.size || null //上传文件的总大小
let shardSize = 5 * 1024 * 1024 //5MB一个分片 let shardSize = 5 * 1024 * 1024 //5MB一个分片
let allSlice = Math.ceil(fileSize / shardSize) //总文件/5MB===共分多少段 向上取整 let allSlice = Math.ceil(fileSize / shardSize) //总文件/5MB===共分多少段 向上取整
for (let i = 0;i < allSlice;i++) { //循环分段上传 for (let i = 0; i < allSlice; i++) { //循环分段上传
let start = i * shardSize //切割文件开始位置 let start = i * shardSize //切割文件开始位置
let end = Math.min(fileSize, start + shardSize); //切割文件结束位置 (对比取小数) let end = Math.min(fileSize, start + shardSize); //切割文件结束位置 (对比取小数)
let formData = new FormData() let formData = new FormData()
formData.append("file",file.slice(start, end)) formData.append("file", file.slice(start, end))
//同步写法实现异步调用 //同步写法实现异步调用
let result = await new Promise((resolve, reject) => { let result = await new Promise((resolve, reject) => {
// await 需要后面返回一个 promise 对象 // await 需要后面返回一个 promise 对象
this.http.post(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}&partNumber=${i+1}`,formData).subscribe((data:any)=>{ this.http.post(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}&partNumber=${i + 1}`, formData).subscribe((data: any) => {
let msg = { let msg = {
"partNumber":data.partNumber || null, "partNumber": data.partNumber || null,
"eTag": data.eTag || null} "eTag": data.eTag || null
resolve(msg) // 调用 promise 内置方法处理成功 }
}) resolve(msg) // 调用 promise 内置方法处理成功
}); })
this.PartNumberETag.push(result) });
this.uploadProgress = Number((i/allSlice).toFixed(2))*100 this.PartNumberETag.push(result)
this.uploadProgress = Number((i / allSlice).toFixed(2)) * 100
if (this.PartNumberETag.length === allSlice) {
this.uploadProgress = 100 if (this.PartNumberETag.length === allSlice) {
this.endUploading(planType)} this.uploadProgress = 100
this.endUploading(planType)
}
}//for循环 }//for循环
} }
//完成分块上传 //完成分块上传
endUploading (planType) { endUploading(planType) {
let data = this.PartNumberETag let data = this.PartNumberETag
let paramsData = {uploadId:this.uploadId} let paramsData = { uploadId: this.uploadId }
this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`,data,{params:paramsData}).subscribe(data=>{ this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`, data, { params: paramsData }).subscribe(data => {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
//console.log('创建成功') //console.log('创建成功')
this.uploadProgress = 0; this.uploadProgress = 0;
this.uploadisLoading = false this.uploadisLoading = false
this.PartNumberETag =[] //清空保存返回的信息 this.PartNumberETag = [] //清空保存返回的信息
this.uploadover = true this.uploadover = true
let level = sessionStorage.getItem("level") let level = sessionStorage.getItem("level")
// console.log(level) // console.log(level)
let PlanLevel let PlanLevel
if(level == '0'){ if (level == '0') {
PlanLevel = 1 PlanLevel = 1
} }
if(level == '1'){ if (level == '1') {
PlanLevel = 2 PlanLevel = 2
} }
if(level == '2'){ if (level == '2') {
PlanLevel = 4 PlanLevel = 4
} }
if(level == '3'){ if (level == '3') {
PlanLevel = 8 PlanLevel = 8
} }
let body:any = { let body: any = {
Name:this.unitname||'', Name: this.unitname || '',
PlanCategory:8, PlanCategory: 8,
PlanLevel:PlanLevel, PlanLevel: PlanLevel,
PlanMode:1, PlanMode: 1,
PlanType:8, PlanType: 8,
planType:16, planType: 16,
attachmentUrls:[`${this.objectName}`] attachmentUrls: [`${this.objectName}`]
} }
this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{ this.http.post("/api/PlanComponentsMajor", body).subscribe((data: any) => {
this.snackBar.open('创建成功!','确定',config); this.snackBar.open('创建成功!', '确定', config);
this.dialogRef.close(); this.dialogRef.close();
},err=>{ }, err => {
this.snackBar.open('创建失败!','确定',config); this.snackBar.open('创建失败!', '确定', config);
}) })
}) })
} }
//取消分块上传 //取消分块上传
cancel () { cancel() {
this.http.delete(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}`).subscribe(data=>{ this.http.delete(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}`).subscribe(data => {
this.uploadProgress = 0; this.uploadProgress = 0;
this.uploadisLoading= false; this.uploadisLoading = false;
(<HTMLInputElement>document.getElementById('up')).value = null (<HTMLInputElement>document.getElementById('up')).value = null
this.PartNumberETag =[] //清空保存返回的信息 this.PartNumberETag = [] //清空保存返回的信息
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
this.snackBar.open('取消上传成功!','确定',config); this.snackBar.open('取消上传成功!', '确定', config);
this.uploadover = false this.uploadover = false
this.file = null this.file = null
}) })
} }
//创建预案 //创建预案
newplan(){ newplan() {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
if(this.unitname==undefined||this.unitname==''){ if (this.unitname == undefined || this.unitname == '') {
this.snackBar.open('请输入预案名称!','确定',config); this.snackBar.open('请输入预案名称!', '确定', config);
} }
else if(this.file==undefined){ else if (this.file == undefined) {
this.snackBar.open('请先上传文件!','确定',config); this.snackBar.open('请先上传文件!', '确定', config);
} }
else{ else {
if(this.reservePlanType!='1'){ if (this.reservePlanType != '1') {
this.startUploading("非二维") this.startUploading("非二维")
} }
else{this.startUploading("二维")} else { this.startUploading("二维") }
} }
} }
//取消按钮 //取消按钮
close(){ close() {
this.dialogRef.close(); this.dialogRef.close();
} }
} }
@ -599,15 +582,15 @@ export class newunitType{
templateUrl: './resulttypePlan.html', templateUrl: './resulttypePlan.html',
styleUrls: ['./type-plan.component.scss'] styleUrls: ['./type-plan.component.scss']
}) })
export class typeAuditResult{ export class typeAuditResult {
constructor(private http: HttpClient,public dialogRef: MatDialogRef<typeAuditResult>,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} constructor(private http: HttpClient, public dialogRef: MatDialogRef<typeAuditResult>, @Inject(MAT_DIALOG_DATA) public data, public snackBar: MatSnackBar) { }
planName:any = this.data.element.name planName: any = this.data.element.name
commitTime:any = this.data.element.committedTime commitTime: any = this.data.element.committedTime
commitOrganizationName:any = this.data.element.committerOrganizationName commitOrganizationName: any = this.data.element.committerOrganizationName
auditOrganizationName:any = this.data.element.auditorOrganizationName auditOrganizationName: any = this.data.element.auditorOrganizationName
auditResult:any = this.data.element.auditStatus auditResult: any = this.data.element.auditStatus
auditOpinion:any = this.data.element.auditOpinion auditOpinion: any = this.data.element.auditOpinion
ngOnInit(): void { ngOnInit(): void {
} }
onNoClick(): void { onNoClick(): void {

122
src/app/statistic-analysis/all-plan/all-plan.component.ts

@ -12,7 +12,7 @@ import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree'
import { MatPaginator } from '@angular/material/paginator'; import { MatPaginator } from '@angular/material/paginator';
import { FlatTreeControl } from '@angular/cdk/tree'; import { FlatTreeControl } from '@angular/cdk/tree';
import { FormControl } from '@angular/forms'; import { FormControl } from '@angular/forms';
import { Router,ActivatedRoute } from '@angular/router' import { Router, ActivatedRoute } from '@angular/router'
import { PageEvent } from '@angular/material/paginator'; import { PageEvent } from '@angular/material/paginator';
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
@ -28,102 +28,84 @@ declare var CryptoJS
}) })
export class AllPlanComponent implements OnInit { export class AllPlanComponent implements OnInit {
constructor(private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public route: ActivatedRoute,private router: Router) { } constructor(private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public route: ActivatedRoute, private router: Router) { }
ngOnInit(): void { ngOnInit(): void {
this.route.queryParams.subscribe(params => { this.route.queryParams.subscribe(params => {
this.titlename = params['name']; this.titlename = params['name'];
this.type = params['type']; this.type = params['type'];
this.jsId=params['id'] this.jsId = params['id']
this.tid=params.tid this.tid = params.tid
}); });
this.getAlltabledate() this.getAlltabledate()
} }
tid tid
displayedColumns: string[] = ['unitname','modifiedTime','organizationName','buildingTypes','operation']; displayedColumns: string[] = ['unitname', 'modifiedTime', 'organizationName', 'buildingTypes', 'operation'];
tabledataSource tabledataSource
titlename //上个页面传过来的名称 titlename //上个页面传过来的名称
type //上个页面传过来:1重点单位 2预案 type //上个页面传过来:1重点单位 2预案
jsId //组织机构id jsId //组织机构id
//分页 //分页
@ViewChild(MatPaginator, {static: true}) @ViewChild(MatPaginator, { static: true })
pageEvent: PageEvent; pageEvent: PageEvent;
paginator: MatPaginator; paginator: MatPaginator;
length:any; //共多少条数据 length: any; //共多少条数据
pageSize:any; //每页条数 pageSize: any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数 pageSizeOptions: number[] = [10] //设置每页条数
PageNumber:any; //第几页 PageNumber: any; //第几页
//分页事件 //分页事件
changePage(e){ changePage(e) {
this.PageNumber = e.pageIndex+1 this.PageNumber = e.pageIndex + 1
this.getAlltabledate() this.getAlltabledate()
} }
//返回 //返回
goBack () { goBack() {
sessionStorage.setItem('refresh', 'true'); sessionStorage.setItem('refresh', 'true');
history.go(-1); history.go(-1);
//this.echartsData.statefulInspectionToggle = true //this.echartsData.statefulInspectionToggle = true
} }
//获得所有预案 //获得所有预案
getAlltabledate(){ getAlltabledate() {
let paramtedate:any={ let paramtedate: any = {
organizationId:this.jsId||'', organizationId: this.jsId || '',
planStatus:this.tid=='pieone'?'': this.type, planStatus: this.tid == 'pieone' ? '' : this.type,
PlanCategory:this.tid=='pieone'?this.type:'', PlanCategory: this.tid == 'pieone' ? this.type : '',
PageNumber: this.PageNumber || '1', PageNumber: this.PageNumber || '1',
PageSize: this.pageSizeOptions[0] PageSize: this.pageSizeOptions[0]
} }
this.http.get(`/api/Plans/Organizations`,{params:paramtedate}).subscribe((data:any)=>{ this.http.get(`/api/Plans/Organizations`, { params: paramtedate }).subscribe((data: any) => {
this.length = data.totalCount this.length = data.totalCount
this.tabledataSource=data.items this.tabledataSource = data.items
//console.log(this.tabledataSource) //console.log(this.tabledataSource)
}) })
} }
//查看详情 //查看详情
lookPlan(e){ lookPlan(e) {
if(e.planType == 16||e.planType == 4||e.planType == 8){ if (e.planType == 16 || e.planType == 4 || e.planType == 8) {
var index=e.attachmentUrls[0].indexOf("\/") var index = e.attachmentUrls[0].indexOf("\/")
if(e.attachmentUrls[0].substr(0,index)=='psw'){ if (e.attachmentUrls[0].substr(0, index) == 'psw') {
const dialogRef = this.dialog.open(PsViewer, { const dialogRef = this.dialog.open(PsViewer, {
width: '1500px', width: '1500px',
height:'800px', height: '800px',
data: e.attachmentUrls[0] data: e.attachmentUrls[0]
}); });
} }
else /* if(e.attachmentUrls[0].substr(e.attachmentUrls[0].length-4,e.attachmentUrls[0].length-1)=='docx'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='pdf' else {
||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='doc'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='DOC' let fetchUrl = e.attachmentUrls[0]
||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='txt'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='JPG') */{ let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase()
let filename:string if (suffix == 'docx' || suffix == 'doc') {
let fetchUrl = e.attachmentUrls[0] let arr = fetchUrl.split('.')
let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl); arr[arr.length - 1] = 'pdf'
let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); window.open(`/api/Objects/PlanPlatform/` + arr.join('.'))
let jwt = sessionStorage.getItem("token"); } else if (suffix == 'pdf') {
let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); window.open(`/api/Objects/PlanPlatform/` + fetchUrl)
let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); } else {
let identityJsonparse=JSON.parse(identityJson) let config = new MatSnackBarConfig();
this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{ config.verticalPosition = 'top';
filename=data.fileName config.duration = 3000
let json={ this.snackBar.open('该文件类型暂不支持在线查看', '确定', config);
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: [
'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}`)
})
} }
} }
/* if(e.planType == 4){ /* if(e.planType == 4){
@ -136,18 +118,18 @@ export class AllPlanComponent implements OnInit {
}); });
} }
} */ } */
if(e.planType == 1){ //如果是在线编辑 if (e.planType == 1) { //如果是在线编辑
let id = e.id let id = e.id
sessionStorage.setItem("planId",id) sessionStorage.setItem("planId", id)
sessionStorage.setItem("companyId",e.company.id) sessionStorage.setItem("companyId", e.company.id)
sessionStorage.setItem("buildingTypeId",e.company.buildingTypes[0].id) sessionStorage.setItem("buildingTypeId", e.company.buildingTypes[0].id)
sessionStorage.setItem("editable","0") sessionStorage.setItem("editable", "0")
sessionStorage.setItem("planName",e.name) sessionStorage.setItem("planName", e.name)
let companyId = sessionStorage.getItem("companyId") let companyId = sessionStorage.getItem("companyId")
window.open(`/keyUnit/viewunitinfoplan?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`); window.open(`/keyUnit/viewunitinfoplan?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`);
} }
if(e.planType == 2){ //如果是跳转网页 if (e.planType == 2) { //如果是跳转网页
sessionStorage.setItem("url",e.url) sessionStorage.setItem("url", e.url)
window.open(`/planManagement/webLook`) window.open(`/planManagement/webLook`)
} }
} }
@ -160,13 +142,13 @@ export class AllPlanComponent implements OnInit {
templateUrl: './Photo-Sphere-Viewer.html', templateUrl: './Photo-Sphere-Viewer.html',
styleUrls: ['./all-plan.component.scss'] styleUrls: ['./all-plan.component.scss']
}) })
export class PsViewer{ export class PsViewer {
constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef<PsViewer>,@Inject(MAT_DIALOG_DATA) public data: any) {} constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef<PsViewer>, @Inject(MAT_DIALOG_DATA) public data: any) { }
ngOnInit(): void { ngOnInit(): void {
const viewer = new Viewer({ const viewer = new Viewer({
container: document.querySelector('#viewer'), container: document.querySelector('#viewer'),
panorama:'/api/Objects/PlanPlatform/'+ this.data, panorama: '/api/Objects/PlanPlatform/' + this.data,
}); });
} }
} }

46
src/app/statistic-analysis/plan-analysis-by-synthesis/plan-analysis-by-synthesis.component.ts

@ -353,39 +353,21 @@ export class PlanAnalysisBySynthesisComponent implements OnInit {
data: e.attachmentUrls[0] data: e.attachmentUrls[0]
}); });
} }
else /* if(e.attachmentUrls[0].substr(e.attachmentUrls[0].length-4,e.attachmentUrls[0].length-1)=='docx'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='pdf' else {
||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='doc'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='DOC'
||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='txt'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='JPG') */ {
let filename: string
let fetchUrl = e.attachmentUrls[0] let fetchUrl = e.attachmentUrls[0]
let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl); let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase()
let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); if (suffix == 'docx' || suffix == 'doc') {
let jwt = sessionStorage.getItem("token"); let arr = fetchUrl.split('.')
let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); arr[arr.length - 1] = 'pdf'
let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); window.open(`/api/Objects/PlanPlatform/` + arr.join('.'))
let identityJsonparse = JSON.parse(identityJson) } else if (suffix == 'pdf') {
this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data: any) => { window.open(`/api/Objects/PlanPlatform/` + fetchUrl)
filename = data.fileName } else {
let json = { let config = new MatSnackBarConfig();
doc: { config.verticalPosition = 'top';
docId: docId, config.duration = 3000
title: filename, this.snackBar.open('该文件类型暂不支持在线查看', '确定', config);
fetchUrl: `http://172.18.0.1:8000/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://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`)
})
} }
} }

39
src/app/tabbar/tabbar.component.html

@ -134,7 +134,6 @@
<p *ngIf="!isUpdates" style="font-size: 16px;position: absolute; right: 233px;">欢迎您, {{realName}}</p> <p *ngIf="!isUpdates" style="font-size: 16px;position: absolute; right: 233px;">欢迎您, {{realName}}</p>
<div class="scoringRule" *ngIf="companyIntegrityScore"> <div class="scoringRule" *ngIf="companyIntegrityScore">
<span class="name" (click)="scoringRule()"> <span class="name" (click)="scoringRule()">
信息完整度规则 信息完整度规则
@ -158,60 +157,62 @@
<td>规则说明</td> <td>规则说明</td>
</tr> </tr>
<tr> <tr>
<td>单位名称</td> <td>单位信息</td>
<td class="bulecolor">5%</td> <td class="bulecolor">5%</td>
<td>按填录入内容评判</td> <td>填写项平分该项占比分值,信息填写完整即可</td>
</tr> </tr>
<tr> <tr>
<td>建筑信息</td> <td>建筑信息</td>
<td class="bulecolor">10%</td> <td class="bulecolor">10%</td>
<td>根据创建的建筑个数平分该分值,每个建筑根据实际填写的完整度再进行评判</td> <td>根据创建的建筑个数平分该分值,每个建筑根据实际填写的完整度再进行评判</td>
</tr> </tr>
<tr>
<td>平面图</td>
<td class="bulecolor">10%</td>
<td>总平面图<span class="bulecolor">1</span>张,层平面图<span class="bulecolor">1</span></td>
</tr>
<tr> <tr>
<td>四周毗邻</td> <td>四周毗邻</td>
<td class="bulecolor">10%</td> <td class="bulecolor">10%</td>
<td><span class="bulecolor">4</span>个方向均分,每个方向的属性信息要填写完整才能得分</td> <td><span class="bulecolor">4</span>个方向均分,每个方向的属性信息要填写完整,并且包含图片</td>
</tr> </tr>
<tr> <tr>
<td>消防设施</td> <td>消防设施</td>
<td class="bulecolor">25%</td> <td class="bulecolor">25%</td>
<td>消防水源占<span class="bulecolor">30%</span> &nbsp;&nbsp;&nbsp; 安全疏散占<span <td>消防水源占<span class="bulecolor">30%</span> &nbsp;&nbsp;安全疏散设施/消防泡沫系统/安全疏散模块占<span
class="bulecolor">30%</span> <br> 消防水系统占<span class="bulecolor">30%</span> class="bulecolor">30%</span> <br> 消防水系统/自动消防设施/消防设施/消防灭火给水系统/消火栓系统模块占<span
class="bulecolor">30%</span>
&nbsp;&nbsp;&nbsp; 内部消防力量占<span class="bulecolor">10%</span></td> &nbsp;&nbsp;&nbsp; 内部消防力量占<span class="bulecolor">10%</span></td>
</tr> </tr>
<tr> <tr>
<td>重点部位</td> <td>重点部位</td>
<td class="bulecolor">10%</td> <td class="bulecolor">10%</td>
<td><span>根据耐火等级做区分</span>:一级:添加<span class="bulecolor">3</span>个重点部位(1个50%,2个80%,3个满分)<span <td>层平面图中重点部位数量大于1个,并且属性信息填写完整(包含图片)</td>
class="bulecolor">二级</span>:添加<span class="bulecolor">2</span>个重点部位(一个占50%)<span
class="bulecolor">三级</span> 添加<span class="bulecolor">1</span>个重点部位 其它:填写重点提示自动满分</td>
</tr> </tr>
<tr> <tr>
<td>功能分区</td> <td>功能分区</td>
<td class="bulecolor">10%</td> <td class="bulecolor">10%</td>
<td>创建<span class="bulecolor">2</span>条并填写完整得满分</td> <td>任意建筑下功能分区信息填写两条以上并且信息填写完整</td>
</tr> </tr>
<tr> <tr>
<td>实景图</td> <td>实景图</td>
<td class="bulecolor">10%</td> <td class="bulecolor">10%</td>
<td>外观,保证有<span class="bulecolor">2</span>张照片(占<span class="bulecolor">30%</span>); 重点部位,保证有<span <td>外观,保证有<span class="bulecolor">2</span>张照片(占<span class="bulecolor">30%</span>);
class="bulecolor">2</span>张照片(占<span class="bulecolor">30%</span>);安全出口,保证有<span 重点部位,保证有<span class="bulecolor">2</span>张照片(占<span
class="bulecolor">2</span>张照片(占<span class="bulecolor">40%</span></td> class="bulecolor">30%</span>);安全出口,保证有<span class="bulecolor">2</span>张照片(占<span
class="bulecolor">40%</span></td>
</tr> </tr>
<tr> <tr>
<td>CAD上传</td> <td>CAD上传</td>
<td class="bulecolor">10%</td> <td class="bulecolor">10%</td>
<td>上传<span class="bulecolor">2</span>个cad文件</td> <td>保证至少有<span class="bulecolor">1</span>个文件,格式不限</td>
</tr>
<tr>
<td>平面图</td>
<td class="bulecolor">10%</td>
<td>总平面图<span class="bulecolor">1</span>张,建筑平面图<span class="bulecolor">1</span></td>
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
<div class="isUpdates" *ngIf="isUpdates"> <div class="isUpdates" *ngIf="isUpdates">
<span class="name" (click)="submitAudit()" <span class="name" (click)="submitAudit()"
*ngIf="!contentVerify || contentVerify.verifyState == 5 || contentVerify.verifyState == 4">提交审核</span> *ngIf="!contentVerify || contentVerify.verifyState == 5 || contentVerify.verifyState == 4">提交审核</span>

4
src/app/ui/collection-tools-plan/addPlaneFigure.html

@ -12,9 +12,9 @@
</mat-form-field> </mat-form-field>
</div> </div>
<!-- <div class="keyMargin"> <div class="keyMargin">
<a href="javascript:;" class="uploadBackGround" (click)='toGIS()' [ngClass]="{'uploadBackGroundSelected': selectedType == 'gis'}">导入GIS地图</a> <a href="javascript:;" class="uploadBackGround" (click)='toGIS()' [ngClass]="{'uploadBackGroundSelected': selectedType == 'gis'}">导入GIS地图</a>
</div> --> </div>
<div class="keyMargin"> <div class="keyMargin">
<a href="javascript:;" class="uploadBackGround" [ngClass]="{'uploadBackGroundSelected': selectedType == 'image'}"> <a href="javascript:;" class="uploadBackGround" [ngClass]="{'uploadBackGroundSelected': selectedType == 'image'}">

13
src/index.html

@ -20,16 +20,15 @@
</head> </head>
<body> <body>
<app-root></app-root> <app-root></app-root>
</body> </body>
<script src="http://10.81.73.39:8000/webapi/maps?v=2.0&key=e4b359dc7b03f9418b7497f807131346&plugin=AMap.Driving,AMap.MouseTool,AMap.RangingTool"></script> <!-- <script src="http://10.81.73.39:8000/webapi/maps?v=2.0&key=e4b359dc7b03f9418b7497f807131346&plugin=AMap.Driving,AMap.MouseTool,AMap.RangingTool"></script>
<script src="http://10.81.73.39:8000/webapi/ui/1.1/main.js"></script> <script src="http://10.81.73.39:8000/webapi/ui/1.1/main.js"></script> -->
<!-- <script src="https://webapi.amap.com/maps?v=2.0&key=e4b359dc7b03f9418b7497f807131346&plugin=AMap.Driving,AMap.MouseTool,AMap.RangingTool"></script> <script src="https://webapi.amap.com/maps?v=2.0&key=e4b359dc7b03f9418b7497f807131346&plugin=AMap.Driving,AMap.MouseTool,AMap.RangingTool"></script>
<script src="https://webapi.amap.com/ui/1.1/main.js"></script> --> <script src="https://webapi.amap.com/ui/1.1/main.js"></script>
<script src="/assets/html2canvas.js"></script> <script src="/assets/html2canvas.js"></script>
<!-- <script type="text/javascript" src="/assets/wordexport/jquery.js"></script> <script type="text/javascript" src="/assets/wordexport/jquery.js"></script>
<script type="text/javascript" src="/assets/wordexport/FileSaver.js"></script> <script type="text/javascript" src="/assets/wordexport/FileSaver.js"></script>
<script type="text/javascript" src="/assets/wordexport/jquery.wordexport.js"></script> --> <script type="text/javascript" src="/assets/wordexport/jquery.wordexport.js"></script>
</html> </html>

Loading…
Cancel
Save