vue2-client 1.4.16 → 1.4.18
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.
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,346 +1,342 @@
|
|
|
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, 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
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
this.
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
.
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
}
|
|
311
|
-
.ant-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
border-radius: 12px;
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
</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
|
+
}).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>
|
|
@@ -154,17 +154,6 @@
|
|
|
154
154
|
<a-input v-model="customerName" placeholder="请输入客户名称(总公司名+分公司名)"/>
|
|
155
155
|
<strong v-show="showCustomerNameAlert" style="color: red">客户名称不能为空!</strong>
|
|
156
156
|
</a-form-item>
|
|
157
|
-
<!-- 问题类型单选框 -->
|
|
158
|
-
<a-form-item label="问题类型">
|
|
159
|
-
<a-radio-group v-for="(item,index) in ticketCategoryMap" :key="index" v-model="form.category">
|
|
160
|
-
<a-radio :value="item.value" class="radio-item">
|
|
161
|
-
{{ item.label }}
|
|
162
|
-
</a-radio>
|
|
163
|
-
</a-radio-group>
|
|
164
|
-
<a-spin :spinning="ticketCategoryMapLoading" />
|
|
165
|
-
<br/>
|
|
166
|
-
<strong v-show="showCategoryAlert" style="color: red">类型不允许为空!</strong>
|
|
167
|
-
</a-form-item>
|
|
168
157
|
<!-- 联系人 -->
|
|
169
158
|
<a-form-item label="联系人">
|
|
170
159
|
<a-input v-model="form.contact"></a-input>
|
|
@@ -178,6 +167,7 @@
|
|
|
178
167
|
<!-- 问题描述框 -->
|
|
179
168
|
<a-form-item label="问题详情描述">
|
|
180
169
|
<a-textarea v-model="form.desc" allow-clear placeholder="请用一句话描述您的问题,必要时请注明客户编号,表号,系统功能项等信息"/>
|
|
170
|
+
<strong v-show="showDescAlert" style="color: red">问题详情描述不能为空!</strong>
|
|
181
171
|
</a-form-item>
|
|
182
172
|
<!-- 图片上传 -->
|
|
183
173
|
<a-form-item :wrapper-col="{ span: 12 }" label="问题截图">
|
|
@@ -201,7 +191,7 @@
|
|
|
201
191
|
</a-form-item>
|
|
202
192
|
<!-- 表单底部按钮 -->
|
|
203
193
|
<a-form-item :wrapper-col="{ span: 12, offset: 5 }">
|
|
204
|
-
<a-button :disabled="
|
|
194
|
+
<a-button :disabled="showPhoneAlert || !validCustomerName || showContactAlert || showDescAlert || !imageList.length" style="margin-right: 20px" type="primary" @click="onSubmit">
|
|
205
195
|
提交
|
|
206
196
|
</a-button>
|
|
207
197
|
</a-form-item>
|
|
@@ -290,7 +280,6 @@ export default {
|
|
|
290
280
|
// 表单数据
|
|
291
281
|
form: {
|
|
292
282
|
name: '',
|
|
293
|
-
category: undefined,
|
|
294
283
|
desc: undefined,
|
|
295
284
|
contact: '',
|
|
296
285
|
phone: ''
|
|
@@ -298,9 +287,9 @@ export default {
|
|
|
298
287
|
// 工单序列号
|
|
299
288
|
serialNumber: '',
|
|
300
289
|
// 类别未填写警告信息控制
|
|
301
|
-
showCategoryAlert: true,
|
|
302
290
|
showContactAlert: true,
|
|
303
291
|
showPhoneAlert: true,
|
|
292
|
+
showDescAlert: true,
|
|
304
293
|
showCustomerNameAlert: true,
|
|
305
294
|
// 向日葵使用指南可见性
|
|
306
295
|
sunClientManualVisible: false,
|
|
@@ -317,9 +306,6 @@ export default {
|
|
|
317
306
|
fileUploadModel,
|
|
318
307
|
// 客户名称
|
|
319
308
|
customerName: undefined,
|
|
320
|
-
// 问题类型选项
|
|
321
|
-
ticketCategoryMap: [],
|
|
322
|
-
ticketCategoryMapLoading: false,
|
|
323
309
|
// 未传入客户名称手动输入联系方式
|
|
324
310
|
infoFormVisible: false,
|
|
325
311
|
infoForm: {
|
|
@@ -339,16 +325,6 @@ export default {
|
|
|
339
325
|
},
|
|
340
326
|
created () {
|
|
341
327
|
document.title = '售后问题反馈平台'
|
|
342
|
-
const dictionary = this.$appdata.getParams()
|
|
343
|
-
if (dictionary && dictionary['ticketCategoryMap']) {
|
|
344
|
-
this.ticketCategoryMap = dictionary['ticketCategoryMap']
|
|
345
|
-
} else {
|
|
346
|
-
this.ticketCategoryMapLoading = true
|
|
347
|
-
this.$appdata.load().then(() => {
|
|
348
|
-
this.ticketCategoryMap = this.$appdata.getDictionaryList('ticketCategoryMap')
|
|
349
|
-
this.ticketCategoryMapLoading = false
|
|
350
|
-
})
|
|
351
|
-
}
|
|
352
328
|
let customerName = this.$route.query.orgName
|
|
353
329
|
// 分割客户名称
|
|
354
330
|
if (customerName) {
|
|
@@ -398,7 +374,6 @@ export default {
|
|
|
398
374
|
}
|
|
399
375
|
const form = {
|
|
400
376
|
customerName,
|
|
401
|
-
problemType: this.form.category,
|
|
402
377
|
contact: this.form.contact,
|
|
403
378
|
phone: this.form.phone,
|
|
404
379
|
problemDetail: this.form.desc,
|
|
@@ -417,15 +392,11 @@ export default {
|
|
|
417
392
|
this.$message.error('问题详情不能包含特殊符号')
|
|
418
393
|
return
|
|
419
394
|
}
|
|
420
|
-
if (!this.form.desc) {
|
|
421
|
-
form.problemDetail = '该用户没有填写描述信息'
|
|
422
|
-
}
|
|
423
395
|
post(TicketDetailsViewApi.createTicket, { form }).then((res) => {
|
|
424
396
|
this.serialNumber = res
|
|
425
397
|
this.successVisible = true
|
|
426
398
|
this.$message.success('创建成功')
|
|
427
399
|
this.customerName = ''
|
|
428
|
-
this.form.category = undefined
|
|
429
400
|
this.form.contact = ''
|
|
430
401
|
this.form.phone = ''
|
|
431
402
|
this.form.desc = ''
|
|
@@ -471,10 +442,6 @@ export default {
|
|
|
471
442
|
},
|
|
472
443
|
watch: {
|
|
473
444
|
// 监控类别的改变,当类别改变,校验通过
|
|
474
|
-
'form.category' (newVal) {
|
|
475
|
-
const numReg = new RegExp(/^[0-9]+$/)
|
|
476
|
-
this.showCategoryAlert = !numReg.test(newVal)
|
|
477
|
-
},
|
|
478
445
|
'form.contact' (newVal) {
|
|
479
446
|
this.showContactAlert = newVal.trim().length === 0
|
|
480
447
|
},
|
|
@@ -482,6 +449,9 @@ export default {
|
|
|
482
449
|
const numReg = new RegExp(/^[0-9]+$/)
|
|
483
450
|
this.showPhoneAlert = !numReg.test(newVal)
|
|
484
451
|
},
|
|
452
|
+
'form.desc' (newVal) {
|
|
453
|
+
this.showDescAlert = newVal.trim().length === 0
|
|
454
|
+
},
|
|
485
455
|
'customerName' (newVal) {
|
|
486
456
|
this.showCustomerNameAlert = !newVal
|
|
487
457
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
// 跨域代理前缀
|
|
2
|
-
// const API_PROXY_PREFIX='/api'
|
|
3
|
-
// const BASE_URL = process.env.NODE_ENV === 'production' ? process.env.VUE_APP_API_BASE_URL : API_PROXY_PREFIX
|
|
4
|
-
|
|
5
|
-
module.exports = {
|
|
6
|
-
LOGIN: `/rs/logic/getLogin`,
|
|
7
|
-
V4_LOGIN: '/auth/login',
|
|
8
|
-
V4_LOGOUT: '/auth/logout',
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
// 跨域代理前缀
|
|
2
|
+
// const API_PROXY_PREFIX='/api'
|
|
3
|
+
// const BASE_URL = process.env.NODE_ENV === 'production' ? process.env.VUE_APP_API_BASE_URL : API_PROXY_PREFIX
|
|
4
|
+
|
|
5
|
+
module.exports = {
|
|
6
|
+
LOGIN: `/rs/logic/getLogin`,
|
|
7
|
+
V4_LOGIN: '/auth/login',
|
|
8
|
+
V4_LOGOUT: '/auth/logout',
|
|
9
|
+
V4_GET_INFO: '/api/af-system/logic/getInfo',
|
|
10
|
+
ROUTES: `/rs/user/userLogin/智慧燃气`,
|
|
11
|
+
SEARCH: `/rs/search`,
|
|
12
|
+
GOODS: `/goods`,
|
|
13
|
+
GOODS_COLUMNS: `/columns`
|
|
14
|
+
}
|
package/src/services/user.js
CHANGED
|
@@ -1,49 +1,53 @@
|
|
|
1
|
-
import { LOGIN, ROUTES, V4_LOGIN, V4_LOGOUT } from '@vue2-client/services/apiService'
|
|
2
|
-
import { request, METHOD, removeAuthorization } from '@vue2-client/utils/request'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* 登录服务
|
|
6
|
-
* @param name 账户名
|
|
7
|
-
* @param password 账户密码
|
|
8
|
-
* @returns {Promise<AxiosResponse<T>>}
|
|
9
|
-
*/
|
|
10
|
-
export async function login (name, password) {
|
|
11
|
-
return request(LOGIN, METHOD.POST, {
|
|
12
|
-
name: name,
|
|
13
|
-
password: password
|
|
14
|
-
})
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export async function
|
|
18
|
-
return request(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
})
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}).
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
1
|
+
import { LOGIN, ROUTES, V4_GET_INFO, V4_LOGIN, V4_LOGOUT } from '@vue2-client/services/apiService'
|
|
2
|
+
import { request, METHOD, removeAuthorization } from '@vue2-client/utils/request'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 登录服务
|
|
6
|
+
* @param name 账户名
|
|
7
|
+
* @param password 账户密码
|
|
8
|
+
* @returns {Promise<AxiosResponse<T>>}
|
|
9
|
+
*/
|
|
10
|
+
export async function login (name, password) {
|
|
11
|
+
return request(LOGIN, METHOD.POST, {
|
|
12
|
+
name: name,
|
|
13
|
+
password: password
|
|
14
|
+
})
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export async function V4Login (name, password) {
|
|
18
|
+
return request(V4_LOGIN, METHOD.POST, {
|
|
19
|
+
username: name,
|
|
20
|
+
password: password
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export async function V4GetInfo () {
|
|
25
|
+
return request(V4_GET_INFO, METHOD.POST, {})
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export async function getRoutesConfig (value) {
|
|
29
|
+
return request(ROUTES, METHOD.POST, value)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 退出登录
|
|
34
|
+
*/
|
|
35
|
+
export function logout () {
|
|
36
|
+
return new Promise((resolve, reject) => {
|
|
37
|
+
request(V4_LOGOUT, METHOD.DELETE, {}).then(() => {
|
|
38
|
+
resolve()
|
|
39
|
+
}).catch(error => {
|
|
40
|
+
reject(error)
|
|
41
|
+
}).finally(() => {
|
|
42
|
+
localStorage.removeItem(process.env.VUE_APP_ROUTES_KEY)
|
|
43
|
+
localStorage.removeItem(process.env.VUE_APP_PERMISSIONS_KEY)
|
|
44
|
+
localStorage.removeItem(process.env.VUE_APP_ROLES_KEY)
|
|
45
|
+
removeAuthorization()
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
export default {
|
|
50
|
+
login,
|
|
51
|
+
logout,
|
|
52
|
+
getRoutesConfig
|
|
53
|
+
}
|