lex 2 years ago
parent
commit
672dcc4a14

+ 5 - 2
src/router/index.js

@@ -505,7 +505,7 @@ export const asyncRoutes = {
   // 异常数据
   indexErrDataRecord: () => import("@/views/indexErrDataRecord"),
   // 团练宝数据
-  cloudDate: () => import("@/views/main/cloudDate"),
+  cloudDate: () => import("@/views/main/cloudDate/index.vue"),
   dictionaryManager: () => import("@/views/dictionaryManager"),
   // 会员排课列表
   memberClassList: () =>
@@ -631,6 +631,9 @@ export const asyncRoutes = {
   // 合作单位分润 payShareList
   branchShareManager: () => import("@/views/branchPayManager/payShareList"),
   smallCourseConsumption: () =>
-    import("@/views/smallCourseConsumption/index.vue")
+    import("@/views/smallCourseConsumption/index.vue"),
+  // 训练详情
+  exerciseDurationDetail: () =>
+    import("@/views/main/cloudDate/exerciseDurationDetail.vue")
 };
 export default router;

+ 14 - 2
src/store/modules/permission.js

@@ -295,6 +295,19 @@ function setDetailRoute(accessedRoutes) {
             belongTopMenu: "/main",
             activeMenu: "/workbench"
           }
+        },
+        {
+          name: "exerciseDurationDetail",
+          path: "/exerciseDurationDetail",
+          component: () =>
+            import("@/views/main/cloudDate/exerciseDurationDetail.vue"),
+          hidden: true,
+          meta: {
+            noCache: "1",
+            title: "练习时长详情",
+            belongTopMenu: "/main",
+            activeMenu: "/workbench"
+          }
         }
         // /hasfreeCourse  排课时长消耗异常
       ]);
@@ -1085,8 +1098,7 @@ function setDetailRoute(accessedRoutes) {
         {
           name: "缴费项目列表",
           path: "payschoolList",
-          component: () =>
-            import("@/views/branchPayManager/payschoolList"),
+          component: () => import("@/views/branchPayManager/payschoolList"),
           hidden: true,
           meta: {
             noCache: "1",

+ 7 - 0
src/views/main/api.js

@@ -7,6 +7,13 @@ export const getIndex = data =>
     params: data,
     method: "get"
   });
+// 获取分部下的数据
+export const indexCoop = data =>
+  request2({
+    url: "/api-web/indexCoop",
+    params: data,
+    method: "get"
+  });
 export const getInspectionItem = data =>
   request2({
     url: "/api-web/inspectionItem/queryPage",

+ 33 - 18
src/views/main/baseinfo/index.vue

@@ -42,15 +42,30 @@
     </el-alert> -->
     <!-- 这里显示选项卡 -->
     <!-- <empty desc="暂无统计数据" v-if="isEmpty" /> v-else -->
-    <el-row  class="rows" :gutter="20">
+    <el-row class="rows" :gutter="20">
       <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="8">
-        <studentbaseinfo :data="dataInfo" :search='search'  @resetDate="resetDate"   ref="studentbaseinfo"/>
+        <studentbaseinfo
+          :data="dataInfo"
+          :search="search"
+          @resetDate="resetDate"
+          ref="studentbaseinfo"
+        />
       </el-col>
       <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="8">
-        <operate :data="dataInfo"  :search='search'  @resetDate="resetDate" ref="operate"/>
+        <operate
+          :data="dataInfo"
+          :search="search"
+          @resetDate="resetDate"
+          ref="operate"
+        />
       </el-col>
       <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="8">
-        <hrdata :data="dataInfo"  :search='search'  @resetDate="resetDate" ref="hrdata"/>
+        <hrdata
+          :data="dataInfo"
+          :search="search"
+          @resetDate="resetDate"
+          ref="hrdata"
+        />
       </el-col>
       <!-- <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
         <surplusCourse :data="dataInfo" />
@@ -131,13 +146,13 @@ export default {
     curriculum,
     studentbaseinfo,
     surplusCourse,
-    useCourse,
+    useCourse
   },
   data() {
     return {
       pickerOptions: {
         firstDayOfWeek: 1,
-        disabledDate: (a) => {
+        disabledDate: a => {
           const { dayjs } = this.$helpers;
           return dayjs(a).isAfter(dayjs().subtract(1, "day"));
         },
@@ -150,7 +165,7 @@ export default {
               end.setTime(end.getTime() - 3600 * 1000 * 24 * 1);
               start.setTime(start.getTime() - 3600 * 1000 * 24 * 8);
               picker.$emit("pick", [start, end]);
-            },
+            }
           },
           {
             text: "最近一个月",
@@ -160,7 +175,7 @@ export default {
               end.setTime(end.getTime() - 3600 * 1000 * 24 * 1);
               start.setTime(start.getTime() - 3600 * 1000 * 24 * 31);
               picker.$emit("pick", [start, end]);
-            },
+            }
           },
           {
             text: "最近三个月",
@@ -170,28 +185,28 @@ export default {
               end.setTime(end.getTime() - 3600 * 1000 * 24 * 1);
               start.setTime(start.getTime() - 3600 * 1000 * 24 * 91);
               picker.$emit("pick", [start, end]);
-            },
-          },
-        ],
+            }
+          }
+        ]
       },
       search: {
         dates: [],
-        organId: null,
+        organId: null
       },
       dataInfo: {},
       business: {},
-      loading: false,
+      loading: false
     };
   },
   computed: {
     isEmpty() {
       return !Object.keys(this.dataInfo).length;
-    },
+    }
   },
   created() {},
   async mounted() {
     this.$set(this.search, "dates", this.getInitDate());
-   await this.$store.dispatch("setBranchs");
+    await this.$store.dispatch("setBranchs");
     this.FetchDetail();
   },
   methods: {
@@ -269,8 +284,8 @@ export default {
         // this.$set( this.dataInfo,item,data[item])
       }
       this.dataInfo = { ...this.dataInfo };
-    },
-  },
+    }
+  }
 };
 </script>
 <style lang="less" scoped>
@@ -281,7 +296,7 @@ export default {
       margin-bottom: 20px;
     }
   }
-  ::v-deep  .el-card__body .statistic {
+  ::v-deep .el-card__body .statistic {
     margin-bottom: 15px;
     padding: 0;
   }

+ 40 - 35
src/views/main/baseinfo/management.vue

@@ -1,4 +1,4 @@
-<template >
+<template>
   <el-card id="management">
     <div slot="header" class="clearfix">
       <searchHeader
@@ -19,7 +19,12 @@
       </el-tab-pane>
       <el-tab-pane label="分部数据" name="second">
         <div v-if="activeName == 'second'">
-          <manageOrgan :data="data" :search="search" ref="manageOrgan" />
+          <manageOrgan
+            :data="data"
+            :search="search"
+            ref="manageOrgan"
+            :mdate1="mdate"
+          />
         </div>
       </el-tab-pane>
     </el-tabs>
@@ -45,12 +50,12 @@ export default {
     "ve-histogram": histogram,
     searchHeader,
     manageOrganAll,
-    manageOrgan,
+    manageOrgan
   },
   computed: {
     legend() {
       return {
-        left: "10px",
+        left: "10px"
       };
     },
     items() {
@@ -65,9 +70,9 @@ export default {
         "ORGAN_VIP_AMOUNT",
         "ORGAN_PRACTICE_AMOUNT",
         "ORGAN_OTHER_AMOUNT",
-        "ORGAN_TOTAL_AMOUNT",
+        "ORGAN_TOTAL_AMOUNT"
       ];
-      arr.forEach((str) => {
+      arr.forEach(str => {
         if (this.data[str]) {
           obj[str] = this.data[str];
         }
@@ -82,9 +87,9 @@ export default {
         "RENEW_AMOUNT",
         "VIP_AMOUNT",
         "PRACTICE_AMOUNT",
-        "OTHER_AMOUNT",
+        "OTHER_AMOUNT"
       ];
-      arr.forEach((str) => {
+      arr.forEach(str => {
         if (this.data[str]) {
           obj[str] = this.data[str];
         }
@@ -94,7 +99,7 @@ export default {
     chartExtend() {
       return {
         series: {
-          smooth: false,
+          smooth: false
         },
 
         yAxis: {
@@ -104,27 +109,27 @@ export default {
           scale: true,
           min: 0,
           axisLabel: {
-            formatter: "{value}元",
-          },
+            formatter: "{value}元"
+          }
         },
 
         tooltip: {
           axisPointer: {
             type: "shadow",
             shadowStyle: {
-              color: "rgba(150,150,150,0.2)",
-            },
+              color: "rgba(150,150,150,0.2)"
+            }
           },
 
-          formatter: (item) => {
+          formatter: item => {
             return [
               item[0].axisValueLabel,
               ...item.map(
-                (d) => `<br/>${d.marker}${d.seriesName}: ${d.value[1]} 元`
-              ),
+                d => `<br/>${d.marker}${d.seriesName}: ${d.value[1]} 元`
+              )
             ].join("");
-          },
-        },
+          }
+        }
       };
     },
     dataZoom() {
@@ -133,8 +138,8 @@ export default {
           type: "slider",
           start: 50,
           end: 100,
-          filterMode: "empty",
-        },
+          filterMode: "empty"
+        }
       ];
     },
     chartData() {
@@ -145,7 +150,7 @@ export default {
           const key = this.$helpers.dayjs(row.month).format("YYYY-MM-DD");
           if (!months[key]) {
             months[key] = {
-              日期: key,
+              日期: key
             };
           }
           months[key][item.title] = row.percent;
@@ -163,10 +168,10 @@ export default {
           "网管课收入",
           "其他收入",
           "乐团续费收入",
-          "VIP课收入",
+          "VIP课收入"
         ],
         rows: Object.values(months),
-        loading: true,
+        loading: true
       };
     },
     chartDataForMoth() {
@@ -178,7 +183,7 @@ export default {
 
           if (!months[key]) {
             months[key] = {
-              月份: key,
+              月份: key
             };
             months[key][item.title] = row.percent;
           } else {
@@ -203,15 +208,15 @@ export default {
           "网管课收入",
           "其他收入",
           "乐团续费收入",
-          "VIP课收入",
+          "VIP课收入"
         ],
         rows: Object.values(months),
-        loading: true,
+        loading: true
       };
     },
     dataEmpty() {
       return !this.chartData.rows.length;
-    },
+    }
   },
   data() {
     // this.chartSettings = {
@@ -225,7 +230,7 @@ export default {
       loading: false,
       endDate: "",
       show: true,
-      activeName: "first",
+      activeName: "first"
     };
   },
   mounted() {
@@ -258,17 +263,17 @@ export default {
           ...getTimes(this.mdate, ["startDate", "endDate"]),
           //
           dataTypes:
-            "FINANCE_AMOUNT,FINANCE_BALANCE_AMOUNT,FINANCE_PAY,TOTAL_AMOUNT,ORGAN_FINANCE_AMOUNT,ORGAN_APPLY_AMOUNT,ORGAN_RENEW_AMOUNT,ORGAN_VIP_AMOUNT,ORGAN_PRACTICE_AMOUNT,ORGAN_OTHER_AMOUNT,ORGAN_TOTAL_AMOUNT,APPLY_AMOUNT,RENEW_AMOUNT,VIP_AMOUNT,PRACTICE_AMOUNT,OTHER_AMOUNT",
+            "FINANCE_AMOUNT,FINANCE_BALANCE_AMOUNT,FINANCE_PAY,TOTAL_AMOUNT,ORGAN_FINANCE_AMOUNT,ORGAN_APPLY_AMOUNT,ORGAN_RENEW_AMOUNT,ORGAN_VIP_AMOUNT,ORGAN_PRACTICE_AMOUNT,ORGAN_OTHER_AMOUNT,ORGAN_TOTAL_AMOUNT,APPLY_AMOUNT,RENEW_AMOUNT,VIP_AMOUNT,PRACTICE_AMOUNT,OTHER_AMOUNT"
         });
         for (const item of res.data) {
           // 再循环一遍
           // for (const key in { ...this.items, ...this.items2 }) {
           //   // console.log(key);
           //   if (item.dataType == key) {
-              data[item.dataType] = {
-                ...item,
-                desc: descs[item.dataType],
-              };
+          data[item.dataType] = {
+            ...item,
+            desc: descs[item.dataType]
+          };
           //   }
           // }
         }
@@ -301,8 +306,8 @@ export default {
     },
     changeTimer(val) {
       this.timer = val;
-    },
-  },
+    }
+  }
 };
 </script>
 <style lang="less" scoped>

+ 112 - 59
src/views/main/baseinfo/modals/manageOrgan.vue

@@ -7,30 +7,28 @@
     ></div>
     <!-- 按月/按天 -->
     <div class="wrap">
-      <!--   v-if="timer == 'day'"     :settings="chartSettings"   DD-->
       <ve-histogram
         :data="chartData"
         height="524px"
         :data-empty="dataEmpty"
         :extend="chartExtend"
-            :legend="legend"
+        :legend="legend"
         :data-zoom="dataZoom"
+        ref="histogram"
       />
-      <!-- <ve-line
-
-      v-else
-        :data-zoom="dataZoom"
-        :settings="{
-          area: true,
-        }"
-        :data="chartDataForMoth"
-        height="350px"
-        :data-empty="dataEmpty"
-        :data-zoom="dataZoom"
-        :extend="chartExtend"
-        :legend="legend"
-      /> -->
     </div>
+    <el-dialog
+      title="学校维度"
+      :visible.sync="handleStatus"
+      @close="handleStatus = false"
+      width="900px"
+    >
+      <organCoop
+        v-if="handleStatus"
+        @close="handleStatus = false"
+        :data="dataCoop"
+      />
+    </el-dialog>
   </div>
 </template>
 
@@ -40,34 +38,37 @@ import countTo from "vue-count-to";
 // import veLine from "v-charts/lib/line.common";
 import histogram from "v-charts/lib/histogram.common";
 import searchHeader from "./searchHeader";
-import { getIndex } from "../../api";
+// import { getIndex } from "../../api";
+import { indexCoop } from "../../api";
 import { getTimes } from "@/utils";
 import { descs, chioseNum } from "../../constant";
 import { orderType } from "@/constant";
 import lodash from "lodash";
+import organCoop from "./organCoop.vue";
 export default {
-  props: ["data", "search"],
+  props: ["data", "search", "mdate1"],
   components: {
     // "ve-line": veLine,
     "count-to": countTo,
     "ve-histogram": histogram,
     searchHeader,
+    organCoop
   },
   computed: {
     legend() {
       return {
-        show:false,
+        show: false
       };
     },
     items() {
       let obj = {};
       let arr = [
-        "ORGAN_TOTAL_AMOUNT",
+        "ORGAN_TOTAL_AMOUNT"
         // "FINANCE_AMOUNT",
         // "FINANCE_BALANCE_AMOUNT",
         // "FINANCE_PAY",
       ];
-      arr.forEach((str) => {
+      arr.forEach(str => {
         if (this.data[str]) {
           obj[str] = this.data[str];
         }
@@ -83,14 +84,12 @@ export default {
         "ORGAN_RENEW_AMOUNT",
         "ORGAN_VIP_AMOUNT",
         "ORGAN_PRACTICE_AMOUNT",
-        "ORGAN_OTHER_AMOUNT",
+        "ORGAN_OTHER_AMOUNT"
       ];
 
-
-      arr.forEach((str) => {
+      arr.forEach(str => {
         if (this.data[str]) {
-
-          obj[str] = this.data[str]
+          obj[str] = this.data[str];
         }
       });
       return obj;
@@ -99,19 +98,19 @@ export default {
       return {
         series: {
           smooth: false,
-          barWidth: 60,
+          barWidth: 40,
           label: {
             show: true,
             position: "top",
             color: "#000",
-            formatter: function (value) {
+            formatter: function(value) {
               var val = value.data;
               return val + "%";
-            },
-          },
+            }
+          }
         },
         markerPoint: {
-          data: { name: "百分比" },
+          data: { name: "百分比" }
         },
 
         yAxis: {
@@ -122,15 +121,15 @@ export default {
           min: 0,
 
           axisLabel: {
-            formatter: "{value}%",
+            formatter: "{value}%"
           },
           splitLine: {
             //分割线配置
             show: true,
             lineStyle: {
-              color: "#EBEEF5",
-            },
-          },
+              color: "#EBEEF5"
+            }
+          }
         },
 
         xAxis: {
@@ -140,22 +139,22 @@ export default {
             interval: 0, // 坐标轴刻度标签的显示间隔,在类目轴中有效;默认会采用标签不重叠的策略间隔显示标签;可以设置成0强制显示所有标签;如果设置为1,表示『隔一个标签显示一个标签』,如果值为2,表示隔两个标签显示一个标签,以此类推。
             inside: false, // 刻度标签是否朝内,默认朝外
             margin: 6, // 刻度标签与轴线之间的距离
-            rotate: 45,
+            rotate: 45
             // formatter: function (value) {
             //   return value.split("").join("\n");
             // },
-          },
+          }
         },
 
         tooltip: {
           axisPointer: {
             type: "shadow",
             shadowStyle: {
-              color: "rgba(150,150,150,0.2)",
-            },
+              color: "rgba(150,150,150,0.2)"
+            }
           },
 
-          formatter: (item) => {
+          formatter: item => {
             // console.log(item);
             // console.log(this.values, item[0].axisValue, "organ");
             let arr = [
@@ -165,19 +164,25 @@ export default {
               { name: "乐团续费收入", dot: "元" },
               { name: "VIP课收入", dot: "元" },
               { name: "网管课收入", dot: "元" },
-              { name: "其他收入", dot: "元" },
+              { name: "其他收入", dot: "元" }
             ];
             return [
               item[0].axisValueLabel,
               ...arr.map(
-                (d) =>
+                d =>
                   `<br/>${d.name}:${this.values[item[0].axisValue][d.name]}${
                     d.dot
                   }`
-              ),
+              )
             ].join("");
-          },
-        },
+          }
+        }
+        // events: {
+        //   click: (e, index) => {
+        //     // this.onClick(e, index);
+        //     console.log("e", e);
+        //   }
+        // }
       };
     },
     dataZoom() {
@@ -189,8 +194,8 @@ export default {
           end: 20,
           filterMode: "empty",
           zoomLock: true,
-          handleSize: 0,
-        },
+          handleSize: 0
+        }
       ];
     },
     chartData() {
@@ -201,7 +206,7 @@ export default {
       for (const row of values[0].indexMonthData || []) {
         const key = row.organName;
         organ[key] = {
-          分部: row.organName,
+          分部: row.organName
         };
         for (const item of values) {
           if (item.title == row.title) {
@@ -210,8 +215,9 @@ export default {
 
           if (item.title == "总收入" && row.title == "总收入") {
             organ[key]["总收入占比"] = (
-              (isNaN(row.percent / item.percent)?0:row.percent / item.percent) *
-              100
+              (isNaN(row.percent / item.percent)
+                ? 0
+                : row.percent / item.percent) * 100
             ).toFixed(2);
           }
         }
@@ -219,7 +225,7 @@ export default {
 
       for (const item of values) {
         for (const row of item.indexMonthData || []) {
-          if ((item.title == row.title)) {
+          if (item.title == row.title) {
             organ[row.organName][row.title] = row.percent;
           }
         }
@@ -241,7 +247,7 @@ export default {
 
       this.values = organ;
       let row = Object.values(organ);
-      row = lodash.sortBy(row, function (o) {
+      row = lodash.sortBy(row, function(o) {
         return -o["总收入占比"];
       });
       // console.log(row, "row");
@@ -250,7 +256,7 @@ export default {
       return {
         columns: ["分部", "总收入占比"],
         rows: row,
-        loading: true,
+        loading: true
       };
     },
     chartDataForMoth() {
@@ -262,7 +268,7 @@ export default {
 
           if (!months[key]) {
             months[key] = {
-              月份: key,
+              月份: key
             };
             months[key][item.title] = row.percent;
           } else {
@@ -287,15 +293,15 @@ export default {
           "网管课收入",
           "其他收入",
           "乐团续费收入",
-          "VIP课收入",
+          "VIP课收入"
         ],
         rows: Object.values(months),
-        loading: true,
+        loading: true
       };
     },
     dataEmpty() {
       return !this.chartData.rows.length;
-    },
+    }
   },
   data() {
     // this.chartSettings = {
@@ -311,12 +317,56 @@ export default {
       activeName: "first",
       timer: "day",
       values: "",
+      handleStatus: false,
+      organId: "",
+      dataCoop: []
     };
   },
   mounted() {
     this.init();
+    // console.log(this.$refs.histogram, "histogram");
+    const charts = this.$refs.histogram?.echarts;
+    if (charts) {
+      const that = this;
+      charts.getZr().off("click"); //防止触发两次点击事件
+      charts.getZr().on("click", async function(params) {
+        let op = charts.getOption();
+        // console.log(op, params);
+        let pointInPixel = [params.offsetX, params.offsetY];
+        if (charts.containPixel("grid", pointInPixel)) {
+          const xIndex = charts.convertFromPixel(
+            { seriesIndex: 0 },
+            pointInPixel
+          )[0];
+          //获得图表中点击的列
+          var name = op.xAxis[0].data[xIndex]; // 当前点击的 X轴 的名称
+          const indexMonthData =
+            that.data?.ORGAN_FINANCE_AMOUNT.indexMonthData || [];
+          indexMonthData.forEach(item => {
+            if (item.organName == name) {
+              that.organId = item.organId;
+            }
+          });
+          await that.FetchDetail();
+        }
+      });
+    }
   },
   methods: {
+    async FetchDetail() {
+      this.loading = true;
+      try {
+        const res = await indexCoop({
+          ...getTimes(this.mdate1, ["startTime", "endTime"]),
+          organId: this.organId
+        });
+        this.dataCoop = res.data || [];
+        this.handleStatus = true;
+      } catch (error) {
+        console.log(error);
+      }
+      this.loading = false;
+    },
     init() {
       // this.$refs.searchHeader.initStatue("month");
       this.mdate = this.getInitDate();
@@ -381,14 +431,17 @@ export default {
         .set("date", 1)
         .format("YYYY-MM-DD");
       return [start, end];
-    },
-  },
+    }
+  }
 };
 </script>
 <style lang="less" scoped>
 ::v-deep .description-title {
   margin-bottom: 0;
 }
+::v-deep .el-dialog__body {
+  padding-top: 0;
+}
 #management .statistic .statistic-content > span {
   &:first-child {
     font-size: 14px !important;

+ 120 - 0
src/views/main/baseinfo/modals/organCoop.vue

@@ -0,0 +1,120 @@
+<template>
+  <div class="organCoop">
+    <ve-histogram
+      :data="chartData"
+      height="400px"
+      :data-empty="dataEmpty"
+      :extend="chartExtend"
+      :legend="legend"
+      ref="histogram"
+    />
+    <!-- :data-zoom="dataZoom" -->
+  </div>
+</template>
+
+<script>
+import "echarts/lib/component/dataZoom";
+import histogram from "v-charts/lib/histogram.common";
+export default {
+  name: "organ-coop",
+  props: ["data"],
+  components: {
+    "ve-histogram": histogram
+  },
+  computed: {
+    legend() {
+      return {
+        show: false
+      };
+    },
+
+    chartData() {
+      const temp = {
+        amount: "总金额"
+      };
+      const values = this.data;
+      const months = [];
+      values.forEach(item => {
+        months.push({
+          学校: item.name,
+          总金额: item.amount
+        });
+      });
+      return {
+        columns: ["学校", "总金额"],
+        rows: months
+      };
+    },
+    chartExtend() {
+      return {
+        yAxis: {
+          //纵轴标尺固定
+          minInterval: 1,
+          type: "value",
+          scale: true,
+          min: 0,
+
+          axisLabel: {
+            formatter: "{value}元"
+          },
+          splitLine: {
+            //分割线配置
+            show: true,
+            lineStyle: {
+              color: "#EBEEF5"
+            }
+          }
+        },
+
+        xAxis: {
+          interval: 0,
+          axisLabel: {
+            show: true, // 是否显示刻度标签,默认显示
+            interval: 0, // 坐标轴刻度标签的显示间隔,在类目轴中有效;默认会采用标签不重叠的策略间隔显示标签;可以设置成0强制显示所有标签;如果设置为1,表示『隔一个标签显示一个标签』,如果值为2,表示隔两个标签显示一个标签,以此类推。
+            inside: false, // 刻度标签是否朝内,默认朝外
+            margin: 6 // 刻度标签与轴线之间的距离
+            // rotate: 45
+          }
+        },
+        series: {
+          type: "bar",
+          smooth: false,
+          barWidth: 50
+        },
+        tooltip: {
+          axisPointer: {
+            type: "shadow",
+            shadowStyle: {
+              color: "rgba(150,150,150,0.2)"
+            }
+          },
+          formatter: item => {
+            return [
+              item[0].axisValueLabel,
+              ...item.map(d => {
+                return `<br/>${d.marker}${d.seriesName}: ${d.value}元`;
+              })
+            ].join("");
+          }
+        }
+      };
+    },
+    dataZoom() {
+      return [
+        {
+          show: true,
+          type: "slider",
+          start: 0,
+          end: 20,
+          filterMode: "empty",
+          zoomLock: true,
+          handleSize: 0
+        }
+      ];
+    },
+    dataEmpty() {
+      return !this.chartData.rows.length;
+    }
+  }
+};
+</script>

+ 18 - 19
src/views/main/baseinfo/operate.vue

@@ -75,13 +75,13 @@ export default {
   props: ["data", "search"],
   components: {
     "ve-histogram": veHistogram,
-    "count-to": countTo,
+    "count-to": countTo
   },
   computed: {
     items() {
       let obj = {};
       let arr = ["SCHOOL", "PROGRESS_MUSIC_GROUP_NUM"];
-      arr.forEach((str) => {
+      arr.forEach(str => {
         if (this.data[str]) {
           obj[str] = this.data[str];
         }
@@ -100,10 +100,10 @@ export default {
           axisPointer: {
             type: "shadow",
             shadowStyle: {
-              color: "rgba(150,150,150,0.2)",
-            },
-          },
-        },
+              color: "rgba(150,150,150,0.2)"
+            }
+          }
+        }
       };
     },
     dataZoom() {
@@ -111,8 +111,8 @@ export default {
         {
           type: "slider",
           start: 60,
-          end: 100,
-        },
+          end: 100
+        }
       ];
     },
     chartData() {
@@ -123,28 +123,27 @@ export default {
           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)],
-        rows: Object.values(months),
+        columns: ["日期", ...values.map(item => item.title)],
+        rows: Object.values(months)
       };
     },
     dataEmpty() {
       return !this.chartData.rows.length;
-    },
+    }
   },
   data() {
     return {
-      active: "SCHOOL",
+      active: "SCHOOL"
     };
   },
-  mounted() {
-  },
+  mounted() {},
   methods: {
     init() {
       this.FetchDetail();
@@ -157,7 +156,7 @@ export default {
         const res = await getIndex({
           ...rest,
           ...getTimes(dates, ["startDate", "endDate"]),
-          dataTypes: "TRANSACTION_TEACHER_NUM,SCHOOL,PROGRESS_MUSIC_GROUP_NUM",
+          dataTypes: "TRANSACTION_TEACHER_NUM,SCHOOL,PROGRESS_MUSIC_GROUP_NUM"
         });
         for (const item of res.data) {
           // 再循环一遍
@@ -171,7 +170,7 @@ export default {
           // }
           data[item.dataType] = {
             ...item,
-            desc: descs[item.dataType],
+            desc: descs[item.dataType]
           };
         }
       } catch (error) {
@@ -181,8 +180,8 @@ export default {
 
       // this.dataInfo = data;
       this.$emit("resetDate", data);
-    },
-  },
+    }
+  }
 };
 </script>
 <style lang="less" scoped>

+ 132 - 168
src/views/main/cloudDate/exerciseDuration.vue

@@ -9,11 +9,11 @@
     >
       <el-form-item prop="dates">
         <el-date-picker
-        @change="changeWeek"
-        :closeable ="false"
+          @change="changeWeek"
+          :closeable="false"
           v-model="searchForm.dates"
           value-format="yyyy-MM-dd"
-            :picker-options="{ firstDayOfWeek: 1 }"
+          :picker-options="{ firstDayOfWeek: 1 }"
           type="daterange"
           style="width: 405px"
           range-separator="至"
@@ -29,157 +29,109 @@
       </el-form-item>
     </saveform>
     <!-- 分组添加柱状图  -->
-    <el-tabs v-model="activeName" class="submitTab" >
-    <el-tab-pane label="人数图表" name="first">
-      <ve-histogram
-      v-if="activeName=='first'"
-        style="width: 100%"
-        height="350px"
-        :data="chartData"
-        :data-empty="dataEmpty"
-        :extend="chartExtend"
-        :legend="legend"
-        :data-zoom="dataZoom"
-      ></ve-histogram>
-    </el-tab-pane>
-    <el-tab-pane label="比例图标" name="second" >  <ve-histogram
-      v-if="activeName=='second'"
-        style="width: 100%"
-        height="350px"
-        :data="scaleCharData"
-        :data-empty="dataEmpty"
-        :extend="scalChartExtend"
-        :legend="legend"
-        :data-zoom="dataZoom"
-      ></ve-histogram>
+    <el-tabs v-model="activeName" class="submitTab">
+      <el-tab-pane label="人数图表" name="first">
+        <ve-histogram
+          v-if="activeName == 'first'"
+          style="width: 100%"
+          height="350px"
+          :data="chartData"
+          :data-empty="dataEmpty"
+          :extend="chartExtend"
+          :legend="legend"
+          :data-zoom="dataZoom"
+        ></ve-histogram>
       </el-tab-pane>
-  </el-tabs>
+      <el-tab-pane label="比例图标" name="second">
+        <ve-histogram
+          v-if="activeName == 'second'"
+          style="width: 100%"
+          height="350px"
+          :data="scaleCharData"
+          :data-empty="dataEmpty"
+          :extend="scalChartExtend"
+          :legend="legend"
+          :data-zoom="dataZoom"
+        ></ve-histogram>
+      </el-tab-pane>
+    </el-tabs>
+
+    <el-button
+      type="primary"
+      @click="exportQuestion"
+      style="margin: 16px 0"
+      v-permission="'export/managerDownload/num'"
+      >导出</el-button
+    >
     <div class="tableWrap">
       <el-table
         :data="tableList"
         :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
       >
-        <el-table-column
-          width="120px"
-          align="center"
-          prop="id"
-          label="排名"
-        >
-        <template slot-scope="scope">
-          <div>
-            {{scope.$index+1}}
-          </div>
-        </template>
+        <el-table-column width="120px" align="center" prop="id" label="排名">
+          <template slot-scope="scope">
+            <div>
+              {{ scope.$index + 1 }}
+            </div>
+          </template>
         </el-table-column>
         <el-table-column
           align="center"
           prop="organName"
           label="分部名称"
         ></el-table-column>
-        <el-table-column
-          align="center"
-          prop="normalNum"
-          label="会员人数"
-        >
-        <template slot-scope="scope">
-          <div>
-            {{scope.row.normalNum}}人
-          </div>
-        </template>
+        <el-table-column align="center" prop="normalNum" label="会员人数">
+          <template slot-scope="scope">
+            <div>{{ scope.row.normalNum }}人</div>
+          </template>
         </el-table-column>
-        <el-table-column
-          align="center"
-          prop="trainStudentNum"
-          label="练习人数"
-        >
-        <template slot-scope="scope">
-          <div>
-            {{scope.row.trainStudentNum}}人
-          </div>
-        </template></el-table-column>
-        <el-table-column
-          align="center"
-          prop="trainRate"
-          label="练习率"
+        <el-table-column align="center" prop="trainStudentNum" label="练习人数">
+          <template slot-scope="scope">
+            <div>{{ scope.row.trainStudentNum }}人</div>
+          </template></el-table-column
         >
-        <template slot-scope="scope">
-          <div>
-            {{scope.row.trainRate}}%
-          </div>
-        </template>
+        <el-table-column align="center" prop="trainRate" label="练习率">
+          <template slot-scope="scope">
+            <div>{{ scope.row.trainRate }}%</div>
+          </template>
         </el-table-column>
-        <el-table-column
-          align="center"
-          prop="id"
-          label="≤60分钟"
+        <el-table-column align="center" prop="id" label="≤60分钟">
+          <template slot-scope="scope">
+            <div>{{ scope.row.train1 }}人</div>
+          </template></el-table-column
         >
-        <template slot-scope="scope">
-          <div>
-            {{scope.row.train1}}人
-          </div>
-        </template></el-table-column>
 
-        <el-table-column
-          align="center"
-          prop="id"
-          label="60~120分钟"
-        >
-        <template slot-scope="scope">
-          <div>
-            {{scope.row.train2}}人
-          </div>
-        </template>
+        <el-table-column align="center" prop="id" label="60~120分钟">
+          <template slot-scope="scope">
+            <div>{{ scope.row.train2 }}人</div>
+          </template>
         </el-table-column>
-        <el-table-column
-          align="center"
-          prop="id"
-          label="120~240分钟"
-        >
-        <template slot-scope="scope">
-          <div>
-            {{scope.row.train3}}人
-          </div>
-        </template>
+        <el-table-column align="center" prop="id" label="120~240分钟">
+          <template slot-scope="scope">
+            <div>{{ scope.row.train3 }}人</div>
+          </template>
         </el-table-column>
-        <el-table-column
-          align="center"
-          prop="id"
-          label=">240分钟"
-        >
-        <template slot-scope="scope">
-          <div>
-            {{scope.row.train4}}人
-          </div>
-        </template>
+        <el-table-column align="center" prop="id" label=">240分钟">
+          <template slot-scope="scope">
+            <div>{{ scope.row.train4 }}人</div>
+          </template>
         </el-table-column>
-        <el-table-column
-          align="center"
-          prop="id"
-          label="平均练习时长"
-        >
-        <template slot-scope="scope">
-          <div>
-            {{scope.row.avgTrainTime}}分钟
-          </div>
-        </template>
+        <el-table-column align="center" prop="id" label="平均练习时长">
+          <template slot-scope="scope">
+            <div>{{ scope.row.avgTrainTime }}分钟</div>
+          </template>
         </el-table-column>
-        <el-table-column
-          align="center"
-          prop="id"
-          label="练习达标占比"
-        >
-        <template slot-scope="scope">
-          <div>
-            {{scope.row.trainStandRate}}%
-          </div>
-        </template>
+        <el-table-column align="center" prop="id" label="练习达标占比">
+          <template slot-scope="scope">
+            <div>{{ scope.row.trainStandRate }}%</div>
+          </template>
         </el-table-column>
 
         <el-table-column align="center" label="操作" fixed="right">
           <template slot-scope="scope">
             <el-button
-              v-permission="'employeeInfo/update'"
-              @click="openTypes('update', scope.row)"
+              v-permission="'/exerciseDurationDetail'"
+              @click="onDetail(scope.row)"
               type="text"
               >详情</el-button
             >
@@ -190,13 +142,14 @@
   </div>
 </template>
 <script>
+import { Export } from "@/utils/downLoadFile";
 import saveform from "@/components/save-form";
 import dayjs from "dayjs";
 import histogram from "v-charts/lib/histogram.common";
 import { getNowDateAndMonday, getNowDateAndSunday } from "@/utils/utils";
 import { cloudTeacherNum } from "../api";
-let nowTime = new Date()
-    nowTime =
+let nowTime = new Date();
+nowTime =
   nowTime.getFullYear() +
   "-" +
   (nowTime.getMonth() + 1) +
@@ -212,7 +165,7 @@ export const getTimes = (times, keys = []) => {
   return {};
 };
 export default {
-  components: { saveform,"ve-histogram": histogram, },
+  components: { saveform, "ve-histogram": histogram },
   name: "helpCategory",
   data() {
     return {
@@ -220,21 +173,44 @@ export default {
         dates: []
       },
       tableList: [],
-      activeName:'first'
+      activeName: "first"
     };
   },
   async mounted() {
-
     this.searchForm.dates.push(getNowDateAndMonday(nowTime));
     this.searchForm.dates.push(getNowDateAndSunday(nowTime));
     this.getList();
   },
   methods: {
+    exportQuestion() {
+      const { dates } = this.searchForm;
+      Export(
+        this,
+        {
+          url: "/api-web/export/managerDownload",
+          fileName: "云教练练习时长.xls",
+          method: "post",
+          params: {
+            exportEnum: "EXPORT_CLOUD_TEACHER_SUM",
+            ...getTimes(dates, ["startDate", "endDate"])
+          }
+        },
+        "您确定导出云教练练习时长?"
+      );
+    },
+    onDetail(row) {
+      this.$router.push({
+        path: "/exerciseDurationDetail",
+        query: {
+          organId: row.organId
+        }
+      });
+    },
     search() {
-      this.$refs.searchForm.validate((valid) => {
+      this.$refs.searchForm.validate(valid => {
         this.pageInfo = {
           ...this.pageInfo,
-          page: 1,
+          page: 1
         };
         this.getList();
       });
@@ -242,29 +218,30 @@ export default {
     onReSet() {
       this.pageInfo = {
         ...this.pageInfo,
-        page: 1,
+        page: 1
       };
       this.$refs.searchForm.resetFields();
       this.searchForm.dates.push(getNowDateAndMonday(nowTime));
-    this.searchForm.dates.push(getNowDateAndSunday(nowTime));
+      this.searchForm.dates.push(getNowDateAndSunday(nowTime));
       this.getList();
     },
     getDefaultTime() {
       const dayjs = this.$helpers.dayjs;
       let nowDate = dayjs(new Date()).format("YYYY-MM-DD");
-      let lastWeek = dayjs(nowDate).subtract(1, "week").format("YYYY-MM-DD");
+      let lastWeek = dayjs(nowDate)
+        .subtract(1, "week")
+        .format("YYYY-MM-DD");
       this.searchForm.dates = [
         getNowDateAndMonday(lastWeek),
-        getNowDateAndSunday(nowDate),
+        getNowDateAndSunday(nowDate)
       ];
-
     },
     changeWeek(val) {
       if (val) {
-        this.searchForm.dates  =  [
+        this.searchForm.dates = [
           getNowDateAndMonday(val[0]),
-          getNowDateAndSunday(val[1]),
-        ]
+          getNowDateAndSunday(val[1])
+        ];
       } else {
         this.getDefaultTime();
       }
@@ -297,7 +274,7 @@ export default {
         "train3",
         "train4",
         "buyRate",
-        "avgTrainTime",
+        "avgTrainTime"
       ];
       arr.forEach(str => {
         if (this.dataList[str] + "") {
@@ -311,13 +288,10 @@ export default {
 
       return obj;
     },
-    scaleItems(){
+    scaleItems() {
       let obj = {};
       //        "eVipStudentNum",
-      let arr = [
-        "trainRate",
-        "trainStandRate",
-      ];
+      let arr = ["trainRate", "trainStandRate"];
       arr.forEach(str => {
         if (this.dataList[str] + "") {
           obj[str] = {
@@ -335,11 +309,10 @@ export default {
         left: "10px"
       };
     },
-    scaleCharData(){
+    scaleCharData() {
       const temp = {
         trainRate: "练习率",
-        trainStandRate: "练习达标率",
-
+        trainStandRate: "练习达标率"
       };
       const values = this.tableList;
 
@@ -354,13 +327,9 @@ export default {
           months[item.organName][temp[key]] = item[key] || 0;
         }
       }
-      console.log(months,'months')
+      console.log(months, "months");
       return {
-        columns: [
-          "分部",
-          "练习率",
-          "练习达标率",
-        ],
+        columns: ["分部", "练习率", "练习达标率"],
         rows: Object.values(months)
       };
     },
@@ -370,8 +339,8 @@ export default {
         train1: "<=60分钟",
         train2: "60-120分钟",
         train3: "120-240分钟",
-        train3:">240分钟",
-        avgTrainTime: "平均时长",
+        train3: ">240分钟",
+        avgTrainTime: "平均时长"
       };
       const values = this.tableList;
 
@@ -386,7 +355,7 @@ export default {
           months[item.organName][temp[key]] = item[key] || 0;
         }
       }
-      console.log(months,'months')
+      console.log(months, "months");
       return {
         columns: [
           "分部",
@@ -395,7 +364,7 @@ export default {
           "60-120分钟",
           "120-240分钟",
           ">240分钟",
-          "平均时长",
+          "平均时长"
         ],
         rows: Object.values(months)
       };
@@ -514,8 +483,6 @@ export default {
   display: inline-block;
 }
 
-
-
 ::v-deep .el-tabs__active-bar {
   background-color: transparent !important;
 }
@@ -527,10 +494,7 @@ export default {
 /*去掉切换时el-tab-pane底部的蓝色下划线*/
 ::v-deep .el-tabs__nav-wrap::after {
   background-color: transparent !important;
-
-  }
-
+}
 
 /*去掉tabs底部的下划线*/
-
 </style>

+ 314 - 0
src/views/main/cloudDate/exerciseDurationDetail.vue

@@ -0,0 +1,314 @@
+<template>
+  <div class="m-container">
+    <h2>
+      <el-page-header @back="onCancel" content="练习时长详情"></el-page-header>
+    </h2>
+
+    <div class="m-core">
+      <!-- 搜索标题 -->
+      <saveform
+        :inline="true"
+        ref="searchForm"
+        class="searchForm"
+        :model.sync="searchForm"
+      >
+        <el-form-item prop="dates">
+          <el-select
+            class="multiple"
+            v-model.trim="searchForm.organId"
+            filterable
+            clearable
+            placeholder="请选择分部"
+          >
+            <el-option
+              v-for="(item, index) in selects.branchs"
+              :key="index"
+              :label="item.name"
+              :value="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item prop="dates">
+          <!-- @change="changeWeek" -->
+          <el-date-picker
+            :clearable="false"
+            v-model="searchForm.dates"
+            value-format="yyyy-MM-dd"
+            :picker-options="{
+              firstDayOfWeek: 1,
+              disabledDate(time) {
+                return time.getTime() >= nowIndex;
+              }
+            }"
+            type="daterange"
+            style="width: 405px"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+          >
+          </el-date-picker>
+        </el-form-item>
+
+        <el-form-item>
+          <el-button @click="search" type="danger">搜索</el-button>
+          <el-button @click="onReSet" type="primary">重置</el-button>
+        </el-form-item>
+      </saveform>
+      <!-- 分组添加柱状图  -->
+      <el-button
+        type="primary"
+        @click="exportQuestion"
+        style="margin: 0 0 16px"
+        v-permission="'export/managerDownload/numDetail'"
+        >导出</el-button
+      >
+      <div class="tableWrap">
+        <el-table
+          :data="tableList"
+          :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+        >
+          <el-table-column width="120px" align="center" prop="id" label="排名">
+            <template slot-scope="scope">
+              <div>
+                {{ scope.$index + 1 }}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="teacherName"
+            label="声部老师"
+          ></el-table-column>
+          <el-table-column align="center" prop="normalNum" label="会员人数">
+            <template slot-scope="scope">
+              <div>{{ scope.row.normalNum }}人</div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="trainStudentNum"
+            label="练习人数"
+          >
+            <template slot-scope="scope">
+              <div>{{ scope.row.trainStudentNum }}人</div>
+            </template></el-table-column
+          >
+          <el-table-column align="center" prop="trainRate" label="练习率">
+            <template slot-scope="scope">
+              <div>{{ scope.row.trainRate }}%</div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop="id" label="≤60分钟">
+            <template slot-scope="scope">
+              <div>{{ scope.row.train1 }}人</div>
+            </template></el-table-column
+          >
+
+          <el-table-column align="center" prop="id" label="60~120分钟">
+            <template slot-scope="scope">
+              <div>{{ scope.row.train2 }}人</div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop="id" label="120~240分钟">
+            <template slot-scope="scope">
+              <div>{{ scope.row.train3 }}人</div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop="id" label=">240分钟">
+            <template slot-scope="scope">
+              <div>{{ scope.row.train4 }}人</div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop="id" label="平均练习时长">
+            <template slot-scope="scope">
+              <div>{{ scope.row.avgTrainTime }}分钟</div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop="id" label="练习达标占比">
+            <template slot-scope="scope">
+              <div>{{ scope.row.trainStandRate }}%</div>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+import { Export } from "@/utils/downLoadFile";
+import saveform from "@/components/save-form";
+import dayjs from "dayjs";
+import histogram from "v-charts/lib/histogram.common";
+import { getNowDateAndMonday, getNowDateAndSunday } from "@/utils/utils";
+import { cloudTeacherSumDetail } from "../api";
+let nowTime = new Date();
+nowTime =
+  nowTime.getFullYear() +
+  "-" +
+  (nowTime.getMonth() + 1) +
+  "-" +
+  nowTime.getDate();
+export const getTimes = (times, keys = []) => {
+  if (times && times.length) {
+    return {
+      [keys[0] || "start"]: dayjs(times[0]).format("YYYY-MM-DD"),
+      [keys[1] || "start"]: dayjs(times[1]).format("YYYY-MM-DD")
+    };
+  }
+  return {};
+};
+export default {
+  components: { saveform, "ve-histogram": histogram },
+  name: "helpCategory",
+  data() {
+    return {
+      nowIndex: dayjs(dayjs().format("YYYY-MM-DD")).valueOf(),
+      searchForm: {
+        dates: [
+          dayjs()
+            .subtract(1, "day")
+            .format("YYYY-MM-DD"),
+          dayjs()
+            .subtract(1, "day")
+            .format("YYYY-MM-DD")
+        ],
+        organId: ""
+      },
+      tableList: [],
+      activeName: "first",
+      specialList: []
+    };
+  },
+  async mounted() {
+    const query = this.$route.query;
+    this.searchForm.organId = query.organId ? Number(query.organId) : "";
+    await this.$store.dispatch("setBranchs");
+    const arr = [36, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 52, 54, 56];
+    this.specialList = this.selects.branchs.filter(item => {
+      return arr.indexOf(item.id) == -1;
+    });
+    // this.searchForm.dates.push(getNowDateAndMonday(nowTime));
+    // this.searchForm.dates.push(getNowDateAndSunday(nowTime));
+    this.getList();
+  },
+  methods: {
+    exportQuestion() {
+      const { dates, organId } = this.searchForm;
+      Export(
+        this,
+        {
+          url: "/api-web/export/managerDownload",
+          fileName: "云教练练习时长.xls",
+          method: "post",
+          params: {
+            exportEnum: "EXPORT_CLOUD_TEACHER_SUM_DETAIL",
+            ...getTimes(dates, ["startDate", "endDate"]),
+            organId
+          }
+        },
+        "您确定导出云教练练习时长?"
+      );
+    },
+    search() {
+      this.$refs.searchForm.validate(valid => {
+        this.pageInfo = {
+          ...this.pageInfo,
+          page: 1
+        };
+        this.getList();
+      });
+    },
+    onCancel() {
+      this.$store.dispatch("delVisitedViews", this.$route);
+      this.$router.push({
+        path: "/cloudDate?tabrouter=exerciseDuration"
+      });
+    },
+    onReSet() {
+      this.pageInfo = {
+        ...this.pageInfo,
+        page: 1
+      };
+      this.$refs.searchForm.resetFields();
+      // this.searchForm.dates.push(getNowDateAndMonday(nowTime));
+      // this.searchForm.dates.push(getNowDateAndSunday(nowTime));
+      this.getList();
+    },
+    getDefaultTime() {
+      const dayjs = this.$helpers.dayjs;
+      let nowDate = dayjs(new Date()).format("YYYY-MM-DD");
+      let lastWeek = dayjs(nowDate)
+        .subtract(1, "week")
+        .format("YYYY-MM-DD");
+      this.searchForm.dates = [
+        getNowDateAndMonday(lastWeek),
+        getNowDateAndSunday(nowDate)
+      ];
+    },
+    changeWeek(val) {
+      if (val) {
+        // this.searchForm.dates = [
+        //   getNowDateAndMonday(val[0]),
+        //   getNowDateAndSunday(val[1])
+        // ];
+      } else {
+        this.getDefaultTime();
+      }
+    },
+    async getList() {
+      // cloudTeacherSumDetail
+      try {
+        const { dates, organId } = this.searchForm;
+        let params = {
+          ...getTimes(dates, ["startDate", "endDate"]),
+          organId
+        };
+        const res = await cloudTeacherSumDetail({
+          page: 1,
+          rows: 10,
+          ...params
+        });
+        this.tableList = [];
+        this.tableList = res.data.rows || [];
+      } catch {}
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+::v-deep .el-date-editor.el-input {
+  width: 100% !important;
+}
+::v-deep .el-select {
+  width: 100% !important;
+}
+::v-deep .el-table .cell {
+  display: -webkit-box;
+  overflow: hidden;
+  max-height: 45px;
+  text-overflow: ellipsis;
+  -webkit-line-clamp: 3;
+  -webkit-box-orient: vertical;
+}
+::v-deep .el-dialog__body {
+  padding: 10px 20px;
+}
+.newBand {
+  display: inline-block;
+}
+
+::v-deep .el-tabs__active-bar {
+  background-color: transparent !important;
+}
+::v-deep.el-tabs__nav-wrap {
+  &:after {
+    background-color: transparent !important;
+  }
+}
+/*去掉切换时el-tab-pane底部的蓝色下划线*/
+::v-deep .el-tabs__nav-wrap::after {
+  background-color: transparent !important;
+}
+
+/*去掉tabs底部的下划线*/
+</style>

+ 15 - 5
src/views/main/cloudDate/index.vue

@@ -6,14 +6,24 @@
     </h2>
     <div class="m-core">
       <tab-router @change="changeKey">
-        <el-tab-pane lazy label="数据总览" name="memberList">
+        <el-tab-pane
+          lazy
+          label="数据总览"
+          name="memberList"
+          v-if="permission('/cloudDate/organMemberList')"
+        >
           <organMemberList
-          v-if="activeKey=='memberList'"
+            v-if="activeKey == 'memberList'"
             v-permission="'studentManage/getCloudStudyStudentOverView'"
           />
         </el-tab-pane>
-        <el-tab-pane lazy label="练习时长" name="exerciseDuration">
-          <exerciseDuration  v-if="activeKey=='exerciseDuration'" />
+        <el-tab-pane
+          lazy
+          label="练习时长"
+          name="exerciseDuration"
+          v-if="permission('/cloudDate/exerciseDuration')"
+        >
+          <exerciseDuration v-if="activeKey == 'exerciseDuration'" />
         </el-tab-pane>
       </tab-router>
     </div>
@@ -39,7 +49,7 @@ export default {
   methods: {
     permission,
     changeKey(val) {
-      console.log(val,'val')
+      console.log(val, "val");
       this.activeKey = val;
     }
   }

+ 22 - 12
src/views/main/cloudDate/organMemberList.vue

@@ -68,14 +68,13 @@
 
     <el-card>
       <!-- <headers title="分部数据" :hidenOrgan="true" /> -->
-      <ExportChiose
-        style="margin-top: 16px"
-        ExportEnum="CLOUD_STUDY_STUDENT_OVER_VIEW"
-        :exportData="exporyun"
-        fileName="云教练数据汇总"
-        errorMsg="请选择分部"
-        :isDownList="true"
-      />
+      <el-button
+        type="primary"
+        @click="exportQuestion"
+        style="margin-top: 16px;"
+        v-permission="'export/now/cloudDate'"
+        >导出</el-button
+      >
       <div class="tableWrap">
         <el-table
           style="width: 100%"
@@ -230,7 +229,7 @@
   </div>
 </template>
 <script>
-import ExportChiose from "@/components/Export-chiose";
+// import ExportChiose from "@/components/Export-chiose";
 import pagination from "@/components/Pagination/index";
 import { getOrganMemberList } from "../api";
 import "echarts/lib/component/dataZoom";
@@ -248,8 +247,7 @@ export default {
     headers,
     pagination,
     "ve-histogram": histogram,
-    countTo,
-    ExportChiose
+    countTo
   },
   data() {
     return {
@@ -275,6 +273,18 @@ export default {
     this.getList();
   },
   methods: {
+    exportQuestion() {
+      Export(
+        this,
+        {
+          url: "/api-web/export/now",
+          fileName: "云教练数据汇总.xls",
+          method: "post",
+          params: { exportEnum: "CLOUD_STUDY_STUDENT_OVER_VIEW" }
+        },
+        "您确定导出云教练数据汇总?"
+      );
+    },
     async getList() {
       /**
        * try {
@@ -426,7 +436,7 @@ export default {
           months[item.organId][temp[key]] = item[key] || 0;
         }
       }
-      console.log(months,'months')
+      console.log(months, "months");
       return {
         columns: [
           "分部",