|
|
@@ -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) => {
|