123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8"/>
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
- <title>发布文章</title>
- <link rel="stylesheet" href="../../../assets/libs/layui/css/layui.css"/>
- <link rel="stylesheet" href="../../../assets/module/inputTags.css"/>
- <link rel="stylesheet" href="../../../assets/module/admin.css?v=312"/>
- <link rel="stylesheet" href="../../../assets/module/formSelects/formSelects-v4.css"/>
- <style>
- .time-box {
- overflow: hidden;
- padding: 0px 30px;
- padding-top: 20px;
- }
- .time1 {
- float: left;
- margin-right: 50px;
- }
- .fu {
- display: inline-block;
- font-size: 16px;
- color: #fff;
- margin-bottom: 10px;
- margin-top: 10px;
- padding: 10px 20px;
- background: #3a98ff;
- }
- .line {
- margin-top: -10px;
- border-bottom: 2px solid #3a98ff;
- margin-bottom: 25px;
- }
- fieldset:hover {
- background: #F2F2F2;
- display: block;
- }
- </style>
- </head>
- <body>
- <!-- 页面加载loading -->
- <div class="page-loading">
- <div class="ball-loader">
- <span></span><span></span><span></span><span></span>
- </div>
- </div>
- <!-- 正文开始 -->
- <div class="layui-row" style="margin-top: 10px;background: white">
- <div style="width:93%;margin:0 auto;padding-bottom: 5px;word-wrap:break-word; overflow:hidden;">
- <div style="padding-top: 20px;text-align: right;border: 0px;">
- <button class="layui-btn icon-btn" onclick="history.back()">返 回</button>
- </div>
- <fieldset class="layui-elem-field " style="margin-top: 10px;border: 0px">
- <fieldset class="layui-elem-field layui-field-title">
- <legend>详情信息</legend>
- </fieldset>
- <div class="layui-field-box">
- <legend id="postTitle"></legend>
- <div class="time-box">
- <h4><span class="time1" id="postAuthor">发布人:</span></h4>
- <h4><span class="time1" id="createdTime">时间:</span></h4>
- <h4 style="display: none"><span class="time1" id="groupName">所属部门:</span></h4>
- </div>
- <!--<hr class="layui-bg-gray">-->
- <div class="time-box" id="postDesc" style="display: none">
- </div>
- <!--<hr class="layui-bg-gray">-->
- <div id="showPostContent" style="display: none;margin-left: 30px">
- <blockquote class="layui-elem-quote layui-quote-nm" id="postContent">
- </div>
- </blockquote>
- </div>
- </fieldset>
- <!--<hr class="layui-bg-gray">-->
- </blockquote>
- <div style="margin-bottom: 30px;">
- <!-- 缩略图Div -->
- <div id="postPicUrlDiv" style="display: none">
- <fieldset class="layui-elem-field layui-field-title">
- <legend>缩略图</legend>
- </fieldset>
- <!--<span class="fu">缩略图:</span>-->
- <!--<div class="line"></div>-->
- <p style="margin-left: 30px;">
- <a target="_blank" id="postPicUrlA">
- <img style="width: 60px;height: 60px;" id="postPicUrlImg" src="">
- </a>
- </p>
- </div>
- <fieldset class="layui-elem-field layui-field-title">
- <legend>附加文件</legend>
- </fieldset>
- <!--<span class="fu">附件</span>-->
- <!--<div class="line"></div>-->
- <p style="color: indianred;margin-left: 30px;margin-top: -25px;" class="pull-right">
- 温馨提示:图片可点击查看,文件可点击下载
- </p>
- <div id="attachmentDiv" style="display: none;margin-left: 30px;">
- </div>
- </div>
- </div>
- </div>
- <!-- js部分 -->
- <script type="text/javascript" src="../../../assets/libs/layui/layui.js"></script>
- <script type="text/javascript" src="../../../assets/js/common.js?v=312"></script>
- <script type="text/javascript" src="../../../assets/libs/jquery/jquery-3.2.1.min.js"></script>
- <script type="text/javascript" src="../../../assets/module/inputTags.js"></script>
- <script src="../../../assets/libs/wangEditor/wangEditor.js"></script>
- <script>
- var typePage = '';
- var baseUrl = '';
- layui.use(['layer', 'form', 'table', 'admin', 'zTree', 'uParas', 'upload', 'inputTags', 'formSelects'], function () {
- var $ = layui.jquery;
- var layer = layui.layer;
- var admin = layui.admin;
- var uParas = layui.uParas;
- var postId = uParas.getUrlParam("postId");
- typePage = uParas.getUrlParam("type");
- baseUrl = uParas.baseUrl;
- admin.req(uParas.baseUrl + '/ent/post/get/' + postId, {}, function (resp) {
- if (resp.code == 1) {
- var post = resp.data.post;
- // 填充数据
- $("#postTitle").text('《' + post.postTitle + '》');
- $("#postAuthor").text("发布人:" + post.postAuthor);
- $("#createdTime").text("时间:" + post.createdTime);
- $("#groupName").text("所属部门:" + post.groupName);
- debugger
- if (post.postContent != null && post.postContent != '' && post.postContent != '<p><br></p>') {
- $("#postContent").html(post.postContent);
- $("#showPostContent").show();
- }
- if (post.groupName != null && post.groupName != '') {
- $("#groupName").html(post.groupName);
- $("#groupName").show();
- }
- if (post.postDesc != null && post.postDesc != '') {
- $("#postDesc").html(post.postDesc);
- $("#postDesc").show();
- }
- if (post.postPicUrl && post.postPicUrl != '') {
- $("#postPicUrlImg").attr("src", post.postPicUrl);
- $("#postPicUrlA").attr("href", post.postPicUrl);
- $("#postPicUrlDiv").show();
- }
- //附件初始化
- var attachList = resp.data.attachList;
- if (attachList && attachList.length > 0) {
- for (var i = 0; i < attachList.length; i++) {
- fileHtml(attachList[i].extName, attachList[i].savePath, attachList[i].attName)
- }
- $("#attachmentDiv").show();
- }
- } else {
- layer.msg(resp.msg)
- }
- }, 'GET');
- function fileHtml(ext, path, oriFileName) {
- //文件图标
- var url = "https://view.officeapps.live.com/op/view.aspx?src=http://";
- var hint = '附件';
- var glanceOver = '';
- var download = '';
- var icon = '';
- if (ext === 'xlsx' || ext === 'xls') {
- hint = 'Excel 工作表';
- glanceOver = '<a target="_blank" href="' + path + '" style="color: #5b9bd1;margin-right: 15px;cursor: pointer;" class="pull-right">在线预览</a>';
- download = '<a target="_blank" href="' + path + '" download="' + oriFileName + '" style="color: #5b9bd1;margin-right: 15px;cursor: pointer;" class="pull-right"><i class="layui-icon"></i> 下载</a>';
- icon = '<img style="width: 20px;height: 20px;" src="../../../assets/module/img/uploader/excel.png" alt="">';
- } else if (ext === 'docx' || ext === 'doc') {
- hint = 'Work 文档';
- glanceOver = '<a target="_blank" href="' + path + '" style="color: #5b9bd1;margin-right: 15px;cursor: pointer;" class="pull-right">在线预览</a>';
- download = '<a target="_blank" href="' + path + '" download="' + oriFileName + '" style="color: #5b9bd1;margin-right: 15px;cursor: pointer;" class="pull-right"><i class="layui-icon"></i> 下载</a>';
- icon = '<img style="width: 20px;height: 20px;" download="' + oriFileName + '" src="../../../assets/module/img/uploader/word.png" alt="">';
- } else if (ext === 'ppt' || ext === 'pptx') {
- hint = 'PPT 演示文稿';
- glanceOver = '<a target="_blank" href="' + path + '" style="color: #5b9bd1;margin-right: 15px;cursor: pointer;" class="pull-right">在线预览</a>';
- download = '<a target="_blank" href="' + path + '" download="' + oriFileName + '" style="color: #5b9bd1;margin-right: 15px;cursor: pointer;" class="pull-right"><i class="layui-icon"></i> 下载</a>';
- icon = '<img style="width: 20px;height: 20px;" src="../../../assets/module/img/uploader/ppt.png" alt="">';
- } else if (ext === 'pdf' || ext === 'pdf') {
- hint = 'PDF 文档';
- glanceOver = '<a target="_blank" href="' + path + '" style="color: #5b9bd1;margin-right: 15px;cursor: pointer;" class="pull-right">在线预览</a>';
- download = '<a target="_blank" href="' + path + '" download="' + oriFileName + '" style="color: #5b9bd1;margin-right: 15px;cursor: pointer;" class="pull-right"><i class="layui-icon"></i> 预览</a>';
- icon = '<img style="width: 20px;height: 20px;" src="../../../assets/module/img/uploader/pdf.png" alt="">';
- } else if (ext === 'txt' || ext === 'txt') {
- hint = '文本 文档';
- glanceOver = '<a target="_blank" href="' + path + '" style="color: #5b9bd1;margin-right: 15px;cursor: pointer;" class="pull-right">在线预览</a>';
- download = '<a target="_blank" href="' + path + '" download="' + oriFileName + '" style="color: #5b9bd1;margin-right: 15px;cursor: pointer;" class="pull-right"><i class="layui-icon"></i> 预览</a>';
- icon = '<img style="width: 20px;height: 20px;" src="../../../assets/module/img/uploader/txt.png" alt="">';
- } else if (ext === 'zip' || ext === 'zip') {
- hint = '压缩 文件';
- download = '<a target="_blank" href="' + path + '" download="' + oriFileName + '" style="color: #5b9bd1;margin-right: 15px;cursor: pointer;" class="pull-right"><i class="layui-icon"></i> 下载</a>';
- icon = '<img style="width: 20px;height: 20px;" src="../../../assets/module/img/uploader/zip.png" alt="">';
- } else if (ext === 'rar' || ext === 'rar') {
- hint = '压缩 文件';
- download = '<a target="_blank" href="' + path + '" download="' + oriFileName + '" style="color: #5b9bd1;margin-right: 15px;cursor: pointer;" class="pull-right"><i class="layui-icon"></i> 下载</a>';
- icon = '<img style="width: 20px;height: 20px;" src="../../../assets/module/img/uploader/rar.png" alt="">';
- } else if (ext === 'bmp' || ext === 'jpg' || ext === 'jpeg' || ext === 'png' || ext === 'gif') {
- hint = '照片 附件';
- glanceOver = '<a target="_blank" href="' + path + '" style="color: #5b9bd1;margin-right: 15px;cursor: pointer;" class="pull-right">在线预览</a>';
- download = '<a target="_blank" href="' + path + '" download="' + oriFileName + '" style="color: #5b9bd1;margin-right: 15px;cursor: pointer;" class="pull-right"><i class="layui-icon"></i> 预览</a>';
- icon = '<img style="width: 20px;height: 20px;" src="../../../assets/module/img/uploader/img.png" alt="">';
- } else if (ext === 'audio' || ext === 'audio') {
- icon = '<img style="width: 20px;height: 20px;" src="../../../assets/module/img/uploader/audio.png" alt="">';
- } else if (ext === 'video' || ext === 'video') {
- icon = '<img style="width: 20px;height: 20px;" src="../../../assets/module/img/uploader/video.png" alt="">';
- } else {
- icon = '<img style="width: 20px;height: 20px;" src="../../../assets/module/img/uploader/file.png" alt="">';
- }
- //文件信息置入隐藏域
- var html = '<fieldset class="layui-elem-field " style="padding-top: 5px;padding: 6px;margin-bottom: 5px">';
- html += '<legend style="font-size: 8px">' + hint + '</legend>';
- html += '<a target="_blank" href="' + path + '" style="color: #5b9bd1" download="' + oriFileName + '">';
- html += icon + ' ' + oriFileName;
- html += '</a>';
- // html += glanceOver; //在线预览
- html += download;
- html += '</fieldset>';
- $("#attachmentDiv").append(html);
- }
- });
- //删除附件
- function deleteFile(obj) {
- var pDiv = $(obj).parent();
- pDiv.remove();
- }
- /*在线浏览*/
- function GridClickButton_Detail(filePath) {
- debugger
- // var i = filePath.lastIndexOf("/");
- // var fileName = filePath.substr(i,filePath.length);
- var url = "https://view.officeapps.live.com/op/view.aspx?src=http://" + baseUrl + filePath;
- window.open(url);
- }
- </script>
- </body>
- </html>
|