create-jnrs-template-vue 1.1.3 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +5 -5
  2. package/bin/create.mjs +1 -1
  3. package/jnrs-template-vue/README.md +2 -2
  4. package/jnrs-template-vue/components.d.ts +1 -0
  5. package/jnrs-template-vue/package.json +23 -23
  6. package/jnrs-template-vue/public/system/menu.json +8 -4
  7. package/jnrs-template-vue/src/App.vue +36 -5
  8. package/jnrs-template-vue/src/assets/fonts/.keep +0 -0
  9. package/jnrs-template-vue/src/assets/fonts/AlibabaPuHuiTi-Regular.woff2 +0 -0
  10. package/jnrs-template-vue/src/assets/fonts/AlimamaShuHeiTi-Bold.woff2 +0 -0
  11. package/jnrs-template-vue/src/assets/images/common/jnrs-white.svg +1 -0
  12. package/jnrs-template-vue/src/assets/styles/fonts.scss +24 -0
  13. package/jnrs-template-vue/src/assets/styles/init.scss +38 -0
  14. package/jnrs-template-vue/src/assets/styles/main.scss +27 -0
  15. package/jnrs-template-vue/src/assets/styles/root.scss +12 -0
  16. package/jnrs-template-vue/src/layout/BlankLayout.vue +2 -1
  17. package/jnrs-template-vue/src/layout/RouterTabs.vue +14 -9
  18. package/jnrs-template-vue/src/layout/SideMenu.vue +95 -27
  19. package/jnrs-template-vue/src/layout/SideMenuItem.vue +4 -4
  20. package/jnrs-template-vue/src/layout/TopHeader.vue +85 -86
  21. package/jnrs-template-vue/src/layout/index.vue +12 -8
  22. package/jnrs-template-vue/src/locales/en.ts +9 -0
  23. package/jnrs-template-vue/src/locales/index.ts +16 -0
  24. package/jnrs-template-vue/src/locales/zhCn.ts +9 -0
  25. package/jnrs-template-vue/src/main.ts +8 -2
  26. package/jnrs-template-vue/src/router/routes.ts +16 -16
  27. package/jnrs-template-vue/src/types/index.ts +1 -0
  28. package/jnrs-template-vue/src/utils/common.ts +58 -0
  29. package/jnrs-template-vue/src/views/home/index.vue +4 -1
  30. package/jnrs-template-vue/src/views/login/index.vue +222 -38
  31. package/jnrs-template-vue/src/views/system/mine/securitySettings.vue +11 -12
  32. package/jnrs-template-vue/src/views/visual/index.vue +6 -1
  33. package/jnrs-template-vue/tsconfig.json +6 -1
  34. package/jnrs-template-vue/vite.config.ts +2 -2
  35. package/jnrs-template-vue/viteMockServe/index.ts +5 -0
  36. package/package.json +1 -1
  37. package/jnrs-template-vue/src/assets/styles/base.css +0 -28
  38. package/jnrs-template-vue/src/assets/styles/main.css +0 -1
  39. package/jnrs-template-vue/src/utils/storage.ts +0 -7
  40. package/jnrs-template-vue/src/utils/validate.ts +0 -321
  41. package/jnrs-template-vue/src/utils/validator.ts +0 -153
package/README.md CHANGED
@@ -7,12 +7,12 @@
7
7
  TypeScript、Vue3 生态
8
8
 
9
9
  ## 🧩 安装使用说明
10
- jnrs-app-vue」 是你的新项目名称
10
+ 新项目默认名称为 jnrs-template-vue
11
11
  ```shell
12
12
  ✅ 正确用法
13
- pnpm create jnrs-template-vue@latest jnrs-app-vue
13
+ pnpm create jnrs-template-vue@latest
14
14
 
15
- cd jnrs-app-vue
15
+ cd jnrs-template-vue
16
16
  pnpm i
17
17
  pnpm dev
18
18
  pnpm build
@@ -21,9 +21,9 @@ pnpm build
21
21
  pnpm add create-jnrs-template-vue
22
22
  ```
23
23
 
24
- #### 项目结构
24
+ ## 📂 模板项目主要结构
25
25
  ```Text
26
- jnrs-app-vue/
26
+ jnrs-template-vue/
27
27
  ├── dist/ # 打包构建产物
28
28
  ├── node_modules/ # 项目依赖
29
29
  ├── viteMockServe/ # Mock 服务配置(用于开发环境模拟 API)
package/bin/create.mjs CHANGED
@@ -70,7 +70,7 @@ async function main() {
70
70
  type: 'text',
71
71
  name: 'name',
72
72
  message: '项目名称:',
73
- initial: 'jnrs-app-vue',
73
+ initial: 'jnrs-template-vue',
74
74
  validate: (input) => {
75
75
  if (!input) return '请输入项目名称!'
76
76
  if (existsSync(input)) return '目录已存在!'
@@ -1,7 +1,7 @@
1
- # create-jnrs-template-vue
1
+ # jnrs-template-vue
2
2
 
3
3
  ## ✨ 介绍
4
- 巨能前端工程化开发,Vue 项目模板脚手架
4
+ 巨能前端工程化开发,Vue 项目信息化管理系统模板
5
5
 
6
6
  ## 💻 技术栈
7
7
  TypeScript、Vue3 生态
@@ -18,6 +18,7 @@ declare module 'vue' {
18
18
  ElCard: typeof import('element-plus/es')['ElCard']
19
19
  ElCascader: typeof import('element-plus/es')['ElCascader']
20
20
  ElContainer: typeof import('element-plus/es')['ElContainer']
21
+ ElDatePickerPanel: typeof import('element-plus/es')['ElDatePickerPanel']
21
22
  ElForm: typeof import('element-plus/es')['ElForm']
22
23
  ElFormItem: typeof import('element-plus/es')['ElFormItem']
23
24
  ElHeader: typeof import('element-plus/es')['ElHeader']
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jnrs-template-vue",
3
- "version": "1.1.3",
4
- "description": "JNRS 新项目模板",
3
+ "version": "1.1.5",
4
+ "description": "JNRS 信息化管理系统模板",
5
5
  "author": "Talia-Tan",
6
6
  "private": true,
7
7
  "type": "module",
@@ -18,37 +18,37 @@
18
18
  "format": "prettier --write src/"
19
19
  },
20
20
  "dependencies": {
21
- "@jnrs/shared": "*",
21
+ "@element-plus/icons-vue": "^2.3.2",
22
22
  "@jnrs/core": "*",
23
+ "@jnrs/shared": "*",
23
24
  "@jnrs/vue-core": "*",
24
- "@element-plus/icons-vue": "^2.3.2",
25
- "async-validator": "^4.2.5",
26
- "element-plus": "^2.11.4",
27
- "pinia": "^3.0.3",
28
- "pinia-plugin-persistedstate": "^4.5.0",
29
- "vue": "^3.5.22"
25
+ "element-plus": "^2.11.9",
26
+ "pinia": "^3.0.4",
27
+ "pinia-plugin-persistedstate": "^4.7.1",
28
+ "vue": "^3.5.25",
29
+ "vue-i18n": "^9.14.5"
30
30
  },
31
31
  "devDependencies": {
32
- "@tsconfig/node22": "^22.0.2",
33
- "@types/node": "^22.18.6",
34
- "@typescript-eslint/parser": "^8.46.2",
35
- "@vitejs/plugin-vue": "^6.0.1",
32
+ "@tsconfig/node22": "^22.0.5",
33
+ "@types/node": "^22.19.1",
34
+ "@typescript-eslint/parser": "^8.48.1",
35
+ "@vitejs/plugin-vue": "^6.0.2",
36
36
  "@vue/eslint-config-prettier": "^10.2.0",
37
37
  "@vue/eslint-config-typescript": "^14.6.0",
38
38
  "@vue/tsconfig": "^0.8.1",
39
- "eslint": "^9.33.0",
39
+ "eslint": "^9.39.1",
40
40
  "eslint-plugin-vue": "~10.4.0",
41
- "jiti": "^2.5.1",
41
+ "jiti": "^2.6.1",
42
42
  "npm-run-all2": "^8.0.4",
43
43
  "prettier": "3.6.2",
44
- "sass-embedded": "^1.93.2",
45
- "typescript": "~5.9.0",
46
- "unplugin-auto-import": "^20.2.0",
47
- "unplugin-vue-components": "^29.1.0",
48
- "vite": "^7.1.7",
44
+ "sass": "^1.94.2",
45
+ "typescript": "~5.9.3",
46
+ "unplugin-auto-import": "^20.3.0",
47
+ "unplugin-vue-components": "^29.2.0",
48
+ "vite": "^7.2.2",
49
49
  "vite-plugin-compression": "^0.5.1",
50
- "vite-plugin-vue-devtools": "^8.0.2",
51
- "vue-tsc": "^3.1.0",
52
- "vite-plugin-mock": "^3.0.2"
50
+ "vite-plugin-mock": "^3.0.2",
51
+ "vite-plugin-vue-devtools": "^8.0.5",
52
+ "vue-tsc": "^3.1.5"
53
53
  }
54
54
  }
@@ -18,14 +18,16 @@
18
18
  "name": "Crud",
19
19
  "meta": {
20
20
  "title": "测试页面",
21
- "icon": "Platform"
21
+ "icon": "StarFilled",
22
+ "todoCount": 8
22
23
  },
23
24
  "component": "/crud/index"
24
25
  },
25
26
  {
26
27
  "meta": {
27
28
  "title": "系统管理",
28
- "icon": "Tools"
29
+ "icon": "Tools",
30
+ "todoCount": 99
29
31
  },
30
32
  "children": [
31
33
  {
@@ -33,7 +35,8 @@
33
35
  "name": "SystemMine",
34
36
  "meta": {
35
37
  "title": "个人中心",
36
- "icon": "User"
38
+ "icon": "User",
39
+ "todoCount": 99
37
40
  },
38
41
  "component": "/system/mine/index"
39
42
  },
@@ -42,7 +45,8 @@
42
45
  "name": "SystemUser",
43
46
  "meta": {
44
47
  "title": "用户管理",
45
- "icon": "User"
48
+ "icon": "User",
49
+ "todoCount": 0
46
50
  },
47
51
  "component": "/system/user/index"
48
52
  },
@@ -1,14 +1,45 @@
1
1
  <script setup lang="ts">
2
- console.log(
3
- '%cPowered by 🅹🅽🆁🆂 TECH',
4
- `background: #f2f2c1;
2
+ import { onMounted, watch } from 'vue'
3
+ import { useSystemStore } from '@/stores'
4
+ import { ElConfigProvider } from 'element-plus'
5
+ import zhCn from 'element-plus/es/locale/lang/zh-CN'
6
+ import en from 'element-plus/es/locale/lang/en'
7
+ import { useI18n } from 'vue-i18n'
8
+ import { changeLocales as changeLocalesForShared } from '@jnrs/shared'
9
+ import { changeLocales as changeLocalesForCore } from '@jnrs/core'
10
+
11
+ const { locale } = useI18n()
12
+ const { theme } = useSystemStore()
13
+ watch(
14
+ () => theme.locale,
15
+ (newValue) => {
16
+ locale.value = newValue
17
+ changeLocalesForShared(newValue)
18
+ changeLocalesForCore(newValue)
19
+ },
20
+ {
21
+ immediate: true
22
+ }
23
+ )
24
+ const localeMap = {
25
+ zhCn: zhCn,
26
+ en: en
27
+ }
28
+
29
+ onMounted(() => {
30
+ console.log(
31
+ '%cPowered by 🅹🅽🆁🆂 TECH',
32
+ `background: #f2f2c1;
5
33
  color: #d15f2c;
6
34
  font-weight: bold;
7
35
  padding: 0 8px;
8
36
  font-family: 'Helvetica Neue', sans-serif;`
9
- )
37
+ )
38
+ })
10
39
  </script>
11
40
 
12
41
  <template>
13
- <router-view></router-view>
42
+ <el-config-provider :locale="localeMap[theme.locale]">
43
+ <router-view></router-view>
44
+ </el-config-provider>
14
45
  </template>
File without changes
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 276.55 50.85"><defs><style>.a{fill:#fff;}</style></defs><path class="a" d="M-336.3,445.05c6.8,0,13.6-.05,20.41,0,.05,14.45-.12,28.89-.14,43.33.3,3.93-3.34,7.48-7.21,7.43-4.35,0-8.71,0-13.06,0Q-336.33,470.45-336.3,445.05Z" transform="translate(381.53 -445.04)"/><path class="a" d="M-306.42,447.84a6.54,6.54,0,0,1,5.5-2.79h12.49a1.57,1.57,0,0,1,1.11.31c5.76,3.57,11.54,7.1,17.3,10.67q0,11.28,0,22.58c-5.92-3.59-11.83-7.22-17.76-10.8v28.08c-6.79,0-13.59,0-20.38,0q0-20.82,0-41.63A10.53,10.53,0,0,1-306.42,447.84Z" transform="translate(381.53 -445.04)"/><path class="a" d="M-267.56,452.43a7.3,7.3,0,0,1,7.09-7.38h13.39c.06,16.92,0,33.85,0,50.78-6.83,0-13.66,0-20.49,0C-267.61,481.37-267.54,466.9-267.56,452.43Z" transform="translate(381.53 -445.04)"/><path class="a" d="M-236.93,445.06q26.9,0,53.78,0a7.23,7.23,0,0,1,7,5.58c.11,1.55,0,3.1,0,4.64-20.28,0-40.56,0-60.84-.06Q-236.91,450.14-236.93,445.06Z" transform="translate(381.53 -445.04)"/><path class="a" d="M-165.71,450a7.14,7.14,0,0,1,6.63-4.95h42.25a11.66,11.66,0,0,1,8.19,3.34,13.71,13.71,0,0,1,3.65,6.86h-40.62c0,3.36,0,6.72,0,10.09q16.77,0,33.54,0a7.29,7.29,0,0,1,7,6.09c.09,1.33,0,2.67,0,4-18.42.05-36.84,0-55.26,0A7,7,0,0,1-166,469.7c0-5.16,0-10.33,0-15.49A13.83,13.83,0,0,1-165.71,450Z" transform="translate(381.53 -445.04)"/><path class="a" d="M-196.48,457.73c6.79-.05,13.59,0,20.39,0,0,3.89,0,7.78,0,11.66a7.07,7.07,0,0,1-7.05,6.1c-11.19,0-22.37,0-33.55,0q0,10.2,0,20.38c-6.79,0-13.58,0-20.38,0,0-10.05,0-20.11,0-30.16q20.26,0,40.52,0C-196.36,463.05-196.48,460.38-196.48,457.73Z" transform="translate(381.53 -445.04)"/><path class="a" d="M-381.49,472.19c6.78,0,13.56,0,20.34,0,0,4.48,0,9,0,13.42,7.43.14,14.88.06,22.31,0,.11,3.39,0,6.78,0,10.17q-17.79,0-35.58,0a7.23,7.23,0,0,1-7.16-7.13C-381.48,483.2-381.55,477.7-381.49,472.19Z" transform="translate(381.53 -445.04)"/><path class="a" d="M-202.37,477.73h19.88c.72,2.63,1.29,5.31,2.06,7.93,18.36-.07,36.72,0,55.08-.06,0-2.56,0-5.13,0-7.69,6.78,0,13.56,0,20.34,0,0,3.6,0,7.2,0,10.8a7.08,7.08,0,0,1-6.79,7.14h-52.05c-11.43,0-22.86-.07-34.28,0Q-200.28,486.8-202.37,477.73Z" transform="translate(381.53 -445.04)"/></svg>
@@ -0,0 +1,24 @@
1
+ /* font */
2
+ @font-face {
3
+ font-family: 'Alibaba-PuHuiTi-Regular';
4
+ src: url('@/assets/fonts/AlibabaPuHuiTi-Regular.woff2');
5
+ }
6
+
7
+ @font-face {
8
+ font-family: 'AlimamaShuHeiTi-Bold';
9
+ src: url('@/assets/fonts/AlimamaShuHeiTi-Bold.woff2');
10
+ }
11
+
12
+ /*
13
+ * 阿里巴巴普惠体 - 正黑体
14
+ */
15
+ .Alibaba-PuHuiTi-Regular {
16
+ font-family: 'Alibaba-PuHuiTi-Regular';
17
+ }
18
+
19
+ /*
20
+ * 阿里妈妈字体 - 数黑体
21
+ */
22
+ .AlimamaShuHeiTi-Bold {
23
+ font-family: 'AlimamaShuHeiTi-Bold';
24
+ }
@@ -0,0 +1,38 @@
1
+ *,
2
+ *::before,
3
+ *::after {
4
+ margin: 0;
5
+ box-sizing: border-box;
6
+ font-family: Alibaba-PuHuiTi-Regular;
7
+ }
8
+
9
+ a {
10
+ text-decoration: none;
11
+ }
12
+
13
+ /* 所有自动填充 input */
14
+ input:-webkit-autofill,
15
+ input:-webkit-autofill:hover,
16
+ input:-webkit-autofill:focus,
17
+ input:-webkit-autofill:active,
18
+ input:autofill,
19
+ input:-webkit-autofill-strong-password,
20
+ input:-webkit-autofill-strong-password-viewable,
21
+ input:-webkit-autofill-and-obscured {
22
+ -webkit-box-shadow: 0 0 0 1000px rgba(255, 0, 0, 0) inset !important;
23
+ background-color: rgb(255, 0, 0) !important;
24
+ }
25
+
26
+ /*
27
+ * 禁止拖拽图片
28
+ * 禁止长按弹出菜单
29
+ */
30
+ img {
31
+ -ms-user-drag: none;
32
+ -moz-user-drag: none;
33
+ -webkit-user-drag: none;
34
+ -webkit-touch-callout: none;
35
+ overflow: hidden;
36
+ object-fit: cover;
37
+ object-position: center center;
38
+ }
@@ -0,0 +1,27 @@
1
+ @use './init.scss';
2
+ @use './fonts.scss';
3
+ @use './root.scss';
4
+
5
+ body {
6
+ width: 100vw;
7
+ height: 100vh;
8
+ color: var(--jnrs-font-primary);
9
+ background: var(--jnrs-background-primary);
10
+ }
11
+
12
+ #app {
13
+ min-width: 1280px;
14
+ height: 100%;
15
+ }
16
+
17
+ /*
18
+ * 禁止用户选中页面元素
19
+ */
20
+ .no-select {
21
+ -khtml-user-drag: none;
22
+ -webkit-user-drag: none;
23
+ -webkit-user-select: none;
24
+ -moz-user-select: none;
25
+ -ms-user-select: none;
26
+ user-select: none;
27
+ }
@@ -0,0 +1,12 @@
1
+ :root {
2
+ // Layout 头部高度
3
+ --jnrs-head-height: 50px;
4
+ --jnrs-routerTabs-height: 30px;
5
+
6
+ // // element-ui 样式
7
+ // --el-menu-base-level-padding: 8px !important;
8
+ }
9
+
10
+ .el-button--primary {
11
+ --el-button-bg-color: var(--jnrs-color-primary);
12
+ }
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="blank-layout">
2
+ <div class="blank-layout no-select">
3
3
  <router-view />
4
4
  </div>
5
5
  </template>
@@ -10,5 +10,6 @@
10
10
  width: 100vw;
11
11
  height: 100vh;
12
12
  background: #000;
13
+ overflow: hidden;
13
14
  }
14
15
  </style>
@@ -122,26 +122,31 @@ const handleTabClick = (tab: TabsPaneContext) => {
122
122
 
123
123
  <style lang="scss" scoped>
124
124
  .routerTabs {
125
+ position: relative;
126
+ z-index: 5;
125
127
  :deep(.el-tabs__header) {
126
128
  margin-bottom: 0;
127
- height: 32px;
129
+ height: var(--jnrs-routerTabs-height);
128
130
  }
129
131
  :deep(.el-tabs__item) {
130
- color: #888;
132
+ color: var(--jnrs-font-primary-06);
131
133
  font-size: 12px;
132
- height: 32px;
134
+ height: var(--jnrs-routerTabs-height);
133
135
  }
134
136
  :deep(.el-tabs__item.is-active) {
135
- color: #d15f2c;
136
- border-bottom-color: #f2f2f2;
137
+ color: var(--jnrs-color-primary);
138
+ border-bottom-color: var(--jnrs-color-primary);
139
+ }
140
+ :deep(.el-tabs__nav) {
141
+ border-radius: 0;
142
+ border-left: none;
143
+ border-top: none;
137
144
  }
138
145
  :deep(.el-tabs__nav-prev) {
139
- color: #d15f2c;
140
- background: #fff;
146
+ color: var(--jnrs-color-primary);
141
147
  }
142
148
  :deep(.el-tabs__nav-next) {
143
- color: #d15f2c;
144
- background: #fff;
149
+ color: var(--jnrs-color-primary);
145
150
  }
146
151
  }
147
152
  </style>
@@ -3,9 +3,12 @@ import SideMenuItem from './SideMenuItem.vue'
3
3
  import { storeToRefs } from 'pinia'
4
4
  import { useRoute } from '@jnrs/vue-core/router'
5
5
  import { useSystemStore, useMenuStore } from '@/stores'
6
+ import { useI18n } from 'vue-i18n'
6
7
 
8
+ const { t } = useI18n()
7
9
  const systemStore = useSystemStore()
8
10
  const { menuCollapse } = storeToRefs(systemStore)
11
+ const { toggleCollapse } = systemStore
9
12
  const { menus } = useMenuStore()
10
13
 
11
14
  const route = useRoute()
@@ -13,7 +16,18 @@ const route = useRoute()
13
16
 
14
17
  <template>
15
18
  <el-aside class="sideMenu">
16
- <div class="logo">后台管理系统</div>
19
+ <div class="logo" :class="{ logo_collapse: menuCollapse }">
20
+ <img class="logo_img" src="@/assets/images/common/jnrs-white.svg" alt="jnrs" />
21
+ <span class="logo_text">{{ t('main.title') }}</span>
22
+ </div>
23
+ <el-icon
24
+ class="collapseBtn"
25
+ :class="{ collapseBtn_active: menuCollapse }"
26
+ title="菜单折叠"
27
+ @click="toggleCollapse()"
28
+ >
29
+ <Fold />
30
+ </el-icon>
17
31
  <el-menu
18
32
  class="leftSide_menu"
19
33
  popper-class="layoutPage_leftSide_menu_popper"
@@ -28,17 +42,77 @@ const route = useRoute()
28
42
  </template>
29
43
 
30
44
  <style lang="scss" scoped>
45
+ $mainFontColor: rgba(255, 255, 255, 0.8);
46
+
31
47
  .sideMenu {
32
- max-width: 200px;
48
+ position: relative;
49
+ z-index: 20;
50
+ width: auto;
33
51
  height: 100%;
52
+ padding: 0 8px;
53
+ background: oklch(0.24 0 0);
54
+ // background: var(--jnrs-card-primary);
55
+ box-shadow: 1px 0 1px var(--jnrs-font-primary-03);
34
56
  overflow-x: hidden;
35
- padding: 0 10px;
36
- background: rgba(20, 22, 26, 1);
37
- box-shadow: 5px 0 8px rgba(20, 22, 26, 0.3);
38
- color: rgba(255, 255, 255, 1);
57
+ color: $mainFontColor;
39
58
 
40
59
  .logo {
41
- height: 50px;
60
+ position: relative;
61
+ height: calc(var(--jnrs-head-height) + var(--jnrs-routerTabs-height));
62
+ border-bottom: 1px solid rgb(248 248 248 / 15%);
63
+
64
+ .logo_text {
65
+ position: absolute;
66
+ bottom: 0;
67
+ left: 50%;
68
+ color: rgba(255, 255, 255, 1);
69
+ font-weight: normal;
70
+ font-family: AlimamaShuHeiTi-Bold;
71
+ white-space: nowrap;
72
+ transform: translate(-50%, -50%);
73
+ transition: all 0.3s ease;
74
+ filter: opacity(1);
75
+ }
76
+
77
+ .logo_img {
78
+ position: absolute;
79
+ top: 0;
80
+ left: 50%;
81
+ width: 80%;
82
+ transform: translate(-50%, 50%);
83
+ transition: all 0.3s ease;
84
+ }
85
+ }
86
+
87
+ .logo_collapse {
88
+ .logo_text {
89
+ transform: translate(-50%, -50%) scale(0);
90
+ opacity: 0;
91
+ }
92
+ .logo_img {
93
+ width: 100%;
94
+ top: 50%;
95
+ transform: translate(-50%, -50%);
96
+ }
97
+ }
98
+
99
+ .collapseBtn {
100
+ position: absolute;
101
+ bottom: 10px;
102
+ font-size: 24px;
103
+ color: $mainFontColor;
104
+ padding: 4px;
105
+ border-radius: 50%;
106
+ background-color: #424242;
107
+ transition: all 0.25s ease;
108
+ cursor: pointer;
109
+ &:hover {
110
+ color: var(--jnrs-color-primary);
111
+ }
112
+ }
113
+
114
+ .collapseBtn_active {
115
+ transform: rotate(-180deg);
42
116
  }
43
117
 
44
118
  :deep(.el-sub-menu__title) {
@@ -52,7 +126,7 @@ const route = useRoute()
52
126
 
53
127
  .el-sub-menu.is-active {
54
128
  border-radius: 10px;
55
- background: #d15f2c;
129
+ background: var(--jnrs-color-primary);
56
130
  }
57
131
 
58
132
  :deep(.el-menu-item span) {
@@ -63,8 +137,8 @@ const route = useRoute()
63
137
  .leftSide_menu {
64
138
  border: none;
65
139
  min-width: 180px;
66
- --el-menu-text-color: #f2f2f2;
67
- --el-menu-active-color: #f2f2f2;
140
+ --el-menu-text-color: $mainFontColor;
141
+ --el-menu-active-color: $mainFontColor;
68
142
  --el-menu-bg-color: none;
69
143
 
70
144
  :deep(.el-menu-item) {
@@ -77,22 +151,17 @@ const route = useRoute()
77
151
 
78
152
  &:hover {
79
153
  background: none !important;
80
- span {
81
- color: #f2f2f2 !important;
82
- }
154
+ color: var(--jnrs-color-primary);
83
155
  }
84
156
  }
85
157
 
86
158
  :deep(.el-menu-item.is-active) {
87
- background: #d15f2c !important;
88
-
89
- span {
90
- color: #f2f2f2 !important;
91
- }
159
+ background: var(--jnrs-color-primary) !important;
160
+ color: $mainFontColor !important;
92
161
  }
93
162
 
94
163
  .el-menu-item.is-active {
95
- background: #d15f2c;
164
+ background: var(--jnrs-color-primary);
96
165
  color: #fff !important;
97
166
 
98
167
  span {
@@ -104,11 +173,13 @@ const route = useRoute()
104
173
  </style>
105
174
 
106
175
  <style lang="scss">
176
+ $mainFontColor: rgba(255, 255, 255, 0.8);
177
+
107
178
  // 弹出层样式
108
179
  .layoutPage_leftSide_menu_popper {
109
180
  background: #051524;
110
181
  border: none !important;
111
- left: 86px !important;
182
+ left: 74px !important;
112
183
  border-radius: 15px;
113
184
  padding: 0 10px;
114
185
  .el-menu {
@@ -117,9 +188,9 @@ const route = useRoute()
117
188
  .el-menu-item {
118
189
  border-radius: 10px;
119
190
  background-color: none;
120
- color: #f2f2f2;
191
+ color: $mainFontColor;
121
192
  &:hover {
122
- color: none;
193
+ color: var(--jnrs-color-primary);
123
194
  background: none;
124
195
  }
125
196
  span {
@@ -130,11 +201,8 @@ const route = useRoute()
130
201
  }
131
202
  .el-menu-item.is-active {
132
203
  border-radius: 10px;
133
- background: #d15f2c;
134
- color: #f2f2f2;
135
- }
136
- .layoutPage_leftSide_menu_popper {
137
- left: 215px !important;
204
+ background: var(--jnrs-color-primary);
205
+ color: $mainFontColor;
138
206
  }
139
207
  }
140
208
  </style>
@@ -1,6 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { useSystemStore } from '@/stores'
3
3
  import type { MenuItem } from '@/types'
4
+
4
5
  defineProps<{
5
6
  listItem: MenuItem
6
7
  }>()
@@ -14,7 +15,7 @@ const { menuCollapse } = useSystemStore()
14
15
  <el-icon v-if="listItem.meta.icon">
15
16
  <component :is="listItem.meta.icon" />
16
17
  </el-icon>
17
- <el-badge :show-zero="false" :value="listItem.todoCount" :offset="[7, 17]" color="#f00">
18
+ <el-badge :show-zero="false" :value="listItem.meta.todoCount" :offset="[7, 17]" color="#EC5545">
18
19
  <span>{{ listItem.meta.title }}</span>
19
20
  </el-badge>
20
21
  </el-menu-item>
@@ -22,11 +23,10 @@ const { menuCollapse } = useSystemStore()
22
23
  <!-- 一级目录 -->
23
24
  <template #title>
24
25
  <el-badge
25
- v-if="listItem.todoCount"
26
26
  :show-zero="false"
27
- :is-dot="listItem.todoCount > 0"
27
+ :is-dot="listItem.meta.todoCount && listItem.meta.todoCount > 0"
28
28
  :offset="[menuCollapse ? -5 : -10, 20]"
29
- color="#f00"
29
+ color="#EC5545"
30
30
  >
31
31
  <el-icon v-if="listItem.meta.icon"><component :is="listItem.meta.icon" /></el-icon>
32
32
  </el-badge>