Browse Source

[修改]发现问题上传框调整

master
chenjingyu 4 years ago
parent
commit
0e8d5b5571
  1. 8
      src/app/ui/find-problem/find-problem.component.scss
  2. 4
      src/app/ui/know-route/know-route.component.html
  3. 29
      src/app/ui/know-route/know-route.component.ts

8
src/app/ui/find-problem/find-problem.component.scss

@ -24,8 +24,8 @@
display: flex;
flex-direction:column;
span{
font-size: 0.097656rem;
margin-left: 0.195313rem;
font-size: 0.146484rem;
margin-left: 0.488281rem;
}
textarea{
position: relative;
@ -44,8 +44,8 @@
// background: url('../../../assets/images/upload2.png') no-repeat center center;
position: absolute;
left: 0.390625rem;
bottom: 80px;
left: 0.78125rem;
top: 1.171875rem;
//border: 1px dashed gray;
border-radius:3px;
img{

4
src/app/ui/know-route/know-route.component.html

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-11-05 15:27:58
* @LastEditors: sueRimn
* @LastEditTime: 2020-11-06 14:26:00
* @LastEditTime: 2020-11-06 16:27:42
-->
<div class="box">
<div class="addbw">
@ -24,7 +24,7 @@
</div>
</div>
<div class="image" >
<input id="selectedfile" type="file" name="imgFile" accept=".jpg,.png,.jpeg,.gif,.webp">
<input id="selectedfile" (change)="filechange($event)" type="file" name="imgFile" accept=".jpg,.png,.jpeg,.gif,.webp">
</div>
<div class="remarks">
<span>备注:</span><br>

29
src/app/ui/know-route/know-route.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-11-05 15:27:58
* @LastEditors: sueRimn
* @LastEditTime: 2020-11-06 14:10:39
* @LastEditTime: 2020-11-06 16:36:48
*/
import { Component, OnInit } from '@angular/core';
import { HttpClient,HttpHeaders, HttpEventType } from '@angular/common/http';
@ -64,6 +64,29 @@ export class KnowRouteComponent implements OnInit {
uploadId: any; //上传分块上传事件编号
isspinner:boolean=false //控制进度圈的显示隐藏
PartNumberETag: any = []; //分块上传每次返回需要保存的信息
//change选择文件
filechange(e) {
this.file = e.target.files[0] || null //上传的文件
var reader = new FileReader();
reader.readAsDataURL(this.file);
var image:any = new Image();
reader.onload = function(){
image.src = reader.result
}
setTimeout(() => {
if(image.width>=4096 || image.height>=5000 ){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择分辨率小于4096*5000的图片','确定',config);
}else{
if(this.file){
this.startUploading()
}
}
}, 500);
}
//上传文件
startUploading() {
this.isspinner = true
@ -86,12 +109,12 @@ export class KnowRouteComponent implements OnInit {
})
} else if (file && fileSize >= shardSize) { //上传文件>5MB时,分块上传
let data = { filename: file.name }
/* let data = { filename: file.name }
this.http.post(`/api/NewMultipartUpload/PlanPlatform/${this.unitinfo.id}`, {}, { params: data }).subscribe((data: any) => { //初始化分段上传
this.objectName = data.objectName
this.uploadId = data.uploadId
this.subsectionUploading()
})
}) */
}
}
//开始分块上传

Loading…
Cancel
Save