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
@ -52,16 +51,13 @@ export const unban = (data: GroupUnbanDTO) => {
});
};
export const findGroupByName = (name?: String): AxiosPromise<GroupVO[]> => {
return request({
url: '/im/group/findByName?name='+name,
url: '/im/group/findByName?name=' + name,
method: 'get'
});
};
/**
*
*/
@ -71,4 +67,3 @@ export const getTotalGroupCount = (): AxiosPromise<number> => {
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-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:group']" link type="primary" @click="handleGroup(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:editGroupAndLabel']" link type="primary" @click="handleGroup(scope.row)">设置分组</el-button>
</template>
</el-table-column>
</el-table>
@ -352,7 +352,7 @@ const confirmLabel = async () => {
}
const labelIdsStr = selectedLabelIds.value.join(',');
const payload = ids.value.map(id => ({
const payload = ids.value.map((id) => ({
id: id,
labelIds: labelIdsStr
}));
@ -366,10 +366,12 @@ const confirmLabel = async () => {
return;
}
const payload = [{
const payload = [
{
id: editingUser.value.id,
labelIds: selectedLabelIds.value.join(',')
}];
}
];
// UI
editingUser.value.labelIds = payload[0].labelIds;
@ -411,7 +413,7 @@ const confirmGroup = async () => {
}
const groupIdsStr = selectedGroupIds.value.join(',');
const payload = ids.value.map(id => ({
const payload = ids.value.map((id) => ({
id: id,
groupIds: groupIdsStr
}));
@ -425,10 +427,12 @@ const confirmGroup = async () => {
return;
}
const payload = [{
const payload = [
{
id: editingUser.value.id,
groupIds: selectedGroupIds.value.join(',')
}];
}
];
// UI
editingUser.value.groupIds = payload[0].groupIds;

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

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

Loading…
Cancel
Save