imatrix-ui 2.8.7 → 2.8.8-boe10
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 -5
- package/package.json +2 -2
- package/src/i18n/langs/cn.js +2 -0
- package/src/i18n/langs/en.js +4 -2
- package/src/router/index.js +10 -0
- package/src/store/modules/tab-content.js +6 -0
- package/src/styles/display-layout.scss +34 -0
- package/src/styles/index.scss +103 -5
- 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/button.scss +9 -0
- package/src/styles/theme/dark-blue/card.scss +64 -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/{gray/form-style.scss → dark-blue/form.scss} +12 -2
- package/src/styles/theme/dark-blue/index.scss +255 -0
- package/src/styles/theme/dark-blue/input.scss +15 -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 +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 +5 -0
- package/src/utils/common-util.js +4 -0
- package/src/utils/request.js +13 -0
- 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
|
@@ -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>
|