Explorar el Código

Merge remote-tracking branch 'upstream/master'

zyj hace 10 meses
padre
commit
03006af978
Se han modificado 35 ficheros con 530 adiciones y 523 borrados
  1. 1 1
      pom.xml
  2. 1 1
      ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java
  3. 3 1
      ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java
  4. 1 2
      ruoyi-common/src/main/java/com/ruoyi/common/utils/Arith.java
  5. 26 0
      ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java
  6. 21 2
      ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java
  7. 2 2
      ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
  8. 7 1
      ruoyi-common/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java
  9. 4 2
      ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java
  10. 0 1
      ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java
  11. 1 1
      ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java
  12. 10 9
      ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java
  13. 11 11
      ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java
  14. 1 1
      ruoyi-generator/src/main/resources/vm/java/domain.java.vm
  15. 4 4
      ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm
  16. 6 6
      ruoyi-generator/src/main/resources/vm/vue/index.vue.vm
  17. 4 4
      ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm
  18. 6 6
      ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm
  19. 1 1
      ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/JobInvokeUtil.java
  20. 1 1
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
  21. 0 1
      ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
  22. 0 4
      ruoyi-ui/src/assets/styles/index.scss
  23. 3 12
      ruoyi-ui/src/assets/styles/ruoyi.scss
  24. 10 4
      ruoyi-ui/src/components/FileUpload/index.vue
  25. 1 1
      ruoyi-ui/src/components/HeaderSearch/index.vue
  26. 0 1
      ruoyi-ui/src/components/Pagination/index.vue
  27. 5 5
      ruoyi-ui/src/layout/components/Navbar.vue
  28. 6 21
      ruoyi-ui/src/store/modules/permission.js
  29. 19 27
      ruoyi-ui/src/utils/ruoyi.js
  30. 0 8
      ruoyi-ui/src/views/index.vue
  31. 148 148
      ruoyi-ui/src/views/monitor/cache/index.vue
  32. 1 1
      ruoyi-ui/src/views/monitor/logininfor/index.vue
  33. 1 1
      ruoyi-ui/src/views/monitor/operlog/index.vue
  34. 207 207
      ruoyi-ui/src/views/monitor/server/index.vue
  35. 18 25
      ruoyi-ui/src/views/tool/gen/index.vue

+ 1 - 1
pom.xml

@@ -31,7 +31,7 @@
         <velocity.version>2.3</velocity.version>
         <velocity.version>2.3</velocity.version>
         <jwt.version>0.9.1</jwt.version>
         <jwt.version>0.9.1</jwt.version>
         <!-- override dependency version -->
         <!-- override dependency version -->
-        <tomcat.version>9.0.96</tomcat.version>
+        <tomcat.version>9.0.98</tomcat.version>
         <logback.version>1.2.13</logback.version>
         <logback.version>1.2.13</logback.version>
         <spring-security.version>5.7.12</spring-security.version>
         <spring-security.version>5.7.12</spring-security.version>
         <spring-framework.version>5.3.39</spring-framework.version>
         <spring-framework.version>5.3.39</spring-framework.version>

+ 1 - 1
ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java

@@ -37,7 +37,7 @@ public class TableDataInfo implements Serializable
      * @param list 列表数据
      * @param list 列表数据
      * @param total 总记录数
      * @param total 总记录数
      */
      */
-    public TableDataInfo(List<?> list, int total)
+    public TableDataInfo(List<?> list, long total)
     {
     {
         this.rows = list;
         this.rows = list;
         this.total = total;
         this.total = total;

+ 3 - 1
ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java

@@ -541,7 +541,7 @@ public class Convert
 
 
     /**
     /**
      * 转换为boolean<br>
      * 转换为boolean<br>
-     * String支持的值为:true、false、yes、ok、no,1,0 如果给定的值为空,或者转换失败,返回默认值<br>
+     * String支持的值为:true、false、yes、ok、no、1、0、是、否, 如果给定的值为空,或者转换失败,返回默认值<br>
      * 转换失败不会报错
      * 转换失败不会报错
      *
      *
      * @param value 被转换的值
      * @param value 被转换的值
@@ -570,10 +570,12 @@ public class Convert
             case "yes":
             case "yes":
             case "ok":
             case "ok":
             case "1":
             case "1":
+            case "是":
                 return true;
                 return true;
             case "false":
             case "false":
             case "no":
             case "no":
             case "0":
             case "0":
+            case "否":
                 return false;
                 return false;
             default:
             default:
                 return defaultValue;
                 return defaultValue;

+ 1 - 2
ruoyi-common/src/main/java/com/ruoyi/common/utils/Arith.java

@@ -108,7 +108,6 @@ public class Arith
                     "The scale must be a positive integer or zero");
                     "The scale must be a positive integer or zero");
         }
         }
         BigDecimal b = new BigDecimal(Double.toString(v));
         BigDecimal b = new BigDecimal(Double.toString(v));
-        BigDecimal one = BigDecimal.ONE;
-        return b.divide(one, scale, RoundingMode.HALF_UP).doubleValue();
+        return b.divide(BigDecimal.ONE, scale, RoundingMode.HALF_UP).doubleValue();
     }
     }
 }
 }

+ 26 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java

@@ -286,6 +286,32 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
         return str.substring(start, end);
         return str.substring(start, end);
     }
     }
 
 
+    /**
+     * 在字符串中查找第一个出现的 `open` 和最后一个出现的 `close` 之间的子字符串
+     * 
+     * @param str 要截取的字符串
+     * @param open 起始字符串
+     * @param close 结束字符串
+     * @return 截取结果
+     */
+    public static String substringBetweenLast(final String str, final String open, final String close)
+    {
+        if (isEmpty(str) || isEmpty(open) || isEmpty(close))
+        {
+            return NULLSTR;
+        }
+        final int start = str.indexOf(open);
+        if (start != INDEX_NOT_FOUND)
+        {
+            final int end = str.lastIndexOf(close);
+            if (end != INDEX_NOT_FOUND)
+            {
+                return str.substring(start + open.length(), end);
+            }
+        }
+        return NULLSTR;
+    }
+
     /**
     /**
      * 判断是否为空,并且不是空白字符
      * 判断是否为空,并且不是空白字符
      * 
      * 

+ 21 - 2
ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java

@@ -21,6 +21,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
 import com.ruoyi.common.constant.Constants;
 import com.ruoyi.common.constant.Constants;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.StringUtils;
+import org.springframework.http.MediaType;
 
 
 /**
 /**
  * 通用http发送方法
  * 通用http发送方法
@@ -125,6 +126,19 @@ public class HttpUtils
      * @return 所代表远程资源的响应结果
      * @return 所代表远程资源的响应结果
      */
      */
     public static String sendPost(String url, String param)
     public static String sendPost(String url, String param)
+    {
+        return sendPost(url, param, MediaType.APPLICATION_FORM_URLENCODED_VALUE);
+    }
+
+    /**
+     * 向指定 URL 发送POST方法的请求
+     * 
+     * @param url 发送请求的 URL
+     * @param param 请求参数
+     * @param contentType 内容类型
+     * @return 所代表远程资源的响应结果
+     */
+    public static String sendPost(String url, String param, String contentType)
     {
     {
         PrintWriter out = null;
         PrintWriter out = null;
         BufferedReader in = null;
         BufferedReader in = null;
@@ -138,7 +152,7 @@ public class HttpUtils
             conn.setRequestProperty("connection", "Keep-Alive");
             conn.setRequestProperty("connection", "Keep-Alive");
             conn.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)");
             conn.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)");
             conn.setRequestProperty("Accept-Charset", "utf-8");
             conn.setRequestProperty("Accept-Charset", "utf-8");
-            conn.setRequestProperty("contentType", "utf-8");
+            conn.setRequestProperty("Content-Type", contentType);
             conn.setDoOutput(true);
             conn.setDoOutput(true);
             conn.setDoInput(true);
             conn.setDoInput(true);
             out = new PrintWriter(conn.getOutputStream());
             out = new PrintWriter(conn.getOutputStream());
@@ -190,6 +204,11 @@ public class HttpUtils
     }
     }
 
 
     public static String sendSSLPost(String url, String param)
     public static String sendSSLPost(String url, String param)
+    {
+        return sendSSLPost(url, param, MediaType.APPLICATION_FORM_URLENCODED_VALUE);
+    }
+
+    public static String sendSSLPost(String url, String param, String contentType)
     {
     {
         StringBuilder result = new StringBuilder();
         StringBuilder result = new StringBuilder();
         String urlNameString = url + "?" + param;
         String urlNameString = url + "?" + param;
@@ -204,7 +223,7 @@ public class HttpUtils
             conn.setRequestProperty("connection", "Keep-Alive");
             conn.setRequestProperty("connection", "Keep-Alive");
             conn.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)");
             conn.setRequestProperty("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)");
             conn.setRequestProperty("Accept-Charset", "utf-8");
             conn.setRequestProperty("Accept-Charset", "utf-8");
-            conn.setRequestProperty("contentType", "utf-8");
+            conn.setRequestProperty("Content-Type", contentType);
             conn.setDoOutput(true);
             conn.setDoOutput(true);
             conn.setDoInput(true);
             conn.setDoInput(true);
 
 

+ 2 - 2
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java

@@ -1148,6 +1148,7 @@ public class ExcelUtil<T>
                 String dictType = attr.dictType();
                 String dictType = attr.dictType();
                 if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value))
                 if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value))
                 {
                 {
+                    cell.getCellStyle().setDataFormat(this.wb.getCreationHelper().createDataFormat().getFormat(dateFormat));
                     cell.setCellValue(parseDateToStr(dateFormat, value));
                     cell.setCellValue(parseDateToStr(dateFormat, value));
                 }
                 }
                 else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value))
                 else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value))
@@ -1448,8 +1449,7 @@ public class ExcelUtil<T>
      */
      */
     public String encodingFilename(String filename)
     public String encodingFilename(String filename)
     {
     {
-        filename = UUID.randomUUID() + "_" + filename + ".xlsx";
-        return filename;
+        return UUID.randomUUID() + "_" + filename + ".xlsx";
     }
     }
 
 
     /**
     /**

+ 7 - 1
ruoyi-common/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java

@@ -1,5 +1,6 @@
 package com.ruoyi.common.utils.spring;
 package com.ruoyi.common.utils.spring;
 
 
+import org.springframework.aop.framework.Advised;
 import org.springframework.aop.framework.AopContext;
 import org.springframework.aop.framework.AopContext;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.NoSuchBeanDefinitionException;
 import org.springframework.beans.factory.NoSuchBeanDefinitionException;
@@ -120,7 +121,12 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC
     @SuppressWarnings("unchecked")
     @SuppressWarnings("unchecked")
     public static <T> T getAopProxy(T invoker)
     public static <T> T getAopProxy(T invoker)
     {
     {
-        return (T) AopContext.currentProxy();
+        Object proxy = AopContext.currentProxy();
+        if (((Advised) proxy).getTargetSource().getTargetClass() == invoker.getClass())
+        {
+            return (T) proxy;
+        }
+        return invoker;
     }
     }
 
 
     /**
     /**

+ 4 - 2
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java

@@ -20,9 +20,11 @@ import com.alibaba.fastjson2.JSON;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.common.core.text.Convert;
 import com.ruoyi.common.enums.BusinessStatus;
 import com.ruoyi.common.enums.BusinessStatus;
 import com.ruoyi.common.enums.HttpMethod;
 import com.ruoyi.common.enums.HttpMethod;
 import com.ruoyi.common.filter.PropertyPreExcludeFilter;
 import com.ruoyi.common.filter.PropertyPreExcludeFilter;
+import com.ruoyi.common.utils.ExceptionUtil;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.ServletUtils;
 import com.ruoyi.common.utils.ServletUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.StringUtils;
@@ -52,7 +54,7 @@ public class LogAspect
      * 处理请求前执行
      * 处理请求前执行
      */
      */
     @Before(value = "@annotation(controllerLog)")
     @Before(value = "@annotation(controllerLog)")
-    public void boBefore(JoinPoint joinPoint, Log controllerLog)
+    public void doBefore(JoinPoint joinPoint, Log controllerLog)
     {
     {
         TIME_THREADLOCAL.set(System.currentTimeMillis());
         TIME_THREADLOCAL.set(System.currentTimeMillis());
     }
     }
@@ -107,7 +109,7 @@ public class LogAspect
             if (e != null)
             if (e != null)
             {
             {
                 operLog.setStatus(BusinessStatus.FAIL.ordinal());
                 operLog.setStatus(BusinessStatus.FAIL.ordinal());
-                operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000));
+                operLog.setErrorMsg(StringUtils.substring(Convert.toStr(e.getMessage(), ExceptionUtil.getExceptionMessage(e)), 0, 2000));
             }
             }
             // 设置方法名称
             // 设置方法名称
             String className = joinPoint.getTarget().getClass().getName();
             String className = joinPoint.getTarget().getClass().getName();

+ 0 - 1
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java

@@ -55,7 +55,6 @@ public class ResourcesConfig implements WebMvcConfigurer
     public CorsFilter corsFilter()
     public CorsFilter corsFilter()
     {
     {
         CorsConfiguration config = new CorsConfiguration();
         CorsConfiguration config = new CorsConfiguration();
-        config.setAllowCredentials(true);
         // 设置访问源地址
         // 设置访问源地址
         config.addAllowedOriginPattern("*");
         config.addAllowedOriginPattern("*");
         // 设置访问源请求头
         // 设置访问源请求头

+ 1 - 1
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java

@@ -70,7 +70,7 @@ public class SysPermissionService
                 // 多角色设置permissions属性,以便数据权限匹配权限
                 // 多角色设置permissions属性,以便数据权限匹配权限
                 for (SysRole role : roles)
                 for (SysRole role : roles)
                 {
                 {
-                    if (StringUtils.equals(role.getStatus(), UserConstants.ROLE_NORMAL))
+                    if (StringUtils.equals(role.getStatus(), UserConstants.ROLE_NORMAL) && !role.isAdmin())
                     {
                     {
                         Set<String> rolePerms = menuService.selectMenuPermsByRoleId(role.getRoleId());
                         Set<String> rolePerms = menuService.selectMenuPermsByRoleId(role.getRoleId());
                         role.setPermissions(rolePerms);
                         role.setPermissions(rolePerms);

+ 10 - 9
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java

@@ -25,7 +25,7 @@ import io.jsonwebtoken.SignatureAlgorithm;
 
 
 /**
 /**
  * token验证处理
  * token验证处理
- *
+ * 
  * @author ruoyi
  * @author ruoyi
  */
  */
 @Component
 @Component
@@ -49,14 +49,14 @@ public class TokenService
 
 
     protected static final long MILLIS_MINUTE = 60 * MILLIS_SECOND;
     protected static final long MILLIS_MINUTE = 60 * MILLIS_SECOND;
 
 
-    private static final Long MILLIS_MINUTE_TEN = 20 * 60 * 1000L;
+    private static final Long MILLIS_MINUTE_TWENTY = 20 * 60 * 1000L;
 
 
     @Autowired
     @Autowired
     private RedisCache redisCache;
     private RedisCache redisCache;
 
 
     /**
     /**
      * 获取用户身份信息
      * 获取用户身份信息
-     *
+     * 
      * @return 用户信息
      * @return 用户信息
      */
      */
     public LoginUser getLoginUser(HttpServletRequest request)
     public LoginUser getLoginUser(HttpServletRequest request)
@@ -107,7 +107,7 @@ public class TokenService
 
 
     /**
     /**
      * 创建令牌
      * 创建令牌
-     *
+     * 
      * @param loginUser 用户信息
      * @param loginUser 用户信息
      * @return 令牌
      * @return 令牌
      */
      */
@@ -120,20 +120,21 @@ public class TokenService
 
 
         Map<String, Object> claims = new HashMap<>();
         Map<String, Object> claims = new HashMap<>();
         claims.put(Constants.LOGIN_USER_KEY, token);
         claims.put(Constants.LOGIN_USER_KEY, token);
+        claims.put(Constants.JWT_USERNAME, loginUser.getUsername());
         return createToken(claims);
         return createToken(claims);
     }
     }
 
 
     /**
     /**
      * 验证令牌有效期,相差不足20分钟,自动刷新缓存
      * 验证令牌有效期,相差不足20分钟,自动刷新缓存
-     *
-     * @param loginUser
+     * 
+     * @param loginUser 登录信息
      * @return 令牌
      * @return 令牌
      */
      */
     public void verifyToken(LoginUser loginUser)
     public void verifyToken(LoginUser loginUser)
     {
     {
         long expireTime = loginUser.getExpireTime();
         long expireTime = loginUser.getExpireTime();
         long currentTime = System.currentTimeMillis();
         long currentTime = System.currentTimeMillis();
-        if (expireTime - currentTime <= MILLIS_MINUTE_TEN)
+        if (expireTime - currentTime <= MILLIS_MINUTE_TWENTY)
         {
         {
             refreshToken(loginUser);
             refreshToken(loginUser);
         }
         }
@@ -141,7 +142,7 @@ public class TokenService
 
 
     /**
     /**
      * 刷新令牌有效期
      * 刷新令牌有效期
-     *
+     * 
      * @param loginUser 登录信息
      * @param loginUser 登录信息
      */
      */
     public void refreshToken(LoginUser loginUser)
     public void refreshToken(LoginUser loginUser)
@@ -155,7 +156,7 @@ public class TokenService
 
 
     /**
     /**
      * 设置用户代理信息
      * 设置用户代理信息
-     *
+     * 
      * @param loginUser 登录信息
      * @param loginUser 登录信息
      */
      */
     public void setUserAgent(LoginUser loginUser)
     public void setUserAgent(LoginUser loginUser)

+ 11 - 11
ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java

@@ -128,9 +128,9 @@ public class GenTableServiceImpl implements IGenTableService
         int row = genTableMapper.updateGenTable(genTable);
         int row = genTableMapper.updateGenTable(genTable);
         if (row > 0)
         if (row > 0)
         {
         {
-            for (GenTableColumn cenTableColumn : genTable.getColumns())
+            for (GenTableColumn genTableColumn : genTable.getColumns())
             {
             {
-                genTableColumnMapper.updateGenTableColumn(cenTableColumn);
+                genTableColumnMapper.updateGenTableColumn(genTableColumn);
             }
             }
         }
         }
     }
     }
@@ -424,16 +424,16 @@ public class GenTableServiceImpl implements IGenTableService
             {
             {
                 throw new ServiceException("树名称字段不能为空");
                 throw new ServiceException("树名称字段不能为空");
             }
             }
-            else if (GenConstants.TPL_SUB.equals(genTable.getTplCategory()))
+        }
+        else if (GenConstants.TPL_SUB.equals(genTable.getTplCategory()))
+        {
+            if (StringUtils.isEmpty(genTable.getSubTableName()))
             {
             {
-                if (StringUtils.isEmpty(genTable.getSubTableName()))
-                {
-                    throw new ServiceException("关联子表的表名不能为空");
-                }
-                else if (StringUtils.isEmpty(genTable.getSubTableFkName()))
-                {
-                    throw new ServiceException("子表关联的外键名不能为空");
-                }
+                throw new ServiceException("关联子表的表名不能为空");
+            }
+            else if (StringUtils.isEmpty(genTable.getSubTableFkName()))
+            {
+                throw new ServiceException("子表关联的外键名不能为空");
             }
             }
         }
         }
     }
     }

+ 1 - 1
ruoyi-generator/src/main/resources/vm/java/domain.java.vm

@@ -71,9 +71,9 @@ public class ${ClassName} extends ${Entity}
     {
     {
         return $column.javaField;
         return $column.javaField;
     }
     }
+
 #end
 #end
 #end
 #end
-
 #if($table.sub)
 #if($table.sub)
     public List<${subClassName}> get${subClassName}List()
     public List<${subClassName}> get${subClassName}List()
     {
     {

+ 4 - 4
ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm

@@ -75,7 +75,7 @@
           icon="el-icon-plus"
           icon="el-icon-plus"
           size="mini"
           size="mini"
           @click="handleAdd"
           @click="handleAdd"
-          v-hasPermi="['${moduleName}:${businessName}:add']"
+          v-hasPermi="['${permissionPrefix}:add']"
         >新增</el-button>
         >新增</el-button>
       </el-col>
       </el-col>
       <el-col :span="1.5">
       <el-col :span="1.5">
@@ -144,21 +144,21 @@
             type="text"
             type="text"
             icon="el-icon-edit"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['${moduleName}:${businessName}:edit']"
+            v-hasPermi="['${permissionPrefix}:edit']"
           >修改</el-button>
           >修改</el-button>
           <el-button
           <el-button
             size="mini"
             size="mini"
             type="text"
             type="text"
             icon="el-icon-plus"
             icon="el-icon-plus"
             @click="handleAdd(scope.row)"
             @click="handleAdd(scope.row)"
-            v-hasPermi="['${moduleName}:${businessName}:add']"
+            v-hasPermi="['${permissionPrefix}:add']"
           >新增</el-button>
           >新增</el-button>
           <el-button
           <el-button
             size="mini"
             size="mini"
             type="text"
             type="text"
             icon="el-icon-delete"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['${moduleName}:${businessName}:remove']"
+            v-hasPermi="['${permissionPrefix}:remove']"
           >删除</el-button>
           >删除</el-button>
         </template>
         </template>
       </el-table-column>
       </el-table-column>

+ 6 - 6
ruoyi-generator/src/main/resources/vm/vue/index.vue.vm

@@ -75,7 +75,7 @@
           icon="el-icon-plus"
           icon="el-icon-plus"
           size="mini"
           size="mini"
           @click="handleAdd"
           @click="handleAdd"
-          v-hasPermi="['${moduleName}:${businessName}:add']"
+          v-hasPermi="['${permissionPrefix}:add']"
         >新增</el-button>
         >新增</el-button>
       </el-col>
       </el-col>
       <el-col :span="1.5">
       <el-col :span="1.5">
@@ -86,7 +86,7 @@
           size="mini"
           size="mini"
           :disabled="single"
           :disabled="single"
           @click="handleUpdate"
           @click="handleUpdate"
-          v-hasPermi="['${moduleName}:${businessName}:edit']"
+          v-hasPermi="['${permissionPrefix}:edit']"
         >修改</el-button>
         >修改</el-button>
       </el-col>
       </el-col>
       <el-col :span="1.5">
       <el-col :span="1.5">
@@ -97,7 +97,7 @@
           size="mini"
           size="mini"
           :disabled="multiple"
           :disabled="multiple"
           @click="handleDelete"
           @click="handleDelete"
-          v-hasPermi="['${moduleName}:${businessName}:remove']"
+          v-hasPermi="['${permissionPrefix}:remove']"
         >删除</el-button>
         >删除</el-button>
       </el-col>
       </el-col>
       <el-col :span="1.5">
       <el-col :span="1.5">
@@ -107,7 +107,7 @@
           icon="el-icon-download"
           icon="el-icon-download"
           size="mini"
           size="mini"
           @click="handleExport"
           @click="handleExport"
-          v-hasPermi="['${moduleName}:${businessName}:export']"
+          v-hasPermi="['${permissionPrefix}:export']"
         >导出</el-button>
         >导出</el-button>
       </el-col>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@@ -158,14 +158,14 @@
             type="text"
             type="text"
             icon="el-icon-edit"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['${moduleName}:${businessName}:edit']"
+            v-hasPermi="['${permissionPrefix}:edit']"
           >修改</el-button>
           >修改</el-button>
           <el-button
           <el-button
             size="mini"
             size="mini"
             type="text"
             type="text"
             icon="el-icon-delete"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['${moduleName}:${businessName}:remove']"
+            v-hasPermi="['${permissionPrefix}:remove']"
           >删除</el-button>
           >删除</el-button>
         </template>
         </template>
       </el-table-column>
       </el-table-column>

+ 4 - 4
ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm

@@ -73,7 +73,7 @@
           plain
           plain
           icon="Plus"
           icon="Plus"
           @click="handleAdd"
           @click="handleAdd"
-          v-hasPermi="['${moduleName}:${businessName}:add']"
+          v-hasPermi="['${permissionPrefix}:add']"
         >新增</el-button>
         >新增</el-button>
       </el-col>
       </el-col>
       <el-col :span="1.5">
       <el-col :span="1.5">
@@ -136,9 +136,9 @@
 #end
 #end
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template #default="scope">
         <template #default="scope">
-          <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${moduleName}:${businessName}:edit']">修改</el-button>
-          <el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['${moduleName}:${businessName}:add']">新增</el-button>
-          <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${moduleName}:${businessName}:remove']">删除</el-button>
+          <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${permissionPrefix}:edit']">修改</el-button>
+          <el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['${permissionPrefix}:add']">新增</el-button>
+          <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${permissionPrefix}:remove']">删除</el-button>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
     </el-table>
     </el-table>

+ 6 - 6
ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm

@@ -73,7 +73,7 @@
           plain
           plain
           icon="Plus"
           icon="Plus"
           @click="handleAdd"
           @click="handleAdd"
-          v-hasPermi="['${moduleName}:${businessName}:add']"
+          v-hasPermi="['${permissionPrefix}:add']"
         >新增</el-button>
         >新增</el-button>
       </el-col>
       </el-col>
       <el-col :span="1.5">
       <el-col :span="1.5">
@@ -83,7 +83,7 @@
           icon="Edit"
           icon="Edit"
           :disabled="single"
           :disabled="single"
           @click="handleUpdate"
           @click="handleUpdate"
-          v-hasPermi="['${moduleName}:${businessName}:edit']"
+          v-hasPermi="['${permissionPrefix}:edit']"
         >修改</el-button>
         >修改</el-button>
       </el-col>
       </el-col>
       <el-col :span="1.5">
       <el-col :span="1.5">
@@ -93,7 +93,7 @@
           icon="Delete"
           icon="Delete"
           :disabled="multiple"
           :disabled="multiple"
           @click="handleDelete"
           @click="handleDelete"
-          v-hasPermi="['${moduleName}:${businessName}:remove']"
+          v-hasPermi="['${permissionPrefix}:remove']"
         >删除</el-button>
         >删除</el-button>
       </el-col>
       </el-col>
       <el-col :span="1.5">
       <el-col :span="1.5">
@@ -102,7 +102,7 @@
           plain
           plain
           icon="Download"
           icon="Download"
           @click="handleExport"
           @click="handleExport"
-          v-hasPermi="['${moduleName}:${businessName}:export']"
+          v-hasPermi="['${permissionPrefix}:export']"
         >导出</el-button>
         >导出</el-button>
       </el-col>
       </el-col>
       <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
       <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
@@ -148,8 +148,8 @@
 #end
 #end
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template #default="scope">
         <template #default="scope">
-          <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${moduleName}:${businessName}:edit']">修改</el-button>
-          <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${moduleName}:${businessName}:remove']">删除</el-button>
+          <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${permissionPrefix}:edit']">修改</el-button>
+          <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${permissionPrefix}:remove']">删除</el-button>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
     </el-table>
     </el-table>

+ 1 - 1
ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/JobInvokeUtil.java

@@ -105,7 +105,7 @@ public class JobInvokeUtil
      */
      */
     public static List<Object[]> getMethodParams(String invokeTarget)
     public static List<Object[]> getMethodParams(String invokeTarget)
     {
     {
-        String methodStr = StringUtils.substringBetween(invokeTarget, "(", ")");
+        String methodStr = StringUtils.substringBetweenLast(invokeTarget, "(", ")");
         if (StringUtils.isEmpty(methodStr))
         if (StringUtils.isEmpty(methodStr))
         {
         {
             return null;
             return null;

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java

@@ -365,7 +365,7 @@ public class SysMenuServiceImpl implements ISysMenuService
     /**
     /**
      * 获取路由名称,如没有配置路由名称则取路由地址
      * 获取路由名称,如没有配置路由名称则取路由地址
      * 
      * 
-     * @param routerName 路由名称
+     * @param name 路由名称
      * @param path 路由地址
      * @param path 路由地址
      * @return 路由名称(驼峰格式)
      * @return 路由名称(驼峰格式)
      */
      */

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

@@ -178,7 +178,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  		update sys_user
  		update sys_user
  		<set>
  		<set>
  			<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
  			<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
- 			<if test="userName != null and userName != ''">user_name = #{userName},</if>
  			<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
  			<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
  			<if test="email != null ">email = #{email},</if>
  			<if test="email != null ">email = #{email},</if>
  			<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
  			<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>

+ 0 - 4
ruoyi-ui/src/assets/styles/index.scss

@@ -129,10 +129,6 @@ aside {
   position: relative;
   position: relative;
 }
 }
 
 
-.pagination-container {
-  margin-top: 30px;
-}
-
 .text-center {
 .text-center {
   text-align: center
   text-align: center
 }
 }

+ 3 - 12
ruoyi-ui/src/assets/styles/ruoyi.scss

@@ -117,11 +117,9 @@
 
 
 /** 表格布局 **/
 /** 表格布局 **/
 .pagination-container {
 .pagination-container {
-  position: relative;
-  height: 32px;
-  margin-bottom: 10px;
-  margin-top: 15px;
-  padding: 10px 20px !important;
+  display: flex;
+  justify-content: flex-end;
+  margin-top: 20px;
 }
 }
 
 
 /* tree border */
 /* tree border */
@@ -132,11 +130,6 @@
   border-radius: 4px;
   border-radius: 4px;
 }
 }
 
 
-.pagination-container .el-pagination {
-  right: 0;
-  position: absolute;
-}
-
 @media (max-width: 768px) {
 @media (max-width: 768px) {
   .pagination-container .el-pagination > .el-pagination__jump {
   .pagination-container .el-pagination > .el-pagination__jump {
     display: none !important;
     display: none !important;
@@ -201,8 +194,6 @@
 }
 }
 
 
 .card-box {
 .card-box {
-  padding-right: 15px;
-  padding-left: 15px;
   margin-bottom: 10px;
   margin-bottom: 10px;
 }
 }
 
 

+ 10 - 4
ruoyi-ui/src/components/FileUpload/index.vue

@@ -13,6 +13,7 @@
       :headers="headers"
       :headers="headers"
       class="upload-file-uploader"
       class="upload-file-uploader"
       ref="fileUpload"
       ref="fileUpload"
+      v-if="!disabled"
     >
     >
       <!-- 上传按钮 -->
       <!-- 上传按钮 -->
       <el-button size="mini" type="primary">选取文件</el-button>
       <el-button size="mini" type="primary">选取文件</el-button>
@@ -32,7 +33,7 @@
           <span class="el-icon-document"> {{ getFileName(file.name) }} </span>
           <span class="el-icon-document"> {{ getFileName(file.name) }} </span>
         </el-link>
         </el-link>
         <div class="ele-upload-list__item-content-action">
         <div class="ele-upload-list__item-content-action">
-          <el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
+          <el-link :underline="false" @click="handleDelete(index)" type="danger" v-if="!disabled">删除</el-link>
         </div>
         </div>
       </li>
       </li>
     </transition-group>
     </transition-group>
@@ -50,22 +51,27 @@ export default {
     // 数量限制
     // 数量限制
     limit: {
     limit: {
       type: Number,
       type: Number,
-      default: 5,
+      default: 5
     },
     },
     // 大小限制(MB)
     // 大小限制(MB)
     fileSize: {
     fileSize: {
       type: Number,
       type: Number,
-      default: 5,
+      default: 5
     },
     },
     // 文件类型, 例如['png', 'jpg', 'jpeg']
     // 文件类型, 例如['png', 'jpg', 'jpeg']
     fileType: {
     fileType: {
       type: Array,
       type: Array,
-      default: () => ["doc", "xls", "ppt", "txt", "pdf"],
+      default: () => ["doc", "docx", "xls", "xlsx", "ppt", "pptx", "txt", "pdf"]
     },
     },
     // 是否显示提示
     // 是否显示提示
     isShowTip: {
     isShowTip: {
       type: Boolean,
       type: Boolean,
       default: true
       default: true
+    },
+    // 禁用组件(仅查看文件)
+    disabled: {
+      type: Boolean,
+      default: false
     }
     }
   },
   },
   data() {
   data() {

+ 1 - 1
ruoyi-ui/src/components/HeaderSearch/index.vue

@@ -37,7 +37,7 @@ export default {
   },
   },
   computed: {
   computed: {
     routes() {
     routes() {
-      return this.$store.getters.permission_routes
+      return this.$store.getters.defaultRoutes
     }
     }
   },
   },
   watch: {
   watch: {

+ 0 - 1
ruoyi-ui/src/components/Pagination/index.vue

@@ -106,7 +106,6 @@ export default {
 <style scoped>
 <style scoped>
 .pagination-container {
 .pagination-container {
   background: #fff;
   background: #fff;
-  padding: 32px 16px;
 }
 }
 .pagination-container.hidden {
 .pagination-container.hidden {
   display: none;
   display: none;

+ 5 - 5
ruoyi-ui/src/layout/components/Navbar.vue

@@ -2,8 +2,8 @@
   <div class="navbar">
   <div class="navbar">
     <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
     <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
 
 
-    <breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/>
-    <top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/>
+    <breadcrumb v-if="!topNav" id="breadcrumb-container" class="breadcrumb-container" />
+    <top-nav v-if="topNav" id="topmenu-container" class="topmenu-container" />
 
 
     <div class="right-menu">
     <div class="right-menu">
       <template v-if="device!=='mobile'">
       <template v-if="device!=='mobile'">
@@ -95,16 +95,16 @@ export default {
     toggleSideBar() {
     toggleSideBar() {
       this.$store.dispatch('app/toggleSideBar')
       this.$store.dispatch('app/toggleSideBar')
     },
     },
-    async logout() {
+    logout() {
       this.$confirm('确定注销并退出系统吗?', '提示', {
       this.$confirm('确定注销并退出系统吗?', '提示', {
         confirmButtonText: '确定',
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         cancelButtonText: '取消',
         type: 'warning'
         type: 'warning'
       }).then(() => {
       }).then(() => {
         this.$store.dispatch('LogOut').then(() => {
         this.$store.dispatch('LogOut').then(() => {
-          location.href = '/index';
+          location.href = '/index'
         })
         })
-      }).catch(() => {});
+      }).catch(() => {})
     }
     }
   }
   }
 }
 }

+ 6 - 21
ruoyi-ui/src/store/modules/permission.js

@@ -82,28 +82,13 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
 
 
 function filterChildren(childrenMap, lastRouter = false) {
 function filterChildren(childrenMap, lastRouter = false) {
   var children = []
   var children = []
-  childrenMap.forEach((el, index) => {
-    if (el.children && el.children.length) {
-      if (el.component === 'ParentView' && !lastRouter) {
-        el.children.forEach(c => {
-          c.path = el.path + '/' + c.path
-          if (c.children && c.children.length) {
-            children = children.concat(filterChildren(c.children, c))
-            return
-          }
-          children.push(c)
-        })
-        return
-      }
-    }
-    if (lastRouter) {
-      el.path = lastRouter.path + '/' + el.path
-      if (el.children && el.children.length) {
-        children = children.concat(filterChildren(el.children, el))
-        return
-      }
+  childrenMap.forEach(el => {
+    el.path = lastRouter ? lastRouter.path + '/' + el.path : el.path
+    if (el.children && el.children.length && el.component === 'ParentView') {
+      children = children.concat(filterChildren(el.children, el))
+    } else {
+      children.push(el)
     }
     }
-    children = children.concat(el)
   })
   })
   return children
   return children
 }
 }

+ 19 - 27
ruoyi-ui/src/utils/ruoyi.js

@@ -1,5 +1,3 @@
-
-
 /**
 /**
  * 通用js方法封装处理
  * 通用js方法封装处理
  * Copyright (c) 2019 ruoyi
  * Copyright (c) 2019 ruoyi
@@ -165,37 +163,19 @@ export function handleTree(data, id, parentId, children) {
   };
   };
 
 
   var childrenListMap = {};
   var childrenListMap = {};
-  var nodeIds = {};
   var tree = [];
   var tree = [];
-
   for (let d of data) {
   for (let d of data) {
-    let parentId = d[config.parentId];
-    if (childrenListMap[parentId] == null) {
-      childrenListMap[parentId] = [];
-    }
-    nodeIds[d[config.id]] = d;
-    childrenListMap[parentId].push(d);
+    let id = d[config.id];
+    childrenListMap[id] = d;
   }
   }
 
 
   for (let d of data) {
   for (let d of data) {
-    let parentId = d[config.parentId];
-    if (nodeIds[parentId] == null) {
+    let parentId = d[config.parentId]
+    let parentObj = childrenListMap[parentId]
+    if (!parentObj) {
       tree.push(d);
       tree.push(d);
-    }
-  }
-
-  for (let t of tree) {
-    adaptToChildrenList(t);
-  }
-
-  function adaptToChildrenList(o) {
-    if (childrenListMap[o[config.id]] !== null) {
-      o[config.childrenList] = childrenListMap[o[config.id]];
-    }
-    if (o[config.childrenList]) {
-      for (let c of o[config.childrenList]) {
-        adaptToChildrenList(c);
-      }
+    } else {
+      parentObj[config.childrenList].push(d)
     }
     }
   }
   }
   return tree;
   return tree;
@@ -227,6 +207,18 @@ export function tansParams(params) {
   return result
   return result
 }
 }
 
 
+// 返回项目路径
+export function getNormalPath(p) {
+  if (p.length === 0 || !p || p == 'undefined') {
+    return p
+  };
+  let res = p.replace('//', '/')
+  if (res[res.length - 1] === '/') {
+    return res.slice(0, res.length - 1)
+  }
+  return res;
+}
+
 // 验证是否为blob格式
 // 验证是否为blob格式
 export function blobValidate(data) {
 export function blobValidate(data) {
   return data.type !== 'application/json'
   return data.type !== 'application/json'

+ 0 - 8
ruoyi-ui/src/views/index.vue

@@ -1,13 +1,5 @@
 <template>
 <template>
   <div class="app-container home">
   <div class="app-container home">
-    <el-row :gutter="20">
-      <el-col :sm="24" :lg="24">
-        <blockquote class="text-warning" style="font-size: 14px">
-          阿里云服务器折扣区<el-link href="http://aly.ruoyi.vip" type="primary" target="_blank">☛☛点我进入☚☚</el-link> &nbsp;&nbsp;&nbsp; 腾讯云服务器秒杀区<el-link href="http://txy.ruoyi.vip" type="primary" target="_blank">☛☛点我进入☚☚</el-link>
-        </blockquote>
-        <hr />
-      </el-col>
-    </el-row>
     <el-row :gutter="20">
     <el-row :gutter="20">
       <el-col :sm="24" :lg="12" style="padding-left: 20px">
       <el-col :sm="24" :lg="12" style="padding-left: 20px">
         <h2>若依后台管理框架</h2>
         <h2>若依后台管理框架</h2>

+ 148 - 148
ruoyi-ui/src/views/monitor/cache/index.vue

@@ -1,148 +1,148 @@
-<template>
-  <div class="app-container">
-    <el-row>
-      <el-col :span="24" class="card-box">
-        <el-card>
-          <div slot="header"><span><i class="el-icon-monitor"></i> 基本信息</span></div>
-          <div class="el-table el-table--enable-row-hover el-table--medium">
-            <table cellspacing="0" style="width: 100%">
-              <tbody>
-                <tr>
-                  <td class="el-table__cell is-leaf"><div class="cell">Redis版本</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.redis_version }}</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell">运行模式</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.redis_mode == "standalone" ? "单机" : "集群" }}</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell">端口</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.tcp_port }}</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell">客户端数</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.connected_clients }}</div></td>
-                </tr>
-                <tr>
-                  <td class="el-table__cell is-leaf"><div class="cell">运行时间(天)</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.uptime_in_days }}</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell">使用内存</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.used_memory_human }}</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell">使用CPU</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ parseFloat(cache.info.used_cpu_user_children).toFixed(2) }}</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell">内存配置</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.maxmemory_human }}</div></td>
-                </tr>
-                <tr>
-                  <td class="el-table__cell is-leaf"><div class="cell">AOF是否开启</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.aof_enabled == "0" ? "否" : "是" }}</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell">RDB是否成功</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.rdb_last_bgsave_status }}</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell">Key数量</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.dbSize">{{ cache.dbSize }} </div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell">网络入口/出口</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.instantaneous_input_kbps }}kps/{{cache.info.instantaneous_output_kbps}}kps</div></td>
-                </tr>
-              </tbody>
-            </table>
-          </div>
-        </el-card>
-      </el-col>
-
-      <el-col :span="12" class="card-box">
-        <el-card>
-          <div slot="header"><span><i class="el-icon-pie-chart"></i> 命令统计</span></div>
-          <div class="el-table el-table--enable-row-hover el-table--medium">
-            <div ref="commandstats" style="height: 420px" />
-          </div>
-        </el-card>
-      </el-col>
-
-      <el-col :span="12" class="card-box">
-        <el-card>
-          <div slot="header"><span><i class="el-icon-odometer"></i> 内存信息</span></div>
-          <div class="el-table el-table--enable-row-hover el-table--medium">
-            <div ref="usedmemory" style="height: 420px" />
-          </div>
-        </el-card>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-import { getCache } from "@/api/monitor/cache";
-import * as echarts from "echarts";
-
-export default {
-  name: "Cache",
-  data() {
-    return {
-      // 统计命令信息
-      commandstats: null,
-      // 使用内存
-      usedmemory: null,
-      // cache信息
-      cache: []
-    }
-  },
-  created() {
-    this.getList();
-    this.openLoading();
-  },
-  methods: {
-    /** 查缓存询信息 */
-    getList() {
-      getCache().then((response) => {
-        this.cache = response.data;
-        this.$modal.closeLoading();
-
-        this.commandstats = echarts.init(this.$refs.commandstats, "macarons");
-        this.commandstats.setOption({
-          tooltip: {
-            trigger: "item",
-            formatter: "{a} <br/>{b} : {c} ({d}%)",
-          },
-          series: [
-            {
-              name: "命令",
-              type: "pie",
-              roseType: "radius",
-              radius: [15, 95],
-              center: ["50%", "38%"],
-              data: response.data.commandStats,
-              animationEasing: "cubicInOut",
-              animationDuration: 1000,
-            }
-          ]
-        });
-        this.usedmemory = echarts.init(this.$refs.usedmemory, "macarons");
-        this.usedmemory.setOption({
-          tooltip: {
-            formatter: "{b} <br/>{a} : " + this.cache.info.used_memory_human,
-          },
-          series: [
-            {
-              name: "峰值",
-              type: "gauge",
-              min: 0,
-              max: 1000,
-              detail: {
-                formatter: this.cache.info.used_memory_human,
-              },
-              data: [
-                {
-                  value: parseFloat(this.cache.info.used_memory_human),
-                  name: "内存消耗",
-                }
-              ]
-            }
-          ]
-        });
-        window.addEventListener("resize", () => {
-          this.commandstats.resize();
-          this.usedmemory.resize();
-        });
-      });
-    },
-    // 打开加载层
-    openLoading() {
-      this.$modal.loading("正在加载缓存监控数据,请稍候!");
-    }
-  }
-};
-</script>
+<template>
+  <div class="app-container">
+    <el-row :gutter="10">
+      <el-col :span="24" class="card-box">
+        <el-card>
+          <div slot="header"><span><i class="el-icon-monitor"></i> 基本信息</span></div>
+          <div class="el-table el-table--enable-row-hover el-table--medium">
+            <table cellspacing="0" style="width: 100%">
+              <tbody>
+                <tr>
+                  <td class="el-table__cell is-leaf"><div class="cell">Redis版本</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.redis_version }}</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell">运行模式</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.redis_mode == "standalone" ? "单机" : "集群" }}</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell">端口</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.tcp_port }}</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell">客户端数</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.connected_clients }}</div></td>
+                </tr>
+                <tr>
+                  <td class="el-table__cell is-leaf"><div class="cell">运行时间(天)</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.uptime_in_days }}</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell">使用内存</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.used_memory_human }}</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell">使用CPU</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ parseFloat(cache.info.used_cpu_user_children).toFixed(2) }}</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell">内存配置</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.maxmemory_human }}</div></td>
+                </tr>
+                <tr>
+                  <td class="el-table__cell is-leaf"><div class="cell">AOF是否开启</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.aof_enabled == "0" ? "否" : "是" }}</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell">RDB是否成功</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.rdb_last_bgsave_status }}</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell">Key数量</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.dbSize">{{ cache.dbSize }} </div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell">网络入口/出口</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="cache.info">{{ cache.info.instantaneous_input_kbps }}kps/{{cache.info.instantaneous_output_kbps}}kps</div></td>
+                </tr>
+              </tbody>
+            </table>
+          </div>
+        </el-card>
+      </el-col>
+
+      <el-col :span="12" class="card-box">
+        <el-card>
+          <div slot="header"><span><i class="el-icon-pie-chart"></i> 命令统计</span></div>
+          <div class="el-table el-table--enable-row-hover el-table--medium">
+            <div ref="commandstats" style="height: 420px" />
+          </div>
+        </el-card>
+      </el-col>
+
+      <el-col :span="12" class="card-box">
+        <el-card>
+          <div slot="header"><span><i class="el-icon-odometer"></i> 内存信息</span></div>
+          <div class="el-table el-table--enable-row-hover el-table--medium">
+            <div ref="usedmemory" style="height: 420px" />
+          </div>
+        </el-card>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { getCache } from "@/api/monitor/cache";
+import * as echarts from "echarts";
+
+export default {
+  name: "Cache",
+  data() {
+    return {
+      // 统计命令信息
+      commandstats: null,
+      // 使用内存
+      usedmemory: null,
+      // cache信息
+      cache: []
+    }
+  },
+  created() {
+    this.getList();
+    this.openLoading();
+  },
+  methods: {
+    /** 查缓存询信息 */
+    getList() {
+      getCache().then((response) => {
+        this.cache = response.data;
+        this.$modal.closeLoading();
+
+        this.commandstats = echarts.init(this.$refs.commandstats, "macarons");
+        this.commandstats.setOption({
+          tooltip: {
+            trigger: "item",
+            formatter: "{a} <br/>{b} : {c} ({d}%)",
+          },
+          series: [
+            {
+              name: "命令",
+              type: "pie",
+              roseType: "radius",
+              radius: [15, 95],
+              center: ["50%", "38%"],
+              data: response.data.commandStats,
+              animationEasing: "cubicInOut",
+              animationDuration: 1000,
+            }
+          ]
+        });
+        this.usedmemory = echarts.init(this.$refs.usedmemory, "macarons");
+        this.usedmemory.setOption({
+          tooltip: {
+            formatter: "{b} <br/>{a} : " + this.cache.info.used_memory_human,
+          },
+          series: [
+            {
+              name: "峰值",
+              type: "gauge",
+              min: 0,
+              max: 1000,
+              detail: {
+                formatter: this.cache.info.used_memory_human,
+              },
+              data: [
+                {
+                  value: parseFloat(this.cache.info.used_memory_human),
+                  name: "内存消耗",
+                }
+              ]
+            }
+          ]
+        });
+        window.addEventListener("resize", () => {
+          this.commandstats.resize();
+          this.usedmemory.resize();
+        });
+      });
+    },
+    // 打开加载层
+    openLoading() {
+      this.$modal.loading("正在加载缓存监控数据,请稍候!");
+    }
+  }
+};
+</script>

+ 1 - 1
ruoyi-ui/src/views/monitor/logininfor/index.vue

@@ -156,7 +156,7 @@ export default {
       // 日期范围
       // 日期范围
       dateRange: [],
       dateRange: [],
       // 默认排序
       // 默认排序
-      defaultSort: {prop: 'loginTime', order: 'descending'},
+      defaultSort: { prop: "loginTime", order: "descending" },
       // 查询参数
       // 查询参数
       queryParams: {
       queryParams: {
         pageNum: 1,
         pageNum: 1,

+ 1 - 1
ruoyi-ui/src/views/monitor/operlog/index.vue

@@ -231,7 +231,7 @@ export default {
       // 日期范围
       // 日期范围
       dateRange: [],
       dateRange: [],
       // 默认排序
       // 默认排序
-      defaultSort: {prop: 'operTime', order: 'descending'},
+      defaultSort: { prop: "operTime", order: "descending" },
       // 表单参数
       // 表单参数
       form: {},
       form: {},
       // 查询参数
       // 查询参数

+ 207 - 207
ruoyi-ui/src/views/monitor/server/index.vue

@@ -1,207 +1,207 @@
-<template>
-  <div class="app-container">
-    <el-row>
-      <el-col :span="12" class="card-box">
-        <el-card>
-          <div slot="header"><span><i class="el-icon-cpu"></i> CPU</span></div>
-          <div class="el-table el-table--enable-row-hover el-table--medium">
-            <table cellspacing="0" style="width: 100%;">
-              <thead>
-                <tr>
-                  <th class="el-table__cell is-leaf"><div class="cell">属性</div></th>
-                  <th class="el-table__cell is-leaf"><div class="cell">值</div></th>
-                </tr>
-              </thead>
-              <tbody>
-                <tr>
-                  <td class="el-table__cell is-leaf"><div class="cell">核心数</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.cpu">{{ server.cpu.cpuNum }}</div></td>
-                </tr>
-                <tr>
-                  <td class="el-table__cell is-leaf"><div class="cell">用户使用率</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.cpu">{{ server.cpu.used }}%</div></td>
-                </tr>
-                <tr>
-                  <td class="el-table__cell is-leaf"><div class="cell">系统使用率</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.cpu">{{ server.cpu.sys }}%</div></td>
-                </tr>
-                <tr>
-                  <td class="el-table__cell is-leaf"><div class="cell">当前空闲率</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.cpu">{{ server.cpu.free }}%</div></td>
-                </tr>
-              </tbody>
-            </table>
-          </div>
-        </el-card>
-      </el-col>
-
-      <el-col :span="12" class="card-box">
-        <el-card>
-          <div slot="header"><span><i class="el-icon-tickets"></i> 内存</span></div>
-          <div class="el-table el-table--enable-row-hover el-table--medium">
-            <table cellspacing="0" style="width: 100%;">
-              <thead>
-                <tr>
-                  <th class="el-table__cell is-leaf"><div class="cell">属性</div></th>
-                  <th class="el-table__cell is-leaf"><div class="cell">内存</div></th>
-                  <th class="el-table__cell is-leaf"><div class="cell">JVM</div></th>
-                </tr>
-              </thead>
-              <tbody>
-                <tr>
-                  <td class="el-table__cell is-leaf"><div class="cell">总内存</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.mem">{{ server.mem.total }}G</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.total }}M</div></td>
-                </tr>
-                <tr>
-                  <td class="el-table__cell is-leaf"><div class="cell">已用内存</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.mem">{{ server.mem.used}}G</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.used}}M</div></td>
-                </tr>
-                <tr>
-                  <td class="el-table__cell is-leaf"><div class="cell">剩余内存</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.mem">{{ server.mem.free }}G</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.free }}M</div></td>
-                </tr>
-                <tr>
-                  <td class="el-table__cell is-leaf"><div class="cell">使用率</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.mem" :class="{'text-danger': server.mem.usage > 80}">{{ server.mem.usage }}%</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm" :class="{'text-danger': server.jvm.usage > 80}">{{ server.jvm.usage }}%</div></td>
-                </tr>
-              </tbody>
-            </table>
-          </div>
-        </el-card>
-      </el-col>
-
-      <el-col :span="24" class="card-box">
-        <el-card>
-          <div slot="header">
-            <span><i class="el-icon-monitor"></i> 服务器信息</span>
-          </div>
-          <div class="el-table el-table--enable-row-hover el-table--medium">
-            <table cellspacing="0" style="width: 100%;">
-              <tbody>
-                <tr>
-                  <td class="el-table__cell is-leaf"><div class="cell">服务器名称</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.computerName }}</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell">操作系统</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.osName }}</div></td>
-                </tr>
-                <tr>
-                  <td class="el-table__cell is-leaf"><div class="cell">服务器IP</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.computerIp }}</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell">系统架构</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.osArch }}</div></td>
-                </tr>
-              </tbody>
-            </table>
-          </div>
-        </el-card>
-      </el-col>
-
-      <el-col :span="24" class="card-box">
-        <el-card>
-          <div slot="header">
-            <span><i class="el-icon-coffee-cup"></i> Java虚拟机信息</span>
-          </div>
-          <div class="el-table el-table--enable-row-hover el-table--medium">
-            <table cellspacing="0" style="width: 100%;table-layout:fixed;">
-              <tbody>
-                <tr>
-                  <td class="el-table__cell is-leaf"><div class="cell">Java名称</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.name }}</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell">Java版本</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.version }}</div></td>
-                </tr>
-                <tr>
-                  <td class="el-table__cell is-leaf"><div class="cell">启动时间</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.startTime }}</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell">运行时长</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.runTime }}</div></td>
-                </tr>
-                <tr>
-                  <td colspan="1" class="el-table__cell is-leaf"><div class="cell">安装路径</div></td>
-                  <td colspan="3" class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.home }}</div></td>
-                </tr>
-                <tr>
-                  <td colspan="1" class="el-table__cell is-leaf"><div class="cell">项目路径</div></td>
-                  <td colspan="3" class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.userDir }}</div></td>
-                </tr>
-                <tr>
-                  <td colspan="1" class="el-table__cell is-leaf"><div class="cell">运行参数</div></td>
-                  <td colspan="3" class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.inputArgs }}</div></td>
-                </tr>
-              </tbody>
-            </table>
-          </div>
-        </el-card>
-      </el-col>
-
-      <el-col :span="24" class="card-box">
-        <el-card>
-          <div slot="header">
-            <span><i class="el-icon-receiving"></i> 磁盘状态</span>
-          </div>
-          <div class="el-table el-table--enable-row-hover el-table--medium">
-            <table cellspacing="0" style="width: 100%;">
-              <thead>
-                <tr>
-                  <th class="el-table__cell el-table__cell is-leaf"><div class="cell">盘符路径</div></th>
-                  <th class="el-table__cell is-leaf"><div class="cell">文件系统</div></th>
-                  <th class="el-table__cell is-leaf"><div class="cell">盘符类型</div></th>
-                  <th class="el-table__cell is-leaf"><div class="cell">总大小</div></th>
-                  <th class="el-table__cell is-leaf"><div class="cell">可用大小</div></th>
-                  <th class="el-table__cell is-leaf"><div class="cell">已用大小</div></th>
-                  <th class="el-table__cell is-leaf"><div class="cell">已用百分比</div></th>
-                </tr>
-              </thead>
-              <tbody v-if="server.sysFiles">
-                <tr v-for="(sysFile, index) in server.sysFiles" :key="index">
-                  <td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.dirName }}</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.sysTypeName }}</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.typeName }}</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.total }}</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.free }}</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.used }}</div></td>
-                  <td class="el-table__cell is-leaf"><div class="cell" :class="{'text-danger': sysFile.usage > 80}">{{ sysFile.usage }}%</div></td>
-                </tr>
-              </tbody>
-            </table>
-          </div>
-        </el-card>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-import { getServer } from "@/api/monitor/server";
-
-export default {
-  name: "Server",
-  data() {
-    return {
-      // 服务器信息
-      server: []
-    };
-  },
-  created() {
-    this.getList();
-    this.openLoading();
-  },
-  methods: {
-    /** 查询服务器信息 */
-    getList() {
-      getServer().then(response => {
-        this.server = response.data;
-        this.$modal.closeLoading();
-      });
-    },
-    // 打开加载层
-    openLoading() {
-      this.$modal.loading("正在加载服务监控数据,请稍候!");
-    }
-  }
-};
-</script>
+<template>
+  <div class="app-container">
+    <el-row :gutter="10">
+      <el-col :span="12" class="card-box">
+        <el-card>
+          <div slot="header"><span><i class="el-icon-cpu"></i> CPU</span></div>
+          <div class="el-table el-table--enable-row-hover el-table--medium">
+            <table cellspacing="0" style="width: 100%;">
+              <thead>
+                <tr>
+                  <th class="el-table__cell is-leaf"><div class="cell">属性</div></th>
+                  <th class="el-table__cell is-leaf"><div class="cell">值</div></th>
+                </tr>
+              </thead>
+              <tbody>
+                <tr>
+                  <td class="el-table__cell is-leaf"><div class="cell">核心数</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.cpu">{{ server.cpu.cpuNum }}</div></td>
+                </tr>
+                <tr>
+                  <td class="el-table__cell is-leaf"><div class="cell">用户使用率</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.cpu">{{ server.cpu.used }}%</div></td>
+                </tr>
+                <tr>
+                  <td class="el-table__cell is-leaf"><div class="cell">系统使用率</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.cpu">{{ server.cpu.sys }}%</div></td>
+                </tr>
+                <tr>
+                  <td class="el-table__cell is-leaf"><div class="cell">当前空闲率</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.cpu">{{ server.cpu.free }}%</div></td>
+                </tr>
+              </tbody>
+            </table>
+          </div>
+        </el-card>
+      </el-col>
+
+      <el-col :span="12" class="card-box">
+        <el-card>
+          <div slot="header"><span><i class="el-icon-tickets"></i> 内存</span></div>
+          <div class="el-table el-table--enable-row-hover el-table--medium">
+            <table cellspacing="0" style="width: 100%;">
+              <thead>
+                <tr>
+                  <th class="el-table__cell is-leaf"><div class="cell">属性</div></th>
+                  <th class="el-table__cell is-leaf"><div class="cell">内存</div></th>
+                  <th class="el-table__cell is-leaf"><div class="cell">JVM</div></th>
+                </tr>
+              </thead>
+              <tbody>
+                <tr>
+                  <td class="el-table__cell is-leaf"><div class="cell">总内存</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.mem">{{ server.mem.total }}G</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.total }}M</div></td>
+                </tr>
+                <tr>
+                  <td class="el-table__cell is-leaf"><div class="cell">已用内存</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.mem">{{ server.mem.used}}G</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.used}}M</div></td>
+                </tr>
+                <tr>
+                  <td class="el-table__cell is-leaf"><div class="cell">剩余内存</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.mem">{{ server.mem.free }}G</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.free }}M</div></td>
+                </tr>
+                <tr>
+                  <td class="el-table__cell is-leaf"><div class="cell">使用率</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.mem" :class="{'text-danger': server.mem.usage > 80}">{{ server.mem.usage }}%</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm" :class="{'text-danger': server.jvm.usage > 80}">{{ server.jvm.usage }}%</div></td>
+                </tr>
+              </tbody>
+            </table>
+          </div>
+        </el-card>
+      </el-col>
+
+      <el-col :span="24" class="card-box">
+        <el-card>
+          <div slot="header">
+            <span><i class="el-icon-monitor"></i> 服务器信息</span>
+          </div>
+          <div class="el-table el-table--enable-row-hover el-table--medium">
+            <table cellspacing="0" style="width: 100%;">
+              <tbody>
+                <tr>
+                  <td class="el-table__cell is-leaf"><div class="cell">服务器名称</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.computerName }}</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell">操作系统</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.osName }}</div></td>
+                </tr>
+                <tr>
+                  <td class="el-table__cell is-leaf"><div class="cell">服务器IP</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.computerIp }}</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell">系统架构</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.osArch }}</div></td>
+                </tr>
+              </tbody>
+            </table>
+          </div>
+        </el-card>
+      </el-col>
+
+      <el-col :span="24" class="card-box">
+        <el-card>
+          <div slot="header">
+            <span><i class="el-icon-coffee-cup"></i> Java虚拟机信息</span>
+          </div>
+          <div class="el-table el-table--enable-row-hover el-table--medium">
+            <table cellspacing="0" style="width: 100%;table-layout:fixed;">
+              <tbody>
+                <tr>
+                  <td class="el-table__cell is-leaf"><div class="cell">Java名称</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.name }}</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell">Java版本</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.version }}</div></td>
+                </tr>
+                <tr>
+                  <td class="el-table__cell is-leaf"><div class="cell">启动时间</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.startTime }}</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell">运行时长</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.runTime }}</div></td>
+                </tr>
+                <tr>
+                  <td colspan="1" class="el-table__cell is-leaf"><div class="cell">安装路径</div></td>
+                  <td colspan="3" class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.home }}</div></td>
+                </tr>
+                <tr>
+                  <td colspan="1" class="el-table__cell is-leaf"><div class="cell">项目路径</div></td>
+                  <td colspan="3" class="el-table__cell is-leaf"><div class="cell" v-if="server.sys">{{ server.sys.userDir }}</div></td>
+                </tr>
+                <tr>
+                  <td colspan="1" class="el-table__cell is-leaf"><div class="cell">运行参数</div></td>
+                  <td colspan="3" class="el-table__cell is-leaf"><div class="cell" v-if="server.jvm">{{ server.jvm.inputArgs }}</div></td>
+                </tr>
+              </tbody>
+            </table>
+          </div>
+        </el-card>
+      </el-col>
+
+      <el-col :span="24" class="card-box">
+        <el-card>
+          <div slot="header">
+            <span><i class="el-icon-receiving"></i> 磁盘状态</span>
+          </div>
+          <div class="el-table el-table--enable-row-hover el-table--medium">
+            <table cellspacing="0" style="width: 100%;">
+              <thead>
+                <tr>
+                  <th class="el-table__cell el-table__cell is-leaf"><div class="cell">盘符路径</div></th>
+                  <th class="el-table__cell is-leaf"><div class="cell">文件系统</div></th>
+                  <th class="el-table__cell is-leaf"><div class="cell">盘符类型</div></th>
+                  <th class="el-table__cell is-leaf"><div class="cell">总大小</div></th>
+                  <th class="el-table__cell is-leaf"><div class="cell">可用大小</div></th>
+                  <th class="el-table__cell is-leaf"><div class="cell">已用大小</div></th>
+                  <th class="el-table__cell is-leaf"><div class="cell">已用百分比</div></th>
+                </tr>
+              </thead>
+              <tbody v-if="server.sysFiles">
+                <tr v-for="(sysFile, index) in server.sysFiles" :key="index">
+                  <td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.dirName }}</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.sysTypeName }}</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.typeName }}</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.total }}</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.free }}</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell">{{ sysFile.used }}</div></td>
+                  <td class="el-table__cell is-leaf"><div class="cell" :class="{'text-danger': sysFile.usage > 80}">{{ sysFile.usage }}%</div></td>
+                </tr>
+              </tbody>
+            </table>
+          </div>
+        </el-card>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { getServer } from "@/api/monitor/server";
+
+export default {
+  name: "Server",
+  data() {
+    return {
+      // 服务器信息
+      server: []
+    };
+  },
+  created() {
+    this.getList();
+    this.openLoading();
+  },
+  methods: {
+    /** 查询服务器信息 */
+    getList() {
+      getServer().then(response => {
+        this.server = response.data;
+        this.$modal.closeLoading();
+      });
+    },
+    // 打开加载层
+    openLoading() {
+      this.$modal.loading("正在加载服务监控数据,请稍候!");
+    }
+  }
+};
+</script>

+ 18 - 25
ruoyi-ui/src/views/tool/gen/index.vue

@@ -91,36 +91,18 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
     </el-row>
 
 
-    <el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange">
+    <el-table ref="tables" v-loading="loading" :data="tableList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
       <el-table-column type="selection" align="center" width="55"></el-table-column>
       <el-table-column type="selection" align="center" width="55"></el-table-column>
       <el-table-column label="序号" type="index" width="50" align="center">
       <el-table-column label="序号" type="index" width="50" align="center">
         <template slot-scope="scope">
         <template slot-scope="scope">
           <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
           <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
-      <el-table-column
-        label="表名称"
-        align="center"
-        prop="tableName"
-        :show-overflow-tooltip="true"
-        width="120"
-      />
-      <el-table-column
-        label="表描述"
-        align="center"
-        prop="tableComment"
-        :show-overflow-tooltip="true"
-        width="120"
-      />
-      <el-table-column
-        label="实体"
-        align="center"
-        prop="className"
-        :show-overflow-tooltip="true"
-        width="120"
-      />
-      <el-table-column label="创建时间" align="center" prop="createTime" width="160" />
-      <el-table-column label="更新时间" align="center" prop="updateTime" width="160" />
+      <el-table-column label="表名称" align="center" prop="tableName" :show-overflow-tooltip="true" width="120" />
+      <el-table-column label="表描述" align="center" prop="tableComment" :show-overflow-tooltip="true" width="120" />
+      <el-table-column label="实体" align="center" prop="className" :show-overflow-tooltip="true" width="120" />
+      <el-table-column label="创建时间" align="center" prop="createTime" sortable="custom" :sort-orders="['descending', 'ascending']" width="160" />
+      <el-table-column label="更新时间" align="center" prop="updateTime" sortable="custom" :sort-orders="['descending', 'ascending']" width="160" />
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
         <template slot-scope="scope">
           <el-button
           <el-button
@@ -225,6 +207,8 @@ export default {
       tableList: [],
       tableList: [],
       // 日期范围
       // 日期范围
       dateRange: "",
       dateRange: "",
+      // 默认排序
+      defaultSort: { prop: "createTime", order: "descending" },
       // 查询参数
       // 查询参数
       queryParams: {
       queryParams: {
         pageNum: 1,
         pageNum: 1,
@@ -242,6 +226,8 @@ export default {
     };
     };
   },
   },
   created() {
   created() {
+    this.queryParams.orderByColumn = this.defaultSort.prop;
+    this.queryParams.isAsc = this.defaultSort.order;
     this.getList();
     this.getList();
   },
   },
   activated() {
   activated() {
@@ -304,7 +290,8 @@ export default {
     resetQuery() {
     resetQuery() {
       this.dateRange = [];
       this.dateRange = [];
       this.resetForm("queryForm");
       this.resetForm("queryForm");
-      this.handleQuery();
+      this.queryParams.pageNum = 1;
+      this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order)
     },
     },
     /** 预览按钮 */
     /** 预览按钮 */
     handlePreview(row) {
     handlePreview(row) {
@@ -332,6 +319,12 @@ export default {
       this.single = selection.length != 1;
       this.single = selection.length != 1;
       this.multiple = !selection.length;
       this.multiple = !selection.length;
     },
     },
+    /** 排序触发事件 */
+    handleSortChange(column, prop, order) {
+      this.queryParams.orderByColumn = column.prop;
+      this.queryParams.isAsc = column.order;
+      this.getList();
+    },
     /** 修改按钮操作 */
     /** 修改按钮操作 */
     handleEditTable(row) {
     handleEditTable(row) {
       const tableId = row.tableId || this.ids[0];
       const tableId = row.tableId || this.ids[0];