commonFileInfoHeader.ftl
4.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<link rel="icon" href="css/img/favicon.ico" />
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"/>
<link rel="stylesheet" href="bootstrap3-dialog/bootstrap-dialog.min.css"/>
<script src="js/jquery-3.0.0.min.js" type="text/javascript"></script>
<script src="js/jquery.form.min.js" type="text/javascript"></script>
<script src="bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="js/base64.min.js" type="text/javascript"></script>
<script src="bootstrap3-dialog/bootstrap-dialog.min.js" type="text/javascript"></script>
<script>
/**
* 初始化文件信息
*/
function showInfo(){
const name = '${file.name}';
const ownerName = '${file.ownerName}';
const updateTime = '${file.updateTime}';
const type = '${file.type}';
const sizeStr = '${file.sizeStr}';
const folderName = '${file.folderName}';
var $textAndPic = $('<table style="width:100%;"></table>');
$textAndPic.append('<tr><td style="width:20%;height: 30px;">文件名</td><td>'+name+'</td></tr>');
$textAndPic.append('<tr><td style="width:20%;height: 30px;">所属人</td><td>'+ownerName+'</td></tr>');
$textAndPic.append('<tr><td style="width:20%;height: 30px;">更新时间</td><td>'+updateTime+'</td></tr>');
$textAndPic.append('<tr><td style="width:20%;height: 30px;">文档类型</td><td>'+type+'</td></tr>');
$textAndPic.append('<tr><td style="width:20%;height: 30px;">大小</td><td>'+sizeStr+'</td></tr>');
$textAndPic.append('<tr><td style="width:20%;height: 30px;">所属文件夹</td><td>'+folderName+'</td></tr>');
var bootstrapDialog=new BootstrapDialog({
title: '文档信息',
message: $textAndPic,
buttons: [{
label: '确认',
action: function(dialogRef){
dialogRef.close();
}
}]
});
bootstrapDialog.open();
$(bootstrapDialog.$modal[0]).css('z-index',3000);
}
function download(){
const fileId = '${file.fileId}';
window.open(window.location.protocol+'//'+window.location.host+'/download?fileId='+fileId+'&token=${token}');
}
</script>
<style>
* {
margin: 0;
padding: 0;
}
html, body {
height: 100%;
width: 100%;
overflow-y: hidden;
}
.modal-dialog{
width:450px;
}
</style>
<div class="panel panel-default" style="margin-bottom: 0px;z-index: 3000;position: relative;width: 100%;">
<div class="panel-heading">
<div class="panel-title">
<div style="height: 50px;">
<div style="width:50%;display: block;float: left;height: 100%;">
<div style="line-height:25px;">
<span style="font-size: 20px;">${file.name}</span>
<#list file.tagNames as tagName>
<span class="label label-default" style="margin-left: 5px;">${tagName}</span>
</#list>
</div>
<#if file.folderName?exists&&file.updateTime?exists >
<div style="line-height:25px;">
<span class="glyphicon glyphicon-folder-open" aria-hidden="true"></span>
<span style="font-size: 15px;">${file.folderName}</span>
<span>|</span>
<span style="font-size: 15px;">更新时间:${file.updateTime}</span>
</div>
</#if>
</div>
<div style="width:50%;display: block;float: left;line-height: 50px;text-align: right;">
<span class="glyphicon glyphicon-cloud-download" style="margin-left: 10px;cursor: pointer;" aria-hidden="true" onclick="download();">下载</span>
<span class="glyphicon glyphicon-info-sign" style="margin-left: 10px;cursor: pointer;" aria-hidden="true" onclick="showInfo();">文档信息</span>
</div>
</div>
</div>
</div>
</div>