vue2-client 1.4.19 → 1.4.21

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