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