| | |
| | | import { getDeptTree } from '@/api/system/dept' |
| | | import { getRoleTree } from '@/api/system/role' |
| | | import func from '@/utils/func' |
| | | import { saveOperationLog } from '@ztzf/apis' |
| | | import { useRoute } from 'vue-router' |
| | | |
| | | // 初始化表单 |
| | | const initForm = () => ({ |
| | |
| | | const titleEnum = ref({ edit: '编辑用户', view: '查看用户', add: '新增用户' }) |
| | | const roleTree = ref([]) |
| | | const deptTree = ref([]) |
| | | const route = useRoute() |
| | | |
| | | // 密码验证 |
| | | const validatePass = (rule, value, callback) => { |
| | |
| | | |
| | | if (dialogMode.value === 'add') { |
| | | await add(submitData) |
| | | saveOperationLog({ |
| | | requestUri: route.path, |
| | | title: `${route.name || '用户管理01'}-新增`, |
| | | type: 1 |
| | | }) |
| | | ElMessage.success('新增成功') |
| | | } else { |
| | | await update(submitData) |
| | | saveOperationLog({ |
| | | requestUri: route.path, |
| | | title: `${route.name || '用户管理01'}-编辑`, |
| | | type: 1 |
| | | }) |
| | | ElMessage.success('更新成功') |
| | | } |
| | | visible.value = false |