vue2-client 1.6.13 → 1.6.15

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 (104) hide show
  1. package/CHANGELOG.md +562 -555
  2. package/index.js +30 -30
  3. package/package.json +78 -78
  4. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +226 -226
  5. package/src/base-client/components/common/CitySelect/CitySelect.vue +247 -247
  6. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +733 -733
  7. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +508 -508
  8. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +140 -140
  9. package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +165 -165
  10. package/src/base-client/components/common/JSONToTree/jsontotree.vue +275 -275
  11. package/src/base-client/components/common/XAddForm/XAddForm.vue +326 -326
  12. package/src/base-client/components/common/XCard/XCard.vue +64 -64
  13. package/src/base-client/components/common/XForm/XForm.vue +180 -180
  14. package/src/base-client/components/common/XFormTable/XFormTable.vue +336 -334
  15. package/src/base-client/components/common/XFormTable/index.md +97 -97
  16. package/src/base-client/components/common/XTreeOne/XTreeOne.vue +109 -109
  17. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
  18. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +807 -807
  19. package/src/base-client/components/ticket/TicketDetailsView/index.md +29 -29
  20. package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
  21. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
  22. package/src/base-client/components/ticket/TicketSubmitSuccessView/index.md +29 -29
  23. package/src/base-client/plugins/AppData.js +76 -76
  24. package/src/base-client/plugins/GetLoginInfoService.js +179 -179
  25. package/src/base-client/plugins/PagedList.js +177 -177
  26. package/src/base-client/plugins/compatible/LoginServiceOA.js +20 -20
  27. package/src/base-client/plugins/i18n-extend.js +32 -32
  28. package/src/components/Ellipsis/Ellipsis.vue +65 -65
  29. package/src/components/Ellipsis/index.md +38 -38
  30. package/src/components/NumberInfo/index.md +43 -43
  31. package/src/components/STable/README.md +341 -341
  32. package/src/components/STable/index.js +318 -318
  33. package/src/components/Trend/index.md +45 -45
  34. package/src/components/checkbox/ColorCheckbox.vue +157 -157
  35. package/src/components/checkbox/ImgCheckbox.vue +163 -163
  36. package/src/components/exception/ExceptionPage.vue +70 -70
  37. package/src/components/form/FormRow.vue +52 -52
  38. package/src/components/index.js +36 -36
  39. package/src/components/menu/SideMenu.vue +62 -62
  40. package/src/components/menu/menu.js +273 -273
  41. package/src/components/page/header/index.less +40 -40
  42. package/src/components/setting/Setting.vue +235 -235
  43. package/src/components/table/StandardTable.vue +141 -141
  44. package/src/components/table/advance/ActionColumns.vue +158 -158
  45. package/src/components/table/advance/SearchArea.vue +355 -355
  46. package/src/components/tool/AStepItem.vue +60 -60
  47. package/src/components/tool/AvatarList.vue +68 -68
  48. package/src/components/tool/Drawer.vue +142 -142
  49. package/src/components/tool/TagSelect.vue +83 -83
  50. package/src/components/transition/PageToggleTransition.vue +97 -97
  51. package/src/config/default/admin.config.js +18 -18
  52. package/src/config/default/setting.config.js +44 -44
  53. package/src/config/replacer/resolve.config.js +67 -67
  54. package/src/layouts/CommonLayout.vue +42 -42
  55. package/src/layouts/ComponentLayoutOne.vue +47 -47
  56. package/src/layouts/PageLayout.vue +151 -151
  57. package/src/layouts/SinglePageView.vue +111 -111
  58. package/src/layouts/footer/PageFooter.vue +49 -49
  59. package/src/layouts/header/AdminHeader.vue +104 -104
  60. package/src/layouts/header/HeaderAvatar.vue +64 -64
  61. package/src/layouts/header/HeaderNotice.vue +176 -176
  62. package/src/layouts/header/HeaderSearch.vue +67 -67
  63. package/src/layouts/header/InstitutionDetail.vue +181 -181
  64. package/src/layouts/header/index.less +92 -92
  65. package/src/layouts/tabs/TabsHead.vue +190 -190
  66. package/src/layouts/tabs/TabsView.vue +379 -379
  67. package/src/mock/goods/index.js +108 -108
  68. package/src/pages/exception/404.vue +25 -25
  69. package/src/pages/login/Login.vue +363 -363
  70. package/src/pages/report/ReportTable.js +124 -124
  71. package/src/pages/report/ReportTableHome.vue +28 -28
  72. package/src/pages/resourceManage/orgListManage.vue +98 -98
  73. package/src/pages/system/dictionary/index.vue +80 -43
  74. package/src/pages/system/file/index.vue +317 -317
  75. package/src/pages/system/settings/index.vue +126 -126
  76. package/src/pages/system/settings/modifyPassword.vue +109 -109
  77. package/src/router/async/config.async.js +28 -28
  78. package/src/router/async/router.map.js +68 -68
  79. package/src/router/index.js +27 -27
  80. package/src/services/api/DictionaryDetailsViewApi.js +6 -6
  81. package/src/services/api/LogDetailsViewApi.js +10 -10
  82. package/src/services/api/QueryParamsDetailsViewApi.js +6 -6
  83. package/src/services/api/TicketDetailsViewApi.js +34 -34
  84. package/src/services/api/cas.js +79 -79
  85. package/src/services/api/commonTempTable.js +10 -10
  86. package/src/services/api/index.js +17 -17
  87. package/src/services/api/logininfor/index.js +6 -6
  88. package/src/services/api/manage.js +8 -8
  89. package/src/services/apiService.js +14 -14
  90. package/src/services/user.js +64 -64
  91. package/src/store/modules/index.js +4 -4
  92. package/src/theme/default/nprogress.less +76 -76
  93. package/src/theme/default/style.less +47 -47
  94. package/src/utils/colors.js +107 -107
  95. package/src/utils/excel/Blob.js +180 -180
  96. package/src/utils/excel/Export2Excel.js +141 -141
  97. package/src/utils/formatter.js +68 -68
  98. package/src/utils/i18n.js +80 -80
  99. package/src/utils/map-utils.js +8 -2
  100. package/src/utils/request.js +311 -311
  101. package/src/utils/theme-color-replacer-extend.js +91 -91
  102. package/src/utils/themeUtil.js +100 -100
  103. package/src/utils/util.js +230 -230
  104. package/vue.config.js +106 -106
@@ -1,363 +1,363 @@
1
- <template>
2
- <common-layout>
3
- <div class="loginContent">
4
- <div class="illustration"/>
5
- <div class="business">
6
- <div class="top">
7
- <div class="header">
8
- <span class="title">{{ systemName }}</span>
9
- </div>
10
- </div>
11
- <div class="login" id="loginForm">
12
- <a-form :form="form" @submit="onSubmit">
13
- <a-tabs :tabBarStyle="{textAlign: 'center'}" size="large" style="padding: 0 2px;">
14
- <a-tab-pane key="1" tab="账户密码登录">
15
- <a-alert
16
- v-show="error"
17
- :closable="false"
18
- :message="error"
19
- showIcon
20
- style="margin-bottom: 2.8vh;"
21
- type="error" />
22
- <a-form-item>
23
- <a-input
24
- v-decorator="['name', {rules: [{ required: true, message: '请输入账户名', whitespace: true}]}]"
25
- autocomplete="autocomplete"
26
- placeholder="请输入账户名"
27
- size="large"
28
- >
29
- <a-icon slot="prefix" type="user" />
30
- </a-input>
31
- </a-form-item>
32
- <a-form-item>
33
- <a-input
34
- v-decorator="['password', {rules: [{ required: true, message: '请输入密码', whitespace: true}]}]"
35
- autocomplete="autocomplete"
36
- placeholder="请输入密码"
37
- size="large"
38
- type="password"
39
- >
40
- <a-icon slot="prefix" type="lock" />
41
- </a-input>
42
- </a-form-item>
43
- <a-form-item>
44
- <a-button :loading="loading" htmlType="submit" size="large" class="btn" type="primary">登录</a-button>
45
- </a-form-item>
46
- </a-tab-pane>
47
- </a-tabs>
48
- </a-form>
49
- </div>
50
- </div>
51
- </div>
52
- </common-layout>
53
- </template>
54
-
55
- <script>
56
- import CommonLayout from '@vue2-client/layouts/CommonLayout'
57
- import { getRoutesConfig, login, V4Login } from '@vue2-client/services/user'
58
- import { setAuthorization } from '@vue2-client/utils/request'
59
- import { loadRoutes, funcToRouter } from '@vue2-client/utils/routerUtil'
60
- import { mapMutations, mapState } from 'vuex'
61
- import JSEncrypt from 'jsencrypt'
62
- import { ACCESS_TOKEN } from '@vue2-client/store/mutation-types'
63
- import { positions } from '@vue2-client/mock/common'
64
- import { timeFix } from '@vue2-client/utils/util'
65
- import { loginStart } from '@vue2-client/base-client/plugins/compatible/LoginServiceOA'
66
- import { indexedDB } from '@vue2-client/utils/indexedDB'
67
-
68
- export default {
69
- name: 'Login',
70
- components: { CommonLayout },
71
- data () {
72
- return {
73
- loading: false,
74
- error: '',
75
- form: this.$form.createForm(this)
76
- }
77
- },
78
- computed: {
79
- ...mapState('setting', ['systemName', 'systemDesc', 'homePage', 'ticketPage', 'compatible', 'routeName'])
80
- },
81
- methods: {
82
- ...mapMutations('account', ['setUser', 'setPermissions', 'setRoles']),
83
- onSubmit (e) {
84
- e.preventDefault()
85
- this.form.validateFields((err) => {
86
- if (!err) {
87
- this.loading = true
88
- const name = this.form.getFieldValue('name')
89
- const password = this.form.getFieldValue('password')
90
- switch (this.compatible) {
91
- case 'V3': {
92
- login(name, password).then(this.afterLogin).catch(msg => {
93
- this.error = msg
94
- this.loading = false
95
- })
96
- break
97
- }
98
- case 'OA' : {
99
- loginStart(name, password).then(this.afterLoginOA).catch(msg => {
100
- this.error = msg
101
- this.loading = false
102
- })
103
- break
104
- }
105
- case 'V4' : {
106
- V4Login(name, password).then(this.afterLoginV4).catch(msg => {
107
- this.error = msg
108
- this.loading = false
109
- })
110
- break
111
- }
112
- }
113
- }
114
- })
115
- },
116
- afterLoginOA (result) {
117
- try {
118
- // 默认第一个是旧OA地址
119
- result.functions[0].navigate = result.functions[0].link
120
- result.functions[0].link = null
121
- this.afterGeneral(result)
122
- this.setAccessToken(result.password)
123
- this.$router.push(this.homePage).catch(() => {
124
- })
125
- } catch (res) {
126
- this.error = res
127
- } finally {
128
- this.loading = false
129
- }
130
- },
131
- afterLoginV4 (res) {
132
- this.setV4AccessToken(res)
133
- const data = res.resources
134
- this.$login.login(data).then(() => {
135
- this.afterGeneral(data)
136
- if (data.deps === '用户工单登记') {
137
- this.$router.push(this.ticketPage).catch(() => {
138
- })
139
- } else {
140
- this.$router.push(this.homePage).catch(() => {
141
- })
142
- }
143
- }).catch(res => {
144
- this.error = res
145
- }).finally(() => {
146
- this.loading = false
147
- })
148
- },
149
- afterLogin (res) {
150
- const name = this.form.getFieldValue('name')
151
- const password = this.form.getFieldValue('password')
152
- const loginRes = res.states
153
- if (loginRes === '登录成功') {
154
- const encrypt = new JSEncrypt()
155
- encrypt.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqPvovSfXcwBbW8cKMCgwqNpsYuzF8RPAPFb7LGsnVo44JhM/xxzDyzoYtdfNmtbIuKVi9PzIsyp6rg+09gbuI6UGwBZ5DWBDBMqv5MPdOF5dCQkB2Bbr5yPfURPENypUz+pBFBg41d+BC+rwRiXELwKy7Y9caD/MtJyHydj8OUwIDAQAB')
156
- const data = encrypt.encrypt(JSON.stringify({ username: name, password: password }))
157
- // 获取路由配置
158
- getRoutesConfig(data, this.routeName).then(result => {
159
- this.$login.login(result).then(() => {
160
- // V3任何情况首位加入资源管理
161
- const resourceManageMain = {
162
- name: '资源管理',
163
- icon: 'api',
164
- position: 1,
165
- link: 'resourceManageMain'
166
- }
167
- result.functions.unshift(resourceManageMain)
168
- this.afterGeneral(result)
169
- this.setAccessToken(data)
170
- if (result.deps === '用户工单登记') {
171
- this.$router.push(this.ticketPage).catch(() => {})
172
- } else {
173
- this.$router.push(this.homePage).catch(() => {})
174
- }
175
- }).finally(() => {
176
- this.loading = false
177
- })
178
- }).catch(res => {
179
- this.error = res
180
- })
181
- } else {
182
- this.error = loginRes
183
- this.loading = false
184
- }
185
- },
186
- afterGeneral (result) {
187
- const user = Object.assign({
188
- username: result.ename,
189
- name: result.name,
190
- avatar: 'https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png',
191
- address: '西安市',
192
- position: positions[0]
193
- }, result)
194
- this.setUser(user)
195
- this.setPermissions([{ id: 'queryForm', operation: ['add', 'edit'] }])
196
- this.setRoles([{ id: 'admin', operation: ['add', 'edit', 'delete'] }])
197
- loadRoutes(funcToRouter(user.functions))
198
- // 每次重新登录时,清除indexedDB缓存
199
- indexedDB.clear()
200
- this.$message.success(timeFix().CN + `,${result.name} 欢迎回来`, 3)
201
- },
202
- setAccessToken (data) {
203
- if (data) {
204
- localStorage.setItem(ACCESS_TOKEN, data)
205
- let timestamp = new Date().getTime()// 当前的时间戳
206
- timestamp = timestamp + 12 * 60 * 60 * 1000
207
- // 格式化时间获取年月日, 登陆过期时间
208
- const dateAfter = new Date(timestamp)
209
- setAuthorization({ token: data, expireAt: dateAfter })
210
- }
211
- },
212
- setV4AccessToken (res) {
213
- localStorage.setItem(ACCESS_TOKEN, res.access_token)
214
- let timestamp = new Date().getTime()// 当前的时间戳
215
- timestamp = timestamp + res.expire * 60 * 1000
216
- // 格式化时间获取年月日, 登陆过期时间
217
- const dateAfter = new Date(timestamp)
218
- setAuthorization({ token: res.access_token, expireAt: dateAfter })
219
- }
220
- }
221
- }
222
- </script>
223
-
224
- <style lang="less" scoped>
225
- .common-layout {
226
- background-image: url('/img/login/background.webp');
227
- background-size: cover;
228
- background-position: center;
229
- .content {
230
- .loginContent {
231
- position: absolute;
232
- top: 50%;
233
- left: 50%;
234
- width: 63vw;
235
- padding: 12.4vh 4.8vw 13.4vh 3.5vw;
236
- @media screen and (max-width: 479px) {
237
- padding: 6.4vh 4.8vw 4.4vh 3.5vw;
238
- }
239
- transform: translate(-50%, -50%);
240
- background: #fff;
241
- border-radius: 30px;
242
- display: flex;
243
- .illustration {
244
- flex: 1;
245
- background-image: url("/img/login/illustration.webp");
246
- background-size: contain;
247
- background-position: center;
248
- background-repeat: no-repeat;
249
- @media screen and (max-width: 959px) {
250
- flex: 0;
251
- }
252
- }
253
- .business {
254
- flex: 1;
255
- .top {
256
- text-align: center;
257
- .header {
258
- height: 2vh;
259
- line-height: 2.7vh;
260
- padding-bottom: 5.4vh;
261
- .title {
262
- font-size: 1.5rem;
263
- @media screen and (max-width: 479px) {
264
- font-size: 1rem;
265
- }
266
- @media screen and (min-width: 480px) and (max-width: 767px) {
267
- font-size: 1.3rem;
268
- }
269
- @media screen and (min-width: 768px) and (max-width: 959px) {
270
- font-size: 1.5rem;
271
- }
272
- @media screen and (min-width: 960px) {
273
- font-size: 1.3rem;
274
- }
275
- @media screen and (min-width: 1200px) {
276
- font-size: 1.5rem;
277
- }
278
- color: #333333;
279
- font-weight: bold;
280
- font-family: 'Microsoft YaHei UI Light', 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
281
- letter-spacing: 0.13rem;
282
- }
283
- }
284
- }
285
- .login{
286
- width: 20vw;
287
- margin: 0 auto;
288
- @media screen and (max-width: 479px) {
289
- width: 50vw;
290
- }
291
- @media screen and (min-width: 480px) and (max-width: 767px) {
292
- width: 50vw;
293
- }
294
- @media screen and (min-width: 768px) and (max-width: 959px) {
295
- width: 40vw;
296
- }
297
- @media screen and (min-width: 960px) {
298
- width: 20vw;
299
- }
300
- @media screen and (min-width: 1200px) {
301
- width: 20vw;
302
- }
303
- .btn {
304
- width: 100%;
305
- min-height: 43px;
306
- height: 5.4vh;
307
- border-radius: 30px;
308
- background-color: #4F93FE;
309
- }
310
- }
311
- }
312
- }
313
- }
314
- }
315
- </style>
316
- <style lang="less">
317
- .common-layout {
318
- .footer {
319
- .copyright {
320
- color: #fff !important;
321
- }
322
- }
323
- }
324
- #loginForm {
325
- .ant-input {
326
- border-radius: 30px;
327
- }
328
- .ant-input-lg {
329
- min-height: 43px;
330
- height: 5.4vh;
331
- }
332
- .ant-tabs-bar {
333
- margin-bottom: 24px;
334
- }
335
- .ant-input-affix-wrapper {
336
- font-size: 1.15rem;
337
- }
338
- .ant-input-affix-wrapper .ant-input:not(:first-child) {
339
- padding-left: 2.4vw;
340
- @media screen and (max-width: 479px) {
341
- padding-left: 10vw;
342
- }
343
- @media screen and (min-width: 480px) and (max-width: 767px) {
344
- padding-left: 8vw;
345
- }
346
- @media screen and (min-width: 768px) and (max-width: 959px) {
347
- padding-left: 5vw;
348
- }
349
- @media screen and (min-width: 960px) {
350
- padding-left: 4vw;
351
- }
352
- @media screen and (min-width: 1200px) {
353
- padding-left: 2.4vw;
354
- }
355
- }
356
- .ant-input-affix-wrapper .ant-input-prefix, .ant-input-affix-wrapper .ant-input-suffix {
357
- color: #4F93FE;
358
- }
359
- .ant-alert {
360
- border-radius: 12px;
361
- }
362
- }
363
- </style>
1
+ <template>
2
+ <common-layout>
3
+ <div class="loginContent">
4
+ <div class="illustration"/>
5
+ <div class="business">
6
+ <div class="top">
7
+ <div class="header">
8
+ <span class="title">{{ systemName }}</span>
9
+ </div>
10
+ </div>
11
+ <div class="login" id="loginForm">
12
+ <a-form :form="form" @submit="onSubmit">
13
+ <a-tabs :tabBarStyle="{textAlign: 'center'}" size="large" style="padding: 0 2px;">
14
+ <a-tab-pane key="1" tab="账户密码登录">
15
+ <a-alert
16
+ v-show="error"
17
+ :closable="false"
18
+ :message="error"
19
+ showIcon
20
+ style="margin-bottom: 2.8vh;"
21
+ type="error" />
22
+ <a-form-item>
23
+ <a-input
24
+ v-decorator="['name', {rules: [{ required: true, message: '请输入账户名', whitespace: true}]}]"
25
+ autocomplete="autocomplete"
26
+ placeholder="请输入账户名"
27
+ size="large"
28
+ >
29
+ <a-icon slot="prefix" type="user" />
30
+ </a-input>
31
+ </a-form-item>
32
+ <a-form-item>
33
+ <a-input
34
+ v-decorator="['password', {rules: [{ required: true, message: '请输入密码', whitespace: true}]}]"
35
+ autocomplete="autocomplete"
36
+ placeholder="请输入密码"
37
+ size="large"
38
+ type="password"
39
+ >
40
+ <a-icon slot="prefix" type="lock" />
41
+ </a-input>
42
+ </a-form-item>
43
+ <a-form-item>
44
+ <a-button :loading="loading" htmlType="submit" size="large" class="btn" type="primary">登录</a-button>
45
+ </a-form-item>
46
+ </a-tab-pane>
47
+ </a-tabs>
48
+ </a-form>
49
+ </div>
50
+ </div>
51
+ </div>
52
+ </common-layout>
53
+ </template>
54
+
55
+ <script>
56
+ import CommonLayout from '@vue2-client/layouts/CommonLayout'
57
+ import { getRoutesConfig, login, V4Login } from '@vue2-client/services/user'
58
+ import { setAuthorization } from '@vue2-client/utils/request'
59
+ import { loadRoutes, funcToRouter } from '@vue2-client/utils/routerUtil'
60
+ import { mapMutations, mapState } from 'vuex'
61
+ import JSEncrypt from 'jsencrypt'
62
+ import { ACCESS_TOKEN } from '@vue2-client/store/mutation-types'
63
+ import { positions } from '@vue2-client/mock/common'
64
+ import { timeFix } from '@vue2-client/utils/util'
65
+ import { loginStart } from '@vue2-client/base-client/plugins/compatible/LoginServiceOA'
66
+ import { indexedDB } from '@vue2-client/utils/indexedDB'
67
+
68
+ export default {
69
+ name: 'Login',
70
+ components: { CommonLayout },
71
+ data () {
72
+ return {
73
+ loading: false,
74
+ error: '',
75
+ form: this.$form.createForm(this)
76
+ }
77
+ },
78
+ computed: {
79
+ ...mapState('setting', ['systemName', 'systemDesc', 'homePage', 'ticketPage', 'compatible', 'routeName'])
80
+ },
81
+ methods: {
82
+ ...mapMutations('account', ['setUser', 'setPermissions', 'setRoles']),
83
+ onSubmit (e) {
84
+ e.preventDefault()
85
+ this.form.validateFields((err) => {
86
+ if (!err) {
87
+ this.loading = true
88
+ const name = this.form.getFieldValue('name')
89
+ const password = this.form.getFieldValue('password')
90
+ switch (this.compatible) {
91
+ case 'V3': {
92
+ login(name, password).then(this.afterLogin).catch(msg => {
93
+ this.error = msg
94
+ this.loading = false
95
+ })
96
+ break
97
+ }
98
+ case 'OA' : {
99
+ loginStart(name, password).then(this.afterLoginOA).catch(msg => {
100
+ this.error = msg
101
+ this.loading = false
102
+ })
103
+ break
104
+ }
105
+ case 'V4' : {
106
+ V4Login(name, password).then(this.afterLoginV4).catch(msg => {
107
+ this.error = msg
108
+ this.loading = false
109
+ })
110
+ break
111
+ }
112
+ }
113
+ }
114
+ })
115
+ },
116
+ afterLoginOA (result) {
117
+ try {
118
+ // 默认第一个是旧OA地址
119
+ result.functions[0].navigate = result.functions[0].link
120
+ result.functions[0].link = null
121
+ this.afterGeneral(result)
122
+ this.setAccessToken(result.password)
123
+ this.$router.push(this.homePage).catch(() => {
124
+ })
125
+ } catch (res) {
126
+ this.error = res
127
+ } finally {
128
+ this.loading = false
129
+ }
130
+ },
131
+ afterLoginV4 (res) {
132
+ this.setV4AccessToken(res)
133
+ const data = res.resources
134
+ this.$login.login(data).then(() => {
135
+ this.afterGeneral(data)
136
+ if (data.deps === '用户工单登记') {
137
+ this.$router.push(this.ticketPage).catch(() => {
138
+ })
139
+ } else {
140
+ this.$router.push(this.homePage).catch(() => {
141
+ })
142
+ }
143
+ }).catch(res => {
144
+ this.error = res
145
+ }).finally(() => {
146
+ this.loading = false
147
+ })
148
+ },
149
+ afterLogin (res) {
150
+ const name = this.form.getFieldValue('name')
151
+ const password = this.form.getFieldValue('password')
152
+ const loginRes = res.states
153
+ if (loginRes === '登录成功') {
154
+ const encrypt = new JSEncrypt()
155
+ encrypt.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqPvovSfXcwBbW8cKMCgwqNpsYuzF8RPAPFb7LGsnVo44JhM/xxzDyzoYtdfNmtbIuKVi9PzIsyp6rg+09gbuI6UGwBZ5DWBDBMqv5MPdOF5dCQkB2Bbr5yPfURPENypUz+pBFBg41d+BC+rwRiXELwKy7Y9caD/MtJyHydj8OUwIDAQAB')
156
+ const data = encrypt.encrypt(JSON.stringify({ username: name, password: password }))
157
+ // 获取路由配置
158
+ getRoutesConfig(data, this.routeName).then(result => {
159
+ this.$login.login(result).then(() => {
160
+ // V3任何情况首位加入资源管理
161
+ const resourceManageMain = {
162
+ name: '资源管理',
163
+ icon: 'api',
164
+ position: 1,
165
+ link: 'resourceManageMain'
166
+ }
167
+ result.functions.unshift(resourceManageMain)
168
+ this.afterGeneral(result)
169
+ this.setAccessToken(data)
170
+ if (result.deps === '用户工单登记') {
171
+ this.$router.push(this.ticketPage).catch(() => {})
172
+ } else {
173
+ this.$router.push(this.homePage).catch(() => {})
174
+ }
175
+ }).finally(() => {
176
+ this.loading = false
177
+ })
178
+ }).catch(res => {
179
+ this.error = res
180
+ })
181
+ } else {
182
+ this.error = loginRes
183
+ this.loading = false
184
+ }
185
+ },
186
+ afterGeneral (result) {
187
+ const user = Object.assign({
188
+ username: result.ename,
189
+ name: result.name,
190
+ avatar: 'https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png',
191
+ address: '西安市',
192
+ position: positions[0]
193
+ }, result)
194
+ this.setUser(user)
195
+ this.setPermissions([{ id: 'queryForm', operation: ['add', 'edit'] }])
196
+ this.setRoles([{ id: 'admin', operation: ['add', 'edit', 'delete'] }])
197
+ loadRoutes(funcToRouter(user.functions))
198
+ // 每次重新登录时,清除indexedDB缓存
199
+ indexedDB.clear()
200
+ this.$message.success(timeFix().CN + `,${result.name} 欢迎回来`, 3)
201
+ },
202
+ setAccessToken (data) {
203
+ if (data) {
204
+ localStorage.setItem(ACCESS_TOKEN, data)
205
+ let timestamp = new Date().getTime()// 当前的时间戳
206
+ timestamp = timestamp + 12 * 60 * 60 * 1000
207
+ // 格式化时间获取年月日, 登陆过期时间
208
+ const dateAfter = new Date(timestamp)
209
+ setAuthorization({ token: data, expireAt: dateAfter })
210
+ }
211
+ },
212
+ setV4AccessToken (res) {
213
+ localStorage.setItem(ACCESS_TOKEN, res.access_token)
214
+ let timestamp = new Date().getTime()// 当前的时间戳
215
+ timestamp = timestamp + res.expire * 60 * 1000
216
+ // 格式化时间获取年月日, 登陆过期时间
217
+ const dateAfter = new Date(timestamp)
218
+ setAuthorization({ token: res.access_token, expireAt: dateAfter })
219
+ }
220
+ }
221
+ }
222
+ </script>
223
+
224
+ <style lang="less" scoped>
225
+ .common-layout {
226
+ background-image: url('/img/login/background.webp');
227
+ background-size: cover;
228
+ background-position: center;
229
+ .content {
230
+ .loginContent {
231
+ position: absolute;
232
+ top: 50%;
233
+ left: 50%;
234
+ width: 63vw;
235
+ padding: 12.4vh 4.8vw 13.4vh 3.5vw;
236
+ @media screen and (max-width: 479px) {
237
+ padding: 6.4vh 4.8vw 4.4vh 3.5vw;
238
+ }
239
+ transform: translate(-50%, -50%);
240
+ background: #fff;
241
+ border-radius: 30px;
242
+ display: flex;
243
+ .illustration {
244
+ flex: 1;
245
+ background-image: url("/img/login/illustration.webp");
246
+ background-size: contain;
247
+ background-position: center;
248
+ background-repeat: no-repeat;
249
+ @media screen and (max-width: 959px) {
250
+ flex: 0;
251
+ }
252
+ }
253
+ .business {
254
+ flex: 1;
255
+ .top {
256
+ text-align: center;
257
+ .header {
258
+ height: 2vh;
259
+ line-height: 2.7vh;
260
+ padding-bottom: 5.4vh;
261
+ .title {
262
+ font-size: 1.5rem;
263
+ @media screen and (max-width: 479px) {
264
+ font-size: 1rem;
265
+ }
266
+ @media screen and (min-width: 480px) and (max-width: 767px) {
267
+ font-size: 1.3rem;
268
+ }
269
+ @media screen and (min-width: 768px) and (max-width: 959px) {
270
+ font-size: 1.5rem;
271
+ }
272
+ @media screen and (min-width: 960px) {
273
+ font-size: 1.3rem;
274
+ }
275
+ @media screen and (min-width: 1200px) {
276
+ font-size: 1.5rem;
277
+ }
278
+ color: #333333;
279
+ font-weight: bold;
280
+ font-family: 'Microsoft YaHei UI Light', 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
281
+ letter-spacing: 0.13rem;
282
+ }
283
+ }
284
+ }
285
+ .login{
286
+ width: 20vw;
287
+ margin: 0 auto;
288
+ @media screen and (max-width: 479px) {
289
+ width: 50vw;
290
+ }
291
+ @media screen and (min-width: 480px) and (max-width: 767px) {
292
+ width: 50vw;
293
+ }
294
+ @media screen and (min-width: 768px) and (max-width: 959px) {
295
+ width: 40vw;
296
+ }
297
+ @media screen and (min-width: 960px) {
298
+ width: 20vw;
299
+ }
300
+ @media screen and (min-width: 1200px) {
301
+ width: 20vw;
302
+ }
303
+ .btn {
304
+ width: 100%;
305
+ min-height: 43px;
306
+ height: 5.4vh;
307
+ border-radius: 30px;
308
+ background-color: #4F93FE;
309
+ }
310
+ }
311
+ }
312
+ }
313
+ }
314
+ }
315
+ </style>
316
+ <style lang="less">
317
+ .common-layout {
318
+ .footer {
319
+ .copyright {
320
+ color: #fff !important;
321
+ }
322
+ }
323
+ }
324
+ #loginForm {
325
+ .ant-input {
326
+ border-radius: 30px;
327
+ }
328
+ .ant-input-lg {
329
+ min-height: 43px;
330
+ height: 5.4vh;
331
+ }
332
+ .ant-tabs-bar {
333
+ margin-bottom: 24px;
334
+ }
335
+ .ant-input-affix-wrapper {
336
+ font-size: 1.15rem;
337
+ }
338
+ .ant-input-affix-wrapper .ant-input:not(:first-child) {
339
+ padding-left: 2.4vw;
340
+ @media screen and (max-width: 479px) {
341
+ padding-left: 10vw;
342
+ }
343
+ @media screen and (min-width: 480px) and (max-width: 767px) {
344
+ padding-left: 8vw;
345
+ }
346
+ @media screen and (min-width: 768px) and (max-width: 959px) {
347
+ padding-left: 5vw;
348
+ }
349
+ @media screen and (min-width: 960px) {
350
+ padding-left: 4vw;
351
+ }
352
+ @media screen and (min-width: 1200px) {
353
+ padding-left: 2.4vw;
354
+ }
355
+ }
356
+ .ant-input-affix-wrapper .ant-input-prefix, .ant-input-affix-wrapper .ant-input-suffix {
357
+ color: #4F93FE;
358
+ }
359
+ .ant-alert {
360
+ border-radius: 12px;
361
+ }
362
+ }
363
+ </style>