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
@@ -1,6 +1,13 @@
1
1
  # Change Log
2
2
  > 所有关于本项目的变化都在该文档里。
3
3
 
4
+ **1.4.18 -2022-09-28 @江超**
5
+ - 功能修改:
6
+ - V4登录获取路由提取到后端处理
7
+
8
+ **1.4.17 -2022-09-28 @苗艳强**
9
+ - 售后工单删除问题类型选择
10
+
4
11
  **1.4.15 - 1.4.16 -2022-09-26 @江超**
5
12
  - 功能修改:
6
13
  - 新增操作日志,登录日志页面
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.4.16",
3
+ "version": "1.4.18",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -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
- const name = this.form.getFieldValue('name')
118
- const password = this.form.getFieldValue('password')
119
- this.logging = false
120
- this.setV4AccessToken(res)
121
- const encrypt = new JSEncrypt()
122
- encrypt.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqPvovSfXcwBbW8cKMCgwqNpsYuzF8RPAPFb7LGsnVo44JhM/xxzDyzoYtdfNmtbIuKVi9PzIsyp6rg+09gbuI6UGwBZ5DWBDBMqv5MPdOF5dCQkB2Bbr5yPfURPENypUz+pBFBg41d+BC+rwRiXELwKy7Y9caD/MtJyHydj8OUwIDAQAB')
123
- const data = encrypt.encrypt(JSON.stringify({ username: name, password: password }))
124
- // 获取路由配置
125
- getRoutesConfig(data).then(result => {
126
- this.$login.login(result).then(() => {
127
- this.afterGeneral(result)
128
- if (result.deps === '用户工单登记') {
129
- this.$router.push(this.ticketPage).catch(() => {
130
- })
131
- } else {
132
- this.$router.push(this.homePage).catch(() => {
133
- })
134
- }
135
- })
136
- })
137
- },
138
- afterLogin (res) {
139
- const name = this.form.getFieldValue('name')
140
- const password = this.form.getFieldValue('password')
141
- this.logging = false
142
- const loginRes = res.states
143
- if (loginRes === '登录成功') {
144
- const encrypt = new JSEncrypt()
145
- encrypt.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqPvovSfXcwBbW8cKMCgwqNpsYuzF8RPAPFb7LGsnVo44JhM/xxzDyzoYtdfNmtbIuKVi9PzIsyp6rg+09gbuI6UGwBZ5DWBDBMqv5MPdOF5dCQkB2Bbr5yPfURPENypUz+pBFBg41d+BC+rwRiXELwKy7Y9caD/MtJyHydj8OUwIDAQAB')
146
- const data = encrypt.encrypt(JSON.stringify({ username: name, password: password }))
147
- // 获取路由配置
148
- getRoutesConfig(data).then(result => {
149
- this.$login.login(result).then(() => {
150
- // V3任何情况首位加入资源管理
151
- const resourceManageMain = {
152
- name: '资源管理',
153
- icon: 'api',
154
- position: 1,
155
- link: 'resourceManageMain'
156
- }
157
- result.functions.unshift(resourceManageMain)
158
- this.afterGeneral(result)
159
- this.setAccessToken(data)
160
- if (result.deps === '用户工单登记') {
161
- this.$router.push(this.ticketPage).catch(() => {})
162
- } else {
163
- this.$router.push(this.homePage).catch(() => {})
164
- }
165
- })
166
- })
167
- } else {
168
- this.error = loginRes
169
- }
170
- },
171
- afterGeneral (result) {
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
- },
185
- setAccessToken (data) {
186
- if (data) {
187
- localStorage.setItem(ACCESS_TOKEN, data)
188
- let timestamp = new Date().getTime()// 当前的时间戳
189
- timestamp = timestamp + 12 * 60 * 60 * 1000
190
- // 格式化时间获取年月日, 登陆过期时间
191
- const dateAfter = new Date(timestamp)
192
- setAuthorization({ token: data, expireAt: dateAfter })
193
- }
194
- },
195
- setV4AccessToken (res) {
196
- localStorage.setItem(ACCESS_TOKEN, res.access_token)
197
- let timestamp = new Date().getTime()// 当前的时间戳
198
- timestamp = timestamp + res.expire * 60 * 1000
199
- // 格式化时间获取年月日, 登陆过期时间
200
- const dateAfter = new Date(timestamp)
201
- setAuthorization({ token: res.access_token, expireAt: dateAfter })
202
- }
203
- }
204
- }
205
- </script>
206
-
207
- <style lang="less" scoped>
208
- .common-layout {
209
- background-image: url('/img/login/background.webp');
210
- background-size: cover;
211
- background-position: center;
212
- .content {
213
- .loginContent {
214
- position: absolute;
215
- top: 50%;
216
- left: 50%;
217
- width: 63vw;
218
- padding: 12.4vh 4.8vw 13.4vh 3.5vw;
219
- @media screen and (max-width: 479px) {
220
- padding: 6.4vh 4.8vw 4.4vh 3.5vw;
221
- }
222
- transform: translate(-50%, -50%);
223
- background: #fff;
224
- border-radius: 30px;
225
- display: flex;
226
- .illustration {
227
- flex: 1;
228
- background-image: url("/img/login/illustration.webp");
229
- background-size: contain;
230
- background-position: center;
231
- background-repeat: no-repeat;
232
- @media screen and (max-width: 959px) {
233
- flex: 0;
234
- }
235
- }
236
- .business {
237
- flex: 1;
238
- .top {
239
- text-align: center;
240
- .header {
241
- height: 2vh;
242
- line-height: 2.7vh;
243
- padding-bottom: 5.4vh;
244
- .title {
245
- font-size: 1.5rem;
246
- @media screen and (max-width: 479px) {
247
- font-size: 1rem;
248
- }
249
- @media screen and (min-width: 480px) and (max-width: 767px) {
250
- font-size: 1.3rem;
251
- }
252
- @media screen and (min-width: 768px) and (max-width: 959px) {
253
- font-size: 1.5rem;
254
- }
255
- @media screen and (min-width: 960px) {
256
- font-size: 1.3rem;
257
- }
258
- @media screen and (min-width: 1200px) {
259
- font-size: 1.5rem;
260
- }
261
- color: #333333;
262
- font-weight: bold;
263
- font-family: 'Microsoft YaHei UI Light', 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
264
- letter-spacing: 0.13rem;
265
- }
266
- }
267
- }
268
- .login{
269
- width: 20vw;
270
- margin: 0 auto;
271
- @media screen and (max-width: 479px) {
272
- width: 50vw;
273
- }
274
- @media screen and (min-width: 480px) and (max-width: 767px) {
275
- width: 50vw;
276
- }
277
- @media screen and (min-width: 768px) and (max-width: 959px) {
278
- width: 40vw;
279
- }
280
- @media screen and (min-width: 960px) {
281
- width: 20vw;
282
- }
283
- @media screen and (min-width: 1200px) {
284
- width: 20vw;
285
- }
286
- .btn {
287
- width: 100%;
288
- min-height: 43px;
289
- height: 5.4vh;
290
- border-radius: 30px;
291
- background-color: #4F93FE;
292
- }
293
- }
294
- }
295
- }
296
- }
297
- }
298
- </style>
299
- <style lang="less">
300
- .common-layout {
301
- .footer {
302
- .copyright {
303
- color: #fff !important;
304
- }
305
- }
306
- }
307
- #loginForm {
308
- .ant-input {
309
- border-radius: 30px;
310
- }
311
- .ant-input-lg {
312
- min-height: 43px;
313
- height: 5.4vh;
314
- }
315
- .ant-tabs-bar {
316
- margin-bottom: 24px;
317
- }
318
- .ant-input-affix-wrapper {
319
- font-size: 1.15rem;
320
- }
321
- .ant-input-affix-wrapper .ant-input:not(:first-child) {
322
- padding-left: 2.4vw;
323
- @media screen and (max-width: 479px) {
324
- padding-left: 10vw;
325
- }
326
- @media screen and (min-width: 480px) and (max-width: 767px) {
327
- padding-left: 8vw;
328
- }
329
- @media screen and (min-width: 768px) and (max-width: 959px) {
330
- padding-left: 5vw;
331
- }
332
- @media screen and (min-width: 960px) {
333
- padding-left: 4vw;
334
- }
335
- @media screen and (min-width: 1200px) {
336
- padding-left: 2.4vw;
337
- }
338
- }
339
- .ant-input-affix-wrapper .ant-input-prefix, .ant-input-affix-wrapper .ant-input-suffix {
340
- color: #4F93FE;
341
- }
342
- .ant-alert {
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="showCategoryAlert || showPhoneAlert || !validCustomerName || showContactAlert || !imageList.length" style="margin-right: 20px" type="primary" @click="onSubmit">
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
  }
@@ -75,7 +75,7 @@ export default {
75
75
  // 工单详情
76
76
  details: {
77
77
  uploader: '',
78
- status: '',
78
+ status: 0,
79
79
  name: '',
80
80
  phone: '',
81
81
  createdTime: '',
@@ -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
- ROUTES: `/rs/user/userLogin/智慧燃气`,
10
- SEARCH: `/rs/search`,
11
- GOODS: `/goods`,
12
- GOODS_COLUMNS: `/columns`
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
+ }
@@ -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 getRoutesConfig (value) {
18
- return request(ROUTES, METHOD.POST, value)
19
- }
20
-
21
- export async function V4Login (name, password) {
22
- return request(V4_LOGIN, METHOD.POST, {
23
- username: name,
24
- password: password
25
- })
26
- }
27
-
28
- /**
29
- * 退出登录
30
- */
31
- export function logout () {
32
- return new Promise((resolve, reject) => {
33
- request(V4_LOGOUT, METHOD.DELETE, {}).then(() => {
34
- resolve()
35
- }).catch(error => {
36
- reject(error)
37
- }).finally(() => {
38
- localStorage.removeItem(process.env.VUE_APP_ROUTES_KEY)
39
- localStorage.removeItem(process.env.VUE_APP_PERMISSIONS_KEY)
40
- localStorage.removeItem(process.env.VUE_APP_ROLES_KEY)
41
- removeAuthorization()
42
- })
43
- })
44
- }
45
- export default {
46
- login,
47
- logout,
48
- getRoutesConfig
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
+ }