imatrix-ui 2.9.9-dw → 2.9.11-boe1
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/lib/super-ui.css +1 -1
- package/lib/super-ui.umd.min.js +5 -35
- package/package.json +2 -2
- package/src/api/sso-service.js +19 -1
- package/src/i18n/i18n.js +1 -1
- package/src/i18n/langs/cn.js +14 -4
- package/src/i18n/langs/en.js +16 -5
- package/src/permission.js +1 -1
- package/src/plugins.js +3 -3
- package/src/router/index.js +10 -0
- package/src/store/modules/tab-content.js +6 -0
- package/src/store/modules/user.js +19 -0
- package/src/styles/index.scss +74 -4
- package/src/styles/theme/black/font-style.scss +70 -0
- package/src/styles/theme/black/index.scss +6 -30
- package/src/styles/theme/blue/font-style.scss +37 -0
- package/src/styles/theme/blue/index.scss +2 -18
- package/src/styles/theme/blue2/font-style.scss +70 -0
- package/src/styles/theme/blue2/index.scss +3 -13
- package/src/styles/theme/dark-blue/index.scss +27 -5
- package/src/styles/theme/dark-blue/message.scss +8 -0
- package/src/styles/theme/dark-blue/sidebar.scss +7 -37
- package/src/styles/theme/dark-blue/table.scss +1 -1
- package/src/styles/theme/gray/card-style.scss +13 -1
- package/src/styles/theme/gray/font-style.scss +38 -0
- package/src/styles/theme/gray/index.scss +13 -25
- package/src/styles/theme/gray/scrollbar-style.scss +32 -0
- package/src/styles/theme/gray/sidebar.scss +7 -14
- package/src/utils/auth-api.js +45 -1
- package/src/utils/common-util.js +21 -81
- package/src/utils/range-selector.js +185 -0
- package/src/utils/request.js +6 -3
- package/src/utils/util.js +12 -10
- package/src/views/dsc-component/Sidebar/Item.vue +7 -5
- package/src/views/dsc-component/Sidebar/SidebarItem.vue +2 -3
- package/src/views/dsc-component/Sidebar/index.vue +12 -20
- package/src/views/dsc-component/tabs/tab-content.vue +1 -5
- package/src/views/layout/NewLayout.vue +6 -65
- package/src/views/layout/components/Menubar/Item.vue +23 -7
- package/src/views/layout/components/Menubar/Link.vue +11 -2
- package/src/views/layout/components/Menubar/SidebarItem.vue +50 -7
- package/src/views/layout/components/Menubar/index.vue +51 -16
- package/src/views/layout/components/tabs/tab-content.vue +160 -0
- package/src/views/layout/tab-content-iframe-index.vue +31 -0
- package/src/views/layout/tab-content-index.vue +85 -0
- package/src/views/login/index.vue +1 -1
- package/packages/breadcrumb/index.js +0 -6
- package/packages/breadcrumb/src/breadcrumb.vue +0 -71
- package/packages/department-tree/index.js +0 -6
- package/packages/department-tree/src/department-tree.vue +0 -108
- package/packages/department-tree-inline/index.js +0 -6
- package/packages/department-tree-inline/src/department-multi-tree-inline.vue +0 -402
- package/packages/department-tree-inline/src/department-single-tree-inline.vue +0 -284
- package/packages/department-tree-inline/src/department-tree-inline.vue +0 -86
- package/packages/department-tree-inline/src/department-tree-service.js +0 -245
- package/packages/department-tree-inline/src/search-result.vue +0 -176
- package/packages/department-user-tree/index.js +0 -6
- package/packages/department-user-tree/src/department-user-multiple-tree.vue +0 -116
- package/packages/department-user-tree/src/department-user-single-tree.vue +0 -76
- package/packages/department-user-tree/src/department-user-tree.vue +0 -101
- package/packages/department-user-tree-inline/index.js +0 -6
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +0 -626
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +0 -269
- package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +0 -79
- package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +0 -230
- package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -122
- package/packages/department-user-tree-inline/src/search-result.vue +0 -197
- package/packages/directives/prevent-reclick.js +0 -19
- package/packages/dynamic-source-select/index.js +0 -6
- package/packages/dynamic-source-select/src/dynamic-source-select-service.js +0 -70
- package/packages/dynamic-source-select/src/dynamic-source-select.vue +0 -440
- package/packages/dynamic-source-select/src/events.js +0 -55
- package/packages/fs-preview/index.js +0 -6
- package/packages/fs-preview/src/fs-preview.vue +0 -226
- package/packages/fs-upload/index.js +0 -6
- package/packages/fs-upload/src/fs-upload-multi.vue +0 -420
- package/packages/fs-upload/src/fs-upload-single.vue +0 -312
- package/packages/fs-upload/src/fs-upload.vue +0 -189
- package/packages/fs-upload/src/see-big-picture.vue +0 -55
- package/packages/fs-upload-list/index.js +0 -6
- package/packages/fs-upload-list/src/fs-upload-list.vue +0 -287
- package/packages/hamburger/index.js +0 -6
- package/packages/hamburger/src/hamburger.vue +0 -38
- package/packages/index.js +0 -121
- package/packages/multipart-upload/index.js +0 -6
- package/packages/multipart-upload/src/index.vue +0 -73
- package/packages/multipart-upload/src/multipart-upload-form.vue +0 -297
- package/packages/multipart-upload/src/multipart-upload-list.vue +0 -378
- package/packages/organization-input/index.js +0 -6
- package/packages/organization-input/src/organization-input.vue +0 -542
- package/packages/plugins/export-data-new.js +0 -453
- package/packages/plugins/export-data.js +0 -361
- package/packages/plugins/index.js +0 -15
- package/packages/plugins/public-method.js +0 -43
- package/packages/remove-department/index.js +0 -6
- package/packages/remove-department/src/remove-department.vue +0 -172
- package/packages/remove-department/src/remove-dept-service.js +0 -20
- package/packages/remove-user/index.js +0 -6
- package/packages/remove-user/src/remove-user-service.js +0 -20
- package/packages/remove-user/src/remove-user.vue +0 -195
- package/packages/remove-workgroup/index.js +0 -6
- package/packages/remove-workgroup/src/remove-workgroup-service.js +0 -20
- package/packages/remove-workgroup/src/remove-workgroup.vue +0 -159
- package/packages/rich-editor/index.js +0 -7
- package/packages/rich-editor/index.vue +0 -278
- package/packages/rich-editor/langs/zh-Hans.js +0 -1
- package/packages/rich-editor/viewer.vue +0 -103
- package/packages/scan-code-input/index.js +0 -6
- package/packages/scan-code-input/src/events.js +0 -33
- package/packages/scan-code-input/src/scan-code-input-colse.vue +0 -131
- package/packages/scan-code-input/src/scan-code-input.vue +0 -116
- package/packages/secret-info/index.js +0 -7
- package/packages/secret-info/index.vue +0 -90
- package/packages/super-grid/index.js +0 -7
- package/packages/super-grid/src/apis.js +0 -763
- package/packages/super-grid/src/columns-config.vue +0 -335
- package/packages/super-grid/src/custom-formatter.js +0 -250
- package/packages/super-grid/src/dynamic-input.vue +0 -1279
- package/packages/super-grid/src/eventBus.js +0 -2
- package/packages/super-grid/src/events.js +0 -55
- package/packages/super-grid/src/formValidatorUtil.js +0 -226
- package/packages/super-grid/src/formatter.js +0 -181
- package/packages/super-grid/src/group-column.vue +0 -100
- package/packages/super-grid/src/header-context-menu.vue +0 -87
- package/packages/super-grid/src/index-column.vue +0 -51
- package/packages/super-grid/src/normal-column.vue +0 -769
- package/packages/super-grid/src/public-methods.js +0 -31
- package/packages/super-grid/src/row-operation.vue +0 -161
- package/packages/super-grid/src/search-button.vue +0 -66
- package/packages/super-grid/src/search-condition-input.vue +0 -61
- package/packages/super-grid/src/search-condition-list.vue +0 -59
- package/packages/super-grid/src/search-form-advancedQuery.vue +0 -653
- package/packages/super-grid/src/search-form-dialog.vue +0 -79
- package/packages/super-grid/src/search-form-item.vue +0 -386
- package/packages/super-grid/src/search-form-number.vue +0 -38
- package/packages/super-grid/src/search-form-open.vue +0 -162
- package/packages/super-grid/src/search-form-ordinarySearch.vue +0 -188
- package/packages/super-grid/src/search-form.vue +0 -634
- package/packages/super-grid/src/search-methods.js +0 -387
- package/packages/super-grid/src/selection-column.vue +0 -43
- package/packages/super-grid/src/store.js +0 -3
- package/packages/super-grid/src/super-grid-service.js +0 -561
- package/packages/super-grid/src/super-grid.vue +0 -2829
- package/packages/super-grid/src/utils.js +0 -763
- package/packages/super-grid/src/view-image-dialog.vue +0 -130
- package/packages/super-nine-grid/index.js +0 -7
- package/packages/super-nine-grid/src/apis.js +0 -103
- package/packages/super-nine-grid/src/custom-formatter.js +0 -66
- package/packages/super-nine-grid/src/formatter.js +0 -132
- package/packages/super-nine-grid/src/search-form-number.vue +0 -38
- package/packages/super-nine-grid/src/search-form.vue +0 -430
- package/packages/super-nine-grid/src/search-methods.js +0 -134
- package/packages/super-nine-grid/src/store.js +0 -3
- package/packages/super-nine-grid/src/super-grid-service.js +0 -91
- package/packages/super-nine-grid/src/super-nine-grid.vue +0 -872
- package/packages/super-nine-grid/src/utils.js +0 -261
- package/packages/svg-icon/index.js +0 -6
- package/packages/svg-icon/src/svg-icon.vue +0 -43
- package/packages/utils/utils.js +0 -152
- package/packages/utils/value-set.js +0 -86
- package/packages/valid-code/index.js +0 -7
- package/packages/valid-code/src/valid-code.vue +0 -95
- package/packages/workflow-button/index.js +0 -6
- package/packages/workflow-button/src/workflow-button.vue +0 -325
- package/packages/workflow-history-list/index.js +0 -6
- package/packages/workflow-history-list/src/api.js +0 -7
- package/packages/workflow-history-list/src/workflow-history-list.vue +0 -185
- package/packages/workgroup-tree/index.js +0 -6
- package/packages/workgroup-tree/src/workgroup-tree.vue +0 -76
- package/packages/workgroup-tree-inline/index.js +0 -6
- package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +0 -317
- package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +0 -43
- package/packages/workgroup-user-tree/index.js +0 -6
- package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +0 -100
- package/packages/workgroup-user-tree-inline/index.js +0 -6
- package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +0 -163
- package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +0 -436
- package/packages/year-range-picker/index.js +0 -6
- package/packages/year-range-picker/src/year-range-picker.vue +0 -51
- package/src/index.js +0 -93
- package/src/styles/theme/gray/form-style.scss +0 -41
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="menu-wrapper">
|
|
3
3
|
<template v-if="!item.children || item.children.lenght === 0">
|
|
4
|
-
<app-link :to="toPath(item)">
|
|
4
|
+
<app-link :to="toPath(item)" @click.native="clickMenu(toPath(item))">
|
|
5
5
|
<el-menu-item :index="item.fullPath+'~~'+item.i18nValue" :class="{'submenu-title-noDropdown':!isNest}">
|
|
6
|
-
<item :icon="item.iconName" :title="item
|
|
6
|
+
<item :icon="item.iconName" :title="getI18nName(item)" :is-root="true" />
|
|
7
7
|
</el-menu-item>
|
|
8
8
|
</app-link>
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
11
|
<el-submenu v-else :index="item.fullPath+'~~'+item.i18nValue">
|
|
12
12
|
<template slot="title">
|
|
13
|
-
<item :icon="item.iconName" :title="item
|
|
13
|
+
<item :icon="item.iconName" :title="getI18nName(item)" :has-children="item.children.length > 0?true:false" />
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<template v-for="child in item.children">
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
:item="child"
|
|
22
22
|
class="nest-menu"
|
|
23
23
|
/>
|
|
24
|
-
<app-link v-else :key="child.code" :to="toPath(child)">
|
|
24
|
+
<app-link v-else :key="child.code" :to="toPath(child)" @click.native="clickMenu(toPath(child))">
|
|
25
25
|
<el-menu-item :index="child.fullPath+'~~'+child.i18nValue">
|
|
26
|
-
<item :icon="child.iconName" :title="child
|
|
26
|
+
<item :icon="child.iconName" :title="getI18nName(child)" />
|
|
27
27
|
</el-menu-item>
|
|
28
28
|
</app-link>
|
|
29
29
|
</template>
|
|
@@ -34,6 +34,9 @@
|
|
|
34
34
|
<script>
|
|
35
35
|
import Item from './Item'
|
|
36
36
|
import AppLink from './Link'
|
|
37
|
+
import Vue from 'vue'
|
|
38
|
+
import { getI18nName } from 'imatrix-ui/src/utils/menu'
|
|
39
|
+
import tabJs from '../../../../api/tab'
|
|
37
40
|
|
|
38
41
|
export default {
|
|
39
42
|
name: 'SidebarItem',
|
|
@@ -59,6 +62,7 @@ export default {
|
|
|
59
62
|
}
|
|
60
63
|
},
|
|
61
64
|
methods: {
|
|
65
|
+
...tabJs,
|
|
62
66
|
hasOneShowingChild(children, parent) {
|
|
63
67
|
if (children && children.length > 0) {
|
|
64
68
|
this.onlyOneChild = children[0]
|
|
@@ -80,13 +84,24 @@ export default {
|
|
|
80
84
|
toPath(menu) {
|
|
81
85
|
const toPathObj = {}
|
|
82
86
|
const routePath = menu.fullPath
|
|
87
|
+
toPathObj.openWay = menu.openWay
|
|
83
88
|
if (this.isExternalLink(menu.pageType)) {
|
|
84
|
-
toPathObj.path = '/iframe-
|
|
89
|
+
toPathObj.path = '/tab-content-iframe-index'
|
|
90
|
+
toPathObj.tabPath = '/iframe-page/page'
|
|
85
91
|
toPathObj.query = {}
|
|
86
92
|
toPathObj.query.src = routePath
|
|
87
93
|
toPathObj.isExternal = true
|
|
94
|
+
// 如果路径中没有拼系统编码,才需要把系统编码放到参数中
|
|
95
|
+
toPathObj.query.customSystem = Vue.prototype.customSystem
|
|
96
|
+
toPathObj.query._menuCode = menu.code
|
|
97
|
+
toPathObj.query._menuName = getI18nName(menu)
|
|
88
98
|
} else {
|
|
89
|
-
toPathObj.path =
|
|
99
|
+
toPathObj.path = '/tab-content-index'
|
|
100
|
+
toPathObj.tabPath = routePath
|
|
101
|
+
toPathObj.query = {}
|
|
102
|
+
toPathObj.query.customSystem = Vue.prototype.customSystem
|
|
103
|
+
toPathObj.query._menuCode = menu.code
|
|
104
|
+
toPathObj.query._menuName = getI18nName(menu)
|
|
90
105
|
}
|
|
91
106
|
return toPathObj
|
|
92
107
|
},
|
|
@@ -95,6 +110,34 @@ export default {
|
|
|
95
110
|
return true
|
|
96
111
|
}
|
|
97
112
|
return false
|
|
113
|
+
},
|
|
114
|
+
clickMenu(toPathObj) {
|
|
115
|
+
// console.log('clickMenu----toPathObj=', toPathObj)
|
|
116
|
+
if (toPathObj.openWay && toPathObj.openWay === 'NEW_PAGE_OPEN' && toPathObj.query) {
|
|
117
|
+
// 新页签打开菜单
|
|
118
|
+
let url = toPathObj.query.src
|
|
119
|
+
if (url && url.indexOf('?') > 0) {
|
|
120
|
+
url += '&'
|
|
121
|
+
} else {
|
|
122
|
+
url += '?'
|
|
123
|
+
}
|
|
124
|
+
if (toPathObj.query.customSystem) {
|
|
125
|
+
url += 'customSystem=' + toPathObj.query.customSystem
|
|
126
|
+
}
|
|
127
|
+
if (toPathObj.query._menuCode) {
|
|
128
|
+
url += '_menuCode=' + toPathObj.query._menuCode
|
|
129
|
+
}
|
|
130
|
+
if (toPathObj.query._menuCode) {
|
|
131
|
+
url += '_menuName=' + toPathObj.query._menuName
|
|
132
|
+
}
|
|
133
|
+
window.open(url, toPathObj.query._menuCode)
|
|
134
|
+
} else {
|
|
135
|
+
// 刷新页签打开菜单
|
|
136
|
+
this.addTabs(toPathObj.query, this.$store.state.tabContent.openTab, toPathObj.tabPath)
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
getI18nName(menu) {
|
|
140
|
+
return getI18nName(menu)
|
|
98
141
|
}
|
|
99
142
|
}
|
|
100
143
|
}
|
|
@@ -24,6 +24,8 @@ import SidebarItem from './SidebarItem'
|
|
|
24
24
|
import Vue from 'vue'
|
|
25
25
|
import { getLanguageWithLocale } from '../../../../utils/util'
|
|
26
26
|
import { isShowSystemMenu } from '../../../../utils/common-util'
|
|
27
|
+
import tabJs from '../../../../api/tab'
|
|
28
|
+
import { getI18nName } from '../../../../utils/menu'
|
|
27
29
|
import Cookies from 'js-cookie'
|
|
28
30
|
import { getMenus } from '../../../../utils/permissionAuth'
|
|
29
31
|
export default {
|
|
@@ -31,6 +33,16 @@ export default {
|
|
|
31
33
|
components: {
|
|
32
34
|
SidebarItem
|
|
33
35
|
},
|
|
36
|
+
props: {
|
|
37
|
+
systemCode: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: null
|
|
40
|
+
},
|
|
41
|
+
collapse: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false
|
|
44
|
+
}
|
|
45
|
+
},
|
|
34
46
|
data() {
|
|
35
47
|
let systemName
|
|
36
48
|
if (isShowSystemMenu() === true) {
|
|
@@ -53,7 +65,10 @@ export default {
|
|
|
53
65
|
'sidebar'
|
|
54
66
|
]),
|
|
55
67
|
isCollapse() {
|
|
56
|
-
|
|
68
|
+
if (this.collapse === false) {
|
|
69
|
+
return !this.sidebar.opened
|
|
70
|
+
}
|
|
71
|
+
return true
|
|
57
72
|
}
|
|
58
73
|
},
|
|
59
74
|
watch: {
|
|
@@ -77,13 +92,22 @@ export default {
|
|
|
77
92
|
// 跳转到第一个页面
|
|
78
93
|
if (this.firstLeafMenu.pageType && this.firstLeafMenu.pageType === 'iframe') {
|
|
79
94
|
const iframeSrc = this.firstLeafMenu.fullPath
|
|
80
|
-
this.$router.push({ path: '/iframe-page/page', query: { src: iframeSrc }})
|
|
95
|
+
// this.$router.push({ path: '/iframe-page/page', query: { src: iframeSrc }})
|
|
96
|
+
const query = { src: iframeSrc, customSystem: this.systemCode, _menuCode: this.firstLeafMenu.code, _menuName: getI18nName(this.firstLeafMenu) }
|
|
97
|
+
this.addTabs(query, this.$store.state.tabContent.openTab, '/iframe-page/page', '/iframe-page/page')
|
|
98
|
+
// this.$router.push({ path: '/iframe-page/page', query: query })
|
|
99
|
+
this.$router.push({ path: '/tab-content-iframe-index', query: query })
|
|
81
100
|
} else {
|
|
82
|
-
this
|
|
101
|
+
const query = { customSystem: this.systemCode, _menuCode: this.firstLeafMenu.code, _menuName: getI18nName(this.firstLeafMenu) }
|
|
102
|
+
const path = this.firstLeafMenu.fullPath
|
|
103
|
+
this.addTabs(query, this.$store.state.tabContent.openTab, path, path)
|
|
104
|
+
this.$router.push({ path: '/tab-content-index', query: query })
|
|
105
|
+
// this.$router.push({ path: this.firstLeafMenu.fullPath })
|
|
83
106
|
}
|
|
84
107
|
}
|
|
85
108
|
},
|
|
86
109
|
methods: {
|
|
110
|
+
...tabJs,
|
|
87
111
|
toggleSideBar() {
|
|
88
112
|
this.$store.dispatch('toggleSidebar')
|
|
89
113
|
},
|
|
@@ -102,31 +126,42 @@ export default {
|
|
|
102
126
|
break
|
|
103
127
|
}
|
|
104
128
|
}
|
|
105
|
-
if (!shouldSelectMenu) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
129
|
+
// if (!shouldSelectMenu) {
|
|
130
|
+
// // 如果没有获得默认选中的菜单,则默认选中第一个菜单
|
|
131
|
+
// shouldSelectMenu = this.getSelectMenuWithFirstMenu(menus[0])
|
|
132
|
+
// }
|
|
109
133
|
return shouldSelectMenu
|
|
110
134
|
}
|
|
111
135
|
},
|
|
112
136
|
getShouldSelectMenu(menu) {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
let currentRoute = this.$route.path
|
|
116
|
-
if (cookieMenu && cookieMenu.indexOf('~~') > 0) {
|
|
117
|
-
// cookie中记录了选中的菜单路径
|
|
118
|
-
const path = cookieMenu.substring(0, cookieMenu.lastIndexOf('~~'))
|
|
119
|
-
currentRoute = path
|
|
120
|
-
}
|
|
137
|
+
const currentMenuCode = this.$route.query ? this.$route.query._menuCode : null
|
|
138
|
+
if (menu && currentMenuCode) {
|
|
121
139
|
let shouldSelectMenu
|
|
122
140
|
const children = menu.children
|
|
123
141
|
if (children && children.length > 0) {
|
|
124
142
|
shouldSelectMenu = this.getFirstMenu(children)
|
|
125
|
-
} else if (menu.
|
|
143
|
+
} else if (menu.code && menu.code === currentMenuCode) {
|
|
126
144
|
shouldSelectMenu = menu
|
|
127
145
|
}
|
|
128
146
|
return shouldSelectMenu
|
|
129
147
|
}
|
|
148
|
+
// if (menu) {
|
|
149
|
+
// const cookieMenu = Cookies.get('selectMenu')
|
|
150
|
+
// let currentRoute = this.$route.path
|
|
151
|
+
// if (cookieMenu && cookieMenu.indexOf('~~') > 0) {
|
|
152
|
+
// // cookie中记录了选中的菜单路径
|
|
153
|
+
// const path = cookieMenu.substring(0, cookieMenu.lastIndexOf('~~'))
|
|
154
|
+
// currentRoute = path
|
|
155
|
+
// }
|
|
156
|
+
// let shouldSelectMenu
|
|
157
|
+
// const children = menu.children
|
|
158
|
+
// if (children && children.length > 0) {
|
|
159
|
+
// shouldSelectMenu = this.getFirstMenu(children)
|
|
160
|
+
// } else if (menu.fullPath && menu.fullPath === currentRoute) {
|
|
161
|
+
// shouldSelectMenu = menu
|
|
162
|
+
// }
|
|
163
|
+
// return shouldSelectMenu
|
|
164
|
+
// }
|
|
130
165
|
},
|
|
131
166
|
getSelectMenuWithFirstMenu(menu) {
|
|
132
167
|
if (menu) {
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-tabs v-if="openTab && openTab.length > 0" v-model="activeIndex" class="nav-tab menu-tab-container" closable @tab-remove="closeSelectedTag">
|
|
4
|
+
<el-tab-pane v-for="tag in openTab" :key="tag.code" :label="tag.name" :name="tag.code">
|
|
5
|
+
<iframe ref="tabMainContent" :src="getFullPath(tag)" class="tab-main-content" name="tab-main-content" frameborder="0" />
|
|
6
|
+
</el-tab-pane>
|
|
7
|
+
</el-tabs>
|
|
8
|
+
<div class="default-page-tip">
|
|
9
|
+
<div class="default-page-tip-msg">
|
|
10
|
+
<div class="default-page-tip-item">
|
|
11
|
+
{{ defaultPageTipCn }}
|
|
12
|
+
</div>
|
|
13
|
+
<div class="default-page-tip-item">
|
|
14
|
+
{{ defaultPageTipEn }}
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
21
|
+
iframe.tab-main-content{
|
|
22
|
+
width: 100%;
|
|
23
|
+
height: calc(100vh - 53px);
|
|
24
|
+
}
|
|
25
|
+
</style>
|
|
26
|
+
<script>
|
|
27
|
+
import Vue from 'vue'
|
|
28
|
+
import { mapGetters } from 'vuex'
|
|
29
|
+
export default {
|
|
30
|
+
name: 'TabContent',
|
|
31
|
+
data() {
|
|
32
|
+
let defaultPageTip = Vue.prototype.defaultPageTip
|
|
33
|
+
if (!defaultPageTip) {
|
|
34
|
+
defaultPageTip = '欢迎访问质量管理系统/Welcome to Quality Management System'
|
|
35
|
+
}
|
|
36
|
+
let defaultPageTipCn = defaultPageTip
|
|
37
|
+
let defaultPageTipEn
|
|
38
|
+
if (defaultPageTip && defaultPageTip.indexOf('/') > 0) {
|
|
39
|
+
defaultPageTipCn = defaultPageTip.substring(0, defaultPageTip.lastIndexOf('/'))
|
|
40
|
+
defaultPageTipEn = defaultPageTip.substring(defaultPageTip.lastIndexOf('/') + 1)
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
defaultPageTipCn,
|
|
44
|
+
defaultPageTipEn
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
computed: {
|
|
48
|
+
...mapGetters([
|
|
49
|
+
'openTab'
|
|
50
|
+
]),
|
|
51
|
+
activeIndex: {
|
|
52
|
+
get() {
|
|
53
|
+
return this.$store.state.tabContent.activeIndex
|
|
54
|
+
},
|
|
55
|
+
set(val) {
|
|
56
|
+
this.$store.commit('set_active_index', val)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
created() {
|
|
61
|
+
// 登录超时,给父iframe发送信号
|
|
62
|
+
window.addEventListener('message', this.recieveMessage)
|
|
63
|
+
},
|
|
64
|
+
methods: {
|
|
65
|
+
closeSelectedTag(tagName) {
|
|
66
|
+
const index = this.$store.state.tabContent.openTab.findIndex((item) => item.code === tagName)
|
|
67
|
+
const view = this.$store.state.tabContent.openTab[index]
|
|
68
|
+
this.$store.commit('delete_tabs', view)
|
|
69
|
+
if (tagName === this.activeIndex) {
|
|
70
|
+
// 表示删除的是当前选中的菜单,选中前面的菜单
|
|
71
|
+
this.toLastView(this.$store.state.tabContent.openTab, index > 0 ? (index - 1) : 0)
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
toLastView(visitedViews, lastIndex) {
|
|
75
|
+
if (visitedViews && visitedViews.length > 0 && visitedViews.length > lastIndex) {
|
|
76
|
+
const latestView = visitedViews[lastIndex]
|
|
77
|
+
if (latestView) {
|
|
78
|
+
this.$store.commit('set_active_index', latestView.code)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
getFullPath(tag) {
|
|
83
|
+
let path
|
|
84
|
+
if (tag.routePath === '/iframe-page/page') {
|
|
85
|
+
// 表示是iframe页面
|
|
86
|
+
let src
|
|
87
|
+
let params = ''
|
|
88
|
+
if (tag.routeQuery) {
|
|
89
|
+
for (const key in tag.routeQuery) {
|
|
90
|
+
if (key === 'src') {
|
|
91
|
+
src = tag.routeQuery[key]
|
|
92
|
+
} else {
|
|
93
|
+
params += key + '=' + tag.routeQuery[key] + '&'
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (src) {
|
|
98
|
+
path = src
|
|
99
|
+
}
|
|
100
|
+
if (params) {
|
|
101
|
+
path += '?' + params
|
|
102
|
+
}
|
|
103
|
+
} else {
|
|
104
|
+
// 表示页面跳转
|
|
105
|
+
path = '#' + tag.routePath + '?'
|
|
106
|
+
if (tag.routeQuery) {
|
|
107
|
+
for (const key in tag.routeQuery) {
|
|
108
|
+
path += key + '=' + tag.routeQuery[key] + '&'
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (path && path.length > 0 && path.lastIndexOf('&') === path.length - 1) {
|
|
113
|
+
path = path.substring(0, path.lastIndexOf('&'))
|
|
114
|
+
}
|
|
115
|
+
return path
|
|
116
|
+
},
|
|
117
|
+
recieveMessage(event) {
|
|
118
|
+
if (event && typeof event.data === 'string' && event.data.indexOf('loginTimeout') >= 0) {
|
|
119
|
+
// 表示iframe中的页面发送了登录超时的信号,将信号传给最外层window
|
|
120
|
+
console.log('tab-content-接收到登录超时的信息---event.data=', event.data)
|
|
121
|
+
window.parent.postMessage(event.data, '*')
|
|
122
|
+
} else if (event && typeof event.data === 'string' && event.data === 'return-to-system-list') {
|
|
123
|
+
// 表示系统元数据/设计页面点击了“返回“按钮,需要返回到系统九宫格列表页面
|
|
124
|
+
this.$store.commit('clear_tabs')
|
|
125
|
+
this.$router.push({ path: '/mms/systems/list' })
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
</script>
|
|
131
|
+
|
|
132
|
+
<style>
|
|
133
|
+
.nav-tab {
|
|
134
|
+
padding-top: 5px;
|
|
135
|
+
padding-left: 5px;
|
|
136
|
+
}
|
|
137
|
+
.nav-tab .el-tabs__header{
|
|
138
|
+
margin: 0;
|
|
139
|
+
/* border-bottom: 0px; */
|
|
140
|
+
}
|
|
141
|
+
.menu-tab-container .el-tabs__content{
|
|
142
|
+
padding: 0;
|
|
143
|
+
}
|
|
144
|
+
.default-page-tip {
|
|
145
|
+
width: 100%;
|
|
146
|
+
height: 100%;
|
|
147
|
+
background: #f7f7f8;
|
|
148
|
+
}
|
|
149
|
+
.default-page-tip-msg {
|
|
150
|
+
padding-top: 25%;
|
|
151
|
+
padding-bottom: 30%;
|
|
152
|
+
font-size: 24px;
|
|
153
|
+
font-weight: 600;
|
|
154
|
+
text-align: center;
|
|
155
|
+
color: gray;
|
|
156
|
+
}
|
|
157
|
+
.default-page-tip-item {
|
|
158
|
+
padding-top: 10px;
|
|
159
|
+
}
|
|
160
|
+
</style>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<iframe v-if="src && src!== null" ref="menuContent" :src="src" name="menu-content" title="Main content" frameborder="0" />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
export default {
|
|
9
|
+
data() {
|
|
10
|
+
return {
|
|
11
|
+
src: null
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
watch: {
|
|
15
|
+
$route(to, from) {
|
|
16
|
+
// 必须这样写,否则会在切换页面时无法获得pageCode参数
|
|
17
|
+
this.src = this.$route.query.src
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
mounted() {
|
|
21
|
+
this.src = this.$route.query.src
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<style lang="scss" scoped>
|
|
27
|
+
iframe{
|
|
28
|
+
width: 100%;
|
|
29
|
+
height: calc(100vh - 50px);
|
|
30
|
+
}
|
|
31
|
+
</style>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="classObj" class="app-wrapper">
|
|
3
|
+
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside" />
|
|
4
|
+
<menubar :system-code="systemCode" :collapse="true" class="sidebar-container" />
|
|
5
|
+
<div class="main-container">
|
|
6
|
+
<breadcrumb v-if="showMenuRoute" />
|
|
7
|
+
<tab-content />
|
|
8
|
+
<!-- <app-main /> -->
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
import { Menubar, Breadcrumb } from './components'
|
|
15
|
+
import ResizeMixin from './mixin/ResizeHandler'
|
|
16
|
+
import { isShowMenuRoute } from 'imatrix-ui/src/utils/common-util'
|
|
17
|
+
import TabContent from './components/tabs/tab-content'
|
|
18
|
+
import Vue from 'vue'
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
name: 'Layout',
|
|
22
|
+
components: {
|
|
23
|
+
Menubar,
|
|
24
|
+
Breadcrumb,
|
|
25
|
+
TabContent
|
|
26
|
+
},
|
|
27
|
+
mixins: [ResizeMixin],
|
|
28
|
+
data() {
|
|
29
|
+
// 是否显示菜单路径,默认是不显示
|
|
30
|
+
const showMenuRoute = isShowMenuRoute()
|
|
31
|
+
return {
|
|
32
|
+
showMenuRoute,
|
|
33
|
+
systemCode: null
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
computed: {
|
|
37
|
+
sidebar() {
|
|
38
|
+
return this.$store.state.app.sidebar
|
|
39
|
+
},
|
|
40
|
+
device() {
|
|
41
|
+
return this.$store.state.app.device
|
|
42
|
+
},
|
|
43
|
+
classObj() {
|
|
44
|
+
return {
|
|
45
|
+
hideSidebar: !this.sidebar.opened,
|
|
46
|
+
openSidebar: this.sidebar.opened,
|
|
47
|
+
withoutAnimation: this.sidebar.withoutAnimation,
|
|
48
|
+
mobile: this.device === 'mobile'
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
created() {
|
|
53
|
+
this.systemCode = Vue.prototype.customSystem
|
|
54
|
+
console.log('新菜单组件-----systemCode====', this.systemCode)
|
|
55
|
+
},
|
|
56
|
+
methods: {
|
|
57
|
+
handleClickOutside() {
|
|
58
|
+
this.$store.dispatch('closeSidebar', { withoutAnimation: false })
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
65
|
+
@import "imatrix-ui/src/styles/mixin.scss";
|
|
66
|
+
.app-wrapper {
|
|
67
|
+
@include clearfix;
|
|
68
|
+
position: relative;
|
|
69
|
+
height: 100%;
|
|
70
|
+
width: 100%;
|
|
71
|
+
&.mobile.openSidebar{
|
|
72
|
+
position: fixed;
|
|
73
|
+
top: 0;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
.drawer-bg {
|
|
77
|
+
background: #000;
|
|
78
|
+
opacity: 0.3;
|
|
79
|
+
width: 100%;
|
|
80
|
+
top: 0;
|
|
81
|
+
height: 100%;
|
|
82
|
+
position: absolute;
|
|
83
|
+
z-index: 999;
|
|
84
|
+
}
|
|
85
|
+
</style>
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-breadcrumb class="app-breadcrumb" separator="/">
|
|
3
|
-
<transition-group name="breadcrumb">
|
|
4
|
-
<el-breadcrumb-item v-for="(item,index) in levelListWithTitle" :key="item.path">
|
|
5
|
-
<span v-if="item.redirect==='noredirect'||index==levelList.length-1" class="no-redirect">
|
|
6
|
-
{{ item.meta.title }}
|
|
7
|
-
</span>
|
|
8
|
-
<router-link v-else :to="item.redirect||item.path">
|
|
9
|
-
{{ item.meta.title }}
|
|
10
|
-
</router-link>
|
|
11
|
-
</el-breadcrumb-item>
|
|
12
|
-
</transition-group>
|
|
13
|
-
</el-breadcrumb>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script>
|
|
17
|
-
import pathToRegexp from 'path-to-regexp'
|
|
18
|
-
|
|
19
|
-
export default {
|
|
20
|
-
name: 'Breadcrumb',
|
|
21
|
-
data() {
|
|
22
|
-
return {
|
|
23
|
-
levelList: null
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
computed: {
|
|
27
|
-
levelListWithTitle() {
|
|
28
|
-
return this.levelList.filter(item => item.meta.title !== undefined && item.meta.title !== null)
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
watch: {
|
|
32
|
-
$route() {
|
|
33
|
-
this.getBreadcrumb()
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
created() {
|
|
37
|
-
this.getBreadcrumb()
|
|
38
|
-
},
|
|
39
|
-
methods: {
|
|
40
|
-
getBreadcrumb() {
|
|
41
|
-
const { params } = this.$route
|
|
42
|
-
let matched = this.$route.matched.filter(item => {
|
|
43
|
-
if (item.name) {
|
|
44
|
-
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
|
|
45
|
-
var toPath = pathToRegexp.compile(item.path)
|
|
46
|
-
item.path = toPath(params)
|
|
47
|
-
return true
|
|
48
|
-
}
|
|
49
|
-
})
|
|
50
|
-
const first = matched[0]
|
|
51
|
-
if (first && first.name !== 'Dashboard') {
|
|
52
|
-
matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched)
|
|
53
|
-
}
|
|
54
|
-
this.levelList = matched
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
</script>
|
|
59
|
-
|
|
60
|
-
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
61
|
-
.app-breadcrumb.el-breadcrumb {
|
|
62
|
-
display: inline-block;
|
|
63
|
-
font-size: 14px;
|
|
64
|
-
line-height: 50px;
|
|
65
|
-
margin-left: 10px;
|
|
66
|
-
.no-redirect {
|
|
67
|
-
color: #97a8be;
|
|
68
|
-
cursor: text;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
</style>
|