|
|
@@ -11,6 +11,11 @@ import {
|
|
|
import { PieChart } from "echarts/charts";
|
|
|
import { LabelLayout } from "echarts/features";
|
|
|
import { CanvasRenderer } from "echarts/renderers";
|
|
|
+import {
|
|
|
+ getHotExhibition,
|
|
|
+ getHotGoods,
|
|
|
+ getHotModule,
|
|
|
+} from "@/store/action/A1Hot";
|
|
|
|
|
|
echarts.use([
|
|
|
ToolboxComponent,
|
|
|
@@ -103,26 +108,32 @@ function Hot() {
|
|
|
);
|
|
|
|
|
|
// 时间改变的时候 获取3个数据
|
|
|
- const getInfoAPIFu1 = useCallback(() => {
|
|
|
- console.log("1获取饼图数据", select1Ref.current);
|
|
|
-
|
|
|
- const data1 = [
|
|
|
- { value: 124, name: "新闻资讯", icon: "circle" },
|
|
|
- { value: 100, name: "虚拟漫游", icon: "circle" },
|
|
|
- { value: 200, name: "馆藏鉴赏", icon: "circle" },
|
|
|
- { value: 80, name: "场馆导览", icon: "circle" },
|
|
|
- { value: 70, name: "周边查询", icon: "circle" },
|
|
|
- { value: 155, name: "游客服务", icon: "circle" },
|
|
|
- ];
|
|
|
+ const getInfoAPIFu1 = useCallback(async () => {
|
|
|
+ const res1 = await getHotModule(select1Ref.current);
|
|
|
+ const data1 = res1.data.map((v: any) => {
|
|
|
+ return {
|
|
|
+ value: v.pcs,
|
|
|
+ name: v.groupKey,
|
|
|
+ icon: "circle",
|
|
|
+ };
|
|
|
+ });
|
|
|
+ // console.log("1获取饼图数据", select1Ref.current);
|
|
|
getEchartsFu(data1);
|
|
|
|
|
|
// -------------
|
|
|
- console.log(
|
|
|
- "2获取场馆数据",
|
|
|
+ // console.log(
|
|
|
+ // "2获取场馆数据",
|
|
|
+ // select1Ref.current,
|
|
|
+ // select2Ref.current ? select2Ref.current : "visit"
|
|
|
+ // );
|
|
|
+
|
|
|
+ const res2 = await getHotExhibition(
|
|
|
select1Ref.current,
|
|
|
select2Ref.current ? select2Ref.current : "visit"
|
|
|
);
|
|
|
|
|
|
+ console.log(res2);
|
|
|
+
|
|
|
const data2 = [
|
|
|
{ id: 1, name: "撒大苏打撒旦", num: 550 },
|
|
|
{
|
|
|
@@ -141,11 +152,19 @@ function Hot() {
|
|
|
|
|
|
// ---------------
|
|
|
|
|
|
- console.log(
|
|
|
- "3获取馆藏数据",
|
|
|
+ // console.log(
|
|
|
+ // "3获取馆藏数据",
|
|
|
+ // select1Ref.current,
|
|
|
+ // select3Ref.current ? select3Ref.current : "visit"
|
|
|
+ // );
|
|
|
+
|
|
|
+ const res3 = await getHotGoods(
|
|
|
select1Ref.current,
|
|
|
- select3Ref.current ? select3Ref.current : "visit"
|
|
|
+ select2Ref.current ? select2Ref.current : "visit"
|
|
|
);
|
|
|
+
|
|
|
+ console.log(res3);
|
|
|
+
|
|
|
const data3 = [
|
|
|
{ id: 1, name: "撒大苏打撒旦", num: 550 },
|
|
|
{
|