ソースを参照

Merge branch 'dev' into 'test'

Dev

See merge request quanshu/mp-ui-pc!139
zhong chunping 3 年 前
コミット
61298cd2c8
1 ファイル変更16 行追加125 行削除
  1. 16 125
      src/views/index.vue

+ 16 - 125
src/views/index.vue

@@ -17,7 +17,7 @@
                 </div>
                 <div
                   class="number">
-                  ¥ {{daily.payAmt && daily.payAmt.today || 0}}
+                  ¥ {{ accDiv((daily.payAmt && daily.payAmt.today || 0), 100)}}
                 </div>
                <div class="brief-item__others">
                  <div class="text">
@@ -182,7 +182,7 @@
                 start-placeholder="开始日期"
                 end-placeholder="结束日期"
                 value-format="yyyy-MM-dd"
-                :picker-options="pickerOptions1"
+                :picker-options="pickerOptions"
                 @change="dateSelect1"
               >
               </el-date-picker>
@@ -217,7 +217,7 @@
                 start-placeholder="开始日期"
                 end-placeholder="结束日期"
                 value-format="yyyy-MM-dd"
-                :picker-options="pickerOptions2"
+                :picker-options="pickerOptions"
                 @change="dateSelect2"
               >
               </el-date-picker>
@@ -252,7 +252,7 @@
                 start-placeholder="开始日期"
                 end-placeholder="结束日期"
                 value-format="yyyy-MM-dd"
-                :picker-options="pickerOptions3"
+                :picker-options="pickerOptions"
                 @change="dateSelect3"
               >
               </el-date-picker>
@@ -276,7 +276,7 @@
                 start-placeholder="开始日期"
                 end-placeholder="结束日期"
                 value-format="yyyy-MM-dd"
-                :picker-options="pickerOptions4"
+                :picker-options="pickerOptions"
                 @change="dateSelect4"
               >
               </el-date-picker>
@@ -307,6 +307,7 @@ import echarts from "echarts"
 import moment from 'moment'
 import { mapGetters } from 'vuex'
 import { numberFormat, getTimeResult } from "@/utils/util";
+import { accDiv, accMul } from '@/utils/util'
 export default {
   data() {
     return {
@@ -333,8 +334,7 @@ export default {
       queryParams4:{
         days:7
       },
-      timeArr1: [],
-      pickerOptions1: {
+      pickerOptions: {
          shortcuts: [{
           text: '最近7天',
           onClick(picker) {
@@ -372,123 +372,10 @@ export default {
           }
         }]
       },
+      timeArr1: [],
       timeArr2: [],
-      pickerOptions2: {
-         shortcuts: [{
-          text: '最近7天',
-          onClick(picker) {
-          const end = new Date();
-          const start = new Date();
-          start.setTime(start.getTime() - 3600 * 1000 * 24 * (7-1));
-          picker.$emit('pick', [start, end]);
-          }
-        },
-        {
-          text: '最近30天',
-          onClick(picker) {
-          const end = new Date();
-          const start = new Date();
-          start.setTime(start.getTime() - 3600 * 1000 * 24 * (30-1));
-          picker.$emit('pick', [start, end]);
-          }
-        },
-        {
-          text: '最近三个月',
-          onClick(picker) {
-          const end = new Date();
-          const start = new Date();
-          start.setTime(start.getTime() - 3600 * 1000 * 24 * (90-1));
-          picker.$emit('pick', [start, end]);
-          }
-        },
-        {
-          text: '最近六个月',
-          onClick(picker) {
-          const end = new Date();
-          const start = new Date();
-          start.setTime(start.getTime() - 3600 * 1000 * 24 * (180-1));
-          picker.$emit('pick', [start, end]);
-          }
-        }]
-      },
       timeArr3: [],
-      pickerOptions3: {
-         shortcuts: [{
-          text: '最近7天',
-          onClick(picker) {
-          const end = new Date();
-          const start = new Date();
-          start.setTime(start.getTime() - 3600 * 1000 * 24 * (7-1));
-          picker.$emit('pick', [start, end]);
-          }
-        },
-        {
-          text: '最近30天',
-          onClick(picker) {
-          const end = new Date();
-          const start = new Date();
-          start.setTime(start.getTime() - 3600 * 1000 * 24 * (30-1));
-          picker.$emit('pick', [start, end]);
-          }
-        },
-        {
-          text: '最近三个月',
-          onClick(picker) {
-          const end = new Date();
-          const start = new Date();
-          start.setTime(start.getTime() - 3600 * 1000 * 24 * (90-1));
-          picker.$emit('pick', [start, end]);
-          }
-        },
-        {
-          text: '最近六个月',
-          onClick(picker) {
-          const end = new Date();
-          const start = new Date();
-          start.setTime(start.getTime() - 3600 * 1000 * 24 * (180-1));
-          picker.$emit('pick', [start, end]);
-          }
-        }]
-      },
-      timeArr4: [],
-      pickerOptions4: {
-         shortcuts: [{
-          text: '最近7天',
-          onClick(picker) {
-          const end = new Date();
-          const start = new Date();
-          start.setTime(start.getTime() - 3600 * 1000 * 24 * (7-1));
-          picker.$emit('pick', [start, end]);
-          }
-        },
-        {
-          text: '最近30天',
-          onClick(picker) {
-          const end = new Date();
-          const start = new Date();
-          start.setTime(start.getTime() - 3600 * 1000 * 24 * (30-1));
-          picker.$emit('pick', [start, end]);
-          }
-        },
-        {
-          text: '最近三个月',
-          onClick(picker) {
-          const end = new Date();
-          const start = new Date();
-          start.setTime(start.getTime() - 3600 * 1000 * 24 * (90-1));
-          picker.$emit('pick', [start, end]);
-          }
-        },
-        {
-          text: '最近六个月',
-          onClick(picker) {
-          const end = new Date();
-          const start = new Date();
-          start.setTime(start.getTime() - 3600 * 1000 * 24 * (180-1));
-          picker.$emit('pick', [start, end]);
-          }
-        }]
-      }
+      timeArr4: []
     };
   },
   mounted: function () {
@@ -658,6 +545,10 @@ export default {
       })
     },
 
+    accDiv(data){
+      return accDiv(data, 100)
+    },
+
     // 统计交易金额(带粒度)
     getPayAmtList() {
       getPayAmtList(this.queryParams1).then(res => {
@@ -668,7 +559,7 @@ export default {
           for (let index = 0; index < list.length; index++) {
             const element = list[index]
             xAxisData.push(element.x)
-            yAxisData.push(element.y)
+            yAxisData.push(accDiv(element.y, 100))
           }
           this.axisOption1.xAxis.data = xAxisData
           this.axisOption1.series[0].data = yAxisData
@@ -708,7 +599,7 @@ export default {
           for (let index = 0; index < list.length; index++) {
             const element = list[index]
             xAxisData.push(element.x)
-            yAxisData.push(element.y)
+            yAxisData.push(accDiv(element.y, 100))
           }
           this.axisOption3.xAxis.data = xAxisData
           this.axisOption3.series[0].data = yAxisData
@@ -728,7 +619,7 @@ export default {
           for (let index = 0; index < list.length; index++) {
             const element = list[index]
             xAxisData.push(element.x)
-            yAxisData.push(element.y)
+            yAxisData.push(accDiv(element.y, 100))
           }
           this.axisOption4.xAxis.data = xAxisData
           this.axisOption4.series[0].data = yAxisData