Browse Source

优化代码

RuoYi 8 months ago
parent
commit
b376ab792a

+ 3 - 4
ruoyi-ui/src/layout/components/Sidebar/SidebarItem.vue

@@ -62,11 +62,10 @@ export default {
       const showingChildren = children.filter(item => {
         if (item.hidden) {
           return false
-        } else {
-          // Temp set(will be used if only has one showing child)
-          this.onlyOneChild = item
-          return true
         }
+        // Temp set(will be used if only has one showing child)
+        this.onlyOneChild = item
+        return true
       })
 
       // When there is only one child router, the child router is displayed by default

+ 2 - 0
ruoyi-ui/src/plugins/cache.js

@@ -26,6 +26,7 @@ const sessionCache = {
     if (value != null) {
       return JSON.parse(value)
     }
+    return null
   },
   remove (key) {
     sessionStorage.removeItem(key);
@@ -59,6 +60,7 @@ const localCache = {
     if (value != null) {
       return JSON.parse(value)
     }
+    return null
   },
   remove (key) {
     localStorage.removeItem(key);

+ 3 - 3
ruoyi-ui/src/utils/validate.js

@@ -1,5 +1,5 @@
 /**
- * 判断value字符串是否为空 
+ * 鍒ゆ柇value瀛楃�涓叉槸鍚︿负绌� 
  * @param {string} value
  * @returns {Boolean}
  */
@@ -11,7 +11,7 @@ export function isEmpty(value) {
 }
 
 /**
- * 判断url是否是http或https 
+ * 鍒ゆ柇url鏄�惁鏄痟ttp鎴杊ttps 
  * @param {string} url
  * @returns {Boolean}
  */
@@ -20,7 +20,7 @@ export function isHttp(url) {
 }
 
 /**
- * 判断path是否为外链
+ * 鍒ゆ柇path鏄�惁涓哄�閾�
  * @param {string} path
  * @returns {Boolean}
  */

+ 1 - 1
ruoyi-ui/src/views/system/config/index.vue

@@ -157,7 +157,7 @@
           <el-input v-model="form.configKey" placeholder="请输入参数键名" />
         </el-form-item>
         <el-form-item label="参数键值" prop="configValue">
-          <el-input v-model="form.configValue" placeholder="请输入参数键值" />
+          <el-input v-model="form.configValue" type="textarea" placeholder="请输入参数键值" />
         </el-form-item>
         <el-form-item label="系统内置" prop="configType">
           <el-radio-group v-model="form.configType">

+ 2 - 2
ruoyi-ui/src/views/system/role/index.vue

@@ -522,8 +522,8 @@ export default {
             })
           });
         });
-        this.title = "修改角色";
       });
+      this.title = "修改角色";
     },
     /** 选择角色权限范围触发 */
     dataScopeSelectChange(value) {
@@ -543,8 +543,8 @@ export default {
             this.$refs.dept.setCheckedKeys(res.checkedKeys);
           });
         });
-        this.title = "分配数据权限";
       });
+      this.title = "分配数据权限";
     },
     /** 分配用户操作 */
     handleAuthUser: function(row) {

+ 3 - 3
ruoyi-ui/src/views/system/user/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="app-container">
     <el-row :gutter="20">
-      <splitpanes class="default-theme">
+      <splitpanes :horizontal="this.$store.getters.device === 'mobile'" class="default-theme">
         <!--部门数据-->
         <pane size="16">
           <el-col>
@@ -14,8 +14,8 @@
           </el-col>
         </pane>
         <!--用户数据-->
-        <pane>
-          <el-col size="84">
+        <pane size="84">
+          <el-col>
             <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
               <el-form-item label="用户名称" prop="userName">
                 <el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable style="width: 240px" @keyup.enter.native="handleQuery" />