|
@@ -134,10 +134,8 @@ export default {
|
|
|
return false;
|
|
|
}
|
|
|
},
|
|
|
- getData() {
|
|
|
- const vm = this;
|
|
|
- this.isLoading = true;
|
|
|
- this.$http.get('http://www.googo.org:8050/api/get_2020_marketing_cal').then(res => {
|
|
|
+ getcalData() {
|
|
|
+ this.$http.get('http://www.googo.org:8050/api/get_2020_marketing_cal').then(res => {
|
|
|
console.log(res.data);
|
|
|
this.json = res.data;
|
|
|
this.json.splice(34);
|
|
@@ -157,41 +155,25 @@ export default {
|
|
|
})
|
|
|
console.log(this.json[2]);
|
|
|
});
|
|
|
+ },
|
|
|
+ getData() {
|
|
|
+ const vm = this;
|
|
|
+ this.isLoading = true;
|
|
|
this.$http.get('http://www.googo.org:8050/api/group_datas/').then(res => {
|
|
|
- this.group_datas = res.data;
|
|
|
- //console.log(this.group_datas);
|
|
|
- // this.trends = this.json.filter(item => item['data_type'] === 'trends');
|
|
|
- //this.keywords = this.json.filter(item => item['data_type'] === 'suggests');
|
|
|
-
|
|
|
- });
|
|
|
- this.$http.get('http://www.googo.org:8050/api/user_groups/').then(res => {
|
|
|
+ this.group_datas = res.data;
|
|
|
+ vm.$http.get('http://www.googo.org:8050/api/user_groups/').then(res => {
|
|
|
//console.log(res.data);
|
|
|
- this.user_groups = res.data;
|
|
|
- this.user_groups.forEach(item => {
|
|
|
- this.group_datas.forEach(d => {
|
|
|
+ vm.user_groups = res.data;
|
|
|
+ vm.user_groups.forEach(item => {
|
|
|
+ vm.group_datas.forEach(d => {
|
|
|
if(d.group_id === item.id) {
|
|
|
d.group_chinese_name = item.group_chinese_name;
|
|
|
}
|
|
|
})
|
|
|
});
|
|
|
- /* this.trends = this.group_datas.filter(item => item['data_type'] === 'trends');
|
|
|
- this.keywords = this.group_datas.filter(item => item['data_type'] === 'suggests');
|
|
|
- this.trends.forEach(item => {
|
|
|
- item.times = this.GetObjVal(item.data.data);
|
|
|
- let newD = [];
|
|
|
- item.times.forEach((k, i) => {
|
|
|
- if(i%3===0){
|
|
|
- newD.push([]);
|
|
|
- }
|
|
|
- const page = parseInt(i/3);
|
|
|
- newD[page].push({times:k});
|
|
|
- console.log(newD);
|
|
|
- item.final = newD;
|
|
|
- });
|
|
|
- }); */
|
|
|
- this.user_groups.forEach(item => {
|
|
|
+ vm.user_groups.forEach(item => {
|
|
|
let arr = [];
|
|
|
- this.group_datas.forEach(d => {
|
|
|
+ vm.group_datas.forEach(d => {
|
|
|
if(d.group_id == item.id) {
|
|
|
if(d['data_type'] == 'suggests') {
|
|
|
arr.push({start: d.start, end: d.end, words: d.data.data});
|
|
@@ -203,8 +185,9 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
+ arr.reverse();
|
|
|
});
|
|
|
- this.user_groups.forEach(item => {
|
|
|
+ vm.user_groups.forEach(item => {
|
|
|
if(item.trends) {
|
|
|
const temp = this.GetObjVal(item.trends);
|
|
|
let newD = [];
|
|
@@ -228,6 +211,7 @@ export default {
|
|
|
console.log(this.user_groups);
|
|
|
this.isLoading = false;
|
|
|
})
|
|
|
+ });
|
|
|
},
|
|
|
mergeData() {
|
|
|
this.user_groups.forEach(item => {
|
|
@@ -282,7 +266,7 @@ export default {
|
|
|
this.selected = 3;
|
|
|
};
|
|
|
this.getData();
|
|
|
- //this.getPack();
|
|
|
+ this.getcalData();
|
|
|
},
|
|
|
};
|
|
|
</script>
|