|
|
@ -4,7 +4,7 @@ |
|
|
|
* @Author: sueRimn |
|
|
|
* @Author: sueRimn |
|
|
|
* @Date: 2021-06-16 13:56:54 |
|
|
|
* @Date: 2021-06-16 13:56:54 |
|
|
|
* @LastEditors: sueRimn |
|
|
|
* @LastEditors: sueRimn |
|
|
|
* @LastEditTime: 2021-06-30 14:01:35 |
|
|
|
* @LastEditTime: 2021-07-02 14:28:59 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
import { HttpClient } from '@angular/common/http'; |
|
|
|
import { HttpClient } from '@angular/common/http'; |
|
|
|
import { Component, Inject, OnInit, Renderer2, ViewChild, Input } from '@angular/core'; |
|
|
|
import { Component, Inject, OnInit, Renderer2, ViewChild, Input } from '@angular/core'; |
|
|
@ -270,6 +270,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
//重点图示上传图片
|
|
|
|
//重点图示上传图片
|
|
|
|
filechange(e, i) { |
|
|
|
filechange(e, i) { |
|
|
|
|
|
|
|
console.log(i) |
|
|
|
let file = e.target.files[0] || null //获取上传的文件
|
|
|
|
let file = e.target.files[0] || null //获取上传的文件
|
|
|
|
let fileSize = file.size || null //上传文件的总大小
|
|
|
|
let fileSize = file.size || null //上传文件的总大小
|
|
|
|
let maxSize = 5 * 1024 * 1024 //5MB一个分片
|
|
|
|
let maxSize = 5 * 1024 * 1024 //5MB一个分片
|
|
|
@ -277,12 +278,22 @@ export class CreatePlanOnlineFiveComponent implements OnInit { |
|
|
|
if (file && fileSize <= maxSize) { //上传文件<=5MB时
|
|
|
|
if (file && fileSize <= maxSize) { //上传文件<=5MB时
|
|
|
|
let upload = this.uploadFile(this.route.snapshot.queryParams.companyId, this.route.snapshot.queryParams.planId, file) |
|
|
|
let upload = this.uploadFile(this.route.snapshot.queryParams.companyId, this.route.snapshot.queryParams.planId, file) |
|
|
|
upload.then((res: any) => { |
|
|
|
upload.then((res: any) => { |
|
|
|
|
|
|
|
if(i.tableth!=undefined){ |
|
|
|
|
|
|
|
i.tableth.json.push('/api/Objects/PlanPlatform/' + res.objectName) |
|
|
|
|
|
|
|
}else{ |
|
|
|
i.imgArr.push('/api/Objects/PlanPlatform/' + res.objectName) |
|
|
|
i.imgArr.push('/api/Objects/PlanPlatform/' + res.objectName) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { //上传文件>5MB时
|
|
|
|
} else { //上传文件>5MB时
|
|
|
|
let upload = this.sectionUpload(this.route.snapshot.queryParams.companyId, this.route.snapshot.queryParams.planId, file) |
|
|
|
let upload = this.sectionUpload(this.route.snapshot.queryParams.companyId, this.route.snapshot.queryParams.planId, file) |
|
|
|
upload.then(res => { |
|
|
|
upload.then(res => { |
|
|
|
|
|
|
|
if(i.tableth!=undefined){ |
|
|
|
|
|
|
|
i.tableth.json.push('/api/Objects/PlanPlatform/' + res) |
|
|
|
|
|
|
|
}else{ |
|
|
|
i.imgArr.push('/api/Objects/PlanPlatform/' + res) |
|
|
|
i.imgArr.push('/api/Objects/PlanPlatform/' + res) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|