|
@@ -75,7 +75,7 @@
|
|
|
</el-button>
|
|
|
</el-button-group>
|
|
|
</div>
|
|
|
- <canvas id="barChart" style="width: 100%; height: 70vw" class=""></canvas>
|
|
|
+ <canvas id="barChart" v-if="heightBar > 0" :height="heightBar" style="width: 100%" class=""></canvas>
|
|
|
</div>
|
|
|
|
|
|
<div class="card">
|
|
@@ -190,13 +190,14 @@ export default {
|
|
|
dep: "全部",
|
|
|
T: [],
|
|
|
userlist: [],
|
|
|
- type: "ALL",
|
|
|
+ type: localStorage.type || "ALL",
|
|
|
page: 1,
|
|
|
options: [],
|
|
|
pageSize: 10,
|
|
|
usertotal: 0,
|
|
|
height: 0,
|
|
|
c: ["#FB6161", "#EC72DC", "#F98E53", "#49BED0", "#4BCA8B"],
|
|
|
+ heightBar: 0
|
|
|
};
|
|
|
},
|
|
|
filters: {
|
|
@@ -339,11 +340,10 @@ export default {
|
|
|
title: this.topic,
|
|
|
}).then(r => {
|
|
|
let li = (r || []).reverse();
|
|
|
- if (!li || !li.length) {
|
|
|
- document.getElementById("barChart").style.display = "none";
|
|
|
- } else {
|
|
|
- document.getElementById("barChart").style.display = "block";
|
|
|
- }
|
|
|
+ console.log(li)
|
|
|
+ this.heightBar = li.length ? li.length * 35 + 40 : 0;
|
|
|
+ localStorage.type = this.type;
|
|
|
+ if(this.heightBar === 0) return
|
|
|
this.$nextTick(() => {
|
|
|
this.bar1(li);
|
|
|
});
|
|
@@ -416,6 +416,7 @@ export default {
|
|
|
id: "barChart",
|
|
|
pixelRatio: window.devicePixelRatio,
|
|
|
padding: [10, 50, 30, 140],
|
|
|
+ height: this.heightBar
|
|
|
});
|
|
|
|
|
|
barchart.source(li, {
|