|
@@ -154,24 +154,47 @@ export default {
|
|
|
params.append("states", "2,3");
|
|
|
params.append("pageSize", 999);
|
|
|
params.append("page", 0);
|
|
|
- let sortparam = [{ field: "c_years", orderByType: 1 }];
|
|
|
- params.append("orderBy", JSON.stringify(sortparam));
|
|
|
+ let sortparam = [{ field: "c_years", orderByType: 1 }];
|
|
|
+ params.append("orderBy", JSON.stringify(sortparam));
|
|
|
this.$Post(this.urlsCollection.selectContentList, params).then(
|
|
|
res => {
|
|
|
if (res.code === 200 && res.content.data.length > 0) {
|
|
|
- let listMap = {}
|
|
|
+ let listMap = {};
|
|
|
let tableData = res.content.data;
|
|
|
- tableData.forEach(item=>{
|
|
|
- if(listMap[item.street]){
|
|
|
- listMap[item.street]['categoryData'].push(item.c_years);
|
|
|
- listMap[item.street]['valueData'].push((item.c_float_num / 10000).toFixed(2));
|
|
|
- }else{
|
|
|
+ tableData.forEach(item => {
|
|
|
+ if (listMap[item.street]) {
|
|
|
+ listMap[item.street]["categoryData"].push(item.c_years);
|
|
|
+ listMap[item.street]["valueData"].push((item.c_float_num / 10000).toFixed(2));
|
|
|
+ } else {
|
|
|
let listMapItem = {};
|
|
|
- listMapItem['categoryData'] = [item.c_years];
|
|
|
- listMapItem['valueData'] = [(item.c_float_num / 10000).toFixed(2)];
|
|
|
+ listMapItem["categoryData"] = [item.c_years];
|
|
|
+ listMapItem["valueData"] = [(item.c_float_num / 10000).toFixed(2)];
|
|
|
listMap[item.street] = listMapItem;
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
+ // if (listMap) {
|
|
|
+ // let categoryData = [];
|
|
|
+ // for (let listMapKeys in listMap) {
|
|
|
+ // if (listMap[listMapKeys].categoryData) {
|
|
|
+ // categoryData = listMap[listMapKeys].categoryData;
|
|
|
+ // }
|
|
|
+ // if (listMap[listMapKeys].valueData) {
|
|
|
+ // if (!listMap["全部"]) {
|
|
|
+ // listMap["全部"] = { valueData: [], categoryData: [] };
|
|
|
+ // }
|
|
|
+ // listMap[listMapKeys].valueData.forEach((index, valueIndexItem) => {
|
|
|
+ // if (listMap["全部"].valueData[index]) {
|
|
|
+ // listMap["全部"].valueData[index] += valueIndexItem;
|
|
|
+ // } else {
|
|
|
+ // listMap["全部"].valueData[index] = valueIndexItem;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // if (!listMap["全部"].categoryData && categoryData) {
|
|
|
+ // listMap["全部"].categoryData = categoryData;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
this.resData = listMap;
|
|
|
} else {
|
|
|
this.resData = [];
|
|
@@ -236,7 +259,7 @@ export default {
|
|
|
if (this.resData[this.$store.state.homeSpecialTown]) {
|
|
|
this.menuData.topSolt.commonData[0].categoryData = this.resData[this.$store.state.homeSpecialTown].categoryData;
|
|
|
this.menuData.topSolt.commonData[0].valueData = this.resData[this.$store.state.homeSpecialTown].valueData;
|
|
|
- console.log(this.menuData,this.resData,this.$store.state.homeSpecialTown)
|
|
|
+ console.log(this.menuData, this.resData, this.$store.state.homeSpecialTown);
|
|
|
}
|
|
|
},
|
|
|
// 当用户使用光标切换交互组件时触发
|