vue2-client 1.6.48 → 1.6.49

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