This commit is contained in:
77
2024-04-26 01:02:00 +08:00
parent bba3830396
commit 6f23538f3b

View File

@@ -74,6 +74,14 @@
</el-table-column>
<el-table-column label="昵称" align="center" prop="reportNickname"/>
<el-table-column :label="systemName+'号'" align="center" prop="reportUsercode"/>
<el-table-column label="IM状态" align="center" prop="im" >
<template v-slot="scope">
<el-tag v-if="scope.row.reportEnableIm && scope.row.reportImSpeck" :disable-transitions="true" type="primary">正常</el-tag>
<el-tag v-if="scope.row.reportEnableIm && !scope.row.reportImSpeck" :disable-transitions="true" type="warning">禁言</el-tag>
<el-tag v-if="!scope.row.reportEnableIm && scope.row.reportImSpeck" :disable-transitions="true" type="danger">封禁</el-tag>
<el-tag v-if="!scope.row.reportEnableIm && !scope.row.reportImSpeck" :disable-transitions="true" type="danger">封禁+禁言</el-tag>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="举报内容" align="center" prop="content"/>
<el-table-column label="状态" align="center" prop="status">
@@ -106,6 +114,15 @@
v-hasPermi="['cai:report:remove']"
>删除
</el-button>
<el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)">
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-hasPermi="['cai:user:im']" v-if="scope.row.reportEnableIm" 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.reportEnableIm" 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.reportImSpeck" 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.reportImSpeck" command="handleEnSpeckIm" icon="el-icon-unlock"><span style="color: blue">解封禁言</span></el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
@@ -126,6 +143,7 @@
import { delReport, listReport, updateReport } from '@/api/cai/report'
import { reportStatusList, reportTypeList } from '@/constant/statusMap'
import UserForbidDialog from "@/views/cai/user/user-forbid-dialog";
import {enSpeckIm, lockIm, noSpeckIm, unLockIm, userLogout} from "@/api/cai/user";
export default {
name: 'Report',
@@ -230,6 +248,76 @@ export default {
this.$refs.userForbid.init(row.reportUid)
})
},
handleLockIm(row){
this.$modal.confirm('是否确认封禁用户"' + row.reportNickname + '"的IM').then(() => {
this.loading = true;
return lockIm(row.reportUid);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
handleUnlockIm(row){
this.$modal.confirm('是否确认解封用户"' + row.reportNickname + '"的IM').then(() => {
this.loading = true;
return unLockIm(row.reportUid);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
handleNoSpeckIm(row){
this.$modal.confirm('是否确认封禁用户"' + row.reportNickname + '"的IM聊天功能').then(() => {
this.loading = true;
return noSpeckIm(row.reportUid);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
handleEnSpeckIm(row){
this.$modal.confirm('是否确认解封用户"' + row.reportNickname + '"的IM聊天功能').then(() => {
this.loading = true;
return enSpeckIm(row.reportUid);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
handleCommand(command, row) {
switch (command) {
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:
break;
}
},
}
}
</script>