提交内容

special-20250331
dshclm 4 days ago
parent a84e1c3f14
commit e4811cb916

@ -2,6 +2,9 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org"> <html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head> <head>
<!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<![endif]-->
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>甘肃省人民检察院兰铁分院</title> <title>甘肃省人民检察院兰铁分院</title>
@ -15,12 +18,15 @@
height: 100%; height: 100%;
margin: 0; margin: 0;
padding: 0; padding: 0;
display: -ms-flexbox;
display: flex; display: flex;
-ms-flex-direction: column;
flex-direction: column; flex-direction: column;
} }
/* 设置内容区域自动填充剩余高度 */ /* 设置内容区域自动填充剩余高度 */
#content { #content {
-ms-flex-positive: 1;
flex-grow: 1; flex-grow: 1;
padding-bottom: 28px; padding-bottom: 28px;
} }
@ -31,7 +37,6 @@
padding: 0 5px; padding: 0 5px;
} }
.time { .time {
position: absolute; position: absolute;
right: 0; right: 0;
@ -52,46 +57,28 @@
} }
.row { .row {
display: inline-block; display: -ms-flexbox;
width: 100%;
display: flex; display: flex;
display: inline-block\9; -ms-flex-wrap: nowrap;
justify-content: space-between;
flex-wrap: nowrap; flex-wrap: nowrap;
-ms-flex-pack: justify;
justify-content: space-between;
} }
.main-left { .main-left {
width: 22.3%; width: 22.3%;
} }
.fl {
float: left;
}
sidebar {
border: 1px solid #E1E1E1;
border-bottom: none;
}
.main-right { .main-right {
width: 74.92%; width: 74.92%;
min-height: 516px; min-height: 516px;
} }
.fr {
float: right;
}
.mt10 { .mt10 {
margin-top: 10px; margin-top: 10px;
min-height: 565px; min-height: 565px;
} }
.mt10 li {
border-bottom: 1px solid #ccc;
}
ul.list li .date { ul.list li .date {
color: #999; color: #999;
font-size: 14px; font-size: 14px;
@ -116,11 +103,6 @@
word-break: break-all; word-break: break-all;
} }
a {
text-decoration: none;
color: #333;
}
.main-left h2 { .main-left h2 {
padding: 16px 0px; padding: 16px 0px;
color: #fff; color: #fff;
@ -138,9 +120,6 @@
.sidebar li a.active { .sidebar li a.active {
color: #0055A5; color: #0055A5;
}
.sidebar li a.active {
background: url(/home/base/p110.png) no-repeat 12%; background: url(/home/base/p110.png) no-repeat 12%;
background-size: 5%; background-size: 5%;
} }
@ -207,10 +186,6 @@
word-break: break-all; word-break: break-all;
} }
.speciList li a:hover {
cursor: pointer;
}
.speciList li .date { .speciList li .date {
color: #999; color: #999;
font-size: 14px; font-size: 14px;
@ -220,23 +195,64 @@
} }
.isShow { .isShow {
-ms-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out;
} }
.pagination { .pagination-container {
display: -ms-flexbox;
display: flex; display: flex;
justify-content: center; -ms-flex-pack: justify;
margin-top: 10px; justify-content: space-between;
align-items: center;
margin: 15px 0;
}
.page-size-select {
width: 120px;
margin-left: 10px;
}
.pagination-buttons {
display: -ms-flexbox;
display: flex;
align-items: center;
}
.pagination-button {
margin: 0 3px;
padding: 6px 12px;
border: 1px solid #dcdfe6;
border-radius: 4px;
cursor: pointer;
background-color: #fff;
}
.pagination-button:hover {
background-color: #e8f2ff;
}
.pagination-button:disabled {
color: #c0c4cc;
cursor: not-allowed;
background-color: #f5f7fa;
border-color: #e4e7ed;
} }
.pagination button { .page-info {
margin: 0 5px; margin-right: 10px;
color: #606266;
} }
.pagination-container { display: flex; justify-content: space-between; align-items: center; margin: 15px 0; } .page-size-select { width: 120px; margin-left: 10px; } .pagination-buttons { display: flex; align-items: center; } .pagination-button { margin: 0 3px; padding: 6px 12px; border: 1px solid #dcdfe6; border-radius: 4px; cursor: pointer; background-color: #fff; } .pagination-button:hover { background-color: #e8f2ff; } .pagination-button:disabled { color: #c0c4cc; cursor: not-allowed; background-color: #f5f7fa; border-color: #e4e7ed; } .page-info { margin-right: 10px; color: #606266; }
</style> </style>
</head> </head>
<body class="layui-bg-gray" style=""> <body class="layui-bg-gray" style="">
<!--[if lte IE 10]>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-shim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-sham.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script>
<![endif]-->
<div id="content"> <div id="content">
<!--头部--> <!--头部-->
<th:block th:include="home_head.html :: home_head" /> <th:block th:include="home_head.html :: home_head" />
@ -253,7 +269,7 @@
<div class="container"> <div class="container">
<div class="main"> <div class="main">
<div class="row" id="app"> <div class="row" id="app">
<div class="main-left fl"> <div class="main-left">
<h2> <h2>
专题栏目 专题栏目
</h2> </h2>
@ -272,22 +288,22 @@
</span> </span>
</el-tree> </el-tree>
</div> </div>
<div class="main-right fr common-list"> <div class="main-right common-list">
<ul> <ul>
<li v-for="(item, index) in rightList" :key="index" class="isShow" ref="listRef"> <li v-for="(item, index) in rightList" :key="index" class="isShow" ref="listRef">
<h2 style=" <h2 style="
width: 100%; width: 100%;
height: 50px; height: 50px;
background-color: #ebebeb; background-color: #ebebeb;
line-height: 50px; line-height: 50px;
font-size: 18px; font-size: 18px;
color: #0b61d3; color: #0b61d3;
padding-left: 10px" padding-left: 10px"
> >
{{item.columnName}} {{item.columnName}}
<span v-if="item.sysSpecials.list.length != 0" style="color: #0b61d3;font-size: 14px;float: right;margin-right: 17px;cursor: pointer;" @click="more(index)"> <span v-if="item.sysSpecials.list.length != 0" style="color: #0b61d3;font-size: 14px;float: right;margin-right: 17px;cursor: pointer;" @click="more(index)">
{{ item.isExpanded ? '收起-' : '更多+' }} {{ item.isExpanded ? '收起-' : '更多+' }}
</span> </span>
</h2> </h2>
<ul style="" class="speciList"> <ul style="" class="speciList">
<li v-for="(item2, index2) in getPaginatedData(item, index)" :key="index2"> <li v-for="(item2, index2) in getPaginatedData(item, index)" :key="index2">
@ -326,6 +342,7 @@
</div> </div>
</div> </div>
</div> </div>
<!--底部--> <!--底部-->
<script th:src="@{/home/lib/vue.js}"></script> <script th:src="@{/home/lib/vue.js}"></script>
<script th:src="@{/home/lib/elementui.js}"></script> <script th:src="@{/home/lib/elementui.js}"></script>
@ -334,19 +351,17 @@
<script th:inline="javascript"> <script th:inline="javascript">
window.addEventListener('DOMContentLoaded', function () { window.addEventListener('DOMContentLoaded', function () {
var currentUrl = location.href; var currentUrl = location.href;
// 获取所有的<a>标签
var links = document.querySelectorAll('a'); var links = document.querySelectorAll('a');
// 遍历每个链接并判断其href属性是否与当前URL相同
for (var i = 0; i < links.length; i++) { for (var i = 0; i < links.length; i++) {
if (links[i].href === currentUrl) { if (links[i].href === currentUrl) {
// 添加layui-this类名到对应的父元素的class中 links[i].parentNode.className += ' layui-this';
links[i].parentNode.classList.add('layui-this');
} }
} }
}); });
var app = new Vue({ var app = new Vue({
el: '#app', el: '#app',
data() { data: function() {
return { return {
treeData: [], treeData: [],
defaultProps: { defaultProps: {
@ -356,140 +371,136 @@
}, },
defaultSelected: [[${columnId}]], defaultSelected: [[${columnId}]],
rightList: [], rightList: [],
isMoreTitle: true, isMoreTitle: true
// itemsPerPage: 5, // 每页显示的项目数
}; };
}, },
filters: { filters: {
formatDate(value) { formatDate: function(value) {
if (!value) return ''; if (!value) return '';
const date = new Date(value); var date = new Date(value);
const year = date.getFullYear(); var year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); var month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0'); var day = String(date.getDate()).padStart(2, '0');
return `${year}年${month}月${day}日`; return year + '年' + month + '月' + day + '日';
} }
}, },
mounted() { mounted: function() {
this.getTreeData(); this.getTreeData();
this.getSpecial('') this.getSpecial('');
}, },
methods: { methods: {
getTreeData() { getTreeData: function() {
$.ajax({ $.ajax({
type: "get", type: "get",
url: "/columnTree/getSpecialTree", url: "/columnTree/getSpecialTree",
data: { data: {
columnId: this.defaultSelected, columnId: this.defaultSelected
}, },
success: function (res) { success: function(res) {
if (res.code == 0) { if (res.code == 0) {
this.treeData = res.data; this.treeData = res.data;
// this.defaultSelected = localStorage.getItem('defaultSelected'); this.$nextTick(function() {
this.$nextTick(() => { this.$refs.treeRef.setCurrentKey(this.defaultSelected);
this.$refs.treeRef.setCurrentKey(this.defaultSelected) }.bind(this));
})
} }
}.bind(this) }.bind(this)
}); });
}, },
getSpecial(params) { getSpecial: function(params) {
if (params){ if (params) {
$.ajax({ $.ajax({
type: "get", type: "get",
url: "/columnTree/getSpecial", url: "/columnTree/getSpecial",
data: { data: {
columnId: params.columnId, columnId: params.columnId,
type: '2', type: '2',
pageNum: this.currentPage, pageNum: this.currentPage
}, },
success: function (res) { success: function(res) {
if (res.code == 0) { if (res.code == 0) {
this.rightList = res.data.map(item => ({ this.rightList = res.data.map(function(item) {
...item, return {
isExpanded: false, ...item,
currentPage: 1, isExpanded: false,
itemsPerPage: 5 // 初始化每页显示5条 currentPage: 1,
})); itemsPerPage: 5
};
});
} }
}.bind(this) }.bind(this)
}); });
}else{ } else {
$.ajax({ $.ajax({
type: "get", type: "get",
url: "/columnTree/getSpecial", url: "/columnTree/getSpecial",
data: { data: {
columnId: this.defaultSelected, columnId: this.defaultSelected,
type: '', type: '',
pageNum: this.currentPage, pageNum: this.currentPage
}, },
success: function (res) { success: function(res) {
if (res.code == 0) { if (res.code == 0) {
this.rightList = res.data.map(item => ({ this.rightList = res.data.map(function(item) {
...item, return {
isExpanded: false, ...item,
currentPage: 1, isExpanded: false,
itemsPerPage: 5 // 初始化每页显示5条 currentPage: 1,
})); itemsPerPage: 5
};
});
} }
}.bind(this) }.bind(this)
}); });
} }
}, },
handleNodeClick(data) { handleNodeClick: function(data) {
// localStorage.setItem('defaultSelected',data.columnId)
if (data.columnGrade == '2') { if (data.columnGrade == '2') {
this.getSpecial('') this.getSpecial('');
}else{ } else {
this.getSpecial(data) this.getSpecial(data);
} }
}, },
pubHref(id, type) { pubHref: function(id, type) {
openPopup("/public_view.html?type=" + type + "&id=" + id); window.open("/public_view.html?type=" + type + "&id=" + id, '_blank');
}, },
more(index) { more: function(index) {
if (!this.rightList[index].isExpanded) { this.rightList[index].isExpanded = !this.rightList[index].isExpanded;
// 切换当前列表的展开状态
this.rightList[index].isExpanded = !this.rightList[index].isExpanded;
} else {
this.rightList[index].isExpanded = !this.rightList[index].isExpanded;
}
}, },
getPaginatedData(item, index) { getPaginatedData: function(item, index) {
const startIndex = (this.rightList[index].currentPage - 1) * this.rightList[index].itemsPerPage; var startIndex = (this.rightList[index].currentPage - 1) * this.rightList[index].itemsPerPage;
const endIndex = startIndex + this.rightList[index].itemsPerPage; var endIndex = startIndex + this.rightList[index].itemsPerPage;
return item.sysSpecials.list.slice(startIndex, endIndex); return item.sysSpecials.list.slice(startIndex, endIndex);
}, },
getTotalPages(item) { getTotalPages: function(item) {
return Math.ceil(item.sysSpecials.list.length / this.itemsPerPage); return Math.ceil(item.sysSpecials.list.length / this.itemsPerPage);
}, },
prevPage(index) { prevPage: function(index) {
if (this.rightList[index].currentPage > 1) { if (this.rightList[index].currentPage > 1) {
this.rightList[index].currentPage--; this.rightList[index].currentPage--;
} }
}, },
nextPage(index) { nextPage: function(index) {
const total = this.totalPages(index); var total = this.totalPages(index);
if (this.rightList[index].currentPage < total) { if (this.rightList[index].currentPage < total) {
this.rightList[index].currentPage++; this.rightList[index].currentPage++;
} }
}, },
handlePageSizeChange(index,itemsPerPage) { handlePageSizeChange: function(index, itemsPerPage) {
this.rightList[index].currentPage = 1; // 切换页大小后重置页码 this.rightList[index].currentPage = 1;
this.rightList[index].itemsPerPage = itemsPerPage; // 直接更新当前列表项的属性 this.rightList[index].itemsPerPage = itemsPerPage;
}, },
paginatedData(index) { paginatedData: function(index) {
const item = this.rightList[index]; var item = this.rightList[index];
const start = (item.currentPage - 1) * item.itemsPerPage; var start = (item.currentPage - 1) * item.itemsPerPage;
const end = start + item.itemsPerPage; var end = start + item.itemsPerPage;
return item.sysSpecials.list.slice(start, end); return item.sysSpecials.list.slice(start, end);
}, },
totalPages(index) { totalPages: function(index) {
const item = this.rightList[index]; var item = this.rightList[index];
return Math.ceil(item.sysSpecials.list.length / item.itemsPerPage); return Math.ceil(item.sysSpecials.list.length / item.itemsPerPage);
} }
} }
}) });
function redirect(url) { function redirect(url) {
window.location.href = url; window.location.href = url;

Loading…
Cancel
Save