Browse Source

实时总览接口拆分

newStyle
风继续吹 1 year ago
parent
commit
3758ccbaa6
2 changed files with 72 additions and 20 deletions
  1. +21
    -0
      src/api/modules/http.js
  2. +51
    -20
      src/page/bi/bi.vue

+ 21
- 0
src/api/modules/http.js View File

@@ -1358,6 +1358,27 @@ export function biDataOverview(data) {
})
}

// 用户总览右侧菜单
export function biDataOverviewDistribute(data) {
return request({
url: 'autoSR/biData/dataOverviewDistribute',
method: 'post',
data
})
}

// 用户总览左侧菜单饼图
export function biDataOverviewTendency(data) {
return request({
url: 'autoSR/biData/dataOverviewTendency',
method: 'post',
data
})
}




// 获取公司接口
export function biGetOrgCodeList(params) {
return request({


+ 51
- 20
src/page/bi/bi.vue View File

@@ -507,6 +507,8 @@ export default {
// 实时总览
initPageRealTimeOverview() {
this.biDataOverview();
this.biDataOverviewTendency();
this.biDataOverviewDistribute();
},

// 案场排名
@@ -572,20 +574,20 @@ export default {
console.log(e);
}
} else {
avgList.push({
yAxis: object.allAvg,
name: "行业平均",
});
try {
if (
object.data[this.orderBy == 1 ? 0 : object.data.length - 1]
.value < object.allAvg
) {
yAxis.max = object.allAvg;
}
} catch (e) {
console.log(e);
}
// avgList.push({
// yAxis: object.allAvg,
// name: "行业平均",
// });
// try {
// if (
// object.data[this.orderBy == 1 ? 0 : object.data.length - 1]
// .value < object.allAvg
// ) {
// yAxis.max = object.allAvg;
// }
// } catch (e) {
// console.log(e);
// }
}
if (ob.unit == "%") {
yAxis = {
@@ -723,7 +725,42 @@ export default {
// 销讲趋势
item.data = res.data.statisticData[item.params] || 0;
});
}
});
},

// 用户总览右侧菜单
biDataOverviewDistribute() {
const params = {
dateType: this.dateSelectIndex,
orgCode: this.companyValue,
startDate: this.time[0] || "",
endDate: this.time[1] || "",
};
this.$api.http.biDataOverviewDistribute(params).then((res) => {
if (res.code == 10000) {
//右侧菜单数据填充
this.rsideDataList.forEach((item) => {
this[item.params] = res.data[item.params] || [];
});

this.$nextTick(() => {
this.formatterPie();
});
}
});
},

// 用户总览左侧菜单饼图
biDataOverviewTendency() {
const params = {
dateType: this.dateSelectIndex,
orgCode: this.companyValue,
startDate: this.time[0] || "",
endDate: this.time[1] || "",
};
this.$api.http.biDataOverviewTendency(params).then((res) => {
if (res.code == 10000) {
this.allRecSaleList = res.data.tendencyData || []; // 趋势图

//左侧菜单数据填充
@@ -732,15 +769,9 @@ export default {
this[item.params1] = res.data[item.params1] || [];
});

//右侧菜单数据填充
this.rsideDataList.forEach((item) => {
this[item.params] = res.data[item.params] || [];
});

this.$nextTick(() => {
this.empityReceptionListSalesExecution();
this.formatLineData();
this.formatterPie();
this.formatterBar();
});
}


Loading…
Cancel
Save