Prechádzať zdrojové kódy

添加点击率报表

liyongli 3 mesiacov pred
rodič
commit
445deafb0d

+ 1 - 0
src/types/Report.d.ts

@@ -4,4 +4,5 @@ export interface IReportItem {
   requestCount: number
   sdate: string
   uvCount: number
+  lv: number
 }

+ 1 - 1
src/views/ReportFormsMonthPage.vue

@@ -204,7 +204,7 @@ const onSubmit = (isExport = false) => {
     const list = (data.records || []).map((v: IReportItem) => {
       return {
         ...v,
-        lv: (v.clickCount / v.exposureCount).toFixed(2) - 0,
+        lv: Number((v.clickCount / v.exposureCount).toFixed(2)) * 100,
       }
     })
     if (!isExport) {

+ 2 - 2
src/views/ReportFormsPage.vue

@@ -204,7 +204,7 @@ const onSubmit = (isExport = false) => {
     const list = (data.records || []).map((v: IReportItem) => {
       return {
         ...v,
-        lv: (v.clickCount / v.exposureCount).toFixed(2) - 0,
+        lv: Number((v.clickCount / v.exposureCount).toFixed(2)) * 100,
       }
     })
     if (!isExport) {
@@ -220,7 +220,7 @@ const onSubmit = (isExport = false) => {
     // 生成数据
     let strcsv = 'data:text/csv;charset=utf-8,\uFEFF日期,曝光数,点击数,点击率,用户数\r\n'
     list.map((v: IReportItem) => {
-      strcsv += `${v.sdate},${v.exposureCount},${v.clickCount},${v.lv}%,${v.uvCount},\r\n`
+      strcsv += `${v.sdate},${v.exposureCount},${v.clickCount},${v.lv},${v.uvCount},\r\n`
     })
     // 导出
     let link: HTMLAnchorElement | undefined = document.createElement('a')

+ 1 - 1
src/views/ReportSpaceFormsMonthPage.vue

@@ -129,7 +129,7 @@ const onSubmit = (isExport = false) => {
     const list = (data.records || []).map((v: IReportItem) => {
       return {
         ...v,
-        lv: (v.clickCount / v.exposureCount).toFixed(2) - 0,
+        lv: Number((v.clickCount / v.exposureCount).toFixed(2)) * 100,
       }
     })
     if (!isExport) {

+ 1 - 1
src/views/ReportSpaceFormsPage.vue

@@ -129,7 +129,7 @@ const onSubmit = (isExport = false) => {
     const list = (data.records || []).map((v: IReportItem) => {
       return {
         ...v,
-        lv: (v.clickCount / v.exposureCount).toFixed(2) - 0,
+        lv: Number((v.clickCount / v.exposureCount).toFixed(2)) * 100,
       }
     })
     if (!isExport) {