压缩图片
@@ -116,6 +116,8 @@ import { roleAll } from '@/api/perms/role'
|
|||||||
import { postAll } from '@/api/org/post'
|
import { postAll } from '@/api/org/post'
|
||||||
import { deptLists } from '@/api/org/department'
|
import { deptLists } from '@/api/org/department'
|
||||||
import feedback from '@/utils/feedback'
|
import feedback from '@/utils/feedback'
|
||||||
|
import { encryptPassword } from '@/utils/util'
|
||||||
|
|
||||||
const emit = defineEmits(['success', 'close'])
|
const emit = defineEmits(['success', 'close'])
|
||||||
const formRef = shallowRef<FormInstance>()
|
const formRef = shallowRef<FormInstance>()
|
||||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||||
@@ -231,7 +233,15 @@ const { optionsData } = useDictOptions<{
|
|||||||
|
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
await formRef.value?.validate()
|
await formRef.value?.validate()
|
||||||
mode.value == 'edit' ? await adminEdit(formData) : await adminAdd(formData)
|
const data = {
|
||||||
|
...formData
|
||||||
|
}
|
||||||
|
if (formData.password) {
|
||||||
|
data.password = encryptPassword(formData.password)
|
||||||
|
data.passwordConfirm = encryptPassword(formData.passwordConfirm)
|
||||||
|
}
|
||||||
|
|
||||||
|
mode.value == 'edit' ? await adminEdit(data) : await adminAdd(data)
|
||||||
popupRef.value?.close()
|
popupRef.value?.close()
|
||||||
feedback.msgSuccess('操作成功')
|
feedback.msgSuccess('操作成功')
|
||||||
emit('success')
|
emit('success')
|
||||||
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 18 KiB |