Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
416721d5f4
@ -109,7 +109,7 @@ public class AgreementPortalController extends DefaultBaseController {
|
|||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@GetMapping("getByType/{agreementType}")
|
@GetMapping("getByType/{agreementType}")
|
||||||
public AgreementPortalDTO getByType(@PathVariable("agreementType") String agreementType) {
|
public AgreementPortalDTO getByType(@PathVariable("agreementType") String agreementType) {
|
||||||
return agreementService.getByType(agreementType);
|
return agreementService.getByType(agreementType, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -123,7 +123,7 @@ public class AgreementPortalAppController extends DefaultBaseController {
|
|||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@GetMapping("getrelease/{agreementType}")
|
@GetMapping("getrelease/{agreementType}")
|
||||||
public AgreementPortalDTO getByType(@PathVariable("agreementType") String agreementType) {
|
public AgreementPortalDTO getByType(@PathVariable("agreementType") String agreementType) {
|
||||||
return agreementService.getByType(agreementType);
|
return agreementService.getByType(agreementType, "yes");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -123,7 +123,7 @@ public class AgreementPortalResourceController extends DefaultBaseController {
|
|||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@GetMapping("getByType/{agreementType}")
|
@GetMapping("getByType/{agreementType}")
|
||||||
public AgreementPortalDTO getByType(@PathVariable("agreementType") String agreementType) {
|
public AgreementPortalDTO getByType(@PathVariable("agreementType") String agreementType) {
|
||||||
return agreementService.getByType(agreementType);
|
return agreementService.getByType(agreementType, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -35,4 +35,9 @@ public class AgreementPortalRouteController extends DefaultBaseController {
|
|||||||
return new ModelAndView("agreementportal/list");
|
return new ModelAndView("agreementportal/list");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("view")
|
||||||
|
public ModelAndView view() {
|
||||||
|
return new ModelAndView("agreementportal/view-agreement");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -193,5 +193,5 @@ public interface IAgreementPortalService {
|
|||||||
* @param agreementType
|
* @param agreementType
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
AgreementPortalDTO getByType(String agreementType);
|
AgreementPortalDTO getByType(String agreementType, String forPortal);
|
||||||
}
|
}
|
@ -214,11 +214,20 @@ public class AgreementPortalServiceImpl extends DefaultBaseService implements IA
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AgreementPortalDTO getByType(String agreementType) {
|
public AgreementPortalDTO getByType(String agreementType, String forPortal) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("agreementType", agreementType);
|
params.put("agreementType", agreementType);
|
||||||
params.put("sendStatus", "published");
|
params.put("sendStatus", "published");
|
||||||
AgreementPortalDTO agreementDTO = agreementDao.getByType(params);
|
AgreementPortalDTO agreementDTO = agreementDao.getByType(params);
|
||||||
|
if(null != forPortal && null != agreementDTO) {
|
||||||
|
// System.out.println("-----" + newsDTO.getContent());
|
||||||
|
if(null != agreementDTO.getContent()) {
|
||||||
|
String replacedText = agreementDTO.getContent().replaceAll("<img src=\"route/file(.*?)\"",
|
||||||
|
"<img src=\"https://www.aimzhu.com/operator/route/file$1\"");
|
||||||
|
agreementDTO.setContent(replacedText);
|
||||||
|
// System.out.println("*****" + newsDTO.getContent());
|
||||||
|
}
|
||||||
|
}
|
||||||
return agreementDTO;
|
return agreementDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,6 +123,14 @@
|
|||||||
return rowData;
|
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',
|
{field: 'isOpen', width: 180, title: '是否启用', align:'center',
|
||||||
templet: function(row) {
|
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 () {
|
form.on('switch(switchEvent)', function () {
|
||||||
let agreementportalId = $(this).attr("agreementportalId");
|
let agreementportalId = $(this).attr("agreementportalId");
|
||||||
let checked = this.checked;
|
let checked = this.checked;
|
||||||
|
117
src/main/resources/templates/agreementportal/view-agreement.html
Normal file
117
src/main/resources/templates/agreementportal/view-agreement.html
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
<!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');
|
||||||
|
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