Przeglądaj źródła

Merge branch 'feature/formulaStatistics_date' of duanxiaoduan/tmr-admin into release/v1.0.2

duanxiaoduan 1 rok temu
rodzic
commit
c8d3816b3b

+ 1 - 0
src/icons/svg/配方统计.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1706865897438" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1129" xmlns:xlink="http://www.w3.org/1999/xlink" width="42" height="42"><path d="M256 64v64a64 64 0 0 0 56.512 63.552L320 192h384a64 64 0 0 0 63.552-56.512L768 128V64h128a64 64 0 0 1 64 64v832a64 64 0 0 1-64 64H128a64 64 0 0 1-64-64V128a64 64 0 0 1 64-64h128z m416 576h-320a32 32 0 1 0 0 64h320a32 32 0 1 0 0-64z m0-224h-320a32 32 0 0 0 0 64h320a32 32 0 1 0 0-64zM640 0a64 64 0 0 1 0 128H384a64 64 0 1 1 0-128h256z" p-id="1130"></path></svg>

+ 12 - 2
src/views/statisticalAnalysis/formulaStatistics/index.vue

@@ -91,11 +91,21 @@
     },
 
     created() {
-      // this.getChart1()
+      this.getTimeFn()
       this.getChart1()
     },
 
-    methods: {
+    methods: {
+      getTimeFn() {
+        const that = this
+        const start = new Date()
+        const end = new Date()
+        start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
+        end.setTime(end.getTime() - 3600 * 1000 * 24 * 1)
+        that.startTime = parseTime(start, '{y}-{m}-{d}')
+        that.endTime = parseTime(end, '{y}-{m}-{d}')
+        that.inputDatetime = [start, end]
+      },
       handleBefore() {
         if (this.inputDatetime !== '' && this.inputDatetime !== null) {
           var start = new Date(this.inputDatetime[0].setDate(this.inputDatetime[0].getDate() - 1))