| | |
| | | |
| | | import { userSexMap } from '../types'; |
| | | import * as userApi from '/@/api/auth/user'; |
| | | import { formatDate } from '/@/utils/formatTime'; |
| | | |
| | | const props = defineProps(['item', 'roleList']); |
| | | const emit = defineEmits(['update', 'insert']); |
| | |
| | | const submitFormValue = async () => { |
| | | const valid = await dialogFormRef.value.validate().catch(() => {}); |
| | | if (!valid) return; |
| | | const updateTime = formatDate(new Date()); |
| | | |
| | | if (isEditDialog.value) { |
| | | const res = await userApi.updateUserInfoByPost(dialogFormValue.value); |
| | |
| | | |
| | | const res = await userApi.addUserInfoByPost(sendForm); |
| | | const newData = { |
| | | id: res.user_id, |
| | | user_id: res.user_id, |
| | | ...dialogFormValue.value, |
| | | create_time: updateTime.slice(0, 10), |
| | | }; |
| | | emit('insert', newData); |
| | | // tableData.value.push(newData); |