n20-common-lib 1.2.28 → 1.2.31

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 (191) hide show
  1. package/README.md +2 -2
  2. package/package.json +88 -88
  3. package/src/_qiankun/index.js +113 -113
  4. package/src/_qiankun/postMessage.js +48 -48
  5. package/src/assets/css/_coreLib.scss +35 -35
  6. package/src/assets/css/cl-anchor.scss +23 -23
  7. package/src/assets/css/cl-approve-card.scss +58 -58
  8. package/src/assets/css/cl-dialog.scss +99 -99
  9. package/src/assets/css/cl-drag-list.scss +22 -22
  10. package/src/assets/css/cl-empty.scss +10 -10
  11. package/src/assets/css/cl-expandable-pane.scss +26 -26
  12. package/src/assets/css/cl-expandable.scss +24 -24
  13. package/src/assets/css/cl-file-upload-table.scss +11 -11
  14. package/src/assets/css/cl-filter.scss +4 -4
  15. package/src/assets/css/cl-flow-step.scss +185 -185
  16. package/src/assets/css/cl-footer-box.scss +10 -10
  17. package/src/assets/css/cl-form-item.scss +612 -612
  18. package/src/assets/css/cl-general-card.scss +11 -11
  19. package/src/assets/css/cl-layout-aside.scss +92 -92
  20. package/src/assets/css/cl-layout-content.scss +16 -16
  21. package/src/assets/css/cl-layout-header.scss +73 -73
  22. package/src/assets/css/cl-layout-tabs.scss +87 -87
  23. package/src/assets/css/cl-layout.scss +97 -97
  24. package/src/assets/css/cl-login-temporary.scss +37 -37
  25. package/src/assets/css/cl-message.scss +75 -75
  26. package/src/assets/css/cl-more-tab.scss +98 -98
  27. package/src/assets/css/cl-nav-menu.scss +5 -5
  28. package/src/assets/css/cl-pagination.scss +128 -128
  29. package/src/assets/css/cl-secondary-tab.scss +53 -53
  30. package/src/assets/css/cl-showcolumn.scss +23 -23
  31. package/src/assets/css/cl-sifting.scss +51 -51
  32. package/src/assets/css/cl-statis.scss +42 -42
  33. package/src/assets/css/cl-step.scss +73 -73
  34. package/src/assets/css/cl-suspend.scss +19 -19
  35. package/src/assets/css/cl-tertiary-tab.scss +54 -54
  36. package/src/assets/css/cl-upload.scss +41 -41
  37. package/src/assets/css/cl-worn-pagination.scss +50 -50
  38. package/src/assets/css/el-button.scss +173 -173
  39. package/src/assets/css/el-table.scss +79 -79
  40. package/src/assets/css/element-variables.scss +1061 -1061
  41. package/src/assets/css/element.dev.scss +21 -21
  42. package/src/assets/css/font-icon.scss +27 -27
  43. package/src/assets/css/index.dev.scss +4 -4
  44. package/src/assets/css/index.scss +11 -11
  45. package/src/assets/css/normalize.scss +726 -726
  46. package/src/assets/css/rootvar.scss +139 -139
  47. package/src/assets/css/select.scss +25 -25
  48. package/src/assets/css/title-pop.scss +4 -4
  49. package/src/assets/getJsonc.js +50 -50
  50. package/src/assets/realUrl.js +12 -12
  51. package/src/components/Anchor/AnchorItem.vue +29 -29
  52. package/src/components/Anchor/index.vue +185 -185
  53. package/src/components/ApprovalButtons/index.vue +233 -233
  54. package/src/components/ApprovalCard/index.vue +128 -128
  55. package/src/components/ApprovalRecord/approvalImg.vue +39 -39
  56. package/src/components/ApprovalRecord/index.vue +59 -59
  57. package/src/components/Button/button-group.vue +150 -150
  58. package/src/components/Button/icon-group-button.vue +61 -61
  59. package/src/components/Button/index.vue +56 -56
  60. package/src/components/CascaderArea/index.vue +103 -103
  61. package/src/components/ContentLoading/index.vue +41 -41
  62. package/src/components/ContentNull/index.vue +19 -19
  63. package/src/components/DatePicker/index.vue +27 -27
  64. package/src/components/DatePicker/por.vue +169 -169
  65. package/src/components/Dialog/index.vue +26 -26
  66. package/src/components/Dialog/indexO.vue +116 -116
  67. package/src/components/DragList/index.vue +75 -75
  68. package/src/components/Empty/img/abnormal.svg +108 -108
  69. package/src/components/Empty/img/dispose.svg +71 -71
  70. package/src/components/Empty/img/empty.svg +57 -57
  71. package/src/components/Empty/img/general.svg +58 -58
  72. package/src/components/Empty/img/lock.svg +57 -57
  73. package/src/components/Empty/img/network.svg +59 -59
  74. package/src/components/Empty/img/relevant.svg +68 -68
  75. package/src/components/Empty/img/search.svg +72 -72
  76. package/src/components/Empty/index.vue +92 -92
  77. package/src/components/Expandable/index.vue +49 -49
  78. package/src/components/Expandable/main.vue +52 -52
  79. package/src/components/FileExportAsync/index.vue +178 -178
  80. package/src/components/FileUploadTable/index.vue +484 -484
  81. package/src/components/Filters/index.vue +371 -371
  82. package/src/components/Filters/indexO.vue +104 -104
  83. package/src/components/FlowStep/index.vue +68 -68
  84. package/src/components/FooterBox/index.vue +21 -21
  85. package/src/components/GeneralCard/index.vue +15 -15
  86. package/src/components/InputNumber/index.vue +169 -169
  87. package/src/components/InputNumber/numberRange.vue +47 -47
  88. package/src/components/InputSearch/index.vue +75 -75
  89. package/src/components/Layout/AsideNav/index.vue +119 -119
  90. package/src/components/Layout/AsideNav/menuItem.vue +34 -34
  91. package/src/components/Layout/AsideNav/submenuTitle.vue +26 -26
  92. package/src/components/Layout/HeaderWrap/changePwd.vue +215 -215
  93. package/src/components/Layout/HeaderWrap/index.vue +373 -373
  94. package/src/components/Layout/HeaderWrap/noticePop.vue +300 -300
  95. package/src/components/Layout/SubContent/index.vue +131 -131
  96. package/src/components/Layout/TabsNav/index.vue +170 -170
  97. package/src/components/Layout/index.vue +529 -529
  98. package/src/components/Layout/utils.js +12 -12
  99. package/src/components/LoginTemporary/form.vue +561 -563
  100. package/src/components/LoginTemporary/index.vue +139 -146
  101. package/src/components/LoginTemporary/qrcode.vue +90 -90
  102. package/src/components/LoginTemporary/retrievePw.vue +372 -374
  103. package/src/components/LoginTemporary/utils.js +73 -73
  104. package/src/components/MicroApp/index.js +67 -67
  105. package/src/components/MicroFrame/index.vue +95 -95
  106. package/src/components/MoreTab/index.vue +232 -232
  107. package/src/components/NavMenu/index.vue +60 -60
  108. package/src/components/NstcG6Components/NstcDialog/NstcDialog.vue +184 -184
  109. package/src/components/PageLayout/page.vue +15 -15
  110. package/src/components/Pagination/index.vue +165 -165
  111. package/src/components/SecondaryTab/index.vue +58 -58
  112. package/src/components/SelectLazy/index.vue +75 -75
  113. package/src/components/SelectTree/SelectTreeLazy.vue +241 -241
  114. package/src/components/SelectTree/index.vue +205 -205
  115. package/src/components/ShowColumn/index.vue +213 -208
  116. package/src/components/Sifting/index.vue +99 -99
  117. package/src/components/Statis/index.vue +97 -97
  118. package/src/components/Statis/statisItem.vue +54 -54
  119. package/src/components/Statis/statisPopover.vue +55 -55
  120. package/src/components/Step/index.vue +38 -38
  121. package/src/components/Suspend/index.vue +72 -72
  122. package/src/components/Table/index.vue +209 -209
  123. package/src/components/Table/indexO.vue +149 -149
  124. package/src/components/Task/index.vue +26 -26
  125. package/src/components/TertiaryTab/index.vue +63 -63
  126. package/src/components/TimePicker/index.vue +28 -28
  127. package/src/components/Upload/index.vue +242 -242
  128. package/src/components/WornPagination/index.vue +73 -73
  129. package/src/directives/VClickOutside/index.js +19 -19
  130. package/src/directives/VHas/index.js +58 -58
  131. package/src/directives/VMove/index.js +42 -42
  132. package/src/directives/VTitle/index.js +69 -69
  133. package/src/directives/VTitle/tooltip.vue +21 -21
  134. package/src/index.js +229 -229
  135. package/src/plugins/CompatibleOld/index.js +57 -57
  136. package/src/plugins/Print/index.js +4 -4
  137. package/src/plugins/Print/print-js/.babelrc +12 -12
  138. package/src/plugins/Print/print-js/LICENSE +21 -21
  139. package/src/plugins/Print/print-js/README.md +98 -98
  140. package/src/plugins/Print/print-js/dist/print.css +96 -96
  141. package/src/plugins/Print/print-js/dist/print.js +990 -990
  142. package/src/plugins/Print/print-js/package.json +60 -60
  143. package/src/plugins/Print/print-js/src/index.d.ts +45 -45
  144. package/src/plugins/Print/print-js/src/index.js +10 -10
  145. package/src/plugins/Print/print-js/src/js/browser.js +33 -33
  146. package/src/plugins/Print/print-js/src/js/functions.js +103 -103
  147. package/src/plugins/Print/print-js/src/js/html.js +70 -70
  148. package/src/plugins/Print/print-js/src/js/image.js +48 -48
  149. package/src/plugins/Print/print-js/src/js/init.js +168 -168
  150. package/src/plugins/Print/print-js/src/js/json.js +109 -109
  151. package/src/plugins/Print/print-js/src/js/modal.js +62 -62
  152. package/src/plugins/Print/print-js/src/js/pdf.js +62 -62
  153. package/src/plugins/Print/print-js/src/js/print.js +102 -102
  154. package/src/plugins/Print/print-js/src/js/raw-html.js +15 -15
  155. package/src/plugins/Print/print-js/src/sass/index.scss +13 -13
  156. package/src/plugins/Print/print-js/src/sass/modules/_colors.scss +9 -9
  157. package/src/plugins/Print/print-js/src/sass/partials/_modal.scss +40 -40
  158. package/src/plugins/Print/print-js/src/sass/partials/_spinner.scss +45 -45
  159. package/src/plugins/Print/print.js +2 -2
  160. package/src/plugins/Print/print.scss +1 -1
  161. package/src/plugins/SetMenuTree/index.vue +41 -41
  162. package/src/plugins/SetMenuTree/logoIcon.vue +37 -37
  163. package/src/plugins/SetMenuTree/setmenutree.vue +427 -427
  164. package/src/plugins/SetMenuTree/utils.js +74 -74
  165. package/src/plugins/Sign/InfosecNetSignCNGAgent.min.js +2000 -2000
  166. package/src/plugins/Sign/index.js +65 -65
  167. package/src/plugins/Sign/sign.js +1 -1
  168. package/src/plugins/setTabsForSub.js +2 -2
  169. package/src/utils/auth.js +53 -53
  170. package/src/utils/axios.js +203 -203
  171. package/src/utils/downloadBlob.js +19 -19
  172. package/src/utils/forEachs.js +16 -16
  173. package/src/utils/getScrollContainer.js +43 -43
  174. package/src/utils/i18n/cn2hk.json +1270 -1270
  175. package/src/utils/i18n/index.js +50 -50
  176. package/src/utils/list2tree.js +36 -36
  177. package/src/utils/msgboxPor.js +26 -26
  178. package/src/utils/print.js +161 -161
  179. package/src/utils/relaNo.js +76 -76
  180. package/src/utils/repairElementUI.js +66 -66
  181. package/src/utils/urlToGo.js +82 -82
  182. package/style/css/normalize.scss +726 -726
  183. package/style/index.css +3 -3
  184. package/style/pageDemo/demo-1.vue +131 -131
  185. package/style/pageDemo/demo-2.vue +35 -35
  186. package/style/pageDemo/demo-3.vue +22 -22
  187. package/style/pageDemo/seeCode.js +20 -20
  188. package/style/server-config.jsonc +606 -606
  189. package/src/components/.DS_Store +0 -0
  190. package/src/components/Layout/.DS_Store +0 -0
  191. package/src/components/NstcG6Components/.DS_Store +0 -0
@@ -1,373 +1,373 @@
1
- /* 页头内容 */
2
- <template>
3
- <div class="flex-box flex-v p-l-s p-r-s" :class="show && 'header-wrap-show'">
4
- <img
5
- class="header-logo"
6
- :src="headerLogoUrl"
7
- alt="logo"
8
- :style="{
9
- width: headerLogoWidth,
10
- height: headerLogoHeight
11
- }"
12
- />
13
- <el-divider direction="vertical" />
14
- <!-- eslint-disable-next-line vue/no-v-html -->
15
- <h3 class="header-title" v-html="headerTitle"></h3>
16
- <el-tooltip
17
- class="set-user-btn"
18
- effect="dark"
19
- content="帮助文档"
20
- placement="top-start"
21
- >
22
- <i class="el-icon-info" @click="openHelp"></i>
23
- </el-tooltip>
24
-
25
- <el-dropdown
26
- class="m-l-m"
27
- trigger="click"
28
- placement="bottom"
29
- size="medium"
30
- @command="setUserFn"
31
- >
32
- <span class="set-user-btn el-icon-setting"></span>
33
-
34
- <el-dropdown-menu slot="dropdown">
35
- <el-dropdown-item icon="el-icon-document" command="setLang"
36
- >{{ '语言切换' | $l(i18n) }}
37
- </el-dropdown-item>
38
- <el-dropdown-item icon="el-icon-document" command="dowApp">{{
39
- '客户端下载' | $l(i18n)
40
- }}</el-dropdown-item>
41
- <el-dropdown-item
42
- v-if="false"
43
- icon="el-icon-document"
44
- command="setStyle"
45
- >{{ '主题设置' | $l(i18n) }}</el-dropdown-item
46
- >
47
- </el-dropdown-menu>
48
- </el-dropdown>
49
-
50
- <el-badge :hidden="noticeNum === 0" :value="noticeNum">
51
- <span v-popover:noticePop class="news-btn el-icon-bell"></span>
52
- </el-badge>
53
-
54
- <el-dropdown
55
- class="user-info-drop"
56
- trigger="click"
57
- placement="bottom-end"
58
- size="medium"
59
- @command="setUserFn"
60
- @visible-change="setUserVisible"
61
- >
62
- <img class="user-info-btn" :src="headerUserUrl" />
63
-
64
- <el-dropdown-menu slot="dropdown">
65
- <div
66
- class="user-info-name flex-box p-l p-r p-t-s p-b-s"
67
- style="max-width: 300px"
68
- >
69
- <span class="pointer" @click="goMdmUser">{{
70
- userInfo.userName
71
- }}</span>
72
- <div class="flex-column flex-l">
73
- <span
74
- v-title="userInfo.companyName"
75
- class="
76
- flex-item
77
- text-ellipsis
78
- m-l m-b-ss
79
- font-size-small
80
- color-primary
81
- "
82
- :show-overflow-tooltip="true"
83
- >{{ userInfo.companyName }}</span
84
- >
85
- </div>
86
- </div>
87
- <div
88
- v-for="(item, i) in rolesList"
89
- :key="i"
90
- class="text-ellipsis m-l color-ccc"
91
- >
92
- {{ item.name }}
93
- </div>
94
- <el-dropdown-item command="changePassword" divided>{{
95
- '修改密码' | $l(i18n)
96
- }}</el-dropdown-item>
97
- <el-dropdown-item command="myDeal" divided>{{
98
- '我的交易' | $l(i18n)
99
- }}</el-dropdown-item>
100
- <el-dropdown-item
101
- v-if="customOpt.agency && customOpt.agency.show"
102
- command="myAgency"
103
- divided
104
- >
105
- <div class="flex-box flex-v">
106
- <span>{{ '工作代理' | $l(i18n) }}</span>
107
- <el-badge
108
- v-if="customOpt.agency.underway"
109
- class="m-l-auto font-size-small color-primary"
110
- is-dot
111
- type="primary"
112
- style="line-height: initial"
113
- >进行中</el-badge
114
- >
115
- </div>
116
- </el-dropdown-item>
117
- <el-divider class="m-t-s m-b-s" />
118
- <div class="user-log-time p-l p-r p-b-s">
119
- <i
120
- class="el-icon-s-help m-r-s"
121
- style="color: var(--color-success)"
122
- ></i>
123
- <span style="color: var(--color-text-placeholder)"
124
- >{{ '登录时长' | $l(i18n) }} {{ durationTime }}</span
125
- >
126
- </div>
127
- <el-dropdown-item command="logOut">{{
128
- '退出登录' | $l(i18n)
129
- }}</el-dropdown-item>
130
- </el-dropdown-menu>
131
- </el-dropdown>
132
-
133
- <dialogWrap
134
- :title="'语言切换' | $l(i18n)"
135
- :visible.sync="langV"
136
- append-to-body
137
- width="560px"
138
- >
139
- <div class="b-center">
140
- <el-radio-group v-model="langVal" @change="setLang">
141
- <el-radio label="zh-cn" border>{{ '中文简体' | $l(i18n) }}</el-radio>
142
- <el-radio label="zh-hk" border>{{ '中文繁体' | $l(i18n) }}</el-radio>
143
- <el-radio label="en" border>{{ '英文' | $l(i18n) }}</el-radio>
144
- </el-radio-group>
145
- </div>
146
- </dialogWrap>
147
- <dialogWrap
148
- :title="'修改密码' | $l(i18n)"
149
- :visible.sync="cpwdV"
150
- append-to-body
151
- width="400px"
152
- >
153
- <changePwd :visible.sync="cpwdV" />
154
- </dialogWrap>
155
- <!-- 消息/通知 -->
156
- <el-popover
157
- ref="noticePop"
158
- trigger="click"
159
- width="400"
160
- @after-enter="$refs.noticeContent.show()"
161
- >
162
- <noticePop ref="noticeContent" :num.sync="noticeNum" />
163
- </el-popover>
164
- </div>
165
- </template>
166
-
167
- <script>
168
- import dialogWrap from '../../Dialog/index.vue'
169
- import changePwd from './changePwd.vue'
170
- import noticePop from './noticePop.vue'
171
- import axios from '../../../utils/axios'
172
-
173
- import getJsonc from '../../../assets/getJsonc'
174
- import realUrl from '../../../assets/realUrl'
175
- import auth from '../../../utils/auth'
176
- import { linkPush } from '../../../utils/urlToGo'
177
- import dayjs from 'dayjs'
178
- import duration from 'dayjs/plugin/duration'
179
- dayjs.extend(duration)
180
-
181
- const prefix =
182
- window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__ || process.env.BASE_URL || '/'
183
-
184
- const i18n = {
185
- 语言切换: {
186
- en: 'Language switching'
187
- },
188
- 客户端下载: {
189
- en: 'Client download'
190
- },
191
- 主题设置: {
192
- en: 'Theme setting'
193
- },
194
- 修改密码: {
195
- en: 'Change Password'
196
- },
197
- 我的交易: {
198
- en: 'My deal'
199
- },
200
- 工作代理: {
201
- en: 'My agency'
202
- },
203
- 登录时长: {
204
- en: 'Login duration'
205
- },
206
- 退出登录: {
207
- en: 'LogOut'
208
- },
209
- 小时: {
210
- en: ':'
211
- },
212
- 分: {
213
- en: ':'
214
- },
215
- 秒: {
216
- en: ':'
217
- },
218
- '确定退出,将清除未提交的临时操作,是否继续?': {
219
- en: 'Are you sure to exit? Uncommitted temporary operations will be cleared. Do you want to continue?'
220
- },
221
- 退出提示: {
222
- en: 'Exit Tips'
223
- },
224
- 中文简体: {
225
- en: 'Chinese Simplified'
226
- },
227
- 中文繁体: {
228
- en: 'Chinese Traditional'
229
- },
230
- 英文: {
231
- en: 'English'
232
- }
233
- }
234
-
235
- export default {
236
- components: {
237
- dialogWrap,
238
- changePwd,
239
- noticePop
240
- },
241
- inject: {
242
- customOpt: {
243
- type: Object,
244
- default: () => ({})
245
- }
246
- },
247
- data() {
248
- return {
249
- show: false,
250
- headerLogoUrl: undefined,
251
- headerLogoWidth: undefined,
252
- headerLogoHeight: undefined,
253
- headerTitle: undefined,
254
- headerUserUrl: undefined,
255
- userInfo: {},
256
- durationTime: '00小时00分00秒',
257
- cpwdV: false,
258
- langV: false,
259
- langVal: window.localStorage.getItem('pageLang') || 'zh-cn',
260
- noticeNum: 0,
261
- rolesList: [],
262
- i18n
263
- }
264
- },
265
- created() {
266
- getJsonc('/server-config.jsonc').then(({ _layoutData = {} }) => {
267
- this.show = true
268
-
269
- this.headerLogoUrl = realUrl(_layoutData.headerLogoUrl)
270
- this.headerUserUrl = realUrl(_layoutData.headerUserUrl)
271
- this.headerLogoWidth = _layoutData.headerLogoWidth
272
- this.headerLogoHeight = _layoutData.headerLogoHeight
273
- this.headerTitle = _layoutData.headerTitle
274
- })
275
- },
276
- methods: {
277
- // 跳转打主数据人员页面
278
- goMdmUser() {
279
- linkPush('/mdm/personnel')
280
- },
281
- setUserVisible(v) {
282
- if (v) {
283
- let loginTime = sessionStorage.getItem('loginTime')
284
- if (loginTime) {
285
- this.durationTime = dayjs.duration(Date.now() - loginTime).format(
286
- `HH${this.$l('小时', this.i18n)}
287
- mm${this.$l('分', this.i18n)}
288
- ss${this.$l('秒', this.i18n)}`
289
- )
290
- }
291
-
292
- let userInfo = JSON.parse(sessionStorage.getItem('userInfo') || '{}')
293
- this.userInfo = {
294
- userName: userInfo.uname,
295
- companyName: userInfo.cltName
296
- }
297
- this.rolesList = userInfo.roles || []
298
- }
299
- },
300
- // 打开帮助文档
301
- openHelp() {
302
- axios
303
- .get(`/bems/1.0/userManual`, {}, { responseType: 'blob' })
304
- .then((res) => {
305
- if (!res.size) {
306
- this.$message.error('暂无帮助文档,请联系管理员!')
307
- return
308
- }
309
- let url = window.URL.createObjectURL(res)
310
- let win = window.open(url, '帮助文档')
311
- setTimeout(function () {
312
- win.document.title = '帮助文档'
313
- }, 1000)
314
- })
315
- },
316
- setUserFn(c) {
317
- switch (c) {
318
- case 'setLang':
319
- // this.setLang()
320
- this.langV = true
321
- break
322
- case 'dowApp':
323
- this.dowApp()
324
- break
325
- case 'changePassword':
326
- this.changePassword()
327
- break
328
- case 'logOut':
329
- this.logOut()
330
- break
331
- default:
332
- this.$emit('custom-event', { type: c })
333
- break
334
- }
335
- },
336
- setLang() {
337
- this.langV = false
338
- window.localStorage.setItem('pageLang', this.langVal)
339
- window.location.reload()
340
- },
341
- dowApp() {
342
- // alert('客户端下载')
343
- let name = 'download.exe'
344
- let aDom = document.createElement('a')
345
- aDom.href = `${prefix}server-assets/${name}`
346
- aDom.download = name
347
- aDom.click()
348
-
349
- this.$nextTick(() => {
350
- aDom = undefined
351
- })
352
- },
353
- changePassword() {
354
- // alert('修改密码')
355
- this.cpwdV = true
356
- },
357
- logOut() {
358
- // alert('退出登录')
359
- this.$confirm(
360
- this.$l('退出将清除未保存的临时操作,请确认是否继续?', this.i18n),
361
- this.$l('退出提示', this.i18n),
362
- {
363
- confirmButtonText: this.$l('确定'),
364
- cancelButtonText: this.$l('取消'),
365
- type: 'warning'
366
- }
367
- ).then(() => {
368
- auth.removeToken()
369
- })
370
- }
371
- }
372
- }
373
- </script>
1
+ /* 页头内容 */
2
+ <template>
3
+ <div class="flex-box flex-v p-l-s p-r-s" :class="show && 'header-wrap-show'">
4
+ <img
5
+ class="header-logo"
6
+ :src="headerLogoUrl"
7
+ alt="logo"
8
+ :style="{
9
+ width: headerLogoWidth,
10
+ height: headerLogoHeight
11
+ }"
12
+ />
13
+ <el-divider direction="vertical" />
14
+ <!-- eslint-disable-next-line vue/no-v-html -->
15
+ <h3 class="header-title" v-html="headerTitle"></h3>
16
+ <el-tooltip
17
+ class="set-user-btn"
18
+ effect="dark"
19
+ content="帮助文档"
20
+ placement="top-start"
21
+ >
22
+ <i class="el-icon-info" @click="openHelp"></i>
23
+ </el-tooltip>
24
+
25
+ <el-dropdown
26
+ class="m-l-m"
27
+ trigger="click"
28
+ placement="bottom"
29
+ size="medium"
30
+ @command="setUserFn"
31
+ >
32
+ <span class="set-user-btn el-icon-setting"></span>
33
+
34
+ <el-dropdown-menu slot="dropdown">
35
+ <el-dropdown-item icon="el-icon-document" command="setLang"
36
+ >{{ '语言切换' | $l(i18n) }}
37
+ </el-dropdown-item>
38
+ <el-dropdown-item icon="el-icon-document" command="dowApp">{{
39
+ '客户端下载' | $l(i18n)
40
+ }}</el-dropdown-item>
41
+ <el-dropdown-item
42
+ v-if="false"
43
+ icon="el-icon-document"
44
+ command="setStyle"
45
+ >{{ '主题设置' | $l(i18n) }}</el-dropdown-item
46
+ >
47
+ </el-dropdown-menu>
48
+ </el-dropdown>
49
+
50
+ <el-badge :hidden="noticeNum === 0" :value="noticeNum">
51
+ <span v-popover:noticePop class="news-btn el-icon-bell"></span>
52
+ </el-badge>
53
+
54
+ <el-dropdown
55
+ class="user-info-drop"
56
+ trigger="click"
57
+ placement="bottom-end"
58
+ size="medium"
59
+ @command="setUserFn"
60
+ @visible-change="setUserVisible"
61
+ >
62
+ <img class="user-info-btn" :src="headerUserUrl" />
63
+
64
+ <el-dropdown-menu slot="dropdown">
65
+ <div
66
+ class="user-info-name flex-box p-l p-r p-t-s p-b-s"
67
+ style="max-width: 300px"
68
+ >
69
+ <span class="pointer" @click="goMdmUser">{{
70
+ userInfo.userName
71
+ }}</span>
72
+ <div class="flex-column flex-l">
73
+ <span
74
+ v-title="userInfo.companyName"
75
+ class="
76
+ flex-item
77
+ text-ellipsis
78
+ m-l m-b-ss
79
+ font-size-small
80
+ color-primary
81
+ "
82
+ :show-overflow-tooltip="true"
83
+ >{{ userInfo.companyName }}</span
84
+ >
85
+ </div>
86
+ </div>
87
+ <div
88
+ v-for="(item, i) in rolesList"
89
+ :key="i"
90
+ class="text-ellipsis m-l color-ccc"
91
+ >
92
+ {{ item.name }}
93
+ </div>
94
+ <el-dropdown-item command="changePassword" divided>{{
95
+ '修改密码' | $l(i18n)
96
+ }}</el-dropdown-item>
97
+ <el-dropdown-item command="myDeal" divided>{{
98
+ '我的交易' | $l(i18n)
99
+ }}</el-dropdown-item>
100
+ <el-dropdown-item
101
+ v-if="customOpt.agency && customOpt.agency.show"
102
+ command="myAgency"
103
+ divided
104
+ >
105
+ <div class="flex-box flex-v">
106
+ <span>{{ '工作代理' | $l(i18n) }}</span>
107
+ <el-badge
108
+ v-if="customOpt.agency.underway"
109
+ class="m-l-auto font-size-small color-primary"
110
+ is-dot
111
+ type="primary"
112
+ style="line-height: initial"
113
+ >进行中</el-badge
114
+ >
115
+ </div>
116
+ </el-dropdown-item>
117
+ <el-divider class="m-t-s m-b-s" />
118
+ <div class="user-log-time p-l p-r p-b-s">
119
+ <i
120
+ class="el-icon-s-help m-r-s"
121
+ style="color: var(--color-success)"
122
+ ></i>
123
+ <span style="color: var(--color-text-placeholder)"
124
+ >{{ '登录时长' | $l(i18n) }} {{ durationTime }}</span
125
+ >
126
+ </div>
127
+ <el-dropdown-item command="logOut">{{
128
+ '退出登录' | $l(i18n)
129
+ }}</el-dropdown-item>
130
+ </el-dropdown-menu>
131
+ </el-dropdown>
132
+
133
+ <dialogWrap
134
+ :title="'语言切换' | $l(i18n)"
135
+ :visible.sync="langV"
136
+ append-to-body
137
+ width="560px"
138
+ >
139
+ <div class="b-center">
140
+ <el-radio-group v-model="langVal" @change="setLang">
141
+ <el-radio label="zh-cn" border>{{ '中文简体' | $l(i18n) }}</el-radio>
142
+ <el-radio label="zh-hk" border>{{ '中文繁体' | $l(i18n) }}</el-radio>
143
+ <el-radio label="en" border>{{ '英文' | $l(i18n) }}</el-radio>
144
+ </el-radio-group>
145
+ </div>
146
+ </dialogWrap>
147
+ <dialogWrap
148
+ :title="'修改密码' | $l(i18n)"
149
+ :visible.sync="cpwdV"
150
+ append-to-body
151
+ width="400px"
152
+ >
153
+ <changePwd :visible.sync="cpwdV" />
154
+ </dialogWrap>
155
+ <!-- 消息/通知 -->
156
+ <el-popover
157
+ ref="noticePop"
158
+ trigger="click"
159
+ width="400"
160
+ @after-enter="$refs.noticeContent.show()"
161
+ >
162
+ <noticePop ref="noticeContent" :num.sync="noticeNum" />
163
+ </el-popover>
164
+ </div>
165
+ </template>
166
+
167
+ <script>
168
+ import dialogWrap from '../../Dialog/index.vue'
169
+ import changePwd from './changePwd.vue'
170
+ import noticePop from './noticePop.vue'
171
+ import axios from '../../../utils/axios'
172
+
173
+ import getJsonc from '../../../assets/getJsonc'
174
+ import realUrl from '../../../assets/realUrl'
175
+ import auth from '../../../utils/auth'
176
+ import { linkPush } from '../../../utils/urlToGo'
177
+ import dayjs from 'dayjs'
178
+ import duration from 'dayjs/plugin/duration'
179
+ dayjs.extend(duration)
180
+
181
+ const prefix =
182
+ window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__ || process.env.BASE_URL || '/'
183
+
184
+ const i18n = {
185
+ 语言切换: {
186
+ en: 'Language switching'
187
+ },
188
+ 客户端下载: {
189
+ en: 'Client download'
190
+ },
191
+ 主题设置: {
192
+ en: 'Theme setting'
193
+ },
194
+ 修改密码: {
195
+ en: 'Change Password'
196
+ },
197
+ 我的交易: {
198
+ en: 'My deal'
199
+ },
200
+ 工作代理: {
201
+ en: 'My agency'
202
+ },
203
+ 登录时长: {
204
+ en: 'Login duration'
205
+ },
206
+ 退出登录: {
207
+ en: 'LogOut'
208
+ },
209
+ 小时: {
210
+ en: ':'
211
+ },
212
+ 分: {
213
+ en: ':'
214
+ },
215
+ 秒: {
216
+ en: ':'
217
+ },
218
+ '确定退出,将清除未提交的临时操作,是否继续?': {
219
+ en: 'Are you sure to exit? Uncommitted temporary operations will be cleared. Do you want to continue?'
220
+ },
221
+ 退出提示: {
222
+ en: 'Exit Tips'
223
+ },
224
+ 中文简体: {
225
+ en: 'Chinese Simplified'
226
+ },
227
+ 中文繁体: {
228
+ en: 'Chinese Traditional'
229
+ },
230
+ 英文: {
231
+ en: 'English'
232
+ }
233
+ }
234
+
235
+ export default {
236
+ components: {
237
+ dialogWrap,
238
+ changePwd,
239
+ noticePop
240
+ },
241
+ inject: {
242
+ customOpt: {
243
+ type: Object,
244
+ default: () => ({})
245
+ }
246
+ },
247
+ data() {
248
+ return {
249
+ show: false,
250
+ headerLogoUrl: undefined,
251
+ headerLogoWidth: undefined,
252
+ headerLogoHeight: undefined,
253
+ headerTitle: undefined,
254
+ headerUserUrl: undefined,
255
+ userInfo: {},
256
+ durationTime: '00小时00分00秒',
257
+ cpwdV: false,
258
+ langV: false,
259
+ langVal: window.localStorage.getItem('pageLang') || 'zh-cn',
260
+ noticeNum: 0,
261
+ rolesList: [],
262
+ i18n
263
+ }
264
+ },
265
+ created() {
266
+ getJsonc('/server-config.jsonc').then(({ _layoutData = {} }) => {
267
+ this.show = true
268
+
269
+ this.headerLogoUrl = realUrl(_layoutData.headerLogoUrl)
270
+ this.headerUserUrl = realUrl(_layoutData.headerUserUrl)
271
+ this.headerLogoWidth = _layoutData.headerLogoWidth
272
+ this.headerLogoHeight = _layoutData.headerLogoHeight
273
+ this.headerTitle = _layoutData.headerTitle
274
+ })
275
+ },
276
+ methods: {
277
+ // 跳转打主数据人员页面
278
+ goMdmUser() {
279
+ linkPush('/mdm/personnel')
280
+ },
281
+ setUserVisible(v) {
282
+ if (v) {
283
+ let loginTime = sessionStorage.getItem('loginTime')
284
+ if (loginTime) {
285
+ this.durationTime = dayjs.duration(Date.now() - loginTime).format(
286
+ `HH${this.$l('小时', this.i18n)}
287
+ mm${this.$l('分', this.i18n)}
288
+ ss${this.$l('秒', this.i18n)}`
289
+ )
290
+ }
291
+
292
+ let userInfo = JSON.parse(sessionStorage.getItem('userInfo') || '{}')
293
+ this.userInfo = {
294
+ userName: userInfo.uname,
295
+ companyName: userInfo.cltName
296
+ }
297
+ this.rolesList = userInfo.roles || []
298
+ }
299
+ },
300
+ // 打开帮助文档
301
+ openHelp() {
302
+ axios
303
+ .get(`/bems/1.0/userManual`, {}, { responseType: 'blob' })
304
+ .then((res) => {
305
+ if (!res.size) {
306
+ this.$message.error('暂无帮助文档,请联系管理员!')
307
+ return
308
+ }
309
+ let url = window.URL.createObjectURL(res)
310
+ let win = window.open(url, '帮助文档')
311
+ setTimeout(function () {
312
+ win.document.title = '帮助文档'
313
+ }, 1000)
314
+ })
315
+ },
316
+ setUserFn(c) {
317
+ switch (c) {
318
+ case 'setLang':
319
+ // this.setLang()
320
+ this.langV = true
321
+ break
322
+ case 'dowApp':
323
+ this.dowApp()
324
+ break
325
+ case 'changePassword':
326
+ this.changePassword()
327
+ break
328
+ case 'logOut':
329
+ this.logOut()
330
+ break
331
+ default:
332
+ this.$emit('custom-event', { type: c })
333
+ break
334
+ }
335
+ },
336
+ setLang() {
337
+ this.langV = false
338
+ window.localStorage.setItem('pageLang', this.langVal)
339
+ window.location.reload()
340
+ },
341
+ dowApp() {
342
+ // alert('客户端下载')
343
+ let name = 'download.exe'
344
+ let aDom = document.createElement('a')
345
+ aDom.href = `${prefix}server-assets/${name}`
346
+ aDom.download = name
347
+ aDom.click()
348
+
349
+ this.$nextTick(() => {
350
+ aDom = undefined
351
+ })
352
+ },
353
+ changePassword() {
354
+ // alert('修改密码')
355
+ this.cpwdV = true
356
+ },
357
+ logOut() {
358
+ // alert('退出登录')
359
+ this.$confirm(
360
+ this.$l('退出将清除未保存的临时操作,请确认是否继续?', this.i18n),
361
+ this.$l('退出提示', this.i18n),
362
+ {
363
+ confirmButtonText: this.$l('确定'),
364
+ cancelButtonText: this.$l('取消'),
365
+ type: 'warning'
366
+ }
367
+ ).then(() => {
368
+ auth.removeToken()
369
+ })
370
+ }
371
+ }
372
+ }
373
+ </script>