修改样式

This commit is contained in:
yangjun 2024-09-11 20:21:28 +08:00
parent 3ed75cdd38
commit 62fff0da7b
5 changed files with 159 additions and 126 deletions

View File

@ -123,6 +123,25 @@ public class SysLoginController extends BaseController
ndNew.setNewType("13");
List<NdNew> yqljList = ndNewService.selectNdNewList(ndNew);
mmap.put("yqljList", yqljList);
if(StringUtils.equals("14",newType) || StringUtils.equals("17",newType) || StringUtils.equals("37",newType) || StringUtils.equals("42",newType) ){
ndNew.setNewType(newType);
List<NdNew> list222 = ndNewService.selectNdNewList(ndNew);
if(list222!=null && list222.size()>0){
NdNew ndNew22 = list222.get(0);
mmap.put("info", ndNew22);
ndNew22.setClickRate(ndNew22.getClickRate()+1);
ndNewService.updateNdNew(ndNew22);
}else{
NdNew ndNew22 = new NdNew();
ndNew22.setTitle("暂无数据");
mmap.put("info", ndNew22);
}
return "portal/details";
}
return "portal/list";
}

View File

@ -402,7 +402,7 @@ html {
text-align: center;
color: #ccc;
line-height: 1.2rem;
font-size: .56rem;
font-size: .86rem;
border-bottom: 0;
}
@ -4484,7 +4484,6 @@ li.A_li9:hover p {
}
.portal_list li{
padding: 1.6rem 0;
border-bottom: .04rem dashed rgba(0,0,0,0.2);
}
@ -4499,15 +4498,15 @@ li.A_li9:hover p {
}
.ta{
padding-bottom: .8rem;
margin-bottom: .8rem;
border-bottom: .04rem solid #113a85;
margin-top: 5px;
margin-bottom: 5px;
color: #113a85;
font-family: "time";
}
.title{
margin: .6rem 0 1.4rem;
margin-top: 5px;
margin-bottom: 5px;
}
.fnt_22 {

View File

@ -5,37 +5,24 @@
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: bootstrap-fileinput-css"/>
<th:block th:include="include :: summernote-css" />
<script th:src="@{/ajax/libs/cxselect/jquery.cxselect.js}"></script>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-new-edit" th:object="${ndNew}">
<input name="id" th:field="*{id}" type="hidden">
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">状态:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">-->
<!-- <input type="radio" th:id="${'delFlag_' + dict.dictCode}" name="delFlag" th:value="${dict.dictValue}" th:checked="${dict.default}">-->
<!-- <label th:for="${'delFlag_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<div id="element" class="form-group">
<label class="col-sm-3 control-label">栏目类型:</label>
<div class="col-sm-4">
<select class="first form-control" name="firstType" required>
<option th:value="*{firstType}" selected>[[*{firstTypeStr}]]</option>
<select class="form-control" name="firstType" id="firstType" th:onchange="handleFirst('')">
<option th:value="${item.v}" th:each="item : ${data}">[[${item.n}]]</option>
</select>
</div>
<!-- </div>-->
<!-- <div class="form-group">-->
<div class="col-sm-4">
<select class="second form-control" name="newType" required>
<option th:value="*{newType}" selected>[[*{newTypeStr}]]</option>
<select class="form-control" name="newType" id="newType" th:onchange="handleSecond('')">
</select>
</div>
</div>
<div class="form-group">
<div class="form-group" id="col1">
<label class="col-sm-3 control-label">内容类型:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('news_content_type')}">
@ -78,7 +65,7 @@
<textarea name="linkUrl" type="url" class="form-control">[[*{linkUrl}]]</textarea>
</div>
</div>
<div class="form-group">
<div class="form-group" id="col3">
<label class="col-sm-3 control-label">缩略图:</label>
<div class="col-sm-8">
<input type="hidden" name="imagePath" th:field="*{imagePath}">
@ -96,24 +83,6 @@
</div>
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">摘要:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <textarea name="abstracts" class="form-control">[[*{abstracts}]]</textarea>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">点击率:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="clickRate" th:field="*{clickRate}" type="number" class="form-control">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">排序:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="sort" th:field="*{sort}" class="form-control" type="number">-->
<!-- </div>-->
<!-- </div>-->
</form>
</div>
<th:block th:include="include :: footer" />
@ -123,9 +92,12 @@
<th:block th:include="include :: summernote-js" />
<!-- <th:block th:include="include :: jquery-cxselect-js" />-->
<!--<script th:src="@{/ajax/libs/cxselect/jquery.cxselect.js}"></script>-->
<script th:inline="javascript">
var prefix = ctx + "back/news/news";
$("#form-new-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
@ -133,99 +105,139 @@
}
}
async function handleFirst(newType){
var record = document.getElementById("firstType").value;
await $.ajax({
type: "post",
url: "/back/news/news/getNewType",
data: {
"id": record,
"fragment":'fragment-tasklist'
},
success: function(data) {
console.log('2222->',data);
var rows = data.rows;
var optionhtml = `<option value="">请选择</option>`;
for(var i = 0; i < rows.length; i++) {
optionhtml += `<option value="${rows[i].v}">${rows[i].n}</option>`;
}
document.getElementById("newType").innerHTML = optionhtml;
if(newType){
document.getElementById("newType").value = newType;
}
}
});
}
function handleSecond(newType){
var record = document.getElementById("newType").value;
if(newType!=''){
record = newType;
}
if(record == '48'){
$("#col1").css("display","none");
$("#col3").css("display","none");
$("#contentDiv").css("display","none");
$("#linkUrlDiv").css("display","none");
}else{
$("#col1").css("display","block");
$("#col3").css("display","block");
$("#contentDiv").css("display","block");
$("#linkUrlDiv").css("display","block");
handleRadioChange();
}
}
$(function() {
var ndNew = [[${ndNew}]];
// 直接返回获取
var data = [[${data}]];
$('#element').cxSelect({
selects: ['first', 'second'],
jsonValue: 'v',
data: data
});
var prefix = ctx + "back/news/news";
$("#form-new-edit").validate({
focusCleanup: true
});
// var data = [[${data}]];
// $('#element').cxSelect({
// selects: ['first', 'second'],
// jsonValue: 'v',
// data: data
// });
document.getElementById("firstType").value =ndNew.firstType;
handleFirst(ndNew.newType);
handleSecond(ndNew.newType)
$('.summernote').each(function(i) {
$('#' + this.id).summernote({
lang: 'zh-CN',
dialogsInBody: true,
height: '300px',
callbacks: {
onChange: function(contents, $edittable) {
$("input[name='" + this.id + "']").val(contents);
},
onImageUpload: function(files) {
var obj = this;
var data = new FormData();
data.append("file", files[0]);
$.ajax({
type: "post",
url: ctx + "common/upload",
data: data,
cache: false,
contentType: false,
processData: false,
dataType: 'json',
success: function(result) {
if (result.code == web_status.SUCCESS) {
$('#' + obj.id).summernote('insertImage', result.url);
} else {
$.modal.alertError(result.msg);
}
},
error: function(error) {
$.modal.alertWarning("图片上传失败。");
}
});
}
}
});
var content = $("input[name='" + this.id + "']").val();
$('#' + this.id).summernote('code', content);
$('#' + this.id).summernote({
lang: 'zh-CN',
dialogsInBody: true,
height: '300px',
callbacks: {
onChange: function(contents, $edittable) {
$("input[name='" + this.id + "']").val(contents);
},
onImageUpload: function(files) {
var obj = this;
var data = new FormData();
data.append("file", files[0]);
$.ajax({
type: "post",
url: ctx + "common/upload",
data: data,
cache: false,
contentType: false,
processData: false,
dataType: 'json',
success: function(result) {
if (result.code == web_status.SUCCESS) {
$('#' + obj.id).summernote('insertImage', result.url);
} else {
$.modal.alertError(result.msg);
}
},
error: function(error) {
$.modal.alertWarning("图片上传失败。");
}
});
}
}
});
var content = $("input[name='" + this.id + "']").val();
$('#' + this.id).summernote('code', content);
})
$("input[name='publishTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$(".file-upload").each(function (i) {
var val = $("input[name='" + this.id + "']").val()
$(this).fileinput({
'uploadUrl': ctx + 'common/upload',
initialPreviewAsData: true,
initialPreview: [val],
maxFileCount: 1,
autoReplace: true
}).on('fileuploaded', function (event, data, previewId, index) {
$("input[name='" + event.currentTarget.id + "']").val(data.response.url)
}).on('fileremoved', function (event, id, index) {
$("input[name='" + event.currentTarget.id + "']").val('')
})
$(this).fileinput('_initFileActions');
var val = $("input[name='" + this.id + "']").val()
$(this).fileinput({
'uploadUrl': ctx + 'common/upload',
initialPreviewAsData: true,
initialPreview: [val],
maxFileCount: 1,
autoReplace: true
}).on('fileuploaded', function (event, data, previewId, index) {
$("input[name='" + event.currentTarget.id + "']").val(data.response.url)
}).on('fileremoved', function (event, id, index) {
$("input[name='" + event.currentTarget.id + "']").val('')
})
$(this).fileinput('_initFileActions');
});
$(".file-uploadb").each(function (i) {
var val = $("input[name='" + this.id + "']").val()
$(this).fileinput({
'uploadUrl': ctx + 'common/upload',
initialPreviewAsData: true,
initialPreview: [val],
maxFileCount: 10,
autoReplace: true
}).on('fileuploaded', function (event, data, previewId, index) {
var inputaaa = $("input[name='" + event.currentTarget.id + "']").val();
$("input[name='" + event.currentTarget.id + "']").val(inputaaa+"|"+data.response.url)
}).on('fileremoved', function (event, id, index) {
$("input[name='" + event.currentTarget.id + "']").val('')
})
$(this).fileinput('_initFileActions');
var val = $("input[name='" + this.id + "']").val()
$(this).fileinput({
'uploadUrl': ctx + 'common/upload',
initialPreviewAsData: true,
initialPreview: [val],
maxFileCount: 10,
autoReplace: true
}).on('fileuploaded', function (event, data, previewId, index) {
var inputaaa = $("input[name='" + event.currentTarget.id + "']").val();
$("input[name='" + event.currentTarget.id + "']").val(inputaaa+"|"+data.response.url)
}).on('fileremoved', function (event, id, index) {
$("input[name='" + event.currentTarget.id + "']").val('')
})
$(this).fileinput('_initFileActions');
});
});
@ -250,5 +262,7 @@
handleRadioChange();
</script>
<!-- <script th:src="@{/ajax/libs/cxselect/jquery.cxselect.js}"></script>-->
<script th:src="@{/ajax/libs/cxselect/jquery.cxselect.js}"></script>
</body>
</html>

View File

@ -40,14 +40,14 @@
</div>
<div class="details_title">
<h2>[[${info.title}]]</h2>
<ul>
<h2 style="font-family: 'FZXiaoBiaoSong-Z04S', '方正小标宋简体';font-size: 22px;margin-top: 20px;margin-bottom: 20px;font-weight:700;">[[${info.title}]]</h2>
<ul style="margin-top: 32px;margin-bottom: 20px;font-size: 18px;">
<li>日期:[[${#dates.format(info.publishTime, 'YYYY-MM-dd')}]]</li>
<li>编辑:[[${info.sourceAuthor}]]</li>
<li>点击率:[[${info.clickRate}]]</li>
</ul>
</div>
<div class="con deheligh">
<div class="con deheligh" style="min-height:400px;margin-top: 70px;">
<div class="clearfix">
<div style="text-indent:1.5rem;width:100%;float:left;" id="contentID">
</div>

View File

@ -104,7 +104,8 @@
<div class="left txt">
<div class="fnt_22 title">${item.title}</div>`
if(item.abstracts){
prve +=`<div class="des">${item.abstracts}</div>`
// prve +=`<div class="des">${item.abstracts}</div>`
prve +=`<div class="des"></div>`
}else{
prve +=`<div class="des"> </div>`
}
@ -112,7 +113,7 @@
prve +=`</div>
<div class="right time">
<div class="ta">${item.publishTime}</div>
<div>发布时间</div>
</div>
</a>
</li>