freemarker的使用

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8" />

    <title>导出报告</title>

    <style>

        body {

            margin-left: 10px;

            margin-right: 10px;

            font-family: Arial Unicode MS;

            font-size: 10px;

        }

        * {

            margin: 0;

            padding: 0;

        }

        table {

            border-collapse: collapse;

            border-spacing: 0;

            table-layout: fixed;

            word-break: break-all;

        }

        /*lmy*/

        .mt-10 {

            margin-top: 10px;

        }

        .mb-10 {

            margin-bottom: 10px;

        }

        .fl {

            float: left;

        }

        .fr {

            float: right;

        }

        .clear::after {

            content: '';

            display: block;

            visibility: hidden;

            height: 0;

            clear: both;

            overflow: hidden;

        }

        .main {

            padding: 15px 40px 30px 30px;

        }

        .cover-content {

            overflow: hidden;

            position: relative;

            height: 1100px;

        }

        .cover-content img {

            width: 100%;

            height: 100%;

            display: none;

        }

        .cover-info {

            position: absolute;

            bottom: 20%;

            left: 7%;

        }

        .cover-info p {

            font-size: 16px;

            margin-bottom: 18px;

        }

        .cover-info p label {

            color: #D0C6FF;

        }

        .cover-info p span {

            color: #fff;

        }

        .page-header {

            margin-bottom: 8px;

        }

        .page-name {

            color: #9B9B9B;

        }

        .page-footer {

            color: #9B9B9B;

            margin-top: 9px;

        }

        .task-detail-wrap {

            padding-top: 12px;

        }

        .title {

            position: relative;

            color: #6E52EE;

            margin-left: 20px;

            line-height: 20px;

        }

        .title::before {

            position: absolute;

            top: 3px;

            left: -10px;

            content: '';

            width: 3px;

            height: 14px;

            background-color: #6E52EE;

        }

        .task-detail-item {

            margin-top: 10px;

            padding-left: 24px;

        }

        .task-item {

            width: 100%;

            overflow: hidden;

            margin-bottom: 10px;

        }

        .left-item {

            width: 33.33%;

            float: left;

        }

        .right-item {

            width: 33.33%;

            float: right;

        }

        .task-detail-item label {

            color: #9B9B9B;

        }

        .task-detail-item span {

            color: #000000;

        }

        .line {

            height: 1px;

            margin-bottom: 10px;

            background: #DADADA;

            border-radius: 2px;

        }

        .task-table {

            font-family: Arial Unicode MS;

            margin: 0 10px;

            width: 100%;

        }

        .task-table th {

            padding-top: 4px;

            padding-bottom: 12px;

            color: #5D5D5D;

            background-color: #fff;

            border-color: #CFCFCF;

        }

        .task-table thead tr th {

            border-bottom: 1px solid #ddd;

            border-radius: 2px;

        }

        .task-table thead th {

            padding: 10px;

            font-weight: normal;

            table-layout: fixed;

            word-break: break-all;

            text-align: center;

        }

        .task-table thead tr {

            border-bottom: 1px solid #EBEBEB;

            border-radius: 2px;

        }

        .task-table tbody tr {

            border-bottom: 1px solid #EBEBEB;

            border-radius: 2px;

        }

        .task-table tbody tr td {

            padding: 10px;

            text-align: center;

            color: #9B9B9B;

            border-bottom: 1px solid #ddd;

        }

        .page {

            margin: 0 10px;

            clear: both;

            /* height: 100vh; */

        }

        .page .header {

            margin-top: 0;

            text-align: right;

            color: #9AB7FF;

            padding: 15px 0;

            border-bottom: 1px solid #BFBFBF;

            font-size: 12px;

            font-weight: bold;

        }

        .page .footer {

            color: #9AB7FF;

            padding: 5px 0;

            border-top: 1px solid #BFBFBF;

            font-size: 12px;

            font-weight: bold;

        }

        /*页眉页脚*/

        @media print {

            @page {

                margin: 0px;

                padding: 0px;

                margin-bottom: 20px;

            }

        }

        .no-bold {

            font-weight: normal;

        }

        .breakline {

            word-wrap: break-word;

            word-break: normal;

        }

        .footer {

            margin-top: 10px;

        }

        @page {

            margin: 20mm 5mm 40mm 5mm;

        }

        #header {

            position: running(header);

        }

        #footer {

            position: running(footer);

        }

        @page {

            @top-center {

                content: element(header);

            }

            @bottom-center {

                content: element(footer);

            }

        }

        #pages:before {

            content: counter(page);

            font-size: 10px;

        }

        #pages:after {

            content: counter(pages);

            font-size: 10px;

        }

        @page:first {   /*设置封面*/

            margin: 0pt;    /*让封面的背景图占满整页*/

            padding: 0pt;   /*让封面的背景图占满整页*/

            background: url('${imgPath}');

            @top-left {     /*设置首页的页眉页脚内容为空*/

                content: "";

            }

            @top-right {        /*设置首页的页眉页脚内容为空*/

                content: "";

                display:none;

            }

            @bottom-right {     /*设置首页的页眉页脚内容为空*/

                content:"";

            }

            @bottom-left {      /*设置首页的页眉页脚内容为空*/

                content: "";

            }

            @top-center {

                content: "";

            }

            @bottom-center {

                content: "";

            }

        }

    </style>

</head>

<body>

    <#setting datetime_format="yyyy-MM-dd HH:mm:ss"/>

    <div class="cover-content" style="margin-top: 0px;">

        <img src="${imgPath}" width="100%" style="height: auto;" />

        <div class="cover-info">

            <p>

                <label>任务名称:</label>

                <span>${assetScanningTask.taskName!}</span>

            </p>

            <p>

                <label>数据源名称:</label>

                <#if (assetScanningTask.dsName)??>

                  <span>${assetScanningTask.dsName!}</span>

                <#else>

                    <span> </span>

                </#if>

            </p>

            <p>

                <label>扫描时间:</label>

                <span>${assetScanningTask.startTime!}</span>

            </p>

            <p>

                <label>完成时间:</label>

                <span>${assetScanningTask.endTime!}</span>

            </p>

        </div>

    </div>

    <div class="page">

        <div id="header" class="header">

            <div class="clear page-header">

                <div class="fl page-name">数据地图系统 </div>

                <div class="fr page-name">${assetScanningTask.taskName}任务报告</div>

            </div>

        </div>

        <div id="footer" class="footer">

            <div class="clear page-footer">

                <div class="fl">© 2019 顺丰科技 版权所有 </div>

                <div class="fr">page <span id="pages">/</span></div>

            </div>

        </div>

    </div>

    <div class="main">

        <div class="task-detail-wrap">

            <h2 class="title">基本信息</h2>

            <div class="task-detail-item">

                <div class="task-item">

                    <div class="left-item">

                        <label>任务名称:</label>

                        <span>${assetScanningTask.taskName!}</span>

                    </div>

                    <div class="left-item">

                        <label>任务开始时间:</label>

                        <span>${assetScanningTask.startTime!}</span>

                    </div>

                    <div class="right-item">

                        <#if assetScanningTask.scanningCycle == 1>

                            <#assign scanningCycle='仅一次'/>

                        <#elseif assetScanningTask.scanningCycle == 2>

                            <#assign scanningCycle='每日一次'/>

                        <#elseif assetScanningTask.scanningCycle == 3>

                            <#assign scanningCycle='每周一次'/>

                        <#elseif assetScanningTask.scanningCycle == 4>

                            <#assign scanningCycle='每月一次'/>

                        <#elseif assetScanningTask.scanningCycle == 5>

                            <#assign scanningCycle='每年一次'/>

                        </#if>

                        <label>扫描周期</label>

                        <span>${scanningCycle!}</span>

                    </div>

                </div>

                <div class="task-item">

                    <div class="left-item">

                        <label>扫描目标</label>

                        <span>${assetScanningTask.includeIp!}</span>

                    </div>

                    <div class="left-item">

                        <label>任务运行时间</label>

                        <span></span>

                    </div>

                    <div class="right-item">

                        <#if assetScanningTask.taskStatus == 1>

                            <#assign taskStatus='未开始'/>

                        <#elseif assetScanningTask.taskStatus == 2 >

                            <#assign taskStatus='执行中'/>

                        <#elseif assetScanningTask.taskStatus == 3>

                            <#assign taskStatus='停止'/>

                        <#elseif assetScanningTask.taskStatus == 4>

                            <#assign taskStatus='已完成'/>

                        </#if>

                        <label>扫描状态</label>

                        <span>${taskStatus!}</span>

                    </div>

                </div>

                <div class="task-item">

                    <div class="left-item">

                        <label>扫描端口</label>

                        <span>${assetScanningTask.port!}</span>

                    </div>

                    <div class="left-item">

                        <label>资产扫描数量</label>

                        <span>${assetScanningTask.assetNum!}</span>

                    </div>

                    <div class="right-item">

                        <label>敏感资产数量</label>

                        <span>${assetScanningTask.sensiAssetNum!}</span>

                    </div>

                </div>

            </div>

            <div class="line"></div>

            <div>

                <div>

                    <h2 class="title">列表信息</h2>

                </div>

            </div>

            <table class="task-table" style="width:100%;">

                <thead>

                    <tr>

                        <th>序号</th>

                        <th>资产IP</th>

                        <th>资产类别</th>

                        <th>协议</th>

                        <th>端口</th>

                        <th>服务</th>

                        <th>资产状态</th>

                        <th>资产发现时间</th>

                        <th>是否敏感资产</th>

                    </tr>

                </thead>

                <tbody>

                    <#list assetList as x>

                        <tr>

                            <td>${x.id!}</td>

                            <td>${x.host!}</td>

                            <td>${x.assetType!}</td>

                            <td>${x.protocol!}</td>

                            <td>${x.port!}</td>

                            <td>${x.service!}</td>

                            <td>${x.status!}</td>

                            <td>${x.createTime!}</td>

                            <td>${x.isSensitive!}</td>

                        </tr>

                    </#list>

                </tbody>

            </table>

        </div>

    </div>

</body>

</html>

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 216,324评论 6 498
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,356评论 3 392
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 162,328评论 0 353
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,147评论 1 292
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,160评论 6 388
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,115评论 1 296
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,025评论 3 417
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,867评论 0 274
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,307评论 1 310
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,528评论 2 332
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,688评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,409评论 5 343
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,001评论 3 325
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,657评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,811评论 1 268
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,685评论 2 368
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,573评论 2 353

推荐阅读更多精彩内容

  • 不会用代码框,所以看着有些乱套,,,,html部分 <!DOCTYPE html> 迅雷看看 ...
    这就是个帅气的名字阅读 1,534评论 0 0
  • 各种纯css图标 CSS3可以实现很多漂亮的图形,我收集了32种图形,在下面列出。直接用CSS3画出这些图形,要比...
    剑残阅读 9,537评论 0 8
  • 我的公共CSS文件@import "normalize.css";/begin主页面//begin主页面/body...
    蓝色海洋_1982阅读 1,163评论 0 0
  • 1. tab列表折叠效果 html: 能源系统事业部 岗位名称: 工作地点 岗位名...
    lilyping阅读 1,859评论 0 1
  • 虽然已经毕业三年了,可还是觉得自己一事无成,自己所学专业很多年没碰,差不多忘完了,找的工作不尽人意。于是还是回到了...
    鸢尾花的美好生活阅读 86评论 0 0