n20-common-lib 1.2.39 → 1.2.42

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 (188) 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 +44 -44
  56. package/src/components/ApprovalRecord/flowDialog.vue +45 -45
  57. package/src/components/ApprovalRecord/index.vue +59 -59
  58. package/src/components/Button/button-group.vue +150 -150
  59. package/src/components/Button/icon-group-button.vue +61 -61
  60. package/src/components/Button/index.vue +56 -56
  61. package/src/components/CascaderArea/index.vue +103 -103
  62. package/src/components/ContentLoading/index.vue +41 -41
  63. package/src/components/ContentNull/index.vue +19 -19
  64. package/src/components/DatePicker/index.vue +27 -27
  65. package/src/components/DatePicker/por.vue +169 -169
  66. package/src/components/Dialog/index.vue +26 -26
  67. package/src/components/Dialog/indexO.vue +116 -116
  68. package/src/components/DragList/index.vue +75 -75
  69. package/src/components/Empty/img/abnormal.svg +108 -108
  70. package/src/components/Empty/img/dispose.svg +71 -71
  71. package/src/components/Empty/img/empty.svg +57 -57
  72. package/src/components/Empty/img/general.svg +58 -58
  73. package/src/components/Empty/img/lock.svg +57 -57
  74. package/src/components/Empty/img/network.svg +59 -59
  75. package/src/components/Empty/img/relevant.svg +68 -68
  76. package/src/components/Empty/img/search.svg +72 -72
  77. package/src/components/Empty/index.vue +92 -92
  78. package/src/components/Expandable/index.vue +49 -49
  79. package/src/components/Expandable/main.vue +52 -52
  80. package/src/components/FileExportAsync/index.vue +178 -178
  81. package/src/components/FileUploadTable/index.vue +484 -484
  82. package/src/components/Filters/index.vue +371 -371
  83. package/src/components/Filters/indexO.vue +104 -104
  84. package/src/components/FlowStep/index.vue +68 -68
  85. package/src/components/FooterBox/index.vue +21 -21
  86. package/src/components/GeneralCard/index.vue +15 -15
  87. package/src/components/InputNumber/index.vue +169 -169
  88. package/src/components/InputNumber/numberRange.vue +47 -47
  89. package/src/components/InputSearch/index.vue +75 -75
  90. package/src/components/Layout/AsideNav/index.vue +120 -119
  91. package/src/components/Layout/AsideNav/menuItem.vue +34 -34
  92. package/src/components/Layout/AsideNav/submenuTitle.vue +26 -26
  93. package/src/components/Layout/HeaderWrap/changePwd.vue +215 -215
  94. package/src/components/Layout/HeaderWrap/index.vue +371 -371
  95. package/src/components/Layout/HeaderWrap/noticePop.vue +316 -316
  96. package/src/components/Layout/SubContent/index.vue +127 -127
  97. package/src/components/Layout/TabsNav/index.vue +170 -170
  98. package/src/components/Layout/index.vue +518 -518
  99. package/src/components/Layout/utils.js +12 -12
  100. package/src/components/LoginTemporary/form.vue +570 -570
  101. package/src/components/LoginTemporary/index.vue +139 -139
  102. package/src/components/LoginTemporary/retrievePw.vue +372 -372
  103. package/src/components/MicroApp/index.js +67 -67
  104. package/src/components/MicroFrame/index.vue +95 -95
  105. package/src/components/MoreTab/index.vue +232 -232
  106. package/src/components/NavMenu/index.vue +60 -60
  107. package/src/components/PageLayout/page.vue +15 -15
  108. package/src/components/Pagination/index.vue +165 -165
  109. package/src/components/SecondaryTab/index.vue +58 -58
  110. package/src/components/SelectLazy/index.vue +75 -75
  111. package/src/components/SelectTree/SelectTreeLazy.vue +241 -241
  112. package/src/components/SelectTree/index.vue +205 -205
  113. package/src/components/ShowColumn/index.vue +213 -213
  114. package/src/components/Sifting/index.vue +99 -99
  115. package/src/components/Statis/index.vue +97 -97
  116. package/src/components/Statis/statisItem.vue +54 -54
  117. package/src/components/Statis/statisPopover.vue +55 -55
  118. package/src/components/Step/index.vue +38 -38
  119. package/src/components/Suspend/index.vue +72 -72
  120. package/src/components/Table/index.vue +209 -209
  121. package/src/components/Table/indexO.vue +149 -149
  122. package/src/components/Task/index.vue +26 -26
  123. package/src/components/TertiaryTab/index.vue +63 -63
  124. package/src/components/TimePicker/index.vue +28 -28
  125. package/src/components/Upload/index.vue +242 -242
  126. package/src/components/WornPagination/index.vue +73 -73
  127. package/src/directives/VClickOutside/index.js +19 -19
  128. package/src/directives/VHas/index.js +58 -58
  129. package/src/directives/VMove/index.js +42 -42
  130. package/src/directives/VTitle/index.js +69 -69
  131. package/src/directives/VTitle/tooltip.vue +21 -21
  132. package/src/index.js +232 -232
  133. package/src/plugins/CompatibleOld/index.js +57 -57
  134. package/src/plugins/Print/index.js +4 -4
  135. package/src/plugins/Print/print-js/.babelrc +12 -12
  136. package/src/plugins/Print/print-js/LICENSE +21 -21
  137. package/src/plugins/Print/print-js/README.md +98 -98
  138. package/src/plugins/Print/print-js/dist/print.css +96 -96
  139. package/src/plugins/Print/print-js/dist/print.js +990 -990
  140. package/src/plugins/Print/print-js/package.json +60 -60
  141. package/src/plugins/Print/print-js/src/index.d.ts +45 -45
  142. package/src/plugins/Print/print-js/src/index.js +10 -10
  143. package/src/plugins/Print/print-js/src/js/browser.js +33 -33
  144. package/src/plugins/Print/print-js/src/js/functions.js +103 -103
  145. package/src/plugins/Print/print-js/src/js/html.js +70 -70
  146. package/src/plugins/Print/print-js/src/js/image.js +48 -48
  147. package/src/plugins/Print/print-js/src/js/init.js +168 -168
  148. package/src/plugins/Print/print-js/src/js/json.js +109 -109
  149. package/src/plugins/Print/print-js/src/js/modal.js +62 -62
  150. package/src/plugins/Print/print-js/src/js/pdf.js +62 -62
  151. package/src/plugins/Print/print-js/src/js/print.js +102 -102
  152. package/src/plugins/Print/print-js/src/js/raw-html.js +15 -15
  153. package/src/plugins/Print/print-js/src/sass/index.scss +13 -13
  154. package/src/plugins/Print/print-js/src/sass/modules/_colors.scss +9 -9
  155. package/src/plugins/Print/print-js/src/sass/partials/_modal.scss +40 -40
  156. package/src/plugins/Print/print-js/src/sass/partials/_spinner.scss +45 -45
  157. package/src/plugins/Print/print.js +2 -2
  158. package/src/plugins/Print/print.scss +1 -1
  159. package/src/plugins/SetMenuTree/index.vue +41 -41
  160. package/src/plugins/SetMenuTree/logoIcon.vue +37 -37
  161. package/src/plugins/SetMenuTree/setmenutree.vue +427 -427
  162. package/src/plugins/SetMenuTree/utils.js +74 -74
  163. package/src/plugins/Sign/InfosecNetSignCNGAgent.min.js +2000 -2000
  164. package/src/plugins/Sign/index.js +65 -65
  165. package/src/plugins/Sign/sign.js +1 -1
  166. package/src/plugins/setTabsForSub.js +2 -2
  167. package/src/utils/auth.js +53 -53
  168. package/src/utils/axios.js +203 -203
  169. package/src/utils/downloadBlob.js +19 -19
  170. package/src/utils/forEachs.js +16 -16
  171. package/src/utils/getScrollContainer.js +43 -43
  172. package/src/utils/i18n/cn2hk.json +1270 -1270
  173. package/src/utils/i18n/index.js +50 -50
  174. package/src/utils/list2tree.js +36 -36
  175. package/src/utils/msgboxPor.js +26 -26
  176. package/src/utils/print.js +161 -161
  177. package/src/utils/relaNo.js +72 -72
  178. package/src/utils/repairElementUI.js +95 -66
  179. package/src/utils/urlToGo.js +82 -82
  180. package/style/css/normalize.scss +726 -0
  181. package/style/index.css +3 -3
  182. package/style/index.css.map +1 -1
  183. package/style/pageDemo/demo-1.vue +131 -0
  184. package/style/pageDemo/demo-2.vue +35 -0
  185. package/style/pageDemo/demo-3.vue +22 -0
  186. package/style/pageDemo/seeCode.js +20 -0
  187. package/style/server-config.jsonc +606 -0
  188. package/src/components/NstcG6Components/NstcDialog/NstcDialog.vue +0 -185
@@ -1,570 +1,570 @@
1
- <template>
2
- <!-- eslint-disable no-irregular-whitespace -->
3
- <div v-loading="loadingV" class="login-form-wrap flex-column p-a">
4
- <slot name="header"></slot>
5
- <svg class="cut-qrcode-h">
6
- <image
7
- v-if="theType === 'qrcode'"
8
- width="52"
9
- height="52"
10
- xlink:href="./qrt.png"
11
- />
12
- <image v-else width="52" height="52" xlink:href="./qr.png" />
13
- <path d="M0,0L52,0L52,52Z" @click="cutQrcode" />
14
- </svg>
15
- <!-- 账号/密码登录 -->
16
- <div v-if="theType === 'account'" class="flex-item">
17
- <el-form
18
- ref="login-form"
19
- :model="form"
20
- :rules="rules"
21
- :hide-required-asterisk="true"
22
- @submit.native.prevent="submitLogin"
23
- >
24
- <el-form-item class="m-b" label="账号" prop="username">
25
- <el-input v-model="form.username" placeholder="请输入账号" />
26
- </el-form-item>
27
- <el-form-item class="m-b" label="密码" prop="password">
28
- <el-input
29
- v-model="form.password"
30
- placeholder="请输入密码"
31
- show-password
32
- />
33
- <!-- 不自动填充密码
34
- <input
35
- v-model="fakePwd"
36
- type="password"
37
- name="password"
38
- hidden="hidden"
39
- @change="fakePwd = 'a1b2c3d4'"
40
- />
41
- <el-input
42
- v-model="form.password"
43
- placeholder="请输入密码"
44
- :class="{ 'login-password': !showPwd }"
45
- >
46
- <i
47
- slot="suffix"
48
- class="el-input__icon el-icon-view"
49
- style="pointer-events: all"
50
- @click.stop="showPwd = !showPwd"
51
- ></i>
52
- </el-input>
53
- 不自动填充密码End -->
54
- </el-form-item>
55
- <el-button
56
- class="m-t"
57
- type="primary"
58
- native-type="submit"
59
- style="width: 100%"
60
- >登 录</el-button
61
- >
62
- </el-form>
63
- </div>
64
- <!-- 二维码扫码登录 -->
65
- <qrCode v-else-if="theType === 'qrcode'" @qrcode-login="QrcodeLogin" />
66
- <!-- 手机验证码登录 -->
67
- <div v-if="theType === 'pthon'" class="flex-item">
68
- <el-form
69
- ref="login-form"
70
- :model="form"
71
- :rules="rules"
72
- :hide-required-asterisk="true"
73
- @submit.native.prevent="submitLogin"
74
- >
75
- <el-form-item class="m-b" label="手机号" prop="phone">
76
- <el-input v-model="form.phone" placeholder="请输入手机号" />
77
- </el-form-item>
78
- <el-form-item class="m-b" label="验证码" prop="code">
79
- <br />
80
- <div class="flex-box">
81
- <el-input
82
- v-model="form.code"
83
- class="flex-item m-r-s"
84
- placeholder="请输入验证码"
85
- />
86
- <el-button
87
- plain
88
- style="4em"
89
- :disabled="!form.phone || codeNum !== '验证码'"
90
- @click="sendMsg('phone', '手机号')"
91
- >{{ codeNum }}</el-button
92
- >
93
- </div>
94
- </el-form-item>
95
- <el-button
96
- class="m-t"
97
- type="primary"
98
- native-type="submit"
99
- style="width: 100%"
100
- >登 录</el-button
101
- >
102
- </el-form>
103
- </div>
104
- <!-- 账户密码验证码登录 -->
105
- <div v-if="theType === 'accountPthon'" class="flex-item">
106
- <el-form
107
- ref="login-form"
108
- :model="form"
109
- :rules="rules"
110
- :hide-required-asterisk="true"
111
- @submit.native.prevent="submitLogin"
112
- >
113
- <el-form-item class="m-b" label="账号" prop="username">
114
- <el-input v-model="form.username" placeholder="请输入账号" />
115
- </el-form-item>
116
- <el-form-item class="m-b" label="密码" prop="password">
117
- <el-input
118
- v-model="form.password"
119
- placeholder="请输入密码"
120
- show-password
121
- />
122
- </el-form-item>
123
- <el-form-item class="m-b" label="验证码" prop="code">
124
- <br />
125
- <div class="flex-box">
126
- <el-input
127
- v-model="form.code"
128
- class="flex-item m-r-s"
129
- placeholder="请输入验证码"
130
- />
131
- <el-button
132
- plain
133
- style="4em"
134
- :disabled="!form.username || codeNum !== '验证码'"
135
- @click="sendMsg('username', '账户')"
136
- >{{ codeNum }}</el-button
137
- >
138
- </div>
139
- </el-form-item>
140
- <el-button
141
- class="m-t"
142
- type="primary"
143
- native-type="submit"
144
- style="width: 100%"
145
- >登 录</el-button
146
- >
147
- </el-form>
148
- </div>
149
- <!-- -->
150
- <div v-if="theType !== 'qrcode'" class="flex-box flex-lr m-t-s m-b-s">
151
- <el-dropdown
152
- size="mini"
153
- placement="bottom-start"
154
- @command="changeLoginType"
155
- >
156
- <span>其他登录方式</span>
157
- <el-dropdown-menu slot="dropdown">
158
- <template v-for="item in loginTypes">
159
- <el-dropdown-item
160
- v-if="item !== theType"
161
- :key="item"
162
- :command="item"
163
- >{{ loginTypeMap[item] }}</el-dropdown-item
164
- >
165
- </template>
166
- </el-dropdown-menu>
167
- </el-dropdown>
168
-
169
- <el-link :underline="false" @click="forgetPw">忘记密码</el-link>
170
- </div>
171
- <slot name="footer"></slot>
172
- </div>
173
- </template>
174
-
175
- <script>
176
- import decode from 'jsonwebtoken/decode'
177
- import axios from '../../utils/axios'
178
- import auth from '../../utils/auth'
179
- import qrCode from './qrcode.vue'
180
- import { siteTree2menus, siteTree2RelaNos } from './utils'
181
-
182
- function encode(pwd = '', key = 0) {
183
- if (pwd === '') return ''
184
-
185
- let pwdArr = pwd.trim().split('')
186
- let resultArr = pwdArr.map((oPwd) =>
187
- String.fromCharCode(oPwd.charCodeAt() ^ key)
188
- )
189
- let result = resultArr.join('')
190
-
191
- return window.btoa(window.unescape(window.encodeURIComponent(result)))
192
- }
193
-
194
- export default {
195
- name: 'LoginForm',
196
- components: {
197
- qrCode
198
- },
199
- props: {
200
- loginTypes: {
201
- type: Array,
202
- default: () => ['account']
203
- },
204
- loginThen: {
205
- type: Function,
206
- default: undefined
207
- }
208
- },
209
- data() {
210
- return {
211
- showPwd: false,
212
- fakePwd: 'a1b2c3d4',
213
- loadingV: false,
214
- loginTypeMap: {
215
- account: '账号密码登录',
216
- pthon: '手机验证码登录',
217
- qrcode: '二维码扫码登录',
218
- accountPthon: '账户密码验证码登录'
219
- },
220
- theType: this.loginTypes[0],
221
- userNo: undefined,
222
- form: {
223
- username: '',
224
- password: '',
225
- code: ''
226
- },
227
- pwd: '',
228
- rules: {
229
- username: [{ required: true, message: '请输入账号!', trigger: 'blur' }],
230
- password: [{ required: true, message: '请输入密码!', trigger: 'blur' }],
231
- code: [{ required: true, message: '请输入验证码!', trigger: 'blur' }],
232
- phone: [
233
- { required: true, message: '请输入手机号!', trigger: 'blur' },
234
- {
235
- pattern: /^1\d{10}$/,
236
- message: '请输入正确手机号!',
237
- trigger: 'blur'
238
- }
239
- ]
240
- },
241
- codeNum: '验证码',
242
- getAzCount: 0
243
- }
244
- },
245
- methods: {
246
- // 忘记密码
247
- forgetPw() {
248
- this.$emit('changType', 'retrievePw')
249
- },
250
- // 切换登录方式
251
- changeLoginType(val) {
252
- this.theType = val
253
- },
254
- // 切换二维码小图标
255
- cutQrcode() {
256
- if (this.theType !== 'qrcode') {
257
- this.theType = 'qrcode'
258
- } else {
259
- this.theType = this.loginTypes[0]
260
- }
261
- },
262
- // 发送短信
263
- outTime(num) {
264
- clearTimeout(this.setTimeNum)
265
- if (num > 0) {
266
- num--
267
- this.codeNum = num + 'S'
268
-
269
- this.setTimeNum = setTimeout(() => {
270
- this.outTime(num)
271
- }, 1000)
272
- num--
273
- } else {
274
- clearTimeout(this.setTimeNum)
275
- this.codeNum = '验证码'
276
- }
277
- },
278
- sendMsg(type = 'phone', typeName = '手机号') {
279
- this.$refs['login-form'].validateField(type, (valid) => {
280
- if (!valid) {
281
- this.outTime(60)
282
-
283
- axios
284
- // .get(
285
- // `/bems/prod_1.0/uas/api/authorization/captcha/${this.form[type]}/1`,
286
- // null,
287
- // { loading: false, noMsg: true }
288
- // )
289
- .post(
290
- '/bems/prod_1.0/uas/api/authorization/captcha',
291
- {
292
- handleType: 1,
293
- mobile: type === 'phone' ? this.form[type] : '',
294
- username: type !== 'phone' ? this.form[type] : ''
295
- },
296
- { loading: false, noMsg: true }
297
- )
298
- .then(() => {
299
- this.$message.success(
300
- `${typeName}: ${this.form[type]} 验证码发送成功`
301
- )
302
- })
303
- .catch(() => {
304
- clearTimeout(this.setTimeNum)
305
- this.codeNum = '验证码'
306
- this.$message.warning(
307
- `${typeName}: ${this.form[type]} 验证码发送失败`
308
- )
309
- })
310
- }
311
- })
312
- },
313
- loadingFn() {
314
- this.loadingV = false
315
- },
316
- // 登录
317
- submitLogin() {
318
- this.$refs['login-form'].validate((valid) => {
319
- if (!valid) return false
320
-
321
- auth.removeToken()
322
- this.theType === 'account' && this.passwordLogin().catch(this.loadingFn)
323
- this.theType === 'pthon' && this.phoneLogin().catch(this.loadingFn)
324
- this.theType === 'accountPthon' &&
325
- this.accountPthonLogin().catch(this.loadingFn)
326
- })
327
- },
328
- // 获取加密参数
329
- authorizationCode(username, password, code) {
330
- this.getAzCount = this.getAzCount + 1
331
-
332
- let pwdArr = code ? [username, password, code] : [username, password]
333
- let pwd = pwdArr.join('@@')
334
-
335
- return new Promise((resolve, reject) => {
336
- if (this.getAzCount <= 3) {
337
- axios
338
- .get(
339
- '/bems/prod_1.0/uas/api/authorization/authorizationCode',
340
- {},
341
- { loading: false }
342
- )
343
- .then(({ data = {} }) => {
344
- try {
345
- pwd = encode(pwd, data.authorizationValue)
346
- this.pwd = pwd + '@@' + data.authorizationKey
347
-
348
- this.getAzCount = 0
349
- resolve()
350
- } catch (error) {
351
- console.error('密码加密错误:' + JSON.stringify(data))
352
- this.authorizationCode(username, password, code) // 再次请求
353
- .then(resolve)
354
- .catch(reject)
355
- }
356
- })
357
- } else {
358
- // 当重新请求大于3次,抛出错误
359
- this.$message.warning(`登录失败,请重新登录!`)
360
- this.getAzCount = 0
361
- reject()
362
- }
363
- })
364
- },
365
- // 账号/密码登录
366
- async passwordLogin() {
367
- this.loadingV = true
368
-
369
- let { username, password, code } = this.form
370
- await this.authorizationCode(username, password, code)
371
- // 请求该账号要不要强制验证码登录
372
- let cL = await axios.post(
373
- '/bems/prod_1.0/uas/api/authorization/checkLogin',
374
- { grantType: 'password', username, password: this.pwd, code },
375
- {
376
- loading: false
377
- }
378
- )
379
-
380
- // 输入验证码
381
- if (cL.data === true) {
382
- this.loadingV = false
383
- this.theType = 'accountPthon'
384
-
385
- this.sendMsg('username', '账户')
386
- this.outTime(60)
387
- return
388
- }
389
- // 签名验签
390
- else if (cL.data === false) {
391
- // 获取线上签名uDn
392
- let uDn = await axios.get(
393
- `/bems/prod_1.0/dssc/sign/getUserDn/${username}/password`,
394
- null,
395
- { loading: false }
396
- )
397
- let { checkCert, userDn } = uDn.data
398
- // 走本地签名
399
- let sign = undefined
400
- let certDn = undefined
401
- if (checkCert) {
402
- let { getSign } = await import('../../plugins/Sign/index')
403
- sign = getSign(username, userDn)
404
- certDn = userDn
405
- }
406
-
407
- await this.authorizationCode(username, password, code) // authorizationValue 使用一次后就失效了
408
- axios
409
- .post(
410
- '/bems/prod_1.0/uas/api/authorization/login',
411
- {
412
- grantType: 'password',
413
- username,
414
- password: this.pwd,
415
- code,
416
- sign,
417
- certDn
418
- },
419
- {
420
- loading: this.loadingFn
421
- }
422
- )
423
- .then((res) => {
424
- this.loginAfter(res.data)
425
- })
426
- return
427
- }
428
-
429
- // 正常登录
430
- await this.authorizationCode(username, password, code) // authorizationValue 使用一次后就失效了
431
- axios
432
- .post(
433
- '/bems/prod_1.0/uas/api/authorization/login',
434
- { grantType: 'password', username, password: this.pwd, code },
435
- { loading: this.loadingFn }
436
- )
437
- .then((res) => {
438
- this.loginAfter(res.data)
439
- })
440
- },
441
- // 二维码扫码登录
442
- QrcodeLogin(userNo, qrcode) {
443
- axios
444
- .post(
445
- '/bems/prod_1.0/uas/api/authorization/login',
446
- {
447
- grantType: 'qr_code',
448
- type: 'qr_code',
449
- username: userNo,
450
- password: qrcode
451
- },
452
- { loading: false }
453
- )
454
- .then((res) => {
455
- this.loginAfter(res.data)
456
- })
457
- },
458
- // 手机号/验证码登录
459
- async phoneLogin() {
460
- this.loadingV = true
461
- let { phone, code } = this.form
462
- await this.authorizationCode(phone, code)
463
- let pwd = this.pwd
464
-
465
- axios
466
- .post(
467
- '/bems/prod_1.0/uas/api/authorization/login',
468
- { grantType: 'mobile', username: phone, password: pwd },
469
- { loading: this.loadingFn }
470
- )
471
- .then((res) => {
472
- this.loginAfter(res.data)
473
- })
474
- },
475
- async accountPthonLogin() {
476
- this.loadingV = true
477
- let { username, password, code } = this.form
478
- await this.authorizationCode(username, password, code)
479
- let pwd = this.pwd
480
-
481
- axios
482
- .post(
483
- '/bems/prod_1.0/uas/api/authorization/login',
484
- { grantType: 'user_password_code', username, password: pwd, code },
485
- { loading: this.loadingFn }
486
- )
487
- .then((res) => {
488
- this.loginAfter(res.data)
489
- })
490
- },
491
- // 登录成功后
492
- loginAfter(data) {
493
- auth.setToken(data.accessToken)
494
- try {
495
- let tokenObj = decode(data.accessToken)
496
- let userInfo = JSON.parse(tokenObj.user_name)
497
- this.userNo = userInfo.userNo
498
- sessionStorage.setItem('User_Info', tokenObj.user_name)
499
- } catch (error) {
500
- console.error('accessToken解析错误:' + data.accessToken)
501
- }
502
-
503
- Promise.all([
504
- this.getUserInfo(),
505
- this.getMicroAppsInfo(),
506
- this.getCltRelaNos()
507
- ]).then(() => {
508
- if (this.loginThen) {
509
- this.loginThen().then(() => {
510
- this.$router.replace('/')
511
- })
512
- } else {
513
- this.$router.replace('/')
514
- }
515
- })
516
- },
517
- // 获取用户基本信息
518
- async getUserInfo() {
519
- let username = this.userNo
520
- let { data } = await axios.get(
521
- // '/bems/prod_1.0/user/api/userController/userCltAdDep/' + username
522
- '/bems/prod_1.0/user/api/userController/userCltAdRole/' + username
523
- )
524
- let userInfo = data || { uname: username }
525
-
526
- sessionStorage.setItem('userNo', username)
527
- sessionStorage.setItem('userInfo', JSON.stringify(userInfo))
528
- sessionStorage.setItem('loginTime', Date.now())
529
- },
530
- // 获取子应用相关列表
531
- async getMicroAppsInfo() {
532
- this.loadingV = true
533
- let { data } = await axios.get('/bems/1.0/menuTree/tree', null, {
534
- loading: this.loadingFn
535
- })
536
- data || (data = [])
537
-
538
- let layoutMenus = siteTree2menus(data)
539
- sessionStorage.setItem('menuTree', JSON.stringify(layoutMenus))
540
-
541
- let relaNos = siteTree2RelaNos(data)
542
- sessionStorage.setItem('relaNos', JSON.stringify(relaNos))
543
-
544
- // XXX: 兼容旧版resources
545
- sessionStorage.setItem('resources', JSON.stringify(data))
546
- },
547
- // 新增不同单位对应不同角色,具有不同权限
548
- getCltRelaNos() {
549
- let pro = new Promise((resolve) => {
550
- axios
551
- .post(
552
- '/bems/prod_1.0/user/api/userController/qryBusyInfoNo',
553
- { uno: this.userNo },
554
- { loading: false, noMsg: true }
555
- )
556
- .then(({ data: cltrelaMap = [] }) => {
557
- let cltrelaNos = {}
558
- cltrelaMap.forEach((item) => {
559
- cltrelaNos[item.cltNo] = item.relaNos
560
- })
561
- sessionStorage.setItem('cltrelaNos', JSON.stringify(cltrelaNos))
562
- })
563
- .finally(resolve)
564
- })
565
-
566
- return pro
567
- }
568
- }
569
- }
570
- </script>
1
+ <template>
2
+ <!-- eslint-disable no-irregular-whitespace -->
3
+ <div v-loading="loadingV" class="login-form-wrap flex-column p-a">
4
+ <slot name="header"></slot>
5
+ <svg class="cut-qrcode-h">
6
+ <image
7
+ v-if="theType === 'qrcode'"
8
+ width="52"
9
+ height="52"
10
+ xlink:href="./qrt.png"
11
+ />
12
+ <image v-else width="52" height="52" xlink:href="./qr.png" />
13
+ <path d="M0,0L52,0L52,52Z" @click="cutQrcode" />
14
+ </svg>
15
+ <!-- 账号/密码登录 -->
16
+ <div v-if="theType === 'account'" class="flex-item">
17
+ <el-form
18
+ ref="login-form"
19
+ :model="form"
20
+ :rules="rules"
21
+ :hide-required-asterisk="true"
22
+ @submit.native.prevent="submitLogin"
23
+ >
24
+ <el-form-item class="m-b" label="账号" prop="username">
25
+ <el-input v-model="form.username" placeholder="请输入账号" />
26
+ </el-form-item>
27
+ <el-form-item class="m-b" label="密码" prop="password">
28
+ <el-input
29
+ v-model="form.password"
30
+ placeholder="请输入密码"
31
+ show-password
32
+ />
33
+ <!-- 不自动填充密码
34
+ <input
35
+ v-model="fakePwd"
36
+ type="password"
37
+ name="password"
38
+ hidden="hidden"
39
+ @change="fakePwd = 'a1b2c3d4'"
40
+ />
41
+ <el-input
42
+ v-model="form.password"
43
+ placeholder="请输入密码"
44
+ :class="{ 'login-password': !showPwd }"
45
+ >
46
+ <i
47
+ slot="suffix"
48
+ class="el-input__icon el-icon-view"
49
+ style="pointer-events: all"
50
+ @click.stop="showPwd = !showPwd"
51
+ ></i>
52
+ </el-input>
53
+ 不自动填充密码End -->
54
+ </el-form-item>
55
+ <el-button
56
+ class="m-t"
57
+ type="primary"
58
+ native-type="submit"
59
+ style="width: 100%"
60
+ >登 录</el-button
61
+ >
62
+ </el-form>
63
+ </div>
64
+ <!-- 二维码扫码登录 -->
65
+ <qrCode v-else-if="theType === 'qrcode'" @qrcode-login="QrcodeLogin" />
66
+ <!-- 手机验证码登录 -->
67
+ <div v-if="theType === 'pthon'" class="flex-item">
68
+ <el-form
69
+ ref="login-form"
70
+ :model="form"
71
+ :rules="rules"
72
+ :hide-required-asterisk="true"
73
+ @submit.native.prevent="submitLogin"
74
+ >
75
+ <el-form-item class="m-b" label="手机号" prop="phone">
76
+ <el-input v-model="form.phone" placeholder="请输入手机号" />
77
+ </el-form-item>
78
+ <el-form-item class="m-b" label="验证码" prop="code">
79
+ <br />
80
+ <div class="flex-box">
81
+ <el-input
82
+ v-model="form.code"
83
+ class="flex-item m-r-s"
84
+ placeholder="请输入验证码"
85
+ />
86
+ <el-button
87
+ plain
88
+ style="4em"
89
+ :disabled="!form.phone || codeNum !== '验证码'"
90
+ @click="sendMsg('phone', '手机号')"
91
+ >{{ codeNum }}</el-button
92
+ >
93
+ </div>
94
+ </el-form-item>
95
+ <el-button
96
+ class="m-t"
97
+ type="primary"
98
+ native-type="submit"
99
+ style="width: 100%"
100
+ >登 录</el-button
101
+ >
102
+ </el-form>
103
+ </div>
104
+ <!-- 账户密码验证码登录 -->
105
+ <div v-if="theType === 'accountPthon'" class="flex-item">
106
+ <el-form
107
+ ref="login-form"
108
+ :model="form"
109
+ :rules="rules"
110
+ :hide-required-asterisk="true"
111
+ @submit.native.prevent="submitLogin"
112
+ >
113
+ <el-form-item class="m-b" label="账号" prop="username">
114
+ <el-input v-model="form.username" placeholder="请输入账号" />
115
+ </el-form-item>
116
+ <el-form-item class="m-b" label="密码" prop="password">
117
+ <el-input
118
+ v-model="form.password"
119
+ placeholder="请输入密码"
120
+ show-password
121
+ />
122
+ </el-form-item>
123
+ <el-form-item class="m-b" label="验证码" prop="code">
124
+ <br />
125
+ <div class="flex-box">
126
+ <el-input
127
+ v-model="form.code"
128
+ class="flex-item m-r-s"
129
+ placeholder="请输入验证码"
130
+ />
131
+ <el-button
132
+ plain
133
+ style="4em"
134
+ :disabled="!form.username || codeNum !== '验证码'"
135
+ @click="sendMsg('username', '账户')"
136
+ >{{ codeNum }}</el-button
137
+ >
138
+ </div>
139
+ </el-form-item>
140
+ <el-button
141
+ class="m-t"
142
+ type="primary"
143
+ native-type="submit"
144
+ style="width: 100%"
145
+ >登 录</el-button
146
+ >
147
+ </el-form>
148
+ </div>
149
+ <!-- -->
150
+ <div v-if="theType !== 'qrcode'" class="flex-box flex-lr m-t-s m-b-s">
151
+ <el-dropdown
152
+ size="mini"
153
+ placement="bottom-start"
154
+ @command="changeLoginType"
155
+ >
156
+ <span>其他登录方式</span>
157
+ <el-dropdown-menu slot="dropdown">
158
+ <template v-for="item in loginTypes">
159
+ <el-dropdown-item
160
+ v-if="item !== theType"
161
+ :key="item"
162
+ :command="item"
163
+ >{{ loginTypeMap[item] }}</el-dropdown-item
164
+ >
165
+ </template>
166
+ </el-dropdown-menu>
167
+ </el-dropdown>
168
+
169
+ <el-link :underline="false" @click="forgetPw">忘记密码</el-link>
170
+ </div>
171
+ <slot name="footer"></slot>
172
+ </div>
173
+ </template>
174
+
175
+ <script>
176
+ import decode from 'jsonwebtoken/decode'
177
+ import axios from '../../utils/axios'
178
+ import auth from '../../utils/auth'
179
+ import qrCode from './qrcode.vue'
180
+ import { siteTree2menus, siteTree2RelaNos } from './utils'
181
+
182
+ function encode(pwd = '', key = 0) {
183
+ if (pwd === '') return ''
184
+
185
+ let pwdArr = pwd.trim().split('')
186
+ let resultArr = pwdArr.map((oPwd) =>
187
+ String.fromCharCode(oPwd.charCodeAt() ^ key)
188
+ )
189
+ let result = resultArr.join('')
190
+
191
+ return window.btoa(window.unescape(window.encodeURIComponent(result)))
192
+ }
193
+
194
+ export default {
195
+ name: 'LoginForm',
196
+ components: {
197
+ qrCode
198
+ },
199
+ props: {
200
+ loginTypes: {
201
+ type: Array,
202
+ default: () => ['account']
203
+ },
204
+ loginThen: {
205
+ type: Function,
206
+ default: undefined
207
+ }
208
+ },
209
+ data() {
210
+ return {
211
+ showPwd: false,
212
+ fakePwd: 'a1b2c3d4',
213
+ loadingV: false,
214
+ loginTypeMap: {
215
+ account: '账号密码登录',
216
+ pthon: '手机验证码登录',
217
+ qrcode: '二维码扫码登录',
218
+ accountPthon: '账户密码验证码登录'
219
+ },
220
+ theType: this.loginTypes[0],
221
+ userNo: undefined,
222
+ form: {
223
+ username: '',
224
+ password: '',
225
+ code: ''
226
+ },
227
+ pwd: '',
228
+ rules: {
229
+ username: [{ required: true, message: '请输入账号!', trigger: 'blur' }],
230
+ password: [{ required: true, message: '请输入密码!', trigger: 'blur' }],
231
+ code: [{ required: true, message: '请输入验证码!', trigger: 'blur' }],
232
+ phone: [
233
+ { required: true, message: '请输入手机号!', trigger: 'blur' },
234
+ {
235
+ pattern: /^1\d{10}$/,
236
+ message: '请输入正确手机号!',
237
+ trigger: 'blur'
238
+ }
239
+ ]
240
+ },
241
+ codeNum: '验证码',
242
+ getAzCount: 0
243
+ }
244
+ },
245
+ methods: {
246
+ // 忘记密码
247
+ forgetPw() {
248
+ this.$emit('changType', 'retrievePw')
249
+ },
250
+ // 切换登录方式
251
+ changeLoginType(val) {
252
+ this.theType = val
253
+ },
254
+ // 切换二维码小图标
255
+ cutQrcode() {
256
+ if (this.theType !== 'qrcode') {
257
+ this.theType = 'qrcode'
258
+ } else {
259
+ this.theType = this.loginTypes[0]
260
+ }
261
+ },
262
+ // 发送短信
263
+ outTime(num) {
264
+ clearTimeout(this.setTimeNum)
265
+ if (num > 0) {
266
+ num--
267
+ this.codeNum = num + 'S'
268
+
269
+ this.setTimeNum = setTimeout(() => {
270
+ this.outTime(num)
271
+ }, 1000)
272
+ num--
273
+ } else {
274
+ clearTimeout(this.setTimeNum)
275
+ this.codeNum = '验证码'
276
+ }
277
+ },
278
+ sendMsg(type = 'phone', typeName = '手机号') {
279
+ this.$refs['login-form'].validateField(type, (valid) => {
280
+ if (!valid) {
281
+ this.outTime(60)
282
+
283
+ axios
284
+ // .get(
285
+ // `/bems/prod_1.0/uas/api/authorization/captcha/${this.form[type]}/1`,
286
+ // null,
287
+ // { loading: false, noMsg: true }
288
+ // )
289
+ .post(
290
+ '/bems/prod_1.0/uas/api/authorization/captcha',
291
+ {
292
+ handleType: 1,
293
+ mobile: type === 'phone' ? this.form[type] : '',
294
+ username: type !== 'phone' ? this.form[type] : ''
295
+ },
296
+ { loading: false, noMsg: true }
297
+ )
298
+ .then(() => {
299
+ this.$message.success(
300
+ `${typeName}: ${this.form[type]} 验证码发送成功`
301
+ )
302
+ })
303
+ .catch(() => {
304
+ clearTimeout(this.setTimeNum)
305
+ this.codeNum = '验证码'
306
+ this.$message.warning(
307
+ `${typeName}: ${this.form[type]} 验证码发送失败`
308
+ )
309
+ })
310
+ }
311
+ })
312
+ },
313
+ loadingFn() {
314
+ this.loadingV = false
315
+ },
316
+ // 登录
317
+ submitLogin() {
318
+ this.$refs['login-form'].validate((valid) => {
319
+ if (!valid) return false
320
+
321
+ auth.removeToken()
322
+ this.theType === 'account' && this.passwordLogin().catch(this.loadingFn)
323
+ this.theType === 'pthon' && this.phoneLogin().catch(this.loadingFn)
324
+ this.theType === 'accountPthon' &&
325
+ this.accountPthonLogin().catch(this.loadingFn)
326
+ })
327
+ },
328
+ // 获取加密参数
329
+ authorizationCode(username, password, code) {
330
+ this.getAzCount = this.getAzCount + 1
331
+
332
+ let pwdArr = code ? [username, password, code] : [username, password]
333
+ let pwd = pwdArr.join('@@')
334
+
335
+ return new Promise((resolve, reject) => {
336
+ if (this.getAzCount <= 3) {
337
+ axios
338
+ .get(
339
+ '/bems/prod_1.0/uas/api/authorization/authorizationCode',
340
+ {},
341
+ { loading: false }
342
+ )
343
+ .then(({ data = {} }) => {
344
+ try {
345
+ pwd = encode(pwd, data.authorizationValue)
346
+ this.pwd = pwd + '@@' + data.authorizationKey
347
+
348
+ this.getAzCount = 0
349
+ resolve()
350
+ } catch (error) {
351
+ console.error('密码加密错误:' + JSON.stringify(data))
352
+ this.authorizationCode(username, password, code) // 再次请求
353
+ .then(resolve)
354
+ .catch(reject)
355
+ }
356
+ })
357
+ } else {
358
+ // 当重新请求大于3次,抛出错误
359
+ this.$message.warning(`登录失败,请重新登录!`)
360
+ this.getAzCount = 0
361
+ reject()
362
+ }
363
+ })
364
+ },
365
+ // 账号/密码登录
366
+ async passwordLogin() {
367
+ this.loadingV = true
368
+
369
+ let { username, password, code } = this.form
370
+ await this.authorizationCode(username, password, code)
371
+ // 请求该账号要不要强制验证码登录
372
+ let cL = await axios.post(
373
+ '/bems/prod_1.0/uas/api/authorization/checkLogin',
374
+ { grantType: 'password', username, password: this.pwd, code },
375
+ {
376
+ loading: false
377
+ }
378
+ )
379
+
380
+ // 输入验证码
381
+ if (cL.data === true) {
382
+ this.loadingV = false
383
+ this.theType = 'accountPthon'
384
+
385
+ this.sendMsg('username', '账户')
386
+ this.outTime(60)
387
+ return
388
+ }
389
+ // 签名验签
390
+ else if (cL.data === false) {
391
+ // 获取线上签名uDn
392
+ let uDn = await axios.get(
393
+ `/bems/prod_1.0/dssc/sign/getUserDn/${username}/password`,
394
+ null,
395
+ { loading: false }
396
+ )
397
+ let { checkCert, userDn } = uDn.data
398
+ // 走本地签名
399
+ let sign = undefined
400
+ let certDn = undefined
401
+ if (checkCert) {
402
+ let { getSign } = await import('../../plugins/Sign/index')
403
+ sign = getSign(username, userDn)
404
+ certDn = userDn
405
+ }
406
+
407
+ await this.authorizationCode(username, password, code) // authorizationValue 使用一次后就失效了
408
+ axios
409
+ .post(
410
+ '/bems/prod_1.0/uas/api/authorization/login',
411
+ {
412
+ grantType: 'password',
413
+ username,
414
+ password: this.pwd,
415
+ code,
416
+ sign,
417
+ certDn
418
+ },
419
+ {
420
+ loading: this.loadingFn
421
+ }
422
+ )
423
+ .then((res) => {
424
+ this.loginAfter(res.data)
425
+ })
426
+ return
427
+ }
428
+
429
+ // 正常登录
430
+ await this.authorizationCode(username, password, code) // authorizationValue 使用一次后就失效了
431
+ axios
432
+ .post(
433
+ '/bems/prod_1.0/uas/api/authorization/login',
434
+ { grantType: 'password', username, password: this.pwd, code },
435
+ { loading: this.loadingFn }
436
+ )
437
+ .then((res) => {
438
+ this.loginAfter(res.data)
439
+ })
440
+ },
441
+ // 二维码扫码登录
442
+ QrcodeLogin(userNo, qrcode) {
443
+ axios
444
+ .post(
445
+ '/bems/prod_1.0/uas/api/authorization/login',
446
+ {
447
+ grantType: 'qr_code',
448
+ type: 'qr_code',
449
+ username: userNo,
450
+ password: qrcode
451
+ },
452
+ { loading: false }
453
+ )
454
+ .then((res) => {
455
+ this.loginAfter(res.data)
456
+ })
457
+ },
458
+ // 手机号/验证码登录
459
+ async phoneLogin() {
460
+ this.loadingV = true
461
+ let { phone, code } = this.form
462
+ await this.authorizationCode(phone, code)
463
+ let pwd = this.pwd
464
+
465
+ axios
466
+ .post(
467
+ '/bems/prod_1.0/uas/api/authorization/login',
468
+ { grantType: 'mobile', username: phone, password: pwd },
469
+ { loading: this.loadingFn }
470
+ )
471
+ .then((res) => {
472
+ this.loginAfter(res.data)
473
+ })
474
+ },
475
+ async accountPthonLogin() {
476
+ this.loadingV = true
477
+ let { username, password, code } = this.form
478
+ await this.authorizationCode(username, password, code)
479
+ let pwd = this.pwd
480
+
481
+ axios
482
+ .post(
483
+ '/bems/prod_1.0/uas/api/authorization/login',
484
+ { grantType: 'user_password_code', username, password: pwd, code },
485
+ { loading: this.loadingFn }
486
+ )
487
+ .then((res) => {
488
+ this.loginAfter(res.data)
489
+ })
490
+ },
491
+ // 登录成功后
492
+ loginAfter(data) {
493
+ auth.setToken(data.accessToken)
494
+ try {
495
+ let tokenObj = decode(data.accessToken)
496
+ let userInfo = JSON.parse(tokenObj.user_name)
497
+ this.userNo = userInfo.userNo
498
+ sessionStorage.setItem('User_Info', tokenObj.user_name)
499
+ } catch (error) {
500
+ console.error('accessToken解析错误:' + data.accessToken)
501
+ }
502
+
503
+ Promise.all([
504
+ this.getUserInfo(),
505
+ this.getMicroAppsInfo(),
506
+ this.getCltRelaNos()
507
+ ]).then(() => {
508
+ if (this.loginThen) {
509
+ this.loginThen().then(() => {
510
+ this.$router.replace('/')
511
+ })
512
+ } else {
513
+ this.$router.replace('/')
514
+ }
515
+ })
516
+ },
517
+ // 获取用户基本信息
518
+ async getUserInfo() {
519
+ let username = this.userNo
520
+ let { data } = await axios.get(
521
+ // '/bems/prod_1.0/user/api/userController/userCltAdDep/' + username
522
+ '/bems/prod_1.0/user/api/userController/userCltAdRole/' + username
523
+ )
524
+ let userInfo = data || { uname: username }
525
+
526
+ sessionStorage.setItem('userNo', username)
527
+ sessionStorage.setItem('userInfo', JSON.stringify(userInfo))
528
+ sessionStorage.setItem('loginTime', Date.now())
529
+ },
530
+ // 获取子应用相关列表
531
+ async getMicroAppsInfo() {
532
+ this.loadingV = true
533
+ let { data } = await axios.get('/bems/1.0/menuTree/tree', null, {
534
+ loading: this.loadingFn
535
+ })
536
+ data || (data = [])
537
+
538
+ let layoutMenus = siteTree2menus(data)
539
+ sessionStorage.setItem('menuTree', JSON.stringify(layoutMenus))
540
+
541
+ let relaNos = siteTree2RelaNos(data)
542
+ sessionStorage.setItem('relaNos', JSON.stringify(relaNos))
543
+
544
+ // XXX: 兼容旧版resources
545
+ sessionStorage.setItem('resources', JSON.stringify(data))
546
+ },
547
+ // 新增不同单位对应不同角色,具有不同权限
548
+ getCltRelaNos() {
549
+ let pro = new Promise((resolve) => {
550
+ axios
551
+ .post(
552
+ '/bems/prod_1.0/user/api/userController/qryBusyInfoNo',
553
+ { uno: this.userNo },
554
+ { loading: false, noMsg: true }
555
+ )
556
+ .then(({ data: cltrelaMap = [] }) => {
557
+ let cltrelaNos = {}
558
+ cltrelaMap.forEach((item) => {
559
+ cltrelaNos[item.cltNo] = item.relaNos
560
+ })
561
+ sessionStorage.setItem('cltrelaNos', JSON.stringify(cltrelaNos))
562
+ })
563
+ .finally(resolve)
564
+ })
565
+
566
+ return pro
567
+ }
568
+ }
569
+ }
570
+ </script>