diff --git a/src/app/navigation/navigation.component.scss b/src/app/navigation/navigation.component.scss index 122765b..c52ad7e 100644 --- a/src/app/navigation/navigation.component.scss +++ b/src/app/navigation/navigation.component.scss @@ -199,7 +199,7 @@ mat-sidenav{ ul{ li{ text-align: left; - padding-left: 46px; + padding-left: 56px; } } // mat-panel-title{ diff --git a/src/app/pipes/size.pipe.ts b/src/app/pipes/size.pipe.ts index 7e12666..6a13fb3 100644 --- a/src/app/pipes/size.pipe.ts +++ b/src/app/pipes/size.pipe.ts @@ -36,6 +36,10 @@ export class NamePipe2 implements PipeTransform { @Pipe({name: 'name3'}) export class NamePipe3 implements PipeTransform { transform(name: string): string { - return name.replace(/\//g,'>').substring(9,name.length) + if(name.charAt(name.length-1) == "/"){ + return name.substr(0, name.length - 1).replace(/\//g,'>').substring(9,name.length) + }else{ + return name.replace(/\//g,'>').substring(9,name.length) + } } } \ No newline at end of file diff --git a/src/app/ui/all-file/all-file.component.html b/src/app/ui/all-file/all-file.component.html index 49d9f6f..83b89f6 100644 --- a/src/app/ui/all-file/all-file.component.html +++ b/src/app/ui/all-file/all-file.component.html @@ -67,8 +67,6 @@ {{selectedDataBank}} - -
已全部加载,共 {{fileNum}} 个
@@ -144,11 +142,10 @@
- 战术授课进入 + 战术授课进入
- 战术学习进入 - + 战术学习进入
diff --git a/src/app/ui/all-file/all-file.component.ts b/src/app/ui/all-file/all-file.component.ts index 70e9687..d75b2ea 100644 --- a/src/app/ui/all-file/all-file.component.ts +++ b/src/app/ui/all-file/all-file.component.ts @@ -67,7 +67,6 @@ export class AllFileComponent { ngOnInit(): void { this.dataSource.sort = this.sort; - // this.getAllDataBank() this.getALLFileList("支队级-主官") // 接收发射过来的数据 @@ -81,19 +80,8 @@ export class AllFileComponent { } } - //获得所有资料库,默认显示第一个资料库的文件 - getAllDataBank(){ - this.http.get('/api/DataBanks').subscribe((data:any) => { - if(data.length != 0){ - this.selectedDataBank = data[0].name - this.getALLFileList(data[0].name) - } - }) - } - //获得当前资料库的文件列表 getALLFileList(name){ - this.selectedDataBank = name let paramsdata = { prefix : "allFiles/" + this.selectedDataBank + "/", @@ -102,13 +90,12 @@ export class AllFileComponent { this.http.get(`/api/Objects/drives`,{ params:paramsdata }).subscribe((data:any) => { - // console.log(456,data) this.selection.clear() data.contents.forEach((item)=>{ let typeArr = item.key.split('.') item.type = typeArr[typeArr.length - 1] }) - if(this.selectedDataBank == "装备车辆"){ + if(name.split('/')[1] == "装备"){ data.contents.unshift( { key: "装备车辆/高喷车", lastModified: null, @@ -141,7 +128,7 @@ export class AllFileComponent { } ) } - if(this.selectedDataBank == "设备设施"){ + if(name.split('/')[1] == "消防设施"){ data.contents.unshift( { key: "设备设施/外浮顶罐", lastModified: null, @@ -251,13 +238,12 @@ export class AllFileComponent { goback:any //记录上一级目录 //点击列表每一条的名字 clickName(e,item){ - // console.log(e,item) e.stopPropagation() - if(item.type == "jpg" || item.type == "png" || item.type == "bmp"|| item.type == "gif" || item.type == "jpeg"&& !item.isDir){ const dialogRef = this.dialog.open(ViewDetails, {//调用open方法打开对话框并且携带参数过去 data: {url:item.key,type:"img"} }); + this.downloadFile.handleData(item.key,"查看") }else if(item.type == "mp4" || item.type == "MP4" && !item.isDir){ const dialogRef = this.dialog.open(ViewDetails, {//调用open方法打开对话框并且携带参数过去 @@ -268,7 +254,6 @@ export class AllFileComponent { dialogRef.afterClosed().subscribe(); this.downloadFile.handleData(item.key,"查看") }else if(item.type == "mp3" || item.type == "MP3"&& !item.isDir){ - const dialogRef = this.dialog.open(ViewDetails, {//调用open方法打开对话框并且携带参数过去 width: '400px', height:'108px', @@ -326,9 +311,17 @@ export class AllFileComponent { config.duration = 3000 this.snackBar.open('该文件类型暂不支持在线查看,请下载查看','确定',config) } + } - - + //记录战术授课 + openteacher(){ + let key = `allFiles/${this.selectedDataBank}/战术授课/` + this.downloadFile.handleData(key,"进入") + } + //记录战术学习 + openlearn(){ + let key = `allFiles/${this.selectedDataBank}/战术学习/` + this.downloadFile.handleData(key,"进入") } //返回上一级目录 backTominTop(){ @@ -353,10 +346,12 @@ export class AllFileComponent { uploadBtnEnter(){ this.isOpenUpload = true } + //上传按钮鼠标移出 uploadBtnLeave(){ this.isOpenUpload = false } + //点击每条的checkbox clickCheckBox(e){ e.stopPropagation(); @@ -368,6 +363,7 @@ export class AllFileComponent { } }, 0); } + //点击每条的li clickCheckBoxLi(e,row){ this.selection.toggle(row) @@ -379,8 +375,8 @@ export class AllFileComponent { } }, 0); } - file:any //需要上传的文件 + file:any //需要上传的文件 //input file 选择文件 selectFile (e) { this.file = e.target.files[0] || null //上传的文件 @@ -393,18 +389,16 @@ export class AllFileComponent { }, err => { this.startUploading() - }) + } + ) } - fileArr:any //上传文件夹 async selectFiles (e) { - this.fileArr = e.target.files || null //上传的文件 this.uploadisLoading2 = true this.child.handleData() //子组件处理数据格式 - let _this = this for (var i = 0;i < this.fileArr.length; i++) { let f = this.fileArr[i]; @@ -416,7 +410,6 @@ export class AllFileComponent { let result = await new Promise ((result,reject)=>{ this.startUploading2(f,adddress,result,reject,filesnum,this.selectedDataBank) }) - } } @@ -476,7 +469,6 @@ export class AllFileComponent { } } - PartNumberETag2:any=[]; //每次返回需要保存的信息 //开始分段上传 async subsectionUploading2 (e,result,reject,filesnum,selectedDataBank2) { @@ -558,20 +550,6 @@ export class AllFileComponent { } - - - - - - - - - - - - - - //新建文件夹 createFolder(){ const dialogRef = this.dialog.open(FolderDialog); @@ -601,7 +579,6 @@ export class AllFileComponent { config.duration = 3000 this.snackBar.open('目前已是一级目录','确定',config) } - } @@ -630,11 +607,9 @@ export class AllFileComponent { } else if (file && fileSize>shardSize) { //上传文件>5MB时,分块上传 let data = {fileName: file.name} this.uploadisLoading = true - this.http.post(`/api/NewMultipartUpload/drives/allFiles/${this.selectedDataBank}`,{},{params:data}).subscribe((data:any)=>{ //初始化分段上传 - + this.http.post(`/api/NewMultipartUpload/drives/allFiles/${this.selectedDataBank}`,{},{params:data}).subscribe((data:any)=>{ //初始化分段上传 this.objectName = data.objectName this.uploadId = data.uploadId - // console.log(1) this.subsectionUploading() }) } @@ -789,7 +764,6 @@ export class AllFileComponent { } - // deleteFiles(){ // if (this.selection.selected.length == 1) { // let isDelete = confirm('您确定要删除吗') @@ -824,9 +798,6 @@ export class AllFileComponent { // this.isDelete = false // }) // } - - - // } // } // if (this.selection.selected.length == 0) { @@ -843,8 +814,6 @@ export class AllFileComponent { // } // } - - //下载文件 //下载↓ selectDownloadFile:any; //选择下载的文件 download:any; //下载文件元数据 diff --git a/src/assets/images/house.gif b/src/assets/images/house.gif new file mode 100644 index 0000000..dffe609 Binary files /dev/null and b/src/assets/images/house.gif differ