@lambo-design/pro-layout 1.0.0-beta.48 → 1.0.0-beta.480

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.
Files changed (41) hide show
  1. package/package.json +11 -4
  2. package/src/components/pro-layout-header/index.vue +224 -0
  3. package/src/components/pro-layout-header/pro-layout-logo/index.vue +206 -0
  4. package/src/components/pro-layout-header/pro-layout-nav/components/pro-layout-nav-slide-menu.vue +398 -0
  5. package/src/components/pro-layout-header/pro-layout-nav/index-slide.vue +226 -0
  6. package/src/components/pro-layout-header/pro-layout-nav/index.vue +564 -0
  7. package/src/components/pro-layout-header/pro-layout-slogan/index.vue +40 -0
  8. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-collect.vue +79 -0
  9. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-document.vue +116 -0
  10. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-fullscreen.vue +144 -0
  11. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-icons.vue +104 -0
  12. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-intl.vue +111 -0
  13. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-notice.vue +133 -0
  14. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-search.vue +305 -0
  15. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-todo.vue +145 -0
  16. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-quick-todoCenter.vue +177 -0
  17. package/src/components/pro-layout-header/pro-layout-tools/components/pro-layout-tools-user.vue +86 -0
  18. package/src/components/pro-layout-header/pro-layout-tools/index.vue +32 -0
  19. package/src/components/pro-layout-header/pro-layout-trigger/index.vue +84 -0
  20. package/src/components/{pro-layout-sider-collapsed-menu.vue → pro-layout-sider/components/pro-layout-sider-collapsed-menu.vue} +30 -11
  21. package/src/components/{pro-layout-sider-icon.vue → pro-layout-sider/components/pro-layout-sider-icon.vue} +2 -2
  22. package/src/components/pro-layout-sider/components/pro-layout-sider-menu-item.vue +139 -0
  23. package/src/components/pro-layout-sider/components/pro-layout-sider-other-menu.vue +140 -0
  24. package/src/components/pro-layout-sider/components/pro-layout-sider-search.vue +345 -0
  25. package/src/components/pro-layout-sider/index.vue +485 -0
  26. package/src/components/{pro-layout-tabs.vue → pro-layout-tabs/index.vue} +121 -23
  27. package/src/index.vue +366 -44
  28. package/src/styles/color.less +267 -0
  29. package/src/styles/images/xiaoxitongzhi.png +0 -0
  30. package/src/styles/other-menu.less +63 -111
  31. package/src/utils/menuItem.js +10 -0
  32. package/src/utils/sider.js +16 -1
  33. package/src/components/pro-layout-header.vue +0 -52
  34. package/src/components/pro-layout-logo.vue +0 -79
  35. package/src/components/pro-layout-nav.vue +0 -150
  36. package/src/components/pro-layout-other-menu.vue +0 -137
  37. package/src/components/pro-layout-sider-menu-item.vue +0 -37
  38. package/src/components/pro-layout-sider.vue +0 -240
  39. package/src/components/pro-layout-tools-user.vue +0 -84
  40. package/src/components/pro-layout-tools.vue +0 -21
  41. package/src/components/pro-layout-trigger.vue +0 -48
@@ -1,11 +1,11 @@
1
1
  <template>
2
- <div class="pro-layout-tabs-wrapper">
2
+ <div class="pro-layout-tabs-wrapper" :class="tabsHeight != 46 ? 'custom-tabs' : ''">
3
3
  <div class="close-con">
4
4
  <Dropdown transfer @on-click="handleTagsOption">
5
5
  <Icon :size="24" type="ios-close-circle-outline" class="btn-close"/>
6
6
  <DropdownMenu slot="list">
7
- <DropdownItem name="close-all">关闭所有</DropdownItem>
8
- <DropdownItem name="close-others">关闭其他</DropdownItem>
7
+ <DropdownItem name="close-all">{{ t('pro-layout.tabs.close-all') }}</DropdownItem>
8
+ <DropdownItem name="close-others">{{ t('pro-layout.tabs.close-others') }}</DropdownItem>
9
9
  </DropdownMenu>
10
10
  </Dropdown>
11
11
  </div>
@@ -46,15 +46,19 @@ import {
46
46
  getPreviousTagIndex,
47
47
  getDelTagIndex,
48
48
  setTagNavListInLocalstorage,
49
- showTitle
49
+ setTagNavListInSessionstorage,
50
+ showTitle, getRootPermission, getTagNavListKey
50
51
  } from '@lambo-design/shared/utils/platform'
51
52
  import beforeClose from '@lambo-design/shared/utils/menu/before-close'
52
53
  import Bus from "@lambo-design/shared/utils/bus";
53
54
  import config from "@lambo-design/shared/config/config";
54
55
  import {deepCopy} from "@lambo-design/shared/utils/assist";
56
+ import {getThemeVarByKey} from "@lambo-design/shared/utils/theme";
57
+ import Locale from "@lambo-design/core/src/mixins/locale";
55
58
 
56
59
  export default {
57
60
  name: 'pro-layout-tabs',
61
+ mixins: [Locale],
58
62
  data() {
59
63
  return {
60
64
  systemInfo: {},
@@ -72,9 +76,16 @@ export default {
72
76
  contextMenuTop: 0,
73
77
  visible: false,
74
78
  menuList: {
75
- others: '关闭其他',
76
- all: '关闭所有'
77
- }
79
+ others: this.t('pro-layout.tabs.close-others'),
80
+ all: this.t('pro-layout.tabs.close-all')
81
+ },
82
+ tabsHeight: 46
83
+ }
84
+ },
85
+ props: {
86
+ notSingleApp: {
87
+ type: Boolean,
88
+ default: true
78
89
  }
79
90
  },
80
91
  methods: {
@@ -124,7 +135,8 @@ export default {
124
135
  let index = getDelTagIndex(data,current);
125
136
  data.splice(index,1);
126
137
  }
127
- setTagNavListInLocalstorage(data, config.routerBase + '-tagNavList');
138
+ // setTagNavListInLocalstorage(data, config.routerBase + '-tagNavList');
139
+ setTagNavListInSessionstorage(data, getTagNavListKey());
128
140
  this.tagList = data;
129
141
  if (current !== this.value) {
130
142
  this.value = current;
@@ -138,8 +150,34 @@ export default {
138
150
  }, 200)
139
151
  },
140
152
  changeApp(appId,appInfo){
153
+ let oldAppId = this.appId
154
+ let oldAppInfo = this.appInfo
141
155
  this.appId = appId;
142
156
  this.appInfo = appInfo;
157
+ if(oldAppId !== appId && oldAppInfo && this.appInfo){
158
+ let oldAppConfig = {}
159
+ if(oldAppInfo.extendProps){
160
+ oldAppConfig = oldAppInfo.extendProps
161
+ }
162
+ if(oldAppInfo.setting){
163
+ oldAppConfig = JSON.parse(oldAppInfo.setting)
164
+ }
165
+ let newAppConfig = {}
166
+ if(this.appInfo.extendProps){
167
+ newAppConfig = this.appInfo.extendProps
168
+ }
169
+ if(this.appInfo.setting){
170
+ newAppConfig = JSON.parse(this.appInfo.setting)
171
+ }
172
+ if(oldAppConfig && oldAppConfig.hasOwnProperty('is_hide_left_menu')
173
+ && oldAppConfig.is_hide_left_menu === '1' && oldAppConfig.homePagePath){
174
+ let removeTag = this.tagList.filter(item => item.meta.appId === oldAppInfo.appId)
175
+ //this.handleClose(removeTag[0],true)
176
+ for (let oneTag of removeTag) {
177
+ this.handleClose(oneTag,true)
178
+ }
179
+ }
180
+ }
143
181
  },
144
182
  emitTags(data,current){
145
183
  Bus.$emit('tag-list',data,current);
@@ -183,20 +221,22 @@ export default {
183
221
  }, 100)
184
222
  }
185
223
  },
186
- handleClose(current) {
224
+ handleClose(current,isHomePage) {
187
225
  if (current.meta && current.meta.beforeCloseName && current.meta.beforeCloseName in beforeClose) {
188
226
  new Promise(beforeClose[current.meta.beforeCloseName]).then(close => {
189
227
  if (close) {
190
- this.close(current)
228
+ this.close(current,isHomePage)
191
229
  }
192
230
  })
193
231
  } else {
194
- this.close(current)
232
+ this.close(current,isHomePage)
195
233
  }
196
234
  },
197
- close(route) {
235
+ close(route,isHomePage) {
198
236
  let value = this.value;
199
- if (route.name == this.value) {
237
+ if (isHomePage) {
238
+ value = config.homeRouter.name;
239
+ } else if (route.name == this.value) {
200
240
  let preTagIndex = getPreviousTagIndex(this.tagList, this.value)
201
241
  value = this.tagList[preTagIndex].name;
202
242
  }
@@ -204,18 +244,33 @@ export default {
204
244
  this.emitTags(res, value);
205
245
  },
206
246
  handleClick(item) {
207
- this.value = item.name
208
- Bus.$emit('menu-click', item.name , item)
209
- if (item.meta && item.meta.appId
210
- && item.meta.appId != this.appId
211
- && item.meta.appId != config.homeRouter.meta.appId) {
212
- let appInfo = this.navList.filter(app => app.appId === item.meta.appId);
213
- if (appInfo && appInfo.length > 0) {
214
- Bus.$emit('change-app', {appId:appInfo[0].appId,appInfo:appInfo[0]})
215
- } else {
216
- Bus.$emit('change-app', {appId:item.meta.appId,appInfo:null})
247
+ if (item.meta && item.meta.appId && item.meta.appId != config.homeRouter.meta.appId) {
248
+ let appIdInner = item.meta.appId;
249
+ if (!this.notSingleApp) {
250
+ // 如果是单应用模式,根据permissionId找到最上层目录(即导航栏中的应用)的permissionId
251
+ const permissionList = this.$store.getters.getOriginalPermissionList;
252
+ if (permissionList && permissionList.length > 0) {
253
+ const permission = {
254
+ pid: item.pid,
255
+ appId: item.meta ? item.meta.appId : item.appId
256
+ }
257
+ const rootPermission = getRootPermission(permissionList, permission);
258
+ if (rootPermission && rootPermission.permissionId) {
259
+ appIdInner = rootPermission.permissionId
260
+ }
261
+ }
262
+ }
263
+ if (appIdInner != this.appId) {
264
+ let appInfo = this.navList.filter(app => app.appId === appIdInner);
265
+ if (appInfo && appInfo.length > 0) {
266
+ Bus.$emit('change-app', {appId: appInfo[0].appId, appInfo: appInfo[0]})
267
+ } else {
268
+ Bus.$emit('change-app', {appId: appIdInner, appInfo: null})
269
+ }
217
270
  }
218
271
  }
272
+ this.value = item.name
273
+ Bus.$emit('menu-click', item.name , item);
219
274
  },
220
275
  showTitleInside(item) {
221
276
  return showTitle(item, this)
@@ -261,6 +316,13 @@ export default {
261
316
  },
262
317
  closeMenu() {
263
318
  this.visible = false
319
+ },
320
+ loadingCustomStyle(){
321
+ let themeKey = localStorage.getItem("theme") ? localStorage.getItem("theme") : "default"
322
+ let tabsHeight = getThemeVarByKey(themeKey,'--layout-tabs-height');
323
+ if (tabsHeight) {
324
+ this.tabsHeight = tabsHeight;
325
+ }
264
326
  }
265
327
  },
266
328
  watch: {
@@ -276,6 +338,7 @@ export default {
276
338
  setTimeout(() => {
277
339
  this.getTagElementByRoute(this.value)
278
340
  }, 200)
341
+ this.loadingCustomStyle();
279
342
  },
280
343
  created(){
281
344
  this.initListener();
@@ -400,5 +463,40 @@ export default {
400
463
  background-color: var(--primary-color,@_primary-color)
401
464
  }
402
465
  }
466
+ &.custom-tabs{
467
+ height: 36px;
468
+ line-height: 30px;
469
+ .close-con{
470
+ .btn-close{
471
+ margin-top: 5px;
472
+ }
473
+ }
474
+ .btn-con{
475
+ padding: 5px 0px;
476
+ }
477
+ .scroll-outer{
478
+ left: 8px;
479
+ right: 51px;
480
+ .scroll-body{
481
+ /deep/.ivu-tag-dot{
482
+ height: 28px;
483
+ line-height: 28px;
484
+ padding: 0 8px;
485
+ .ivu-tag-dot-inner{
486
+ width: 10px;
487
+ height: 10px;
488
+ margin-right: 2px;
489
+ top: 1px;
490
+ }
491
+ }
492
+ /deep/.ivu-tag{
493
+ .ivu-icon-ios-close{
494
+ margin-left: 0px !important;
495
+ top: 0px;
496
+ }
497
+ }
498
+ }
499
+ }
500
+ }
403
501
  }
404
502
  </style>