|
@@ -42,6 +42,7 @@
|
|
|
id="piechart"
|
|
|
style="width: 100%; height: 100%"
|
|
|
class=""
|
|
|
+ :height="height + 'px'"
|
|
|
></canvas>
|
|
|
</div>
|
|
|
</el-col>
|
|
@@ -122,7 +123,7 @@
|
|
|
>
|
|
|
</el-date-picker>
|
|
|
</div>
|
|
|
- <div style="padding: 10px">
|
|
|
+ <div style="padding: 20px">
|
|
|
<el-table v-loading="loading" :data="userlist" style="width: 100%">
|
|
|
<el-table-column prop="depName" label="部门"> </el-table-column>
|
|
|
<el-table-column prop="name" label="账号"> </el-table-column>
|
|
@@ -174,6 +175,7 @@ export default {
|
|
|
options: [],
|
|
|
pageSize: 10,
|
|
|
usertotal: 0,
|
|
|
+ height: 0,
|
|
|
c: ["#FB6161", "#EC72DC", "#F98E53", "#49BED0", "#4BCA8B"],
|
|
|
};
|
|
|
},
|
|
@@ -194,6 +196,13 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
mounted() {
|
|
|
+ this.height = (this.$refs.main.offsetWidth / 24) * 6.9;
|
|
|
+ linechart && linechart.destroy();
|
|
|
+ barchart && barchart.destroy();
|
|
|
+ piechart && piechart.destroy();
|
|
|
+ linechart = null;
|
|
|
+ barchart = null;
|
|
|
+ piechart = null;
|
|
|
platformData(this.topic).then(r => {
|
|
|
let platform = {},
|
|
|
pli = [];
|
|
@@ -368,6 +377,7 @@ export default {
|
|
|
barchart = new F2.Chart({
|
|
|
id: "barChart",
|
|
|
pixelRatio: window.devicePixelRatio,
|
|
|
+ padding: [10, 50, 30, 110],
|
|
|
});
|
|
|
|
|
|
barchart.source(li, {
|
|
@@ -421,7 +431,6 @@ export default {
|
|
|
piechart = new F2.Chart({
|
|
|
id: "piechart",
|
|
|
pixelRatio: window.devicePixelRatio,
|
|
|
- height: (this.$refs.main.offsetWidth / 24) * 7.5,
|
|
|
});
|
|
|
let lis = [];
|
|
|
for (let i = 0; i < li.length; i++) {
|
|
@@ -479,6 +488,15 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
},
|
|
|
+ beforeDestroy() {
|
|
|
+ console.log("---");
|
|
|
+ linechart && linechart.destroy();
|
|
|
+ barchart && barchart.destroy();
|
|
|
+ piechart && piechart.destroy();
|
|
|
+ linechart = null;
|
|
|
+ barchart = null;
|
|
|
+ piechart = null;
|
|
|
+ },
|
|
|
components: {},
|
|
|
};
|
|
|
</script>
|