Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jxf111348
vue-vben-admin
提交
e2333642
V
vue-vben-admin
项目概览
jxf111348
/
vue-vben-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue-vben-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e2333642
编写于
10月 30, 2020
作者:
V
vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
style: some format adjustments
上级
bdce8453
变更
21
隐藏空白更改
内联
并排
Showing
21 changed file
with
71 addition
and
162 deletion
+71
-162
src/layouts/Logo.vue
src/layouts/Logo.vue
+4
-2
src/layouts/iframe/useFrameKeepAlive.ts
src/layouts/iframe/useFrameKeepAlive.ts
+4
-3
src/layouts/page/index.tsx
src/layouts/page/index.tsx
+4
-6
src/router/constant.ts
src/router/constant.ts
+1
-13
src/router/guard/index.ts
src/router/guard/index.ts
+5
-5
src/router/guard/permissionGuard.ts
src/router/guard/permissionGuard.ts
+4
-4
src/router/guard/progressGuard.ts
src/router/guard/progressGuard.ts
+1
-0
src/router/index.ts
src/router/index.ts
+2
-17
src/router/menus/index.ts
src/router/menus/index.ts
+1
-27
src/router/routes/index.ts
src/router/routes/index.ts
+2
-24
src/setup/error-handle/index.ts
src/setup/error-handle/index.ts
+17
-19
src/store/index.ts
src/store/index.ts
+2
-0
src/store/modules/app.ts
src/store/modules/app.ts
+10
-5
src/store/modules/error.ts
src/store/modules/error.ts
+3
-0
src/store/modules/permission.ts
src/store/modules/permission.ts
+3
-12
src/store/modules/tab.ts
src/store/modules/tab.ts
+2
-8
src/store/modules/user.ts
src/store/modules/user.ts
+0
-2
src/types/config.d.ts
src/types/config.d.ts
+0
-10
src/types/global.d.ts
src/types/global.d.ts
+2
-0
src/types/module.d.ts
src/types/module.d.ts
+3
-0
src/types/shim-tsx.d.ts
src/types/shim-tsx.d.ts
+1
-5
未找到文件。
src/layouts/Logo.vue
浏览文件 @
e2333642
...
@@ -23,12 +23,14 @@
...
@@ -23,12 +23,14 @@
},
},
},
},
setup
(
props
)
{
setup
(
props
)
{
const
showRef
=
ref
<
boolean
>
(
!!
props
.
showTitle
);
const
{
globSetting
}
=
useSetting
();
const
{
globSetting
}
=
useSetting
();
const
go
=
useGo
();
const
go
=
useGo
();
function
handleGoHome
()
{
function
handleGoHome
()
{
go
(
PageEnum
.
BASE_HOME
);
go
(
PageEnum
.
BASE_HOME
);
}
}
const
showRef
=
ref
<
boolean
>
(
!!
props
.
showTitle
);
watch
(
watch
(
()
=>
props
.
showTitle
,
()
=>
props
.
showTitle
,
(
show
:
boolean
)
=>
{
(
show
:
boolean
)
=>
{
...
@@ -41,6 +43,7 @@
...
@@ -41,6 +43,7 @@
}
}
}
}
);
);
return
{
return
{
handleGoHome
,
handleGoHome
,
globSetting
,
globSetting
,
...
@@ -55,7 +58,6 @@
...
@@ -55,7 +58,6 @@
.app-logo {
.app-logo {
display: flex;
display: flex;
// justify-content: center;
align-items: center;
align-items: center;
cursor: pointer;
cursor: pointer;
...
...
src/layouts/iframe/useFrameKeepAlive.ts
浏览文件 @
e2333642
import
type
{
AppRouteRecordRaw
}
from
'
/@/router/types
'
;
import
{
computed
,
toRaw
,
unref
}
from
'
vue
'
;
import
{
computed
,
toRaw
,
unref
}
from
'
vue
'
;
import
{
useRouter
}
from
'
vue-router
'
;
import
router
from
'
/@/router
'
;
import
{
tabStore
}
from
'
/@/store/modules/tab
'
;
import
{
tabStore
}
from
'
/@/store/modules/tab
'
;
import
{
appStore
}
from
'
/@/store/modules/app
'
;
import
{
appStore
}
from
'
/@/store/modules/app
'
;
import
{
AppRouteRecordRaw
}
from
'
/@/router/types
'
;
import
{
useRouter
}
from
'
vue-router
'
;
import
router
from
'
/@/router
'
;
import
{
unique
}
from
'
/@/utils
'
;
import
{
unique
}
from
'
/@/utils
'
;
export
function
useFrameKeepAlive
()
{
export
function
useFrameKeepAlive
()
{
...
...
src/layouts/page/index.tsx
浏览文件 @
e2333642
import
{
computed
,
defineComponent
,
unref
,
Transition
,
KeepAlive
,
toRaw
}
from
'
vue
'
;
import
{
computed
,
defineComponent
,
unref
,
Transition
,
KeepAlive
,
toRaw
}
from
'
vue
'
;
import
{
RouterView
,
RouteLocation
}
from
'
vue-router
'
;
import
{
appStore
}
from
'
/@/store/modules/app
'
;
import
FrameLayout
from
'
/@/layouts/iframe/index.vue
'
;
import
{
useTransition
}
from
'
./useTransition
'
;
import
{
useTransition
}
from
'
./useTransition
'
;
import
{
useSetting
}
from
'
/@/hooks/core/useSetting
'
;
import
{
RouterView
,
RouteLocation
}
from
'
vue-router
'
;
import
{
tabStore
}
from
'
/@/store/modules/tab
'
;
import
{
tabStore
}
from
'
/@/store/modules/tab
'
;
import
FrameLayout
from
'
/@/layouts/iframe/index.vue
'
;
import
{
appStore
}
from
'
/@/store/modules/app
'
;
import
{
useSetting
}
from
'
/@/hooks/core/useSetting
'
;
// import { useRouter } from 'vue-router';
export
default
defineComponent
({
export
default
defineComponent
({
name
:
'
PageLayout
'
,
name
:
'
PageLayout
'
,
setup
()
{
setup
()
{
// const { currentRoute } = useRouter();
const
getProjectConfigRef
=
computed
(()
=>
{
const
getProjectConfigRef
=
computed
(()
=>
{
return
appStore
.
getProjectConfig
;
return
appStore
.
getProjectConfig
;
});
});
...
...
src/router/constant.ts
浏览文件 @
e2333642
...
@@ -22,6 +22,7 @@ export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
...
@@ -22,6 +22,7 @@ export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
hideBreadcrumb
:
true
,
hideBreadcrumb
:
true
,
},
},
};
};
export
const
REDIRECT_ROUTE
:
AppRouteRecordRaw
=
{
export
const
REDIRECT_ROUTE
:
AppRouteRecordRaw
=
{
path
:
'
/redirect/:path(.*)*
'
,
path
:
'
/redirect/:path(.*)*
'
,
name
:
'
Redirect
'
,
name
:
'
Redirect
'
,
...
@@ -31,16 +32,3 @@ export const REDIRECT_ROUTE: AppRouteRecordRaw = {
...
@@ -31,16 +32,3 @@ export const REDIRECT_ROUTE: AppRouteRecordRaw = {
hideBreadcrumb
:
true
,
hideBreadcrumb
:
true
,
},
},
};
};
// Whole site 404
// export const FULL_PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
// path: '/:path(.*)*',
// name: 'FullErrorPage',
// component: EXCEPTION_COMPONENT,
// props: {
// full: true,
// },
// meta: {
// title: 'FullErrorPage',
// },
// };
src/router/guard/index.ts
浏览文件 @
e2333642
import
type
{
Router
}
from
'
vue-router
'
;
import
type
{
Router
}
from
'
vue-router
'
;
import
{
Modal
,
notification
}
from
'
ant-design-vue
'
;
import
{
Modal
,
notification
}
from
'
ant-design-vue
'
;
import
{
AxiosCanceler
}
from
'
/@/utils/http/axios/axiosCancel
'
;
import
{
createProgressGuard
}
from
'
./progressGuard
'
;
import
{
createProgressGuard
}
from
'
./progressGuard
'
;
import
{
createPermissionGuard
}
from
'
./permissionGuard
'
;
import
{
createPermissionGuard
}
from
'
./permissionGuard
'
;
import
{
createPageLoadingGuard
}
from
'
./pageLoadingGuard
'
;
import
{
createPageLoadingGuard
}
from
'
./pageLoadingGuard
'
;
import
{
useSetting
}
from
'
/@/hooks/core/useSetting
'
;
import
{
useSetting
}
from
'
/@/hooks/core/useSetting
'
;
import
{
getIsOpenTab
,
setCurrentTo
}
from
'
/@/utils/helper/routeHelper
'
;
import
{
getIsOpenTab
,
setCurrentTo
}
from
'
/@/utils/helper/routeHelper
'
;
import
{
setTitle
}
from
'
/@/utils/browser
'
;
import
{
setTitle
}
from
'
/@/utils/browser
'
;
import
{
AxiosCanceler
}
from
'
/@/utils/http/axios/axiosCancel
'
;
const
{
projectSetting
,
globSetting
}
=
useSetting
();
const
{
projectSetting
,
globSetting
}
=
useSetting
();
export
function
createGuard
(
router
:
Router
)
{
export
function
createGuard
(
router
:
Router
)
{
...
@@ -36,10 +39,7 @@ export function createGuard(router: Router) {
...
@@ -36,10 +39,7 @@ export function createGuard(router: Router) {
router
.
afterEach
((
to
)
=>
{
router
.
afterEach
((
to
)
=>
{
// change html title
// change html title
setTitle
(
to
.
meta
.
title
,
globSetting
.
title
);
setTimeout
(()
=>
{
setTitle
(
to
.
meta
.
title
,
globSetting
.
title
);
},
0
);
});
});
openNProgress
&&
createProgressGuard
(
router
);
openNProgress
&&
createProgressGuard
(
router
);
...
...
src/router/guard/permissionGuard.ts
浏览文件 @
e2333642
...
@@ -2,12 +2,11 @@ import type { Router, RouteRecordRaw } from 'vue-router';
...
@@ -2,12 +2,11 @@ import type { Router, RouteRecordRaw } from 'vue-router';
import
{
userStore
}
from
'
/@/store/modules/user
'
;
import
{
userStore
}
from
'
/@/store/modules/user
'
;
import
{
permissionStore
}
from
'
/@/store/modules/permission
'
;
import
{
permissionStore
}
from
'
/@/store/modules/permission
'
;
import
{
PageEnum
}
from
'
/@/enums/pageEnum
'
;
import
{
PageEnum
}
from
'
/@/enums/pageEnum
'
;
import
{
getToken
}
from
'
/@/utils/auth
'
;
import
{
getToken
}
from
'
/@/utils/auth
'
;
import
{
// FULL_PAGE_NOT_FOUND_ROUTE,
import
{
PAGE_NOT_FOUND_ROUTE
}
from
'
/@/router/constant
'
;
PAGE_NOT_FOUND_ROUTE
,
}
from
'
/@/router/constant
'
;
import
{
RootRoute
}
from
'
../routes/index
'
;
import
{
RootRoute
}
from
'
../routes/index
'
;
const
LOGIN_PATH
=
PageEnum
.
BASE_LOGIN
;
const
LOGIN_PATH
=
PageEnum
.
BASE_LOGIN
;
...
@@ -60,6 +59,7 @@ export function createPermissionGuard(router: Router) {
...
@@ -60,6 +59,7 @@ export function createPermissionGuard(router: Router) {
permissionStore
.
commitDynamicAddedRouteState
(
true
);
permissionStore
.
commitDynamicAddedRouteState
(
true
);
next
(
nextData
);
next
(
nextData
);
});
});
router
.
afterEach
((
to
)
=>
{
router
.
afterEach
((
to
)
=>
{
// Just enter the login page and clear the authentication information
// Just enter the login page and clear the authentication information
if
(
to
.
path
===
LOGIN_PATH
)
{
if
(
to
.
path
===
LOGIN_PATH
)
{
...
...
src/router/guard/progressGuard.ts
浏览文件 @
e2333642
...
@@ -11,6 +11,7 @@ export function createProgressGuard(router: Router) {
...
@@ -11,6 +11,7 @@ export function createProgressGuard(router: Router) {
!
to
.
meta
.
inTab
&&
NProgress
.
start
();
!
to
.
meta
.
inTab
&&
NProgress
.
start
();
return
true
;
return
true
;
});
});
router
.
afterEach
(
async
(
to
)
=>
{
router
.
afterEach
(
async
(
to
)
=>
{
!
to
.
meta
.
inTab
&&
NProgress
.
done
();
!
to
.
meta
.
inTab
&&
NProgress
.
done
();
return
true
;
return
true
;
...
...
src/router/index.ts
浏览文件 @
e2333642
...
@@ -2,6 +2,7 @@ import type { RouteRecordRaw } from 'vue-router';
...
@@ -2,6 +2,7 @@ import type { RouteRecordRaw } from 'vue-router';
import
type
{
App
}
from
'
vue
'
;
import
type
{
App
}
from
'
vue
'
;
import
{
createRouter
,
createWebHashHistory
}
from
'
vue-router
'
;
import
{
createRouter
,
createWebHashHistory
}
from
'
vue-router
'
;
import
{
scrollWaiter
}
from
'
../utils/scrollWaiter
'
;
import
{
scrollWaiter
}
from
'
../utils/scrollWaiter
'
;
import
{
createGuard
}
from
'
./guard/
'
;
import
{
createGuard
}
from
'
./guard/
'
;
...
@@ -24,6 +25,7 @@ const router = createRouter({
...
@@ -24,6 +25,7 @@ const router = createRouter({
}
}
},
},
});
});
// reset router
// reset router
export
function
resetRouter
()
{
export
function
resetRouter
()
{
const
resetWhiteNameList
=
[
const
resetWhiteNameList
=
[
...
@@ -45,21 +47,4 @@ export function setupRouter(app: App<Element>) {
...
@@ -45,21 +47,4 @@ export function setupRouter(app: App<Element>) {
createGuard
(
router
);
createGuard
(
router
);
}
}
// // hmr
// if (import.meta.hot) {
// let removeRoutes: (() => void)[] = [];
// for (let route of routes) {
// removeRoutes.push(router.addRoute(route as RouteRecordRaw));
// }
// import.meta.hot?.acceptDeps('./routes.ts', ({ routes }) => {
// for (let removeRoute of removeRoutes) removeRoute();
// removeRoutes = [];
// for (let route of routes) {
// removeRoutes.push(router.addRoute(route));
// }
// router.replace('');
// });
// }
export
default
router
;
export
default
router
;
src/router/menus/index.ts
浏览文件 @
e2333642
...
@@ -9,33 +9,7 @@ import { PermissionModeEnum } from '/@/enums/appEnum';
...
@@ -9,33 +9,7 @@ import { PermissionModeEnum } from '/@/enums/appEnum';
import
{
pathToRegexp
}
from
'
path-to-regexp
'
;
import
{
pathToRegexp
}
from
'
path-to-regexp
'
;
import
modules
from
'
globby!/@/router/menus/modules/**/*.@(ts)
'
;
import
modules
from
'
globby!/@/router/menus/modules/**/*.@(ts)
'
;
// ===========================
const
menuModules
:
MenuModule
[]
=
[];
// ==========module import====
// ===========================
// import dashboard from './modules/dashboard';
// import exceptionDemo from './modules/demo/exception';
// import iframeDemo from './modules/demo/iframe';
// import compDemo from './modules/demo/comp';
// import permissionDemo from './modules/demo/permission';
// import featDemo from './modules/demo/feat';
// import chartsDemo from './modules/demo/charts';
// import tableDemo from './modules/demo/table';
// import formDemo from './modules/demo/form';
// import treeDemo from './modules/demo/tree';
const
menuModules
:
MenuModule
[]
=
[
// dashboard,
// featDemo,
// exceptionDemo,
// iframeDemo,
// compDemo,
// permissionDemo,
// chartsDemo,
// tableDemo,
// formDemo,
// treeDemo,
];
Object
.
keys
(
modules
).
forEach
((
key
)
=>
{
Object
.
keys
(
modules
).
forEach
((
key
)
=>
{
menuModules
.
push
(
modules
[
key
]);
menuModules
.
push
(
modules
[
key
]);
...
...
src/router/routes/index.ts
浏览文件 @
e2333642
...
@@ -4,30 +4,7 @@ import { DEFAULT_LAYOUT_COMPONENT, PAGE_NOT_FOUND_ROUTE, REDIRECT_ROUTE } from '
...
@@ -4,30 +4,7 @@ import { DEFAULT_LAYOUT_COMPONENT, PAGE_NOT_FOUND_ROUTE, REDIRECT_ROUTE } from '
import
{
genRouteModule
}
from
'
/@/utils/helper/routeHelper
'
;
import
{
genRouteModule
}
from
'
/@/utils/helper/routeHelper
'
;
import
modules
from
'
globby!/@/router/routes/modules/**/*.@(ts)
'
;
import
modules
from
'
globby!/@/router/routes/modules/**/*.@(ts)
'
;
// import dashboard from './modules/dashboard';
const
routeModuleList
:
AppRouteModule
[]
=
[];
// demo
// import exceptionDemo from './modules/demo/exception';
// import iframeDemo from './modules/demo/iframe';
// import compDemo from './modules/demo/comp';
// import permissionDemo from './modules/demo/permission';
// import featDemo from './modules/demo/feat';
// import chartsDemo from './modules/demo/charts';
// import tableDemo from './modules/demo/table';
// import formDemo from './modules/demo/form';
// import treeDemo from './modules/demo/tree';
const
routeModuleList
:
AppRouteModule
[]
=
[
// exceptionDemo,
// dashboard,
// iframeDemo,
// compDemo,
// featDemo,
// permissionDemo,
// chartsDemo,
// tableDemo,
// formDemo,
// treeDemo,
];
Object
.
keys
(
modules
).
forEach
((
key
)
=>
{
Object
.
keys
(
modules
).
forEach
((
key
)
=>
{
routeModuleList
.
push
(
modules
[
key
]);
routeModuleList
.
push
(
modules
[
key
]);
...
@@ -38,6 +15,7 @@ export const asyncRoutes = [
...
@@ -38,6 +15,7 @@ export const asyncRoutes = [
PAGE_NOT_FOUND_ROUTE
,
PAGE_NOT_FOUND_ROUTE
,
...
genRouteModule
(
routeModuleList
),
...
genRouteModule
(
routeModuleList
),
];
];
// 主框架根路由
// 主框架根路由
export
const
RootRoute
:
AppRouteRecordRaw
=
{
export
const
RootRoute
:
AppRouteRecordRaw
=
{
path
:
'
/
'
,
path
:
'
/
'
,
...
...
src/setup/error-handle/index.ts
浏览文件 @
e2333642
...
@@ -66,25 +66,23 @@ export function scriptErrorHandler(
...
@@ -66,25 +66,23 @@ export function scriptErrorHandler(
if
(
event
===
'
Script error.
'
&&
!
source
)
{
if
(
event
===
'
Script error.
'
&&
!
source
)
{
return
false
;
return
false
;
}
}
setTimeout
(
function
()
{
const
errorInfo
:
Partial
<
ErrorInfo
>
=
{};
const
errorInfo
:
Partial
<
ErrorInfo
>
=
{};
colno
=
colno
||
(
window
.
event
&&
(
window
.
event
as
any
).
errorCharacter
)
||
0
;
colno
=
colno
||
(
window
.
event
&&
(
window
.
event
as
any
).
errorCharacter
)
||
0
;
errorInfo
.
message
=
event
as
string
;
errorInfo
.
message
=
event
as
string
;
if
(
error
&&
error
.
stack
)
{
if
(
error
&&
error
.
stack
)
{
errorInfo
.
stack
=
error
.
stack
;
errorInfo
.
stack
=
error
.
stack
;
}
else
{
}
else
{
errorInfo
.
stack
=
''
;
errorInfo
.
stack
=
''
;
}
}
const
name
=
source
?
source
.
substr
(
source
.
lastIndexOf
(
'
/
'
)
+
1
)
:
'
script
'
;
const
name
=
source
?
source
.
substr
(
source
.
lastIndexOf
(
'
/
'
)
+
1
)
:
'
script
'
;
errorStore
.
commitErrorInfoState
({
errorStore
.
commitErrorInfoState
({
type
:
ErrorTypeEnum
.
SCRIPT
,
type
:
ErrorTypeEnum
.
SCRIPT
,
name
:
name
,
name
:
name
,
file
:
source
as
string
,
file
:
source
as
string
,
detail
:
'
lineno
'
+
lineno
,
detail
:
'
lineno
'
+
lineno
,
url
:
window
.
location
.
href
,
url
:
window
.
location
.
href
,
...(
errorInfo
as
Pick
<
ErrorInfo
,
'
message
'
|
'
stack
'
>
),
...(
errorInfo
as
Pick
<
ErrorInfo
,
'
message
'
|
'
stack
'
>
),
});
});
},
0
);
return
true
;
return
true
;
}
}
...
...
src/store/index.ts
浏览文件 @
e2333642
...
@@ -15,7 +15,9 @@ const store = createStore({
...
@@ -15,7 +15,9 @@ const store = createStore({
strict
:
isDev
,
strict
:
isDev
,
// plugins,
// plugins,
});
});
export
function
setupStore
(
app
:
App
<
Element
>
)
{
export
function
setupStore
(
app
:
App
<
Element
>
)
{
app
.
use
(
store
);
app
.
use
(
store
);
}
}
export
default
store
;
export
default
store
;
src/store/modules/app.ts
浏览文件 @
e2333642
import
store
from
'
/@/store
'
;
import
type
{
ProjectConfig
}
from
'
/@/types/config
'
;
import
{
hotModuleUnregisterModule
}
from
'
/@/utils/helper/vuexHelper
'
;
import
{
VuexModule
,
getModule
,
Module
,
Mutation
,
Action
}
from
'
vuex-module-decorators
'
;
import
{
VuexModule
,
getModule
,
Module
,
Mutation
,
Action
}
from
'
vuex-module-decorators
'
;
import
store
from
'
/@/store
'
;
import
{
PROJ_CFG_KEY
,
LOCK_INFO_KEY
}
from
'
/@/enums/cacheEnum
'
;
import
{
PROJ_CFG_KEY
,
LOCK_INFO_KEY
}
from
'
/@/enums/cacheEnum
'
;
import
{
ProjectConfig
}
from
'
/@/types/config
'
;
// import { userStore } from './us
er';
import
{
hotModuleUnregisterModule
}
from
'
/@/utils/helper/vuexHelp
er
'
;
import
{
setLocal
,
getLocal
,
removeLocal
}
from
'
/@/utils/helper/persistent
'
;
import
{
setLocal
,
getLocal
,
removeLocal
}
from
'
/@/utils/helper/persistent
'
;
import
{
deepMerge
}
from
'
/@/utils
'
;
import
{
deepMerge
}
from
'
/@/utils
'
;
import
{
userStore
}
from
'
./user
'
;
import
{
userStore
}
from
'
./user
'
;
export
interface
LockInfo
{
export
interface
LockInfo
{
...
@@ -20,12 +21,16 @@ const NAME = 'app';
...
@@ -20,12 +21,16 @@ const NAME = 'app';
hotModuleUnregisterModule
(
NAME
);
hotModuleUnregisterModule
(
NAME
);
@
Module
({
dynamic
:
true
,
namespaced
:
true
,
store
,
name
:
NAME
})
@
Module
({
dynamic
:
true
,
namespaced
:
true
,
store
,
name
:
NAME
})
class
App
extends
VuexModule
{
class
App
extends
VuexModule
{
// Page loading status
private
pageLoadingState
=
false
;
private
pageLoadingState
=
false
;
// project config
private
projectConfigState
:
ProjectConfig
|
null
=
getLocal
(
PROJ_CFG_KEY
);
private
projectConfigState
:
ProjectConfig
|
null
=
getLocal
(
PROJ_CFG_KEY
);
// lock info
private
lockInfoState
:
LockInfo
|
null
=
getLocal
(
LOCK_INFO_KEY
);
private
lockInfoState
:
LockInfo
|
null
=
getLocal
(
LOCK_INFO_KEY
);
// set main overflow hidden
private
lockMainScrollState
=
false
;
private
lockMainScrollState
=
false
;
get
getPageLoading
()
{
get
getPageLoading
()
{
...
@@ -87,7 +92,7 @@ class App extends VuexModule {
...
@@ -87,7 +92,7 @@ class App extends VuexModule {
}
}
// /**
// /**
// * @description:
解锁
// * @description:
unlock page
// */
// */
@
Action
@
Action
public
async
unLockAction
({
password
,
valid
=
true
}:
{
password
:
string
;
valid
?:
boolean
})
{
public
async
unLockAction
({
password
,
valid
=
true
}:
{
password
:
string
;
valid
?:
boolean
})
{
...
...
src/store/modules/error.ts
浏览文件 @
e2333642
...
@@ -25,7 +25,10 @@ const NAME = 'error';
...
@@ -25,7 +25,10 @@ const NAME = 'error';
hotModuleUnregisterModule
(
NAME
);
hotModuleUnregisterModule
(
NAME
);
@
Module
({
dynamic
:
true
,
namespaced
:
true
,
store
,
name
:
NAME
})
@
Module
({
dynamic
:
true
,
namespaced
:
true
,
store
,
name
:
NAME
})
class
Error
extends
VuexModule
implements
ErrorState
{
class
Error
extends
VuexModule
implements
ErrorState
{
// error log list
errorInfoState
:
ErrorInfo
[]
=
[];
errorInfoState
:
ErrorInfo
[]
=
[];
// error log count
errorListCountState
=
0
;
errorListCountState
=
0
;
get
getErrorInfoState
()
{
get
getErrorInfoState
()
{
...
...
src/store/modules/permission.ts
浏览文件 @
e2333642
...
@@ -26,16 +26,16 @@ const NAME = 'permission';
...
@@ -26,16 +26,16 @@ const NAME = 'permission';
hotModuleUnregisterModule
(
NAME
);
hotModuleUnregisterModule
(
NAME
);
@
Module
({
dynamic
:
true
,
namespaced
:
true
,
store
,
name
:
NAME
})
@
Module
({
dynamic
:
true
,
namespaced
:
true
,
store
,
name
:
NAME
})
class
Permission
extends
VuexModule
{
class
Permission
extends
VuexModule
{
// private routesState: AppRouteRecordRaw[] = [];
// Permission code list
// 权限编码列表
private
permCodeListState
:
string
[]
=
[];
private
permCodeListState
:
string
[]
=
[];
// Whether the route has been dynamically added
// Whether the route has been dynamically added
private
isDynamicAddedRouteState
=
false
;
private
isDynamicAddedRouteState
=
false
;
// To trigger a menu update
private
lastBuildMenuTimeState
=
0
;
private
lastBuildMenuTimeState
=
0
;
// Backstage menu list
private
backMenuListState
:
Menu
[]
=
[];
private
backMenuListState
:
Menu
[]
=
[];
get
getPermCodeListState
()
{
get
getPermCodeListState
()
{
...
@@ -50,10 +50,6 @@ class Permission extends VuexModule {
...
@@ -50,10 +50,6 @@ class Permission extends VuexModule {
return
this
.
lastBuildMenuTimeState
;
return
this
.
lastBuildMenuTimeState
;
}
}
// get getRoutesState() {
// return this.routesState;
// }
get
getIsDynamicAddedRouteState
()
{
get
getIsDynamicAddedRouteState
()
{
return
this
.
isDynamicAddedRouteState
;
return
this
.
isDynamicAddedRouteState
;
}
}
...
@@ -73,11 +69,6 @@ class Permission extends VuexModule {
...
@@ -73,11 +69,6 @@ class Permission extends VuexModule {
this
.
lastBuildMenuTimeState
=
new
Date
().
getTime
();
this
.
lastBuildMenuTimeState
=
new
Date
().
getTime
();
}
}
// @Mutation
// commitRoutesState(routes: AppRouteRecordRaw[]): void {
// this.routesState = routes;
// }
@
Mutation
@
Mutation
commitDynamicAddedRouteState
(
added
:
boolean
):
void
{
commitDynamicAddedRouteState
(
added
:
boolean
):
void
{
this
.
isDynamicAddedRouteState
=
added
;
this
.
isDynamicAddedRouteState
=
added
;
...
...
src/store/modules/tab.ts
浏览文件 @
e2333642
...
@@ -34,18 +34,15 @@ const getOpenKeepAliveRef = computed(() => appStore.getProjectConfig.openKeepAli
...
@@ -34,18 +34,15 @@ const getOpenKeepAliveRef = computed(() => appStore.getProjectConfig.openKeepAli
@
Module
({
namespaced
:
true
,
name
:
NAME
,
dynamic
:
true
,
store
})
@
Module
({
namespaced
:
true
,
name
:
NAME
,
dynamic
:
true
,
store
})
class
Tab
extends
VuexModule
{
class
Tab
extends
VuexModule
{
// tab
列表
// tab
list
tabsState
:
TabItem
[]
=
[];
tabsState
:
TabItem
[]
=
[];
//
缓存列表
//
tab cache list
keepAliveTabsState
:
CacheName
[]
=
[];
keepAliveTabsState
:
CacheName
[]
=
[];
currentContextMenuIndexState
=
-
1
;
currentContextMenuIndexState
=
-
1
;
currentContextMenuState
:
TabItem
|
null
=
null
;
currentContextMenuState
:
TabItem
|
null
=
null
;
/**
* @description: 获取tabs
*/
get
getTabsState
()
{
get
getTabsState
()
{
return
this
.
tabsState
;
return
this
.
tabsState
;
}
}
...
@@ -58,9 +55,6 @@ class Tab extends VuexModule {
...
@@ -58,9 +55,6 @@ class Tab extends VuexModule {
return
this
.
currentContextMenuState
;
return
this
.
currentContextMenuState
;
}
}
/**
* @description: 获取缓存的tab列表
*/
get
getKeepAliveTabsState
()
{
get
getKeepAliveTabsState
()
{
return
this
.
keepAliveTabsState
;
return
this
.
keepAliveTabsState
;
}
}
...
...
src/store/modules/user.ts
浏览文件 @
e2333642
...
@@ -58,7 +58,6 @@ class User extends VuexModule {
...
@@ -58,7 +58,6 @@ class User extends VuexModule {
this
.
userInfoState
=
null
;
this
.
userInfoState
=
null
;
this
.
tokenState
=
''
;
this
.
tokenState
=
''
;
this
.
roleListState
=
[];
this
.
roleListState
=
[];
// permissionStore.commitReset();
}
}
@
Mutation
@
Mutation
...
@@ -136,7 +135,6 @@ class User extends VuexModule {
...
@@ -136,7 +135,6 @@ class User extends VuexModule {
resetRouter
();
resetRouter
();
clearSession
();
clearSession
();
clearLocal
();
clearLocal
();
// router.addRoute(FULL_PAGE_NOT_FOUND_ROUTE as RouteRecordRaw);
permissionStore
.
commitResetState
();
permissionStore
.
commitResetState
();
tabStore
.
commitResetState
();
tabStore
.
commitResetState
();
this
.
resetState
();
this
.
resetState
();
...
...
src/types/config.d.ts
浏览文件 @
e2333642
...
@@ -70,7 +70,6 @@ export interface ProjectConfig {
...
@@ -70,7 +70,6 @@ export interface ProjectConfig {
headerSetting
:
HeaderSetting
;
headerSetting
:
HeaderSetting
;
// 菜单类型
// 菜单类型
// menuType: MenuTypeEnum;
// menuType: MenuTypeEnum;
menuSetting
:
MenuSetting
;
menuSetting
:
MenuSetting
;
messageSetting
:
MessageSetting
;
messageSetting
:
MessageSetting
;
...
@@ -88,15 +87,12 @@ export interface ProjectConfig {
...
@@ -88,15 +87,12 @@ export interface ProjectConfig {
showBreadCrumbIcon
:
boolean
;
showBreadCrumbIcon
:
boolean
;
// 使用error-handler-plugin
// 使用error-handler-plugin
useErrorHandle
:
boolean
;
useErrorHandle
:
boolean
;
// 开启页面切换动画
// 开启页面切换动画
openRouterTransition
:
boolean
;
openRouterTransition
:
boolean
;
// 路由切换动画
// 路由切换动画
routerTransition
:
RouterTransitionEnum
;
routerTransition
:
RouterTransitionEnum
;
// 是否开启登录安全校验
// 是否开启登录安全校验
openLoginVerify
:
boolean
;
openLoginVerify
:
boolean
;
// 是否监听网络变化
// 是否监听网络变化
listenNetWork
:
boolean
;
listenNetWork
:
boolean
;
// 是否开启页面切换loading
// 是否开启页面切换loading
...
@@ -116,23 +112,17 @@ export interface ProjectConfig {
...
@@ -116,23 +112,17 @@ export interface ProjectConfig {
export
interface
GlobConfig
{
export
interface
GlobConfig
{
// 网站标题
// 网站标题
title
:
string
;
title
:
string
;
// 项目路径
// 项目路径
apiUrl
:
string
;
apiUrl
:
string
;
urlPrefix
?:
string
;
urlPrefix
?:
string
;
shortName
:
string
;
shortName
:
string
;
}
}
export
interface
GlobEnvConfig
{
export
interface
GlobEnvConfig
{
// 网站标题
// 网站标题
VITE_GLOB_APP_TITLE
:
string
;
VITE_GLOB_APP_TITLE
:
string
;
// 项目路径
// 项目路径
VITE_GLOB_API_URL
:
string
;
VITE_GLOB_API_URL
:
string
;
VITE_GLOB_API_URL_PREFIX
?:
string
;
VITE_GLOB_API_URL_PREFIX
?:
string
;
VITE_GLOB_APP_SHORT_NAME
:
string
;
VITE_GLOB_APP_SHORT_NAME
:
string
;
}
}
...
...
src/types/global.d.ts
浏览文件 @
e2333642
...
@@ -9,6 +9,7 @@ declare interface IObj<T = any> {
...
@@ -9,6 +9,7 @@ declare interface IObj<T = any> {
}
}
declare
function
parseInt
(
s
:
string
|
number
,
radix
?:
number
):
number
;
declare
function
parseInt
(
s
:
string
|
number
,
radix
?:
number
):
number
;
declare
function
parseFloat
(
string
:
string
|
number
):
number
;
declare
function
parseFloat
(
string
:
string
|
number
):
number
;
declare
type
Dictionary
<
T
>
=
Record
<
string
,
T
>
;
declare
type
Dictionary
<
T
>
=
Record
<
string
,
T
>
;
...
@@ -26,6 +27,7 @@ declare type CustomizedHTMLElement<T> = HTMLElement & T;
...
@@ -26,6 +27,7 @@ declare type CustomizedHTMLElement<T> = HTMLElement & T;
declare
type
Indexable
<
T
=
any
>
=
{
declare
type
Indexable
<
T
=
any
>
=
{
[
key
:
string
]:
T
;
[
key
:
string
]:
T
;
};
};
declare
type
Hash
<
T
>
=
Indexable
<
T
>
;
declare
type
Hash
<
T
>
=
Indexable
<
T
>
;
declare
type
DeepPartial
<
T
>
=
{
declare
type
DeepPartial
<
T
>
=
{
...
...
src/types/module.d.ts
浏览文件 @
e2333642
declare
module
'
ant-design-vue/es/locale/zh_CN
'
;
declare
module
'
ant-design-vue/es/locale/zh_CN
'
;
declare
module
'
globby!/@/router/routes/modules/**/*.@(ts)
'
;
declare
module
'
globby!/@/router/routes/modules/**/*.@(ts)
'
;
declare
module
'
globby!/@/router/menus/modules/**/*.@(ts)
'
;
declare
module
'
globby!/@/router/menus/modules/**/*.@(ts)
'
;
declare
const
React
:
string
;
declare
const
React
:
string
;
src/types/shim-tsx.d.ts
浏览文件 @
e2333642
// 文件: `shim-tsx.d.ts`
import
type
{
ComponentRenderProxy
,
VNode
}
from
'
vue
'
;
import
Vue
,
{
VNode
}
from
'
vue
'
;
import
type
{
ComponentRenderProxy
}
from
'
@vue/composition-api
'
;
declare
module
'
*.tsx
'
{
declare
module
'
*.tsx
'
{
import
{
defineComponent
}
from
'
vue
'
;
import
{
defineComponent
}
from
'
vue
'
;
const
component
:
ReturnType
<
defineComponent
>
;
const
component
:
ReturnType
<
defineComponent
>
;
// import { ComponentOptions } from 'vue';
// const component: ReturnType<ComponentOptions>;
export
default
component
;
export
default
component
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录