Skip to content

Commit

Permalink
opimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
kuanghua committed Nov 21, 2022
1 parent b1a9432 commit bc33afe
Show file tree
Hide file tree
Showing 16 changed files with 176 additions and 15 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ strict-peer-dependencies=false
###aliyun address
registry = https://registry.npmmirror.com


11 changes: 8 additions & 3 deletions src/lang/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,19 @@ export default {
'Third KeepAlive': '三级路由缓存',
SecondChild: '三级路由示例1',
ThirdChild: '三级路由示例2',

Worker: '多线程',
Permission: '权限路由',

'Permission Switch': '权限切换',
'Role Index': '角色权限',
'Code Index': 'Code权限',
'Button Permission': '按钮权限'
'Button Permission': '按钮权限',

Charts: '图表',
Excel: 'Excel',
'Rich Text': '富文本',
Table: '表格',
Guid: '使用引导',
Other: '其他'
},

tagsView: {
Expand Down
7 changes: 7 additions & 0 deletions src/layout/app-main/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
<router-link to="/">
<el-dropdown-item>{{ langTitle('Home') }}</el-dropdown-item>
</router-link>
<a target="_blank" href="https://github.com/jzfai/vue3-admin-plus">
<el-dropdown-item>{{ langTitle('Github') }}</el-dropdown-item>
</a>
<a target="_blank" href="https://github.jzfai.top/low-code-platform">
<el-dropdown-item>{{ langTitle('LowCodePlatFrom') }}</el-dropdown-item>
</a>
<!--<el-dropdown-item>修改密码</el-dropdown-item>-->
<el-dropdown-item divided @click="loginOut">{{ langTitle('login out') }}</el-dropdown-item>
</el-dropdown-menu>
</template>
Expand Down
28 changes: 16 additions & 12 deletions src/router/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { createRouter, createWebHashHistory } from 'vue-router'
import basicDemo from './modules/basic-demo'
import charts from './modules/charts'
import richText from './modules/rich-text'
import table from './modules/table'
import excel from './modules/excel'
import other from './modules/other'
import guid from './modules/guid'
import type { RouterTypes } from '~/basic'
import Layout from '@/layout/index.vue'

Expand All @@ -15,6 +21,7 @@ export const constantRoutes: RouterTypes = [
}
]
},

{
path: '/login',
component: () => import('@/views/login/index.vue'),
Expand Down Expand Up @@ -44,16 +51,6 @@ export const constantRoutes: RouterTypes = [
}
]
},
{
path: '/low-code-platform',
component: Layout,
children: [
{
path: 'https://github.jzfai.top/low-code-platform',
meta: { title: 'LowCodePlatFrom', icon: 'link' }
}
]
},
{
path: '/RBAC',
component: Layout,
Expand All @@ -76,7 +73,7 @@ export const constantRoutes: RouterTypes = [
}
]
},
basicDemo,

{
path: '/error-log',
component: Layout,
Expand Down Expand Up @@ -154,7 +151,14 @@ export const constantRoutes: RouterTypes = [
meta: { title: 'menu2' }
}
]
}
},
basicDemo,
guid,
richText,
charts,
table,
excel,
other
]

//角色和code数组动态路由
Expand Down
17 changes: 17 additions & 0 deletions src/router/modules/charts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Layout from '@/layout/index.vue'
const charts = {
path: '/charts',
component: Layout,
meta: { title: 'Charts', icon: 'clipboard' },
alwaysShow: true,
children: [
{
path: 'index',
component: () => import('@/views/charts/index.vue'),
name: 'Index',
meta: { title: 'Index' }
}
]
}

export default charts
17 changes: 17 additions & 0 deletions src/router/modules/excel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Layout from '@/layout/index.vue'
const excel = {
path: '/excel',
component: Layout,
meta: { title: 'Excel', icon: 'pdf' },
alwaysShow: true,
children: [
{
path: 'index',
component: () => import('@/views/excel/index.vue'),
name: 'Index',
meta: { title: 'Index' }
}
]
}

export default excel
17 changes: 17 additions & 0 deletions src/router/modules/guid.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Layout from '@/layout/index.vue'
const guid = {
path: '/guid',
component: Layout,
meta: { title: 'Guid', icon: 'theme' },
alwaysShow: true,
children: [
{
path: 'index',
component: () => import('@/views/guid/index.vue'),
name: 'Index',
meta: { title: 'Index' }
}
]
}

export default guid
17 changes: 17 additions & 0 deletions src/router/modules/other.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Layout from '@/layout/index.vue'
const other = {
path: '/other',
component: Layout,
meta: { title: 'Other', icon: 'eye-open' },
alwaysShow: true,
children: [
{
path: 'index',
component: () => import('@/views/other/index.vue'),
name: 'Index',
meta: { title: 'Index' }
}
]
}

export default other
17 changes: 17 additions & 0 deletions src/router/modules/rich-text.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Layout from '@/layout/index.vue'
const richText = {
path: '/rich-text',
component: Layout,
meta: { title: 'Rich Text', icon: 'clipboard' },
alwaysShow: true,
children: [
{
path: 'index',
component: () => import('@/views/rich-text/index.vue'),
name: 'Index',
meta: { title: 'Index' }
}
]
}

export default richText
17 changes: 17 additions & 0 deletions src/router/modules/table.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Layout from '@/layout/index.vue'
const table = {
path: '/table',
component: Layout,
meta: { title: 'Table', icon: 'table' },
alwaysShow: true,
children: [
{
path: 'index',
component: () => import('@/views/table/index.vue'),
name: 'Index',
meta: { title: 'Index' }
}
]
}

export default table
7 changes: 7 additions & 0 deletions src/views/charts/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template>
<div>chart</div>
</template>

<script setup lang="ts"></script>

<style scoped lang="scss"></style>
7 changes: 7 additions & 0 deletions src/views/excel/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template>
<div>excel</div>
</template>

<script setup lang="ts"></script>

<style scoped lang="scss"></style>
7 changes: 7 additions & 0 deletions src/views/guid/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template>
<div>guid</div>
</template>

<script setup lang="ts"></script>

<style scoped lang="scss"></style>
7 changes: 7 additions & 0 deletions src/views/other/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template>
<div>other</div>
</template>

<script setup lang="ts"></script>

<style scoped lang="scss"></style>
7 changes: 7 additions & 0 deletions src/views/rich-text/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template>
<div>rich-text</div>
</template>

<script setup lang="ts"></script>

<style scoped lang="scss"></style>
7 changes: 7 additions & 0 deletions src/views/table/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template>
<div>table</div>
</template>

<script setup lang="ts"></script>

<style scoped lang="scss"></style>

0 comments on commit bc33afe

Please sign in to comment.