Browse Source

Merge branch 'Inspection' into online

wolyshaw 4 years ago
parent
commit
02d92b9948

+ 20 - 5
src/views/main/baseinfo/business.vue

@@ -13,11 +13,18 @@
         </span>
       </statistic-item>
     </statistic>
-    <ve-histogram style="width: 100%;" height="350px" :data="chartData" :data-empty="dataEmpty"></ve-histogram>
+    <ve-histogram
+      style="width: 100%;"
+      height="350px"
+      :data="chartData"
+      :data-empty="dataEmpty"
+      :data-zoom="dataZoom"
+    ></ve-histogram>
   </el-card>
 </template>
 <script>
 import 'v-charts/lib/style.css'
+import 'echarts/lib/component/dataZoom'
 import countTo from 'vue-count-to'
 import veHistogram from 'v-charts/lib/histogram.common'
 export default {
@@ -35,23 +42,31 @@ export default {
         HOMEWORK_COMMENT_RATE: this.data['HOMEWORK_COMMENT_RATE'] || {},
       }
     },
+    dataZoom() {
+      return [
+        {
+          type: 'slider',
+          start: 60,
+          end: 100
+        }
+      ]
+    },
     chartData() {
-      const data = this.data[this.active] || {}
       const values = Object.values(this.items)
       const months = {}
       for (const item of values) {
         for (const row of (item.indexMonthData || [])) {
-          const key = this.$helpers.dayjs(row.month).month() + 1 + '月'
+          const key = this.$helpers.dayjs(row.month).format('YYYY-MM-DD')
           if (!months[key]) {
             months[key] = {
-              '月份': key,
+              '日期': key,
             }
           }
           months[key][item.title] = row.percent
         }
       }
       return {
-        columns: ['月份', ...values.map(item => item.title)],
+        columns: ['日期', ...values.map(item => item.title)],
         rows: Object.values(months)
       }
     },

+ 20 - 6
src/views/main/baseinfo/curriculum.vue

@@ -14,11 +14,17 @@
       </statistic-item>
     </statistic>
     <ve-line :settings="{
-      area: true,
-    }" :data="chartData" height="350px" :data-empty="dataEmpty"/>
+        area: true,
+      }"
+      :data="chartData"
+      height="350px"
+      :data-empty="dataEmpty"
+      :data-zoom="dataZoom"
+    />
   </el-card>
 </template>
 <script>
+import 'echarts/lib/component/dataZoom'
 import countTo from 'vue-count-to'
 import veLine from 'v-charts/lib/line.common'
 export default {
@@ -35,23 +41,31 @@ export default {
         PRACTICE_GROUP_COURSE: this.data['PRACTICE_GROUP_COURSE'] || {},
       }
     },
+    dataZoom() {
+      return [
+        {
+          type: 'slider',
+          start: 50,
+          end: 100
+        }
+      ]
+    },
     chartData() {
-      const data = this.data[this.active] || {}
       const values = Object.values(this.items)
       const months = {}
       for (const item of values) {
         for (const row of (item.indexMonthData || [])) {
-          const key = this.$helpers.dayjs(row.month).month() + 1 + '月'
+          const key = this.$helpers.dayjs(row.month).format('YYYY-MM-DD')
           if (!months[key]) {
             months[key] = {
-              '月份': key,
+              '日期': key,
             }
           }
           months[key][item.title] = row.percent
         }
       }
       return {
-        columns: ['月份', ...values.map(item => item.title)],
+        columns: ['日期', ...values.map(item => item.title)],
         rows: Object.values(months)
       }
     },

+ 20 - 5
src/views/main/baseinfo/hr.vue

@@ -13,10 +13,17 @@
         </span>
       </statistic-item>
     </statistic>
-    <ve-histogram style="width: 100%;" height="350px" :data="chartData" :data-empty="dataEmpty"></ve-histogram>
+    <ve-histogram
+      style="width: 100%;"
+      height="350px"
+      :data="chartData"
+      :data-empty="dataEmpty"
+      :data-zoom="dataZoom"
+    ></ve-histogram>
   </el-card>
 </template>
 <script>
+import 'echarts/lib/component/dataZoom'
 import countTo from 'vue-count-to'
 import veHistogram from 'v-charts/lib/histogram.common'
 export default {
@@ -34,23 +41,31 @@ export default {
         DIMISSION_NUM: this.data['DIMISSION_NUM'] || {},
       }
     },
+    dataZoom() {
+      return [
+        {
+          type: 'slider',
+          start: 60,
+          end: 100
+        }
+      ]
+    },
     chartData() {
-      const data = this.data[this.active] || {}
       const values = Object.values(this.items)
       const months = {}
       for (const item of values) {
         for (const row of (item.indexMonthData || [])) {
-          const key = this.$helpers.dayjs(row.month).month() + 1 + '月'
+          const key = this.$helpers.dayjs(row.month).format('YYYY-MM-DD')
           if (!months[key]) {
             months[key] = {
-              '月份': key,
+              '日期': key,
             }
           }
           months[key][item.title] = row.percent
         }
       }
       return {
-        columns: ['月份', ...values.map(item => item.title)],
+        columns: ['日期', ...values.map(item => item.title)],
         rows: Object.values(months)
       }
     },

+ 20 - 6
src/views/main/baseinfo/management.vue

@@ -14,11 +14,17 @@
       </statistic-item>
     </statistic>
     <ve-line :settings="{
-      area: true,
-    }" :data="chartData" height="350px" :data-empty="dataEmpty"/>
+        area: true,
+      }"
+      :data="chartData"
+      height="350px"
+      :data-empty="dataEmpty"
+      :data-zoom="dataZoom"
+    />
   </el-card>
 </template>
 <script>
+import 'echarts/lib/component/dataZoom'
 import countTo from 'vue-count-to'
 import veLine from 'v-charts/lib/line.common'
 export default {
@@ -37,23 +43,31 @@ export default {
         REVENUE_MONEY: this.data['REVENUE_MONEY'] || {},
       }
     },
+    dataZoom() {
+      return [
+        {
+          type: 'slider',
+          start: 80,
+          end: 100
+        }
+      ]
+    },
     chartData() {
-      const data = this.data[this.active] || {}
       const values = Object.values(this.items)
       const months = {}
       for (const item of values) {
         for (const row of (item.indexMonthData || [])) {
-          const key = this.$helpers.dayjs(row.month).month() + 1 + '月'
+          const key = this.$helpers.dayjs(row.month).format('YYYY-MM-DD')
           if (!months[key]) {
             months[key] = {
-              '月份': key,
+              '日期': key,
             }
           }
           months[key][item.title] = row.percent
         }
       }
       return {
-        columns: ['月份', ...values.map(item => item.title)],
+        columns: ['日期', ...values.map(item => item.title)],
         rows: Object.values(months)
       }
     },

+ 20 - 5
src/views/main/baseinfo/operate.vue

@@ -13,10 +13,17 @@
         </span>
       </statistic-item>
     </statistic>
-    <ve-histogram style="width: 100%;" height="350px" :data="chartData" :data-empty="dataEmpty"></ve-histogram>
+    <ve-histogram
+      style="width: 100%;"
+      height="350px"
+      :data="chartData"
+      :data-empty="dataEmpty"
+      :data-zoom="dataZoom"
+    ></ve-histogram>
   </el-card>
 </template>
 <script>
+import 'echarts/lib/component/dataZoom'
 import countTo from 'vue-count-to'
 import veHistogram from 'v-charts/lib/histogram.common'
 export default {
@@ -34,23 +41,31 @@ export default {
         OTHER_STUDENT: this.data['OTHER_STUDENT'] || {},
       }
     },
+    dataZoom() {
+      return [
+        {
+          type: 'slider',
+          start: 60,
+          end: 100
+        }
+      ]
+    },
     chartData() {
-      const data = this.data[this.active] || {}
       const values = Object.values(this.items)
       const months = {}
       for (const item of values) {
         for (const row of (item.indexMonthData || [])) {
-          const key = this.$helpers.dayjs(row.month).month() + 1 + '月'
+          const key = this.$helpers.dayjs(row.month).format('YYYY-MM-DD')
           if (!months[key]) {
             months[key] = {
-              '月份': key,
+              '日期': key,
             }
           }
           months[key][item.title] = row.percent
         }
       }
       return {
-        columns: ['月份', ...values.map(item => item.title)],
+        columns: ['日期', ...values.map(item => item.title)],
         rows: Object.values(months)
       }
     },

+ 21 - 6
src/views/main/baseinfo/student.vue

@@ -21,7 +21,14 @@
         </span>
       </statistic-item>
     </statistic>
-    <ve-histogram v-if="isHistogram" style="width: 100%;" height="350px" :data="chartData" :data-empty="dataEmpty"></ve-histogram>
+    <ve-histogram
+      style="width: 100%;"
+      height="350px"
+      :data="chartData"
+      :data-empty="dataEmpty"
+      :data-zoom="dataZoom"
+       v-if="isHistogram"
+    ></ve-histogram>
     <ve-funnel v-else style="width: 100%;" height="350px" :data="funnelData" :data-empty="dataEmpty"></ve-funnel>
   </el-card>
 </template>
@@ -44,23 +51,31 @@ export default {
         STUDENT_CONVERSION: this.data['STUDENT_CONVERSION'] || {},
       }
     },
+    dataZoom() {
+      return [
+        {
+          type: 'slider',
+          start: 60,
+          end: 100
+        }
+      ]
+    },
     chartData() {
-      const data = this.data[this.active] || {}
-      const values = Object.values(this.items).filter(item => item.dataType !== 'STUDENT_CONVERSION')
+      const values = Object.values(this.items)
       const months = {}
       for (const item of values) {
         for (const row of (item.indexMonthData || [])) {
-          const key = this.$helpers.dayjs(row.month).month() + 1 + '月'
+          const key = this.$helpers.dayjs(row.month).format('YYYY-MM-DD')
           if (!months[key]) {
             months[key] = {
-              '月份': key,
+              '日期': key,
             }
           }
           months[key][item.title] = row.percent
         }
       }
       return {
-        columns: ['月份', ...values.map(item => item.title)],
+        columns: ['日期', ...values.map(item => item.title)],
         rows: Object.values(months)
       }
     },

+ 1 - 0
src/views/withdrawal-application/modals/visit.vue

@@ -100,6 +100,7 @@ export default {
           const { visitType, ...rest } = this.visitForm
           const data = {
             ...rest,
+            objectId: this.detail.id,
             studentName: this.userName,
             musicGroupId: this.detail.musicGroupId,
             studentId: this.detail.userId,