Browse Source

feat: 添加路由;关闭若依一些不需要展示的内容;关闭服务器路由;修改部分问题和文本内容

yongCode 10 months ago
parent
commit
2e68078cb2

+ 2 - 2
.env.development

@@ -1,9 +1,9 @@
 # 页面标题
-VITE_APP_TITLE = 若依管理系统
+VITE_APP_TITLE = 工具数字化图鉴
 
 # 开发环境配置
 VITE_APP_ENV = 'development'
 
-# 若依管理系统/开发环境
+# 工具数字化图鉴/开发环境
 VITE_APP_BASE_API = '/dev-api'
 # VITE_APP_BASE_API = 'http://172.16.10.65:8080'

+ 2 - 2
.env.production

@@ -1,10 +1,10 @@
 # 页面标题
-VITE_APP_TITLE = 若依管理系统
+VITE_APP_TITLE = 工具数字化图鉴
 
 # 生产环境配置
 VITE_APP_ENV = 'production'
 
-# 若依管理系统/生产环境
+# 工具数字化图鉴/生产环境
 VITE_APP_BASE_API = '/prod-api'
 
 # 是否在打包时开启压缩,支持 gzip 和 brotli

+ 2 - 2
.env.staging

@@ -1,10 +1,10 @@
 # 页面标题
-VITE_APP_TITLE = 若依管理系统
+VITE_APP_TITLE = 工具数字化图鉴
 
 # 生产环境配置
 VITE_APP_ENV = 'staging'
 
-# 若依管理系统/生产环境
+# 工具数字化图鉴/生产环境
 VITE_APP_BASE_API = '/stage-api'
 
 # 是否在打包时开启压缩,支持 gzip 和 brotli

+ 1 - 0
.gitignore

@@ -21,3 +21,4 @@ selenium-debug.log
 
 package-lock.json
 yarn.lock
+pnpm-lock.yaml

+ 2 - 2
index.html

@@ -6,8 +6,8 @@
   <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
   <meta name="renderer" content="webkit">
   <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
-  <link rel="icon" href="/favicon.ico">
-  <title>若依管理系统</title>
+  <link rel="icon" href="/icon.png">
+  <title>工具数字化图鉴</title>
   <!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
   <style>
     html,

+ 1 - 1
package.json

@@ -1,7 +1,7 @@
 {
   "name": "ruoyi",
   "version": "3.8.7",
-  "description": "若依管理系统",
+  "description": "工具数字化图鉴",
   "author": "若依",
   "license": "MIT",
   "type": "module",

BIN
public/icon.png


BIN
src/assets/images/login-background.jpg


BIN
src/assets/images/pay.png


BIN
src/assets/images/profile.jpg


BIN
src/assets/images/profile.png


BIN
src/assets/logo/logo.png


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

@@ -8,7 +8,7 @@
       filterable
       default-first-option
       remote
-      placeholder="Search"
+      placeholder="请输入"
       class="header-search-select"
       @change="change"
     >

+ 5 - 18
src/layout/components/Navbar.vue

@@ -7,20 +7,7 @@
     <div class="right-menu">
       <template v-if="appStore.device !== 'mobile'">
         <header-search id="header-search" class="right-menu-item" />
-
-        <el-tooltip content="源码地址" effect="dark" placement="bottom">
-          <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
-        </el-tooltip>
-
-        <el-tooltip content="文档地址" effect="dark" placement="bottom">
-          <ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />
-        </el-tooltip>
-
         <screenfull id="screenfull" class="right-menu-item hover-effect" />
-
-        <el-tooltip content="布局大小" effect="dark" placement="bottom">
-          <size-select id="size-select" class="right-menu-item hover-effect" />
-        </el-tooltip>
       </template>
       <div class="avatar-container">
         <el-dropdown @command="handleCommand" class="right-menu-item hover-effect" trigger="click">
@@ -30,9 +17,12 @@
           </div>
           <template #dropdown>
             <el-dropdown-menu>
-              <router-link to="/user/profile">
+              <!-- <router-link to="/user/profile">
                 <el-dropdown-item>个人中心</el-dropdown-item>
-              </router-link>
+              </router-link> -->
+              <el-dropdown-item >
+                <span>{{ userStore.name }}</span>
+              </el-dropdown-item>
               <el-dropdown-item command="setLayout" v-if="settingsStore.showSettings">
                 <span>布局设置</span>
               </el-dropdown-item>
@@ -53,10 +43,7 @@ import Breadcrumb from '@/components/Breadcrumb'
 import TopNav from '@/components/TopNav'
 import Hamburger from '@/components/Hamburger'
 import Screenfull from '@/components/Screenfull'
-import SizeSelect from '@/components/SizeSelect'
 import HeaderSearch from '@/components/HeaderSearch'
-import RuoYiGit from '@/components/RuoYi/Git'
-import RuoYiDoc from '@/components/RuoYi/Doc'
 import useAppStore from '@/store/modules/app'
 import useUserStore from '@/store/modules/user'
 import useSettingsStore from '@/store/modules/settings'

+ 15 - 9
src/permission.js

@@ -8,6 +8,7 @@ import { isRelogin } from '@/utils/request'
 import useUserStore from '@/store/modules/user'
 import useSettingsStore from '@/store/modules/settings'
 import usePermissionStore from '@/store/modules/permission'
+import { constantRoutes } from '@/router'
 
 NProgress.configure({ showSpinner: false });
 
@@ -29,15 +30,20 @@ router.beforeEach((to, from, next) => {
         // 判断当前用户是否已拉取完user_info信息
         useUserStore().getInfo().then(() => {
           isRelogin.show = false
-          usePermissionStore().generateRoutes().then(accessRoutes => {
-            // 根据roles权限生成可访问的路由表
-            accessRoutes.forEach(route => {
-              if (!isHttp(route.path)) {
-                router.addRoute(route) // 动态添加可访问路由表
-              }
-            })
-            next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
-          })
+          // usePermissionStore().generateRoutes().then(accessRoutes => {
+          //   // 根据roles权限生成可访问的路由表
+          //   accessRoutes.forEach(route => {
+          //     if (!isHttp(route.path)) {
+          //       router.addRoute(route) // 动态添加可访问路由表
+          //     }
+          //   })
+          //   next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
+          // })
+          usePermissionStore().setRoutes([]);
+          usePermissionStore().setSidebarRouters(constantRoutes);
+          usePermissionStore().setDefaultRoutes([]);
+          usePermissionStore().setTopbarRoutes(constantRoutes);
+          next()
         }).catch(err => {
           useUserStore().logOut().then(() => {
             ElMessage.error(err)

+ 26 - 14
src/router/index.js

@@ -58,41 +58,53 @@ export const constantRoutes = [
     hidden: true
   },
   {
-    path: '',
+    path: '/',
     component: Layout,
     redirect: '/index',
     children: [
       {
-        path: '/index',
+        path: 'index',
         component: () => import('@/views/index'),
         name: 'Index',
         meta: { title: '首页', icon: 'dashboard', affix: true }
       }
     ]
   },
+  // {
+  //   path: '/user',
+  //   component: Layout,
+  //   hidden: true,
+  //   redirect: 'noredirect',
+  //   children: [
+  //     {
+  //       path: 'profile',
+  //       component: () => import('@/views/system/user/profile/index'),
+  //       name: 'Profile',
+  //       meta: { title: '个人中心', icon: 'user' }
+  //     }
+  //   ]
+  // },
   {
-    path: '/user',
+    path: '/',
     component: Layout,
-    hidden: true,
-    redirect: 'noredirect',
     children: [
       {
-        path: 'profile',
-        component: () => import('@/views/system/user/profile/index'),
-        name: 'Profile',
-        meta: { title: '个人中心', icon: 'user' }
+        path: 'material',
+        component: () => import('@/views/material/index'),
+        name: 'Material',
+        meta: { title: '物料管理', icon: 'component' }
       }
     ]
   },
   {
-    path: '/material',
+    path: '/',
     component: Layout,
     children: [
       {
-        path: '',
-        component: () => import('@/views/material/index'),
-        name: 'Material',
-        meta: { title: '物料管理', icon: 'dashboard', affix: true }
+        path: 'classification',
+        component: () => import('@/views/classification/index'),
+        name: 'Classification',
+        meta: { title: '分类管理', icon: 'tree-table'}
       }
     ]
   }

+ 3 - 3
src/settings.js

@@ -6,16 +6,16 @@ export default {
   /**
    * 侧边栏主题 深色主题theme-dark,浅色主题theme-light
    */
-  sideTheme: 'theme-dark',
+  sideTheme: 'theme-light',
   /**
    * 是否系统布局配置
    */
-  showSettings: true,
+  showSettings: false,
 
   /**
    * 是否显示顶部导航
    */
-  topNav: false,
+  topNav: true,
 
   /**
    * 是否显示 tagsView

+ 1 - 2
src/store/modules/permission.js

@@ -45,8 +45,7 @@ const usePermissionStore = defineStore(
             const asyncRoutes = filterDynamicRoutes(dynamicRoutes)
             asyncRoutes.forEach(route => { router.addRoute(route) })
             this.setRoutes(rewriteRoutes)
-            // this.setSidebarRouters(constantRoutes.concat(sidebarRoutes))
-            this.setSidebarRouters(constantRoutes)
+            this.setSidebarRouters(constantRoutes.concat(sidebarRoutes))
             this.setDefaultRoutes(sidebarRoutes)
             this.setTopbarRoutes(defaultRoutes)
             resolve(rewriteRoutes)

+ 1 - 1
src/store/modules/user.js

@@ -1,6 +1,6 @@
 import { login, logout, getInfo } from '@/api/login'
 import { getToken, setToken, removeToken } from '@/utils/auth'
-import defAva from '@/assets/images/profile.jpg'
+import defAva from '@/assets/images/profile.png'
 
 const useUserStore = defineStore(
   'user',

+ 1 - 1
src/utils/ruoyi.js

@@ -233,7 +233,7 @@ export function getNormalPath(p) {
   if (p.length === 0 || !p || p == 'undefined') {
     return p
   };
-  let res = p.replace('//', '/')
+  let res = p.replace(/\/+/, '/')
   if (res[res.length - 1] === '/') {
     return res.slice(0, res.length - 1)
   }

+ 11 - 0
src/views/classification/index.vue

@@ -0,0 +1,11 @@
+<template>
+  <div class="app-container">
+   分类管理
+   <icon-select ref="iconSelectRef"  />
+   
+  </div>
+</template>
+
+<script setup name="Classification">
+import IconSelect from "@/components/IconSelect";
+</script>

+ 113 - 42
src/views/login.vue

@@ -1,7 +1,12 @@
 <template>
   <div class="login">
-    <el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form">
-      <h3 class="title">若依后台管理系统</h3>
+    <el-form
+      ref="loginRef"
+      :model="loginForm"
+      :rules="loginRules"
+      class="login-form"
+    >
+      <h3 class="title">工具数字化管理系统</h3>
       <el-form-item prop="username">
         <el-input
           v-model="loginForm.username"
@@ -10,7 +15,9 @@
           auto-complete="off"
           placeholder="账号"
         >
-          <template #prefix><svg-icon icon-class="user" class="el-input__icon input-icon" /></template>
+          <template #prefix
+            ><svg-icon icon-class="user" class="el-input__icon input-icon"
+          /></template>
         </el-input>
       </el-form-item>
       <el-form-item prop="password">
@@ -22,7 +29,9 @@
           placeholder="密码"
           @keyup.enter="handleLogin"
         >
-          <template #prefix><svg-icon icon-class="password" class="el-input__icon input-icon" /></template>
+          <template #prefix
+            ><svg-icon icon-class="password" class="el-input__icon input-icon"
+          /></template>
         </el-input>
       </el-form-item>
       <el-form-item prop="code" v-if="captchaEnabled">
@@ -34,33 +43,41 @@
           style="width: 63%"
           @keyup.enter="handleLogin"
         >
-          <template #prefix><svg-icon icon-class="validCode" class="el-input__icon input-icon" /></template>
+          <template #prefix
+            ><svg-icon icon-class="validCode" class="el-input__icon input-icon"
+          /></template>
         </el-input>
         <div class="login-code">
-          <img :src="codeUrl" @click="getCode" class="login-code-img"/>
+          <img :src="codeUrl" @click="getCode" class="login-code-img" />
         </div>
       </el-form-item>
-      <el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
-      <el-form-item style="width:100%;">
+      <el-checkbox
+        v-model="loginForm.rememberMe"
+        style="margin: 0px 0px 25px 0px"
+        >记住密码</el-checkbox
+      >
+      <el-form-item style="width: 100%">
         <el-button
           :loading="loading"
           size="large"
           type="primary"
-          style="width:100%;"
+          style="width: 100%"
           @click.prevent="handleLogin"
         >
           <span v-if="!loading">登 录</span>
           <span v-else>登 录 中...</span>
         </el-button>
-        <div style="float: right;" v-if="register">
-          <router-link class="link-type" :to="'/register'">立即注册</router-link>
+        <div style="float: right" v-if="register">
+          <router-link class="link-type" :to="'/register'"
+            >立即注册</router-link
+          >
         </div>
       </el-form-item>
     </el-form>
     <!--  底部  -->
-    <div class="el-login-footer">
+    <!-- <div class="el-login-footer">
       <span>Copyright © 2018-2024 ruoyi.vip All Rights Reserved.</span>
-    </div>
+    </div> -->
   </div>
 </template>
 
@@ -68,9 +85,9 @@
 import { getCodeImg } from "@/api/login";
 import Cookies from "js-cookie";
 import { encrypt, decrypt } from "@/utils/jsencrypt";
-import useUserStore from '@/store/modules/user'
+import useUserStore from "@/store/modules/user";
 
-const userStore = useUserStore()
+const userStore = useUserStore();
 const route = useRoute();
 const router = useRouter();
 const { proxy } = getCurrentInstance();
@@ -80,13 +97,13 @@ const loginForm = ref({
   password: "admin123",
   rememberMe: false,
   code: "",
-  uuid: ""
+  uuid: "",
 });
 
 const loginRules = {
   username: [{ required: true, trigger: "blur", message: "请输入您的账号" }],
   password: [{ required: true, trigger: "blur", message: "请输入您的密码" }],
-  code: [{ required: true, trigger: "change", message: "请输入验证码" }]
+  code: [{ required: true, trigger: "change", message: "请输入验证码" }],
 };
 
 const codeUrl = ref("");
@@ -97,18 +114,24 @@ const captchaEnabled = ref(true);
 const register = ref(false);
 const redirect = ref(undefined);
 
-watch(route, (newRoute) => {
+watch(
+  route,
+  (newRoute) => {
     redirect.value = newRoute.query && newRoute.query.redirect;
-}, { immediate: true });
+  },
+  { immediate: true }
+);
 
 function handleLogin() {
-  proxy.$refs.loginRef.validate(valid => {
+  proxy.$refs.loginRef.validate((valid) => {
     if (valid) {
       loading.value = true;
       // 勾选了需要记住密码设置在 cookie 中设置记住用户名和密码
       if (loginForm.value.rememberMe) {
         Cookies.set("username", loginForm.value.username, { expires: 30 });
-        Cookies.set("password", encrypt(loginForm.value.password), { expires: 30 });
+        Cookies.set("password", encrypt(loginForm.value.password), {
+          expires: 30,
+        });
         Cookies.set("rememberMe", loginForm.value.rememberMe, { expires: 30 });
       } else {
         // 否则移除
@@ -117,29 +140,33 @@ function handleLogin() {
         Cookies.remove("rememberMe");
       }
       // 调用action的登录方法
-      userStore.login(loginForm.value).then(() => {
-        const query = route.query;
-        const otherQueryParams = Object.keys(query).reduce((acc, cur) => {
-          if (cur !== "redirect") {
-            acc[cur] = query[cur];
+      userStore
+        .login(loginForm.value)
+        .then(() => {
+          const query = route.query;
+          const otherQueryParams = Object.keys(query).reduce((acc, cur) => {
+            if (cur !== "redirect") {
+              acc[cur] = query[cur];
+            }
+            return acc;
+          }, {});
+          router.push({ path: redirect.value || "/", query: otherQueryParams });
+        })
+        .catch(() => {
+          loading.value = false;
+          // 重新获取验证码
+          if (captchaEnabled.value) {
+            getCode();
           }
-          return acc;
-        }, {});
-        router.push({ path: redirect.value || "/", query: otherQueryParams });
-      }).catch(() => {
-        loading.value = false;
-        // 重新获取验证码
-        if (captchaEnabled.value) {
-          getCode();
-        }
-      });
+        });
     }
   });
 }
 
 function getCode() {
-  getCodeImg().then(res => {
-    captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled;
+  getCodeImg().then((res) => {
+    captchaEnabled.value =
+      res.captchaEnabled === undefined ? true : res.captchaEnabled;
     if (captchaEnabled.value) {
       codeUrl.value = "data:image/gif;base64," + res.img;
       loginForm.value.uuid = res.uuid;
@@ -153,8 +180,9 @@ function getCookie() {
   const rememberMe = Cookies.get("rememberMe");
   loginForm.value = {
     username: username === undefined ? loginForm.value.username : username,
-    password: password === undefined ? loginForm.value.password : decrypt(password),
-    rememberMe: rememberMe === undefined ? false : Boolean(rememberMe)
+    password:
+      password === undefined ? loginForm.value.password : decrypt(password),
+    rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
   };
 }
 
@@ -162,7 +190,9 @@ getCode();
 getCookie();
 </script>
 
-<style lang='scss' scoped>
+<style lang="scss" scoped>
+$greenSeaweed: rgb(24, 200, 223);
+$blueQueen: rgb(41, 104, 170);
 .login {
   display: flex;
   justify-content: center;
@@ -170,11 +200,14 @@ getCookie();
   height: 100%;
   background-image: url("../assets/images/login-background.jpg");
   background-size: cover;
+  position: relative;
+  z-index: 2;
 }
 .title {
   margin: 0px auto 30px auto;
   text-align: center;
-  color: #707070;
+  color: #121212;
+  font-weight: 600;
 }
 
 .login-form {
@@ -182,6 +215,44 @@ getCookie();
   background: #ffffff;
   width: 400px;
   padding: 25px 25px 5px 25px;
+  overflow: hidden;
+  position: relative;
+  z-index: 2;
+  &::before,
+  &::after {
+    content: "";
+    position: absolute;
+    width: 600px;
+    height: 600px;
+    border-top-left-radius: 40%;
+    border-top-right-radius: 45%;
+    border-bottom-left-radius: 35%;
+    border-bottom-right-radius: 40%;
+    z-index: -1;
+  }
+
+  &::before {
+    left: 45%;
+    bottom: -75%;
+    background-color: rgba($blueQueen, 0.15);
+    animation: wawes 10s infinite linear;
+  }
+
+  &::after {
+    left: 40%;
+    bottom: -70%;
+    background-color: rgba($greenSeaweed, 0.2);
+    animation: wawes  7s infinite;
+  }
+  @keyframes wawes {
+    from{
+      transform: rotate(0);
+    }
+    to{
+      transform: rotate(360deg);
+
+    }
+  }
   .el-input {
     height: 40px;
     input {

+ 18 - 62
src/views/monitor/cache/index.vue

@@ -80,68 +80,24 @@ function getList() {
     cache.value = response.data;
 
     const commandstatsIntance = echarts.init(commandstats.value, "macarons");
-    let optionsObj =  {title: {
-                     text: 'Echarts 入门实例',
-                     top: 5,
-                     left: 'center'
-                 },
-                 legend: {
-                     data: ['衣服', '帽子', '裤子', '鞋子'],
-                     top: 30
-                 },
-                 // X轴
-                 xAxis: {
-                     data: [
-                         '一月', '二月', '三月', '四月'
-                     ]
-                 },
-                 // Y轴
-                 yAxis: {},
-                 // 数据
-                 series: [
-                     {
-                         name: '衣服',
-                         type: 'bar',
-                         data: [120, 100, 440, 320]
-                     },
-                     {
-                         name: '帽子',
-                         type: 'bar',
-                         data: [200, 120, 240, 330]
-                     },
-                     {
-                         name: 'bar',
-                         type: 'line',
-                         data: [120, 200, 240, 260, 300]
-                     },
-                     {
-                         name: 'bar',
-                         type: 'line',
-                         data: [120, 200, 300, 140, 260]
-                     }
-                 ]                       
-             }
-    commandstatsIntance.setOption(optionsObj
-
-    //   {
-    //   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
-    //     }
-    //   ]
-    // }
-    );
+    commandstatsIntance.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
+        }
+      ]
+    });
     const usedmemoryInstance = echarts.init(usedmemory.value, "macarons");
     usedmemoryInstance.setOption({
       tooltip: {

+ 3 - 3
src/views/register.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="register">
     <el-form ref="registerRef" :model="registerForm" :rules="registerRules" class="register-form">
-      <h3 class="title">若依后台管理系统</h3>
+      <h3 class="title">工具数字化管理系统</h3>
       <el-form-item prop="username">
         <el-input 
           v-model="registerForm.username" 
@@ -69,9 +69,9 @@
       </el-form-item>
     </el-form>
     <!--  底部  -->
-    <div class="el-register-footer">
+    <!-- <div class="el-register-footer">
       <span>Copyright © 2018-2024 ruoyi.vip All Rights Reserved.</span>
-    </div>
+    </div> -->
   </div>
 </template>