浏览代码

图标判断是否开启滚动条

xiaohaizhao 11 月之前
父节点
当前提交
266f4d0f1b

+ 13 - 1
src/WebsiteManagement/dataStatistics/index.vue

@@ -80,6 +80,7 @@ export default {
     getModuleClicksAnalysis(detail) {
       let content = {
         siteid: this.siteid,
+        nocache: true,
         type: "近七日",
       };
       if (detail) {
@@ -101,7 +102,6 @@ export default {
             v.module = this.$t(v.module);
             return v;
           });
-          console.log("list",list)
           this.moduleClicksAnalysisTable = list;
           if (detail) {
             this.moduleClicksAnalysis.changeData(list);
@@ -179,6 +179,7 @@ export default {
     // 获取用户类型分析
     getUserTypeAnalysis(detail) {
       let content = {
+        nocache: true,
         siteid: this.siteid,
         type: "近七日",
       };
@@ -215,6 +216,9 @@ export default {
             });
           });
           if (detail) {
+            this.userTypeAnalysis.update({
+              scrollbar: list.length > 28 ? { type: "horizontal" } : null,
+            });
             this.userTypeAnalysis.changeData(list);
           } else {
             this.userTypeAnalysis = new Column(this.$refs.userTypeAnalysis, {
@@ -246,6 +250,7 @@ export default {
     // 获取留言分析
     getMessageAnalysis(detail) {
       let content = {
+        nocache: true,
         siteid: this.siteid,
         type: "近七日",
       };
@@ -270,6 +275,9 @@ export default {
             return v;
           });
           if (detail) {
+            this.messageAnalysis.update({
+              scrollbar: list.length > 14 ? { type: "horizontal" } : null,
+            });
             this.messageAnalysis.changeData(list);
           } else {
             this.messageAnalysis = new Line(this.$refs.messageAnalysis, {
@@ -298,6 +306,7 @@ export default {
     // 获取服务申请分析
     getServiceRequestAnalysis(detail) {
       let content = {
+        nocache: true,
         siteid: this.siteid,
         type: "近七日",
       };
@@ -322,6 +331,9 @@ export default {
             return v;
           });
           if (detail) {
+            this.serviceRequestAnalysis.update({
+              scrollbar: list.length > 14 ? { type: "horizontal" } : null,
+            });
             this.serviceRequestAnalysis.changeData(list);
           } else {
             this.serviceRequestAnalysis = new Line(

+ 1 - 1
src/WebsiteManagement/dataStatistics/modules/rankingList.vue

@@ -55,6 +55,7 @@ export default {
     // 获取访问量top10
     getVisits(detail) {
       let content = {
+        nocache: true,
         siteid: this.siteid,
         type: "近七日",
       };
@@ -72,7 +73,6 @@ export default {
           content,
         })
         .then((res) => {
-          console.log("获取访问量top10", res);
           if (res.code != 1) return;
           let list = [];
           res.data.forEach((item) => {

+ 19 - 11
src/WebsiteManagement/dataStatistics/modules/visitorStatistics.vue

@@ -143,11 +143,19 @@
 
     <div class="cards" style="margin-top: 20px">
       <div class="card">
-        <cord-top title="访客趋势分析" size="mini" @returnWhere="getVisitorTrend" />
+        <cord-top
+          title="访客趋势分析"
+          size="mini"
+          @returnWhere="getVisitorTrend"
+        />
         <div ref="visitorTrend" style="margin-top: 20px"></div>
       </div>
       <div class="card">
-        <cord-top title="访问量趋势分析" size="mini" @returnWhere="getPageViewTrend" />
+        <cord-top
+          title="访问量趋势分析"
+          size="mini"
+          @returnWhere="getPageViewTrend"
+        />
         <div ref="pageViewTrend" style="margin-top: 20px"></div>
       </div>
     </div>
@@ -184,11 +192,11 @@ export default {
           id: 2025010214243003,
           content: {
             siteid: this.siteid,
+            nocache: true,
             type,
           },
         })
         .then((res) => {
-          console.log("获取" + type, res);
           if (res.code != 1) return;
           if (type == "访客") {
             this.visitor = res.data;
@@ -200,6 +208,7 @@ export default {
     // 获取访客趋势
     getVisitorTrend(detail) {
       let content = {
+        nocache: true,
         siteid: this.siteid,
         type: "近七日",
         datatype: "访客",
@@ -218,7 +227,6 @@ export default {
           content,
         })
         .then((res) => {
-          console.log("获取访客趋势", res);
           if (res.code != 1) return;
           let type = "UV" + this.$t("访客数量");
           let list = res.data.map((v) => {
@@ -226,15 +234,15 @@ export default {
             return v;
           });
           if (detail) {
+            this.visitorTrend.update({
+              scrollbar: list.length > 7 ? { type: "horizontal" } : null,
+            });
             this.visitorTrend.changeData(list);
           } else {
             this.visitorTrend = new Line(this.$refs.visitorTrend, {
               height: 300,
               data: list,
               xField: "date",
-              scrollbar: {
-                type: "horizontal",
-              },
               seriesField: "type",
               yField: "count",
               color: "#5588F7",
@@ -257,6 +265,7 @@ export default {
     // 获取访问量趋势
     getPageViewTrend(detail) {
       let content = {
+        nocache: true,
         siteid: this.siteid,
         type: "近七日",
         datatype: "访问量",
@@ -275,7 +284,6 @@ export default {
           content,
         })
         .then((res) => {
-          console.log("获取访问量趋势", res);
           if (res.code != 1) return;
           let type = this.$t("重复访客数量");
           let list = res.data.map((v) => {
@@ -283,6 +291,9 @@ export default {
             return v;
           });
           if (detail) {
+            this.pageViewTrend.update({
+              scrollbar: list.length > 7 ? { type: "horizontal" } : null,
+            });
             this.pageViewTrend.changeData(list);
           } else {
             this.pageViewTrend = new Line(this.$refs.pageViewTrend, {
@@ -291,9 +302,6 @@ export default {
               xField: "date",
               yField: "count",
               color: "#F29C37",
-              scrollbar: {
-                type: "horizontal",
-              },
               seriesField: "type",
               tooltip: {
                 formatter: (datum) => {