fix:营养分析复购商品bug
This commit is contained in:
1 parent
5d5e1606a4
commit
f722106984
2 files changed
+22
-10
No files matched your search
@@ -25,14 +25,14 @@ onMounted(() => {
|
||||
chartInstance.setOption(options);
|
||||
window.addEventListener("resize", resizeHandler);
|
||||
chartInstance.on("click", (params) => {
|
||||
if (!params.name) return;
|
||||
const _params = {
|
||||
swingTimeList: [dayjs().startOf("day").format("YYYY-MM-DD HH:mm:ss"), dayjs().endOf("day").format("YYYY-MM-DD HH:mm:ss")],
|
||||
personName: params.name,
|
||||
isMainFloor: "1",
|
||||
};
|
||||
console.log(`|点击跳转|-|今日出入机关楼次数排行|-|${params.name}|params:|{${JSON.stringify(_params)}}|`);
|
||||
jumpAdminPath("door_record", _params);
|
||||
// if (!params.name) return;
|
||||
// const _params = {
|
||||
// swingTimeList: [dayjs().startOf("day").format("YYYY-MM-DD HH:mm:ss"), dayjs().endOf("day").format("YYYY-MM-DD HH:mm:ss")],
|
||||
// personName: params.name,
|
||||
// isMainFloor: "1",
|
||||
// };
|
||||
// console.log(`|点击跳转|-|今日出入机关楼次数排行|-|${params.name}|params:|{${JSON.stringify(_params)}}|`);
|
||||
// jumpAdminPath("door_record", _params);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
+14
-2
@@ -15,7 +15,7 @@
|
||||
</AsideBlock>
|
||||
<AsideBlock>
|
||||
<template #header>
|
||||
<span>今日菜品喜好排行(top5)</span>
|
||||
<span>今日菜品复购排行(top5)</span>
|
||||
</template>
|
||||
<PersonThroughRank :data="timerObj.repurchase.data" />
|
||||
</AsideBlock>
|
||||
@@ -162,7 +162,19 @@ const getRepurchase = () => {
|
||||
if (code != 0) throw new Error("code!=0");
|
||||
console.log("复购排行榜:", data);
|
||||
if (!data) return;
|
||||
timerObj.repurchase.data = data
|
||||
timerObj.repurchase.data = {
|
||||
labels: data
|
||||
?.map((v) => {
|
||||
return v.productName;
|
||||
})
|
||||
.reverse() ?? [],
|
||||
values: data
|
||||
?.map((v) => {
|
||||
return v.buyProductCount;
|
||||
})
|
||||
.reverse() ?? [],
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error("|复购排行榜|意外的错误:", error);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user