-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Soybean
committed
Feb 11, 2022
1 parent
a7a269d
commit e65034d
Showing
31 changed files
with
65 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<template> | ||
<exception-base type="403" /> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { ExceptionBase } from '../../system-view/components'; | ||
</script> | ||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<template> | ||
<exception-base type="404" /> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { ExceptionBase } from '../../system-view/components'; | ||
</script> | ||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<template> | ||
<exception-base type="500" /> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { ExceptionBase } from '../../system-view/components'; | ||
</script> | ||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,31 @@ | ||
export * from './system'; | ||
export * from './dashboard'; | ||
export * from './document'; | ||
export * from './component'; | ||
export * from './plugin'; | ||
export * from './multi-menu'; | ||
export * from './about'; | ||
import type { Component } from 'vue'; | ||
|
||
type ViewComponent = Record<string, () => Promise<Component>>; | ||
|
||
const importViews = import.meta.glob('./**/index.vue'); | ||
|
||
const COMPONENTS_KEY = 'components'; | ||
const PREFIX = './'; | ||
const SUFFIX = '/index.vue'; | ||
const PATH_SPLIT_MARK = '/'; | ||
const ROUTE_KEY_SPLIT_MARK = '_'; | ||
/** 系统的内置路由,该文件夹名称不作为RouteKey */ | ||
const SYSTEM_VIEW = 'system-view_'; | ||
|
||
/** 过滤掉组件文件 */ | ||
const viewKeys = Object.keys(importViews).filter(key => !key.includes(COMPONENTS_KEY)); | ||
|
||
function getViewComponent() { | ||
const components: ViewComponent = {}; | ||
viewKeys.forEach(key => { | ||
const routeKey = key | ||
.replace(PREFIX, '') | ||
.replace(SUFFIX, '') | ||
.replaceAll(PATH_SPLIT_MARK, ROUTE_KEY_SPLIT_MARK) | ||
.replace(SYSTEM_VIEW, ''); | ||
components[routeKey] = importViews[key]; | ||
}); | ||
return components; | ||
} | ||
|
||
export const views = getViewComponent(); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<template> | ||
<exception-base type="404" /> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { ExceptionBase } from '../components'; | ||
</script> | ||
<style scoped></style> |
File renamed without changes.
This file was deleted.
Oops, something went wrong.