@hbisty/qj-common 5.0.4 → 5.0.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.
Files changed (234) hide show
  1. package/.babelrc +12 -12
  2. package/.eslintrc.js +25 -25
  3. package/.idea/common.iml +11 -11
  4. package/.idea/modules.xml +7 -7
  5. package/.idea/vcs.xml +5 -5
  6. package/.postcssrc.js +9 -9
  7. package/.prettierrc.js +7 -7
  8. package/.project +37 -37
  9. package/README.md +2 -2
  10. package/gulpfile.js +20 -20
  11. package/package.json +18 -18
  12. package/src/api/apimanage.js +146 -146
  13. package/src/api/common/index.js +192 -192
  14. package/src/api/login.js +160 -160
  15. package/src/api/shopFbu.js +515 -515
  16. package/src/api/siteMsg.js +36 -0
  17. package/src/api/upload.js +8 -8
  18. package/src/components/Bounced/index.vue +145 -145
  19. package/src/components/Breadcrumb/index.vue +71 -71
  20. package/src/components/Checkbox/index.vue +53 -53
  21. package/src/components/Hamburger/index.vue +48 -48
  22. package/src/components/Logistics/logic.vue +186 -186
  23. package/src/components/ScrollBar/index.vue +60 -60
  24. package/src/components/SiteMsg/img/readed-icon.png +0 -0
  25. package/src/components/SiteMsg/img/unread-icon.png +0 -0
  26. package/src/components/SiteMsg/index.vue +773 -0
  27. package/src/components/SiteMsg//347/253/231/345/206/205/344/277/241/346/266/210/346/201/257-/346/216/245/345/217/243/346/226/207/346/241/243.txt +191 -0
  28. package/src/components/Sticky/index.vue +76 -76
  29. package/src/components/SvgIcon/index.vue +42 -42
  30. package/src/components/ThemePicker/index.vue +243 -243
  31. package/src/components/Tinymce/components/editorImage.vue +94 -94
  32. package/src/components/Tinymce/index.vue +166 -166
  33. package/src/components/Tinymce/plugins.js +7 -7
  34. package/src/components/Tinymce/toolbar.js +6 -6
  35. package/src/components/TreeTable/customEval.js +44 -44
  36. package/src/components/TreeTable/eval.js +29 -29
  37. package/src/components/TreeTable/index.vue +124 -124
  38. package/src/components/TreeTable/readme.md +89 -89
  39. package/src/components/TreeTableApi/customEval.js +49 -49
  40. package/src/components/TreeTableApi/eval.js +29 -29
  41. package/src/components/TreeTableApi/index.vue +124 -124
  42. package/src/components/TreeTableApi/readme.md +89 -89
  43. package/src/components/Upload/singleImage.vue +123 -123
  44. package/src/components/Upload/singleImage2.vue +118 -118
  45. package/src/components/Upload/singleImage3.vue +138 -138
  46. package/src/components/Upload/upload.vue +295 -295
  47. package/src/components/workOrderList/index.vue +158 -158
  48. package/src/dependencies.js +119 -119
  49. package/src/iconShop/demo.css +539 -539
  50. package/src/iconShop/demo_index.html +8445 -8445
  51. package/src/iconShop/iconfont.css +1451 -1451
  52. package/src/iconShop/iconfont.json +2522 -2522
  53. package/src/iconShop/iconfont.svg +1070 -1070
  54. package/src/iconfont/demo.css +539 -539
  55. package/src/iconfont/demo_index.html +5276 -5276
  56. package/src/iconfont/iconfont.css +905 -905
  57. package/src/iconfont/iconfont.json +1563 -1563
  58. package/src/iconfont/iconfont.svg +692 -692
  59. package/src/icons/index.js +9 -9
  60. package/src/lang/e.js +48 -48
  61. package/src/lang/en.js +48 -48
  62. package/src/lang/zh.js +48 -48
  63. package/src/main.js +62 -62
  64. package/src/permission.js +283 -283
  65. package/src/permissionForMall.backup.js +375 -375
  66. package/src/permissionForMall.js +375 -375
  67. package/src/preset.js +67 -67
  68. package/src/router/_import_common.js +1 -1
  69. package/src/router/_import_development.js +1 -1
  70. package/src/router/_import_production.js +1 -1
  71. package/src/store/getters.js +39 -39
  72. package/src/store/index.js +18 -18
  73. package/src/store/modules/app.js +34 -34
  74. package/src/store/modules/menu.js +82 -82
  75. package/src/store/modules/user.js +234 -234
  76. package/src/styles/element-ui.scss +1368 -1368
  77. package/src/styles/index.scss +166 -166
  78. package/src/styles/mixin.scss +27 -27
  79. package/src/styles/pc-ui.scss +1031 -1031
  80. package/src/styles/scrollBar.scss +21 -21
  81. package/src/styles/sidebar.scss +123 -123
  82. package/src/styles/transition.scss +32 -32
  83. package/src/styles/variables.scss +44 -44
  84. package/src/styles/wf-ui.scss +86 -86
  85. package/src/utils/auth.js +84 -57
  86. package/src/utils/dom.js +12 -12
  87. package/src/utils/getQueryString.js +5 -5
  88. package/src/utils/import.js +5 -5
  89. package/src/utils/index.js +355 -355
  90. package/src/utils/interceptor.js +34 -34
  91. package/src/utils/menu.js +116 -116
  92. package/src/utils/proapp.js +35 -35
  93. package/src/utils/query.js +26 -26
  94. package/src/utils/request.js +374 -374
  95. package/src/utils/routeMapping.js +39 -39
  96. package/src/utils/routeMapping.json +310 -310
  97. package/src/utils/utils.js +84 -84
  98. package/src/utils/validate.js +102 -102
  99. package/src/views/404.vue +72 -72
  100. package/src/views/Layout.vue +106 -106
  101. package/src/views/imgSwiper/index.vue +34 -34
  102. package/src/views/layout/Layout.vue +181 -181
  103. package/src/views/layout/components/AppMain.vue +20 -20
  104. package/src/views/layout/components/Footer.vue +22 -22
  105. package/src/views/layout/components/LeftNavbar.vue +318 -318
  106. package/src/views/layout/components/NavMenu.vue +15 -15
  107. package/src/views/layout/components/Navbar.vue +765 -695
  108. package/src/views/layout/components/Sidebar/SidebarItem.vue +116 -116
  109. package/src/views/layout/components/Sidebar/index.vue +216 -216
  110. package/src/views/layout/components/index.js +19 -19
  111. package/src/views/layout/theme/darkBlue/Layout.vue +140 -140
  112. package/src/views/layout/theme/darkBlue/components/AppMain.vue +38 -38
  113. package/src/views/layout/theme/darkBlue/components/Footer.vue +147 -147
  114. package/src/views/layout/theme/darkBlue/components/LeftNavbar(/345/261/225/347/244/272/345/205/250/351/203/250/350/217/234/345/215/225).vue +448 -448
  115. package/src/views/layout/theme/darkBlue/components/LeftNavbar.3.vue +191 -191
  116. package/src/views/layout/theme/darkBlue/components/LeftNavbar.vue +466 -466
  117. package/src/views/layout/theme/darkBlue/components/Navbar.vue +200 -200
  118. package/src/views/layout/theme/darkBlue/components/Sidebar/SidebarItem.vue +71 -71
  119. package/src/views/layout/theme/darkBlue/components/Sidebar/index.vue +49 -49
  120. package/src/views/layout/theme/darkBlue/components/index.js +15 -15
  121. package/src/views/layout-default/Layout.vue +134 -134
  122. package/src/views/layout-default/components/AppMain.vue +19 -19
  123. package/src/views/layout-default/components/Footer.vue +22 -22
  124. package/src/views/layout-default/components/LeftNavbar.vue +164 -164
  125. package/src/views/layout-default/components/Navbar.vue +295 -295
  126. package/src/views/layout-default/components/Sidebar/SidebarItem.vue +67 -67
  127. package/src/views/layout-default/components/Sidebar/index.vue +59 -59
  128. package/src/views/layout-default/components/index.js +4 -4
  129. package/src/views/layout-default/theme/darkBlue/Layout.vue +140 -140
  130. package/src/views/layout-default/theme/darkBlue/components/AppMain.vue +38 -38
  131. package/src/views/layout-default/theme/darkBlue/components/Footer.vue +147 -147
  132. package/src/views/layout-default/theme/darkBlue/components/LeftNavbar.vue +465 -465
  133. package/src/views/layout-default/theme/darkBlue/components/Navbar.vue +200 -200
  134. package/src/views/layout-default/theme/darkBlue/components/Sidebar/SidebarItem.vue +69 -69
  135. package/src/views/layout-default/theme/darkBlue/components/Sidebar/index.vue +49 -49
  136. package/src/views/layout-default/theme/darkBlue/components/index.js +15 -15
  137. package/src/views/pc/Internationalization.vue +80 -80
  138. package/src/views/pc/default/Layout.vue +442 -442
  139. package/src/views/pc/default/LayoutCard.vue +424 -424
  140. package/src/views/pc/default/assets/flex.scss +99 -99
  141. package/src/views/pc/default/footer-modules/DgFooter/index.vue +179 -179
  142. package/src/views/pc/default/footer-modules/DgFooter/indexSDX.vue +187 -187
  143. package/src/views/pc/default/footer-modules/footer.vue +171 -171
  144. package/src/views/pc/default/footer-modules/footerAns.vue +167 -167
  145. package/src/views/pc/default/footer-modules/footerBulk.vue +169 -169
  146. package/src/views/pc/default/footer-modules/footerDM.vue +254 -254
  147. package/src/views/pc/default/footer-modules/footerDefault.vue +267 -267
  148. package/src/views/pc/default/footer-modules/footerDefaultA.vue +270 -270
  149. package/src/views/pc/default/footer-modules/footerDefaultNew.vue +201 -201
  150. package/src/views/pc/default/footer-modules/footerHDB.vue +153 -153
  151. package/src/views/pc/default/footer-modules/footerHy.vue +63 -63
  152. package/src/views/pc/default/footer-modules/footerKYW.vue +163 -163
  153. package/src/views/pc/default/footer-modules/footerMh.vue +30 -30
  154. package/src/views/pc/default/footer-modules/footerNew.vue +116 -116
  155. package/src/views/pc/default/footer-modules/footer_yzj.vue +169 -169
  156. package/src/views/pc/default/footer-modules/footerayd.vue +85 -85
  157. package/src/views/pc/default/footer-modules/ymFooter.vue +154 -154
  158. package/src/views/pc/default/footer-modules/zgl.vue +250 -250
  159. package/src/views/pc/default/header-modules/DgHeader/Logo.vue +57 -57
  160. package/src/views/pc/default/header-modules/DgHeader/Search.vue +135 -135
  161. package/src/views/pc/default/header-modules/DgHeader/Settleup.vue +46 -46
  162. package/src/views/pc/default/header-modules/DgHeader/index.vue +38 -38
  163. package/src/views/pc/default/header-modules/active.vue +177 -177
  164. package/src/views/pc/default/header-modules/header.vue +97 -97
  165. package/src/views/pc/default/header-modules/headerA.vue +142 -142
  166. package/src/views/pc/default/header-modules/headerFLPT.vue +157 -157
  167. package/src/views/pc/default/header-modules/headerMh.vue +187 -187
  168. package/src/views/pc/default/header-modules/headerNew.vue +121 -121
  169. package/src/views/pc/default/header-modules/headerSDX.vue +304 -304
  170. package/src/views/pc/default/header-modules/headerStyle2.vue +173 -173
  171. package/src/views/pc/default/header-modules/headerStyle3.vue +190 -190
  172. package/src/views/pc/default/header-modules/headerStyle4.vue +163 -163
  173. package/src/views/pc/default/header-modules/headerStyleAns.vue +400 -400
  174. package/src/views/pc/default/header-modules/headerStyleBulk.vue +427 -427
  175. package/src/views/pc/default/header-modules/headerStyleDefalut.vue +209 -209
  176. package/src/views/pc/default/header-modules/headerStyleKYW.vue +435 -435
  177. package/src/views/pc/default/header-modules/headerStyle_yzj.vue +427 -427
  178. package/src/views/pc/default/header-modules/headerayd.vue +187 -187
  179. package/src/views/pc/default/header-modules/index.vue +466 -466
  180. package/src/views/pc/default/header-modules/ymHeader.vue +292 -292
  181. package/src/views/pc/default/header-modules/ysHeader.vue +248 -248
  182. package/src/views/pc/default/header-modules/zgl.vue +855 -855
  183. package/src/views/pc/default/leftMenu-modules/leftMenu-logo.vue +194 -194
  184. package/src/views/pc/default/leftMenu-modules/leftMenu-style2.vue +206 -206
  185. package/src/views/pc/default/leftMenu-modules/leftMenu-style3.vue +207 -207
  186. package/src/views/pc/default/leftMenu-modules/leftMenu-style4.vue +192 -192
  187. package/src/views/pc/default/leftMenu-modules/leftMenu.vue +183 -183
  188. package/src/views/pc/default/leftMenu-modules/leftMenuDefault.vue +212 -212
  189. package/src/views/pc/default/leftMenu-modules/leftMenuDefaultEn.vue +214 -214
  190. package/src/views/pc/default/leftMenu-modules/leftMenuDefaultFLPT.vue +220 -220
  191. package/src/views/pc/default/leftMenu-modules/leftMenuDefaultayd.vue +220 -220
  192. package/src/views/pc/default/nav-modules/nav.vue +52 -52
  193. package/src/views/pc/default/nav-modules/navAns.vue +60 -60
  194. package/src/views/pc/default/nav-modules/navBulk.vue +60 -60
  195. package/src/views/pc/default/top-modules/DgTopShortcut/index.vue +177 -177
  196. package/src/views/pc/default/top-modules/Toplg.vue +280 -280
  197. package/src/views/pc/default/top-modules/topA.vue +136 -136
  198. package/src/views/pc/default/top-modules/topAns.vue +261 -261
  199. package/src/views/pc/default/top-modules/topAns_yzj.vue +282 -282
  200. package/src/views/pc/default/top-modules/topBar.vue +304 -304
  201. package/src/views/pc/default/top-modules/topBulk.vue +280 -280
  202. package/src/views/pc/default/top-modules/topDefault.vue +244 -244
  203. package/src/views/pc/default/top-modules/topDefaultDM.vue +197 -197
  204. package/src/views/pc/default/top-modules/topDefaultNew.vue +271 -271
  205. package/src/views/pc/default/top-modules/topFLPT.vue +197 -197
  206. package/src/views/pc/default/top-modules/topHDB.vue +479 -479
  207. package/src/views/pc/default/top-modules/topKYW.vue +258 -258
  208. package/src/views/pc/default/top-modules/topMh.vue +174 -174
  209. package/src/views/pc/default/top-modules/topNew.vue +97 -97
  210. package/src/views/pc/default/top-modules/topSDX.vue +298 -298
  211. package/src/views/pc/default/top-modules/topSimple.vue +247 -247
  212. package/src/views/pc/default/top-modules/topSimpleHy.vue +256 -256
  213. package/src/views/pc/default/top-modules/topUcc.vue +264 -264
  214. package/src/views/pc/default/top-modules/topayd.vue +170 -170
  215. package/src/views/pc/default/top-modules/ymTop.vue +299 -299
  216. package/src/views/pc/default/top-modules/zgltop.vue +499 -499
  217. package/src/views/routerView.vue +9 -9
  218. package/src/views/templates/components/temp-select.vue +80 -80
  219. package/src/views/templates/components/temp-upload.vue +233 -233
  220. package/src/views/templates/readme.md +2 -2
  221. package/src/views/templates/templateInput.vue +421 -421
  222. package/src/views/templates/templateReadme.html +588 -588
  223. package/src/views/templates/templateReadme.md +619 -619
  224. package/src/views/templates/templateTable.vue +2244 -2244
  225. package/src/views/templates/templateTableData.vue +1883 -1883
  226. package/src/views/templates/templateUi/templateTableContent.vue +187 -187
  227. package/src/views/treeTemplate/index.vue +559 -559
  228. package/src/views/treeTemplate/treeTemplate.md +274 -274
  229. package/src/views/uploadDialog/index copy.vue +352 -352
  230. package/src/views/uploadDialog/index.vue +558 -558
  231. package/src/views/uploadDialog/indexOlay.vue +582 -582
  232. package/src/views/uploadDialog/indexPM.vue +578 -578
  233. package/src/views/uploadDialog/indexUpload.vue +543 -543
  234. package/src/views/uploadDialog/readme.md +45 -45
@@ -1,695 +1,765 @@
1
- <template>
2
- <div>
3
- <el-menu class="navbar" mode="horizontal">
4
- <!-- <hamburger
5
- class="hamburger-container"
6
- :toggleClick="toggleSideBar"
7
- :isActive="sidebar.appNavOpen"
8
- ></hamburger>
9
- <breadcrumb></breadcrumb>-->
10
- <slot></slot>
11
- <div class="navbar-title">
12
- <!-- <i class="icon-liebiaoxiangyou iconfont"></i> -->
13
- <ul class="flex">
14
- <li>{{ firstLevelMenu || '首页' }}</li>
15
- <li v-if="secondLevelMenu">
16
- <i>/</i>
17
- {{ secondLevelMenu }}
18
- </li>
19
- <li v-if="thirdLevelMenu">
20
- <i>/</i>
21
- {{ thirdLevelMenu }}
22
- </li>
23
- </ul>
24
- </div>
25
- <div class="nav-head">
26
- <el-popover placement="bottom-end" width="100" trigger="click">
27
- <ul class="theme-color-box clearfix">
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>
32
- </ul>
33
- <!-- <el-button class="theme-box" slot="reference">主题</el-button> -->
34
- </el-popover>
35
-
36
- <div class="user_name">
37
- <p class="user-bar">
38
- <!-- <i class="user-icon"></i> -->
39
- <!-- <span class="user_line"></span> -->
40
- <!-- <i class="icon-yonghu-outline iconfont"></i> -->
41
- <span class="user-remark" v-if="proappRemark && proappRemark.length > 0">
42
- <el-popover placement="bottom" width="300" trigger="hover">
43
- <p>{{ proappRemark[0] }}</p>
44
- <img :src="proappRemark[1]" alt="" width="300px" />
45
- <i slot="reference">{{ proappRemark[0] }} </i>
46
- </el-popover>
47
- </span>
48
-
49
- <!-- <span class="user_line"></span> -->
50
- <!-- <i class="icon-yonghu-outline iconfont"></i> -->
51
- <el-badge class="msg-icon" v-if="proappEnvLayout && proappEnvLayout.tenantCode == '2021122100000001'" is-dot
52
- :hidden='unreadMessageNum == 0'>
53
- <i class="el-icon-bell" @click="jumpToPage"></i>
54
- </el-badge>
55
- <span class="user-name" @click="lookInfo">
56
- <i style="padding-right: 10px">{{ this.merberCompname }}</i>
57
- {{ $store.state.user.name }}
58
- </span>
59
- </p>
60
- </div>
61
- <!-- <i class="set-icon"></i>
62
- <i class="info-icon"></i>-->
63
- <!-- <span class="spl_line"></span> -->
64
- <div class="log_uot">
65
- <i class="icon-tuichu1 iconfont" @click="logout"></i>
66
- <!-- <span class="logout-text" @click="logout">退出</span> -->
67
- </div>
68
- </div>
69
- <el-dialog title="登录账户信息" :visible.sync="centerDialogVisible" width="23%" center>
70
- <el-form label-width="100px" style="padding-bottom: 20px;">
71
- <el-form-item label="登录名:">
72
- {{ name }}
73
- </el-form-item>
74
- <el-form-item label="手机号:">
75
- {{ phone | hidePhone }}
76
- </el-form-item>
77
- <el-form-item label="所属公司:">
78
- {{ compony }}
79
- </el-form-item>
80
- <el-form-item label="角色:">
81
- {{ role }}
82
- </el-form-item>
83
- </el-form>
84
- <!-- <div>联系人:</div> -->
85
- <!-- <img :src="proappRemark[1]" alt=""> -->
86
- <!-- <div class="loginInfo-Block-left">
87
- <div>登录名:</div>
88
- <div>手机号:</div>
89
- <div>所属公司:</div>
90
- <div>角色:</div>
91
- </div>
92
- <div class="loginInfo-Block-right">
93
- <div>{{ name }}</div>
94
- <div>{{ phone | hidePhone }}</div>
95
- <div>{{ compony }}</div>
96
- <div>{{ role }}</div>
97
- </div> -->
98
- </el-dialog>
99
- <!-- <el-dropdown class="avatar-container" trigger="click">
100
- <div class="avatar-wrapper">
101
- <img class="user-avatar" src="https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif?imageView2/1/w/80/h/80">
102
- <i class="el-icon-caret-bottom"></i>
103
- </div>
104
- <el-dropdown-menu class="user-dropdown" slot="dropdown">
105
- <router-link class="inlineBlock" to="/">
106
- <el-dropdown-item>
107
- Home
108
- </el-dropdown-item>
109
- </router-link>
110
- <el-dropdown-item divided>
111
- <span @click="logout" style="display:block;">LogOut</span>
112
- </el-dropdown-item>
113
- </el-dropdown-menu>
114
- </el-dropdown>-->
115
- </el-menu>
116
- </div>
117
- </template>
118
-
119
- <script>
120
- import { mapGetters } from 'vuex';
121
- import Breadcrumb from '#/components/Breadcrumb';
122
- import Hamburger from '#/components/Hamburger';
123
- import { getUserserviceInfo, getSSOAuthInfo } from '../../../api/login';
124
- import axios from 'axios';
125
- import qs from 'qs';
126
-
127
- export default {
128
- components: {
129
- Breadcrumb,
130
- Hamburger,
131
- },
132
- props: {
133
- firstLevelMenu: String,
134
- secondLevelMenu: String,
135
- thirdLevelMenu: String,
136
- },
137
- data() {
138
- return {
139
- unreadMessageNum: 0,
140
- activeColor: '2c4158',
141
- menuList: '',
142
- menuCode: '',
143
- merberCompname: '',
144
- centerDialogVisible: false,
145
- name: '',
146
- phone: '',
147
- compony: '',
148
- role: '',
149
- type: null,
150
- ssoSubscriptionKey: '',
151
- proappEnvLayout: '',
152
- proappRemark: [],
153
-
154
- gapTime: '',
155
- beforeUnloadTime: '',
156
- secDomainName: null,
157
- commonShowMenuAction: ''
158
- };
159
- },
160
- computed: {
161
- ...mapGetters(['sidebar']),
162
- },
163
- created() {
164
- this.merberCompname = sessionStorage.getItem('personalInfo') ? JSON.parse(sessionStorage.getItem('personalInfo')).merberCompname : '';
165
- this.proappEnvLayout = window.sessionStorage.getItem('proappEnvLayout') ? JSON.parse(window.sessionStorage.getItem('proappEnvLayout')) : '';
166
-
167
- if (this.proappEnvLayout && this.proappEnvLayout.proappRemark) {
168
- this.proappRemark = this.proappEnvLayout.proappRemark.split('>');
169
- }
170
-
171
- console.log(window.location.href, 'window.location.href本地路由');
172
- if (window.location.href.indexOf('listDMkf') == -1) {
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
- }
196
- }
197
-
198
- if (this.proappEnvLayout && this.proappEnvLayout.tenantCode == '2021122100000001') this.watchLocalStorage()
199
- },
200
- mounted() {
201
- // 监听 beforeunload 离开或者刷新页面触发
202
- window.addEventListener('beforeunload', (e) => this.beforeunloadFn(e));
203
- // 监听 unload
204
- window.addEventListener('unload', (e) => this.unloadFn());
205
-
206
- this.type = this.$route.query.type || null;
207
- this.secDomainName = sessionStorage.getItem('secDomainName') ? sessionStorage.getItem('secDomainName') : null;
208
- },
209
- filters: {
210
- hidePhone: function (value) {
211
- var myreg = /^[1][3,4,5,7,8][0-9]{9}$/; //判断为手机号的正则
212
- if (!myreg.test(value)) {
213
- return value;
214
- } else {
215
- return value.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2');
216
- }
217
- },
218
- },
219
- methods: {
220
- /**
221
- * 监听保存到本地的未读消息数量用来显示角标
222
- */
223
- watchLocalStorage() {
224
- // 监听localStorage的变化
225
- window.addEventListener('storage', event => {
226
- if (event.key === 'unreadMessageNum') {
227
- // 处理数据变化的逻辑
228
- this.unreadMessageNum = Number(event.newValue)
229
- }
230
- });
231
- },
232
- /**
233
- * 跳转到消息列表页面
234
- */
235
- jumpToPage() {
236
- location.href = '/paas/b2b-bus-pc-ayd/index.html#/msgList'
237
- },
238
- /**
239
- * beforeunload function
240
- */
241
- beforeunloadFn() {
242
- // 记录当前时间
243
- this.beforeUnloadTime = new Date().getTime();
244
- },
245
-
246
- /**
247
- * unload function
248
- */
249
- unloadFn() {
250
- this.gapTime = new Date().getTime() - this.beforeUnloadTime;
251
- if (this.gapTime < 5) {
252
- //请求退出接口
253
- this.logout();
254
- }
255
- },
256
-
257
- lookInfo() {
258
- // 这边修改导航用户登陆信息按钮
259
- // location.href = `${
260
- // location.origin
261
- // }/paas/buyer-manager/index.html#/operatorInfo`;
262
- this.centerDialogVisible = true;
263
- // console.log("我被调用了北鼻")
264
- },
265
- toggleSideBar() {
266
- this.$store.commit('TOGGLE_SIDEBAR_APPNAV');
267
- },
268
- logout() {
269
- window.localStorage.removeItem('pohcode');
270
- this.menuList = window.sessionStorage.getItem('menuList') ? window.sessionStorage.getItem('menuList') : '';
271
- this.menuCode = window.sessionStorage.getItem('menuCode') ? window.sessionStorage.getItem('menuCode') : '';
272
- this.proappEnvLayout = window.sessionStorage.getItem('proappEnvLayout') ? window.sessionStorage.getItem('proappEnvLayout') : '';
273
- this.commonShowMenuAction = window.sessionStorage.getItem('commonShowMenuAction') ? window.sessionStorage.getItem('commonShowMenuAction') : ''
274
- // 获取 SSO 登出配置
275
- this.ssoLogout();
276
- },
277
-
278
- /**
279
- * SSO 登出操作
280
- */
281
- ssoLogout() {
282
- getSSOAuthInfo({ oauthEnvCode: 'out' }).then((res) => {
283
- let logoutUrl = '';
284
- let paramsArr = [];
285
- if (res.rows && res.rows.length > 0) {
286
- let configs = res.rows;
287
- let params = '';
288
- configs.forEach((el) => {
289
- if (el.oauthEnvconfigName == 'baseUrl') {
290
- this.ssoBaseUrl = el.oauthEnvconfigValue;
291
- } else {
292
- params += `${el.oauthEnvconfigName}=${el.oauthEnvconfigValue}&`;
293
- paramsArr.push({ name: el.oauthEnvconfigName, value: el.oauthEnvconfigValue });
294
- }
295
- });
296
-
297
- // 拼接登出地址
298
- logoutUrl = `${this.ssoBaseUrl}?${params.substring(0, params.length - 1)}`;
299
- // P&G SSO logout 需要iframe
300
- if (JSON.parse(this.proappEnvLayout).proappCode != '063') {
301
- try {
302
- var iframe = document.createElement('<iframe name="ifr"></iframe>');
303
- } catch (e) {
304
- var iframe = document.createElement('iframe');
305
- iframe.name = 'ifr';
306
- }
307
- iframe.src = logoutUrl;
308
- iframe.style = 'display: none';
309
- document.body.appendChild(iframe);
310
- }
311
- }
312
- console.log('logout---->params---->', paramsArr);
313
- this.paasLogout(paramsArr);
314
- });
315
- },
316
-
317
- // 九洲云腾退出登录
318
- iDsManagerLogout(paramsArr) {
319
- //创建form表单
320
- var temp_form = document.createElement('form');
321
-
322
- temp_form.action = this.ssoBaseUrl;
323
-
324
- //如需打开新窗口,form的target属性要设置为'_blank'
325
-
326
- temp_form.target = '_self';
327
-
328
- temp_form.method = 'post';
329
-
330
- temp_form.style.display = 'none';
331
-
332
- //添加参数
333
- for (var item in paramsArr) {
334
- var opt = document.createElement('textarea');
335
-
336
- opt.name = paramsArr[item].name;
337
-
338
- opt.value = paramsArr[item].value;
339
-
340
- temp_form.appendChild(opt);
341
- }
342
-
343
- document.body.appendChild(temp_form);
344
-
345
- //提交数据
346
-
347
- temp_form.submit();
348
- },
349
-
350
- // Paas 登出操作
351
- paasLogout(paramsArr) {
352
- // 调用 Paas 登出接口
353
- this.$store.dispatch('LogOut').then((res) => {
354
- window.sessionStorage.clear();
355
- window.sessionStorage.setItem('menuList', this.menuList);
356
- window.sessionStorage.setItem('menuCode', this.menuCode);
357
- window.sessionStorage.setItem('commonShowMenuAction', this.commonShowMenuAction)
358
- this.$store.dispatch('GetAppRouter').then((reg) => {
359
- window.sessionStorage.setItem('menuList', JSON.stringify(reg));
360
- });
361
-
362
- this.$store.commit('ADD_MENU', []);
363
- console.log('logout---->params---->', JSON.parse(this.proappEnvLayout).proappCode);
364
- // 九洲云腾登出操作
365
- // if (JSON.parse(this.proappEnvLayout).proappCode === '063') {
366
- // this.iDsManagerLogout(paramsArr);
367
- // } else {
368
- let path = '';
369
- if (this.proappEnvLayout && this.proappEnvLayout != null && this.proappEnvLayout != '') {
370
- path = JSON.parse(this.proappEnvLayout).proappEnvIndexr;
371
- } else {
372
- path = '/paas/index/index.html';
373
- }
374
- console.log(path, window.location.origin, 'logout');
375
- if (window.location.origin) {
376
- //this.secDomainName
377
- if (this.secDomainName && this.secDomainName != 'null' && this.secDomainName != window.location.origin) {
378
- window.location.href = `${this.secDomainName}${path}`;
379
- } else {
380
- window.location.href = `${window.location.origin}${path}`;
381
- }
382
- //无论url是什么,强制刷新页面,另外reload()有true和false参
383
- window.location.reload()
384
- } else {
385
- window.location.href = path;
386
- window.location.reload()
387
- }
388
- // }
389
- });
390
- },
391
-
392
- themeClick(color) {
393
- this.activeColor = color;
394
- this.$emit('themeClick', color);
395
- },
396
- },
397
-
398
- destroyed() {
399
- window.removeEventListener('beforeunload', (e) => this.beforeunloadFn());
400
- window.removeEventListener('unload', (e) => this.unloadFn());
401
- },
402
- };
403
- </script>
404
-
405
- <style rel="stylesheet/scss" lang="scss" scoped>
406
- .flex {
407
- display: flex;
408
- }
409
-
410
- .loginInfo-Block-left {
411
- width: 39%;
412
- height: 100%;
413
- text-align: right;
414
- display: inline-block;
415
- }
416
-
417
- .loginInfo-Block-left>div {
418
- margin-bottom: 25px;
419
- }
420
-
421
- .loginInfo-Block-right {
422
- width: 50%;
423
- height: 100%;
424
- display: inline-block;
425
-
426
- img {
427
- width: 120px;
428
- height: 120px;
429
- }
430
- }
431
-
432
- .loginInfo-Block-right>div {
433
- margin-bottom: 25px;
434
- }
435
-
436
- .theme-color-box {
437
- li {
438
- width: 40px;
439
- height: 20px;
440
- border: 1px solid #e0e0e0;
441
- cursor: pointer;
442
- float: left;
443
- margin: 5px;
444
- opacity: 0.3;
445
-
446
- &.active {
447
- opacity: 1;
448
- }
449
- }
450
- }
451
-
452
- .user-bar {}
453
-
454
- .user-remark {
455
- display: inline-block;
456
- width: 530px;
457
- white-space: nowrap;
458
- overflow: hidden;
459
- text-overflow: ellipsis;
460
- float: left;
461
- font-size: 12px;
462
- cursor: pointer;
463
- text-align: right;
464
- padding-right: 20px;
465
- position: relative;
466
- }
467
-
468
- .user-name {
469
- font-size: 14px;
470
- // line-height: 30px;
471
- // margin-top: -1px;
472
- // display: inline-block;
473
- float: right;
474
-
475
- cursor: pointer;
476
- }
477
-
478
- .nav-head {
479
- flex: 1;
480
- display: inline-flex;
481
- justify-content: flex-end;
482
- align-items: center;
483
- color: #bbbbbb;
484
- margin-right: 15px;
485
- align-items: center; // font-weight: normal;
486
- // transition: all 10s linear;
487
- // i {
488
- // display: inline-block;
489
- // width: 18px;
490
- // height: 18px;
491
- // // margin-right: 25px;
492
- // cursor: pointer;
493
- // }
494
- // .user_name {
495
- // cursor: pointer;
496
- // margin-right: 15px;
497
- // p {
498
- // width: 100%;
499
- // line-height: 24px;
500
- // height: 24px;
501
- // display: inline-table;
502
- // // .user-icon {
503
- // // vertical-align: middle;
504
- // // background: url("../../../assets/nav/admin.png") no-repeat;
505
- // // background-size: 80%;
506
- // // }
507
- // // .user_line {
508
- // // border: 1px solid #f8f8f8;
509
- // // margin: 0 5px;
510
- // // }
511
- // }
512
- // &:hover {
513
- // // .user-icon {
514
- // // vertical-align: middle;
515
- // // background-image: url("../../../assets/nav/admin-hover.png");
516
- // // background-size: 100% 100%;
517
- // // }
518
- // p {
519
- // color: #409dff;
520
- // }
521
- // }
522
- // }
523
-
524
- .spl_line {
525
- height: 40px;
526
- border: 1px solid #f8f8f8;
527
- line-height: 46px;
528
- margin-right: 15px;
529
- }
530
-
531
- .log_uot {
532
- // height: 24px;
533
- // line-height: 24px;
534
- // width: 24px;
535
- cursor: pointer;
536
- margin-left: 12px;
537
-
538
- // .logout-icon {
539
- // vertical-align: middle;
540
- // background: url("../../../assets/nav/logout.png") no-repeat;
541
- // background-size: 80%;
542
- // }
543
- .logout-text {
544
- position: absolute;
545
- bottom: -15px;
546
- font-size: 12px;
547
- }
548
-
549
- &:hover {
550
- // .logout-icon {
551
- // vertical-align: middle;
552
- // background-image: url("../../../assets/nav/logout-hover.png");
553
- // background-size: 100% 100%;
554
- // }
555
- color: #409dff;
556
-
557
- .logout-text {
558
- color: #409dff;
559
- }
560
- }
561
- }
562
- }
563
-
564
- .theme-box {
565
- border: none;
566
- background: none;
567
- margin-right: 30px;
568
-
569
- &:active {
570
- background: none;
571
- color: #409dff;
572
- }
573
-
574
- &:hover {
575
- background: none;
576
- color: #409dff;
577
- }
578
-
579
- &:focus {
580
- background: none;
581
- color: #409dff;
582
- }
583
-
584
- &:visited {
585
- background: none;
586
- color: #409dff;
587
- }
588
- }
589
-
590
- // .logout-text:hover{
591
- // font-weight: bold;
592
- // color:#3ca1ec;
593
- // }
594
- // .logout-text{
595
- // margin:0 25px 0 8px;cursor:pointer;
596
- // }
597
- // .nav-head i{
598
- // display: inline-block;
599
- // width: 18px;
600
- // height: 18px;
601
- // // margin-right: 25px;
602
- // cursor: pointer;
603
- // }
604
- // .nav-head p{
605
- // margin-right: 15px;
606
- // }
607
-
608
- .set-icon {
609
- background-image: url('../../../assets/nav/set.png');
610
- background-size: 100% 100%;
611
- }
612
-
613
- .info-icon {
614
- background-image: url('../../../assets/nav/info.png');
615
- background-size: 100% 100%;
616
- }
617
-
618
- .navbar {
619
- height: 50px;
620
- line-height: 50px;
621
- display: flex;
622
- box-sizing: border-box;
623
- border-radius: 0 !important;
624
- position: relative;
625
-
626
- &-title {
627
- font-size: 14px;
628
- color: #333;
629
- margin-left: 12px;
630
-
631
- // cursor: pointer;
632
- ul {
633
- li:last-child {
634
- color: #999;
635
- }
636
-
637
- i {
638
- margin: 0 10px;
639
- color: #999;
640
- }
641
- }
642
- }
643
-
644
- .hamburger-container {
645
- line-height: 30px;
646
- height: 30px;
647
- float: left;
648
- padding: 0 14px 0 20px;
649
- }
650
-
651
- .screenfull {
652
- position: absolute;
653
- right: 90px;
654
- top: 16px;
655
- color: red;
656
- }
657
-
658
- .avatar-container {
659
- height: 46px;
660
- display: inline-block;
661
- position: absolute;
662
- right: 35px;
663
-
664
- .avatar-wrapper {
665
- cursor: pointer;
666
- margin-top: 5px;
667
- position: relative;
668
-
669
- .user-avatar {
670
- width: 40px;
671
- height: 40px;
672
- border-radius: 10px;
673
- }
674
-
675
- .el-icon-caret-bottom {
676
- position: absolute;
677
- right: -20px;
678
- top: 25px;
679
- font-size: 12px;
680
- }
681
- }
682
- }
683
- }
684
-
685
- /deep/ .msg-icon {
686
- display: inline;
687
- cursor: pointer;
688
- margin-right: 20px;
689
-
690
- .el-badge__content.is-fixed {
691
- top: 4px;
692
- right: 8px;
693
- }
694
- }
695
- </style>
1
+ <template>
2
+ <div>
3
+ <el-menu class="navbar" mode="horizontal">
4
+ <!-- <hamburger
5
+ class="hamburger-container"
6
+ :toggleClick="toggleSideBar"
7
+ :isActive="sidebar.appNavOpen"
8
+ ></hamburger>
9
+ <breadcrumb></breadcrumb>-->
10
+ <slot></slot>
11
+ <div class="navbar-title">
12
+ <!-- <i class="icon-liebiaoxiangyou iconfont"></i> -->
13
+ <ul class="flex">
14
+ <li>{{ firstLevelMenu || '首页' }}</li>
15
+ <li v-if="secondLevelMenu">
16
+ <i>/</i>
17
+ {{ secondLevelMenu }}
18
+ </li>
19
+ <li v-if="thirdLevelMenu">
20
+ <i>/</i>
21
+ {{ thirdLevelMenu }}
22
+ </li>
23
+ </ul>
24
+ </div>
25
+ <div class="nav-head">
26
+ <!-- 站内信消息 -->
27
+ <el-badge
28
+ v-if="isTY()"
29
+ :value="totalUnreadCount"
30
+ :hidden="totalUnreadCount === 0"
31
+ :max="99"
32
+ class="msg-badge"
33
+ >
34
+ <div @click="openMsgDrawer">
35
+ <i
36
+ class="el-icon-message-solid msg-badge-icon"
37
+ ></i>
38
+ <span>消息</span>
39
+ </div>
40
+ </el-badge>
41
+
42
+ <el-popover placement="bottom-end" width="100" trigger="click">
43
+ <ul class="theme-color-box clearfix">
44
+ <li @click="themeClick('bda16f')" :class="[activeColor == 'bda16f' ? 'active' : '']"
45
+ :style="{ background: '#bda16f' }"></li>
46
+ <li @click="themeClick('2c4158')" :class="[activeColor == '2c4158' ? 'active' : '']"
47
+ :style="{ background: '#2c4158' }"></li>
48
+ </ul>
49
+ <!-- <el-button class="theme-box" slot="reference">主题</el-button> -->
50
+ </el-popover>
51
+
52
+ <div class="user_name">
53
+ <p class="user-bar">
54
+ <!-- <i class="user-icon"></i> -->
55
+ <!-- <span class="user_line"></span> -->
56
+ <!-- <i class="icon-yonghu-outline iconfont"></i> -->
57
+ <span class="user-remark" v-if="proappRemark && proappRemark.length > 0">
58
+ <el-popover placement="bottom" width="300" trigger="hover">
59
+ <p>{{ proappRemark[0] }}</p>
60
+ <img :src="proappRemark[1]" alt="" width="300px" />
61
+ <i slot="reference">{{ proappRemark[0] }} </i>
62
+ </el-popover>
63
+ </span>
64
+
65
+ <!-- <span class="user_line"></span> -->
66
+ <!-- <i class="icon-yonghu-outline iconfont"></i> -->
67
+ <el-badge class="msg-icon" v-if="proappEnvLayout && proappEnvLayout.tenantCode == '2021122100000001'" is-dot
68
+ :hidden='unreadMessageNum == 0'>
69
+ <i class="el-icon-bell" @click="jumpToPage"></i>
70
+ </el-badge>
71
+ <span class="user-name" @click="lookInfo">
72
+ <i style="padding-right: 10px">{{ this.merberCompname }}</i>
73
+ {{ $store.state.user.name }}
74
+ </span>
75
+ </p>
76
+ </div>
77
+ <!-- <i class="set-icon"></i>
78
+ <i class="info-icon"></i>-->
79
+ <!-- <span class="spl_line"></span> -->
80
+ <div class="log_uot">
81
+ <i class="icon-tuichu1 iconfont" @click="logout"></i>
82
+ <!-- <span class="logout-text" @click="logout">退出</span> -->
83
+ </div>
84
+ </div>
85
+ <el-dialog title="登录账户信息" :visible.sync="centerDialogVisible" width="23%" center>
86
+ <el-form label-width="100px" style="padding-bottom: 20px;">
87
+ <el-form-item label="登录名:">
88
+ {{ name }}
89
+ </el-form-item>
90
+ <el-form-item label="手机号:">
91
+ {{ phone | hidePhone }}
92
+ </el-form-item>
93
+ <el-form-item label="所属公司:">
94
+ {{ compony }}
95
+ </el-form-item>
96
+ <el-form-item label="角色:">
97
+ {{ role }}
98
+ </el-form-item>
99
+ </el-form>
100
+ <!-- <div>联系人:</div> -->
101
+ <!-- <img :src="proappRemark[1]" alt=""> -->
102
+ <!-- <div class="loginInfo-Block-left">
103
+ <div>登录名:</div>
104
+ <div>手机号:</div>
105
+ <div>所属公司:</div>
106
+ <div>角色:</div>
107
+ </div>
108
+ <div class="loginInfo-Block-right">
109
+ <div>{{ name }}</div>
110
+ <div>{{ phone | hidePhone }}</div>
111
+ <div>{{ compony }}</div>
112
+ <div>{{ role }}</div>
113
+ </div> -->
114
+ </el-dialog>
115
+ <!-- <el-dropdown class="avatar-container" trigger="click">
116
+ <div class="avatar-wrapper">
117
+ <img class="user-avatar" src="https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif?imageView2/1/w/80/h/80">
118
+ <i class="el-icon-caret-bottom"></i>
119
+ </div>
120
+ <el-dropdown-menu class="user-dropdown" slot="dropdown">
121
+ <router-link class="inlineBlock" to="/">
122
+ <el-dropdown-item>
123
+ Home
124
+ </el-dropdown-item>
125
+ </router-link>
126
+ <el-dropdown-item divided>
127
+ <span @click="logout" style="display:block;">LogOut</span>
128
+ </el-dropdown-item>
129
+ </el-dropdown-menu>
130
+ </el-dropdown>-->
131
+ </el-menu>
132
+ <!-- 站内信消息抽屉框 -->
133
+ <site-msg
134
+ :visible.sync="msgDrawerVisible"
135
+ @jump-to-product="handleJumpToProduct"
136
+ @unread-count-change="handleUnreadCountChange"
137
+ />
138
+ </div>
139
+ </template>
140
+
141
+ <script>
142
+ import { mapGetters } from 'vuex';
143
+ import Breadcrumb from '#/components/Breadcrumb';
144
+ import Hamburger from '#/components/Hamburger';
145
+ import { getUserserviceInfo, getSSOAuthInfo } from '../../../api/login';
146
+ import SiteMsg from '#/components/SiteMsg/index.vue'
147
+ import { isTY } from '#/utils/auth';
148
+ import axios from 'axios';
149
+ import qs from 'qs';
150
+
151
+ export default {
152
+ components: {
153
+ Breadcrumb,
154
+ Hamburger,
155
+ SiteMsg
156
+ },
157
+ props: {
158
+ firstLevelMenu: String,
159
+ secondLevelMenu: String,
160
+ thirdLevelMenu: String,
161
+ },
162
+ data() {
163
+ return {
164
+ unreadMessageNum: 0,
165
+ activeColor: '2c4158',
166
+ menuList: '',
167
+ menuCode: '',
168
+ merberCompname: '',
169
+ centerDialogVisible: false,
170
+ name: '',
171
+ phone: '',
172
+ compony: '',
173
+ role: '',
174
+ type: null,
175
+ ssoSubscriptionKey: '',
176
+ proappEnvLayout: '',
177
+ proappRemark: [],
178
+
179
+ gapTime: '',
180
+ beforeUnloadTime: '',
181
+ secDomainName: null,
182
+ commonShowMenuAction: '',
183
+ msgDrawerVisible: false, // 站内信消息抽屉框是否显示
184
+ msgTotalUnread: 0, // 未读消息数量角标
185
+ };
186
+ },
187
+ computed: {
188
+ ...mapGetters(['sidebar']),
189
+ totalUnreadCount() {
190
+ return this.msgTotalUnread
191
+ }
192
+ },
193
+ created() {
194
+ this.merberCompname = sessionStorage.getItem('personalInfo') ? JSON.parse(sessionStorage.getItem('personalInfo')).merberCompname : '';
195
+ this.proappEnvLayout = window.sessionStorage.getItem('proappEnvLayout') ? JSON.parse(window.sessionStorage.getItem('proappEnvLayout')) : '';
196
+
197
+ if (this.proappEnvLayout && this.proappEnvLayout.proappRemark) {
198
+ this.proappRemark = this.proappEnvLayout.proappRemark.split('>');
199
+ }
200
+
201
+ console.log(window.location.href, 'window.location.href本地路由');
202
+ if (window.location.href.indexOf('listDMkf') == -1) {
203
+ if (this.proappEnvLayout.tenantCode === '2019071800001392') { // tenantCode 判断
204
+ let userId = sessionStorage.getItem('personalInfo') ? JSON.parse(sessionStorage.getItem('personalInfo')).userId : '';
205
+ getUserserviceInfo({
206
+ userId: userId,
207
+ }).then((res) => {
208
+ // console.log(res)
209
+ this.name = res.userRelname ? res.userRelname : res.userName;
210
+ this.phone = res.userOcode ? res.userOcode : res.userPhone;
211
+ this.compony = res.userinfoCompname;
212
+ this.role = res.userRoleName;
213
+ });
214
+ } else {
215
+ let userId = sessionStorage.getItem('personalInfo') ? JSON.parse(sessionStorage.getItem('personalInfo')).userId : '';
216
+ getUserserviceInfo({
217
+ userId: userId,
218
+ }).then((res) => {
219
+ // console.log(res)
220
+ this.name = res.userNickname ? res.userNickname : res.userName;
221
+ this.phone = res.userPhone;
222
+ this.compony = res.userinfoCompname;
223
+ this.role = res.userRoleName;
224
+ });
225
+ }
226
+ }
227
+
228
+ if (this.proappEnvLayout && this.proappEnvLayout.tenantCode == '2021122100000001') this.watchLocalStorage()
229
+ },
230
+ mounted() {
231
+ // 监听 beforeunload 离开或者刷新页面触发
232
+ window.addEventListener('beforeunload', (e) => this.beforeunloadFn(e));
233
+ // 监听 unload
234
+ window.addEventListener('unload', (e) => this.unloadFn());
235
+
236
+ this.type = this.$route.query.type || null;
237
+ this.secDomainName = sessionStorage.getItem('secDomainName') ? sessionStorage.getItem('secDomainName') : null;
238
+ },
239
+ filters: {
240
+ hidePhone: function (value) {
241
+ var myreg = /^[1][3,4,5,7,8][0-9]{9}$/; //判断为手机号的正则
242
+ if (!myreg.test(value)) {
243
+ return value;
244
+ } else {
245
+ return value.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2');
246
+ }
247
+ },
248
+ },
249
+ methods: {
250
+ isTY,
251
+ // 打开站内信消息抽屉框
252
+ openMsgDrawer() {
253
+ this.msgDrawerVisible = true
254
+ },
255
+ // 处理跳转事件
256
+ handleJumpToProduct(code) {
257
+ // this.$router.push({ path: '/product/pending-review', query: { code } })
258
+ },
259
+ // 处理未读消息数量变化
260
+ handleUnreadCountChange(count) {
261
+ this.msgTotalUnread = count
262
+ },
263
+ /**
264
+ * 监听保存到本地的未读消息数量用来显示角标
265
+ */
266
+ watchLocalStorage() {
267
+ // 监听localStorage的变化
268
+ window.addEventListener('storage', event => {
269
+ if (event.key === 'unreadMessageNum') {
270
+ // 处理数据变化的逻辑
271
+ this.unreadMessageNum = Number(event.newValue)
272
+ }
273
+ });
274
+ },
275
+ /**
276
+ * 跳转到消息列表页面
277
+ */
278
+ jumpToPage() {
279
+ location.href = '/paas/b2b-bus-pc-ayd/index.html#/msgList'
280
+ },
281
+ /**
282
+ * beforeunload function
283
+ */
284
+ beforeunloadFn() {
285
+ // 记录当前时间
286
+ this.beforeUnloadTime = new Date().getTime();
287
+ },
288
+
289
+ /**
290
+ * unload function
291
+ */
292
+ unloadFn() {
293
+ this.gapTime = new Date().getTime() - this.beforeUnloadTime;
294
+ if (this.gapTime < 5) {
295
+ //请求退出接口
296
+ this.logout();
297
+ }
298
+ },
299
+
300
+ lookInfo() {
301
+ // 这边修改导航用户登陆信息按钮
302
+ // location.href = `${
303
+ // location.origin
304
+ // }/paas/buyer-manager/index.html#/operatorInfo`;
305
+ this.centerDialogVisible = true;
306
+ // console.log("我被调用了北鼻")
307
+ },
308
+ toggleSideBar() {
309
+ this.$store.commit('TOGGLE_SIDEBAR_APPNAV');
310
+ },
311
+ logout() {
312
+ window.localStorage.removeItem('pohcode');
313
+ this.menuList = window.sessionStorage.getItem('menuList') ? window.sessionStorage.getItem('menuList') : '';
314
+ this.menuCode = window.sessionStorage.getItem('menuCode') ? window.sessionStorage.getItem('menuCode') : '';
315
+ this.proappEnvLayout = window.sessionStorage.getItem('proappEnvLayout') ? window.sessionStorage.getItem('proappEnvLayout') : '';
316
+ this.commonShowMenuAction = window.sessionStorage.getItem('commonShowMenuAction') ? window.sessionStorage.getItem('commonShowMenuAction') : ''
317
+ // 获取 SSO 登出配置
318
+ this.ssoLogout();
319
+ },
320
+
321
+ /**
322
+ * SSO 登出操作
323
+ */
324
+ ssoLogout() {
325
+ getSSOAuthInfo({ oauthEnvCode: 'out' }).then((res) => {
326
+ let logoutUrl = '';
327
+ let paramsArr = [];
328
+ if (res.rows && res.rows.length > 0) {
329
+ let configs = res.rows;
330
+ let params = '';
331
+ configs.forEach((el) => {
332
+ if (el.oauthEnvconfigName == 'baseUrl') {
333
+ this.ssoBaseUrl = el.oauthEnvconfigValue;
334
+ } else {
335
+ params += `${el.oauthEnvconfigName}=${el.oauthEnvconfigValue}&`;
336
+ paramsArr.push({ name: el.oauthEnvconfigName, value: el.oauthEnvconfigValue });
337
+ }
338
+ });
339
+
340
+ // 拼接登出地址
341
+ logoutUrl = `${this.ssoBaseUrl}?${params.substring(0, params.length - 1)}`;
342
+ // P&G SSO logout 需要iframe
343
+ if (JSON.parse(this.proappEnvLayout).proappCode != '063') {
344
+ try {
345
+ var iframe = document.createElement('<iframe name="ifr"></iframe>');
346
+ } catch (e) {
347
+ var iframe = document.createElement('iframe');
348
+ iframe.name = 'ifr';
349
+ }
350
+ iframe.src = logoutUrl;
351
+ iframe.style = 'display: none';
352
+ document.body.appendChild(iframe);
353
+ }
354
+ }
355
+ console.log('logout---->params---->', paramsArr);
356
+ this.paasLogout(paramsArr);
357
+ });
358
+ },
359
+
360
+ // 九洲云腾退出登录
361
+ iDsManagerLogout(paramsArr) {
362
+ //创建form表单
363
+ var temp_form = document.createElement('form');
364
+
365
+ temp_form.action = this.ssoBaseUrl;
366
+
367
+ //如需打开新窗口,form的target属性要设置为'_blank'
368
+
369
+ temp_form.target = '_self';
370
+
371
+ temp_form.method = 'post';
372
+
373
+ temp_form.style.display = 'none';
374
+
375
+ //添加参数
376
+ for (var item in paramsArr) {
377
+ var opt = document.createElement('textarea');
378
+
379
+ opt.name = paramsArr[item].name;
380
+
381
+ opt.value = paramsArr[item].value;
382
+
383
+ temp_form.appendChild(opt);
384
+ }
385
+
386
+ document.body.appendChild(temp_form);
387
+
388
+ //提交数据
389
+
390
+ temp_form.submit();
391
+ },
392
+
393
+ // Paas 登出操作
394
+ paasLogout(paramsArr) {
395
+ // 调用 Paas 登出接口
396
+ this.$store.dispatch('LogOut').then((res) => {
397
+ window.sessionStorage.clear();
398
+ window.sessionStorage.setItem('menuList', this.menuList);
399
+ window.sessionStorage.setItem('menuCode', this.menuCode);
400
+ window.sessionStorage.setItem('commonShowMenuAction', this.commonShowMenuAction)
401
+ this.$store.dispatch('GetAppRouter').then((reg) => {
402
+ window.sessionStorage.setItem('menuList', JSON.stringify(reg));
403
+ });
404
+
405
+ this.$store.commit('ADD_MENU', []);
406
+ console.log('logout---->params---->', JSON.parse(this.proappEnvLayout).proappCode);
407
+ // 九洲云腾登出操作
408
+ // if (JSON.parse(this.proappEnvLayout).proappCode === '063') {
409
+ // this.iDsManagerLogout(paramsArr);
410
+ // } else {
411
+ let path = '';
412
+ if (this.proappEnvLayout && this.proappEnvLayout != null && this.proappEnvLayout != '') {
413
+ path = JSON.parse(this.proappEnvLayout).proappEnvIndexr;
414
+ } else {
415
+ path = '/paas/index/index.html';
416
+ }
417
+ console.log(path, window.location.origin, 'logout');
418
+ if (window.location.origin) {
419
+ //this.secDomainName
420
+ if (this.secDomainName && this.secDomainName != 'null' && this.secDomainName != window.location.origin) {
421
+ window.location.href = `${this.secDomainName}${path}`;
422
+ } else {
423
+ window.location.href = `${window.location.origin}${path}`;
424
+ }
425
+ //无论url是什么,强制刷新页面,另外reload()有true和false参
426
+ window.location.reload()
427
+ } else {
428
+ window.location.href = path;
429
+ window.location.reload()
430
+ }
431
+ // }
432
+ });
433
+ },
434
+
435
+ themeClick(color) {
436
+ this.activeColor = color;
437
+ this.$emit('themeClick', color);
438
+ },
439
+ },
440
+
441
+ destroyed() {
442
+ window.removeEventListener('beforeunload', (e) => this.beforeunloadFn());
443
+ window.removeEventListener('unload', (e) => this.unloadFn());
444
+ },
445
+ };
446
+ </script>
447
+
448
+ <style rel="stylesheet/scss" lang="scss" scoped>
449
+ /**
450
+ * 站内消息角标
451
+ */
452
+ .msg-badge {
453
+ padding-left: 16px;
454
+ cursor: pointer;
455
+ margin-right: 15px;
456
+ &:hover {
457
+ color: #409efe;
458
+ }
459
+ .msg-badge-icon {
460
+ font-size: 15px;
461
+ cursor: pointer;
462
+ }
463
+ span{
464
+ font-size: 14px;
465
+ }
466
+
467
+ /deep/ .el-badge__content {
468
+ top: 15px;
469
+ right: 5px;
470
+ font-size: 10px;
471
+ line-height: 14px;
472
+ height: 14px;
473
+ padding: 0 4px;
474
+ }
475
+ }
476
+ .flex {
477
+ display: flex;
478
+ }
479
+
480
+ .loginInfo-Block-left {
481
+ width: 39%;
482
+ height: 100%;
483
+ text-align: right;
484
+ display: inline-block;
485
+ }
486
+
487
+ .loginInfo-Block-left>div {
488
+ margin-bottom: 25px;
489
+ }
490
+
491
+ .loginInfo-Block-right {
492
+ width: 50%;
493
+ height: 100%;
494
+ display: inline-block;
495
+
496
+ img {
497
+ width: 120px;
498
+ height: 120px;
499
+ }
500
+ }
501
+
502
+ .loginInfo-Block-right>div {
503
+ margin-bottom: 25px;
504
+ }
505
+
506
+ .theme-color-box {
507
+ li {
508
+ width: 40px;
509
+ height: 20px;
510
+ border: 1px solid #e0e0e0;
511
+ cursor: pointer;
512
+ float: left;
513
+ margin: 5px;
514
+ opacity: 0.3;
515
+
516
+ &.active {
517
+ opacity: 1;
518
+ }
519
+ }
520
+ }
521
+
522
+ .user-bar {}
523
+
524
+ .user-remark {
525
+ display: inline-block;
526
+ width: 530px;
527
+ white-space: nowrap;
528
+ overflow: hidden;
529
+ text-overflow: ellipsis;
530
+ float: left;
531
+ font-size: 12px;
532
+ cursor: pointer;
533
+ text-align: right;
534
+ padding-right: 20px;
535
+ position: relative;
536
+ }
537
+
538
+ .user-name {
539
+ font-size: 14px;
540
+ // line-height: 30px;
541
+ // margin-top: -1px;
542
+ // display: inline-block;
543
+ float: right;
544
+
545
+ cursor: pointer;
546
+ }
547
+
548
+ .nav-head {
549
+ flex: 1;
550
+ display: inline-flex;
551
+ justify-content: flex-end;
552
+ align-items: center;
553
+ color: #bbbbbb;
554
+ margin-right: 15px;
555
+ align-items: center; // font-weight: normal;
556
+ // transition: all 10s linear;
557
+ // i {
558
+ // display: inline-block;
559
+ // width: 18px;
560
+ // height: 18px;
561
+ // // margin-right: 25px;
562
+ // cursor: pointer;
563
+ // }
564
+ // .user_name {
565
+ // cursor: pointer;
566
+ // margin-right: 15px;
567
+ // p {
568
+ // width: 100%;
569
+ // line-height: 24px;
570
+ // height: 24px;
571
+ // display: inline-table;
572
+ // // .user-icon {
573
+ // // vertical-align: middle;
574
+ // // background: url("../../../assets/nav/admin.png") no-repeat;
575
+ // // background-size: 80%;
576
+ // // }
577
+ // // .user_line {
578
+ // // border: 1px solid #f8f8f8;
579
+ // // margin: 0 5px;
580
+ // // }
581
+ // }
582
+ // &:hover {
583
+ // // .user-icon {
584
+ // // vertical-align: middle;
585
+ // // background-image: url("../../../assets/nav/admin-hover.png");
586
+ // // background-size: 100% 100%;
587
+ // // }
588
+ // p {
589
+ // color: #409dff;
590
+ // }
591
+ // }
592
+ // }
593
+
594
+ .spl_line {
595
+ height: 40px;
596
+ border: 1px solid #f8f8f8;
597
+ line-height: 46px;
598
+ margin-right: 15px;
599
+ }
600
+
601
+ .log_uot {
602
+ // height: 24px;
603
+ // line-height: 24px;
604
+ // width: 24px;
605
+ cursor: pointer;
606
+ margin-left: 12px;
607
+
608
+ // .logout-icon {
609
+ // vertical-align: middle;
610
+ // background: url("../../../assets/nav/logout.png") no-repeat;
611
+ // background-size: 80%;
612
+ // }
613
+ .logout-text {
614
+ position: absolute;
615
+ bottom: -15px;
616
+ font-size: 12px;
617
+ }
618
+
619
+ &:hover {
620
+ // .logout-icon {
621
+ // vertical-align: middle;
622
+ // background-image: url("../../../assets/nav/logout-hover.png");
623
+ // background-size: 100% 100%;
624
+ // }
625
+ color: #409dff;
626
+
627
+ .logout-text {
628
+ color: #409dff;
629
+ }
630
+ }
631
+ }
632
+ }
633
+
634
+ .theme-box {
635
+ border: none;
636
+ background: none;
637
+ margin-right: 30px;
638
+
639
+ &:active {
640
+ background: none;
641
+ color: #409dff;
642
+ }
643
+
644
+ &:hover {
645
+ background: none;
646
+ color: #409dff;
647
+ }
648
+
649
+ &:focus {
650
+ background: none;
651
+ color: #409dff;
652
+ }
653
+
654
+ &:visited {
655
+ background: none;
656
+ color: #409dff;
657
+ }
658
+ }
659
+
660
+ // .logout-text:hover{
661
+ // font-weight: bold;
662
+ // color:#3ca1ec;
663
+ // }
664
+ // .logout-text{
665
+ // margin:0 25px 0 8px;cursor:pointer;
666
+ // }
667
+ // .nav-head i{
668
+ // display: inline-block;
669
+ // width: 18px;
670
+ // height: 18px;
671
+ // // margin-right: 25px;
672
+ // cursor: pointer;
673
+ // }
674
+ // .nav-head p{
675
+ // margin-right: 15px;
676
+ // }
677
+
678
+ .set-icon {
679
+ background-image: url('../../../assets/nav/set.png');
680
+ background-size: 100% 100%;
681
+ }
682
+
683
+ .info-icon {
684
+ background-image: url('../../../assets/nav/info.png');
685
+ background-size: 100% 100%;
686
+ }
687
+
688
+ .navbar {
689
+ height: 50px;
690
+ line-height: 50px;
691
+ display: flex;
692
+ box-sizing: border-box;
693
+ border-radius: 0 !important;
694
+ position: relative;
695
+
696
+ &-title {
697
+ font-size: 14px;
698
+ color: #333;
699
+ margin-left: 12px;
700
+
701
+ // cursor: pointer;
702
+ ul {
703
+ li:last-child {
704
+ color: #999;
705
+ }
706
+
707
+ i {
708
+ margin: 0 10px;
709
+ color: #999;
710
+ }
711
+ }
712
+ }
713
+
714
+ .hamburger-container {
715
+ line-height: 30px;
716
+ height: 30px;
717
+ float: left;
718
+ padding: 0 14px 0 20px;
719
+ }
720
+
721
+ .screenfull {
722
+ position: absolute;
723
+ right: 90px;
724
+ top: 16px;
725
+ color: red;
726
+ }
727
+
728
+ .avatar-container {
729
+ height: 46px;
730
+ display: inline-block;
731
+ position: absolute;
732
+ right: 35px;
733
+
734
+ .avatar-wrapper {
735
+ cursor: pointer;
736
+ margin-top: 5px;
737
+ position: relative;
738
+
739
+ .user-avatar {
740
+ width: 40px;
741
+ height: 40px;
742
+ border-radius: 10px;
743
+ }
744
+
745
+ .el-icon-caret-bottom {
746
+ position: absolute;
747
+ right: -20px;
748
+ top: 25px;
749
+ font-size: 12px;
750
+ }
751
+ }
752
+ }
753
+ }
754
+
755
+ /deep/ .msg-icon {
756
+ display: inline;
757
+ cursor: pointer;
758
+ margin-right: 20px;
759
+
760
+ .el-badge__content.is-fixed {
761
+ top: 4px;
762
+ right: 8px;
763
+ }
764
+ }
765
+ </style>