|
@@ -30,10 +30,9 @@ import { Form, FormSchema, RadioOption } from '@/components/Form'
|
30
|
30
|
import { useForm } from '@/hooks/web/useForm'
|
31
|
31
|
import { useValidator } from '@/hooks/web/useValidator'
|
32
|
32
|
import { BaseButton } from '@/components/Button'
|
33
|
|
-import { Search, Edit, Delete } from '@element-plus/icons-vue'
|
34
|
33
|
import { getRsaKey } from '@/api/login'
|
35
|
34
|
import { cloneDeep } from 'lodash-es'
|
36
|
|
-const { required, noSpaceOrSpecialChars } = useValidator()
|
|
35
|
+const { required, noSpaceOrSpecialChars, validateMobile } = useValidator()
|
37
|
36
|
|
38
|
37
|
defineOptions({
|
39
|
38
|
name: 'TemplateManage'
|
|
@@ -47,6 +46,11 @@ const rules = reactive<{
|
47
|
46
|
validator: (rule, value, callback) =>
|
48
|
47
|
noSpaceOrSpecialChars(value, callback, '不包含中文、空格、特殊字符')
|
49
|
48
|
}
|
|
49
|
+ ],
|
|
50
|
+ userCode: [
|
|
51
|
+ {
|
|
52
|
+ validator: (rule, value, callback) => validateMobile(value, callback, '请输入正确手机号')
|
|
53
|
+ }
|
50
|
54
|
]
|
51
|
55
|
})
|
52
|
56
|
|
|
@@ -126,23 +130,23 @@ let schema = reactive<FormSchema[]>([
|
126
|
130
|
},
|
127
|
131
|
formItemProps: {}
|
128
|
132
|
},
|
129
|
|
- {
|
130
|
|
- field: 'authorizationCode',
|
131
|
|
- label: '授权码',
|
132
|
|
- component: 'Input',
|
133
|
|
- colProps: {
|
134
|
|
- span: 24
|
135
|
|
- },
|
136
|
|
- componentProps: {
|
137
|
|
- style: {
|
138
|
|
- width: '100%'
|
139
|
|
- },
|
140
|
|
- placeholder: '请输入授权码'
|
141
|
|
- },
|
142
|
|
- formItemProps: {
|
143
|
|
- rules: [required()]
|
144
|
|
- }
|
145
|
|
- },
|
|
133
|
+ // {
|
|
134
|
+ // field: 'authorizationCode',
|
|
135
|
+ // label: '授权码',
|
|
136
|
+ // component: 'Input',
|
|
137
|
+ // colProps: {
|
|
138
|
+ // span: 24
|
|
139
|
+ // },
|
|
140
|
+ // componentProps: {
|
|
141
|
+ // style: {
|
|
142
|
+ // width: '100%'
|
|
143
|
+ // },
|
|
144
|
+ // placeholder: '请输入授权码'
|
|
145
|
+ // },
|
|
146
|
+ // formItemProps: {
|
|
147
|
+ // rules: [required()]
|
|
148
|
+ // }
|
|
149
|
+ // },
|
146
|
150
|
{
|
147
|
151
|
field: 'hasManage',
|
148
|
152
|
label: '是否进入后台',
|
|
@@ -209,7 +213,7 @@ const signIn = async () => {
|
209
|
213
|
}
|
210
|
214
|
|
211
|
215
|
nweformData.userCode = encryptedData(res2.data, formData.userCode)
|
212
|
|
- nweformData.authorizationCode = encryptedData(res2.data, formData.authorizationCode)
|
|
216
|
+ // nweformData.authorizationCode = encryptedData(res2.data, formData.authorizationCode)
|
213
|
217
|
let res = await saveUser(nweformData)
|
214
|
218
|
if (res) {
|
215
|
219
|
dialogVisible.value = false
|
|
@@ -317,7 +321,7 @@ const editUser = async (data) => {
|
317
|
321
|
style: {
|
318
|
322
|
width: '100%'
|
319
|
323
|
},
|
320
|
|
- placeholder: '请输入8位数字',
|
|
324
|
+ placeholder: '请输入电话号码',
|
321
|
325
|
disabled: isedit.value === '添加用户' ? false : true
|
322
|
326
|
},
|
323
|
327
|
formItemProps: {
|
|
@@ -356,23 +360,23 @@ const editUser = async (data) => {
|
356
|
360
|
},
|
357
|
361
|
formItemProps: {}
|
358
|
362
|
},
|
359
|
|
- {
|
360
|
|
- field: 'authorizationCode',
|
361
|
|
- label: '授权码',
|
362
|
|
- component: 'Input',
|
363
|
|
- colProps: {
|
364
|
|
- span: 24
|
365
|
|
- },
|
366
|
|
- componentProps: {
|
367
|
|
- style: {
|
368
|
|
- width: '100%'
|
369
|
|
- },
|
370
|
|
- placeholder: '请输入授权码'
|
371
|
|
- },
|
372
|
|
- formItemProps: {
|
373
|
|
- rules: [required()]
|
374
|
|
- }
|
375
|
|
- },
|
|
363
|
+ // {
|
|
364
|
+ // field: 'authorizationCode',
|
|
365
|
+ // label: '授权码',
|
|
366
|
+ // component: 'Input',
|
|
367
|
+ // colProps: {
|
|
368
|
+ // span: 24
|
|
369
|
+ // },
|
|
370
|
+ // componentProps: {
|
|
371
|
+ // style: {
|
|
372
|
+ // width: '100%'
|
|
373
|
+ // },
|
|
374
|
+ // placeholder: '请输入授权码'
|
|
375
|
+ // },
|
|
376
|
+ // formItemProps: {
|
|
377
|
+ // rules: [required()]
|
|
378
|
+ // }
|
|
379
|
+ // },
|
376
|
380
|
{
|
377
|
381
|
field: 'hasManage',
|
378
|
382
|
label: '是否进入后台',
|
|
@@ -427,7 +431,7 @@ const editUser = async (data) => {
|
427
|
431
|
|
428
|
432
|
let res = await getUserDetail(arr)
|
429
|
433
|
res.data.userCode = decrypt(res.data.userCode, key2)
|
430
|
|
- res.data.authorizationCode = decrypt(res.data.authorizationCode, key2)
|
|
434
|
+ // res.data.authorizationCode = decrypt(res.data.authorizationCode, key2)
|
431
|
435
|
if (res) {
|
432
|
436
|
dialogVisible.value = true
|
433
|
437
|
const formRef = await getElFormExpose()
|
|
@@ -437,7 +441,7 @@ const editUser = async (data) => {
|
437
|
441
|
formData.userCode = res.data.userCode
|
438
|
442
|
formData.displayName = res.data.displayName
|
439
|
443
|
formData.hasManage = res.data.hasManage
|
440
|
|
- formData.authorizationCode = res.data.authorizationCode
|
|
444
|
+ // formData.authorizationCode = res.data.authorizationCode
|
441
|
445
|
formData.roleIds = res.data.roleInfoList[0].roleName
|
442
|
446
|
formData.userId = res.data.userId
|
443
|
447
|
}
|
|
@@ -517,7 +521,7 @@ const tianjia = async () => {
|
517
|
521
|
style: {
|
518
|
522
|
width: '100%'
|
519
|
523
|
},
|
520
|
|
- placeholder: '请输入8位数字',
|
|
524
|
+ placeholder: '请输入电话号码',
|
521
|
525
|
disabled: isedit.value === '添加用户' ? false : true
|
522
|
526
|
},
|
523
|
527
|
formItemProps: {
|
|
@@ -558,23 +562,23 @@ const tianjia = async () => {
|
558
|
562
|
rules: [required()]
|
559
|
563
|
}
|
560
|
564
|
},
|
561
|
|
- {
|
562
|
|
- field: 'authorizationCode',
|
563
|
|
- label: '授权码',
|
564
|
|
- component: 'Input',
|
565
|
|
- colProps: {
|
566
|
|
- span: 24
|
567
|
|
- },
|
568
|
|
- componentProps: {
|
569
|
|
- style: {
|
570
|
|
- width: '100%'
|
571
|
|
- },
|
572
|
|
- placeholder: '请输入授权码'
|
573
|
|
- },
|
574
|
|
- formItemProps: {
|
575
|
|
- rules: [required()]
|
576
|
|
- }
|
577
|
|
- },
|
|
565
|
+ // {
|
|
566
|
+ // field: 'authorizationCode',
|
|
567
|
+ // label: '授权码',
|
|
568
|
+ // component: 'Input',
|
|
569
|
+ // colProps: {
|
|
570
|
+ // span: 24
|
|
571
|
+ // },
|
|
572
|
+ // componentProps: {
|
|
573
|
+ // style: {
|
|
574
|
+ // width: '100%'
|
|
575
|
+ // },
|
|
576
|
+ // placeholder: '请输入授权码'
|
|
577
|
+ // },
|
|
578
|
+ // formItemProps: {
|
|
579
|
+ // rules: [required()]
|
|
580
|
+ // }
|
|
581
|
+ // },
|
578
|
582
|
{
|
579
|
583
|
field: 'hasManage',
|
580
|
584
|
label: '是否进入后台',
|
|
@@ -660,7 +664,7 @@ const tianjia = async () => {
|
660
|
664
|
/>
|
661
|
665
|
</ContentWrap>
|
662
|
666
|
|
663
|
|
- <Dialog v-model="dialogVisible" maxHeight="380px" width="35rem" :title="isedit">
|
|
667
|
+ <Dialog v-model="dialogVisible" maxHeight="250px" width="35rem" :title="isedit">
|
664
|
668
|
<Form label-position="left" :rules="rules" :schema="schema" @register="formRegister" />
|
665
|
669
|
|
666
|
670
|
<template #footer>
|