mirror of
https://github.com/TangSengDaoDao/TangSengDaoDaoManager
synced 2025-06-06 09:08:23 +00:00
feat: ✨新增群组接口调试
This commit is contained in:
parent
d023507ce9
commit
b0176c66fd
19
src/api/group.ts
Normal file
19
src/api/group.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import request from '@/utils/axios';
|
||||||
|
|
||||||
|
// 群列表
|
||||||
|
export function groupListGet(params: any) {
|
||||||
|
return request({
|
||||||
|
url: '/manager/group/list',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 封禁群列表
|
||||||
|
export function groupDisablelistGet(params: any) {
|
||||||
|
return request({
|
||||||
|
url: '/manager/group/disablelist',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
@ -8,3 +8,12 @@ export function userListGet(params: any) {
|
|||||||
params
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 封禁用户列表
|
||||||
|
export function userDisablelistGet(params: any) {
|
||||||
|
return request({
|
||||||
|
url: '/manager/user/disablelist',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -9,10 +9,10 @@
|
|||||||
<div class="flex items-center h-50px">
|
<div class="flex items-center h-50px">
|
||||||
<el-form inline>
|
<el-form inline>
|
||||||
<el-form-item class="mb-0 !mr-16px">
|
<el-form-item class="mb-0 !mr-16px">
|
||||||
<el-input v-model="queryFrom.keyword" placeholder="uid/手机号/用户名" clearable />
|
<el-input v-model="queryFrom.keyword" placeholder="群名称/群编号" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item class="mb-0 !mr-0">
|
<el-form-item class="mb-0 !mr-0">
|
||||||
<el-button type="primary" @click="getUserList">查询</el-button>
|
<el-button type="primary" @click="getTableList">查询</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@ -66,32 +66,28 @@ meta:
|
|||||||
import { ElButton, ElSpace, ElAvatar } from 'element-plus';
|
import { ElButton, ElSpace, ElAvatar } from 'element-plus';
|
||||||
import { BU_DOU_CONFIG } from '@/config';
|
import { BU_DOU_CONFIG } from '@/config';
|
||||||
// API 接口
|
// API 接口
|
||||||
import { userListGet } from '@/api/user';
|
import { groupDisablelistGet } from '@/api/group';
|
||||||
/**
|
/**
|
||||||
* 表格
|
* 表格
|
||||||
*/
|
*/
|
||||||
const column = reactive([
|
const column = reactive<Column.ColumnOptions[]>([
|
||||||
{
|
{
|
||||||
prop: 'name',
|
prop: 'name',
|
||||||
label: '用户名',
|
label: '群名称'
|
||||||
fixed: 'left',
|
|
||||||
width: 140
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'phone',
|
prop: 'group_no',
|
||||||
label: '手机号',
|
label: '群编号'
|
||||||
fixed: 'left',
|
|
||||||
width: 120
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'avatar',
|
prop: 'avatar',
|
||||||
label: '头像',
|
label: '群头像',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 80,
|
width: 100,
|
||||||
render: (scope: any) => {
|
render: (scope: any) => {
|
||||||
let img_url = '';
|
let img_url = '';
|
||||||
if (scope.row['uid']) {
|
if (scope.row['group_no']) {
|
||||||
img_url = `${BU_DOU_CONFIG.APP_URL}users/${scope.row['uid']}/avatar`;
|
img_url = `${BU_DOU_CONFIG.APP_URL}groups/${scope.row['group_no']}/avatar`;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<ElAvatar src={img_url} size={54}>
|
<ElAvatar src={img_url} size={54}>
|
||||||
@ -101,45 +97,29 @@ const column = reactive([
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'uid',
|
prop: 'member_count',
|
||||||
label: '用户ID',
|
label: '群人数'
|
||||||
minWidth: 300
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'short_no',
|
prop: 'short_no',
|
||||||
label: '悟空号'
|
label: '群主名称'
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'sex',
|
|
||||||
label: '性别',
|
|
||||||
width: 60,
|
|
||||||
formatter(row: any) {
|
|
||||||
return row.sex === 1 ? '男' : '女';
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'register_time',
|
prop: 'register_time',
|
||||||
label: '注册时间',
|
label: '创建时间'
|
||||||
width: 170
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'last_online_time',
|
|
||||||
label: '封禁日期',
|
|
||||||
width: 150
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'operation',
|
prop: 'operation',
|
||||||
label: '操作',
|
label: '操作',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
width: 180,
|
width: 120,
|
||||||
render: (scope: any) => {
|
render: (scope: any) => {
|
||||||
return (
|
return (
|
||||||
<ElSpace>
|
<ElSpace>
|
||||||
<ElButton type="primary" onClick={() => aa(scope.row)}>
|
<ElButton type="primary" onClick={() => aa(scope.row)}>
|
||||||
发消息
|
解禁
|
||||||
</ElButton>
|
</ElButton>
|
||||||
<ElButton>更多</ElButton>
|
|
||||||
</ElSpace>
|
</ElSpace>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -157,9 +137,9 @@ const queryFrom = reactive({
|
|||||||
page_index: 1
|
page_index: 1
|
||||||
});
|
});
|
||||||
|
|
||||||
const getUserList = () => {
|
const getTableList = () => {
|
||||||
loadTable.value = true;
|
loadTable.value = true;
|
||||||
userListGet(queryFrom).then((res: any) => {
|
groupDisablelistGet(queryFrom).then((res: any) => {
|
||||||
loadTable.value = false;
|
loadTable.value = false;
|
||||||
tableData.value = res.list;
|
tableData.value = res.list;
|
||||||
total.value = res.count;
|
total.value = res.count;
|
||||||
@ -169,13 +149,13 @@ const getUserList = () => {
|
|||||||
// 分页page-size
|
// 分页page-size
|
||||||
const onSizeChange = (size: number) => {
|
const onSizeChange = (size: number) => {
|
||||||
queryFrom.page_size = size;
|
queryFrom.page_size = size;
|
||||||
getUserList();
|
getTableList();
|
||||||
};
|
};
|
||||||
|
|
||||||
// 分页page-size
|
// 分页page-size
|
||||||
const onCurrentChange = (current: number) => {
|
const onCurrentChange = (current: number) => {
|
||||||
queryFrom.page_index = current;
|
queryFrom.page_index = current;
|
||||||
getUserList();
|
getTableList();
|
||||||
};
|
};
|
||||||
|
|
||||||
const aa = (a: any) => {
|
const aa = (a: any) => {
|
||||||
@ -184,7 +164,7 @@ const aa = (a: any) => {
|
|||||||
|
|
||||||
// 初始化
|
// 初始化
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getUserList();
|
getTableList();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<div class="flex items-center h-50px">
|
<div class="flex items-center h-50px">
|
||||||
<el-form inline>
|
<el-form inline>
|
||||||
<el-form-item class="mb-0 !mr-16px">
|
<el-form-item class="mb-0 !mr-16px">
|
||||||
<el-input v-model="queryFrom.keyword" placeholder="uid/手机号/用户名" clearable />
|
<el-input v-model="queryFrom.keyword" placeholder="群名称/群编号" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item class="mb-0 !mr-0">
|
<el-form-item class="mb-0 !mr-0">
|
||||||
<el-button type="primary" @click="getUserList">查询</el-button>
|
<el-button type="primary" @click="getUserList">查询</el-button>
|
||||||
@ -63,35 +63,35 @@ meta:
|
|||||||
</route>
|
</route>
|
||||||
|
|
||||||
<script lang="tsx" setup>
|
<script lang="tsx" setup>
|
||||||
import { ElButton, ElSpace, ElAvatar } from 'element-plus';
|
import { ElButton, ElSpace, ElAvatar, ElDropdown, ElDropdownMenu, ElDropdownItem } from 'element-plus';
|
||||||
import { BU_DOU_CONFIG } from '@/config';
|
import { BU_DOU_CONFIG } from '@/config';
|
||||||
// API 接口
|
// API 接口
|
||||||
import { userListGet } from '@/api/user';
|
import { groupListGet } from '@/api/group';
|
||||||
/**
|
/**
|
||||||
* 表格
|
* 表格
|
||||||
*/
|
*/
|
||||||
const column = reactive([
|
const column = reactive<Column.ColumnOptions[]>([
|
||||||
{
|
{
|
||||||
prop: 'name',
|
prop: 'name',
|
||||||
label: '用户名',
|
label: '群名称',
|
||||||
fixed: 'left',
|
fixed: 'left',
|
||||||
width: 140
|
width: 200
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'phone',
|
prop: 'group_no',
|
||||||
label: '手机号',
|
label: '群编号',
|
||||||
fixed: 'left',
|
fixed: 'left',
|
||||||
width: 120
|
width: 200
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'avatar',
|
prop: 'avatar',
|
||||||
label: '头像',
|
label: '群头像',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 80,
|
width: 100,
|
||||||
render: (scope: any) => {
|
render: (scope: any) => {
|
||||||
let img_url = '';
|
let img_url = '';
|
||||||
if (scope.row['uid']) {
|
if (scope.row['group_no']) {
|
||||||
img_url = `${BU_DOU_CONFIG.APP_URL}users/${scope.row['uid']}/avatar`;
|
img_url = `${BU_DOU_CONFIG.APP_URL}groups/${scope.row['group_no']}/avatar`;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<ElAvatar src={img_url} size={54}>
|
<ElAvatar src={img_url} size={54}>
|
||||||
@ -101,31 +101,30 @@ const column = reactive([
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'uid',
|
prop: 'status',
|
||||||
label: '用户ID',
|
label: '群状态',
|
||||||
minWidth: 300
|
width: 80,
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'short_no',
|
|
||||||
label: '悟空号'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'sex',
|
|
||||||
label: '性别',
|
|
||||||
width: 60,
|
|
||||||
formatter(row: any) {
|
formatter(row: any) {
|
||||||
return row.sex === 1 ? '男' : '女';
|
return row.status === 1 ? '正常' : '封禁中';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'register_time',
|
prop: 'member_count',
|
||||||
label: '注册时间',
|
label: '群人数',
|
||||||
width: 170
|
width: 80
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'last_online_time',
|
prop: 'create_name',
|
||||||
label: '封禁日期',
|
label: '群主名称'
|
||||||
width: 150
|
},
|
||||||
|
{
|
||||||
|
prop: 'creator',
|
||||||
|
label: '群主ID'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'create_at',
|
||||||
|
label: '创建时间',
|
||||||
|
width: 180
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'operation',
|
prop: 'operation',
|
||||||
@ -139,7 +138,22 @@ const column = reactive([
|
|||||||
<ElButton type="primary" onClick={() => aa(scope.row)}>
|
<ElButton type="primary" onClick={() => aa(scope.row)}>
|
||||||
发消息
|
发消息
|
||||||
</ElButton>
|
</ElButton>
|
||||||
<ElButton>更多</ElButton>
|
<ElDropdown
|
||||||
|
v-slots={{
|
||||||
|
default: () => <ElButton>更多</ElButton>,
|
||||||
|
dropdown: () => {
|
||||||
|
return (
|
||||||
|
<ElDropdownMenu>
|
||||||
|
<ElDropdownItem onClick={() => bb(scope.row)}>群成员</ElDropdownItem>
|
||||||
|
<ElDropdownItem>聊天记录</ElDropdownItem>
|
||||||
|
<ElDropdownItem>黑名单成员</ElDropdownItem>
|
||||||
|
<ElDropdownItem>{scope.row.forbidden === 1 ? '禁言中' : '禁言'}</ElDropdownItem>
|
||||||
|
<ElDropdownItem>{scope.row.status === 1 ? '封禁' : '解禁'}</ElDropdownItem>
|
||||||
|
</ElDropdownMenu>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</ElSpace>
|
</ElSpace>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -159,7 +173,7 @@ const queryFrom = reactive({
|
|||||||
|
|
||||||
const getUserList = () => {
|
const getUserList = () => {
|
||||||
loadTable.value = true;
|
loadTable.value = true;
|
||||||
userListGet(queryFrom).then((res: any) => {
|
groupListGet(queryFrom).then((res: any) => {
|
||||||
loadTable.value = false;
|
loadTable.value = false;
|
||||||
tableData.value = res.list;
|
tableData.value = res.list;
|
||||||
total.value = res.count;
|
total.value = res.count;
|
||||||
@ -182,6 +196,10 @@ const aa = (a: any) => {
|
|||||||
console.log(a);
|
console.log(a);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const bb = (a: any) => {
|
||||||
|
console.log(a);
|
||||||
|
};
|
||||||
|
|
||||||
// 初始化
|
// 初始化
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getUserList();
|
getUserList();
|
||||||
|
@ -66,7 +66,7 @@ meta:
|
|||||||
import { ElButton, ElSpace, ElAvatar } from 'element-plus';
|
import { ElButton, ElSpace, ElAvatar } from 'element-plus';
|
||||||
import { BU_DOU_CONFIG } from '@/config';
|
import { BU_DOU_CONFIG } from '@/config';
|
||||||
// API 接口
|
// API 接口
|
||||||
import { userListGet } from '@/api/user';
|
import { userDisablelistGet } from '@/api/user';
|
||||||
/**
|
/**
|
||||||
* 表格
|
* 表格
|
||||||
*/
|
*/
|
||||||
@ -123,7 +123,7 @@ const column = reactive([
|
|||||||
width: 170
|
width: 170
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'last_online_time',
|
prop: 'closure_time',
|
||||||
label: '封禁日期',
|
label: '封禁日期',
|
||||||
width: 150
|
width: 150
|
||||||
},
|
},
|
||||||
@ -132,14 +132,13 @@ const column = reactive([
|
|||||||
label: '操作',
|
label: '操作',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
width: 180,
|
width: 120,
|
||||||
render: (scope: any) => {
|
render: (scope: any) => {
|
||||||
return (
|
return (
|
||||||
<ElSpace>
|
<ElSpace>
|
||||||
<ElButton type="primary" onClick={() => aa(scope.row)}>
|
<ElButton type="primary" onClick={() => aa(scope.row)}>
|
||||||
发消息
|
解禁
|
||||||
</ElButton>
|
</ElButton>
|
||||||
<ElButton>更多</ElButton>
|
|
||||||
</ElSpace>
|
</ElSpace>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -159,7 +158,7 @@ const queryFrom = reactive({
|
|||||||
|
|
||||||
const getUserList = () => {
|
const getUserList = () => {
|
||||||
loadTable.value = true;
|
loadTable.value = true;
|
||||||
userListGet(queryFrom).then((res: any) => {
|
userDisablelistGet(queryFrom).then((res: any) => {
|
||||||
loadTable.value = false;
|
loadTable.value = false;
|
||||||
tableData.value = res.list;
|
tableData.value = res.list;
|
||||||
total.value = res.count;
|
total.value = res.count;
|
||||||
|
12
src/types/global.d.ts
vendored
12
src/types/global.d.ts
vendored
@ -78,3 +78,15 @@ type ObjToKeyValUnion<T> = {
|
|||||||
type ObjToKeyValArray<T> = {
|
type ObjToKeyValArray<T> = {
|
||||||
[K in keyof T]: [K, T[K]];
|
[K in keyof T]: [K, T[K]];
|
||||||
}[keyof T];
|
}[keyof T];
|
||||||
|
declare namespace Column {
|
||||||
|
interface ColumnOptions {
|
||||||
|
prop: string;
|
||||||
|
label: string;
|
||||||
|
fixed?: string;
|
||||||
|
width?: number;
|
||||||
|
minWidth?: number;
|
||||||
|
align?: string;
|
||||||
|
formatter?: (scope: any) => void;
|
||||||
|
render?: (scope: any) => VNode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user