diff --git a/src/componets/Performance/performanceBottom.vue b/src/componets/Performance/performanceBottom.vue
index c6a315a..52d0771 100644
--- a/src/componets/Performance/performanceBottom.vue
+++ b/src/componets/Performance/performanceBottom.vue
@@ -2,29 +2,29 @@
@@ -35,6 +35,7 @@ import titleComponent from '../HomePage/titleComponent.vue'
import fourGraph from '../HomePage/fourGraph.vue'
import ListComponent from './listComponent.vue'
import BarComponent from './barComponent.vue'
+import { getLoadArr, getMountArr } from '@/services/performance'
export default {
name: 'performanceBottom',
@@ -46,49 +47,8 @@ export default {
},
data() {
return {
- loadArr: [
- {
- id: 89,
- loadTime: 1427678475642,
- type: 'ullamco sed',
- kind: 'cillum veniam nulla in',
- },
- {
- id: 5,
- loadTime: 137549105933,
- type: 'ea',
- kind: 'consequat aute sed quis et',
- },
- {
- id: 13,
- loadTime: 57383004513,
- type: 'ut do',
- kind: 'nulla amet cillum',
- },
- ],
- mountArr: [
- {
- id: 97,
- componentName: '方话里极',
- mountTime: 1,
- type: 'ut adipisicing cupidatat',
- kind: 'labore veniam mollit id',
- },
- {
- id: 5,
- componentName: '自北断直上',
- mountTime: 74,
- type: 'esse',
- kind: 'velit',
- },
- {
- id: 16,
- componentName: '红少影适界思',
- mountTime: 9364,
- type: 'sed exercitation',
- kind: 'deserunt tempor',
- },
- ],
+ loadArr: [],
+ mountArr: [],
best: 0,
good: 0,
bad: 0,
@@ -97,22 +57,41 @@ export default {
}
},
mounted() {
- this.loadArr.forEach((item) => {
- if (item.loadTime < 1) {
- this.best++
- } else if (item.loadTime < 3) {
- console.log(item.loadTime)
- this.good++
- } else if (item.loadTime < 5) {
- this.bad++
- } else {
- this.badest++
+ this.getLoadArr()
+ this.getMountArr()
+ },
+ methods: {
+ async getLoadArr() {
+ const res = await getLoadArr()
+ this.loadArr = res.data.result
+ this.loadArr.forEach((item) => {
+ if (item.loadTime < 1000) {
+ this.best++
+ } else if (item.loadTime < 3000) {
+ console.log(item.loadTime)
+ this.good++
+ } else if (item.loadTime < 5000) {
+ this.bad++
+ } else {
+ this.badest++
+ }
+ })
+ this.loadData.push(this.best)
+ this.loadData.push(this.good)
+ this.loadData.push(this.bad)
+ this.loadData.push(this.badest)
+ this.$refs.list.init()
+ this.$refs.four.getData()
+ },
+ async getMountArr() {
+ const res = await getMountArr()
+ for (let i = 0; i < res.data.result.length; i++) {
+ this.mountArr.push(res.data.result[i])
}
- })
- this.loadData.push(this.best)
- this.loadData.push(this.good)
- this.loadData.push(this.bad)
- this.loadData.push(this.badest)
+
+ this.$refs.mount.getMountArr()
+ console.log(this.$refs.mount.mountArr)
+ },
},
}
diff --git a/src/componets/Performance/performanceMain.vue b/src/componets/Performance/performanceMain.vue
index 5ef8efc..0847452 100644
--- a/src/componets/Performance/performanceMain.vue
+++ b/src/componets/Performance/performanceMain.vue
@@ -1,10 +1,14 @@
@@ -12,6 +16,7 @@
import performanceTop from './performanceTop.vue'
import performanceMiddle from './performanceMiddle.vue'
import performanceBottom from './performanceBottom.vue'
+import { getpaintTime } from '@/services/performance'
export default {
name: 'performanceMain',
@@ -22,48 +27,28 @@ export default {
},
data() {
return {
- paintArr: [
- {
- firstPaint: 50,
- firstContentfulPaint: 97,
- firstMeaningfulPaint: 24,
- largestContentfulPaint: 60,
- id: '21',
- day: 27,
- kind: 'fugiat',
- type: 'ex est id proident',
- },
- {
- firstPaint: 35,
- firstContentfulPaint: 43,
- firstMeaningfulPaint: 29,
- largestContentfulPaint: 14,
- id: '40',
- day: 97,
- kind: 'do aliqua dolore Excepteur in',
- type: 'anim laboris quis',
- },
- {
- firstPaint: 73,
- firstContentfulPaint: 61,
- firstMeaningfulPaint: 23,
- largestContentfulPaint: 41,
- id: '99',
- day: 91,
- kind: 'ullamco minim',
- type: 'laboris exercitation eu aliquip dolore',
- },
- ],
+ paintArr: [],
}
},
- mounted() {},
+ mounted() {
+ this.getPaintArr()
+ },
+ methods: {
+ async getPaintArr() {
+ let res = await getpaintTime()
+ for (let i = 0; i < res.data.result.length; i++) {
+ this.paintArr.push(res.data.result[i])
+ }
+ this.$refs.top.getPaintArr()
+ },
+ },
}
diff --git a/src/componets/Performance/performanceMiddle.vue b/src/componets/Performance/performanceMiddle.vue
index 88bc5ea..f58a99a 100644
--- a/src/componets/Performance/performanceMiddle.vue
+++ b/src/componets/Performance/performanceMiddle.vue
@@ -1,7 +1,7 @@
-
+
diff --git a/src/componets/Performance/performanceTop.vue b/src/componets/Performance/performanceTop.vue
index f2ed62b..12ea064 100644
--- a/src/componets/Performance/performanceTop.vue
+++ b/src/componets/Performance/performanceTop.vue
@@ -2,7 +2,7 @@
-
+
@@ -10,19 +10,19 @@
{{ parseInt(firstPaint / 7) }}ms
-
FP平均时间
+
FCP平均时间
{{ parseInt(firstContentfulPaint / 7) }}ms
-
FP平均时间
+
FMP平均时间
{{ parseInt(firstMeaningfulPaint / 7) }}ms
-
FP平均时间
+
LCP平均时间
{{ parseInt(largestContentfulPaint / 7) }}ms
@@ -31,7 +31,7 @@
-
+
{{ count }}
@@ -45,6 +45,7 @@
diff --git a/src/componets/leftMenu.vue b/src/componets/leftMenu.vue
new file mode 100644
index 0000000..ebae4fb
--- /dev/null
+++ b/src/componets/leftMenu.vue
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+
+
+
首页
+
+
+
+
+
+
+
+
js错误
+
+
+
+
+
+
+
+
页面性能
+
+
+
+
+
+
+
+
接口错误
+
+
+
+
+
+
+
+
+
diff --git a/src/services/performance.js b/src/services/performance.js
new file mode 100644
index 0000000..2fb08fe
--- /dev/null
+++ b/src/services/performance.js
@@ -0,0 +1,9 @@
+import service from '@/utils/request'
+
+export const getLoadArr = () => service.get('/loadArr')
+
+export const getMountArr = () => service.get('/mountArr')
+
+export const getBlankCount = () => service.get('/blankCount')
+
+export const getpaintTime = () => service.get('/paintTime')
diff --git a/src/views/PerformanceView.vue b/src/views/PerformanceView.vue
index 4020330..713fa3c 100644
--- a/src/views/PerformanceView.vue
+++ b/src/views/PerformanceView.vue
@@ -7,7 +7,7 @@