qj-common 4.3.0 → 4.3.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.
Files changed (229) 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/upload.js +8 -8
  17. package/src/components/Bounced/index.vue +145 -145
  18. package/src/components/Breadcrumb/index.vue +71 -71
  19. package/src/components/Checkbox/index.vue +53 -53
  20. package/src/components/Hamburger/index.vue +48 -48
  21. package/src/components/Logistics/logic.vue +186 -186
  22. package/src/components/ScrollBar/index.vue +60 -60
  23. package/src/components/Sticky/index.vue +76 -76
  24. package/src/components/SvgIcon/index.vue +42 -42
  25. package/src/components/ThemePicker/index.vue +243 -243
  26. package/src/components/Tinymce/components/editorImage.vue +94 -94
  27. package/src/components/Tinymce/index.vue +166 -166
  28. package/src/components/Tinymce/plugins.js +7 -7
  29. package/src/components/Tinymce/toolbar.js +6 -6
  30. package/src/components/TreeTable/customEval.js +44 -44
  31. package/src/components/TreeTable/eval.js +29 -29
  32. package/src/components/TreeTable/index.vue +124 -124
  33. package/src/components/TreeTable/readme.md +89 -89
  34. package/src/components/TreeTableApi/customEval.js +49 -49
  35. package/src/components/TreeTableApi/eval.js +29 -29
  36. package/src/components/TreeTableApi/index.vue +124 -124
  37. package/src/components/TreeTableApi/readme.md +89 -89
  38. package/src/components/Upload/singleImage.vue +123 -123
  39. package/src/components/Upload/singleImage2.vue +118 -118
  40. package/src/components/Upload/singleImage3.vue +138 -138
  41. package/src/components/Upload/upload.vue +295 -295
  42. package/src/components/workOrderList/index.vue +158 -158
  43. package/src/dependencies.js +119 -119
  44. package/src/iconShop/demo.css +539 -539
  45. package/src/iconShop/demo_index.html +8445 -8445
  46. package/src/iconShop/iconfont.css +1451 -1451
  47. package/src/iconShop/iconfont.json +2522 -2522
  48. package/src/iconShop/iconfont.svg +1070 -1070
  49. package/src/iconfont/demo.css +539 -539
  50. package/src/iconfont/demo_index.html +5276 -5276
  51. package/src/iconfont/iconfont.css +905 -905
  52. package/src/iconfont/iconfont.json +1563 -1563
  53. package/src/iconfont/iconfont.svg +692 -692
  54. package/src/icons/index.js +9 -9
  55. package/src/lang/e.js +48 -48
  56. package/src/lang/en.js +48 -48
  57. package/src/lang/zh.js +48 -48
  58. package/src/main.js +62 -62
  59. package/src/permission.js +283 -283
  60. package/src/permissionForMall.backup.js +375 -375
  61. package/src/permissionForMall.js +375 -375
  62. package/src/preset.js +67 -67
  63. package/src/router/_import_common.js +1 -1
  64. package/src/router/_import_development.js +1 -1
  65. package/src/router/_import_production.js +1 -1
  66. package/src/store/getters.js +39 -39
  67. package/src/store/index.js +18 -18
  68. package/src/store/modules/app.js +34 -30
  69. package/src/store/modules/menu.js +82 -82
  70. package/src/store/modules/user.js +227 -227
  71. package/src/styles/element-ui.scss +1368 -1368
  72. package/src/styles/index.scss +166 -166
  73. package/src/styles/mixin.scss +27 -27
  74. package/src/styles/pc-ui.scss +1031 -1031
  75. package/src/styles/scrollBar.scss +21 -21
  76. package/src/styles/sidebar.scss +123 -123
  77. package/src/styles/transition.scss +32 -32
  78. package/src/styles/variables.scss +44 -44
  79. package/src/styles/wf-ui.scss +86 -86
  80. package/src/utils/auth.js +57 -57
  81. package/src/utils/dom.js +12 -12
  82. package/src/utils/getQueryString.js +5 -5
  83. package/src/utils/import.js +5 -5
  84. package/src/utils/index.js +355 -355
  85. package/src/utils/interceptor.js +34 -34
  86. package/src/utils/menu.js +116 -116
  87. package/src/utils/proapp.js +35 -35
  88. package/src/utils/query.js +26 -26
  89. package/src/utils/request.js +366 -366
  90. package/src/utils/routeMapping.js +39 -39
  91. package/src/utils/routeMapping.json +310 -310
  92. package/src/utils/utils.js +84 -84
  93. package/src/utils/validate.js +102 -102
  94. package/src/views/404.vue +72 -72
  95. package/src/views/Layout.vue +106 -106
  96. package/src/views/imgSwiper/index.vue +34 -34
  97. package/src/views/layout/Layout.vue +181 -170
  98. package/src/views/layout/components/AppMain.vue +20 -20
  99. package/src/views/layout/components/Footer.vue +22 -22
  100. package/src/views/layout/components/LeftNavbar.vue +318 -310
  101. package/src/views/layout/components/NavMenu.vue +15 -15
  102. package/src/views/layout/components/Navbar.vue +664 -661
  103. package/src/views/layout/components/Sidebar/SidebarItem.vue +116 -113
  104. package/src/views/layout/components/Sidebar/index.vue +203 -193
  105. package/src/views/layout/components/index.js +19 -19
  106. package/src/views/layout/theme/darkBlue/Layout.vue +140 -140
  107. package/src/views/layout/theme/darkBlue/components/AppMain.vue +38 -38
  108. package/src/views/layout/theme/darkBlue/components/Footer.vue +147 -147
  109. 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
  110. package/src/views/layout/theme/darkBlue/components/LeftNavbar.3.vue +191 -191
  111. package/src/views/layout/theme/darkBlue/components/LeftNavbar.vue +466 -466
  112. package/src/views/layout/theme/darkBlue/components/Navbar.vue +200 -200
  113. package/src/views/layout/theme/darkBlue/components/Sidebar/SidebarItem.vue +71 -71
  114. package/src/views/layout/theme/darkBlue/components/Sidebar/index.vue +49 -49
  115. package/src/views/layout/theme/darkBlue/components/index.js +15 -15
  116. package/src/views/layout-default/Layout.vue +134 -134
  117. package/src/views/layout-default/components/AppMain.vue +19 -19
  118. package/src/views/layout-default/components/Footer.vue +22 -22
  119. package/src/views/layout-default/components/LeftNavbar.vue +164 -164
  120. package/src/views/layout-default/components/Navbar.vue +295 -295
  121. package/src/views/layout-default/components/Sidebar/SidebarItem.vue +67 -67
  122. package/src/views/layout-default/components/Sidebar/index.vue +59 -59
  123. package/src/views/layout-default/components/index.js +4 -4
  124. package/src/views/layout-default/theme/darkBlue/Layout.vue +140 -140
  125. package/src/views/layout-default/theme/darkBlue/components/AppMain.vue +38 -38
  126. package/src/views/layout-default/theme/darkBlue/components/Footer.vue +147 -147
  127. package/src/views/layout-default/theme/darkBlue/components/LeftNavbar.vue +465 -465
  128. package/src/views/layout-default/theme/darkBlue/components/Navbar.vue +200 -200
  129. package/src/views/layout-default/theme/darkBlue/components/Sidebar/SidebarItem.vue +69 -69
  130. package/src/views/layout-default/theme/darkBlue/components/Sidebar/index.vue +49 -49
  131. package/src/views/layout-default/theme/darkBlue/components/index.js +15 -15
  132. package/src/views/pc/Internationalization.vue +80 -80
  133. package/src/views/pc/default/Layout.vue +442 -442
  134. package/src/views/pc/default/LayoutCard.vue +424 -424
  135. package/src/views/pc/default/assets/flex.scss +99 -99
  136. package/src/views/pc/default/footer-modules/DgFooter/index.vue +179 -179
  137. package/src/views/pc/default/footer-modules/DgFooter/indexSDX.vue +187 -187
  138. package/src/views/pc/default/footer-modules/footer.vue +171 -171
  139. package/src/views/pc/default/footer-modules/footerAns.vue +167 -167
  140. package/src/views/pc/default/footer-modules/footerBulk.vue +169 -169
  141. package/src/views/pc/default/footer-modules/footerDM.vue +254 -254
  142. package/src/views/pc/default/footer-modules/footerDefault.vue +267 -267
  143. package/src/views/pc/default/footer-modules/footerDefaultA.vue +270 -270
  144. package/src/views/pc/default/footer-modules/footerDefaultNew.vue +201 -201
  145. package/src/views/pc/default/footer-modules/footerHDB.vue +153 -153
  146. package/src/views/pc/default/footer-modules/footerHy.vue +63 -63
  147. package/src/views/pc/default/footer-modules/footerKYW.vue +163 -163
  148. package/src/views/pc/default/footer-modules/footerMh.vue +30 -30
  149. package/src/views/pc/default/footer-modules/footerNew.vue +116 -116
  150. package/src/views/pc/default/footer-modules/footer_yzj.vue +169 -169
  151. package/src/views/pc/default/footer-modules/footerayd.vue +85 -85
  152. package/src/views/pc/default/footer-modules/ymFooter.vue +154 -154
  153. package/src/views/pc/default/footer-modules/zgl.vue +250 -250
  154. package/src/views/pc/default/header-modules/DgHeader/Logo.vue +57 -57
  155. package/src/views/pc/default/header-modules/DgHeader/Search.vue +135 -135
  156. package/src/views/pc/default/header-modules/DgHeader/Settleup.vue +46 -46
  157. package/src/views/pc/default/header-modules/DgHeader/index.vue +38 -38
  158. package/src/views/pc/default/header-modules/active.vue +177 -177
  159. package/src/views/pc/default/header-modules/header.vue +97 -97
  160. package/src/views/pc/default/header-modules/headerA.vue +142 -142
  161. package/src/views/pc/default/header-modules/headerFLPT.vue +157 -157
  162. package/src/views/pc/default/header-modules/headerMh.vue +187 -187
  163. package/src/views/pc/default/header-modules/headerNew.vue +121 -121
  164. package/src/views/pc/default/header-modules/headerSDX.vue +304 -304
  165. package/src/views/pc/default/header-modules/headerStyle2.vue +173 -173
  166. package/src/views/pc/default/header-modules/headerStyle3.vue +190 -190
  167. package/src/views/pc/default/header-modules/headerStyle4.vue +163 -163
  168. package/src/views/pc/default/header-modules/headerStyleAns.vue +400 -400
  169. package/src/views/pc/default/header-modules/headerStyleBulk.vue +427 -427
  170. package/src/views/pc/default/header-modules/headerStyleDefalut.vue +209 -209
  171. package/src/views/pc/default/header-modules/headerStyleKYW.vue +435 -435
  172. package/src/views/pc/default/header-modules/headerStyle_yzj.vue +427 -427
  173. package/src/views/pc/default/header-modules/headerayd.vue +187 -187
  174. package/src/views/pc/default/header-modules/index.vue +466 -466
  175. package/src/views/pc/default/header-modules/ymHeader.vue +292 -292
  176. package/src/views/pc/default/header-modules/ysHeader.vue +248 -248
  177. package/src/views/pc/default/header-modules/zgl.vue +855 -855
  178. package/src/views/pc/default/leftMenu-modules/leftMenu-logo.vue +194 -194
  179. package/src/views/pc/default/leftMenu-modules/leftMenu-style2.vue +206 -206
  180. package/src/views/pc/default/leftMenu-modules/leftMenu-style3.vue +207 -207
  181. package/src/views/pc/default/leftMenu-modules/leftMenu-style4.vue +192 -192
  182. package/src/views/pc/default/leftMenu-modules/leftMenu.vue +183 -183
  183. package/src/views/pc/default/leftMenu-modules/leftMenuDefault.vue +212 -212
  184. package/src/views/pc/default/leftMenu-modules/leftMenuDefaultEn.vue +214 -214
  185. package/src/views/pc/default/leftMenu-modules/leftMenuDefaultFLPT.vue +220 -220
  186. package/src/views/pc/default/leftMenu-modules/leftMenuDefaultayd.vue +220 -220
  187. package/src/views/pc/default/nav-modules/nav.vue +52 -52
  188. package/src/views/pc/default/nav-modules/navAns.vue +60 -60
  189. package/src/views/pc/default/nav-modules/navBulk.vue +60 -60
  190. package/src/views/pc/default/top-modules/DgTopShortcut/index.vue +177 -177
  191. package/src/views/pc/default/top-modules/Toplg.vue +280 -280
  192. package/src/views/pc/default/top-modules/topA.vue +136 -136
  193. package/src/views/pc/default/top-modules/topAns.vue +261 -261
  194. package/src/views/pc/default/top-modules/topAns_yzj.vue +282 -282
  195. package/src/views/pc/default/top-modules/topBar.vue +304 -304
  196. package/src/views/pc/default/top-modules/topBulk.vue +280 -280
  197. package/src/views/pc/default/top-modules/topDefault.vue +244 -244
  198. package/src/views/pc/default/top-modules/topDefaultDM.vue +197 -197
  199. package/src/views/pc/default/top-modules/topDefaultNew.vue +271 -271
  200. package/src/views/pc/default/top-modules/topFLPT.vue +197 -197
  201. package/src/views/pc/default/top-modules/topHDB.vue +479 -479
  202. package/src/views/pc/default/top-modules/topKYW.vue +258 -258
  203. package/src/views/pc/default/top-modules/topMh.vue +174 -174
  204. package/src/views/pc/default/top-modules/topNew.vue +97 -97
  205. package/src/views/pc/default/top-modules/topSDX.vue +298 -298
  206. package/src/views/pc/default/top-modules/topSimple.vue +247 -247
  207. package/src/views/pc/default/top-modules/topSimpleHy.vue +256 -256
  208. package/src/views/pc/default/top-modules/topUcc.vue +264 -264
  209. package/src/views/pc/default/top-modules/topayd.vue +170 -170
  210. package/src/views/pc/default/top-modules/ymTop.vue +299 -299
  211. package/src/views/pc/default/top-modules/zgltop.vue +499 -499
  212. package/src/views/routerView.vue +9 -9
  213. package/src/views/templates/components/temp-select.vue +80 -80
  214. package/src/views/templates/components/temp-upload.vue +233 -233
  215. package/src/views/templates/readme.md +2 -2
  216. package/src/views/templates/templateInput.vue +421 -421
  217. package/src/views/templates/templateReadme.html +588 -588
  218. package/src/views/templates/templateReadme.md +619 -619
  219. package/src/views/templates/templateTable.vue +2243 -2243
  220. package/src/views/templates/templateTableData.vue +1883 -1883
  221. package/src/views/templates/templateUi/templateTableContent.vue +187 -187
  222. package/src/views/treeTemplate/index.vue +559 -559
  223. package/src/views/treeTemplate/treeTemplate.md +274 -274
  224. package/src/views/uploadDialog/index copy.vue +352 -352
  225. package/src/views/uploadDialog/index.vue +558 -558
  226. package/src/views/uploadDialog/indexOlay.vue +582 -582
  227. package/src/views/uploadDialog/indexPM.vue +578 -578
  228. package/src/views/uploadDialog/indexUpload.vue +543 -543
  229. package/src/views/uploadDialog/readme.md +45 -45
@@ -1,661 +1,664 @@
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' : '']" :style="{ background: '#bda16f' }"></li>
29
- <li @click="themeClick('2c4158')" :class="[activeColor == '2c4158' ? 'active' : '']" :style="{ background: '#2c4158' }"></li>
30
- </ul>
31
- <!-- <el-button class="theme-box" slot="reference">主题</el-button> -->
32
- </el-popover>
33
-
34
- <div class="user_name">
35
- <p class="user-bar">
36
- <!-- <i class="user-icon"></i> -->
37
- <!-- <span class="user_line"></span> -->
38
- <!-- <i class="icon-yonghu-outline iconfont"></i> -->
39
- <span class="user-remark" v-if="proappRemark && proappRemark.length > 0">
40
- <el-popover placement="bottom" width="300" trigger="hover">
41
- <p>{{ proappRemark[0] }}</p>
42
- <img :src="proappRemark[1]" alt="" width="300px" />
43
- <i slot="reference">{{ proappRemark[0] }} </i>
44
- </el-popover>
45
- </span>
46
-
47
- <!-- <span class="user_line"></span> -->
48
- <!-- <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
- >
55
- <i class="el-icon-bell" @click="jumpToPage"></i>
56
- </el-badge>
57
- <span class="user-name" @click="lookInfo">
58
- <i style="padding-right: 10px">{{ this.merberCompname }}</i>
59
- {{ $store.state.user.name }}
60
- </span>
61
- </p>
62
- </div>
63
- <!-- <i class="set-icon"></i>
64
- <i class="info-icon"></i>-->
65
- <!-- <span class="spl_line"></span> -->
66
- <div class="log_uot">
67
- <i class="icon-tuichu1 iconfont" @click="logout"></i>
68
- <!-- <span class="logout-text" @click="logout">退出</span> -->
69
- </div>
70
- </div>
71
- <el-dialog title="登录账户信息" :visible.sync="centerDialogVisible" width="23%" center>
72
- <el-form label-width="100px" style="padding-bottom: 20px;">
73
- <el-form-item label="登录名:">
74
- {{ name }}
75
- </el-form-item>
76
- <el-form-item label="手机号:">
77
- {{ phone | hidePhone }}
78
- </el-form-item>
79
- <el-form-item label="所属公司:">
80
- {{ compony }}
81
- </el-form-item>
82
- <el-form-item label="角色:">
83
- {{ role }}
84
- </el-form-item>
85
- </el-form>
86
- <!-- <div>联系人:</div> -->
87
- <!-- <img :src="proappRemark[1]" alt=""> -->
88
- <!-- <div class="loginInfo-Block-left">
89
- <div>登录名:</div>
90
- <div>手机号:</div>
91
- <div>所属公司:</div>
92
- <div>角色:</div>
93
- </div>
94
- <div class="loginInfo-Block-right">
95
- <div>{{ name }}</div>
96
- <div>{{ phone | hidePhone }}</div>
97
- <div>{{ compony }}</div>
98
- <div>{{ role }}</div>
99
- </div> -->
100
- </el-dialog>
101
- <!-- <el-dropdown class="avatar-container" trigger="click">
102
- <div class="avatar-wrapper">
103
- <img class="user-avatar" src="https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif?imageView2/1/w/80/h/80">
104
- <i class="el-icon-caret-bottom"></i>
105
- </div>
106
- <el-dropdown-menu class="user-dropdown" slot="dropdown">
107
- <router-link class="inlineBlock" to="/">
108
- <el-dropdown-item>
109
- Home
110
- </el-dropdown-item>
111
- </router-link>
112
- <el-dropdown-item divided>
113
- <span @click="logout" style="display:block;">LogOut</span>
114
- </el-dropdown-item>
115
- </el-dropdown-menu>
116
- </el-dropdown>-->
117
- </el-menu>
118
- </div>
119
- </template>
120
-
121
- <script>
122
- import { mapGetters } from 'vuex';
123
- import Breadcrumb from '#/components/Breadcrumb';
124
- import Hamburger from '#/components/Hamburger';
125
- import { getUserserviceInfo, getSSOAuthInfo } from '../../../api/login';
126
- import axios from 'axios';
127
- import qs from 'qs';
128
-
129
- export default {
130
- components: {
131
- Breadcrumb,
132
- Hamburger,
133
- },
134
- props: {
135
- firstLevelMenu: String,
136
- secondLevelMenu: String,
137
- thirdLevelMenu: String,
138
- },
139
- data() {
140
- return {
141
- unreadMessageNum:0,
142
- activeColor: '2c4158',
143
- menuList: '',
144
- menuCode:'',
145
- merberCompname: '',
146
- centerDialogVisible: false,
147
- name: '',
148
- phone: '',
149
- compony: '',
150
- role: '',
151
- type: null,
152
- ssoSubscriptionKey: '',
153
- proappEnvLayout: '',
154
- proappRemark: [],
155
-
156
- gapTime: '',
157
- beforeUnloadTime: '',
158
- secDomainName: null,
159
- };
160
- },
161
- computed: {
162
- ...mapGetters(['sidebar']),
163
- },
164
- created() {
165
- this.merberCompname = sessionStorage.getItem('personalInfo') ? JSON.parse(sessionStorage.getItem('personalInfo')).merberCompname : '';
166
- this.proappEnvLayout = window.sessionStorage.getItem('proappEnvLayout') ? JSON.parse(window.sessionStorage.getItem('proappEnvLayout')) : '';
167
-
168
- if (this.proappEnvLayout && this.proappEnvLayout.proappRemark) {
169
- this.proappRemark = this.proappEnvLayout.proappRemark.split('>');
170
- }
171
-
172
- console.log(window.location.href, 'window.location.href本地路由');
173
- 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
- }
197
- }
198
-
199
- if(this.proappEnvLayout && this.proappEnvLayout.tenantCode == '2021122100000001') this.watchLocalStorage()
200
- },
201
- mounted() {
202
- // 监听 beforeunload 离开或者刷新页面触发
203
- window.addEventListener('beforeunload', (e) => this.beforeunloadFn(e));
204
- // 监听 unload
205
- window.addEventListener('unload', (e) => this.unloadFn());
206
-
207
- this.type = this.$route.query.type || null;
208
- this.secDomainName = sessionStorage.getItem('secDomainName') ? sessionStorage.getItem('secDomainName') : null;
209
- },
210
- filters: {
211
- hidePhone: function (value) {
212
- var myreg = /^[1][3,4,5,7,8][0-9]{9}$/; //判断为手机号的正则
213
- if (!myreg.test(value)) {
214
- return value;
215
- } else {
216
- return value.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2');
217
- }
218
- },
219
- },
220
- methods: {
221
- /**
222
- * 监听保存到本地的未读消息数量用来显示角标
223
- */
224
- watchLocalStorage(){
225
- // 监听localStorage的变化
226
- window.addEventListener('storage', event=>{
227
- if (event.key === 'unreadMessageNum') {
228
- // 处理数据变化的逻辑
229
- this.unreadMessageNum = Number(event.newValue)
230
- }
231
- });
232
- },
233
- /**
234
- * 跳转到消息列表页面
235
- */
236
- jumpToPage(){
237
- location.href = '/paas/b2b-bus-pc-ayd/index.html#/msgList'
238
- },
239
- /**
240
- * beforeunload function
241
- */
242
- beforeunloadFn() {
243
- // 记录当前时间
244
- this.beforeUnloadTime = new Date().getTime();
245
- },
246
-
247
- /**
248
- * unload function
249
- */
250
- unloadFn() {
251
- this.gapTime = new Date().getTime() - this.beforeUnloadTime;
252
- if (this.gapTime < 5) {
253
- //请求退出接口
254
- this.logout();
255
- }
256
- },
257
-
258
- lookInfo() {
259
- // 这边修改导航用户登陆信息按钮
260
- // location.href = `${
261
- // location.origin
262
- // }/paas/buyer-manager/index.html#/operatorInfo`;
263
- this.centerDialogVisible = true;
264
- // console.log("我被调用了北鼻")
265
- },
266
- toggleSideBar() {
267
- this.$store.commit('TOGGLE_SIDEBAR_APPNAV');
268
- },
269
- logout() {
270
- window.localStorage.removeItem('pohcode');
271
- this.menuList = window.sessionStorage.getItem('menuList') ? window.sessionStorage.getItem('menuList') : '';
272
- this.menuCode = window.sessionStorage.getItem('menuCode') ? window.sessionStorage.getItem('menuCode') : '';
273
- this.proappEnvLayout = window.sessionStorage.getItem('proappEnvLayout') ? window.sessionStorage.getItem('proappEnvLayout') : '';
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
- this.$store.dispatch('GetAppRouter').then((reg) => {
358
- window.sessionStorage.setItem('menuList', JSON.stringify(reg));
359
- });
360
-
361
- this.$store.commit('ADD_MENU', []);
362
- console.log('logout---->params---->', JSON.parse(this.proappEnvLayout).proappCode);
363
- // 九洲云腾登出操作
364
- // if (JSON.parse(this.proappEnvLayout).proappCode === '063') {
365
- // this.iDsManagerLogout(paramsArr);
366
- // } else {
367
- let path = '';
368
- if (this.proappEnvLayout && this.proappEnvLayout != null && this.proappEnvLayout != '') {
369
- path = JSON.parse(this.proappEnvLayout).proappEnvIndexr;
370
- } else {
371
- path = '/paas/index/index.html';
372
- }
373
- console.log(path, window.location.origin, 'logout');
374
- if (window.location.origin) {
375
- //this.secDomainName
376
- if (this.secDomainName && this.secDomainName != 'null' && this.secDomainName != window.location.origin) {
377
- window.location.href = `${this.secDomainName}${path}`;
378
- } else {
379
- window.location.href = `${window.location.origin}${path}`;
380
- }
381
- //无论url是什么,强制刷新页面,另外reload()有true和false参
382
- window.location.reload()
383
- } else {
384
- window.location.href = path;
385
- window.location.reload()
386
- }
387
- // }
388
- });
389
- },
390
-
391
- themeClick(color) {
392
- this.activeColor = color;
393
- this.$emit('themeClick', color);
394
- },
395
- },
396
-
397
- destroyed() {
398
- window.removeEventListener('beforeunload', (e) => this.beforeunloadFn());
399
- window.removeEventListener('unload', (e) => this.unloadFn());
400
- },
401
- };
402
- </script>
403
-
404
- <style rel="stylesheet/scss" lang="scss" scoped>
405
- .loginInfo-Block-left {
406
- width: 39%;
407
- height: 100%;
408
- text-align: right;
409
- display: inline-block;
410
- }
411
- .loginInfo-Block-left > div {
412
- margin-bottom: 25px;
413
- }
414
- .loginInfo-Block-right {
415
- width: 50%;
416
- height: 100%;
417
- display: inline-block;
418
- img {
419
- width: 120px;
420
- height: 120px;
421
- }
422
- }
423
- .loginInfo-Block-right > div {
424
- margin-bottom: 25px;
425
- }
426
- .theme-color-box {
427
- li {
428
- width: 40px;
429
- height: 20px;
430
- border: 1px solid #e0e0e0;
431
- cursor: pointer;
432
- float: left;
433
- margin: 5px;
434
- opacity: 0.3;
435
- &.active {
436
- opacity: 1;
437
- }
438
- }
439
- }
440
- .user-bar {
441
- }
442
- .user-remark {
443
- display: inline-block;
444
- width: 530px;
445
- white-space: nowrap;
446
- overflow: hidden;
447
- text-overflow: ellipsis;
448
- float: left;
449
- font-size: 12px;
450
- cursor: pointer;
451
- text-align: right;
452
- padding-right: 20px;
453
- position: relative;
454
- }
455
-
456
- .user-name {
457
- font-size: 14px;
458
- // line-height: 30px;
459
- // margin-top: -1px;
460
- // display: inline-block;
461
- float: right;
462
-
463
- cursor: pointer;
464
- }
465
- .nav-head {
466
- flex: 1;
467
- display: inline-flex;
468
- justify-content: flex-end;
469
- align-items: center;
470
- color: #bbbbbb;
471
- margin-right: 15px;
472
- align-items:center
473
- // font-weight: normal;
474
- // transition: all 10s linear;
475
- // i {
476
- // display: inline-block;
477
- // width: 18px;
478
- // height: 18px;
479
- // // margin-right: 25px;
480
- // cursor: pointer;
481
- // }
482
- // .user_name {
483
- // cursor: pointer;
484
- // margin-right: 15px;
485
- // p {
486
- // width: 100%;
487
- // line-height: 24px;
488
- // height: 24px;
489
- // display: inline-table;
490
- // // .user-icon {
491
- // // vertical-align: middle;
492
- // // background: url("../../../assets/nav/admin.png") no-repeat;
493
- // // background-size: 80%;
494
- // // }
495
- // // .user_line {
496
- // // border: 1px solid #f8f8f8;
497
- // // margin: 0 5px;
498
- // // }
499
- // }
500
- // &:hover {
501
- // // .user-icon {
502
- // // vertical-align: middle;
503
- // // background-image: url("../../../assets/nav/admin-hover.png");
504
- // // background-size: 100% 100%;
505
- // // }
506
- // p {
507
- // color: #409dff;
508
- // }
509
- // }
510
- // }
511
-
512
- .spl_line {
513
- height: 40px;
514
- border: 1px solid #f8f8f8;
515
- line-height: 46px;
516
- margin-right: 15px;
517
- }
518
- .log_uot {
519
- // height: 24px;
520
- // line-height: 24px;
521
- // width: 24px;
522
- cursor: pointer;
523
- margin-left: 12px;
524
- // .logout-icon {
525
- // vertical-align: middle;
526
- // background: url("../../../assets/nav/logout.png") no-repeat;
527
- // background-size: 80%;
528
- // }
529
- .logout-text {
530
- position: absolute;
531
- bottom: -15px;
532
- font-size: 12px;
533
- }
534
- &:hover {
535
- // .logout-icon {
536
- // vertical-align: middle;
537
- // background-image: url("../../../assets/nav/logout-hover.png");
538
- // background-size: 100% 100%;
539
- // }
540
- color: #409dff;
541
- .logout-text {
542
- color: #409dff;
543
- }
544
- }
545
- }
546
- }
547
- .theme-box {
548
- border: none;
549
- background: none;
550
- margin-right: 30px;
551
- &:active {
552
- background: none;
553
- color: #409dff;
554
- }
555
- &:hover {
556
- background: none;
557
- color: #409dff;
558
- }
559
- &:focus {
560
- background: none;
561
- color: #409dff;
562
- }
563
- &:visited {
564
- background: none;
565
- color: #409dff;
566
- }
567
- }
568
- // .logout-text:hover{
569
- // font-weight: bold;
570
- // color:#3ca1ec;
571
- // }
572
- // .logout-text{
573
- // margin:0 25px 0 8px;cursor:pointer;
574
- // }
575
- // .nav-head i{
576
- // display: inline-block;
577
- // width: 18px;
578
- // height: 18px;
579
- // // margin-right: 25px;
580
- // cursor: pointer;
581
- // }
582
- // .nav-head p{
583
- // margin-right: 15px;
584
- // }
585
-
586
- .set-icon {
587
- background-image: url('../../../assets/nav/set.png');
588
- background-size: 100% 100%;
589
- }
590
-
591
- .info-icon {
592
- background-image: url('../../../assets/nav/info.png');
593
- background-size: 100% 100%;
594
- }
595
- .navbar {
596
- height: 50px;
597
- line-height: 50px;
598
- display: flex;
599
- box-sizing: border-box;
600
- border-radius: 0 !important;
601
- position: relative;
602
- &-title {
603
- font-size: 14px;
604
- color: #333;
605
- margin-left: 12px;
606
- // cursor: pointer;
607
- ul {
608
- li:last-child {
609
- color: #999;
610
- }
611
- i {
612
- margin: 0 10px;
613
- color: #999;
614
- }
615
- }
616
- }
617
- .hamburger-container {
618
- line-height: 30px;
619
- height: 30px;
620
- float: left;
621
- padding: 0 14px 0 20px;
622
- }
623
- .screenfull {
624
- position: absolute;
625
- right: 90px;
626
- top: 16px;
627
- color: red;
628
- }
629
- .avatar-container {
630
- height: 46px;
631
- display: inline-block;
632
- position: absolute;
633
- right: 35px;
634
- .avatar-wrapper {
635
- cursor: pointer;
636
- margin-top: 5px;
637
- position: relative;
638
- .user-avatar {
639
- width: 40px;
640
- height: 40px;
641
- border-radius: 10px;
642
- }
643
- .el-icon-caret-bottom {
644
- position: absolute;
645
- right: -20px;
646
- top: 25px;
647
- font-size: 12px;
648
- }
649
- }
650
- }
651
- }
652
- /deep/ .msg-icon{
653
- display:inline;
654
- cursor: pointer;
655
- margin-right:20px;
656
- .el-badge__content.is-fixed{
657
- top:4px;
658
- right: 8px;
659
- }
660
- }
661
- </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
+ <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' : '']" :style="{ background: '#bda16f' }"></li>
29
+ <li @click="themeClick('2c4158')" :class="[activeColor == '2c4158' ? 'active' : '']" :style="{ background: '#2c4158' }"></li>
30
+ </ul>
31
+ <!-- <el-button class="theme-box" slot="reference">主题</el-button> -->
32
+ </el-popover>
33
+
34
+ <div class="user_name">
35
+ <p class="user-bar">
36
+ <!-- <i class="user-icon"></i> -->
37
+ <!-- <span class="user_line"></span> -->
38
+ <!-- <i class="icon-yonghu-outline iconfont"></i> -->
39
+ <span class="user-remark" v-if="proappRemark && proappRemark.length > 0">
40
+ <el-popover placement="bottom" width="300" trigger="hover">
41
+ <p>{{ proappRemark[0] }}</p>
42
+ <img :src="proappRemark[1]" alt="" width="300px" />
43
+ <i slot="reference">{{ proappRemark[0] }} </i>
44
+ </el-popover>
45
+ </span>
46
+
47
+ <!-- <span class="user_line"></span> -->
48
+ <!-- <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
+ >
55
+ <i class="el-icon-bell" @click="jumpToPage"></i>
56
+ </el-badge>
57
+ <span class="user-name" @click="lookInfo">
58
+ <i style="padding-right: 10px">{{ this.merberCompname }}</i>
59
+ {{ $store.state.user.name }}
60
+ </span>
61
+ </p>
62
+ </div>
63
+ <!-- <i class="set-icon"></i>
64
+ <i class="info-icon"></i>-->
65
+ <!-- <span class="spl_line"></span> -->
66
+ <div class="log_uot">
67
+ <i class="icon-tuichu1 iconfont" @click="logout"></i>
68
+ <!-- <span class="logout-text" @click="logout">退出</span> -->
69
+ </div>
70
+ </div>
71
+ <el-dialog title="登录账户信息" :visible.sync="centerDialogVisible" width="23%" center>
72
+ <el-form label-width="100px" style="padding-bottom: 20px;">
73
+ <el-form-item label="登录名:">
74
+ {{ name }}
75
+ </el-form-item>
76
+ <el-form-item label="手机号:">
77
+ {{ phone | hidePhone }}
78
+ </el-form-item>
79
+ <el-form-item label="所属公司:">
80
+ {{ compony }}
81
+ </el-form-item>
82
+ <el-form-item label="角色:">
83
+ {{ role }}
84
+ </el-form-item>
85
+ </el-form>
86
+ <!-- <div>联系人:</div> -->
87
+ <!-- <img :src="proappRemark[1]" alt=""> -->
88
+ <!-- <div class="loginInfo-Block-left">
89
+ <div>登录名:</div>
90
+ <div>手机号:</div>
91
+ <div>所属公司:</div>
92
+ <div>角色:</div>
93
+ </div>
94
+ <div class="loginInfo-Block-right">
95
+ <div>{{ name }}</div>
96
+ <div>{{ phone | hidePhone }}</div>
97
+ <div>{{ compony }}</div>
98
+ <div>{{ role }}</div>
99
+ </div> -->
100
+ </el-dialog>
101
+ <!-- <el-dropdown class="avatar-container" trigger="click">
102
+ <div class="avatar-wrapper">
103
+ <img class="user-avatar" src="https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif?imageView2/1/w/80/h/80">
104
+ <i class="el-icon-caret-bottom"></i>
105
+ </div>
106
+ <el-dropdown-menu class="user-dropdown" slot="dropdown">
107
+ <router-link class="inlineBlock" to="/">
108
+ <el-dropdown-item>
109
+ Home
110
+ </el-dropdown-item>
111
+ </router-link>
112
+ <el-dropdown-item divided>
113
+ <span @click="logout" style="display:block;">LogOut</span>
114
+ </el-dropdown-item>
115
+ </el-dropdown-menu>
116
+ </el-dropdown>-->
117
+ </el-menu>
118
+ </div>
119
+ </template>
120
+
121
+ <script>
122
+ import { mapGetters } from 'vuex';
123
+ import Breadcrumb from '#/components/Breadcrumb';
124
+ import Hamburger from '#/components/Hamburger';
125
+ import { getUserserviceInfo, getSSOAuthInfo } from '../../../api/login';
126
+ import axios from 'axios';
127
+ import qs from 'qs';
128
+
129
+ export default {
130
+ components: {
131
+ Breadcrumb,
132
+ Hamburger,
133
+ },
134
+ props: {
135
+ firstLevelMenu: String,
136
+ secondLevelMenu: String,
137
+ thirdLevelMenu: String,
138
+ },
139
+ data() {
140
+ return {
141
+ unreadMessageNum:0,
142
+ activeColor: '2c4158',
143
+ menuList: '',
144
+ menuCode:'',
145
+ merberCompname: '',
146
+ centerDialogVisible: false,
147
+ name: '',
148
+ phone: '',
149
+ compony: '',
150
+ role: '',
151
+ type: null,
152
+ ssoSubscriptionKey: '',
153
+ proappEnvLayout: '',
154
+ proappRemark: [],
155
+
156
+ gapTime: '',
157
+ beforeUnloadTime: '',
158
+ secDomainName: null,
159
+ };
160
+ },
161
+ computed: {
162
+ ...mapGetters(['sidebar']),
163
+ },
164
+ created() {
165
+ this.merberCompname = sessionStorage.getItem('personalInfo') ? JSON.parse(sessionStorage.getItem('personalInfo')).merberCompname : '';
166
+ this.proappEnvLayout = window.sessionStorage.getItem('proappEnvLayout') ? JSON.parse(window.sessionStorage.getItem('proappEnvLayout')) : '';
167
+
168
+ if (this.proappEnvLayout && this.proappEnvLayout.proappRemark) {
169
+ this.proappRemark = this.proappEnvLayout.proappRemark.split('>');
170
+ }
171
+
172
+ console.log(window.location.href, 'window.location.href本地路由');
173
+ 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
+ }
197
+ }
198
+
199
+ if(this.proappEnvLayout && this.proappEnvLayout.tenantCode == '2021122100000001') this.watchLocalStorage()
200
+ },
201
+ mounted() {
202
+ // 监听 beforeunload 离开或者刷新页面触发
203
+ window.addEventListener('beforeunload', (e) => this.beforeunloadFn(e));
204
+ // 监听 unload
205
+ window.addEventListener('unload', (e) => this.unloadFn());
206
+
207
+ this.type = this.$route.query.type || null;
208
+ this.secDomainName = sessionStorage.getItem('secDomainName') ? sessionStorage.getItem('secDomainName') : null;
209
+ },
210
+ filters: {
211
+ hidePhone: function (value) {
212
+ var myreg = /^[1][3,4,5,7,8][0-9]{9}$/; //判断为手机号的正则
213
+ if (!myreg.test(value)) {
214
+ return value;
215
+ } else {
216
+ return value.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2');
217
+ }
218
+ },
219
+ },
220
+ methods: {
221
+ /**
222
+ * 监听保存到本地的未读消息数量用来显示角标
223
+ */
224
+ watchLocalStorage(){
225
+ // 监听localStorage的变化
226
+ window.addEventListener('storage', event=>{
227
+ if (event.key === 'unreadMessageNum') {
228
+ // 处理数据变化的逻辑
229
+ this.unreadMessageNum = Number(event.newValue)
230
+ }
231
+ });
232
+ },
233
+ /**
234
+ * 跳转到消息列表页面
235
+ */
236
+ jumpToPage(){
237
+ location.href = '/paas/b2b-bus-pc-ayd/index.html#/msgList'
238
+ },
239
+ /**
240
+ * beforeunload function
241
+ */
242
+ beforeunloadFn() {
243
+ // 记录当前时间
244
+ this.beforeUnloadTime = new Date().getTime();
245
+ },
246
+
247
+ /**
248
+ * unload function
249
+ */
250
+ unloadFn() {
251
+ this.gapTime = new Date().getTime() - this.beforeUnloadTime;
252
+ if (this.gapTime < 5) {
253
+ //请求退出接口
254
+ this.logout();
255
+ }
256
+ },
257
+
258
+ lookInfo() {
259
+ // 这边修改导航用户登陆信息按钮
260
+ // location.href = `${
261
+ // location.origin
262
+ // }/paas/buyer-manager/index.html#/operatorInfo`;
263
+ this.centerDialogVisible = true;
264
+ // console.log("我被调用了北鼻")
265
+ },
266
+ toggleSideBar() {
267
+ this.$store.commit('TOGGLE_SIDEBAR_APPNAV');
268
+ },
269
+ logout() {
270
+ window.localStorage.removeItem('pohcode');
271
+ this.menuList = window.sessionStorage.getItem('menuList') ? window.sessionStorage.getItem('menuList') : '';
272
+ this.menuCode = window.sessionStorage.getItem('menuCode') ? window.sessionStorage.getItem('menuCode') : '';
273
+ this.proappEnvLayout = window.sessionStorage.getItem('proappEnvLayout') ? window.sessionStorage.getItem('proappEnvLayout') : '';
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
+ this.$store.dispatch('GetAppRouter').then((reg) => {
358
+ window.sessionStorage.setItem('menuList', JSON.stringify(reg));
359
+ });
360
+
361
+ this.$store.commit('ADD_MENU', []);
362
+ console.log('logout---->params---->', JSON.parse(this.proappEnvLayout).proappCode);
363
+ // 九洲云腾登出操作
364
+ // if (JSON.parse(this.proappEnvLayout).proappCode === '063') {
365
+ // this.iDsManagerLogout(paramsArr);
366
+ // } else {
367
+ let path = '';
368
+ if (this.proappEnvLayout && this.proappEnvLayout != null && this.proappEnvLayout != '') {
369
+ path = JSON.parse(this.proappEnvLayout).proappEnvIndexr;
370
+ } else {
371
+ path = '/paas/index/index.html';
372
+ }
373
+ console.log(path, window.location.origin, 'logout');
374
+ if (window.location.origin) {
375
+ //this.secDomainName
376
+ if (this.secDomainName && this.secDomainName != 'null' && this.secDomainName != window.location.origin) {
377
+ window.location.href = `${this.secDomainName}${path}`;
378
+ } else {
379
+ window.location.href = `${window.location.origin}${path}`;
380
+ }
381
+ //无论url是什么,强制刷新页面,另外reload()有true和false参
382
+ window.location.reload()
383
+ } else {
384
+ window.location.href = path;
385
+ window.location.reload()
386
+ }
387
+ // }
388
+ });
389
+ },
390
+
391
+ themeClick(color) {
392
+ this.activeColor = color;
393
+ this.$emit('themeClick', color);
394
+ },
395
+ },
396
+
397
+ destroyed() {
398
+ window.removeEventListener('beforeunload', (e) => this.beforeunloadFn());
399
+ window.removeEventListener('unload', (e) => this.unloadFn());
400
+ },
401
+ };
402
+ </script>
403
+
404
+ <style rel="stylesheet/scss" lang="scss" scoped>
405
+ .flex{
406
+ display: flex;
407
+ }
408
+ .loginInfo-Block-left {
409
+ width: 39%;
410
+ height: 100%;
411
+ text-align: right;
412
+ display: inline-block;
413
+ }
414
+ .loginInfo-Block-left > div {
415
+ margin-bottom: 25px;
416
+ }
417
+ .loginInfo-Block-right {
418
+ width: 50%;
419
+ height: 100%;
420
+ display: inline-block;
421
+ img {
422
+ width: 120px;
423
+ height: 120px;
424
+ }
425
+ }
426
+ .loginInfo-Block-right > div {
427
+ margin-bottom: 25px;
428
+ }
429
+ .theme-color-box {
430
+ li {
431
+ width: 40px;
432
+ height: 20px;
433
+ border: 1px solid #e0e0e0;
434
+ cursor: pointer;
435
+ float: left;
436
+ margin: 5px;
437
+ opacity: 0.3;
438
+ &.active {
439
+ opacity: 1;
440
+ }
441
+ }
442
+ }
443
+ .user-bar {
444
+ }
445
+ .user-remark {
446
+ display: inline-block;
447
+ width: 530px;
448
+ white-space: nowrap;
449
+ overflow: hidden;
450
+ text-overflow: ellipsis;
451
+ float: left;
452
+ font-size: 12px;
453
+ cursor: pointer;
454
+ text-align: right;
455
+ padding-right: 20px;
456
+ position: relative;
457
+ }
458
+
459
+ .user-name {
460
+ font-size: 14px;
461
+ // line-height: 30px;
462
+ // margin-top: -1px;
463
+ // display: inline-block;
464
+ float: right;
465
+
466
+ cursor: pointer;
467
+ }
468
+ .nav-head {
469
+ flex: 1;
470
+ display: inline-flex;
471
+ justify-content: flex-end;
472
+ align-items: center;
473
+ color: #bbbbbb;
474
+ margin-right: 15px;
475
+ align-items:center
476
+ // font-weight: normal;
477
+ // transition: all 10s linear;
478
+ // i {
479
+ // display: inline-block;
480
+ // width: 18px;
481
+ // height: 18px;
482
+ // // margin-right: 25px;
483
+ // cursor: pointer;
484
+ // }
485
+ // .user_name {
486
+ // cursor: pointer;
487
+ // margin-right: 15px;
488
+ // p {
489
+ // width: 100%;
490
+ // line-height: 24px;
491
+ // height: 24px;
492
+ // display: inline-table;
493
+ // // .user-icon {
494
+ // // vertical-align: middle;
495
+ // // background: url("../../../assets/nav/admin.png") no-repeat;
496
+ // // background-size: 80%;
497
+ // // }
498
+ // // .user_line {
499
+ // // border: 1px solid #f8f8f8;
500
+ // // margin: 0 5px;
501
+ // // }
502
+ // }
503
+ // &:hover {
504
+ // // .user-icon {
505
+ // // vertical-align: middle;
506
+ // // background-image: url("../../../assets/nav/admin-hover.png");
507
+ // // background-size: 100% 100%;
508
+ // // }
509
+ // p {
510
+ // color: #409dff;
511
+ // }
512
+ // }
513
+ // }
514
+
515
+ .spl_line {
516
+ height: 40px;
517
+ border: 1px solid #f8f8f8;
518
+ line-height: 46px;
519
+ margin-right: 15px;
520
+ }
521
+ .log_uot {
522
+ // height: 24px;
523
+ // line-height: 24px;
524
+ // width: 24px;
525
+ cursor: pointer;
526
+ margin-left: 12px;
527
+ // .logout-icon {
528
+ // vertical-align: middle;
529
+ // background: url("../../../assets/nav/logout.png") no-repeat;
530
+ // background-size: 80%;
531
+ // }
532
+ .logout-text {
533
+ position: absolute;
534
+ bottom: -15px;
535
+ font-size: 12px;
536
+ }
537
+ &:hover {
538
+ // .logout-icon {
539
+ // vertical-align: middle;
540
+ // background-image: url("../../../assets/nav/logout-hover.png");
541
+ // background-size: 100% 100%;
542
+ // }
543
+ color: #409dff;
544
+ .logout-text {
545
+ color: #409dff;
546
+ }
547
+ }
548
+ }
549
+ }
550
+ .theme-box {
551
+ border: none;
552
+ background: none;
553
+ margin-right: 30px;
554
+ &:active {
555
+ background: none;
556
+ color: #409dff;
557
+ }
558
+ &:hover {
559
+ background: none;
560
+ color: #409dff;
561
+ }
562
+ &:focus {
563
+ background: none;
564
+ color: #409dff;
565
+ }
566
+ &:visited {
567
+ background: none;
568
+ color: #409dff;
569
+ }
570
+ }
571
+ // .logout-text:hover{
572
+ // font-weight: bold;
573
+ // color:#3ca1ec;
574
+ // }
575
+ // .logout-text{
576
+ // margin:0 25px 0 8px;cursor:pointer;
577
+ // }
578
+ // .nav-head i{
579
+ // display: inline-block;
580
+ // width: 18px;
581
+ // height: 18px;
582
+ // // margin-right: 25px;
583
+ // cursor: pointer;
584
+ // }
585
+ // .nav-head p{
586
+ // margin-right: 15px;
587
+ // }
588
+
589
+ .set-icon {
590
+ background-image: url('../../../assets/nav/set.png');
591
+ background-size: 100% 100%;
592
+ }
593
+
594
+ .info-icon {
595
+ background-image: url('../../../assets/nav/info.png');
596
+ background-size: 100% 100%;
597
+ }
598
+ .navbar {
599
+ height: 50px;
600
+ line-height: 50px;
601
+ display: flex;
602
+ box-sizing: border-box;
603
+ border-radius: 0 !important;
604
+ position: relative;
605
+ &-title {
606
+ font-size: 14px;
607
+ color: #333;
608
+ margin-left: 12px;
609
+ // cursor: pointer;
610
+ ul {
611
+ li:last-child {
612
+ color: #999;
613
+ }
614
+ i {
615
+ margin: 0 10px;
616
+ color: #999;
617
+ }
618
+ }
619
+ }
620
+ .hamburger-container {
621
+ line-height: 30px;
622
+ height: 30px;
623
+ float: left;
624
+ padding: 0 14px 0 20px;
625
+ }
626
+ .screenfull {
627
+ position: absolute;
628
+ right: 90px;
629
+ top: 16px;
630
+ color: red;
631
+ }
632
+ .avatar-container {
633
+ height: 46px;
634
+ display: inline-block;
635
+ position: absolute;
636
+ right: 35px;
637
+ .avatar-wrapper {
638
+ cursor: pointer;
639
+ margin-top: 5px;
640
+ position: relative;
641
+ .user-avatar {
642
+ width: 40px;
643
+ height: 40px;
644
+ border-radius: 10px;
645
+ }
646
+ .el-icon-caret-bottom {
647
+ position: absolute;
648
+ right: -20px;
649
+ top: 25px;
650
+ font-size: 12px;
651
+ }
652
+ }
653
+ }
654
+ }
655
+ /deep/ .msg-icon{
656
+ display:inline;
657
+ cursor: pointer;
658
+ margin-right:20px;
659
+ .el-badge__content.is-fixed{
660
+ top:4px;
661
+ right: 8px;
662
+ }
663
+ }
664
+ </style>