refactor: user manage
This commit is contained in:
parent
e85aee434c
commit
8e89658b04
@ -135,7 +135,7 @@
|
|||||||
<el-divider direction="vertical"/>
|
<el-divider direction="vertical"/>
|
||||||
<span class="mr-8">
|
<span class="mr-8">
|
||||||
<el-button type="primary" text @click.stop="editUser(row)" :title="$t('common.edit')"
|
<el-button type="primary" text @click.stop="editUser(row)" :title="$t('common.edit')"
|
||||||
v-if="hasPermission([RoleConst.ADMIN,PermissionConst.USER_EDIT],'OR')" >
|
v-if="hasPermission([RoleConst.ADMIN,PermissionConst.USER_EDIT],'OR')">
|
||||||
<el-icon><EditPen/></el-icon>
|
<el-icon><EditPen/></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
</span>
|
</span>
|
||||||
@ -182,7 +182,7 @@ import {MsgSuccess, MsgConfirm} from '@/utils/message'
|
|||||||
import {t} from '@/locales'
|
import {t} from '@/locales'
|
||||||
import {ValidCount, ValidType} from "@/enums/common.ts";
|
import {ValidCount, ValidType} from "@/enums/common.ts";
|
||||||
import useStore from "@/stores";
|
import useStore from "@/stores";
|
||||||
import { PermissionConst, RoleConst } from '@/utils/permission/data'
|
import {PermissionConst, RoleConst} from '@/utils/permission/data'
|
||||||
import {hasPermission} from '@/utils/permission/index'
|
import {hasPermission} from '@/utils/permission/index'
|
||||||
|
|
||||||
const {user, common} = useStore()
|
const {user, common} = useStore()
|
||||||
@ -255,22 +255,23 @@ function editUser(row: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function createUser() {
|
function createUser() {
|
||||||
common.asyncGetValid(ValidType.User, ValidCount.User, loading).then(async (res: any) => {
|
|
||||||
if (res?.data) {
|
|
||||||
title.value = t('views.userManage.createUser')
|
title.value = t('views.userManage.createUser')
|
||||||
UserDrawerRef.value.open()
|
UserDrawerRef.value.open()
|
||||||
} else if (res?.code === 400) {
|
// common.asyncGetValid(ValidType.User, ValidCount.User, loading).then(async (res: any) => {
|
||||||
MsgConfirm(t('common.tip'), t('views.userManage.tip.professionalMessage'), {
|
// if (res?.data) {
|
||||||
cancelButtonText: t('common.confirm'),
|
// title.value = t('views.userManage.createUser')
|
||||||
confirmButtonText: t('common.professional'),
|
// UserDrawerRef.value.open()
|
||||||
})
|
// } else if (res?.code === 400) {
|
||||||
.then(() => {
|
// MsgConfirm(t('common.tip'), t('views.userManage.tip.professionalMessage'), {
|
||||||
window.open('https://maxkb.cn/pricing.html', '_blank')
|
// cancelButtonText: t('common.confirm'),
|
||||||
})
|
// confirmButtonText: t('common.professional'),
|
||||||
.catch(() => {
|
// })
|
||||||
})
|
// .then(() => {
|
||||||
}
|
// window.open('https://maxkb.cn/pricing.html', '_blank')
|
||||||
})
|
// })
|
||||||
|
// .catch(() => {})
|
||||||
|
// }
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteUserManage(row: any) {
|
function deleteUserManage(row: any) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user