Browse Source

首页修改

tianwu.sun 2 months atrás
parent
commit
b28b88895e

+ 43 - 1
src/main/java/com/bootdo/datas/controller/DashboardController.java

@@ -1,16 +1,23 @@
 package com.bootdo.datas.controller;
 
+import com.bootdo.common.annotation.Log;
 import com.bootdo.common.utils.PageUtils;
 import com.bootdo.common.utils.Query;
 
+import com.bootdo.common.utils.ShiroUtils;
 import com.bootdo.common.utils.StringUtils;
 import com.bootdo.datas.dto.*;
 import com.bootdo.datas.service.DataService;
 import com.bootdo.datas.service.GyDataService;
+import com.bootdo.system.domain.UserDO;
 import com.google.common.collect.Lists;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -29,7 +36,7 @@ import java.util.Map;
 @Controller
 @RequestMapping("/dashboard/data")
 public class DashboardController {
-
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
     @Autowired
     private GyDataService gyDataService;
     @Autowired
@@ -38,6 +45,41 @@ public class DashboardController {
     @Value("${deployType:#{null}}")
     public String deployType;
 
+    @Value("${sysCity:#{null}}")
+    public String sysCity;
+
+    @GetMapping("/stat")
+    @Log("访问统计仪表盘页面")
+    @RequiresPermissions("dashboard:data:stat")
+    String Data(Model model) {
+        UserDO currUser = ShiroUtils.getUser();
+        String city = currUser.getCity();
+        if(StringUtils.isEmpty(city)){
+            city = sysCity;
+        }
+        if (StringUtils.isNotEmpty(city)) {
+            logger.info("市级");
+            model.addAttribute("loadURl", "dashboard-2");
+
+        } else {
+            logger.info("省级");
+            model.addAttribute("loadURl", "dashboard-1");
+        }
+        return "dashboard/dashboard";
+    }
+
+    // "dashboard/dashboard-1"; //省
+    // "dashboard/dashboard-2"; //市
+    @GetMapping("/dashboard-1")
+    String dashboard1() {
+        return "dashboard/dashboard-1";
+    }
+
+    @GetMapping("/dashboard-2")
+    String dashboard2() {
+        return "dashboard/dashboard-2";
+    }
+
     /**
      * 首页地图数据
      *

+ 5 - 26
src/main/java/com/bootdo/system/controller/LoginController.java

@@ -103,35 +103,14 @@ public class LoginController extends BaseController {
         logger.info("User:" + currUser.getDeptId() + ",deptName:" + currUser.getDeptName());
         model.addAttribute("username", currUser.getUsername());
 
-        String city = currUser.getCity();
-        if(StringUtils.isEmpty(city)){
-            city = sysCity;
-        }
-
-        if (StringUtils.isNotEmpty(city)) {
-            logger.info("市级");
-            model.addAttribute("loadURl", "dashboard-2");
-            //操作手册标识
-            model.addAttribute("hiddenFlag", "");
-        } else {
-            logger.info("省级");
-            model.addAttribute("loadURl", "dashboard-1");
-            //操作手册标识
-            model.addAttribute("hiddenFlag", "");
-        }
+        model.addAttribute("hiddenFlag", "");
+        model.addAttribute("loadURl", "home");
         return "index_v1";
     }
 
-    // "dashboard/dashboard-1"; //工信部
-    // "dashboard/dashboard-2"; //地方主管部门
-    @GetMapping("/dashboard-1")
-    String dashboard1() {
-        return "dashboard/dashboard-1";
-    }
-
-    @GetMapping("/dashboard-2")
-    String dashboard2() {
-        return "dashboard/dashboard-2";
+    @GetMapping("/home")
+    String home() {
+        return "home";
     }
 
     @ResponseBody

BIN
src/main/resources/static/img/home.png


+ 1 - 1
src/main/resources/static/js/contabs.js

@@ -115,7 +115,7 @@ $(function () {
             flag = true;
         var isHome = 0;
         //首页强制处理
-        if (dataUrl == 'dashboard-1' || dataUrl == 'dashboard-2') {
+        if (dataUrl == 'home') {
             dataUrl = 'index_v1.html';
             isHome = 1;
         }

+ 40 - 0
src/main/resources/templates/dashboard/dashboard.html

@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta name="renderer" content="webkit">
+    <title>工业领域重要数据和核心数据目录备案管理系统</title>
+
+    <!--[if lt IE 9]>
+    <meta http-equiv="refresh" content="0;ie.html"/>
+    <![endif]-->
+    <link rel="shortcut icon" href="favicon.ico">
+    <link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
+    <link href="/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
+    <link href="/css/plugins/toastr/toastr.min.css" rel="stylesheet">
+    <link href="/css/animate.css" rel="stylesheet">
+    <link href="/css/style.css?v=4.1.0" rel="stylesheet">
+</head>
+<body class="fixed-sidebar full-height-layout gray-bg"
+      style="overflow: hidden">
+<div id="wrapper">
+    <iframe class="J_iframe" name="iframe0" width="100%" height="100%"
+            src="" th:src="${loadURl}" frameborder="0" data-id="index_v1.html"
+            seamless>
+    </iframe>
+</div>
+<!-- 全局js -->
+<script src="/js/jquery.min.js?v=2.1.4"></script>
+<script src="/js/bootstrap.min.js?v=3.3.6"></script>
+<script src="/js/plugins/metisMenu/jquery.metisMenu.js"></script>
+<script src="/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
+<script src="/js/plugins/layer/layer.min.js"></script>
+
+<!-- vue -->
+<script type="text/javascript"
+        src="/js/vue.min.js">
+
+</script>
+</body>
+</html>

+ 22 - 0
src/main/resources/templates/home.html

@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <style type="text/css">
+        .container {
+            width: 100%; /* 宽度设置为100% */
+            height: 600px; /* 高度设置为你需要的值 */
+            overflow: hidden; /* 超出容器的图片部分将被隐藏 */
+        }
+        .container img {
+            width: 100%; /* 图片宽度设置为100% */
+            height: 100%; /* 图片高度设置为100%,这样图片就会拉伸以填满div */
+        }
+    </style>
+</head>
+<body>
+<div class="container">
+    <img src="../img/home.png">
+</div>
+</body>
+</html>