Skip to content

Commit cfeb813

Browse files
committed
init
0 parents  commit cfeb813

File tree

401 files changed

+11125
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

401 files changed

+11125
-0
lines changed

.editorconfig

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf

.env

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VITE_TITLE = 'Vue Naive Admin'

.env.development

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# 是否使用Hash路由
2+
VITE_USE_HASH = 'true'
3+
4+
# 资源公共路径,需要以 /开头和结尾
5+
VITE_PUBLIC_PATH = '/'
6+
7+
# 代理配置-target
8+
VITE_PROXY_TARGET = 'http://localhost:8085'

.env.production

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# 是否使用Hash路由
2+
VITE_USE_HASH = 'false'
3+
4+
# 资源公共路径,需要以 /开头和结尾
5+
VITE_PUBLIC_PATH = '/'
6+
7+
# 代理配置-target
8+
VITE_PROXY_TARGET = 'http://localhost:8085'

.eslint-global-variables.json

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"globals": {
3+
"$loadingBar": true,
4+
"$message": true,
5+
"$dialog": true,
6+
"$notification": true,
7+
"$modal": true,
8+
"defineOptions": true,
9+
"EffectScope": true,
10+
"computed": true,
11+
"createApp": true,
12+
"customRef": true,
13+
"defineAsyncComponent": true,
14+
"defineComponent": true,
15+
"effectScope": true,
16+
"getCurrentInstance": true,
17+
"getCurrentScope": true,
18+
"h": true,
19+
"inject": true,
20+
"isProxy": true,
21+
"isReactive": true,
22+
"isReadonly": true,
23+
"isRef": true,
24+
"markRaw": true,
25+
"nextTick": true,
26+
"onActivated": true,
27+
"onBeforeMount": true,
28+
"onBeforeUnmount": true,
29+
"onBeforeUpdate": true,
30+
"onDeactivated": true,
31+
"onErrorCaptured": true,
32+
"onMounted": true,
33+
"onRenderTracked": true,
34+
"onRenderTriggered": true,
35+
"onScopeDispose": true,
36+
"onServerPrefetch": true,
37+
"onUnmounted": true,
38+
"onUpdated": true,
39+
"provide": true,
40+
"reactive": true,
41+
"readonly": true,
42+
"ref": true,
43+
"resolveComponent": true,
44+
"shallowReactive": true,
45+
"shallowReadonly": true,
46+
"shallowRef": true,
47+
"toRaw": true,
48+
"toRef": true,
49+
"toRefs": true,
50+
"triggerRef": true,
51+
"unref": true,
52+
"useAttrs": true,
53+
"useCssModule": true,
54+
"useCssVars": true,
55+
"useRoute": true,
56+
"useRouter": true,
57+
"useSlots": true,
58+
"watch": true,
59+
"watchEffect": true,
60+
"watchPostEffect": true,
61+
"watchSyncEffect": true
62+
}
63+
}

.eslintignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
dist
3+
public
4+
package.json

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.local
2+
node_modules
3+
dist
4+
stats.html

.npmrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
registry=https://registry.npm.taobao.org
2+
shamefully-hoist=true

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/node_modules/**
2+
/dist/*
3+
/public/*

.prettierrc.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"printWidth": 100,
3+
"singleQuote": true,
4+
"semi": false,
5+
"endOfLine": "lf",
6+
"htmlWhitespaceSensitivity": "ignore"
7+
}

.vscode/extensions.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"recommendations": [
3+
"Vue.volar",
4+
"Vue.vscode-typescript-vue-plugin",
5+
"antfu.unocss",
6+
"antfu.iconify",
7+
"dbaeumer.vscode-eslint",
8+
"esbenp.prettier-vscode",
9+
"sdras.vue-vscode-snippets",
10+
"mikestead.dotenv"
11+
]
12+
}

.vscode/settings.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"files.eol": "\n",
3+
"files.associations": {
4+
"*.env.*": "dotenv",
5+
"*.svg": "html",
6+
"*.css": "scss"
7+
},
8+
9+
"editor.formatOnSave": false,
10+
"[html][css][less][scss][sass][yaml][yml][jsonc][json]": {
11+
"editor.formatOnSave": true,
12+
"editor.defaultFormatter": "esbenp.prettier-vscode"
13+
},
14+
"[markdown]": {
15+
"editor.formatOnSave": true,
16+
"editor.defaultFormatter": "yzhang.markdown-all-in-one"
17+
},
18+
"editor.codeActionsOnSave": {
19+
"source.fixAll.eslint": true
20+
},
21+
"eslint.validate": ["javascript", "typescript", "javascriptreact", "typescriptreact", "vue"]
22+
}

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Ronnie Zhang(大脸怪)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Vue Naive Admin 2.0
2+
3+
<p align="center">
4+
<a href="https://github.com/zclzone/vue-naive-admin">
5+
<img alt="Vue Naive Admin Logo" width="200" src="./src/assets/images/logo.png">
6+
</a>
7+
</p>
8+
<p align="center">
9+
<a href="./LICENSE"><img alt="MIT License" src="https://badgen.net/github/license/zclzone/vue-naive-admin"/></a>
10+
</p>
11+
12+
## 简介
13+
Vue Naive Admin 是一款极简风格的后台管理模板,包含前后端解决方案,前端使用 Vite + Vue3 + Pinia + Unocss,后端使用 Nestjs + TypeOrm + MySql,简单易用,赏心悦目,历经十几次重构和细节打磨,诚意满满!!
14+
15+
## 设计理念
16+
17+
Vue Naive Admin 2022年2月开始开源,从 1.0 到现在的 2.0,一直秉持着`简单即正义`的理念,旨在帮助中小企业、在校大学生及个人开发者快速上手开发后台管理项目,为了降低使用者的学习成本,没有使用看似主流的 TypeScript(前端),这也使得 Vue Naive Admin 成为了市面上少有的 `使用 JavaScript 的 Vue3 后台管理模板`,而且还算优秀,得到了大量朋友的认可和喜爱,截至 2023-11-17, github `1.1k+` star,gitee `260+` star。
18+
19+
## 特性
20+
21+
- 🆒 使用 **Vue3** 主流最新技术栈: `Vite + Vue3 + Pinia`
22+
- 🍇 使用 **原子CSS**框架: `Unocss`,优雅、轻量、易用
23+
- 🍍 集成 `Pinia` 状态管理,支持状态持久化
24+
- 🤹 使用主流的 `iconify + unocss` 图标方案,支持自定义图标,支持动态渲染
25+
- 🎨 使用 Naive UI,`极致简洁的代码风格和清爽的页面设计`,审美在线,主题轻松定制
26+
- 👏 先进且易于理解的文件结构设计,多个模块之间**零耦合**,单个业务模块删除不影响其他模块
27+
- 🚀 `扁平化路由`设计,每一个组件都可以是一个页面,告别多级路由 `KeepAlive` 难实现问题
28+
- 🍒 `基于权限动态生成路由`,无需额外定义路由,`403和404页面可区分`,而不是无权限也跳404
29+
- 🔐 基于Redis集成 `无感刷新`,用户登录态可控,安全与体验缺一不可
30+
- ✨ 基于 Naive UI 封装 `message` 全局工具方法,支持批量提醒,支持跨页面单例模式
31+
- ⚡️ 基于 Naive UI 封装常用的业务组件,包含`Page` 组件、`CRUD` 表格组件及 `Modal`组件等,简单易用,减少大量重复性工作
32+
33+
## 极致的性能
34+
35+
![](http://docs.isme.top/server/index.php?s=/api/attachment/visitFile&sign=0b81142878f6cf5019f6c5d4cfed7881)
36+
![](http://docs.isme.top/server/index.php?s=/api/attachment/visitFile&sign=e935b43f97008a7c2a8e7ec95a68b7cd)
37+
38+
## 2.0 和 1.0 区别
39+
40+
- 2.0 是基于 1.0 风格从 0 到 1 重新设计的,所以 2.0 看似跟 1.0 很像,但其实代码机构差别还挺大的。
41+
- 1.0 只提供前端,后端使用 Mock 模拟的,而 2.0 是全栈版,提供真实的后端接口。
42+
- 2.0 虽然版本高于 1.0,但复杂度却远低于 1.0,虽然 1.0 也很简单。
43+
- 2.0 的灵活度远高于 1.0,只要你愿意,你可以为每个页面单独定制一个 layout
44+
45+
[体验1.0 | template.isme.top](https://template.isme.top)
46+
47+
[体验2.0 | admin.isme.top](https://admin.isme.top)
48+
49+
## Nestjs 后端
50+
51+
Vue Naive Admin 提供一套后端代码,技术栈使用 Nestjs + TypeOrm + MySql,内置 JWT、RABC及模板所需的一些基础接口。
52+
*后续可能会提供 Java 版和 Go 版的,但由于精力有限,欢迎感兴趣的大佬基于前端提供对接好的后端项目,当然,并不局限于 Java 和 Go,已对接的后端项目会展示到仓库的 README 和 官方文档中*
53+
54+
## 版权说明
55+
56+
本项目使用 `MIT协议`,默认授权给任何人,被授权人可免费地无限制的使用、复制、修改、合并、发布、发行、再许可、售卖本软件拷贝、并有权向被供应人授予同等的权利,但必须满足以下条件:
57+
58+
- 复制、修改和发行本项目代码需包含原作者的版权及许可信息,包括但不限于文件头注释、协议等
59+
60+
简单来说,作者只想保留版权,没有任何其他限制。
61+

build/index.js

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**********************************
2+
* @Author: Ronnie Zhang
3+
* @LastEditor: Ronnie Zhang
4+
* @LastEditTime: 2023/12/04 22:48:02
5+
6+
* Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
7+
**********************************/
8+
9+
import { globSync } from 'glob'
10+
import path from 'path'
11+
import dynamicIcons from '../src/assets/icons/dynamic-icons'
12+
13+
/**
14+
* @usage 生成icons, 用于 unocss safelist,以支持页面动态渲染自定义图标
15+
*/
16+
export function getIcons() {
17+
const feFiles = globSync('src/assets/icons/feather/*.svg', { nodir: true, strict: true })
18+
const meFiles = globSync('src/assets/icons/isme/*.svg', { nodir: true, strict: true })
19+
const feIcons = feFiles.map((filePath) => {
20+
const fileName = path.basename(filePath) // 获取文件名,包括后缀
21+
const fileNameWithoutExt = path.parse(fileName).name // 获取去除后缀的文件名
22+
return `i-fe:${fileNameWithoutExt}`
23+
})
24+
const meIcons = meFiles.map((filePath) => {
25+
const fileName = path.basename(filePath) // 获取文件名,包括后缀
26+
const fileNameWithoutExt = path.parse(fileName).name // 获取去除后缀的文件名
27+
return `i-me:${fileNameWithoutExt}`
28+
})
29+
30+
return [...dynamicIcons, ...feIcons, ...meIcons]
31+
}
32+
33+
/**
34+
* @usage 生成.vue文件路径列表,用于添加菜单时可下拉选择对应的.vue文件路径,防止手动输入报错
35+
*/
36+
export function getPagePathes() {
37+
const files = globSync('src/views/**/*.vue')
38+
return files.map((item) => '/' + path.normalize(item).replace(/\\/g, '/'))
39+
}

build/plugin-isme/icons.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**********************************
2+
* @Author: Ronnie Zhang
3+
* @LastEditor: Ronnie Zhang
4+
* @LastEditTime: 2023/12/04 22:48:11
5+
6+
* Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
7+
**********************************/
8+
9+
import { getIcons } from '..'
10+
11+
const PLUGIN_ICONS_ID = 'isme:icons'
12+
export function pluginIcons() {
13+
return {
14+
name: 'isme:icons',
15+
resolveId(id) {
16+
if (id === PLUGIN_ICONS_ID) return '\0' + PLUGIN_ICONS_ID
17+
},
18+
load(id) {
19+
if (id === '\0' + PLUGIN_ICONS_ID) {
20+
return `export default ${JSON.stringify(getIcons())}`
21+
}
22+
},
23+
}
24+
}

build/plugin-isme/index.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**********************************
2+
* @Author: Ronnie Zhang
3+
* @LastEditor: Ronnie Zhang
4+
* @LastEditTime: 2023/12/04 22:48:17
5+
6+
* Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
7+
**********************************/
8+
9+
export { pluginPagePathes } from './page-pathes'
10+
export { pluginIcons } from './icons'

build/plugin-isme/page-pathes.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**********************************
2+
* @Author: Ronnie Zhang
3+
* @LastEditor: Ronnie Zhang
4+
* @LastEditTime: 2023/12/05 21:37:43
5+
6+
* Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
7+
**********************************/
8+
9+
import { getPagePathes } from '..'
10+
11+
const PLUGIN_PAGE_PATHES_ID = 'isme:page-pathes'
12+
export function pluginPagePathes() {
13+
return {
14+
name: 'isme:page-pathes',
15+
resolveId(id) {
16+
if (id === PLUGIN_PAGE_PATHES_ID) return '\0' + PLUGIN_PAGE_PATHES_ID
17+
},
18+
load(id) {
19+
if (id === '\0' + PLUGIN_PAGE_PATHES_ID) {
20+
return `export default ${JSON.stringify(getPagePathes())}`
21+
}
22+
},
23+
}
24+
}

index.html

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<link rel="icon" href="/favicon.png" />
7+
<link rel="stylesheet" href="/resource/loading.css" />
8+
<title><%= title %></title>
9+
</head>
10+
<body class="dark:text-#e9e9e9 auto-bg">
11+
<div id="app">
12+
<!-- 白屏时的loading效果 -->
13+
<div class="loading-container">
14+
<img src="/resource/logo.png" alt="logo" height="128" />
15+
<div class="loading-spin__container">
16+
<div class="loading-spin">
17+
<div class="left-0 top-0 loading-spin-item"></div>
18+
<div class="left-0 bottom-0 loading-spin-item loading-delay-500"></div>
19+
<div class="right-0 top-0 loading-spin-item loading-delay-1000"></div>
20+
<div class="right-0 bottom-0 loading-spin-item loading-delay-1500"></div>
21+
</div>
22+
</div>
23+
<div class="loading-title"><%= title %></div>
24+
</div>
25+
<script src="/resource/loading.js"></script>
26+
</div>
27+
<script type="module" src="/src/main.js"></script>
28+
</body>
29+
</html>

jsconfig.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ESNext",
4+
"baseUrl": "./",
5+
"moduleResolution": "node",
6+
"paths": {
7+
"@/*": ["src/*"],
8+
"~/*": ["./*"]
9+
},
10+
"jsx": "preserve",
11+
"allowJs": true
12+
},
13+
"exclude": ["node_modules", "dist"]
14+
}

0 commit comments

Comments
 (0)