qj-common 4.3.4 → 4.3.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qj-common",
3
- "version": "4.3.4",
3
+ "version": "4.3.6",
4
4
  "description": "common files && template for qj-paas",
5
5
  "scripts": {
6
6
  "gulp": "gulp css"
@@ -62,7 +62,7 @@ export default {
62
62
  console.log(this.$route.meta.menuCode, "this.$route.meta.menuCode");
63
63
  let menuCode = sessionStorage.getItem('menuCode') ? sessionStorage.getItem('menuCode') : null
64
64
  if (this.$route.path && this.$route.meta) {
65
- if ('title' in this.$route.meta && 'icon' in this.$route.meta && 'menuCode' in this.$route.meta && 'params' in this.$route.meta) {
65
+ if ('title' in this.$route.meta && 'icon' in this.$route.meta && 'menuCode' in this.$route.meta && 'params' in this.$route.meta && this.$store.name !== '首页') {
66
66
  menuCode = sessionStorage.getItem('menuCode') ? sessionStorage.getItem('menuCode') : localStorage.getItem('menuCode') ? localStorage.getItem('menuCode') : null
67
67
 
68
68
  }
@@ -25,8 +25,10 @@
25
25
  <div class="nav-head">
26
26
  <el-popover placement="bottom-end" width="100" trigger="click">
27
27
  <ul class="theme-color-box clearfix">
28
- <li @click="themeClick('bda16f')" :class="[activeColor == 'bda16f' ? 'active' : '']" :style="{ background: '#bda16f' }"></li>
29
- <li @click="themeClick('2c4158')" :class="[activeColor == '2c4158' ? 'active' : '']" :style="{ background: '#2c4158' }"></li>
28
+ <li @click="themeClick('bda16f')" :class="[activeColor == 'bda16f' ? 'active' : '']"
29
+ :style="{ background: '#bda16f' }"></li>
30
+ <li @click="themeClick('2c4158')" :class="[activeColor == '2c4158' ? 'active' : '']"
31
+ :style="{ background: '#2c4158' }"></li>
30
32
  </ul>
31
33
  <!-- <el-button class="theme-box" slot="reference">主题</el-button> -->
32
34
  </el-popover>
@@ -46,12 +48,8 @@
46
48
 
47
49
  <!-- <span class="user_line"></span> -->
48
50
  <!-- <i class="icon-yonghu-outline iconfont"></i> -->
49
- <el-badge
50
- class="msg-icon"
51
- v-if="proappEnvLayout && proappEnvLayout.tenantCode == '2021122100000001'"
52
- is-dot
53
- :hidden='unreadMessageNum==0'
54
- >
51
+ <el-badge class="msg-icon" v-if="proappEnvLayout && proappEnvLayout.tenantCode == '2021122100000001'" is-dot
52
+ :hidden='unreadMessageNum == 0'>
55
53
  <i class="el-icon-bell" @click="jumpToPage"></i>
56
54
  </el-badge>
57
55
  <span class="user-name" @click="lookInfo">
@@ -83,8 +81,8 @@
83
81
  {{ role }}
84
82
  </el-form-item>
85
83
  </el-form>
86
- <!-- <div>联系人:</div> -->
87
- <!-- <img :src="proappRemark[1]" alt=""> -->
84
+ <!-- <div>联系人:</div> -->
85
+ <!-- <img :src="proappRemark[1]" alt=""> -->
88
86
  <!-- <div class="loginInfo-Block-left">
89
87
  <div>登录名:</div>
90
88
  <div>手机号:</div>
@@ -138,10 +136,10 @@ export default {
138
136
  },
139
137
  data() {
140
138
  return {
141
- unreadMessageNum:0,
139
+ unreadMessageNum: 0,
142
140
  activeColor: '2c4158',
143
141
  menuList: '',
144
- menuCode:'',
142
+ menuCode: '',
145
143
  merberCompname: '',
146
144
  centerDialogVisible: false,
147
145
  name: '',
@@ -156,6 +154,7 @@ export default {
156
154
  gapTime: '',
157
155
  beforeUnloadTime: '',
158
156
  secDomainName: null,
157
+ commonShowMenuAction: ''
159
158
  };
160
159
  },
161
160
  computed: {
@@ -171,32 +170,32 @@ export default {
171
170
 
172
171
  console.log(window.location.href, 'window.location.href本地路由');
173
172
  if (window.location.href.indexOf('listDMkf') == -1) {
174
- if(this.proappEnvLayout.tenantCode === '2019071800001392'){ // tenantCode 判断
175
- let userId = sessionStorage.getItem('personalInfo') ? JSON.parse(sessionStorage.getItem('personalInfo')).userId : '';
176
- getUserserviceInfo({
177
- userId: userId,
178
- }).then((res) => {
179
- // console.log(res)
180
- this.name = res.userRelname ? res.userRelname : res.userName;
181
- this.phone = res.userOcode?res.userOcode:res.userPhone;
182
- this.compony = res.userinfoCompname;
183
- this.role = res.userRoleName;
184
- });
185
- }else{
186
- let userId = sessionStorage.getItem('personalInfo') ? JSON.parse(sessionStorage.getItem('personalInfo')).userId : '';
187
- getUserserviceInfo({
188
- userId: userId,
189
- }).then((res) => {
190
- // console.log(res)
191
- this.name = res.userNickname ? res.userNickname : res.userName;
192
- this.phone = res.userPhone;
193
- this.compony = res.userinfoCompname;
194
- this.role = res.userRoleName;
195
- });
196
- }
173
+ if (this.proappEnvLayout.tenantCode === '2019071800001392') { // tenantCode 判断
174
+ let userId = sessionStorage.getItem('personalInfo') ? JSON.parse(sessionStorage.getItem('personalInfo')).userId : '';
175
+ getUserserviceInfo({
176
+ userId: userId,
177
+ }).then((res) => {
178
+ // console.log(res)
179
+ this.name = res.userRelname ? res.userRelname : res.userName;
180
+ this.phone = res.userOcode ? res.userOcode : res.userPhone;
181
+ this.compony = res.userinfoCompname;
182
+ this.role = res.userRoleName;
183
+ });
184
+ } else {
185
+ let userId = sessionStorage.getItem('personalInfo') ? JSON.parse(sessionStorage.getItem('personalInfo')).userId : '';
186
+ getUserserviceInfo({
187
+ userId: userId,
188
+ }).then((res) => {
189
+ // console.log(res)
190
+ this.name = res.userNickname ? res.userNickname : res.userName;
191
+ this.phone = res.userPhone;
192
+ this.compony = res.userinfoCompname;
193
+ this.role = res.userRoleName;
194
+ });
195
+ }
197
196
  }
198
197
 
199
- if(this.proappEnvLayout && this.proappEnvLayout.tenantCode == '2021122100000001') this.watchLocalStorage()
198
+ if (this.proappEnvLayout && this.proappEnvLayout.tenantCode == '2021122100000001') this.watchLocalStorage()
200
199
  },
201
200
  mounted() {
202
201
  // 监听 beforeunload 离开或者刷新页面触发
@@ -221,9 +220,9 @@ export default {
221
220
  /**
222
221
  * 监听保存到本地的未读消息数量用来显示角标
223
222
  */
224
- watchLocalStorage(){
223
+ watchLocalStorage() {
225
224
  // 监听localStorage的变化
226
- window.addEventListener('storage', event=>{
225
+ window.addEventListener('storage', event => {
227
226
  if (event.key === 'unreadMessageNum') {
228
227
  // 处理数据变化的逻辑
229
228
  this.unreadMessageNum = Number(event.newValue)
@@ -233,7 +232,7 @@ export default {
233
232
  /**
234
233
  * 跳转到消息列表页面
235
234
  */
236
- jumpToPage(){
235
+ jumpToPage() {
237
236
  location.href = '/paas/b2b-bus-pc-ayd/index.html#/msgList'
238
237
  },
239
238
  /**
@@ -271,6 +270,7 @@ export default {
271
270
  this.menuList = window.sessionStorage.getItem('menuList') ? window.sessionStorage.getItem('menuList') : '';
272
271
  this.menuCode = window.sessionStorage.getItem('menuCode') ? window.sessionStorage.getItem('menuCode') : '';
273
272
  this.proappEnvLayout = window.sessionStorage.getItem('proappEnvLayout') ? window.sessionStorage.getItem('proappEnvLayout') : '';
273
+ this.commonShowMenuAction = window.sessionStorage.getItem('commonShowMenuAction') ? JSON.parse(window.sessionStorage.getItem('commonShowMenuAction')) : ''
274
274
  // 获取 SSO 登出配置
275
275
  this.ssoLogout();
276
276
  },
@@ -354,6 +354,7 @@ export default {
354
354
  window.sessionStorage.clear();
355
355
  window.sessionStorage.setItem('menuList', this.menuList);
356
356
  window.sessionStorage.setItem('menuCode', this.menuCode);
357
+ window.sessionStorage.setItem('commonShowMenuAction', this.commonShowMenuAction)
357
358
  this.$store.dispatch('GetAppRouter').then((reg) => {
358
359
  window.sessionStorage.setItem('menuList', JSON.stringify(reg));
359
360
  });
@@ -402,30 +403,36 @@ export default {
402
403
  </script>
403
404
 
404
405
  <style rel="stylesheet/scss" lang="scss" scoped>
405
- .flex{
406
+ .flex {
406
407
  display: flex;
407
408
  }
409
+
408
410
  .loginInfo-Block-left {
409
411
  width: 39%;
410
412
  height: 100%;
411
413
  text-align: right;
412
414
  display: inline-block;
413
415
  }
414
- .loginInfo-Block-left > div {
416
+
417
+ .loginInfo-Block-left>div {
415
418
  margin-bottom: 25px;
416
419
  }
420
+
417
421
  .loginInfo-Block-right {
418
422
  width: 50%;
419
423
  height: 100%;
420
424
  display: inline-block;
425
+
421
426
  img {
422
427
  width: 120px;
423
428
  height: 120px;
424
429
  }
425
430
  }
426
- .loginInfo-Block-right > div {
431
+
432
+ .loginInfo-Block-right>div {
427
433
  margin-bottom: 25px;
428
434
  }
435
+
429
436
  .theme-color-box {
430
437
  li {
431
438
  width: 40px;
@@ -435,13 +442,15 @@ export default {
435
442
  float: left;
436
443
  margin: 5px;
437
444
  opacity: 0.3;
445
+
438
446
  &.active {
439
447
  opacity: 1;
440
448
  }
441
449
  }
442
450
  }
443
- .user-bar {
444
- }
451
+
452
+ .user-bar {}
453
+
445
454
  .user-remark {
446
455
  display: inline-block;
447
456
  width: 530px;
@@ -465,6 +474,7 @@ export default {
465
474
 
466
475
  cursor: pointer;
467
476
  }
477
+
468
478
  .nav-head {
469
479
  flex: 1;
470
480
  display: inline-flex;
@@ -472,8 +482,7 @@ export default {
472
482
  align-items: center;
473
483
  color: #bbbbbb;
474
484
  margin-right: 15px;
475
- align-items:center
476
- // font-weight: normal;
485
+ align-items: center; // font-weight: normal;
477
486
  // transition: all 10s linear;
478
487
  // i {
479
488
  // display: inline-block;
@@ -518,12 +527,14 @@ export default {
518
527
  line-height: 46px;
519
528
  margin-right: 15px;
520
529
  }
530
+
521
531
  .log_uot {
522
532
  // height: 24px;
523
533
  // line-height: 24px;
524
534
  // width: 24px;
525
535
  cursor: pointer;
526
536
  margin-left: 12px;
537
+
527
538
  // .logout-icon {
528
539
  // vertical-align: middle;
529
540
  // background: url("../../../assets/nav/logout.png") no-repeat;
@@ -534,6 +545,7 @@ export default {
534
545
  bottom: -15px;
535
546
  font-size: 12px;
536
547
  }
548
+
537
549
  &:hover {
538
550
  // .logout-icon {
539
551
  // vertical-align: middle;
@@ -541,33 +553,40 @@ export default {
541
553
  // background-size: 100% 100%;
542
554
  // }
543
555
  color: #409dff;
556
+
544
557
  .logout-text {
545
558
  color: #409dff;
546
559
  }
547
560
  }
548
561
  }
549
562
  }
563
+
550
564
  .theme-box {
551
565
  border: none;
552
566
  background: none;
553
567
  margin-right: 30px;
568
+
554
569
  &:active {
555
570
  background: none;
556
571
  color: #409dff;
557
572
  }
573
+
558
574
  &:hover {
559
575
  background: none;
560
576
  color: #409dff;
561
577
  }
578
+
562
579
  &:focus {
563
580
  background: none;
564
581
  color: #409dff;
565
582
  }
583
+
566
584
  &:visited {
567
585
  background: none;
568
586
  color: #409dff;
569
587
  }
570
588
  }
589
+
571
590
  // .logout-text:hover{
572
591
  // font-weight: bold;
573
592
  // color:#3ca1ec;
@@ -595,6 +614,7 @@ export default {
595
614
  background-image: url('../../../assets/nav/info.png');
596
615
  background-size: 100% 100%;
597
616
  }
617
+
598
618
  .navbar {
599
619
  height: 50px;
600
620
  line-height: 50px;
@@ -602,47 +622,56 @@ export default {
602
622
  box-sizing: border-box;
603
623
  border-radius: 0 !important;
604
624
  position: relative;
625
+
605
626
  &-title {
606
627
  font-size: 14px;
607
628
  color: #333;
608
629
  margin-left: 12px;
630
+
609
631
  // cursor: pointer;
610
632
  ul {
611
633
  li:last-child {
612
634
  color: #999;
613
635
  }
636
+
614
637
  i {
615
638
  margin: 0 10px;
616
639
  color: #999;
617
640
  }
618
641
  }
619
642
  }
643
+
620
644
  .hamburger-container {
621
645
  line-height: 30px;
622
646
  height: 30px;
623
647
  float: left;
624
648
  padding: 0 14px 0 20px;
625
649
  }
650
+
626
651
  .screenfull {
627
652
  position: absolute;
628
653
  right: 90px;
629
654
  top: 16px;
630
655
  color: red;
631
656
  }
657
+
632
658
  .avatar-container {
633
659
  height: 46px;
634
660
  display: inline-block;
635
661
  position: absolute;
636
662
  right: 35px;
663
+
637
664
  .avatar-wrapper {
638
665
  cursor: pointer;
639
666
  margin-top: 5px;
640
667
  position: relative;
668
+
641
669
  .user-avatar {
642
670
  width: 40px;
643
671
  height: 40px;
644
672
  border-radius: 10px;
645
673
  }
674
+
646
675
  .el-icon-caret-bottom {
647
676
  position: absolute;
648
677
  right: -20px;
@@ -652,12 +681,14 @@ export default {
652
681
  }
653
682
  }
654
683
  }
655
- /deep/ .msg-icon{
656
- display:inline;
684
+
685
+ /deep/ .msg-icon {
686
+ display: inline;
657
687
  cursor: pointer;
658
- margin-right:20px;
659
- .el-badge__content.is-fixed{
660
- top:4px;
688
+ margin-right: 20px;
689
+
690
+ .el-badge__content.is-fixed {
691
+ top: 4px;
661
692
  right: 8px;
662
693
  }
663
694
  }
@@ -143,7 +143,7 @@ export default {
143
143
  }
144
144
  if (this.$route.path && this.$route.meta) {
145
145
  if ('title' in this.$route.meta && 'icon' in this.$route.meta && 'menuCode' in this.$route.meta && 'params' in this.$route.meta) {
146
- localStorage.setItem('showMenuAction', this.$route.path)
146
+ sessionStorage.setItem('commonShowMenuAction', this.$route.path)
147
147
  }
148
148
  }
149
149
 
@@ -160,9 +160,9 @@ export default {
160
160
 
161
161
  console.log(current, 'path');
162
162
  console.log(path, 'path');
163
- console.log(localStorage.getItem('showMenuAction'), this.$route, '当前路由信息');
164
- if (this.$route.name !== '首页') {
165
- path = localStorage.getItem('showMenuAction') ? localStorage.getItem('showMenuAction') : path
163
+ console.log(sessionStorage.getItem('commonShowMenuAction'), this.$route, '当前路由信息');
164
+ if (this.$route.name !== '首页' && this.$route.path !== '/404') {
165
+ path = sessionStorage.getItem('commonShowMenuAction') ? sessionStorage.getItem('commonShowMenuAction') : path
166
166
  }
167
167
 
168
168
  return path;