Browse Source

先进风采 – 点击首页轮播数据触发onclick事件,下载/预览附件

Wang Zi Wen 1 year ago
parent
commit
7cbfd5a01f

+ 26 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/branch/TBranchDemeanorController.java

@@ -70,6 +70,32 @@ public class TBranchDemeanorController extends BaseController
         return AjaxResult.success(profileVOs);
         return AjaxResult.success(profileVOs);
     }
     }
 
 
+    /**
+     * 查询支部园地风采列表(不分页)
+     */
+    @PreAuthorize("@ss.hasPermi('branch:demeanor:list')")
+    @GetMapping("/listNoPage")
+    public AjaxResult listNoPage(TBranchDemeanor tBranchDemeanor)
+    {
+        List<TBranchDemeanor> tBranchDemeanors = tBranchDemeanorService.selectTBranchDemeanorList(tBranchDemeanor);
+        List<ProfilesVO> profileVOs = new ArrayList<>();
+        for (TBranchDemeanor BranchDemeanor : tBranchDemeanors) {
+            TFile tFile = new TFile();
+            tFile.setTableName("branchDem2");
+            tFile.setTableId(BranchDemeanor.getDemeanorId());
+            List<TFile> tFiles = fileService.selectTFileList(tFile);
+            ProfilesVO vo = new ProfilesVO();
+            vo.setTitle(BranchDemeanor.getDemeanorTitle());
+            vo.setDate(BranchDemeanor.getCreateTime());
+            if (tFiles.size() != 0) {
+                TFile file = tFiles.get(0);
+                vo.setUrl(file.getUrl());
+            }
+            profileVOs.add(vo);
+        }
+        return AjaxResult.success(profileVOs);
+    }
+
     /**
     /**
      * 查询支部园地风采列表
      * 查询支部园地风采列表
      */
      */

+ 14 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/branch/vo/ProfilesVO.java

@@ -3,6 +3,7 @@ package com.ruoyi.web.controller.branch.vo;
 import com.ruoyi.common.core.domain.BaseEntity;
 import com.ruoyi.common.core.domain.BaseEntity;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
+import java.util.Date;
 
 
 /**
 /**
  * 首页轮播图片VO
  * 首页轮播图片VO
@@ -14,11 +15,24 @@ import java.math.BigDecimal;
 public class ProfilesVO extends BaseEntity {
 public class ProfilesVO extends BaseEntity {
     /** 图片地址 */
     /** 图片地址 */
     private String url;
     private String url;
+
+    /** 附件地址 */
     private String url2;
     private String url2;
 
 
     /** 标题 */
     /** 标题 */
     private String title;
     private String title;
 
 
+    /** 日期 */
+    private Date date;
+
+    public Date getDate() {
+        return date;
+    }
+
+    public void setDate(Date date) {
+        this.date = date;
+    }
+
     public String getUrl2() {
     public String getUrl2() {
         return url2;
         return url2;
     }
     }

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

@@ -50,7 +50,6 @@ public class SysNoticeController extends BaseController
         List<TBranchPlanItem> tBranchPlanItems = planItemService.selectTBranchPlanItemList(new TBranchPlanItem());
         List<TBranchPlanItem> tBranchPlanItems = planItemService.selectTBranchPlanItemList(new TBranchPlanItem());
         long now = Calendar.getInstance().getTimeInMillis();
         long now = Calendar.getInstance().getTimeInMillis();
         long alarmTime = 30 * 24 * 60 * 60 * 1000L;
         long alarmTime = 30 * 24 * 60 * 60 * 1000L;
-        System.out.println(alarmTime);
         for (TBranchPlanItem tBranchPlanItem : tBranchPlanItems) {
         for (TBranchPlanItem tBranchPlanItem : tBranchPlanItems) {
             long planTime = tBranchPlanItem.getPlanTime().getTime();
             long planTime = tBranchPlanItem.getPlanTime().getTime();
             long difference = planTime - now;
             long difference = planTime - now;

+ 9 - 0
ruoyi-ui/src/api/branch/demeanor.js

@@ -8,6 +8,15 @@ export function listDemeanorProfiles() {
   })
   })
 }
 }
 
 
+// 查询支部园地风采列表(不分页)
+export function listDemeanorNoPage(query) {
+  return request({
+    url: '/branch/demeanor/listNoPage',
+    method: 'get',
+    params: query
+  })
+}
+
 // 查询支部园地风采列表
 // 查询支部园地风采列表
 export function listDemeanor(query) {
 export function listDemeanor(query) {
   return request({
   return request({

+ 18 - 7
ruoyi-ui/src/views/dashboard/DemeanorChart.vue

@@ -3,8 +3,8 @@
     <div class="text-container" :style="{height:height,width:width}">
     <div class="text-container" :style="{height:height,width:width}">
       <ul class="allDemeanor">
       <ul class="allDemeanor">
         <li v-for="(item,index) in demeanorList" class="info">
         <li v-for="(item,index) in demeanorList" class="info">
-          <span style="padding-left: 20px; display: inline-block; width: 20%;">{{parseTime(item.createTime, '{yyyy}-{mm}-{dd}')}}</span>
-          <span style="padding-left: 20px; display: inline-block; width: 80%;">{{item.demeanorTitle}}</span>
+          <span style="padding-left: 20px; display: inline-block; width: 20%;">{{parseTime(item.date, '{yyyy}-{mm}-{dd}')}}</span>
+          <span style="padding-left: 20px; display: inline-block; width: 80%;" id="demeanor-title" @click="handleSee(item.url)">{{item.title}}</span>
         </li>
         </li>
       </ul>
       </ul>
     </div>
     </div>
@@ -12,7 +12,7 @@
 </template>
 </template>
 
 
 <script scoped>
 <script scoped>
-  import { listDemeanor } from "@/api/branch/demeanor";
+  import { listDemeanorNoPage } from "@/api/branch/demeanor";
 
 
   const totalDuration = 2000;
   const totalDuration = 2000;
 
 
@@ -37,14 +37,17 @@
       }
       }
     },
     },
     created() {
     created() {
-      this.listDemeanor();
+      this.listDemeanorNoPage();
     },
     },
     methods: {
     methods: {
+      handleSee(url) {
+        window.open(process.env.VUE_APP_BASE_API + url);
+      },
       /** 查询先进风采列表 */
       /** 查询先进风采列表 */
-      listDemeanor() {
+      listDemeanorNoPage() {
         this.queryParams.isPinned = 1;
         this.queryParams.isPinned = 1;
-        listDemeanor(this.queryParams).then(response => {
-          this.demeanorList = response.rows;
+        listDemeanorNoPage(this.queryParams).then(response => {
+          this.demeanorList = response.data;
           //判断是否需要滚动
           //判断是否需要滚动
           if (this.demeanorList.length > 4) {
           if (this.demeanorList.length > 4) {
             //设置文字滚动一轮时间
             //设置文字滚动一轮时间
@@ -70,6 +73,14 @@
 </script>
 </script>
 
 
 <style scoped>
 <style scoped>
+  #demeanor-title {
+    padding-left: 20px;
+  }
+
+  #demeanor-title:hover {
+    cursor: pointer;
+  }
+
   .text-container {
   .text-container {
     line-height: 30px;
     line-height: 30px;
     overflow: hidden;
     overflow: hidden;