Browse Source

[修改]增长下载时间

tangshan
陈敬瑜 3 years ago
parent
commit
389f930a30
  1. 42
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts
  2. 2
      src/app/plan-management/entry-plan-look/entry-plan-look.component.ts

42
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts

@ -63,7 +63,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
planMode//预案类型
xiazai//是否点击下载按钮进来的
//index
ngOnInit() {
async ngOnInit() {
//this.index = this.getArrayIndex(this.planTemplateData,'单位概况')
this.xiazai=this.route.snapshot.queryParams.xiazai
this.haveNew=this.route.snapshot.queryParams.haveNew
@ -79,12 +79,12 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
this.selectedItem='封面'
this.pattern = 'edit'
}
this.getUnitData()
this.getOrganizations()
await this.getUnitData()
await this.getOrganizations()
if(this.route.snapshot.queryParams.xiazai=='true'){
window.setTimeout(()=>{
window.setTimeout(async ()=>{
this.generatingDoc()
},5000)
},32000)
}
}
@ -123,7 +123,8 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
}
//得到当前单位所在组织机构的tree型数据
allorganizations: any //所有组织机构
getpresentOrganization() {
async getpresentOrganization() {
let result=new Promise((resolve)=>{
this.newallorganizations = this.allorganizations
this.newallorganizations.forEach(item => {
item.children = []
@ -133,6 +134,10 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
}
});
});
this.dataSource.data = this.tree.toTree(this.treedata);
resolve(this.dataSource.data)
})
/* this.http.get("/api/Account/Profiles").subscribe(
(data: any) => {
this.organizationName = data.organizationName
@ -147,18 +152,21 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
}
}
) */
this.dataSource.data = this.tree.toTree(this.treedata);
}
//获得所有组织机构
getOrganizations() {
async getOrganizations() {
let result=new Promise((resolve)=>{
this.http.get('/api/Organizations').subscribe(
(data: any) => {
async (data: any) => {
this.allorganizations = data
this.treedata = this.tree.toTree(data);
this.getpresentOrganization();
await this.getpresentOrganization();
resolve(data)
}
)
})
}
//清空查询条件数据
clearSearch() {
@ -173,18 +181,22 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
let paramsdata: any = {
Name: this.route.snapshot.queryParams.unitName || '',
}
let result=new Promise((resolve)=>{
this.http.get("/api/Companies", { params: paramsdata }).subscribe((data: any) => {
data.items.forEach(element => {
data.items.forEach(async element => {
if (element.id == this.route.snapshot.queryParams.companyId) {
this.unitData = element
if(this.planLevel=='5'){
this.zaixianDr=true
}
//console.log('单位列表信息', this.unitData)
this.getTemplateData()
await this.getTemplateData()
}
});
resolve(data)
})
})
}
//获得四周毗邻信息
getArrayIndex(arr, groupName) {
@ -592,7 +604,8 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
completed: true,
groupName: "单位概况"
}
getTemplateData() {
async getTemplateData() {
let result=new Promise((resolve)=>{
this.http.get(`/api/PlanComponents/${this.route.snapshot.queryParams.planId}/WebText`).subscribe((data: any) => {
console.log('预案内容', data.webTextData)
if(this.route.snapshot.queryParams.planMode==4&&data.webTextData==null){
@ -710,9 +723,12 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
});
console.log(this.planTemplateData)
}
resolve(data)
})
})
}
//引入数据json
yinJson = {

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

@ -1880,7 +1880,7 @@ export class wenbenUpload{
console.log(this.data)
window.setTimeout(()=>{
this.dialogRef.close();
},8000)
},45000)
}
src=this.sanitizer.bypassSecurityTrustResourceUrl(this.data.src);
}

Loading…
Cancel
Save