vue2-client 1.5.13 → 1.5.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +511 -504
- package/index.js +30 -30
- package/package.json +78 -78
- package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +225 -225
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +667 -667
- package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +713 -713
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +457 -457
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +508 -508
- package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +140 -140
- package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +165 -165
- package/src/base-client/components/common/JSONToTree/jsontotree.vue +275 -275
- package/src/base-client/components/common/XAddForm/XAddForm.vue +316 -316
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +277 -277
- package/src/base-client/components/common/XCard/XCard.vue +64 -64
- package/src/base-client/components/common/XForm/XForm.vue +185 -185
- package/src/base-client/components/common/XForm/XFormItem.vue +502 -485
- package/src/base-client/components/common/XForm/index.md +177 -177
- package/src/base-client/components/common/XFormTable/XFormTable.vue +324 -324
- package/src/base-client/components/common/XFormTable/index.md +96 -96
- package/src/base-client/components/common/XTable/XTable.vue +505 -505
- package/src/base-client/components/common/XTreeOne/XTreeOne.vue +109 -109
- package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
- package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +807 -807
- package/src/base-client/components/ticket/TicketDetailsView/index.md +29 -29
- package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
- package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
- package/src/base-client/components/ticket/TicketSubmitSuccessView/index.md +29 -29
- package/src/base-client/plugins/AppData.js +70 -70
- package/src/base-client/plugins/GetLoginInfoService.js +179 -179
- package/src/base-client/plugins/PagedList.js +177 -177
- package/src/base-client/plugins/compatible/LoginServiceOA.js +20 -20
- package/src/base-client/plugins/i18n-extend.js +32 -32
- package/src/components/Ellipsis/Ellipsis.vue +65 -65
- package/src/components/Ellipsis/index.md +38 -38
- package/src/components/NumberInfo/index.md +43 -43
- package/src/components/STable/README.md +341 -341
- package/src/components/STable/index.js +318 -318
- package/src/components/Trend/index.md +45 -45
- package/src/components/checkbox/ColorCheckbox.vue +157 -157
- package/src/components/checkbox/ImgCheckbox.vue +163 -163
- package/src/components/exception/ExceptionPage.vue +70 -70
- package/src/components/form/FormRow.vue +52 -52
- package/src/components/index.js +36 -36
- package/src/components/menu/SideMenu.vue +62 -62
- package/src/components/menu/menu.js +273 -273
- package/src/components/page/header/index.less +40 -40
- package/src/components/setting/Setting.vue +235 -235
- package/src/components/table/StandardTable.vue +141 -141
- package/src/components/table/advance/ActionColumns.vue +158 -158
- package/src/components/table/advance/SearchArea.vue +355 -355
- package/src/components/tool/AStepItem.vue +60 -60
- package/src/components/tool/AvatarList.vue +68 -68
- package/src/components/tool/Drawer.vue +142 -142
- package/src/components/tool/TagSelect.vue +83 -83
- package/src/components/transition/PageToggleTransition.vue +97 -97
- package/src/config/CreateQueryConfig.js +307 -307
- package/src/config/default/admin.config.js +18 -18
- package/src/config/default/setting.config.js +44 -44
- package/src/config/replacer/resolve.config.js +67 -67
- package/src/layouts/AdminLayout.vue +174 -174
- package/src/layouts/CommonLayout.vue +42 -42
- package/src/layouts/ComponentLayoutOne.vue +47 -47
- package/src/layouts/PageLayout.vue +151 -151
- package/src/layouts/SinglePageView.vue +111 -111
- package/src/layouts/footer/PageFooter.vue +49 -49
- package/src/layouts/header/AdminHeader.vue +104 -104
- package/src/layouts/header/HeaderAvatar.vue +61 -61
- package/src/layouts/header/HeaderNotice.vue +176 -176
- package/src/layouts/header/HeaderSearch.vue +67 -67
- package/src/layouts/header/InstitutionDetail.vue +181 -181
- package/src/layouts/header/index.less +92 -92
- package/src/layouts/tabs/TabsHead.vue +190 -190
- package/src/layouts/tabs/TabsView.vue +379 -379
- package/src/mock/goods/index.js +108 -108
- package/src/pages/exception/404.vue +25 -25
- package/src/pages/login/Login.vue +363 -363
- package/src/pages/report/ReportTable.js +124 -124
- package/src/pages/report/ReportTableHome.vue +28 -28
- package/src/pages/resourceManage/orgListManage.vue +98 -98
- package/src/pages/system/dictionary/index.vue +43 -43
- package/src/pages/system/file/index.vue +317 -317
- package/src/pages/system/monitor/loginInfor/index.vue +36 -36
- package/src/pages/system/monitor/operLog/index.vue +36 -36
- package/src/pages/system/queryParams/index.vue +43 -43
- package/src/router/async/config.async.js +27 -27
- package/src/router/async/router.map.js +68 -68
- package/src/router/guards.js +113 -113
- package/src/router/index.js +27 -27
- package/src/services/api/DictionaryDetailsViewApi.js +6 -6
- package/src/services/api/LogDetailsViewApi.js +10 -10
- package/src/services/api/QueryParamsDetailsViewApi.js +6 -6
- package/src/services/api/TicketDetailsViewApi.js +34 -34
- package/src/services/api/cas.js +79 -79
- package/src/services/api/commonTempTable.js +10 -10
- package/src/services/api/index.js +17 -17
- package/src/services/api/logininfor/index.js +6 -6
- package/src/services/api/manage.js +8 -8
- package/src/services/apiService.js +13 -13
- package/src/services/user.js +53 -53
- package/src/store/modules/index.js +4 -4
- package/src/theme/default/nprogress.less +76 -76
- package/src/theme/default/style.less +47 -47
- package/src/utils/colors.js +107 -107
- package/src/utils/excel/Blob.js +180 -180
- package/src/utils/excel/Export2Excel.js +141 -141
- package/src/utils/formatter.js +68 -68
- package/src/utils/i18n.js +80 -80
- package/src/utils/indexedDB.js +145 -145
- package/src/utils/theme-color-replacer-extend.js +91 -91
- package/src/utils/themeUtil.js +100 -100
- package/src/utils/util.js +230 -230
- package/vue.config.js +106 -106
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<a-card :bordered="false">
|
|
3
|
-
<x-form-table
|
|
4
|
-
title="登录日志"
|
|
5
|
-
:queryParamsName="queryParamsName"
|
|
6
|
-
@action="toDetail">
|
|
7
|
-
</x-form-table>
|
|
8
|
-
</a-card>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<script>
|
|
12
|
-
import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
|
|
13
|
-
|
|
14
|
-
export default {
|
|
15
|
-
name: 'loginInfor',
|
|
16
|
-
components: {
|
|
17
|
-
XFormTable
|
|
18
|
-
},
|
|
19
|
-
data () {
|
|
20
|
-
return {
|
|
21
|
-
// 选中的编号
|
|
22
|
-
selectNo: undefined,
|
|
23
|
-
// 查询配置文件名
|
|
24
|
-
queryParamsName: 'loginInforQueryParams',
|
|
25
|
-
// 是否显示详情抽屉
|
|
26
|
-
detailVisible: false
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
methods: {
|
|
30
|
-
toDetail (record, id) {
|
|
31
|
-
this.selectNo = id + ''
|
|
32
|
-
this.detailVisible = true
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<a-card :bordered="false">
|
|
3
|
+
<x-form-table
|
|
4
|
+
title="登录日志"
|
|
5
|
+
:queryParamsName="queryParamsName"
|
|
6
|
+
@action="toDetail">
|
|
7
|
+
</x-form-table>
|
|
8
|
+
</a-card>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
name: 'loginInfor',
|
|
16
|
+
components: {
|
|
17
|
+
XFormTable
|
|
18
|
+
},
|
|
19
|
+
data () {
|
|
20
|
+
return {
|
|
21
|
+
// 选中的编号
|
|
22
|
+
selectNo: undefined,
|
|
23
|
+
// 查询配置文件名
|
|
24
|
+
queryParamsName: 'loginInforQueryParams',
|
|
25
|
+
// 是否显示详情抽屉
|
|
26
|
+
detailVisible: false
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
methods: {
|
|
30
|
+
toDetail (record, id) {
|
|
31
|
+
this.selectNo = id + ''
|
|
32
|
+
this.detailVisible = true
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
</script>
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<a-card :bordered="false">
|
|
3
|
-
<x-form-table
|
|
4
|
-
title="操作日志"
|
|
5
|
-
:queryParamsName="queryParamsName"
|
|
6
|
-
@action="toDetail">
|
|
7
|
-
</x-form-table>
|
|
8
|
-
</a-card>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<script>
|
|
12
|
-
import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
|
|
13
|
-
|
|
14
|
-
export default {
|
|
15
|
-
name: 'operLog',
|
|
16
|
-
components: {
|
|
17
|
-
XFormTable
|
|
18
|
-
},
|
|
19
|
-
data () {
|
|
20
|
-
return {
|
|
21
|
-
// 选中的编号
|
|
22
|
-
selectNo: undefined,
|
|
23
|
-
// 查询配置文件名
|
|
24
|
-
queryParamsName: 'operLogQueryParams',
|
|
25
|
-
// 是否显示详情抽屉
|
|
26
|
-
detailVisible: false
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
methods: {
|
|
30
|
-
toDetail (record, id) {
|
|
31
|
-
this.selectNo = id + ''
|
|
32
|
-
this.detailVisible = true
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<a-card :bordered="false">
|
|
3
|
+
<x-form-table
|
|
4
|
+
title="操作日志"
|
|
5
|
+
:queryParamsName="queryParamsName"
|
|
6
|
+
@action="toDetail">
|
|
7
|
+
</x-form-table>
|
|
8
|
+
</a-card>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
name: 'operLog',
|
|
16
|
+
components: {
|
|
17
|
+
XFormTable
|
|
18
|
+
},
|
|
19
|
+
data () {
|
|
20
|
+
return {
|
|
21
|
+
// 选中的编号
|
|
22
|
+
selectNo: undefined,
|
|
23
|
+
// 查询配置文件名
|
|
24
|
+
queryParamsName: 'operLogQueryParams',
|
|
25
|
+
// 是否显示详情抽屉
|
|
26
|
+
detailVisible: false
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
methods: {
|
|
30
|
+
toDetail (record, id) {
|
|
31
|
+
this.selectNo = id + ''
|
|
32
|
+
this.detailVisible = true
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
</script>
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<a-card :bordered="false">
|
|
3
|
-
<query-params-details-view
|
|
4
|
-
v-if="selectId"
|
|
5
|
-
:id="selectId"
|
|
6
|
-
:visible.sync="detailVisible"
|
|
7
|
-
/>
|
|
8
|
-
<x-form-table
|
|
9
|
-
:queryParamsName="queryParamsName"
|
|
10
|
-
title="查询配置"
|
|
11
|
-
@action="toDetail">
|
|
12
|
-
</x-form-table>
|
|
13
|
-
</a-card>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script>
|
|
17
|
-
import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
|
|
18
|
-
import QueryParamsDetailsView from '@vue2-client/base-client/components/system/QueryParamsDetailsView'
|
|
19
|
-
|
|
20
|
-
export default {
|
|
21
|
-
name: 'QueryParams',
|
|
22
|
-
components: {
|
|
23
|
-
XFormTable,
|
|
24
|
-
QueryParamsDetailsView
|
|
25
|
-
},
|
|
26
|
-
data () {
|
|
27
|
-
return {
|
|
28
|
-
// 选中的编号
|
|
29
|
-
selectId: undefined,
|
|
30
|
-
// 查询配置文件名
|
|
31
|
-
queryParamsName: 'queryParams',
|
|
32
|
-
// 是否显示详情抽屉
|
|
33
|
-
detailVisible: false
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
methods: {
|
|
37
|
-
toDetail (record, id) {
|
|
38
|
-
this.selectId = id + ''
|
|
39
|
-
this.detailVisible = true
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<a-card :bordered="false">
|
|
3
|
+
<query-params-details-view
|
|
4
|
+
v-if="selectId"
|
|
5
|
+
:id="selectId"
|
|
6
|
+
:visible.sync="detailVisible"
|
|
7
|
+
/>
|
|
8
|
+
<x-form-table
|
|
9
|
+
:queryParamsName="queryParamsName"
|
|
10
|
+
title="查询配置"
|
|
11
|
+
@action="toDetail">
|
|
12
|
+
</x-form-table>
|
|
13
|
+
</a-card>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
|
|
18
|
+
import QueryParamsDetailsView from '@vue2-client/base-client/components/system/QueryParamsDetailsView'
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
name: 'QueryParams',
|
|
22
|
+
components: {
|
|
23
|
+
XFormTable,
|
|
24
|
+
QueryParamsDetailsView
|
|
25
|
+
},
|
|
26
|
+
data () {
|
|
27
|
+
return {
|
|
28
|
+
// 选中的编号
|
|
29
|
+
selectId: undefined,
|
|
30
|
+
// 查询配置文件名
|
|
31
|
+
queryParamsName: 'queryParams',
|
|
32
|
+
// 是否显示详情抽屉
|
|
33
|
+
detailVisible: false
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
methods: {
|
|
37
|
+
toDetail (record, id) {
|
|
38
|
+
this.selectId = id + ''
|
|
39
|
+
this.detailVisible = true
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
</script>
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import routerMap from './router.map'
|
|
2
|
-
import { parseRoutes } from '@vue2-client/utils/routerUtil'
|
|
3
|
-
|
|
4
|
-
// 异步路由配置
|
|
5
|
-
const routesConfig = [
|
|
6
|
-
'login',
|
|
7
|
-
'submitTicket',
|
|
8
|
-
'root',
|
|
9
|
-
{
|
|
10
|
-
router: 'exp404',
|
|
11
|
-
path: '*',
|
|
12
|
-
name: '404'
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
router: 'exp403',
|
|
16
|
-
path: '/403',
|
|
17
|
-
name: '403'
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
|
|
21
|
-
const options = {
|
|
22
|
-
mode: 'history',
|
|
23
|
-
routes: parseRoutes(routesConfig, routerMap),
|
|
24
|
-
config: routesConfig
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export default options
|
|
1
|
+
import routerMap from './router.map'
|
|
2
|
+
import { parseRoutes } from '@vue2-client/utils/routerUtil'
|
|
3
|
+
|
|
4
|
+
// 异步路由配置
|
|
5
|
+
const routesConfig = [
|
|
6
|
+
'login',
|
|
7
|
+
'submitTicket',
|
|
8
|
+
'root',
|
|
9
|
+
{
|
|
10
|
+
router: 'exp404',
|
|
11
|
+
path: '*',
|
|
12
|
+
name: '404'
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
router: 'exp403',
|
|
16
|
+
path: '/403',
|
|
17
|
+
name: '403'
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
const options = {
|
|
22
|
+
mode: 'history',
|
|
23
|
+
routes: parseRoutes(routesConfig, routerMap),
|
|
24
|
+
config: routesConfig
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default options
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
const { homePage } = require('../../config')
|
|
2
|
-
// 视图组件
|
|
3
|
-
const view = {
|
|
4
|
-
tabs: () => import('@vue2-client/layouts/tabs'),
|
|
5
|
-
blank: () => import('@vue2-client/layouts/BlankView'),
|
|
6
|
-
page: () => import('@vue2-client/layouts/PageView')
|
|
7
|
-
}
|
|
8
|
-
// 动态路由对象定义
|
|
9
|
-
const routerResource = {}
|
|
10
|
-
// --------------------------------------基本视图组件--------------------------------------
|
|
11
|
-
// 空白视图
|
|
12
|
-
routerResource.blank = view.blank
|
|
13
|
-
// 单页面视图
|
|
14
|
-
routerResource.singlePage = view.blank
|
|
15
|
-
|
|
16
|
-
// --------------------------------------仪表盘--------------------------------------
|
|
17
|
-
routerResource.dashboard = view.blank
|
|
18
|
-
// 工作台
|
|
19
|
-
routerResource.workplace = () => import('@vue2-client/pages/dashboard/workplace')
|
|
20
|
-
// --------------------------------------系统配置--------------------------------------
|
|
21
|
-
routerResource.system = view.blank
|
|
22
|
-
// 报表测试用页面
|
|
23
|
-
routerResource.testPage = () => import('@vue2-client/pages/ReportView.vue')
|
|
24
|
-
// 字典管理
|
|
25
|
-
routerResource.dictionaryManage = () => import(/* webpackChunkName: "dictionary" */ '@vue2-client/pages/system/dictionary')
|
|
26
|
-
// 查询配置管理
|
|
27
|
-
routerResource.queryParamsManage = () => import(/* webpackChunkName: "queryParams" */ '@vue2-client/pages/system/queryParams')
|
|
28
|
-
// 文件管理
|
|
29
|
-
routerResource.fileManager = () => import('@vue2-client/pages/system/file')
|
|
30
|
-
// 登录日志
|
|
31
|
-
routerResource.loginInfor = () => import('@vue2-client/pages/system/monitor/loginInfor')
|
|
32
|
-
// 操作日志
|
|
33
|
-
routerResource.operLog = () => import('@vue2-client/pages/system/monitor/operLog')
|
|
34
|
-
// 系统问题反馈工单
|
|
35
|
-
routerResource.submitTicket = () => import(/* webpackChunkName: "submitTicket" */ '@vue2-client/pages/system/ticket')
|
|
36
|
-
|
|
37
|
-
// 基础路由组件注册
|
|
38
|
-
const routerMap = {
|
|
39
|
-
login: {
|
|
40
|
-
authority: '*',
|
|
41
|
-
path: '/login',
|
|
42
|
-
component: () => import('@vue2-client/pages/login')
|
|
43
|
-
},
|
|
44
|
-
root: {
|
|
45
|
-
path: '/',
|
|
46
|
-
name: '首页',
|
|
47
|
-
redirect: homePage,
|
|
48
|
-
component: view.tabs
|
|
49
|
-
},
|
|
50
|
-
exp403: {
|
|
51
|
-
authority: '*',
|
|
52
|
-
name: 'exp403',
|
|
53
|
-
path: '403',
|
|
54
|
-
component: () => import('@vue2-client/pages/exception/403')
|
|
55
|
-
},
|
|
56
|
-
exp404: {
|
|
57
|
-
name: 'exp404',
|
|
58
|
-
path: '404',
|
|
59
|
-
component: () => import('@vue2-client/pages/exception/404')
|
|
60
|
-
},
|
|
61
|
-
exp500: {
|
|
62
|
-
name: 'exp500',
|
|
63
|
-
path: '500',
|
|
64
|
-
component: () => import('@vue2-client/pages/exception/500')
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
Object.assign(routerMap, routerResource)
|
|
68
|
-
export default routerMap
|
|
1
|
+
const { homePage } = require('../../config')
|
|
2
|
+
// 视图组件
|
|
3
|
+
const view = {
|
|
4
|
+
tabs: () => import('@vue2-client/layouts/tabs'),
|
|
5
|
+
blank: () => import('@vue2-client/layouts/BlankView'),
|
|
6
|
+
page: () => import('@vue2-client/layouts/PageView')
|
|
7
|
+
}
|
|
8
|
+
// 动态路由对象定义
|
|
9
|
+
const routerResource = {}
|
|
10
|
+
// --------------------------------------基本视图组件--------------------------------------
|
|
11
|
+
// 空白视图
|
|
12
|
+
routerResource.blank = view.blank
|
|
13
|
+
// 单页面视图
|
|
14
|
+
routerResource.singlePage = view.blank
|
|
15
|
+
|
|
16
|
+
// --------------------------------------仪表盘--------------------------------------
|
|
17
|
+
routerResource.dashboard = view.blank
|
|
18
|
+
// 工作台
|
|
19
|
+
routerResource.workplace = () => import('@vue2-client/pages/dashboard/workplace')
|
|
20
|
+
// --------------------------------------系统配置--------------------------------------
|
|
21
|
+
routerResource.system = view.blank
|
|
22
|
+
// 报表测试用页面
|
|
23
|
+
routerResource.testPage = () => import('@vue2-client/pages/ReportView.vue')
|
|
24
|
+
// 字典管理
|
|
25
|
+
routerResource.dictionaryManage = () => import(/* webpackChunkName: "dictionary" */ '@vue2-client/pages/system/dictionary')
|
|
26
|
+
// 查询配置管理
|
|
27
|
+
routerResource.queryParamsManage = () => import(/* webpackChunkName: "queryParams" */ '@vue2-client/pages/system/queryParams')
|
|
28
|
+
// 文件管理
|
|
29
|
+
routerResource.fileManager = () => import('@vue2-client/pages/system/file')
|
|
30
|
+
// 登录日志
|
|
31
|
+
routerResource.loginInfor = () => import('@vue2-client/pages/system/monitor/loginInfor')
|
|
32
|
+
// 操作日志
|
|
33
|
+
routerResource.operLog = () => import('@vue2-client/pages/system/monitor/operLog')
|
|
34
|
+
// 系统问题反馈工单
|
|
35
|
+
routerResource.submitTicket = () => import(/* webpackChunkName: "submitTicket" */ '@vue2-client/pages/system/ticket')
|
|
36
|
+
|
|
37
|
+
// 基础路由组件注册
|
|
38
|
+
const routerMap = {
|
|
39
|
+
login: {
|
|
40
|
+
authority: '*',
|
|
41
|
+
path: '/login',
|
|
42
|
+
component: () => import('@vue2-client/pages/login')
|
|
43
|
+
},
|
|
44
|
+
root: {
|
|
45
|
+
path: '/',
|
|
46
|
+
name: '首页',
|
|
47
|
+
redirect: homePage,
|
|
48
|
+
component: view.tabs
|
|
49
|
+
},
|
|
50
|
+
exp403: {
|
|
51
|
+
authority: '*',
|
|
52
|
+
name: 'exp403',
|
|
53
|
+
path: '403',
|
|
54
|
+
component: () => import('@vue2-client/pages/exception/403')
|
|
55
|
+
},
|
|
56
|
+
exp404: {
|
|
57
|
+
name: 'exp404',
|
|
58
|
+
path: '404',
|
|
59
|
+
component: () => import('@vue2-client/pages/exception/404')
|
|
60
|
+
},
|
|
61
|
+
exp500: {
|
|
62
|
+
name: 'exp500',
|
|
63
|
+
path: '500',
|
|
64
|
+
component: () => import('@vue2-client/pages/exception/500')
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
Object.assign(routerMap, routerResource)
|
|
68
|
+
export default routerMap
|
package/src/router/guards.js
CHANGED
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
import { hasAuthority } from '@vue2-client/utils/authority-utils'
|
|
2
|
-
import { loginIgnore } from '@vue2-client/router/index'
|
|
3
|
-
import { checkAuthorization } from '@vue2-client/utils/request'
|
|
4
|
-
import NProgress from 'nprogress'
|
|
5
|
-
import { logout } from '@vue2-client/services/user'
|
|
6
|
-
|
|
7
|
-
NProgress.configure({ showSpinner: false })
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* 进度条开始
|
|
11
|
-
* @param to
|
|
12
|
-
* @param form
|
|
13
|
-
* @param next
|
|
14
|
-
*/
|
|
15
|
-
const progressStart = (to, from, next) => {
|
|
16
|
-
// start progress bar
|
|
17
|
-
if (!NProgress.isStarted()) {
|
|
18
|
-
NProgress.start()
|
|
19
|
-
}
|
|
20
|
-
next()
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* 登录守卫
|
|
25
|
-
* @param to
|
|
26
|
-
* @param form
|
|
27
|
-
* @param next
|
|
28
|
-
* @param options
|
|
29
|
-
*/
|
|
30
|
-
const loginGuard = (to, from, next, options) => {
|
|
31
|
-
const { store, message } = options
|
|
32
|
-
if ((!loginIgnore.includes(to) || to.name === '404') && !checkAuthorization()) {
|
|
33
|
-
message.warning('登录已失效,请重新登录')
|
|
34
|
-
next({ path: '/login' })
|
|
35
|
-
} else {
|
|
36
|
-
const roles = store.getters['account/roles']
|
|
37
|
-
if (roles.length === 0 && to.path !== '/login') {
|
|
38
|
-
message.warning('登录已失效,请重新登录')
|
|
39
|
-
logout().finally(res => {
|
|
40
|
-
next({ path: '/login' })
|
|
41
|
-
})
|
|
42
|
-
} else {
|
|
43
|
-
next()
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* 权限守卫
|
|
50
|
-
* @param to
|
|
51
|
-
* @param form
|
|
52
|
-
* @param next
|
|
53
|
-
* @param options
|
|
54
|
-
*/
|
|
55
|
-
const authorityGuard = (to, from, next, options) => {
|
|
56
|
-
const { store, message } = options
|
|
57
|
-
const permissions = store.getters['account/permissions']
|
|
58
|
-
const roles = store.getters['account/roles']
|
|
59
|
-
if (!hasAuthority(to, permissions, roles)) {
|
|
60
|
-
message.warning(`对不起,您无权访问页面: ${to.fullPath},请联系管理员`)
|
|
61
|
-
next({ path: '/403' })
|
|
62
|
-
// NProgress.done()
|
|
63
|
-
} else {
|
|
64
|
-
next()
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* 混合导航模式下一级菜单跳转重定向
|
|
70
|
-
* @param to
|
|
71
|
-
* @param from
|
|
72
|
-
* @param next
|
|
73
|
-
* @param options
|
|
74
|
-
* @returns {*}
|
|
75
|
-
*/
|
|
76
|
-
const redirectGuard = (to, from, next, options) => {
|
|
77
|
-
const { store } = options
|
|
78
|
-
const getFirstChild = (routes) => {
|
|
79
|
-
const route = routes[0]
|
|
80
|
-
if (!route.children || route.children.length === 0) {
|
|
81
|
-
return route
|
|
82
|
-
}
|
|
83
|
-
return getFirstChild(route.children)
|
|
84
|
-
}
|
|
85
|
-
if (store.state.setting.layout === 'mix') {
|
|
86
|
-
const firstMenu = store.getters['setting/firstMenu']
|
|
87
|
-
if (firstMenu.find(item => item.fullPath === to.fullPath)) {
|
|
88
|
-
store.commit('setting/setActivatedFirst', to.fullPath)
|
|
89
|
-
const subMenu = store.getters['setting/subMenu']
|
|
90
|
-
if (subMenu.length > 0) {
|
|
91
|
-
const redirect = getFirstChild(subMenu)
|
|
92
|
-
return next({ path: redirect.fullPath })
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
next()
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* 进度条结束
|
|
101
|
-
* @param to
|
|
102
|
-
* @param form
|
|
103
|
-
* @param options
|
|
104
|
-
*/
|
|
105
|
-
const progressDone = () => {
|
|
106
|
-
// finish progress bar
|
|
107
|
-
NProgress.done()
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export default {
|
|
111
|
-
beforeEach: [progressStart, loginGuard, authorityGuard, redirectGuard],
|
|
112
|
-
afterEach: [progressDone]
|
|
113
|
-
}
|
|
1
|
+
import { hasAuthority } from '@vue2-client/utils/authority-utils'
|
|
2
|
+
import { loginIgnore } from '@vue2-client/router/index'
|
|
3
|
+
import { checkAuthorization } from '@vue2-client/utils/request'
|
|
4
|
+
import NProgress from 'nprogress'
|
|
5
|
+
import { logout } from '@vue2-client/services/user'
|
|
6
|
+
|
|
7
|
+
NProgress.configure({ showSpinner: false })
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 进度条开始
|
|
11
|
+
* @param to
|
|
12
|
+
* @param form
|
|
13
|
+
* @param next
|
|
14
|
+
*/
|
|
15
|
+
const progressStart = (to, from, next) => {
|
|
16
|
+
// start progress bar
|
|
17
|
+
if (!NProgress.isStarted()) {
|
|
18
|
+
NProgress.start()
|
|
19
|
+
}
|
|
20
|
+
next()
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 登录守卫
|
|
25
|
+
* @param to
|
|
26
|
+
* @param form
|
|
27
|
+
* @param next
|
|
28
|
+
* @param options
|
|
29
|
+
*/
|
|
30
|
+
const loginGuard = (to, from, next, options) => {
|
|
31
|
+
const { store, message } = options
|
|
32
|
+
if ((!loginIgnore.includes(to) || to.name === '404') && !checkAuthorization()) {
|
|
33
|
+
message.warning('登录已失效,请重新登录')
|
|
34
|
+
next({ path: '/login' })
|
|
35
|
+
} else {
|
|
36
|
+
const roles = store.getters['account/roles']
|
|
37
|
+
if (roles.length === 0 && to.path !== '/login') {
|
|
38
|
+
message.warning('登录已失效,请重新登录')
|
|
39
|
+
logout().finally(res => {
|
|
40
|
+
next({ path: '/login' })
|
|
41
|
+
})
|
|
42
|
+
} else {
|
|
43
|
+
next()
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 权限守卫
|
|
50
|
+
* @param to
|
|
51
|
+
* @param form
|
|
52
|
+
* @param next
|
|
53
|
+
* @param options
|
|
54
|
+
*/
|
|
55
|
+
const authorityGuard = (to, from, next, options) => {
|
|
56
|
+
const { store, message } = options
|
|
57
|
+
const permissions = store.getters['account/permissions']
|
|
58
|
+
const roles = store.getters['account/roles']
|
|
59
|
+
if (!hasAuthority(to, permissions, roles)) {
|
|
60
|
+
message.warning(`对不起,您无权访问页面: ${to.fullPath},请联系管理员`)
|
|
61
|
+
next({ path: '/403' })
|
|
62
|
+
// NProgress.done()
|
|
63
|
+
} else {
|
|
64
|
+
next()
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* 混合导航模式下一级菜单跳转重定向
|
|
70
|
+
* @param to
|
|
71
|
+
* @param from
|
|
72
|
+
* @param next
|
|
73
|
+
* @param options
|
|
74
|
+
* @returns {*}
|
|
75
|
+
*/
|
|
76
|
+
const redirectGuard = (to, from, next, options) => {
|
|
77
|
+
const { store } = options
|
|
78
|
+
const getFirstChild = (routes) => {
|
|
79
|
+
const route = routes[0]
|
|
80
|
+
if (!route.children || route.children.length === 0) {
|
|
81
|
+
return route
|
|
82
|
+
}
|
|
83
|
+
return getFirstChild(route.children)
|
|
84
|
+
}
|
|
85
|
+
if (store.state.setting.layout === 'mix') {
|
|
86
|
+
const firstMenu = store.getters['setting/firstMenu']
|
|
87
|
+
if (firstMenu.find(item => item.fullPath === to.fullPath)) {
|
|
88
|
+
store.commit('setting/setActivatedFirst', to.fullPath)
|
|
89
|
+
const subMenu = store.getters['setting/subMenu']
|
|
90
|
+
if (subMenu.length > 0) {
|
|
91
|
+
const redirect = getFirstChild(subMenu)
|
|
92
|
+
return next({ path: redirect.fullPath })
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
next()
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* 进度条结束
|
|
101
|
+
* @param to
|
|
102
|
+
* @param form
|
|
103
|
+
* @param options
|
|
104
|
+
*/
|
|
105
|
+
const progressDone = () => {
|
|
106
|
+
// finish progress bar
|
|
107
|
+
NProgress.done()
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export default {
|
|
111
|
+
beforeEach: [progressStart, loginGuard, authorityGuard, redirectGuard],
|
|
112
|
+
afterEach: [progressDone]
|
|
113
|
+
}
|