1.数据如下,提取name和callcount

Vue如何循环提取对象数组中的值

2代码.

getQueryCallStatistics("sesp1", this.provinceId).then((res) => {
    let arr = [];
    let arr1 = [];
    let arr2 = [];
    let arr3 = [];
    let arr4 = [];
    this.xunshiMap = res.data.callstatistics;
    res.data.callstatistics.forEach((element) => {
     // arr.push([
     //  element.name,
     //  element.callcount.patrol,
     //  element.callcount.repair,
     //  element.callcount.defect
     // ]);
     arr.push([element.name, 27, 38, 27]);
     arr1.push(element.name);

     arr2.push({ value: element.callcount.defect, name: element.name,type: element.name });
     arr3.push({ value: element.callcount.patrol, name: element.name,type: element.name });
     arr4.push({ value: element.callcount.repair, name: element.name,type: element.name });
     // arr2.push({ value: 27, name: element.name });
     // arr3.push({ value: 27, name: element.name });
     // arr4.push({ value: 38, name: element.name });
    });
    this.xunshiMap = arr;
    this.xunshiPer = arr1;
    this.xunshiPer1 = arr2;
    this.qxArr = arr4;
    this.xqArr = arr2;
    this.xsArr = arr3;
    setTimeout(this.renderEachCity, 0);
    this.echartCity();
   });

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。

广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!