调整趋势图功能,加入了查询数据库,分析群聊聊天数量的功能
This commit is contained in:
@@ -151,8 +151,8 @@
|
|||||||
<div v-else>
|
<div v-else>
|
||||||
<div class="chart-container">
|
<div class="chart-container">
|
||||||
<h3>消息数量趋势</h3>
|
<h3>消息数量趋势</h3>
|
||||||
<!-- 使用div作为容器,动态创建canvas -->
|
<!-- 使用唯一ID -->
|
||||||
<div ref="chartContainer" style="width: 100%; height: 300px;"></div>
|
<div :id="'chart-container-' + currentGroupId" style="width: 100%; height: 300px;"></div>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 20px; text-align: center;">
|
<div style="margin-top: 20px; text-align: center;">
|
||||||
<el-radio-group v-model="trendDays" @change="loadMessageTrend">
|
<el-radio-group v-model="trendDays" @change="loadMessageTrend">
|
||||||
@@ -455,14 +455,19 @@
|
|||||||
try {
|
try {
|
||||||
console.log('开始渲染图表');
|
console.log('开始渲染图表');
|
||||||
|
|
||||||
// 获取容器元素
|
// 使用唯一ID获取容器元素
|
||||||
const container = this.$refs.chartContainer;
|
const containerId = 'chart-container-' + this.currentGroupId;
|
||||||
|
console.log('尝试获取图表容器,ID:', containerId);
|
||||||
|
const container = document.getElementById(containerId);
|
||||||
|
|
||||||
if (!container) {
|
if (!container) {
|
||||||
console.error('找不到图表容器');
|
console.error('找不到图表容器,ID:', containerId);
|
||||||
this.$message.error('无法找到图表容器,请尝试重新打开对话框');
|
this.$message.error('无法找到图表容器,请尝试重新打开对话框');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('找到图表容器:', container);
|
||||||
|
|
||||||
// 清空容器
|
// 清空容器
|
||||||
container.innerHTML = '';
|
container.innerHTML = '';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user