zs 6 달 전
부모
커밋
0a8f3744ac

+ 1 - 1
.prettierrc.json

@@ -3,6 +3,6 @@
   "semi": false,
   "tabWidth": 2,
   "singleQuote": true,
-  "printWidth": 100,
+  "printWidth": 300,
   "trailingComma": "none"
 }

+ 1 - 1
index.html

@@ -4,7 +4,7 @@
     <meta charset="UTF-8">
     <link rel="icon" href="/favicon.ico">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <title>项目名</title>
+    <title>服务器集群监控管理系统</title>
   </head>
   <body>
     <div id="app" class="app"></div>

+ 1 - 2
src/components/Breadcrumb/index.vue

@@ -2,8 +2,7 @@
   <el-breadcrumb class="h-[50px] flex items-center">
     <transition-group name="breadcrumb-transition">
       <el-breadcrumb-item v-for="(item, index) in breadcrumbs" :key="item.path">
-        <span v-if="item.redirect === 'noredirect' || index === breadcrumbs.length - 1"
-          class="text-[var(--el-disabled-text-color)]">
+        <span v-if="item.redirect === 'noredirect' || index === breadcrumbs.length - 1" class="text-[var(--el-disabled-text-color)]">
           {{ get(item, 'meta.title') }}
         </span>
         <a v-else @click.prevent="handleLink(item)">

+ 10 - 0
src/lang/package/en/login.js

@@ -0,0 +1,10 @@
+// 登录页面国际化
+export default {
+  title: 'Server Cluster Monitoring and Management System',
+  username: 'user name',
+  password: 'password',
+  login: 'login',
+  captchaCode: 'Verification code',
+  placeholder1: 'Please input a user name',
+  placeholder2: 'Please input a password'
+}

+ 6 - 0
src/lang/package/en/navbar.js

@@ -0,0 +1,6 @@
+// 导航栏国际化
+export default {
+  dashboard: 'home page',
+  logout: 'log off',
+  my: 'Personal Center'
+}

+ 1 - 1
src/lang/package/zh-cn/login.js

@@ -1,6 +1,6 @@
 // 登录页面国际化
 export default {
-  title: '框架名',
+  title: '服务器集群监控管理系统',
   username: '用户名',
   password: '密码',
   login: '登 录',

+ 18 - 17
src/layout/parts/Tagsbar.vue

@@ -1,15 +1,20 @@
 <template>
   <div class="tags-container">
     <el-scrollbar class="scroll-container" :vertical="false" @wheel.prevent="handleScroll">
-      <router-link ref="tagRef" v-for="tag in visitedViews" :key="tag.fullPath"
-        :class="'tags-item ' + (isActive(tag) ? 'active' : '')" :to="{ path: tag.path, query: tag.query }"
-        @click.middle="!isAffix(tag) ? closeSelectedTag(tag) : ''" @contextmenu.prevent="openContentMenu(tag, $event)">
-        {{ get(tag, 'title') }}
-        <SvgIcon class="close-icon" icon-class="close" v-if="!isAffix(tag)" @click.prevent.stop="closeSelectedTag(tag)">
-        </SvgIcon>
+      <router-link
+        ref="tagRef"
+        v-for="tag in visitedViews"
+        :key="tag.fullPath"
+        :class="'tags-item ' + (isActive(tag) ? 'active' : '')"
+        :to="{ path: tag.path, query: tag.query }"
+        @click.middle="!isAffix(tag) ? closeSelectedTag(tag) : ''"
+        @contextmenu.prevent="openContentMenu(tag, $event)"
+      >
+        {{ tag.title }}
+        <SvgIcon class="close-icon" icon-class="close" v-if="!isAffix(tag)" @click.prevent.stop="closeSelectedTag(tag)"></SvgIcon>
       </router-link>
     </el-scrollbar>
-    <!-- tag标签操作菜单 -->
+    <!-- tag标签操作目录 -->
     <ul v-show="contentMenuVisible" class="contextmenu" :style="{ left: left + 'px', top: top + 'px' }">
       <li @click="refreshSelectedTag(selectedTag)">
         <SvgIcon icon-class="refresh"></SvgIcon>
@@ -45,15 +50,13 @@ import { useRoute, useRouter } from 'vue-router'
 import defaultSettings from '@/settings'
 import { storeToRefs } from 'pinia'
 import { resolve } from 'path-browserify'
-import { useTagsViewStore, useAppStore } from '@/store'
-import {get} from 'lodash-es'
+import { useTagsViewStore } from '@/store'
 
 const { proxy } = getCurrentInstance()
 const router = useRouter()
 const route = useRoute()
 
 const tagsViewStore = useTagsViewStore()
-const appStore = useAppStore()
 
 const { visitedViews } = storeToRefs(tagsViewStore)
 const layout = computed(() => defaultSettings.layout)
@@ -81,7 +84,7 @@ watch(
   }
 )
 
-const contentMenuVisible = ref(false) // 右键菜单是否显示
+const contentMenuVisible = ref(false) // 右键目录是否显示
 watch(contentMenuVisible, (value) => {
   if (value) {
     document.body.addEventListener('click', closeContentMenu)
@@ -171,7 +174,7 @@ function isAffix(tag) {
 
 function isFirstView() {
   try {
-    return selectedTag.value.path === '/dashboard' || selectedTag.value.fullPath === tagsViewStore.visitedViews[1].fullPath
+    return selectedTag.value.path === '/home' || selectedTag.value.fullPath === tagsViewStore.visitedViews[1].fullPath
   } catch (err) {
     return false
   }
@@ -243,7 +246,7 @@ function closeAllTags(view) {
 }
 
 /**
- * 打开右键菜单
+ * 打开右键目录
  */
 function openContentMenu(tag, e) {
   const menuMinWidth = 105
@@ -258,7 +261,7 @@ function openContentMenu(tag, e) {
     left.value = l
   }
 
-  // 混合模式下,需要减去顶部菜单(fixed)的高度
+  // 混合模式下,需要减去顶部目录(fixed)的高度
   if (layout.value === 'mix') {
     top.value = e.clientY - 50
   } else {
@@ -270,7 +273,7 @@ function openContentMenu(tag, e) {
 }
 
 /**
- * 关闭右键菜单
+ * 关闭右键目录
  */
 function closeContentMenu() {
   contentMenuVisible.value = false
@@ -339,11 +342,9 @@ onMounted(() => {
         background: #fff;
         border-radius: 50%;
       }
-
       .close-icon {
         color: #fff;
       }
-
       .close-icon:hover {
         color: var(--el-color-primary);
         background-color: var(--el-fill-color-light);

+ 1 - 1
src/router/guard.js

@@ -90,7 +90,7 @@ export const registerBeforeRouter = async (router) => {
 // 注册路由后置守卫
 
 export const registerAfterRouter = async (router) => {
-  router.afterEach(async (to, form) => {
+  router.afterEach(async (to) => {
     NProgress.done() //完成进度条
     if (to.path === '/login') {
       return

+ 2 - 2
src/router/index.js

@@ -28,8 +28,6 @@ export const constantRoutes = [
     name: 'Layout',
     component: Layout,
     children: [
-      ...systemRoutes,
-      ...userRoutes,
       {
         path: '/',
         name: 'home',
@@ -51,6 +49,8 @@ export const constantRoutes = [
         component: () => import('@/views/error-page/404.vue'),
         meta: { hidden: true }
       },
+      ...systemRoutes,
+      ...userRoutes,
       {
         path: '/acccount',
         name: 'acccount',

+ 1 - 0
src/router/modules/system.js

@@ -2,6 +2,7 @@ export const routes = [
   {
     path: '/system',
     name: 'system',
+    redirect: 'noredirect',
     meta: {
       title: '系统设置',
       affix: true,

+ 1 - 11
src/router/modules/user.js

@@ -2,6 +2,7 @@ export const routes = [
   {
     path: '/user',
     name: 'user',
+    redirect: 'noredirect',
     meta: {
       title: '用户管理',
       affix: true,
@@ -19,17 +20,6 @@ export const routes = [
           alwaysShow: false
         },
         component: () => import('@/views/user/admin/index.vue')
-      },
-      {
-        path: '/user/user',
-        name: 'user_user',
-        meta: {
-          title: '平台用户',
-          affix: true,
-          keepAlive: true,
-          alwaysShow: false
-        },
-        component: () => import('@/views/user/user/index.vue')
       }
     ]
   }

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

@@ -1,5 +1,5 @@
 export const useTagsViewStore = defineStore('tagsView', () => {
-  const visitedViews = ref([{ affix: true, fullPath: '/', keepAlive: true, name: 'home', path: '/', title: '首页' }])
+  const visitedViews = ref([{ affix: true, fullPath: '/', keepAlive: true, name: 'home', path: '/', title: 'home' }])
   const cachedViews = ref([])
 
   /**

+ 4 - 7
src/views/login/index.vue

@@ -22,8 +22,7 @@
         </el-form-item>
         <!-- 密码 -->
         <el-form-item prop="password">
-          <el-input v-model="loginData.password" size="large" type="password" show-password
-            :placeholder="$t('login.placeholder2')">
+          <el-input v-model="loginData.password" size="large" type="password" show-password :placeholder="$t('login.placeholder2')">
             <template #prefix>
               <el-icon>
                 <Unlock />
@@ -32,8 +31,7 @@
           </el-input>
         </el-form-item>
         <!-- 登录按钮 -->
-        <el-button :loading="loading" type="primary" size="large" class="button" @click.prevent="handleLogin">{{
-          $t('login.login') }} </el-button>
+        <el-button :loading="loading" type="primary" size="large" class="button" @click.prevent="handleLogin">{{ $t('login.login') }} </el-button>
       </el-form>
     </el-card>
   </div>
@@ -47,11 +45,11 @@ const loginStore = LoginStore()
 const loading = ref(false) // 按钮loading
 const loginFormRef = ref({}) // 登录表单ref
 const loginData = ref({
-  account: 'admin',
+  account: 'sadmin',
   password: '1qaz2wsx',
   type: 'Admin'
 })
-const loginRules = computed(() => { })
+const loginRules = computed(() => {})
 const toLogin = async (data) => {
   const res = await loginStore.login(data)
   if (res.errcode == '0') {
@@ -61,7 +59,6 @@ const toLogin = async (data) => {
     router.push({ path: '/' })
   }
   loading.value = false
-
 }
 /**
  * 登录

+ 0 - 20
src/views/user/user/index.vue

@@ -1,20 +0,0 @@
-<template>
-  <div id="index">
-    <el-row>
-      <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
-        <el-col :span="24" class="one"> 平台用户 </el-col>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script setup>
-// 加载中
-const loading = ref(false)
-// 请求
-onMounted(async () => {
-  loading.value = true
-  loading.value = false
-})
-</script>
-<style scoped lang="scss"></style>

+ 2 - 2
vite.config.js

@@ -24,7 +24,7 @@ export default defineConfig(({ mode }) => {
       open: true,
       proxy: {
         '/files': {
-          target: 'http://192.168.1.197', // https://broadcast.waityou24.cn
+          target: 'http://127.0.0.1', // https://broadcast.waityou24.cn
           changeOrigin: true
         },
         /**
@@ -32,7 +32,7 @@ export default defineConfig(({ mode }) => {
          */
         [env.VITE_APP_BASE_API]: {
           changeOrigin: true,
-          target: 'http://192.168.1.197:9700'
+          target: 'http://127.0.0.1:9700'
         }
       }
     },