Browse Source

标签/用户/首页页面更新,权限更正

master
La123123 1 month ago
parent
commit
c5b441483d
  1. 7
      im-admin-ui/src/api/im/group/index.ts
  2. 20
      im-admin-ui/src/views/im/user/index.vue
  3. 88
      im-admin-ui/src/views/index.vue

7
im-admin-ui/src/api/im/group/index.ts

@ -39,7 +39,6 @@ export const ban = (data: GroupBanDTO) => {
}); });
}; };
/** /**
* *
* @param data * @param data
@ -52,16 +51,13 @@ export const unban = (data: GroupUnbanDTO) => {
}); });
}; };
export const findGroupByName = (name?: String): AxiosPromise<GroupVO[]> => { export const findGroupByName = (name?: String): AxiosPromise<GroupVO[]> => {
return request({ return request({
url: '/im/group/findByName?name='+name, url: '/im/group/findByName?name=' + name,
method: 'get' method: 'get'
}); });
}; };
/** /**
* *
*/ */
@ -71,4 +67,3 @@ export const getTotalGroupCount = (): AxiosPromise<number> => {
method: 'get' method: 'get'
}); });
}; };

20
im-admin-ui/src/views/im/user/index.vue

@ -106,8 +106,8 @@
<el-button v-if="scope.row.isBanned" v-hasPermi="['im:user:ban']" link type="danger" @click="unbanHandle(scope.row)">解封</el-button> <el-button v-if="scope.row.isBanned" v-hasPermi="['im:user:ban']" link type="danger" @click="unbanHandle(scope.row)">解封</el-button>
<el-button v-else v-hasPermi="['im:user:ban']" link type="danger" @click="banHandle(scope.row)">封禁</el-button> <el-button v-else v-hasPermi="['im:user:ban']" link type="danger" @click="banHandle(scope.row)">封禁</el-button>
--> -->
<el-button v-hasPermi="['im:user:label']" link type="primary" @click="handleLabel(scope.row)">设置标签</el-button> <el-button v-hasPermi="['im:user:editGroupAndLabel']" link type="primary" @click="handleLabel(scope.row)">设置标签</el-button>
<el-button v-hasPermi="['im:user:group']" link type="primary" @click="handleGroup(scope.row)">设置分组</el-button> <el-button v-hasPermi="['im:user:editGroupAndLabel']" link type="primary" @click="handleGroup(scope.row)">设置分组</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -352,7 +352,7 @@ const confirmLabel = async () => {
} }
const labelIdsStr = selectedLabelIds.value.join(','); const labelIdsStr = selectedLabelIds.value.join(',');
const payload = ids.value.map(id => ({ const payload = ids.value.map((id) => ({
id: id, id: id,
labelIds: labelIdsStr labelIds: labelIdsStr
})); }));
@ -366,10 +366,12 @@ const confirmLabel = async () => {
return; return;
} }
const payload = [{ const payload = [
{
id: editingUser.value.id, id: editingUser.value.id,
labelIds: selectedLabelIds.value.join(',') labelIds: selectedLabelIds.value.join(',')
}]; }
];
// UI // UI
editingUser.value.labelIds = payload[0].labelIds; editingUser.value.labelIds = payload[0].labelIds;
@ -411,7 +413,7 @@ const confirmGroup = async () => {
} }
const groupIdsStr = selectedGroupIds.value.join(','); const groupIdsStr = selectedGroupIds.value.join(',');
const payload = ids.value.map(id => ({ const payload = ids.value.map((id) => ({
id: id, id: id,
groupIds: groupIdsStr groupIds: groupIdsStr
})); }));
@ -425,10 +427,12 @@ const confirmGroup = async () => {
return; return;
} }
const payload = [{ const payload = [
{
id: editingUser.value.id, id: editingUser.value.id,
groupIds: selectedGroupIds.value.join(',') groupIds: selectedGroupIds.value.join(',')
}]; }
];
// UI // UI
editingUser.value.groupIds = payload[0].groupIds; editingUser.value.groupIds = payload[0].groupIds;

88
im-admin-ui/src/views/index.vue

@ -5,7 +5,7 @@
<el-col :span="6"> <el-col :span="6">
<el-card class="statistics-card"> <el-card class="statistics-card">
<div class="statistics-item"> <div class="statistics-item">
<div class="statistics-icon" style="background-color: #409EFF;"> <div class="statistics-icon" style="background-color: #409eff">
<el-icon size="24"> <el-icon size="24">
<User /> <User />
</el-icon> </el-icon>
@ -20,7 +20,7 @@
<el-col :span="6"> <el-col :span="6">
<el-card class="statistics-card"> <el-card class="statistics-card">
<div class="statistics-item"> <div class="statistics-item">
<div class="statistics-icon" style="background-color: #67C23A;"> <div class="statistics-icon" style="background-color: #67c23a">
<el-icon size="24"> <el-icon size="24">
<ChatDotRound /> <ChatDotRound />
</el-icon> </el-icon>
@ -35,7 +35,7 @@
<el-col :span="6"> <el-col :span="6">
<el-card class="statistics-card"> <el-card class="statistics-card">
<div class="statistics-item"> <div class="statistics-item">
<div class="statistics-icon" style="background-color: #E6A23C;"> <div class="statistics-icon" style="background-color: #e6a23c">
<el-icon size="24"> <el-icon size="24">
<Timer /> <Timer />
</el-icon> </el-icon>
@ -50,7 +50,7 @@
<el-col :span="6"> <el-col :span="6">
<el-card class="statistics-card"> <el-card class="statistics-card">
<div class="statistics-item"> <div class="statistics-item">
<div class="statistics-icon" style="background-color: #909399;"> <div class="statistics-icon" style="background-color: #909399">
<el-icon size="24"> <el-icon size="24">
<Clock /> <Clock />
</el-icon> </el-icon>
@ -67,34 +67,32 @@
<!-- 统计图表 --> <!-- 统计图表 -->
<div class="chart-section"> <div class="chart-section">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="24">
<el-card> <el-card>
<template #header> <template #header>
<span>用户注册</span> <span>用户注册</span>
<el-select v-model="registrationSelectedDays" @change="loadRegistrationChartData" <el-select v-model="registrationSelectedDays" @change="loadRegistrationChartData" style="width: 100px; float: right" size="small">
style="width: 100px; float: right;" size="small">
<el-option label="7天" :value="7"></el-option> <el-option label="7天" :value="7"></el-option>
<el-option label="15天" :value="15"></el-option> <el-option label="15天" :value="15"></el-option>
<el-option label="30天" :value="30"></el-option> <el-option label="30天" :value="30"></el-option>
</el-select> </el-select>
</template> </template>
<div ref="registrationChartContainer" style="width: 100%; height: 300px;"></div> <div ref="registrationChartContainer" style="width: 100%; height: 300px"></div>
</el-card> </el-card>
</el-col> </el-col>
<el-col :span="12"> <!-- <el-col :span="12">
<el-card> <el-card>
<template #header> <template #header>
<span>消息统计</span> <span>消息统计</span>
<el-select v-model="selectedDays" @change="loadChartData" style="width: 100px; float: right;" <el-select v-model="selectedDays" @change="loadChartData" style="width: 100px; float: right" size="small">
size="small">
<el-option label="7天" :value="7"></el-option> <el-option label="7天" :value="7"></el-option>
<el-option label="15天" :value="15"></el-option> <el-option label="15天" :value="15"></el-option>
<el-option label="30天" :value="30"></el-option> <el-option label="30天" :value="30"></el-option>
</el-select> </el-select>
</template> </template>
<div ref="chartContainer" style="width: 100%; height: 300px;"></div> <div ref="chartContainer" style="width: 100%; height: 300px"></div>
</el-card> </el-card>
</el-col> </el-col> -->
</el-row> </el-row>
</div> </div>
</div> </div>
@ -165,7 +163,6 @@ const loadActiveUserStats = async () => {
} }
}; };
// //
const loadChartData = async () => { const loadChartData = async () => {
try { try {
@ -217,11 +214,11 @@ const processChartData = (privateData: any[], groupData: any[]) => {
dates.push(dateStr); dates.push(dateStr);
// //
const privateDayData = privateData.find(item => item.date === dateStr); const privateDayData = privateData.find((item) => item.date === dateStr);
privateCounts.push(privateDayData ? parseInt(privateDayData.count) : 0); privateCounts.push(privateDayData ? parseInt(privateDayData.count) : 0);
// //
const groupDayData = groupData.find(item => item.date === dateStr); const groupDayData = groupData.find((item) => item.date === dateStr);
groupCounts.push(groupDayData ? parseInt(groupDayData.count) : 0); groupCounts.push(groupDayData ? parseInt(groupDayData.count) : 0);
} }
@ -243,9 +240,11 @@ const loadRegistrationChartData = async () => {
xAxis: { xAxis: {
data: chartData.dates data: chartData.dates
}, },
series: [{ series: [
{
data: chartData.counts data: chartData.counts
}] }
]
}); });
} }
} catch (error) { } catch (error) {
@ -267,7 +266,7 @@ const processRegistrationChartData = (data: any[]) => {
dates.push(dateStr); dates.push(dateStr);
// //
const dayData = data.find(item => item.date === dateStr); const dayData = data.find((item) => item.date === dateStr);
counts.push(dayData ? parseInt(dayData.count) : 0); counts.push(dayData ? parseInt(dayData.count) : 0);
} }
@ -328,11 +327,16 @@ const initChart = async () => {
y: 0, y: 0,
x2: 0, x2: 0,
y2: 1, y2: 1,
colorStops: [{ colorStops: [
offset: 0, color: 'rgba(64, 158, 255, 0.3)' {
}, { offset: 0,
offset: 1, color: 'rgba(64, 158, 255, 0.1)' color: 'rgba(64, 158, 255, 0.3)'
}] },
{
offset: 1,
color: 'rgba(64, 158, 255, 0.1)'
}
]
} }
} }
}, },
@ -351,11 +355,16 @@ const initChart = async () => {
y: 0, y: 0,
x2: 0, x2: 0,
y2: 1, y2: 1,
colorStops: [{ colorStops: [
offset: 0, color: 'rgba(103, 194, 58, 0.3)' {
}, { offset: 0,
offset: 1, color: 'rgba(103, 194, 58, 0.1)' color: 'rgba(103, 194, 58, 0.3)'
}] },
{
offset: 1,
color: 'rgba(103, 194, 58, 0.1)'
}
]
} }
} }
} }
@ -415,7 +424,8 @@ const initRegistrationChart = async () => {
type: 'value', type: 'value',
name: '注册用户数' name: '注册用户数'
}, },
series: [{ series: [
{
name: '注册用户', name: '注册用户',
type: 'line', type: 'line',
data: [], data: [],
@ -430,14 +440,20 @@ const initRegistrationChart = async () => {
y: 0, y: 0,
x2: 0, x2: 0,
y2: 1, y2: 1,
colorStops: [{ colorStops: [
offset: 0, color: 'rgba(230, 162, 60, 0.3)' {
}, { offset: 0,
offset: 1, color: 'rgba(230, 162, 60, 0.1)' color: 'rgba(230, 162, 60, 0.3)'
}] },
{
offset: 1,
color: 'rgba(230, 162, 60, 0.1)'
}
]
}
} }
} }
}], ],
grid: { grid: {
left: '3%', left: '3%',
right: '4%', right: '4%',

Loading…
Cancel
Save