create-young-proj 0.6.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +5 -3
- package/dist/index.mjs +9 -9
- package/package.json +3 -6
- package/template-nuxt-admin/Dockerfile +41 -0
- package/template-nuxt-admin/README.md +57 -0
- package/template-nuxt-admin/_gitignore +23 -0
- package/template-nuxt-admin/_npmrc +2 -0
- package/template-nuxt-admin/app.vue +41 -0
- package/template-nuxt-admin/boot.mjs +16 -0
- package/template-nuxt-admin/components/ScreenFull.vue +18 -0
- package/template-nuxt-admin/components/TopSearch.vue +73 -0
- package/template-nuxt-admin/components/TopUser.vue +69 -0
- package/template-nuxt-admin/components/YoungChangePassword.vue +87 -0
- package/template-nuxt-admin/components/YoungCodeInput.vue +60 -0
- package/template-nuxt-admin/components/YoungLink.vue +23 -0
- package/template-nuxt-admin/components/YoungLoading.vue +39 -0
- package/template-nuxt-admin/components/layout/Footer.vue +29 -0
- package/template-nuxt-admin/components/layout/Logo.vue +52 -0
- package/template-nuxt-admin/components/layout/Main.vue +26 -0
- package/template-nuxt-admin/components/layout/NavBar.vue +77 -0
- package/template-nuxt-admin/components/layout/SideBar.vue +89 -0
- package/template-nuxt-admin/components/layout/SubMenu.vue +46 -0
- package/template-nuxt-admin/components/layout/TabsBar.vue +183 -0
- package/template-nuxt-admin/composables/api.ts +104 -0
- package/template-nuxt-admin/composables/apis/delete.ts +37 -0
- package/template-nuxt-admin/composables/apis/get.ts +83 -0
- package/template-nuxt-admin/composables/apis/index.ts +10 -0
- package/template-nuxt-admin/composables/apis/patch.ts +74 -0
- package/template-nuxt-admin/composables/apis/post.ts +85 -0
- package/template-nuxt-admin/composables/config.ts +13 -0
- package/template-nuxt-admin/composables/icon.ts +27 -0
- package/template-nuxt-admin/composables/nav.ts +60 -0
- package/template-nuxt-admin/composables/tags.ts +114 -0
- package/template-nuxt-admin/composables/user.ts +29 -0
- package/template-nuxt-admin/config/.devrc +1 -0
- package/template-nuxt-admin/config/.onlinerc +1 -0
- package/template-nuxt-admin/config/.testrc +1 -0
- package/template-nuxt-admin/env.d.ts +47 -0
- package/template-nuxt-admin/error.vue +53 -0
- package/template-nuxt-admin/layouts/blank.vue +9 -0
- package/template-nuxt-admin/layouts/default.vue +124 -0
- package/template-nuxt-admin/middleware/auth.global.ts +50 -0
- package/template-nuxt-admin/nuxt.config.ts +101 -0
- package/template-nuxt-admin/package.json +44 -0
- package/template-nuxt-admin/pages/home/[id].vue +28 -0
- package/template-nuxt-admin/pages/index.vue +20 -0
- package/template-nuxt-admin/pages/login.vue +179 -0
- package/template-nuxt-admin/pages/system/api.vue +166 -0
- package/template-nuxt-admin/pages/system/hooks/useRole.ts +336 -0
- package/template-nuxt-admin/pages/system/menuList.vue +329 -0
- package/template-nuxt-admin/pages/system/role.vue +117 -0
- package/template-nuxt-admin/pages/system/user.vue +214 -0
- package/template-nuxt-admin/plugins/directive.ts +26 -0
- package/template-nuxt-admin/public/default_avatar.svg +1 -0
- package/template-nuxt-admin/public/favicon.ico +0 -0
- package/template-nuxt-admin/public/image_placeholder.svg +15 -0
- package/template-nuxt-admin/public/tabbar_bg.png +0 -0
- package/template-nuxt-admin/rome.json +26 -0
- package/template-nuxt-admin/server/api/[...all].ts +10 -0
- package/template-nuxt-admin/server/plugins/env.ts +89 -0
- package/template-nuxt-admin/server/routes/get/env.ts +13 -0
- package/template-nuxt-admin/server/tsconfig.json +3 -0
- package/template-nuxt-admin/server/utils/index.ts +35 -0
- package/template-nuxt-admin/styles/element.scss +30 -0
- package/template-nuxt-admin/styles/index.scss +59 -0
- package/template-nuxt-admin/styles/variable.scss +103 -0
- package/template-nuxt-admin/tsconfig.json +7 -0
- package/template-nuxt-admin/typings/global.d.ts +16 -0
- package/template-nuxt-admin/typings/system.d.ts +66 -0
- package/template-nuxt-admin/typings/user.d.ts +19 -0
- package/template-nuxt-admin/uno.config.ts +40 -0
- package/template-nuxt-admin/utils/tool.ts +207 -0
- package/template-nuxt-admin/yarn.lock +7103 -0
- package/template-uni-app/README.md +20 -0
- package/template-uni-app/_env +1 -1
- package/template-uni-app/_env.development +2 -2
- package/template-uni-app/_env.production +0 -3
- package/template-uni-app/_env.test +0 -3
- package/template-uni-app/_npmrc +2 -0
- package/template-uni-app/auto-imports.d.ts +3 -0
- package/template-uni-app/dist/dev/mp-weixin/apis/index.js +44 -0
- package/template-uni-app/dist/dev/mp-weixin/apis/lib/index.js +90 -0
- package/template-uni-app/dist/dev/mp-weixin/apis/requests/get.js +10 -0
- package/template-uni-app/dist/dev/mp-weixin/apis/requests/index.js +1 -0
- package/template-uni-app/dist/dev/mp-weixin/apis/requests/post.js +15 -0
- package/template-uni-app/dist/dev/mp-weixin/app.js +93 -0
- package/template-uni-app/dist/dev/mp-weixin/app.json +51 -0
- package/template-uni-app/dist/dev/mp-weixin/app.wxss +2378 -0
- package/template-uni-app/dist/dev/mp-weixin/common/assets.js +13 -0
- package/template-uni-app/dist/dev/mp-weixin/common/vendor.js +10189 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.js +22 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.json +4 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.wxml +1 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.js +22 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.json +4 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.wxml +1 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.js +82 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.json +4 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.wxml +1 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.wxss +108 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.js +56 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.json +4 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.wxml +1 -0
- package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.wxss +88 -0
- package/template-uni-app/dist/dev/mp-weixin/config/enum.js +21 -0
- package/template-uni-app/dist/dev/mp-weixin/config/index.js +1 -0
- package/template-uni-app/dist/dev/mp-weixin/config/map.js +1 -0
- package/template-uni-app/dist/dev/mp-weixin/layouts/default.js +30 -0
- package/template-uni-app/dist/dev/mp-weixin/layouts/default.json +6 -0
- package/template-uni-app/dist/dev/mp-weixin/layouts/default.wxml +1 -0
- package/template-uni-app/dist/dev/mp-weixin/layouts/default.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.js +56 -0
- package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.json +9 -0
- package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.wxml +1 -0
- package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.js +98 -0
- package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.json +4 -0
- package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.wxml +1 -0
- package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.wxss +125 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.js +38 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.json +5 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.wxml +1 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/index.js +51 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/index.json +5 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/index.wxml +1 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/index.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/my.js +22 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/my.json +3 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/my.wxml +1 -0
- package/template-uni-app/dist/dev/mp-weixin/pages/my.wxss +0 -0
- package/template-uni-app/dist/dev/mp-weixin/project.config.json +56 -0
- package/template-uni-app/dist/dev/mp-weixin/static/back.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/h.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/home.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/home_active.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/more.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/my.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/my_active.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/static/network.png +0 -0
- package/template-uni-app/dist/dev/mp-weixin/store/index.js +8 -0
- package/template-uni-app/dist/dev/mp-weixin/store/local/index.js +11 -0
- package/template-uni-app/dist/dev/mp-weixin/store/system.js +14 -0
- package/template-uni-app/dist/dev/mp-weixin/utils/modal.js +82 -0
- package/template-uni-app/dist/dev/mp-weixin/utils/route.js +85 -0
- package/template-uni-app/dist/dev/mp-weixin/utils/system.js +27 -0
- package/template-uni-app/src/apis/index.ts +17 -14
- package/template-uni-app/src/components/young-loading/young-loading.vue +6 -13
- package/template-uni-app/src/components/young-loading-mini/young-loading-mini.vue +3 -10
- package/template-uni-app/src/layouts/default.vue +2 -3
- package/template-uni-app/src/layouts/tabbar.vue +22 -15
- package/template-uni-app/src/pages/index.vue +12 -3
- package/template-uni-app/src/pages/my.vue +15 -12
- package/template-uni-app/src/pages.json +8 -2
- package/template-uni-app/src/store/system.ts +4 -3
- package/template-uni-app/src/typings/global.d.ts +7 -0
- package/template-uni-app/src/utils/auth.ts +71 -1
- package/template-uni-app/src/utils/modal.ts +30 -7
- package/template-vue-admin/src/views/system/menuList.vue +3 -3
@@ -0,0 +1,15 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="margin: auto; background: rgb(255, 255, 255); display: block; shape-rendering: auto;" width="200px" height="200px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid">
|
3
|
+
<rect x="17.5" y="30" width="15" height="40" fill="#93dbe9">
|
4
|
+
<animate attributeName="y" repeatCount="indefinite" dur="1s" calcMode="spline" keyTimes="0;0.5;1" values="18;30;30" keySplines="0 0.5 0.5 1;0 0.5 0.5 1" begin="-0.2s"></animate>
|
5
|
+
<animate attributeName="height" repeatCount="indefinite" dur="1s" calcMode="spline" keyTimes="0;0.5;1" values="64;40;40" keySplines="0 0.5 0.5 1;0 0.5 0.5 1" begin="-0.2s"></animate>
|
6
|
+
</rect>
|
7
|
+
<rect x="42.5" y="30" width="15" height="40" fill="#689cc5">
|
8
|
+
<animate attributeName="y" repeatCount="indefinite" dur="1s" calcMode="spline" keyTimes="0;0.5;1" values="20.999999999999996;30;30" keySplines="0 0.5 0.5 1;0 0.5 0.5 1" begin="-0.1s"></animate>
|
9
|
+
<animate attributeName="height" repeatCount="indefinite" dur="1s" calcMode="spline" keyTimes="0;0.5;1" values="58.00000000000001;40;40" keySplines="0 0.5 0.5 1;0 0.5 0.5 1" begin="-0.1s"></animate>
|
10
|
+
</rect>
|
11
|
+
<rect x="67.5" y="30" width="15" height="40" fill="#5e6fa3">
|
12
|
+
<animate attributeName="y" repeatCount="indefinite" dur="1s" calcMode="spline" keyTimes="0;0.5;1" values="20.999999999999996;30;30" keySplines="0 0.5 0.5 1;0 0.5 0.5 1"></animate>
|
13
|
+
<animate attributeName="height" repeatCount="indefinite" dur="1s" calcMode="spline" keyTimes="0;0.5;1" values="58.00000000000001;40;40" keySplines="0 0.5 0.5 1;0 0.5 0.5 1"></animate>
|
14
|
+
</rect>
|
15
|
+
<!-- [ldio] generated by https://loading.io/ --></svg>
|
Binary file
|
@@ -0,0 +1,26 @@
|
|
1
|
+
{
|
2
|
+
"formatter": {
|
3
|
+
"ignore": [
|
4
|
+
"*.d.ts",
|
5
|
+
"index.html",
|
6
|
+
"yarn.lock",
|
7
|
+
"*.json",
|
8
|
+
"README.md",
|
9
|
+
".nuxt/*",
|
10
|
+
".vscode/*",
|
11
|
+
"Dockerfile",
|
12
|
+
"*.vue"
|
13
|
+
],
|
14
|
+
"indentStyle": "space",
|
15
|
+
"indentSize": 2,
|
16
|
+
"lineWidth": 100
|
17
|
+
},
|
18
|
+
"javascript": {
|
19
|
+
"formatter": {
|
20
|
+
"quoteStyle": "single"
|
21
|
+
}
|
22
|
+
},
|
23
|
+
"linter": {
|
24
|
+
"enabled": false
|
25
|
+
}
|
26
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-07-21 09:50:36
|
4
|
+
* @LastEditTime: 2023-07-21 09:50:36
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
export default eventHandler(async (event) => {
|
8
|
+
const proxy = createTransparentProxy(process.env.NUXT_PUBLIC_API_BASE as string);
|
9
|
+
await proxy.handle(event);
|
10
|
+
});
|
@@ -0,0 +1,89 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2022-12-30 17:19:42
|
4
|
+
* @LastEditTime: 2023-07-31 17:52:20
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
import { resolve } from 'node:path';
|
8
|
+
import { loadConfig } from 'c12';
|
9
|
+
import { useYoungLogger } from '@bluesyoung/logger';
|
10
|
+
|
11
|
+
export default defineNitroPlugin(async (nitroApp) => {
|
12
|
+
const env = (process.env.DEPLOY_ENV as 'dev' | 'test' | 'online') || 'dev';
|
13
|
+
const { config } = await loadConfig<Record<string, any>>({
|
14
|
+
name: env,
|
15
|
+
cwd: resolve(process.cwd(), 'config'),
|
16
|
+
defaultConfig: {
|
17
|
+
// 此处可以放置通用的环境变量
|
18
|
+
// 由于频繁修改 package.json 会浪费 docker 性能,故将版本信息放于此处
|
19
|
+
// 优先读取环境变量中的版本信息(自己打的 Tag)
|
20
|
+
NUXT_PUBLIC_CURRENT_VERSION: process.env.PROJECT_VERSION || 'v0.0.1',
|
21
|
+
|
22
|
+
NUXT_PUBLIC_TITLE: 'XXX-后台管理系统',
|
23
|
+
NUXT_PUBLIC_SUB_TITLE: '做XXX我们是认真的!',
|
24
|
+
NUXT_PUBLIC_SLOGAN: 'XXXXX, XXXXX',
|
25
|
+
NUXT_PUBLIC_LOGIN_BG:
|
26
|
+
'https://dogefs.s3.ladydaily.com/~/source/unsplash/photo-1688380692117-63178554d76d?ixid=M3wyNjY4NDZ8MHwxfHRvcGljfHxhZXU2ckwtajZld3x8fHx8Mnx8MTY5MDAxMDMzNnw&ixlib=rb-4.0.3&w=1920&h=1080&fmt=webp',
|
27
|
+
NUXT_PUBLIC_LOGIN_LOGO: 'https://api.iconify.design/logos:nuxt-icon.svg?color=%23f74d49',
|
28
|
+
},
|
29
|
+
});
|
30
|
+
|
31
|
+
for (const key in config) {
|
32
|
+
if (process.env[key]) {
|
33
|
+
console.log(
|
34
|
+
'系统环境变量优先: ',
|
35
|
+
key,
|
36
|
+
' = ',
|
37
|
+
process.env[key],
|
38
|
+
' -> ',
|
39
|
+
config[key],
|
40
|
+
' -> ',
|
41
|
+
'覆盖',
|
42
|
+
);
|
43
|
+
config[key] = process.env[key];
|
44
|
+
} else {
|
45
|
+
process.env[key] = config[key];
|
46
|
+
}
|
47
|
+
if (!(key.indexOf('NUXT_PUBLIC_') === 0)) {
|
48
|
+
delete config[key];
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
console.log('------------------------读取配置文件------------------------');
|
53
|
+
console.log(config);
|
54
|
+
console.log('-------------------------------------------------------------');
|
55
|
+
|
56
|
+
// 仅打包之后格式化日志
|
57
|
+
if (process.env.NODE_ENV !== 'development') {
|
58
|
+
useYoungLogger();
|
59
|
+
}
|
60
|
+
|
61
|
+
nitroApp.hooks.hook('render:html', (html, { event }) => {
|
62
|
+
// 直接注入环境变量到前端
|
63
|
+
html.bodyPrepend.push(`
|
64
|
+
<!-- 注入环境变量 -->
|
65
|
+
<script>window.__YOUNG_ENV__=${JSON.stringify(config)}</script>
|
66
|
+
<!-- 更新检测,每分钟一次 -->
|
67
|
+
<script>
|
68
|
+
setInterval(() => {
|
69
|
+
fetch('/get/env')
|
70
|
+
.then((res) => res.json())
|
71
|
+
.then(({ NUXT_PUBLIC_CURRENT_VERSION }) => {
|
72
|
+
if (NUXT_PUBLIC_CURRENT_VERSION !== window.__YOUNG_ENV__.NUXT_PUBLIC_CURRENT_VERSION) {
|
73
|
+
alert('版本已更新,请重新加载页面!');
|
74
|
+
window.location.reload();
|
75
|
+
}
|
76
|
+
});
|
77
|
+
}, 6e4);
|
78
|
+
</script>
|
79
|
+
`);
|
80
|
+
|
81
|
+
// 移动端调试控制台,需要使用就放开下面的注释
|
82
|
+
// if (process.env.NODE_ENV === 'development' || process.env.NUXT_PUBLIC_ENABLE_CONSOLE) {
|
83
|
+
// html.bodyAppend.push(`
|
84
|
+
// <script src="//cdn.bootcdn.net/ajax/libs/eruda/2.3.3/eruda.js"></script>
|
85
|
+
// <script>eruda.init();</script>
|
86
|
+
// `);
|
87
|
+
// }
|
88
|
+
});
|
89
|
+
});
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-07-20 19:48:12
|
4
|
+
* @LastEditTime: 2023-07-21 11:18:40
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
export default defineEventHandler(async (event) => {
|
8
|
+
const envObj = {
|
9
|
+
NUXT_PUBLIC_CURRENT_VERSION: process.env.PROJECT_VERSION || 'v0.0.1',
|
10
|
+
};
|
11
|
+
|
12
|
+
return envObj;
|
13
|
+
});
|
@@ -0,0 +1,35 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-05-29 10:29:52
|
4
|
+
* @LastEditTime: 2023-06-17 16:20:40
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
import { type ServerOptions as HTTPProxyOptions } from 'http-proxy';
|
8
|
+
import ProxyModule from 'http-proxy';
|
9
|
+
import type { H3Event } from 'h3';
|
10
|
+
/**
|
11
|
+
* @param target 接口代理的具体地址
|
12
|
+
* @param defaults 代理配置
|
13
|
+
* @example
|
14
|
+
* export default defineEventHandler(async (event) => {
|
15
|
+
* const proxy = createTransparentProxy(`http://127.0.0.1:3333`);
|
16
|
+
* await proxy.handle(event);
|
17
|
+
* });
|
18
|
+
*/
|
19
|
+
export const createTransparentProxy = (target: string, defaults: HTTPProxyOptions = {}) => {
|
20
|
+
const proxy = ProxyModule.createProxy();
|
21
|
+
const handle = (event: H3Event, opts: HTTPProxyOptions = {}) => {
|
22
|
+
return new Promise<void>((resolve, reject) => {
|
23
|
+
proxy.web(event.node.req, event.node.res, { target, ...defaults, ...opts }, (error: any) => {
|
24
|
+
if (error.code !== 'ECONNRESET') {
|
25
|
+
reject(error);
|
26
|
+
}
|
27
|
+
resolve();
|
28
|
+
});
|
29
|
+
});
|
30
|
+
};
|
31
|
+
return {
|
32
|
+
proxy,
|
33
|
+
handle,
|
34
|
+
};
|
35
|
+
};
|
@@ -0,0 +1,30 @@
|
|
1
|
+
// el-table 样式
|
2
|
+
.el-table {
|
3
|
+
-webkit-box-flex: 1;
|
4
|
+
-webkit-flex: 1;
|
5
|
+
-ms-flex: 1;
|
6
|
+
flex: 1;
|
7
|
+
|
8
|
+
table {
|
9
|
+
width: 100%;
|
10
|
+
}
|
11
|
+
|
12
|
+
.el-table__header th {
|
13
|
+
font-weight: bold;
|
14
|
+
color: var(--el-text-color-primary);
|
15
|
+
background: var(--el-fill-color-light) !important;
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
// el-dialog 样式
|
20
|
+
.el-dialog {
|
21
|
+
.el-dialog__header {
|
22
|
+
padding: 15px 20px;
|
23
|
+
margin: 0;
|
24
|
+
border-bottom: 1px solid var(--el-border-color-lighter);
|
25
|
+
|
26
|
+
.el-dialog__title {
|
27
|
+
font-size: 17px;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
@import './element.scss';
|
2
|
+
|
3
|
+
// 滚动条样式
|
4
|
+
@mixin base-scrollbar {
|
5
|
+
&::-webkit-scrollbar {
|
6
|
+
width: 13px;
|
7
|
+
height: 13px;
|
8
|
+
}
|
9
|
+
|
10
|
+
&::-webkit-scrollbar-thumb {
|
11
|
+
background-color: rgb(0 0 0 / 10%);
|
12
|
+
background-clip: padding-box;
|
13
|
+
border: 3px solid transparent;
|
14
|
+
border-radius: 7px;
|
15
|
+
}
|
16
|
+
|
17
|
+
&::-webkit-scrollbar-thumb:hover {
|
18
|
+
background-color: rgb(0 0 0 / 30%);
|
19
|
+
}
|
20
|
+
|
21
|
+
&::-webkit-scrollbar-track {
|
22
|
+
background-color: transparent;
|
23
|
+
}
|
24
|
+
|
25
|
+
&::-webkit-scrollbar-track:hover {
|
26
|
+
background-color: #f8fafc;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
html body,
|
31
|
+
#__nuxt {
|
32
|
+
position: relative;
|
33
|
+
-webkit-box-sizing: border-box;
|
34
|
+
box-sizing: border-box;
|
35
|
+
height: 100vh;
|
36
|
+
padding: 0;
|
37
|
+
overflow: auto;
|
38
|
+
font-family: 'PingFang SC', Arial, 'Microsoft YaHei', sans-serif;
|
39
|
+
font-size: 14px;
|
40
|
+
color: var(--el-color-black);
|
41
|
+
background: #f6f8f9;
|
42
|
+
-webkit-font-smoothing: antialiased;
|
43
|
+
@include base-scrollbar;
|
44
|
+
|
45
|
+
div {
|
46
|
+
@include base-scrollbar;
|
47
|
+
}
|
48
|
+
|
49
|
+
.layout-admin-wrapper {
|
50
|
+
.app-main-container {
|
51
|
+
@include base-scrollbar;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
:root {
|
57
|
+
--el-color-white: #fff;
|
58
|
+
--el-color-grey: rgb(0 0 0 / 65%);
|
59
|
+
}
|
@@ -0,0 +1,103 @@
|
|
1
|
+
// 框架默认主题色
|
2
|
+
$base-color-default: #1890ff;
|
3
|
+
|
4
|
+
// 默认层级
|
5
|
+
$base-z-index: 999;
|
6
|
+
|
7
|
+
// 横向布局纵向布局时菜单背景色
|
8
|
+
$base-menu-background: #001529;
|
9
|
+
|
10
|
+
// 菜单文字颜色
|
11
|
+
$base-menu-color: hsl(0deg 0% 100% / 95%);
|
12
|
+
|
13
|
+
// 菜单选中文字颜色
|
14
|
+
$base-menu-color-active: hsl(0deg 0% 100% / 95%);
|
15
|
+
|
16
|
+
// 菜单选中背景色
|
17
|
+
$base-menu-background-active: $base-color-default;
|
18
|
+
$base-color-blue: $base-color-default;
|
19
|
+
|
20
|
+
// 标题颜色
|
21
|
+
$base-title-color: #fff;
|
22
|
+
|
23
|
+
// 字体大小配置
|
24
|
+
$base-font-size-small: 12px;
|
25
|
+
$base-font-size-default: 14px;
|
26
|
+
$base-font-size-big: 16px;
|
27
|
+
$base-font-size-bigger: 18px;
|
28
|
+
$base-font-size-max: 22px;
|
29
|
+
$base-font-color: #606266;
|
30
|
+
$base-color-blue: $base-color-default;
|
31
|
+
$base-color-green: #41b882;
|
32
|
+
$base-color-white: #fff;
|
33
|
+
$base-color-black: #000;
|
34
|
+
$base-color-yellow: #ffa91b;
|
35
|
+
$base-color-orange: #ff6700;
|
36
|
+
$base-color-red: #f34d37;
|
37
|
+
$base-color-gray: rgb(0 0 0 / 65%);
|
38
|
+
$base-main-width: 1279px;
|
39
|
+
$base-border-radius: 4px;
|
40
|
+
$base-border-color: #dcdfe6;
|
41
|
+
|
42
|
+
// 输入框高度
|
43
|
+
$base-input-height: 32px;
|
44
|
+
|
45
|
+
// 默认paddiing
|
46
|
+
$base-padding: 20px;
|
47
|
+
|
48
|
+
// 默认阴影
|
49
|
+
$base-box-shadow: 0 1px 4px rgb(0 21 41 / 8%);
|
50
|
+
|
51
|
+
// 横向布局时top-bar、logo、一级菜单的高度
|
52
|
+
$base-top-bar-height: 60px;
|
53
|
+
|
54
|
+
// 纵向布局时logo的高度
|
55
|
+
$base-logo-height: 75px;
|
56
|
+
|
57
|
+
// 顶部nav-bar的高度
|
58
|
+
$base-nav-bar-height: 60px;
|
59
|
+
|
60
|
+
// 顶部多标签页tabs-bar的高度
|
61
|
+
$base-tabs-bar-height: 55px;
|
62
|
+
|
63
|
+
// 顶部多标签页tabs-bar中每一个item的高度
|
64
|
+
$base-tag-item-height: 34px;
|
65
|
+
|
66
|
+
// 菜单li标签的高度
|
67
|
+
$base-menu-item-height: 50px;
|
68
|
+
|
69
|
+
// 头部高度
|
70
|
+
$base-header-height: -webkit-calc(#{$base-nav-bar-height} + #{$base-tabs-bar-height});
|
71
|
+
$base-header-height: calc(#{$base-nav-bar-height} + #{$base-tabs-bar-height});
|
72
|
+
|
73
|
+
// app-footer高度
|
74
|
+
$base-app-footer-height: 55px;
|
75
|
+
|
76
|
+
// app-main的高度
|
77
|
+
$base-app-main-height: -webkit-calc(
|
78
|
+
100vh - $base-header-height - 40px
|
79
|
+
);
|
80
|
+
$base-app-main-height: calc(
|
81
|
+
100vh - $base-header-height - 40px
|
82
|
+
);
|
83
|
+
|
84
|
+
// 纵向布局时左侧导航未折叠时的宽度
|
85
|
+
$base-left-menu-width: 256px;
|
86
|
+
|
87
|
+
// 纵向布局时左侧导航未折叠时右侧内容的宽度
|
88
|
+
$base-right-content-width: -webkit-calc(100% - #{$base-left-menu-width});
|
89
|
+
$base-right-content-width: calc(100% - #{$base-left-menu-width});
|
90
|
+
|
91
|
+
// 纵向布局时左侧导航已折叠时的宽度
|
92
|
+
$base-left-menu-width-min: 64px;
|
93
|
+
|
94
|
+
// 纵向布局时左侧导航已折叠时右侧内容的宽度
|
95
|
+
$base-right-content-width-min: -webkit-calc(100% - #{$base-left-menu-width-min});
|
96
|
+
$base-right-content-width-min: calc(100% - #{$base-left-menu-width-min});
|
97
|
+
|
98
|
+
// 默认动画
|
99
|
+
$base-transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1), border 0s,
|
100
|
+
background 0s, color 0s, font-size 0s;
|
101
|
+
|
102
|
+
// 默认动画长
|
103
|
+
$base-transition-time: 0.3s;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-07-26 11:57:29
|
4
|
+
* @LastEditTime: 2023-07-26 14:01:32
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
interface BaseQuery {
|
8
|
+
pageNum: number;
|
9
|
+
pageSize: number;
|
10
|
+
total: number;
|
11
|
+
noPagination?: boolean;
|
12
|
+
}
|
13
|
+
|
14
|
+
type PagesData = {
|
15
|
+
list: any[];
|
16
|
+
} & BaseQuery;
|
@@ -0,0 +1,66 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-07-21 09:03:42
|
4
|
+
* @LastEditTime: 2023-07-26 11:49:13
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
import { MethodObj } from '~/composables/config';
|
8
|
+
declare global {
|
9
|
+
type NavArrItem = {
|
10
|
+
breadcrumb: number;
|
11
|
+
component: string;
|
12
|
+
createdAt: string;
|
13
|
+
creator: string;
|
14
|
+
icon?: any;
|
15
|
+
id: number;
|
16
|
+
name: string;
|
17
|
+
not_dev: number;
|
18
|
+
parentId: number;
|
19
|
+
path: string;
|
20
|
+
permission: string;
|
21
|
+
redirect: string;
|
22
|
+
sort: number;
|
23
|
+
status: number;
|
24
|
+
title?: string;
|
25
|
+
updatedAt: string;
|
26
|
+
visible: number;
|
27
|
+
children?: NavArrItem[] | [];
|
28
|
+
} & Record<string, any>;
|
29
|
+
|
30
|
+
type ApiItem = {
|
31
|
+
id: number;
|
32
|
+
path: string;
|
33
|
+
desc: string;
|
34
|
+
category: string;
|
35
|
+
method: keyof typeof MethodObj;
|
36
|
+
roleIds: number[];
|
37
|
+
creator?: string;
|
38
|
+
title?: string;
|
39
|
+
};
|
40
|
+
|
41
|
+
type RoleItem = {
|
42
|
+
createdAt?: string;
|
43
|
+
creator?: string;
|
44
|
+
desc: string;
|
45
|
+
id: number;
|
46
|
+
keyword: string;
|
47
|
+
name: string;
|
48
|
+
not_dev?: number;
|
49
|
+
sort?: number;
|
50
|
+
status: number;
|
51
|
+
updatedAt?: string;
|
52
|
+
};
|
53
|
+
|
54
|
+
type UserItem = {
|
55
|
+
id: number;
|
56
|
+
username: string;
|
57
|
+
nickname: string;
|
58
|
+
mobile: string;
|
59
|
+
roleId: number;
|
60
|
+
status: number;
|
61
|
+
role_name?: string;
|
62
|
+
creator?: string;
|
63
|
+
newPassword?: string;
|
64
|
+
initPassword?: string;
|
65
|
+
};
|
66
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-07-21 08:58:31
|
4
|
+
* @LastEditTime: 2023-07-24 10:36:06
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
type UserLoginRes = {
|
8
|
+
uuid: string;
|
9
|
+
nickname: string;
|
10
|
+
headimgurl: string;
|
11
|
+
phone: string;
|
12
|
+
token: string;
|
13
|
+
};
|
14
|
+
|
15
|
+
type LoginForm = {
|
16
|
+
mobile: string;
|
17
|
+
password: string;
|
18
|
+
vercode: string;
|
19
|
+
};
|
@@ -0,0 +1,40 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2022-06-15 08:59:22
|
4
|
+
* @LastEditTime: 2023-05-27 19:36:43
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
import {
|
8
|
+
defineConfig,
|
9
|
+
presetAttributify,
|
10
|
+
presetIcons,
|
11
|
+
presetTypography,
|
12
|
+
presetUno,
|
13
|
+
presetWebFonts,
|
14
|
+
transformerDirectives,
|
15
|
+
transformerVariantGroup,
|
16
|
+
} from 'unocss';
|
17
|
+
|
18
|
+
export default defineConfig({
|
19
|
+
shortcuts: [],
|
20
|
+
presets: [
|
21
|
+
presetUno(),
|
22
|
+
presetAttributify(),
|
23
|
+
presetIcons({
|
24
|
+
scale: 1.2,
|
25
|
+
}),
|
26
|
+
presetTypography(),
|
27
|
+
presetWebFonts({
|
28
|
+
fonts: {
|
29
|
+
sans: 'DM Sans',
|
30
|
+
serif: 'DM Serif Display',
|
31
|
+
mono: 'DM Mono',
|
32
|
+
},
|
33
|
+
}),
|
34
|
+
],
|
35
|
+
transformers: [
|
36
|
+
// 不加 enforce 会有 bug
|
37
|
+
transformerDirectives({ enforce: 'pre' }),
|
38
|
+
transformerVariantGroup(),
|
39
|
+
],
|
40
|
+
})
|