commonFileInfoHeader.ftl 4.03 KB

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