Kaynağa Gözat

修复工时管理bug

maotao 8 ay önce
ebeveyn
işleme
f0e10c8eb5

+ 5 - 1
src/app/views/repository-manage-add/repository-manage-add.component.ts

@@ -448,7 +448,7 @@ export class RepositoryManageAddComponent implements OnInit {
448 448
 	beforeUpload = (file: UploadFile) => {
449 449
 		let index = file.name.lastIndexOf('.')
450 450
 		let type = file.name.slice(index + 1)
451
-		console.log('type===',type)
451
+		const isSize = file.size / 1024 / 1024 < 10;
452 452
 		const isPic = (type === 'xlsx' || type === 'pdf' || 
453 453
 		type === 'xls' || type === 'ppt' || type === 'pptx' ||
454 454
 		type === 'txt' || type === 'doc' || type === 'docx');
@@ -456,6 +456,10 @@ export class RepositoryManageAddComponent implements OnInit {
456 456
 			this.message.error('只能上传PDF、word、ppt、excel、txt等文件类型格式!');
457 457
 			return false;
458 458
 		}
459
+		if (!isSize) {
460
+		  this.message.error('文件大小不能大于10MB!');
461
+		  return false;
462
+		}
459 463
 		this.fileData = this.fileData.concat(file);
460 464
 		return false;
461 465
 	};

+ 4 - 4
src/app/views/repository-manage/repository-manage.component.ts

@@ -300,8 +300,8 @@ export class RepositoryManageComponent implements OnInit {
300 300
 		this.modal = true
301 301
 		var that = this;
302 302
 		let query = {
303
-			idx: that.pageIndex - 1,
304
-			sum: that.pageSize,
303
+			idx: 0,
304
+			sum: 9999,
305 305
 			solution: {
306 306
 				hosId: this.hosId,
307 307
 				operationType:'lookOver',
@@ -358,8 +358,8 @@ export class RepositoryManageComponent implements OnInit {
358 358
 		this.modal = true
359 359
 		var that = this;
360 360
 		let query = {
361
-			idx: that.pageIndex - 1,
362
-			sum: that.pageSize,
361
+			idx: 0,
362
+			sum: 9999,
363 363
 			solution: {
364 364
 				hosId: this.hosId,
365 365
 				operationType:'lookOver',