imatrix-ui 0.0.15 → 0.1.1-up
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/.vscode/extensions.json +3 -0
- package/README.md +7 -0
- package/components/dynamic-source-select/dynamic-source-select-service.js +106 -0
- package/components/dynamic-source-select/dynamic-source-select.vue +673 -0
- package/components/dynamic-source-select/events.js +77 -0
- package/components/fs-preview/fs-preview.vue +287 -0
- package/components/index.js +26 -0
- package/components/plugins/export-data-new.js +623 -0
- package/components/plugins/export-data.js +431 -0
- package/components/plugins/index.js +15 -0
- package/components/plugins/public-method.js +47 -0
- package/components/rich-editor/index-bak.vue +306 -0
- package/components/rich-editor/index.vue +236 -0
- package/components/rich-editor/langs/zh-Hans.js +438 -0
- package/components/rich-editor/viewer.vue +105 -0
- package/components/super-grid/apis.js +1065 -0
- package/components/super-grid/columns-config.vue +430 -0
- package/components/super-grid/custom-formatter.js +330 -0
- package/components/super-grid/dynamic-input.vue +1706 -0
- package/components/super-grid/eventBus.js +2 -0
- package/components/super-grid/events.js +56 -0
- package/components/super-grid/formValidatorUtil.js +300 -0
- package/components/super-grid/formatter.js +190 -0
- package/components/super-grid/group-column.vue +100 -0
- package/components/super-grid/header-context-menu.vue +82 -0
- package/components/super-grid/index-column.vue +69 -0
- package/components/super-grid/normal-column.vue +1148 -0
- package/components/super-grid/public-methods.js +30 -0
- package/components/super-grid/row-operation.vue +193 -0
- package/components/super-grid/search-button.vue +74 -0
- package/components/super-grid/search-condition-input.vue +73 -0
- package/components/super-grid/search-condition-list.vue +68 -0
- package/components/super-grid/search-form-advancedQuery.vue +820 -0
- package/components/super-grid/search-form-dialog.vue +77 -0
- package/components/super-grid/search-form-item.vue +470 -0
- package/components/super-grid/search-form-number.vue +111 -0
- package/components/super-grid/search-form-open.vue +178 -0
- package/components/super-grid/search-form-ordinarySearch.vue +218 -0
- package/components/super-grid/search-form.vue +756 -0
- package/components/super-grid/search-methods.js +484 -0
- package/components/super-grid/selection-column.vue +46 -0
- package/components/super-grid/store.js +3 -0
- package/components/super-grid/super-grid-service.js +682 -0
- package/components/super-grid/super-grid.vue +2893 -0
- package/components/super-grid/utils.js +851 -0
- package/components/super-grid/view-image-dialog.vue +173 -0
- package/components/utils/gogocodeTransfer.js +59 -0
- package/components/utils/utils.js +180 -0
- package/components/utils/value-set.js +98 -0
- package/components/z-test-utton/index.vue +82 -0
- package/package.json +29 -40
- package/public/index.html +13 -0
- package/public/vite.svg +1 -0
- package/src/api/sso-service.js +172 -19
- package/src/api/tab.js +36 -0
- package/src/api/user-service.js +11 -11
- package/src/assets/401/401.gif +0 -0
- package/src/assets/404/404-cloud.png +0 -0
- package/src/assets/404/404.png +0 -0
- package/src/assets/cloud.png +0 -0
- package/src/directives/permission/index.js +13 -13
- package/src/directives/permission/permission.js +20 -15
- package/src/i18n/i18n.js +16 -0
- package/src/i18n/langs/cn.js +254 -0
- package/src/i18n/langs/en.js +264 -0
- package/src/permission.js +157 -71
- package/src/plugins.js +18 -18
- package/src/router/index.js +96 -69
- package/src/store/getters.js +15 -10
- package/src/store/index.js +19 -19
- package/src/store/modules/app.js +54 -42
- package/src/store/modules/permission.js +137 -73
- package/src/store/modules/tab-content.js +36 -0
- package/src/store/modules/user.js +293 -80
- package/src/styles/display-layout.scss +34 -0
- package/src/styles/element-ui.scss +29 -29
- package/src/styles/index.scss +157 -78
- package/src/styles/mixin.scss +27 -27
- package/src/styles/theme/black/font-style.scss +70 -0
- package/src/styles/theme/black/index.scss +306 -0
- package/src/styles/theme/black/sidebar.scss +189 -0
- package/src/styles/theme/blue/font-style.scss +46 -0
- package/src/styles/theme/blue/index.scss +172 -0
- package/src/styles/{sidebar.scss → theme/blue/sidebar.scss} +171 -141
- package/src/styles/theme/blue2/font-style.scss +70 -0
- package/src/styles/theme/blue2/index.scss +188 -0
- package/src/styles/theme/blue2/sidebar.scss +201 -0
- package/src/styles/theme/dark-blue/button.scss +9 -0
- package/src/styles/theme/dark-blue/card.scss +62 -0
- package/src/styles/theme/dark-blue/checkbox.scss +10 -0
- package/src/styles/theme/dark-blue/dark-blue-var.scss +8 -0
- package/src/styles/theme/dark-blue/dialog.scss +21 -0
- package/src/styles/theme/dark-blue/element-variables.scss +7 -0
- package/src/styles/theme/dark-blue/font.scss +71 -0
- package/src/styles/theme/dark-blue/form.scss +51 -0
- package/src/styles/theme/dark-blue/index.scss +269 -0
- package/src/styles/theme/dark-blue/input.scss +15 -0
- package/src/styles/theme/dark-blue/message.scss +8 -0
- package/src/styles/theme/dark-blue/pagination.scss +14 -0
- package/src/styles/theme/dark-blue/scrollbar-style.scss +32 -0
- package/src/styles/theme/dark-blue/sidebar.scss +266 -0
- package/src/styles/theme/dark-blue/tab.scss +83 -0
- package/src/styles/theme/dark-blue/table.scss +60 -0
- package/src/styles/theme/dark-blue/tree.scss +31 -0
- package/src/styles/theme/dark-blue/var.scss +1028 -0
- package/src/styles/theme/gray/card-style.scss +54 -0
- package/src/styles/theme/gray/font-style.scss +70 -0
- package/src/styles/theme/gray/index.scss +172 -0
- package/src/styles/theme/gray/input-style.scss +19 -0
- package/src/styles/theme/gray/scrollbar-style.scss +32 -0
- package/src/styles/theme/gray/sidebar.scss +231 -0
- package/src/styles/theme/gray/tab-style.scss +81 -0
- package/src/styles/transition.scss +47 -46
- package/src/utils/auth-api.js +159 -0
- package/src/utils/auth.js +61 -15
- package/src/utils/calculator/calculator-factory-wf.js +558 -0
- package/src/utils/calculator/calculator-factory.js +145 -0
- package/src/utils/calculator/calculator-util.js +166 -0
- package/src/utils/common-util.js +305 -0
- package/src/utils/eventBus.js +2 -0
- package/src/utils/iconUtils.js +28 -0
- package/src/utils/index.js +102 -86
- package/src/utils/jump-page-utils.js +814 -0
- package/src/utils/local-storage.js +33 -31
- package/src/utils/menu.js +19 -0
- package/src/utils/permission.js +31 -26
- package/src/utils/permissionAuth.js +90 -0
- package/src/utils/range-selector.js +188 -0
- package/src/utils/request.js +270 -116
- package/src/utils/restful-interface-utils.js +57 -0
- package/src/utils/util.js +698 -0
- package/src/utils/validate.js +34 -33
- package/src/utils/watermark.js +108 -0
- package/src/utils/workflow-util.js +93 -0
- package/src/views/404.vue +248 -228
- package/src/views/dsc-component/Sidebar/Item.vue +84 -0
- package/src/views/dsc-component/Sidebar/Link.vue +38 -0
- package/src/views/dsc-component/Sidebar/SidebarItem.vue +196 -0
- package/src/views/dsc-component/Sidebar/index.vue +220 -0
- package/src/views/dsc-component/tabs/tab-content.vue +199 -0
- package/src/views/error-page/401.vue +106 -91
- package/src/views/error-page/404.vue +248 -228
- package/src/views/layout/EmptyLayout.vue +3 -0
- package/src/views/layout/Layout.vue +81 -68
- package/src/views/layout/NewLayout.vue +18 -0
- package/src/views/layout/components/AppMain.vue +39 -29
- package/src/views/layout/components/Breadcrumb/index.vue +156 -0
- package/src/views/layout/components/Menubar/Item.vue +57 -0
- package/src/views/layout/components/Menubar/Link.vue +38 -0
- package/src/views/layout/components/Menubar/SidebarItem.vue +164 -0
- package/src/views/layout/components/Menubar/index.vue +210 -0
- package/src/views/layout/components/Sidebar/Item.vue +53 -29
- package/src/views/layout/components/Sidebar/Link.vue +38 -39
- package/src/views/layout/components/Sidebar/SidebarItem.vue +135 -100
- package/src/views/layout/components/Sidebar/index.vue +141 -48
- package/src/views/layout/components/iframe-page.vue +38 -0
- package/src/views/layout/components/index.js +4 -3
- package/src/views/layout/components/tabs/tab-content.vue +207 -0
- package/src/views/layout/mixin/ResizeHandler.js +41 -41
- package/src/views/layout/tab-content-iframe-index.vue +38 -0
- package/src/views/layout/tab-content-index.vue +93 -0
- package/src/views/login/authredirect.vue +10 -10
- package/src/views/login/index.vue +296 -203
- package/src/views/login/update-password.vue +243 -0
- package/src/views/redirect/index.vue +14 -12
- package/src/views/wf-history/tache-subprocess-history.vue +45 -0
- package/vite.config.js +31 -0
- package/lib/super-ui.css +0 -1
- package/lib/super-ui.umd.min.js +0 -2
- package/src/styles/variables.scss +0 -4
- package/src/views/layout/components/Navbar.vue +0 -92
|
@@ -1,29 +1,53 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
<script lang="jsx">
|
|
2
|
+
import * as Vue from 'vue'
|
|
3
|
+
export default function render(_props, _context) {
|
|
4
|
+
const context = {
|
|
5
|
+
..._context,
|
|
6
|
+
props: _props,
|
|
7
|
+
data: _context.attr,
|
|
8
|
+
children: _context.slots,
|
|
9
|
+
}
|
|
10
|
+
const { icon, title, hasChildren } = context.props
|
|
11
|
+
const vnodes = []
|
|
12
|
+
|
|
13
|
+
if (icon) {
|
|
14
|
+
vnodes.push(
|
|
15
|
+
<div style="display: inline-block;">
|
|
16
|
+
<svg-icon icon-class={icon} />
|
|
17
|
+
</div>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (title) {
|
|
22
|
+
let width = '130px'
|
|
23
|
+
if (hasChildren) {
|
|
24
|
+
// 当是父菜单时,为了使后面的三角能显示出来,需要将宽度设小点
|
|
25
|
+
width = '100px'
|
|
26
|
+
}
|
|
27
|
+
const className = window.$vueApp.config.globalProperties.className
|
|
28
|
+
if (className && className === 'blue2') {
|
|
29
|
+
// blue2样式的左侧菜单宽度为240px
|
|
30
|
+
width = '230px'
|
|
31
|
+
if (hasChildren) {
|
|
32
|
+
// 当是父菜单时,为了使后面的三角能显示出来,需要将宽度设小点
|
|
33
|
+
width = '200px'
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
vnodes.push(
|
|
37
|
+
<div slot="title" style="display: inline-block">
|
|
38
|
+
<div
|
|
39
|
+
title={title}
|
|
40
|
+
style={
|
|
41
|
+
'display: inline-block;width:' +
|
|
42
|
+
width +
|
|
43
|
+
';overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all;'
|
|
44
|
+
}
|
|
45
|
+
>
|
|
46
|
+
{title}
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
return vnodes
|
|
52
|
+
}
|
|
53
|
+
</script>
|
|
@@ -1,39 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<!-- eslint-disable vue/require-component-is-->
|
|
3
|
+
<component v-bind="linkProps(to)">
|
|
4
|
+
<slot />
|
|
5
|
+
</component>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
import { isExternal } from '../../../../utils'
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
props: {
|
|
13
|
+
to: {
|
|
14
|
+
type: String,
|
|
15
|
+
required: true,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
methods: {
|
|
19
|
+
isExternalLink(routePath) {
|
|
20
|
+
return isExternal(routePath)
|
|
21
|
+
},
|
|
22
|
+
linkProps(url) {
|
|
23
|
+
if (this.isExternalLink(url)) {
|
|
24
|
+
return {
|
|
25
|
+
is: 'a',
|
|
26
|
+
href: url,
|
|
27
|
+
target: '_blank',
|
|
28
|
+
rel: 'noopener',
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
is: 'router-link',
|
|
33
|
+
to: url,
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
}
|
|
38
|
+
</script>
|
|
@@ -1,100 +1,135 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div v-if="!item.hidden&&item.children" class="menu-wrapper">
|
|
3
|
-
<template
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="!item.hidden && item.children" class="menu-wrapper">
|
|
3
|
+
<template
|
|
4
|
+
v-if="
|
|
5
|
+
hasOneShowingChild(item.children, item) &&
|
|
6
|
+
(!onlyOneChild.children || onlyOneChild.noShowingChildren) &&
|
|
7
|
+
!item.alwaysShow
|
|
8
|
+
"
|
|
9
|
+
>
|
|
10
|
+
<app-link :to="resolvePath(onlyOneChild.path)">
|
|
11
|
+
<el-menu-item
|
|
12
|
+
:index="
|
|
13
|
+
resolvePath(onlyOneChild.path) + '~~' + onlyOneChild.meta.title
|
|
14
|
+
"
|
|
15
|
+
:class="{ 'submenu-title-noDropdown': !isNest }"
|
|
16
|
+
>
|
|
17
|
+
<item
|
|
18
|
+
v-if="onlyOneChild.meta"
|
|
19
|
+
:icon="onlyOneChild.meta.icon || item.meta.icon"
|
|
20
|
+
:title="$t(onlyOneChild.meta.title)"
|
|
21
|
+
/>
|
|
22
|
+
</el-menu-item>
|
|
23
|
+
</app-link>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<el-sub-menu
|
|
27
|
+
v-else
|
|
28
|
+
:index="resolvePath(item.path) + '~~' + item.meta.title"
|
|
29
|
+
>
|
|
30
|
+
<template v-slot:title>
|
|
31
|
+
<item
|
|
32
|
+
v-if="item.meta"
|
|
33
|
+
:icon="item.meta.icon"
|
|
34
|
+
:title="$t(item.meta.title)"
|
|
35
|
+
:has-children="item.children.length > 0 ? true : false"
|
|
36
|
+
/>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<template v-for="child in visibleChildren">
|
|
40
|
+
<sidebar-item
|
|
41
|
+
v-if="child.children && child.children.length > 0"
|
|
42
|
+
:is-nest="true"
|
|
43
|
+
:item="child"
|
|
44
|
+
:base-path="resolvePath(child.path)"
|
|
45
|
+
class="nest-menu"
|
|
46
|
+
/>
|
|
47
|
+
<app-link v-else :to="resolvePath(child.path)">
|
|
48
|
+
<el-menu-item
|
|
49
|
+
:index="resolvePath(child.path) + '~~' + child.meta.title"
|
|
50
|
+
>
|
|
51
|
+
<item
|
|
52
|
+
v-if="child.meta"
|
|
53
|
+
:icon="child.meta.icon"
|
|
54
|
+
:title="$t(child.meta.title)"
|
|
55
|
+
/>
|
|
56
|
+
</el-menu-item>
|
|
57
|
+
</app-link>
|
|
58
|
+
</template>
|
|
59
|
+
</el-sub-menu>
|
|
60
|
+
</div>
|
|
61
|
+
</template>
|
|
62
|
+
|
|
63
|
+
<script>
|
|
64
|
+
import path from 'path'
|
|
65
|
+
import { isExternal } from '../../../../utils'
|
|
66
|
+
import Item from './Item.vue'
|
|
67
|
+
import AppLink from './Link.vue'
|
|
68
|
+
|
|
69
|
+
export default {
|
|
70
|
+
name: 'SidebarItem',
|
|
71
|
+
components: { Item, AppLink },
|
|
72
|
+
props: {
|
|
73
|
+
// route object
|
|
74
|
+
item: {
|
|
75
|
+
type: Object,
|
|
76
|
+
required: true,
|
|
77
|
+
},
|
|
78
|
+
isNest: {
|
|
79
|
+
type: Boolean,
|
|
80
|
+
default: false,
|
|
81
|
+
},
|
|
82
|
+
basePath: {
|
|
83
|
+
type: String,
|
|
84
|
+
default: '',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
data() {
|
|
88
|
+
return {
|
|
89
|
+
onlyOneChild: null,
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
computed: {
|
|
93
|
+
visibleChildren() {
|
|
94
|
+
return this.item.children.filter((child) => {
|
|
95
|
+
return !child.hidden
|
|
96
|
+
})
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
methods: {
|
|
100
|
+
hasOneShowingChild(children, parent) {
|
|
101
|
+
const showingChildren = children.filter((item) => {
|
|
102
|
+
if (item.hidden) {
|
|
103
|
+
return false
|
|
104
|
+
} else {
|
|
105
|
+
// Temp set(will be used if only has one showing child)
|
|
106
|
+
this.onlyOneChild = item
|
|
107
|
+
return true
|
|
108
|
+
}
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
// When there is only one child router, the child router is displayed by default
|
|
112
|
+
if (showingChildren.length === 1) {
|
|
113
|
+
return true
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Show parent if there are no child router to display
|
|
117
|
+
if (showingChildren.length === 0) {
|
|
118
|
+
this.onlyOneChild = { ...parent, path: '', noShowingChildren: true }
|
|
119
|
+
return true
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return false
|
|
123
|
+
},
|
|
124
|
+
resolvePath(routePath) {
|
|
125
|
+
if (this.isExternalLink(routePath)) {
|
|
126
|
+
return routePath
|
|
127
|
+
}
|
|
128
|
+
return path.resolve(this.basePath, routePath)
|
|
129
|
+
},
|
|
130
|
+
isExternalLink(routePath) {
|
|
131
|
+
return isExternal(routePath)
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
}
|
|
135
|
+
</script>
|
|
@@ -1,48 +1,141 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<el-scrollbar wrap-class="scrollbar-wrapper">
|
|
4
|
-
<el-menu
|
|
5
|
-
:show-timeout="200"
|
|
6
|
-
:default-active="
|
|
7
|
-
:collapse="isCollapse"
|
|
8
|
-
mode="vertical"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-scrollbar wrap-class="scrollbar-wrapper">
|
|
4
|
+
<el-menu
|
|
5
|
+
:show-timeout="200"
|
|
6
|
+
:default-active="defaultActive"
|
|
7
|
+
:collapse="isCollapse"
|
|
8
|
+
mode="vertical"
|
|
9
|
+
@select="selectMenu"
|
|
10
|
+
>
|
|
11
|
+
<el-menu-item
|
|
12
|
+
v-if="systemName"
|
|
13
|
+
:title="systemName"
|
|
14
|
+
index="1"
|
|
15
|
+
disabled
|
|
16
|
+
class="system-item"
|
|
17
|
+
style="padding-left: 10px"
|
|
18
|
+
>
|
|
19
|
+
{{ systemName }}
|
|
20
|
+
</el-menu-item>
|
|
21
|
+
<sidebar-item
|
|
22
|
+
v-for="route in protectedRouters"
|
|
23
|
+
:key="route.path"
|
|
24
|
+
:item="route"
|
|
25
|
+
:base-path="route.path"
|
|
26
|
+
/>
|
|
27
|
+
</el-menu>
|
|
28
|
+
</el-scrollbar>
|
|
29
|
+
<hamburger
|
|
30
|
+
:is-active="sidebar.opened"
|
|
31
|
+
class="hamburger-container"
|
|
32
|
+
@toggleClick="toggleSideBar"
|
|
33
|
+
/>
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script>
|
|
38
|
+
import { mapGetters } from 'vuex'
|
|
39
|
+
import SidebarItem from './SidebarItem.vue'
|
|
40
|
+
import * as Vue from 'vue'
|
|
41
|
+
import { getLanguageWithLocale } from '../../../../utils/util'
|
|
42
|
+
import { isShowSystemMenu } from '../../../../utils/common-util'
|
|
43
|
+
import Cookies from 'js-cookie'
|
|
44
|
+
export default {
|
|
45
|
+
components: {
|
|
46
|
+
SidebarItem,
|
|
47
|
+
},
|
|
48
|
+
data() {
|
|
49
|
+
let systemName
|
|
50
|
+
if (isShowSystemMenu() === true) {
|
|
51
|
+
const language = getLanguageWithLocale()
|
|
52
|
+
const systemNameObj = window.$vueApp.config.globalProperties.systemNameObj
|
|
53
|
+
if (systemNameObj) {
|
|
54
|
+
systemName = systemNameObj[language]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
systemName,
|
|
59
|
+
defaultActive: '',
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
computed: {
|
|
63
|
+
...mapGetters(['sidebar', 'protectedRouters']),
|
|
64
|
+
isCollapse() {
|
|
65
|
+
return !this.sidebar.opened
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
watch: {
|
|
69
|
+
$route() {
|
|
70
|
+
this.getDefaultActiveMenu()
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
created() {
|
|
74
|
+
this.getDefaultActiveMenu()
|
|
75
|
+
},
|
|
76
|
+
methods: {
|
|
77
|
+
toggleSideBar() {
|
|
78
|
+
this.$store.dispatch('toggleSidebar')
|
|
79
|
+
},
|
|
80
|
+
selectMenu(index, indexPath) {
|
|
81
|
+
window.$vueApp.config.globalProperties._selectMenu = index
|
|
82
|
+
Cookies.set('selectMenu', index)
|
|
83
|
+
},
|
|
84
|
+
getDefaultActiveMenu() {
|
|
85
|
+
const cookieMenu = Cookies.get('selectMenu')
|
|
86
|
+
const leftSelectMenu = window.$vueApp.config.globalProperties._selectMenu
|
|
87
|
+
if (leftSelectMenu) {
|
|
88
|
+
this.defaultActive = leftSelectMenu
|
|
89
|
+
} else if (cookieMenu) {
|
|
90
|
+
this.defaultActive = cookieMenu
|
|
91
|
+
} else {
|
|
92
|
+
// 初始进入系统
|
|
93
|
+
const parentPaths = []
|
|
94
|
+
this.defaultActive = this.getDefaultActiveRouteInChildren(
|
|
95
|
+
this.protectedRouters,
|
|
96
|
+
parentPaths
|
|
97
|
+
)
|
|
98
|
+
window.$vueApp.config.globalProperties._selectMenu = this.defaultActive
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
getDefaultActiveRouteInChildren(children, parentPaths) {
|
|
102
|
+
let defaultActive
|
|
103
|
+
for (let i = 0; i < children.length; i++) {
|
|
104
|
+
const route = children[i]
|
|
105
|
+
if (
|
|
106
|
+
(route.hidden === undefined || route.hidden === false) &&
|
|
107
|
+
route.path &&
|
|
108
|
+
route.path !== '' &&
|
|
109
|
+
route.path !== '/redirect/:path*'
|
|
110
|
+
) {
|
|
111
|
+
// 表示不是隐藏的路由
|
|
112
|
+
if (route.children === undefined || route.children.length === 0) {
|
|
113
|
+
// 表示当前路由就是要默认选中的
|
|
114
|
+
let path = route.path
|
|
115
|
+
if (path && path.indexOf('/') !== 0) {
|
|
116
|
+
// 表示是相对路径,需要拼接父路由路径
|
|
117
|
+
path = parentPaths.join('/') + '/' + path
|
|
118
|
+
}
|
|
119
|
+
if (this.$route.path === path) {
|
|
120
|
+
const title = route.meta ? route.meta.title : ''
|
|
121
|
+
defaultActive = path + '~~' + title
|
|
122
|
+
break
|
|
123
|
+
}
|
|
124
|
+
} else {
|
|
125
|
+
parentPaths.push(route.path)
|
|
126
|
+
defaultActive = this.getDefaultActiveRouteInChildren(
|
|
127
|
+
route.children,
|
|
128
|
+
parentPaths
|
|
129
|
+
)
|
|
130
|
+
if (defaultActive) {
|
|
131
|
+
break
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
parentPaths = []
|
|
136
|
+
}
|
|
137
|
+
return defaultActive
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
}
|
|
141
|
+
</script>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<iframe
|
|
4
|
+
v-if="src && src !== null"
|
|
5
|
+
ref="menuContent"
|
|
6
|
+
:src="src"
|
|
7
|
+
name="menu-content"
|
|
8
|
+
title="Main content"
|
|
9
|
+
frameborder="0"
|
|
10
|
+
/>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
export default {
|
|
16
|
+
data() {
|
|
17
|
+
return {
|
|
18
|
+
src: null,
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
watch: {
|
|
22
|
+
$route(to, from) {
|
|
23
|
+
// 必须这样写,否则会在切换页面时无法获得pageCode参数
|
|
24
|
+
this.src = this.$route.query.src
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
mounted() {
|
|
28
|
+
this.src = this.$route.query.src
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<style lang="scss" scoped>
|
|
34
|
+
iframe {
|
|
35
|
+
width: 100%;
|
|
36
|
+
height: calc(100vh - 50px);
|
|
37
|
+
}
|
|
38
|
+
</style>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export { default as
|
|
2
|
-
export { default as
|
|
3
|
-
export { default as
|
|
1
|
+
export { default as Sidebar } from './Sidebar/index.vue'
|
|
2
|
+
export { default as AppMain } from './AppMain.vue'
|
|
3
|
+
export { default as Menubar } from './Menubar/index.vue'
|
|
4
|
+
export { default as Breadcrumb } from './Breadcrumb/index.vue'
|