协议管理新增预览功能
This commit is contained in:
parent
0ef0280438
commit
3d686aaca9
@ -35,4 +35,9 @@ public class AgreementPortalRouteController extends DefaultBaseController {
|
||||
return new ModelAndView("agreementportal/list");
|
||||
}
|
||||
|
||||
@GetMapping("view")
|
||||
public ModelAndView view() {
|
||||
return new ModelAndView("agreementportal/view-agreement");
|
||||
}
|
||||
|
||||
}
|
@ -123,6 +123,14 @@
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'viewAgreement', fixed: 'right', width: 90, title: '预览', align: 'center',
|
||||
templet: function (row) {
|
||||
return '<a href="route/agreementportal/view?agreementId='+ row.agreementId +'' +
|
||||
'" target="_blank" title="点击预览" class="layui-btn layui-btn-xs" >' +
|
||||
'<i class="fa fa-eye" aria-hidden="true"></i> 预览</a>'
|
||||
}
|
||||
}
|
||||
/*,
|
||||
{field: 'isOpen', width: 180, title: '是否启用', align:'center',
|
||||
templet: function(row) {
|
||||
@ -146,6 +154,19 @@
|
||||
});
|
||||
}
|
||||
|
||||
table.on('tool(dataTable)', function (obj) {
|
||||
var data = obj.data;
|
||||
// 添加说明
|
||||
if ('viewAgreement' == obj.event) {
|
||||
viewAgreement(data);
|
||||
}
|
||||
});
|
||||
|
||||
function viewAgreement(data) {
|
||||
var url = 'route/agreementportal/view?agreementId=' + data.agreementId;
|
||||
window.open(url);
|
||||
}
|
||||
|
||||
form.on('switch(switchEvent)', function () {
|
||||
let agreementportalId = $(this).attr("agreementportalId");
|
||||
let checked = this.checked;
|
||||
|
118
src/main/resources/templates/agreementportal/view-agreement.html
Normal file
118
src/main/resources/templates/agreementportal/view-agreement.html
Normal file
@ -0,0 +1,118 @@
|
||||
<!doctype html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<head>
|
||||
<base th:href="${#request.getContextPath() + '/'}">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<!-- <link rel="icon" type="image/svg+xml" href="./assets/AImzhu.svg"> -->
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<title>用户服务协议</title>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
em,
|
||||
i {
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
ul,
|
||||
li,
|
||||
ol {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#app {
|
||||
width: 1000px;
|
||||
margin: 0 auto;
|
||||
/* border: 1px solid #333; */
|
||||
padding-top: 50px;
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
#title {
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
text-align: center;
|
||||
margin-bottom: 15px;
|
||||
/* border: 1px solid red; */
|
||||
}
|
||||
|
||||
#content {
|
||||
line-height: 35px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
<h2 id="title"></h2>
|
||||
<div id="content"></div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script type="text/javascript" src="assets/js/jquery-3.5.1.min.js"></script>
|
||||
<script src="assets/js/restajax.js"></script>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index'
|
||||
}).use(['index', 'table', 'laydate', 'common', 'form', 'dialog'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var table = layui.table;
|
||||
var admin = layui.admin;
|
||||
var laydate = layui.laydate;
|
||||
var common = layui.common;
|
||||
var resizeTimeout = null;
|
||||
var form = layui.form;
|
||||
var dialog = layui.dialog;
|
||||
|
||||
function getQueryParam(name) {
|
||||
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
|
||||
results = regex.exec(window.location.href);
|
||||
if (!results) return null;
|
||||
if (!results[2]) return '';
|
||||
return decodeURIComponent(results[2].replace(/\+/g, ' '));
|
||||
}
|
||||
|
||||
function initData() {
|
||||
var agreementId = getQueryParam('agreementId');
|
||||
alert(agreementId)
|
||||
var loadLayerIndex;
|
||||
restAjax.get(restAjax.path('api/agreementportal/get/{agreementId}', [agreementId]), {}, null, function(code, data) {
|
||||
const content = document.querySelector('#content')
|
||||
const title = document.querySelector('#title')
|
||||
|
||||
title.innerHTML = data.title
|
||||
content.innerHTML = data.content
|
||||
}, function(code, data) {
|
||||
dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = dialog.msg('加载中', {icon: 16, time: 0, shade: 0.3});
|
||||
}, function() {
|
||||
dialog.close(loadLayerIndex);
|
||||
});
|
||||
}
|
||||
|
||||
initData();
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user