<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <title>首页</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
    <link rel="stylesheet" href="/css/public.css" media="all">
    <link rel="stylesheet" href="/css/welcome.css" media="all">
    <link rel="icon" href="/images/logo/logo2.ico">
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <div class="layui-row layui-col-space15">
            <!-- 左栏：8个宽度 -->
            <div class="layui-col-md8">
                <!-- 左栏栅格化为15列 -->
                <div class="layui-row layui-col-space15">

                    <!-- 快捷入口卡片（6列宽度）-->
                    <div class="layui-col-md6">
                        <div class="layui-card">
                            <div class="layui-card-header"><i class="fa fa-plane icon icon-blue" aria-hidden="true" /></i>快捷入口</div>
                            <div class="layui-card-body">
                                <div class="welcome-module">
                                    <div class="layui-row layui-col-space10 layuimini-qiuck">
                                        <div class="layui-col-xs3 layuimini-qiuck-module">
                                            <a href="javascript:;" layuimini-content-href="/cloud/enterprise/index" data-title="企业文件" data-icon="fa fa-user">
                                                <i class="fa fa-bank"></i>
                                                <cite>企业文件</cite>
                                            </a>
                                        </div>
                                        <div class="layui-col-xs3 layuimini-qiuck-module">
                                            <a href="javascript:;" layuimini-content-href="/cloud/department/index" data-title="部门文件" data-icon="fa fa-users">
                                                <i class="fa fa-newspaper-o"></i>
                                                <cite>部门文件</cite>
                                            </a>
                                        </div>
                                        <div class="layui-col-xs3 layuimini-qiuck-module">
                                            <a href="javascript:;" layuimini-content-href="/cloud/group/index" data-title="团队文件" data-icon="fa fa-th-list">
                                                <i class="fa fa-users"></i>
                                                <cite>团队文件</cite>
                                            </a>
                                        </div>
                                        <div class="layui-col-xs3 layuimini-qiuck-module">
                                            <a href="javascript:;" layuimini-content-href="/cloud/my/index" data-title="我的文件" data-icon="fa fa-history">
                                                <i class="fa fa-user"></i>
                                                <cite>我的文件</cite>
                                            </a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- 系统报表（12列宽度）-->
                    <div class="layui-col-md12">
                        <div class="layui-card">
                            <div class="layui-card-header"><i class="fa fa-list-ol  icon icon-blue"></i>置顶文件</div>
                            <div class="layui-card-body" id="fileTop">

                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 右栏：4个宽度 -->
            <div class="layui-col-md4">
                <!-- 系统公告 卡片-->
                <!--<div class="layui-card">
                    <div class="layui-card-header"><i class="fa fa-compress  icon icon-blue"></i> 与我共享</div>
                    <div class="layui-card-body layui-text">
                        &lt;!&ndash; 公告列表（可以从数据库中读取，并追加，此处演示，故写静态数据）&ndash;&gt;
                        <div class="layuimini-notice">
                            <div class="layuimini-notice-title"> <a>杨叶清</a> 分享给我 <a>某某商品新品说明</a></div>
                            <div class="layuimini-notice-extra">2026-1-21 00:15:21</div>
                        </div>
                        <div class="layuimini-notice">
                            <div class="layuimini-notice-title"> <a>杨叶清</a> 分享给我 <a>某某商品新品说明</a></div>
                            <div class="layuimini-notice-extra">2026-1-21 00:15:21</div>
                            &lt;!&ndash;<div class="layuimini-notice-page">关于新品说明</div>&ndash;&gt;
                        </div>
                        <div class="layuimini-notice">
                            <div class="layuimini-notice-title"><a>杨叶清</a> 分享给我 <a>某某商品新品说明</a></div>
                            <div class="layuimini-notice-extra">2026-1-21 00:15:21</div>
                            &lt;!&ndash;<div class="layuimini-notice-page">关于新品说明</div>&ndash;&gt;
                        </div>
                        <div class="layuimini-notice">
                            <div class="layuimini-notice-title">  <a>杨叶清</a> 分享给我 <a>某某商品新品说明</a></div>
                            <div class="layuimini-notice-extra">2026-1-21 00:15:21</div>
                            &lt;!&ndash;<div class="layuimini-notice-page">关于新品说明</div>&ndash;&gt;
                        </div>
                        <div class="layuimini-notice">
                            <div class="layuimini-notice-title">  <a>杨叶清</a> 分享给我 <a>某某商品新品说明</a></div>
                            <div class="layuimini-notice-extra">2026-1-21 00:15:21</div>
                            &lt;!&ndash;<div class="layuimini-notice-page">关于新品说明</div>&ndash;&gt;
                        </div>
                        <div class="layuimini-notice">
                            <div class="layuimini-notice-title">  <a>杨叶清</a> 分享给我 <a>某某商品新品说明</a></div>
                            <div class="layuimini-notice-extra">2026-1-21 00:15:21</div>
                            &lt;!&ndash;<div class="layuimini-notice-page">关于新品说明</div>&ndash;&gt;
                        </div>


                    </div>
                </div>-->
                <!-- 项目信息-->
                <div class="layui-card">
                    <div class="layui-card-header"><i class="fa fa-stack-overflow icon icon-blue"></i>文件动态</div>
                    <div class="layui-card-body layui-text" id="notice">
                        <!--<div class="layuimini-notice">
                            <div class="layuimini-notice-title"><span class="layui-badge">新</span> <a>杨叶清</a> 更新了 <a>某某商品新品说明1</a></div>
                            <div class="layuimini-notice-extra">2026-1-21 00:15:21</div>
                            <div class="layuimini-notice-page">【企业文件】 客服商品须知/春节新品</div>
                        </div>-->


                    </div>
                </div>

            </div>
        </div>
    </div>
</div>
<script src="/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script src="/js/jquery-1.10.2.min.js" charset="utf-8"></script>
<script>
    layui.use(['layer', 'miniTab', 'echarts'], function () {
        let $ = layui.jquery,
            layer = layui.layer,
            miniTab = layui.miniTab,
            echarts = layui.echarts;

        miniTab.listen();

        getNotice()
        getFileTop()
    });


    function getNotice(){
        $.ajax({
            type:"get",
            data:{},
            dataType:"json",
            url:"/cloud/trace/list",
            success:function(data){
                if (data.code === 200) {
                    let html = "";
                    data.data.forEach(function (item) {
                        html += `<div class="layuimini-notice">
                                    <div class="layuimini-notice-title"><a>${item.traceCreatorName}</a> <a onclick="lately(\'${item.fileId}\',\'${item.fileOss}\')">${item.traceName}</a></div>
                                    <div class="layuimini-notice-extra"></div>
                                    <div class="layuimini-notice-page">${item.createTime}</div>
                                </div>`;
                    })

                    $('#notice').html(html)
                }
            }
        })
    }

    function getFileTop(){
        $.ajax({
            type:"get",
            data:{},
            dataType:"json",
            url:"/cloud/space/queryByIndexPage",
            success:function(data){
                if (data.code === 200) {
                    let html = "";
                    data.data.forEach(function (item) {
                        html += `<div class="layuimini-notice">
                                    <div class="layuimini-notice-title" onclick="lately(\'${item.fileId}\',\'${item.fileOss}\')">
                                        <img width="25" src="${item.fileImage}">
                                        <a onclick="lately(\'${item.fileId}\',\'${item.fileOss}\')">${item.fileName}</a>  <a>${item.creatorName}</a>
                                    </div>
                                    <div class="layuimini-notice-extra">${item.createTime}</div>
                                </div>`;
                    })

                    $('#fileTop').html(html)
                }
            }
        })
    }
    function lately(id,url){
        let dataSet = {
            "fileId" : id
        }
        $.post("/cloud/lately/addSave", dataSet, function (data) {
            if (data.code === 200) {
                window.open('http://onlinefile.lingtao8.com/onlinePreview?url='+encodeURIComponent(base64Encode(url)));
            }else{
                window.open('http://onlinefile.lingtao8.com/onlinePreview?url='+encodeURIComponent(base64Encode(url)));
            }
        });
    }

    function base64Encode(str) {
        // 将字符串转换为UTF-8编码的字节序列，然后进行Base64编码
        return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, p1) {
            return String.fromCharCode('0x' + p1);
        }));
    }
</script>
</body>
</html>
