xiaohaizhao 1 год назад
Родитель
Сommit
c5adffde71

+ 6 - 5
src/WebsiteManagement/dataStatistics/index.vue

@@ -30,6 +30,10 @@
       </div>
     </div>
 
+    <div class="card">
+      <rankingList />
+    </div>
+
     <div class="card">
       <cord-top title="留言分析" @returnWhere="getMessageAnalysis" />
       <div ref="messageAnalysis" style="margin-top: 20px"></div>
@@ -45,10 +49,11 @@
 <script>
 import cordTop from "./modules/header.vue";
 import visitorStatistics from "./modules/visitorStatistics";
+import rankingList from "./modules/rankingList";
 import { Line, Column, Pie } from "@antv/g2plot";
 
 export default {
-  components: { visitorStatistics, cordTop },
+  components: { visitorStatistics, cordTop, rankingList },
   data() {
     return {
       userTypeAnalysis: null, //用户类型分析
@@ -91,7 +96,6 @@ export default {
           content,
         })
         .then((res) => {
-          console.log("获取各模块点击量分析", res);
           if (res.code != 1) return;
           let list = res.data;
           this.moduleClicksAnalysisTable = list;
@@ -188,7 +192,6 @@ export default {
           content,
         })
         .then((res) => {
-          console.log("获取用户类型分析", res);
           if (res.code != 1) return;
           let type = [
             this.$t("时间段内登陆用户"),
@@ -256,7 +259,6 @@ export default {
           content,
         })
         .then((res) => {
-          console.log("获取留言分析", res);
           if (res.code != 1) return;
           let type = this.$t("留言量分析");
           let list = res.data.map((v) => {
@@ -309,7 +311,6 @@ export default {
           content,
         })
         .then((res) => {
-          console.log("获取申请量分析", res);
           if (res.code != 1) return;
           let type = this.$t("申请量分析");
           let list = res.data.map((v) => {

+ 53 - 0
src/WebsiteManagement/dataStatistics/modules/rankingList.vue

@@ -0,0 +1,53 @@
+<template>
+  <div>
+    <cord-top title="访问量top10" @returnWhere="getVisits" />
+  </div>
+</template>
+
+<script>
+import cordTop from "./header.vue";
+
+export default {
+  components: {
+    cordTop,
+  },
+  data() {
+    return {
+      siteid: "", //站点id
+    };
+  },
+  created() {
+    this.siteid = JSON.parse(sessionStorage.getItem("active_account")).siteid;
+    this.getVisits();
+  },
+  methods: {
+    // 获取访问量top10
+    getVisits(detail) {
+      let content = {
+        siteid: this.siteid,
+        type: "近七日",
+      };
+      if (detail) {
+        if (detail.type) {
+          content.type = detail.type;
+        } else {
+          content.type = "";
+          content.where = detail;
+        }
+      }
+      this.$api
+        .requested({
+          id: 2025010310134203,
+          content,
+        })
+        .then((res) => {
+          console.log("获取访问量top10", res);
+          if (res.code != 1) return;
+        });
+    },
+  },
+};
+</script>
+
+<style scoped>
+</style>