|
@@ -447,20 +447,52 @@ export default {
|
|
|
this.data = [];
|
|
|
if (data.length) {
|
|
|
this.spinning = true;
|
|
|
+ const map = {};
|
|
|
for (let i = 0; i < this.GraphElement.length; i++) {
|
|
|
- const it = this.GraphElement[i];
|
|
|
+ const t = this.GraphElement[i];
|
|
|
for (let j = 0; j < data.length; j++) {
|
|
|
- if (
|
|
|
- it.InfoTypeId.indexOf(data[j].key) > -1 &&
|
|
|
- it.Type == data[j].type
|
|
|
- ) {
|
|
|
- data[j].age = it;
|
|
|
- data[j].name = it.Name;
|
|
|
- this.data.push(data[j]);
|
|
|
+ if(t.Type == data[j].type){
|
|
|
+ if (t.InfoTypeId.indexOf(data[j].key) > -1){
|
|
|
+ const obj = {
|
|
|
+ key: data[j].key,
|
|
|
+ name: t.Name,
|
|
|
+ age: t,
|
|
|
+ number: data[j].number,
|
|
|
+ type: data[j].type,
|
|
|
+ address: data[j].address,
|
|
|
+ id: t.Id
|
|
|
+ }
|
|
|
+ if (!map[t.Id]) {
|
|
|
+ map[t.Id] = obj
|
|
|
+ } else {
|
|
|
+ map[t.Id].number += obj.number
|
|
|
+ map[t.Id].key += obj.key
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ try {
|
|
|
+ for(const k in map) {
|
|
|
+ this.data.push(map[k])
|
|
|
+ }
|
|
|
+ } catch (err) {
|
|
|
+ console.log(err);
|
|
|
+ }
|
|
|
this.spinning = false;
|
|
|
+ // for (let j = 0; j < data.length; j++) {
|
|
|
+ // for (let i = 0; i < this.GraphElement.length; i++) {
|
|
|
+ // const it = this.GraphElement[i];
|
|
|
+ // if (
|
|
|
+ // it.InfoTypeId.indexOf(data[j].key) > -1 &&
|
|
|
+ // it.Type == data[j].type
|
|
|
+ // ) {
|
|
|
+ // data[j].age = it;
|
|
|
+ // data[j].name = it.Name;
|
|
|
+ // this.data.push(data[j]);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
}
|
|
|
});
|
|
|
},
|