ソースを参照

通知公告新增详细显示

RuoYi 2 年 前
コミット
83b90c3267

+ 11 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java

@@ -100,6 +100,17 @@ public class SysNoticeController extends BaseController
     }
     }
 
 
     /**
     /**
+     * 查询公告详细
+     */
+    @RequiresPermissions("system:notice:list")
+    @GetMapping("/view/{noticeId}")
+    public String view(@PathVariable("noticeId") Long noticeId, ModelMap mmap)
+    {
+        mmap.put("notice", noticeService.selectNoticeById(noticeId));
+        return prefix + "/view";
+    }
+
+    /**
      * 删除公告
      * 删除公告
      */
      */
     @RequiresPermissions("system:notice:remove")
     @RequiresPermissions("system:notice:remove")

+ 7 - 3
ruoyi-admin/src/main/resources/templates/system/notice/notice.html

@@ -59,6 +59,7 @@
         $(function() {
         $(function() {
             var options = {
             var options = {
                 url: prefix + "/list",
                 url: prefix + "/list",
+                viewUrl: prefix + "/view/{id}",
                 createUrl: prefix + "/add",
                 createUrl: prefix + "/add",
                 updateUrl: prefix + "/edit/{id}",
                 updateUrl: prefix + "/edit/{id}",
                 removeUrl: prefix + "/remove",
                 removeUrl: prefix + "/remove",
@@ -71,9 +72,12 @@
 					title : '序号' 
 					title : '序号' 
 				},
 				},
 				{
 				{
-					field : 'noticeTitle', 
-					title : '公告标题' 
-				},
+		            field: 'noticeTitle',
+		            title: '公告标题',
+		            formatter: function (value, row, index) {
+		                return '<a href="javascript:void(0)" onclick="$.operate.view(\'' + row.noticeId + '\')">' + value + '</a>';
+		            }
+		        },
 				{
 				{
 		            field: 'noticeType',
 		            field: 'noticeType',
 		            title: '公告类型',
 		            title: '公告类型',

+ 27 - 0
ruoyi-admin/src/main/resources/templates/system/notice/view.html

@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('公告详细')" />
+</head>
+<body>
+    <div class="main-content">
+        <div class="row">
+            <div class="col-sm-12">
+                <div class="mail-box-header">
+                    <div class="mail-tools tooltip-demo m-t-md">
+                        <h3 style="text-align: center">[[${notice.noticeTitle}]]</h3>
+                        <h5>
+                          <span class="pull-right font-noraml">发送时间:[[${#dates.format(notice.createTime, 'yyyy-MM-dd HH:mm:ss')}]] </span>
+                          <span class="font-noraml">发件人: </span>[[${notice.createBy}]]
+                        </h5>
+                    </div>
+                </div>
+                <div class="mail-box">
+                    <div class="mail-body" th:utext="${notice.noticeContent}"></div>
+                </div>
+            </div>
+        </div>
+    </div>
+    <th:block th:include="include :: footer" />
+</body>
+</html>

+ 1 - 1
ruoyi-admin/src/main/resources/templates/system/user/view.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <!DOCTYPE html>
 <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
 <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
 <head>
 <head>
-	<th:block th:include="include :: header('用户详细')" />
+    <th:block th:include="include :: header('用户详细')" />
 </head>
 </head>
 <body>
 <body>
     <div class="main-content">
     <div class="main-content">

+ 1 - 1
ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml

@@ -18,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
     </resultMap>
     
     
     <sql id="selectNoticeVo">
     <sql id="selectNoticeVo">
-        select notice_id, notice_title, notice_type, notice_content, status, create_by, create_time, update_by, update_time, remark 
+        select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, create_time, update_by, update_time, remark 
 		from sys_notice
 		from sys_notice
     </sql>
     </sql>
     
     

ファイルの差分が大きいため隠しています
+ 2 - 1
sql/ry_20240104.sql