Browse Source

延迟渲染图表

V1.0
mk 2 years ago
parent
commit
376abc64e0
  1. 4
      src/views/modules/satisfaction/communitySelfInsp/index.vue
  2. 11
      src/views/modules/satisfaction/satisfactionProvince/index.vue

4
src/views/modules/satisfaction/communitySelfInsp/index.vue

@ -295,7 +295,9 @@ export default {
this.myChart.on("click", function (params) {
than.handelClickChart(params.name,params.seriesName);
});
window.addEventListener("resize", this.handleWindowResize);
this.$nextTick(()=>{
window.addEventListener("resize", this.handleWindowResize);
})
},
handleWindowResize() {
if (this.myChart) {

11
src/views/modules/satisfaction/satisfactionProvince/index.vue

@ -344,12 +344,11 @@ export default {
this.formData.periodStart = util.formatDate(date, "yyyy-MM");
this.user = this.$store.state.user;
},
async mounted() {
this.agencyId = this.user.agencyId;
if (this.user.level != "street") {
this.$nextTick(()=>{
this.initEcharts();
}
})
await this.getDicts();
await this.getTableData();
},
@ -378,14 +377,16 @@ export default {
},
// ------------------------------------------------------------------------------
initEcharts() {
if(this.user.level == 'street') return
this.myChart = echarts.init(document.getElementById("myCharts"));
this.myChart.setOption(this.option);
let than = this;
this.myChart.on("click", function (params) {
than.handelClickChart(params.name);
});
this.$nextTick(()=>{
window.addEventListener("resize", this.handleWindowResize);
})
},
handleWindowResize() {
if (this.myChart) {
@ -462,7 +463,7 @@ export default {
} else {
const { statistics, code, msg, tableList } = await requestPost(
`/governance/provinceEvaluationRecord/staticStreetPeopleNum`,
{ ...this.formData }
{ ...this.formData,pageSize:this.pageSize,pageNo:this.pageNo }
);
if (code == 0) {
statistics.forEach((item) => {

Loading…
Cancel
Save