| fzzy-igdss-core/src/main/java/com/fzzy/igds/mapper/EventInfoMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| fzzy-igdss-core/src/main/java/com/fzzy/igds/service/EventInfoService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| fzzy-igdss-web/src/main/java/com/fzzy/sys/controller/eventInfo/EventInfoController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| fzzy-igdss-web/src/main/java/com/fzzy/sys/manager/eventInfo/EventInfoManager.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| fzzy-igdss-web/src/main/resources/static/eventInfo/eventInfo-style.css | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| fzzy-igdss-web/src/main/resources/static/eventInfo/eventInfo.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| fzzy-igdss-web/src/main/resources/templates/eventInfo/eventInfo.html | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
fzzy-igdss-core/src/main/java/com/fzzy/igds/mapper/EventInfoMapper.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,10 @@ package com.fzzy.igds.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.fzzy.igds.domain.EventInfo; import org.apache.ibatis.annotations.Mapper; @Mapper public interface EventInfoMapper extends BaseMapper<EventInfo> { } fzzy-igdss-core/src/main/java/com/fzzy/igds/service/EventInfoService.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,85 @@ package com.fzzy.igds.service; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fzzy.igds.data.BaseResp; import com.fzzy.igds.data.IgdsBaseParam; import com.fzzy.igds.domain.EventInfo; import com.fzzy.igds.mapper.EventInfoMapper; import com.fzzy.igds.utils.ContextUtil; import com.ruoyi.common.utils.StringUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.Date; import java.util.List; @Slf4j @Service public class EventInfoService { @Resource private EventInfoMapper eventInfoMapper; /** * å页æ¥è¯¢æ°æ® * * @param page * @param param */ public void listPage(Page<EventInfo> page, IgdsBaseParam param) { QueryWrapper<EventInfo> queryWrapper = getQueryWrapper(param); eventInfoMapper.selectPage(page, queryWrapper); } /** * å°è£ æ¥è¯¢æ¡ä»¶ * * @param param */ public QueryWrapper<EventInfo> getQueryWrapper(IgdsBaseParam param) { QueryWrapper<EventInfo> queryWrapper = new QueryWrapper<>(); param.setCompanyId(ContextUtil.getCompanyId()); queryWrapper.eq("company_id", param.getCompanyId()); if (StringUtils.isNotBlank(param.getDeptId())) { queryWrapper.eq("dept_id", param.getDeptId()); } queryWrapper.orderByDesc("create_time"); return queryWrapper; } public List<EventInfo> listAll(IgdsBaseParam param) { if (null == param) return eventInfoMapper.selectList(null); QueryWrapper<EventInfo> queryWrapper = new QueryWrapper<>(); if (StringUtils.isNotEmpty(param.getName())) { queryWrapper.like("name", param.getName()); } return eventInfoMapper.selectList(queryWrapper); } public BaseResp addData(EventInfo eventInfo) { eventInfo.setId(ContextUtil.generateId()); eventInfo.setCompanyId(ContextUtil.getCompanyId()); eventInfo.setUpdateBy(ContextUtil.getLoginUserName()); eventInfo.setUpdateTime(new Date()); eventInfo.setCreateBy(ContextUtil.getLoginUserName()); eventInfo.setCreateTime(new Date()); return eventInfoMapper.insert(eventInfo) > 0 ? BaseResp.success() : BaseResp.error("æ·»å 失败"); } public BaseResp updateData(EventInfo eventInfo) { eventInfo.setUpdateBy(ContextUtil.getLoginUserName()); eventInfo.setUpdateTime(new Date()); return eventInfoMapper.updateById(eventInfo) > 0 ? BaseResp.success() : BaseResp.error("æ´æ°å¤±è´¥"); } public BaseResp deleteData(EventInfo eventInfo) { return eventInfoMapper.deleteById(eventInfo) > 0 ? BaseResp.success() : BaseResp.error("å é¤å¤±è´¥"); } } fzzy-igdss-web/src/main/java/com/fzzy/sys/controller/eventInfo/EventInfoController.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,59 @@ package com.fzzy.sys.controller.eventInfo; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fzzy.igds.constant.RespCodeEnum; import com.fzzy.igds.data.IgdsBaseParam; import com.fzzy.igds.data.PageResponse; import com.fzzy.igds.domain.EventInfo; import com.fzzy.sys.manager.eventInfo.EventInfoManager; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; @Slf4j @Controller @RequestMapping("/eventInfo") public class EventInfoController { private static final String prefix = "eventInfo"; @Resource private EventInfoManager eventInfoManager; @GetMapping public String getEventInfo( Model model) { IgdsBaseParam param = new IgdsBaseParam(); param.setPage(1); param.setLimit(6); Page<EventInfo> events = eventInfoManager.pageData(param); model.addAttribute("eventInfoList", events.getRecords()); model.addAttribute("currentPage", events.getCurrent()); model.addAttribute("totalItems", events.getTotal()); model.addAttribute("pageSize", events.getSize()); return prefix + "/eventInfo"; } /** * å页è·åæ°æ® * * @param param * @return */ @RequestMapping("/pageData") @ResponseBody public PageResponse<Page<EventInfo>> pageData(@RequestBody IgdsBaseParam param) { Page<EventInfo> eventInfoPage = eventInfoManager.pageData(param); if (null == eventInfoPage.getRecords() || eventInfoPage.getRecords().isEmpty()) { return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(), "è·åå°æ°æ®ä¿¡æ¯ä¸ºç©º"); } return new PageResponse<>(RespCodeEnum.CODE_0000, eventInfoPage); } } fzzy-igdss-web/src/main/java/com/fzzy/sys/manager/eventInfo/EventInfoManager.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,42 @@ package com.fzzy.sys.manager.eventInfo; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fzzy.igds.data.IgdsBaseParam; import com.fzzy.igds.domain.EventInfo; import com.fzzy.igds.service.EventInfoService; import com.fzzy.igds.utils.ContextUtil; import com.ruoyi.common.utils.StringUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.util.ArrayList; @Slf4j @Component public class EventInfoManager { @Resource private EventInfoService eventInfoService; /** * å页æ¥è¯¢æ°æ® * * @param param * @return */ public Page<EventInfo> pageData(IgdsBaseParam param) { if (StringUtils.isEmpty(param.getCompanyId())) { param.setCompanyId(ContextUtil.getCompanyId()); } Page<EventInfo> corePage = new Page<>(param.getPage(), param.getLimit()); eventInfoService.listPage(corePage, param); if (null == corePage.getRecords() || corePage.getRecords().isEmpty()) { return corePage.setRecords(new ArrayList<>()); } return corePage; } } fzzy-igdss-web/src/main/resources/static/eventInfo/eventInfo-style.css
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,201 @@ /* å¾çé¢è§å±æ ·å¼ */ .img-preview { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.9); z-index: 1000; justify-content: center; align-items: center; } .preview-content { max-width: 90%; max-height: 90%; position: relative; } .preview-img { max-width: 100%; max-height: 90vh; border-radius: 4px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); } .close-preview { position: absolute; top: -40px; right: -10px; color: white; font-size: 2rem; cursor: pointer; background: rgba(0, 0, 0, 0.5); width: 40px; height: 40px; border-radius: 50%; display: flex; justify-content: center; align-items: center; transition: all 0.3s ease; } .close-preview:hover { background: rgba(255, 255, 255, 0.2); transform: scale(1.1); } /* å¾çç½æ ¼æ ·å¼ */ .gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 20px; margin-bottom: 15px; } .gallery-item { background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); transition: all 0.3s ease; } .gallery-item:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12); } .gallery-img { width: 100%; height: 195px; object-fit: cover; cursor: pointer; transition: all 0.3s ease; } .gallery-img:hover { opacity: 0.95; } .gallery-info { padding: 15px; } .gallery-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; } .gallery-title { font-size: 1.5rem; font-weight: 600; color: #333; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .gallery-meta { display: flex; flex-direction: column; gap: 2px; } .meta-item { display: flex; align-items: center; font-size: 1.3rem; color: #666; } .meta-item i { width: 16px; margin-right: 6px; color: #999; font-size: 1.25rem; } .gallery-filename i { margin-right: 5px; font-size: 0.7rem; } /* æ ç¾æ ·å¼ */ .gallery-tags { display: flex; flex-wrap: wrap; /*gap: 8px;*/ /*margin: 12px 0;*/ } /* åé¡µæ ·å¼ */ .pagination-container { display: flex; justify-content: center; /*margin-top: 40px;*/ } /* ç©ºç¶ææ ·å¼ */ .empty-state { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: #999; } .empty-state i { font-size: 4rem; margin-bottom: 20px; color: #ddd; } .empty-state h3 { font-size: 1.5rem; margin-bottom: 10px; color: #666; } /* ååºå¼è®¾è®¡ */ @media (max-width: 992px) { .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 25px; } } @media (max-width: 768px) { .main-nav li { margin: 0 10px; } .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; } .gallery-img { height: 180px; } } @media (max-width: 576px) { .gallery-grid { grid-template-columns: 1fr; } .gallery-img { height: 200px; } } fzzy-igdss-web/src/main/resources/static/eventInfo/eventInfo.js
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,278 @@ var layer; var laypage; $(function () { // åå§åå页 layui.use(['laypage', 'layer'], function () { layer = layui.layer; laypage = layui.laypage; // åå§åå页ç»ä»¶ initPagination(); }); // åå§åå¾çé¢è§åè½ initImagePreview(); }); /** * åå§åå页ç»ä»¶ */ function initPagination() { laypage.render({ elem: 'pagination', count: typeof totalItems !== 'undefined' ? totalItems : 0, limit: typeof pageSize !== 'undefined' ? pageSize : 6, curr: typeof currentPage !== 'undefined' ? currentPage : 1, layout: ['count', 'prev', 'page', 'next', 'refresh', 'skip'], jump: function (obj, first) { if (!first) { searchRecord(obj.curr, obj.limit) } } }); } /** * éæ°åå§åå页ç»ä»¶ * @param {number} totalCount - æ»è®°å½æ° * @param {number} pageSize - æ¯é¡µå¤§å° * @param {number} currentPage - å½å页ç */ function reinitPagination(totalCount, pageSize, currentPage) { laypage.render({ elem: 'pagination', count: totalCount, limit: pageSize, curr: currentPage, layout: ['count', 'prev', 'page', 'next', 'refresh', 'skip'], jump: function (obj, first) { if (!first) { searchRecord(obj.curr, obj.limit) } } }); } /** * è·åäºä»¶è®°å½æ°æ® * @param {Object} params - æ¥è¯¢åæ°å¯¹è±¡ * @param {Function} callback - åè°å½æ° */ function fetchEventInfoData(params, callback) { $.ajax({ url: '../../eventInfo/pageData', type: 'POST', dataType: "json", contentType: "application/json;charset=UTF-8", data: JSON.stringify(params), success: function (response) { if (response.code === '0000') { callback(null, response.data); } else { callback(new Error(response.msg || 'æ°æ®å 载失败'), null); } }, error: function (xhr, status, error) { callback(new Error('请æ±å¤±è´¥ï¼è¯·ç¨åéè¯'), null); } }); } /** * æå»ºæ¥è¯¢åæ° * @param {number} page - 页ç * @param {number} size - æ¯é¡µå¤§å° * @returns {Object} æ¥è¯¢åæ°å¯¹è±¡ */ function buildQueryParams(page, size) { var params = { page: page, limit: size }; // æ·»å è¡¨åæ¥è¯¢æ¡ä»¶ var form = document.getElementById('eventInfo-form'); if (form) { var inputs = form.querySelectorAll('input[name], select[name]'); inputs.forEach(function(input) { if (input.value) { // åªæ·»å éç©ºå¼ params[input.name] = input.value; } }); } return params; } /** * æ´æ°äºä»¶ç»å»å 容 * @param {Array} records - äºä»¶è®°å½æ°æ® */ function updateGallery(records) { var container = document.getElementById('gallery-container'); if (!container) return; // æ¸ ç©ºç°æå 容 container.innerHTML = ''; if (!records || records.length === 0) { // æ¾ç¤ºç©ºç¶æ container.innerHTML = ` <div class="empty-state"> <i class="fa-solid fa-bell-slash"></i> <h3>ææ äºä»¶è®°å½</h3> <p>å½å没æå¯å±ç¤ºçAIäºä»¶æ°æ®</p> </div> `; // éèå页 $('.pagination-container').hide(); return; } // æ¾ç¤ºå页 $('.pagination-container').show(); // çæäºä»¶å¡ç var html = ''; records.forEach(function(record) { html += ` <div class="gallery-item"> <img src="/logo-sm.png" alt="${record.id}" data-url="/logo-sm.png" data-id="${record.id}" class="gallery-img" onclick="showEventInfoPreview(this.getAttribute('data-url'))"> <div class="gallery-info"> <div class="gallery-header"> <h3 class="gallery-title">${record.name || record.id}</h3> </div> <div class="gallery-meta"> <div class="meta-item"> <i class="layui-icon layui-icon-home"></i> <span>${record.deptId || ''}</span> </div> <div class="meta-item"> <i class="layui-icon layui-icon-video"></i> <span>${record.serId || ''}</span> </div> <div class="meta-item"> <i class="layui-icon layui-icon-date"></i> <span>${formatDate(record.time)}</span> </div> </div> <div class="gallery-tags"> <span class="tag-person"> <i class="layui-icon layui-icon-face-smile"></i> <span>${record.level || 'æªç¥'}</span> </span> </div> </div> </div> `; }); container.innerHTML = html; } /** * æ ¼å¼åæ¥æ * @param {string|number} date - æ¥æåç¬¦ä¸²ææ¶é´æ³ */ function formatDate(date) { if (!date) return ''; var d = new Date(date); return d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') + '-' + String(d.getDate()).padStart(2, '0') + ' ' + String(d.getHours()).padStart(2, '0') + ':' + String(d.getMinutes()).padStart(2, '0') + ':' + String(d.getSeconds()).padStart(2, '0'); } /** * åå§åå¾çé¢è§åè½ */ function initImagePreview() { var preview = document.getElementById('imgPreview'); var previewImg = document.getElementById('previewImg'); var closeBtn = document.getElementById('closePreview'); // 妿é¢è§å ç´ ä¸åå¨ï¼åä¸åå§å if (!preview || !previewImg) { return; } // å ³éæé®ç¹å»äºä»¶ if (closeBtn) { closeBtn.addEventListener('click', closePreview); } // ç¹å»é¢è§åºåå¤å ³é preview.addEventListener('click', function (e) { if (e.target === preview) { closePreview(); } }); // é®çäºä»¶çå¬ document.addEventListener('keydown', function (e) { if (e.key === 'Escape' && preview.style.display === 'flex') { closePreview(); } }); // å ³éé¢è§å½æ° function closePreview() { preview.style.display = 'none'; previewImg.src = ''; } } /** * æ¾ç¤ºå¾çé¢è§ * @param {string} imgUrl å¾çURL */ function showEventInfoPreview(imgUrl) { var preview = document.getElementById('imgPreview'); var previewImg = document.getElementById('previewImg'); if (preview && previewImg) { previewImg.src = imgUrl; preview.style.display = 'flex'; } } /** * 读åäºä»¶è®°å½ */ function searchRecord(page , size) { var pageNumber = 1; var sizeNumber = 6; if (pageSize && pageSize > 0){ size = pageSize; } if (size && size > 0){ sizeNumber = size; } if (page && page > 0){ pageNumber = page; } // æé æ¥è¯¢åæ°ï¼ä»ç¬¬ä¸é¡µå¼å§ var queryParams = buildQueryParams(pageNumber, sizeNumber); // æ¾ç¤ºloading var loadingIndex = layer.load(1, {shade: [0.1, '#fff']}); // è°ç¨æ°æ®è¯·æ±æ¹æ³ fetchEventInfoData(queryParams, function(error, data) { // å ³éloading layer.close(loadingIndex); if (error) { layer.msg(error.message); return; } // æ´æ°é¡µé¢æ°æ® updateGallery(data.records); // éæ°åå§åå页ç»ä»¶ reinitPagination(data.total, data.size, data.current); }); } fzzy-igdss-web/src/main/resources/templates/eventInfo/eventInfo.html
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,103 @@ <!DOCTYPE html> <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="renderer" content="webkit"> <th:block th:include="include :: header('AIäºä»¶ç®¡ç')" /> <link rel="stylesheet" type="text/css" th:href="@{/ajax/libs/layui-ruoyi/css/layui.css}"/> <link rel="stylesheet" th:href="@{/eventInfo/eventInfo-style.css}"> </head> <body class="gray-bg"> <div class="container-div"> <div class="row"> <div class="col-sm-12 search-collapse"> <form id="eventInfo-form"> <div class="select-list"> <ul> <li> æå±åºåºï¼<input type="text" name="deptId"/> </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="searchRecord()"><i class="fa fa-search"></i> æç´¢</a> <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> éç½®</a> </li> </ul> </div> </form> </div> <div class="col-sm-12 " style="padding-top: 10px;"> <!-- äºä»¶ç½æ ¼ --> <div class="gallery-grid" id="gallery-container"> <!-- äºä»¶ä¸ºç©ºæ¶æ¾ç¤º --> <div th:if="${#lists.isEmpty(eventInfoList)}" class="empty-state"> <i class="fa-solid fa-bell-slash"></i> <h3>ææ äºä»¶è®°å½</h3> <p>å½å没æå¯å±ç¤ºçAIäºä»¶æ°æ®</p> </div> <!-- äºä»¶å¡ç --> <div th:each="eventInfo : ${eventInfoList}" class="gallery-item"> <img th:src="@{/logo-sm.png}" th:alt="${eventInfo.id}" th:data-url="@{/logo-sm.png}" th:data-id="${eventInfo.id}" class="gallery-img" onclick="showEventInfoPreview(this.getAttribute('data-url'))"> <div class="gallery-info"> <div class="gallery-header"> <h3 class="gallery-title" th:text="${eventInfo.name}"></h3> </div> <div class="gallery-meta"> <div class="meta-item"> <i class="layui-icon layui-icon-home"></i> <span th:text="${eventInfo.deptId}"></span> </div> <div class="meta-item"> <i class="layui-icon layui-icon-video"></i> <span th:text="${eventInfo.serId}"></span> </div> <div class="meta-item"> <i class="layui-icon layui-icon-date"></i> <span th:text="${#dates.format(eventInfo.time, 'yyyy-MM-dd HH:mm:ss')}"></span> </div> </div> <!-- æ ç¾å表 --> <div class="gallery-tags"> <span class="tag-person"> <i class="layui-icon layui-icon-face-smile"></i> <span th:text="${eventInfo.level}"></span> </span> </div> </div> </div> </div> <!-- å页æ§ä»¶ --> <div class="pagination-container" th:if="${not #lists.isEmpty(eventInfoList)}"> <div id="pagination"></div> </div> </div> </div> <!-- å¾çé¢è§å± --> <div class="img-preview" id="imgPreview"> <div class="preview-content"> <img src="" alt="é¢è§å¾ç" class="preview-img" id="previewImg"> <div class="close-preview" id="closePreview"> <i class="layui-icon layui-icon-clear"></i> </div> </div> </div> </div> <th:block th:include="include :: footer" /> <script th:src="@{/ajax/libs/layui-ruoyi/layui.js}"></script> <script th:src="@{/eventInfo/eventInfo.js}"></script> <script th:inline="javascript"> var currentPage = [[${currentPage}]]; var totalItems = [[${totalItems}]]; var pageSize = [[${pageSize}]]; </script> </body> </html>