Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xaoyaoo committed Aug 6, 2024
1 parent 83e9403 commit 622e1ee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
13 changes: 9 additions & 4 deletions src/components/stats/ChatEChartsIndex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const colors = [
const bg_color = ref("");
const chart_option = ref({
backgroundColor: bg_color.value,
tooltip: {
trigger: 'axis',
position: function (pt: any) {
Expand Down Expand Up @@ -77,7 +78,7 @@ const chart_option = ref({
},
xAxis: {
type: 'category', // x 轴类型为分类
boundaryGap: ["5%", '5%'], // x 轴两端不留空白间隙
boundaryGap: false, // x 轴两端不留空白间隙
data: <any>[], // x 轴的数据,这里使用了 TypeScript 的泛型表示尚未填充数据
},
yAxis: {
Expand Down Expand Up @@ -120,6 +121,7 @@ const update_chart_option = () => {
chart_option.value.series[1].areaStyle.color = colors[1].areaStyle;
chart_option.value.series[2].itemStyle.color = colors[2].color;
chart_option.value.series[2].areaStyle.color = colors[2].areaStyle;
chart_option.value.backgroundColor = bg_color.value;
}
const get_date_count_data = async () => {
Expand Down Expand Up @@ -223,7 +225,7 @@ const set_top_user = async (wxid: string) => {
&nbsp;
<strong>颜色设置:</strong>
bg:
<color-select @updateColors="(val:any)=>{bg_color=val}"></color-select>
<color-select @updateColors="(val:any)=>{val?bg_color=val:'';refreshChart(false)}"></color-select>
c1:
<color-select @updateColors="(val:any)=>{val?colors[0].color=val:'';refreshChart(false)}"></color-select>
c2:
Expand All @@ -240,12 +242,15 @@ const set_top_user = async (wxid: string) => {
</el-header>

<el-main style="height: calc(100% - 100px);width: 100%;">
<div id="charts_main" :style="'width: 100%;height: calc(100% - 100px);background-color:'+bg_color "></div>
<div id="charts_main"></div>
</el-main>
</el-container>
</div>
</template>

<style scoped>
#charts_main {
width: 100%;
height: 100%;
}
</style>
6 changes: 3 additions & 3 deletions src/views/StatisticsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import ChatEChartsIndex from "@/components/stats/ChatEChartsIndex.vue";
import {ref} from "vue";
const mene_selected = ref("");
const mene_selected = ref("date_chat_count");
const MeneSelect = (val: string) => {
mene_selected.value = val;
}
Expand All @@ -20,7 +20,7 @@ const MeneSelect = (val: string) => {
<el-container style="height: calc(100vh);width: 100%;">
<el-aside width="120px" style="height: 100%;">
<el-menu style="height: 100%;background-color: #F7F7F7;color:#262626;"
default-active="2"
default-active="date_chat_count"
class="el-menu-vertical-demo"
@select="MeneSelect"
>
Expand All @@ -31,7 +31,7 @@ const MeneSelect = (val: string) => {
</el-aside>

<el-main style="height: 100%;width: 100%;margin: 0;padding: 0;">
<ChatEChartsIndex/>
<ChatEChartsIndex v-if="mene_selected=='date_chat_count'"/>
</el-main>
</el-container>
</div>
Expand Down

0 comments on commit 622e1ee

Please sign in to comment.