This commit is contained in:
77
2024-04-17 23:09:14 +08:00
parent 76bcf110ce
commit 8637404f66
3 changed files with 122 additions and 5 deletions

View File

@@ -130,3 +130,44 @@ export function userBindInvite(userId,inviteUsercode) {
} }
}) })
} }
export function lockIm(userId) {
return request({
url: '/cai/user/lockIm',
method: 'get',
params:{
userId
}
})
}
export function unLockIm(userId) {
return request({
url: '/cai/user/unLockIm',
method: 'get',
params:{
userId
}
})
}
export function noSpeckIm(userId) {
return request({
url: '/cai/user/noSpeckIm',
method: 'get',
params:{
userId
}
})
}
export function enSpeckIm(userId) {
return request({
url: '/cai/user/enSpeckIm',
method: 'get',
params:{
userId
}
})
}

View File

@@ -120,6 +120,14 @@
<cai-dict-tag :options="userStatusList" :value="scope.row.status" /> <cai-dict-tag :options="userStatusList" :value="scope.row.status" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="IM状态" align="center" prop="im" >
<template v-slot="scope">
<el-tag v-if="scope.row.enableIm && scope.row.imSpeck" :disable-transitions="true" type="primary">正常</el-tag>
<el-tag v-if="scope.row.enableIm && !scope.row.imSpeck" :disable-transitions="true" type="warning">禁言</el-tag>
<el-tag v-if="!scope.row.enableIm && scope.row.imSpeck" :disable-transitions="true" type="danger">封禁</el-tag>
<el-tag v-if="!scope.row.enableIm && !scope.row.imSpeck" :disable-transitions="true" type="danger">封禁+禁言</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120" fixed="right"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120" fixed="right">
<template v-slot="scope"> <template v-slot="scope">
<el-button <el-button
@@ -137,6 +145,10 @@
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button> <el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<!-- <el-dropdown-item command="handleDelete" icon="el-icon-info">完整信息</el-dropdown-item>--> <!-- <el-dropdown-item command="handleDelete" icon="el-icon-info">完整信息</el-dropdown-item>-->
<el-dropdown-item v-hasPermi="['cai:user:im']" v-if="scope.row.enableIm" command="handleLockIm" icon="el-icon-lock"><span style="color: red">封禁IM</span></el-dropdown-item>
<el-dropdown-item v-hasPermi="['cai:user:im']" v-if="!scope.row.enableIm" command="handleUnlockIm" icon="el-icon-unlock"><span style="color: blue">解封IM</span></el-dropdown-item>
<el-dropdown-item v-hasPermi="['cai:user:im']" v-if="scope.row.imSpeck" command="handleNoSpeckIm" icon="el-icon-lock"><span style="color: red">禁言</span></el-dropdown-item>
<el-dropdown-item v-hasPermi="['cai:user:im']" v-if="!scope.row.imSpeck" command="handleEnSpeckIm" icon="el-icon-unlock"><span style="color: blue">解封禁言</span></el-dropdown-item>
<el-dropdown-item v-hasPermi="['cai:user:restPwd']" command="handleResetPwd" icon="el-icon-key">重置密码</el-dropdown-item> <el-dropdown-item v-hasPermi="['cai:user:restPwd']" command="handleResetPwd" icon="el-icon-key">重置密码</el-dropdown-item>
<el-dropdown-item v-hasPermi="['cai:user:updateMobile']" command="handleResetMobile" icon="el-icon-phone">修改手机</el-dropdown-item> <el-dropdown-item v-hasPermi="['cai:user:updateMobile']" command="handleResetMobile" icon="el-icon-phone">修改手机</el-dropdown-item>
<el-dropdown-item v-hasPermi="['cai:user:lock']" command="handleUserForbid" icon="el-icon-lock">封禁</el-dropdown-item> <el-dropdown-item v-hasPermi="['cai:user:lock']" command="handleUserForbid" icon="el-icon-lock">封禁</el-dropdown-item>
@@ -168,11 +180,11 @@
<script> <script>
import { import {
delUser, delUser, enSpeckIm,
getFullUser, getUser, getFullUser, getUser,
listUser, listUser, lockIm, noSpeckIm,
resetUserMobile, resetUserMobile,
resetUserPassword, resetUserPassword, unLockIm,
userResetAvatar, userResetAvatar,
userResetNickname, userUnBindInvite userResetNickname, userUnBindInvite
} from '@/api/cai/user' } from '@/api/cai/user'
@@ -402,6 +414,58 @@ export default {
}) })
}) })
}, },
handleLockIm(row){
this.$modal.confirm('是否确认封禁用户"' + row.nickname + '"的IM').then(() => {
this.loading = true;
return lockIm(row.id);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
handleUnlockIm(row){
this.$modal.confirm('是否确认解封用户"' + row.nickname + '"的IM').then(() => {
this.loading = true;
return unLockIm(row.id);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
handleNoSpeckIm(row){
this.$modal.confirm('是否确认封禁用户"' + row.nickname + '"的IM聊天功能').then(() => {
this.loading = true;
return noSpeckIm(row.id);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
handleEnSpeckIm(row){
this.$modal.confirm('是否确认解封用户"' + row.nickname + '"的IM聊天功能').then(() => {
this.loading = true;
return enSpeckIm(row.id);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
handleCommand(command, row) { handleCommand(command, row) {
switch (command) { switch (command) {
case "handleDelete": case "handleDelete":
@@ -428,6 +492,18 @@ export default {
case "handleUserUnBindInvite": case "handleUserUnBindInvite":
this.handleUserUnBindInvite(row); this.handleUserUnBindInvite(row);
break; break;
case "handleLockIm":
this.handleLockIm(row);
break;
case "handleUnlockIm":
this.handleUnlockIm(row);
break;
case "handleNoSpeckIm":
this.handleNoSpeckIm(row);
break;
case "handleEnSpeckIm":
this.handleEnSpeckIm(row);
break;
default: default:
break; break;
} }

View File

@@ -51,11 +51,11 @@
</el-col> </el-col>
<el-col :lg="6" :sm="12" :xs="12" class="card-panel-col"> <el-col :lg="6" :sm="12" :xs="12" class="card-panel-col">
<RankList :type="1" :operation="operation" title="女神收入榜" @switch-change=""/> <RankList :type="1" :operation="operation" title="用户邀请榜" @switch-change=""/>
</el-col> </el-col>
<el-col :lg="6" :sm="12" :xs="12" class="card-panel-col"> <el-col :lg="6" :sm="12" :xs="12" class="card-panel-col">
<RankList :operation="operation" :type="2" title="用户邀请榜"/> <RankList :operation="operation" :type="2" title="女神收入榜"/>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>