同步用户数据
This commit is contained in:
@@ -35,6 +35,15 @@ export function addUser(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 从老系统(Oracle)同步部门/角色/用户(覆盖式迁移)
|
||||
export function syncUsersFromOracle() {
|
||||
return request({
|
||||
url: '/system/user/syncFromOracle',
|
||||
method: 'post',
|
||||
timeout: 120000
|
||||
})
|
||||
}
|
||||
|
||||
// 修改用户
|
||||
export function updateUser(data) {
|
||||
return request({
|
||||
|
||||
@@ -28,6 +28,9 @@
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['system:user:export']">导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Refresh" :loading="syncLoading" @click="handleSyncFromOracle" v-hasPermi="['system:user:add']">TMS系统同步用户数据</el-button>
|
||||
</el-col>
|
||||
</template>
|
||||
|
||||
<template #col-userName="{ row }">
|
||||
@@ -160,7 +163,7 @@ import TreePanel from "@/components/TreePanel"
|
||||
import ExcelImportDialog from "@/components/ExcelImportDialog"
|
||||
import UserViewDrawer from "./view"
|
||||
import { usePasswordRule } from "@/utils/passwordRule"
|
||||
import { changeUserStatus, listUser, resetUserPwd, delUser, getUser, updateUser, addUser, deptTreeSelect } from "@/api/system/user"
|
||||
import { changeUserStatus, listUser, resetUserPwd, delUser, getUser, updateUser, addUser, deptTreeSelect, syncUsersFromOracle } from "@/api/system/user"
|
||||
import { nextTick } from "vue"
|
||||
|
||||
const router = useRouter()
|
||||
@@ -169,6 +172,7 @@ const { pwdValidator, pwdPromptValidator } = usePasswordRule()
|
||||
const { sys_normal_disable, sys_user_sex } = useDict("sys_normal_disable", "sys_user_sex")
|
||||
|
||||
const tableRef = ref()
|
||||
const syncLoading = ref(false)
|
||||
const open = ref(false)
|
||||
const title = ref("")
|
||||
const deptId = ref(undefined)
|
||||
@@ -257,6 +261,22 @@ function handleDelete(userIds) {
|
||||
}).catch(() => {})
|
||||
}
|
||||
|
||||
/** 从老系统(Oracle)同步部门/角色/用户 */
|
||||
function handleSyncFromOracle() {
|
||||
proxy.$modal.confirm(
|
||||
'将从老系统同步部门(威狮国际及其下级部门)、角色、用户数据。注意:同步为覆盖式迁移,除超级管理员外,系统现有部门、角色、用户将被老系统数据替换(角色权限需另行配置,新用户默认密码 123456)。是否继续?'
|
||||
).then(() => {
|
||||
syncLoading.value = true
|
||||
return syncUsersFromOracle()
|
||||
}).then(res => {
|
||||
proxy.$modal.msgSuccess(res.msg || '同步成功')
|
||||
getDeptTree()
|
||||
tableRef.value.refresh()
|
||||
}).catch(() => {}).finally(() => {
|
||||
syncLoading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download("system/user/export", {
|
||||
|
||||
Reference in New Issue
Block a user