imatrix-ui 2.8.2-dw → 2.8.2

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.
@@ -3,14 +3,14 @@
3
3
  <template v-if="!item.children || item.children.lenght === 0">
4
4
  <app-link :to="toPath(item)" @click.native="clickMenu(toPath(item))">
5
5
  <el-menu-item :index="resolvePath(item.code,item.path,item.pageType)" :class="{'submenu-title-noDropdown':!isNest}">
6
- <item :icon="item.iconName" :title="item.i18nValue" :is-root="true" />
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
- <el-submenu v-else :index="resolvePath(item.code,item.path,item.pageType)" popper-class="sidebar-container-popper">
11
+ <el-submenu v-else :index="resolvePath(item.code,item.path,item.pageType)" :show-timeout="0" :hide-timeout="50" popper-class="sidebar-container-popper">
12
12
  <template slot="title">
13
- <item :icon="item.iconName" :title="item.i18nValue" :has-children="item.children.length > 0?true:false" />
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">
@@ -23,7 +23,7 @@
23
23
  />
24
24
  <app-link v-else :key="child.code" :to="toPath(child)" @click.native="clickMenu(toPath(child))">
25
25
  <el-menu-item :index="resolvePath(child.code,child.path,child.pageType)">
26
- <item :icon="child.iconName" :title="child.i18nValue" />
26
+ <item :icon="child.iconName" :title="getI18nName(child)" />
27
27
  </el-menu-item>
28
28
  </app-link>
29
29
  </template>
@@ -37,6 +37,7 @@ import Item from './Item'
37
37
  import AppLink from './Link'
38
38
  import Vue from 'vue'
39
39
  import tabJs from '../../../api/tab'
40
+ import { getI18nName } from '../../../utils/menu'
40
41
  export default {
41
42
  name: 'SidebarItem',
42
43
  components: { Item, AppLink },
@@ -90,23 +91,17 @@ export default {
90
91
  toPath(menu) {
91
92
  const toPathObj = {}
92
93
  const routePath = menu.path
94
+ toPathObj.openWay = menu.openWay
93
95
  if (this.isExternalLink(menu.pageType)) {
94
96
  toPathObj.path = '/dsc-index/iframe-page'
95
97
  toPathObj.tabPath = '/dsc/iframe-page'
96
98
  toPathObj.query = {}
97
99
  toPathObj.query.src = routePath
98
100
  toPathObj.isExternal = true
99
- if (!this.isHasCustomSystem(routePath)) {
100
- // 如果路径中没有拼系统编码,才需要把系统编码放到参数中
101
- toPathObj.query.customSystem = Vue.prototype.customSystem
102
- }
103
-
101
+ // 如果路径中没有拼系统编码,才需要把系统编码放到参数中
102
+ toPathObj.query.customSystem = Vue.prototype.customSystem
104
103
  toPathObj.query._menuCode = menu.code
105
- if (menu.i18nValue) {
106
- toPathObj.query._menuName = menu.i18nValue
107
- } else {
108
- toPathObj.query._menuName = menu.name
109
- }
104
+ toPathObj.query._menuName = getI18nName(menu)
110
105
  } else {
111
106
  const pageCode = routePath
112
107
  toPathObj.path = '/dsc-index/page'
@@ -115,11 +110,7 @@ export default {
115
110
  toPathObj.query.pageCode = pageCode
116
111
  toPathObj.query.customSystem = Vue.prototype.customSystem
117
112
  toPathObj.query._menuCode = menu.code
118
- if (menu.i18nValue) {
119
- toPathObj.query._menuName = menu.i18nValue
120
- } else {
121
- toPathObj.query._menuName = menu.name
122
- }
113
+ toPathObj.query._menuName = getI18nName(menu)
123
114
  }
124
115
  return toPathObj
125
116
  },
@@ -139,14 +130,38 @@ export default {
139
130
  return false
140
131
  },
141
132
  clickMenu(toPathObj) {
142
- console.log('clickMenu----toPathObj=', toPathObj)
143
- this.addTabs(toPathObj.query, this.$store.state.tabContent.openTab, toPathObj.tabPath)
133
+ // console.log('clickMenu----toPathObj=', toPathObj)
134
+ if (toPathObj.openWay && toPathObj.openWay === 'NEW_PAGE_OPEN' && toPathObj.query) {
135
+ // 新页签打开菜单
136
+ let url = toPathObj.query.src
137
+ if (url && url.indexOf('?') > 0) {
138
+ url += '&'
139
+ } else {
140
+ url += '?'
141
+ }
142
+ if (toPathObj.query.customSystem) {
143
+ url += 'customSystem=' + toPathObj.query.customSystem
144
+ }
145
+ if (toPathObj.query._menuCode) {
146
+ url += '_menuCode=' + toPathObj.query._menuCode
147
+ }
148
+ if (toPathObj.query._menuCode) {
149
+ url += '_menuName=' + toPathObj.query._menuName
150
+ }
151
+ window.open(url, toPathObj.query._menuCode)
152
+ } else {
153
+ // 刷新页签打开菜单
154
+ this.addTabs(toPathObj.query, this.$store.state.tabContent.openTab, toPathObj.tabPath)
155
+ }
144
156
  },
145
157
  isExternalLink(pageType) {
146
158
  if (pageType && pageType === 'iframe') {
147
159
  return true
148
160
  }
149
161
  return false
162
+ },
163
+ getI18nName(menu) {
164
+ return getI18nName(menu)
150
165
  }
151
166
  }
152
167
  }
@@ -20,6 +20,8 @@ import { mapGetters } from 'vuex'
20
20
  import SidebarItem from './SidebarItem'
21
21
  import Cookies from 'js-cookie'
22
22
  import tabJs from '../../../api/tab'
23
+ import { getMenus } from '../../../utils/permissionAuth'
24
+ import { getI18nName } from '../../../utils/menu'
23
25
  export default {
24
26
  name: 'Sidebar',
25
27
  components: {
@@ -36,13 +38,14 @@ export default {
36
38
  }
37
39
  },
38
40
  data() {
41
+ const menus = getMenus()
39
42
  return {
43
+ menus
40
44
  }
41
45
  },
42
46
  computed: {
43
47
  ...mapGetters([
44
- 'sidebar',
45
- 'menus'
48
+ 'sidebar'
46
49
  ]),
47
50
  isCollapse() {
48
51
  if (this.collapse === false) {
@@ -57,10 +60,13 @@ export default {
57
60
  // 跳转到第一个页面
58
61
  if (this.firstLeafMenu.pageType && this.firstLeafMenu.pageType === 'iframe') {
59
62
  const iframeSrc = this.firstLeafMenu.fullPath
60
- this.$router.push({ path: '/dsc-index/iframe-page', query: { src: iframeSrc }})
63
+ const pageCode = this.firstLeafMenu.path
64
+ const query = { src: iframeSrc, customSystem: this.systemCode, pageCode: pageCode, _menuCode: this.firstLeafMenu.code, _menuName: getI18nName(this.firstLeafMenu) }
65
+ this.addTabs(query, this.$store.state.tabContent.openTab, '/dsc/iframe-page', '/dsc/iframe-page')
66
+ this.$router.push({ path: '/dsc-index/iframe-page', query: query })
61
67
  } else {
62
68
  const pageCode = this.firstLeafMenu.path
63
- const query = { customSystem: this.systemCode, pageCode: pageCode, _menuCode: this.firstLeafMenu.code, _menuName: this.firstLeafMenu.name }
69
+ const query = { customSystem: this.systemCode, pageCode: pageCode, _menuCode: this.firstLeafMenu.code, _menuName: getI18nName(this.firstLeafMenu) }
64
70
  this.addTabs(query, this.$store.state.tabContent.openTab, '/dsc/page', '/dsc/page')
65
71
  this.$router.push({ path: '/dsc-index/page', query: query })
66
72
  // this.$router.push({ path: this.firstLeafMenu.fullPath })
@@ -83,7 +89,6 @@ export default {
83
89
  this.$store.dispatch('toggleSidebar')
84
90
  },
85
91
  selectMenu(index, indexPath) {
86
- console.log('selectMenu----indexPath=', indexPath, 'index=', index)
87
92
  Cookies.set('selectMenu', index)
88
93
  },
89
94
  getMyFirstMenu(menus) {
@@ -114,7 +119,7 @@ export default {
114
119
  }
115
120
  },
116
121
  getShouldSelectMenu(menu) {
117
- console.log('dsc--getShouldSelectMenu--this.$route=', this.$route)
122
+ // console.log('dsc--getShouldSelectMenu--this.$route=', this.$route)
118
123
  const currentMenuCode = this.$route.query ? this.$route.query._menuCode : null
119
124
  if (menu && currentMenuCode) {
120
125
  let shouldSelectMenu
@@ -162,7 +167,7 @@ export default {
162
167
  },
163
168
  getShouldSelectMenuWithCookie(menu, menuCode) {
164
169
  if (menu) {
165
- console.log('dsc--getShouldSelectMenuWithCookie--this.$route=', this.$route)
170
+ // console.log('dsc--getShouldSelectMenuWithCookie--this.$route=', this.$route)
166
171
  let shouldSelectMenu
167
172
  const children = menu.children
168
173
  if (children && children.length > 0) {
@@ -57,6 +57,10 @@ export default {
57
57
  }
58
58
  }
59
59
  },
60
+ created() {
61
+ // 登录超时,给父iframe发送信号
62
+ window.addEventListener('message', this.recieveMessage)
63
+ },
60
64
  methods: {
61
65
  closeSelectedTag(tagName) {
62
66
  const index = this.$store.state.tabContent.openTab.findIndex((item) => item.code === tagName)
@@ -109,6 +113,13 @@ export default {
109
113
  path = path.substring(0, path.lastIndexOf('&'))
110
114
  }
111
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
+ }
112
123
  }
113
124
  }
114
125
  }
@@ -8,7 +8,7 @@
8
8
  <img class="pic-404__child right" src="../../assets/404/404-cloud.png" alt="404">
9
9
  </div>
10
10
  <div class="bullshit">
11
- <div class="bullshit__oops">
11
+ <!-- <div class="bullshit__oops">
12
12
  OOPS!
13
13
  </div>
14
14
  <div class="bullshit__info">
@@ -16,16 +16,16 @@
16
16
  <a class="link-type" href="https://wallstreetcn.com" target="_blank">
17
17
  华尔街见闻
18
18
  </a>
19
- </div>
19
+ </div> -->
20
20
  <div class="bullshit__headline">
21
21
  {{ message }}
22
22
  </div>
23
23
  <div class="bullshit__info">
24
- 请检查您输入的网址是否正确,请点击以下按钮返回主页或者发送错误报告
24
+ 请检查您输入的网址是否正确
25
25
  </div>
26
- <a href="" class="bullshit__return-home">
26
+ <!-- <a href="" class="bullshit__return-home">
27
27
  返回首页
28
- </a>
28
+ </a> -->
29
29
  </div>
30
30
  </div>
31
31
  </div>
@@ -37,7 +37,7 @@ export default {
37
37
  name: 'Page404',
38
38
  computed: {
39
39
  message() {
40
- return '网管说这个页面你不能进......'
40
+ return '页面不存在'
41
41
  }
42
42
  }
43
43
  }
@@ -25,6 +25,7 @@ import Vue from 'vue'
25
25
  import { getLanguageWithLocale } from '../../../../utils/util'
26
26
  import { isShowSystemMenu } from '../../../../utils/common-util'
27
27
  import Cookies from 'js-cookie'
28
+ import { getMenus } from '../../../../utils/permissionAuth'
28
29
  export default {
29
30
  name: 'Menubar',
30
31
  components: {
@@ -39,16 +40,17 @@ export default {
39
40
  systemName = systemNameObj[language]
40
41
  }
41
42
  }
43
+ const menus = getMenus()
42
44
  return {
43
45
  firstLeafMenu: null, // 第一个有权限的叶子菜单,用于默认展开第一个父菜单
44
46
  systemName,
45
- defaultActive: ''
47
+ defaultActive: '',
48
+ menus
46
49
  }
47
50
  },
48
51
  computed: {
49
52
  ...mapGetters([
50
- 'sidebar',
51
- 'menus'
53
+ 'sidebar'
52
54
  ]),
53
55
  isCollapse() {
54
56
  return !this.sidebar.opened
@@ -41,7 +41,7 @@
41
41
  </template>
42
42
 
43
43
  <script>
44
- import { Message } from '@gcommon/gcommon-ui'
44
+ import { Message } from 'element-ui'
45
45
  export default {
46
46
  name: 'Login',
47
47
  data() {