Browse Source

[新增]增加打开本地程序记录以及修改细微样式

master
邵佳豪 5 years ago
parent
commit
71cddb17bc
  1. 2
      src/app/navigation/navigation.component.scss
  2. 4
      src/app/pipes/size.pipe.ts
  3. 7
      src/app/ui/all-file/all-file.component.html
  4. 69
      src/app/ui/all-file/all-file.component.ts
  5. BIN
      src/assets/images/house.gif

2
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{

4
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 {
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)
}
}
}

7
src/app/ui/all-file/all-file.component.html

@ -67,8 +67,6 @@
<span class="allFile">{{selectedDataBank}}</span>
</div>
<div class="titleright">
<span>已全部加载,共 {{fileNum}} 个</span>
</div>
@ -144,11 +142,10 @@
</div>
</div>
<div class="openSystem" *ngIf="!selectedDataBank.includes('/')">
<a href="ax://startup?"><img src="../../../assets/images/pdf.png" alt="">战术授课<span>进入</span></a>
<a (click)="openteacher()" href="ax://startup?"><img src="../../../assets/images/house.gif" alt="">战术授课<span>进入</span></a>
</div>
<div class="openSystem" *ngIf="!selectedDataBank.includes('/')">
<a href="ax2://startup?"><img src="../../../assets/images/pdf.png" alt="">战术学习<span>进入</span></a>
<a (click)="openlearn()" href="ax2://startup?"><img src="../../../assets/images/house.gif" alt="">战术学习<span>进入</span></a>
</div>

69
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)
}
}
@ -631,10 +608,8 @@ export class AllFileComponent {
let data = {fileName: file.name}
this.uploadisLoading = true
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; //下载文件元数据

BIN
src/assets/images/house.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Loading…
Cancel
Save