Browse Source

Merge branch '07/06musicArchives' into test

mo 3 years ago
parent
commit
f4d378a9a9

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

@@ -155,9 +155,15 @@ export const organStudentOverView = (data) => request2({
 })
 
 // 分部老师数据
-
 export const queryMemberStudentData = (data) => request2({
   url: '/api-web/teacher/queryMemberStudentData',
   method: 'get',
   params: data
 })
+
+// 分部排行  organStudentOverView
+export const indexStudentOverView = (data) => request2({
+  url: '/api-web/organStudentOverView',
+  method: 'get',
+  params: data
+})

+ 2 - 1
src/views/main/cloudDate/allDate.vue

@@ -62,9 +62,10 @@ export default {
   computed: {
     items() {
       let obj = {};
+      //        "eVipStudentNum",
       let arr = [
         "vipStudentNum",
-        "eVipStudentNum",
+
         "cloudStudyLivelyStudentNum",
         "newCloudStudyStudentNum",
         "cloudStudyTodayUseStudentNum",

+ 4 - 4
src/views/main/cloudDate/index.vue

@@ -1,9 +1,9 @@
 <template>
   <div>
-    <allDate class="marginBottom20" />
-    <organDate class="marginBottom20"/>
-    <activeUserNum  class="marginBottom20" />
-    <organRanking />
+    <allDate v-permission="'studentManage/getCloudStudyStudentOverView'" class="marginBottom20" />
+    <organDate  v-permission="'studentManage/organStudentOverView'"  class="marginBottom20"/>
+    <activeUserNum  v-permission="'newIndex/clound'"  class="marginBottom20" />
+    <organRanking  v-permission="'organStudentOverView'" />
   </div>
 </template>
 <script>

+ 64 - 12
src/views/main/cloudDate/organDate.vue

@@ -1,13 +1,20 @@
 <template>
   <div>
     <el-card>
-      <headers title="分部数据" :hidenOrgan="true" />
+      <headers title="分部数据" @changeOrgan="changeOrgan" />
+      <el-button
+        type="primary"
+        v-permission="'export/organStudentOverView'"
+        @click="organDateExport"
+        size="mini"
+        >导出</el-button
+      >
       <div class="tableWrap">
         <el-table
           style="width: 100%"
           :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
           :data="tableList"
-           @sort-change="sortChang(val)"
+          @sort-change="sortChang"
         >
           <el-table-column
             align="center"
@@ -112,7 +119,6 @@
           </el-table-column>
           <el-table-column
             sortable="custom"
-
             align="center"
             prop="vipStudentDuty"
             label="付费会员占比"
@@ -138,7 +144,7 @@
               <div>{{ scope.row.vipStudentDuty }}%</div>
             </template>
           </el-table-column>
-          <el-table-column
+          <!-- <el-table-column
             sortable
             align="center"
             prop="eVipStudentNum"
@@ -163,17 +169,22 @@
                 </el-tooltip>
               </div>
             </template>
-          </el-table-column>
+          </el-table-column> -->
 
           <el-table-column align="center" prop="studentId" label="操作">
             <template slot-scope="scope">
               <div>
-                <el-button type="text" @click="gotoDetail(scope.row)">详情</el-button>
+                <auth auths="/organDateDetail">
+                  <el-button type="text" @click="gotoDetail(scope.row)"
+                    >详情</el-button
+                  >
+                </auth>
               </div>
             </template>
           </el-table-column>
         </el-table>
         <pagination
+          :autoScroll="false"
           :total.sync="rules.total"
           :page.sync="rules.page"
           :limit.sync="rules.limit"
@@ -188,6 +199,7 @@
 import headers from "./modals/headers.vue";
 import pagination from "@/components/Pagination/index";
 import { organStudentOverView } from "../api";
+import { Export } from "@/utils/downLoadFile";
 export default {
   components: {
     headers,
@@ -196,6 +208,7 @@ export default {
   data() {
     return {
       tableList: [],
+      organId: "",
       rules: {
         // 分页规则
         limit: 10, // 限制显示条数
@@ -203,6 +216,7 @@ export default {
         total: 0, // 总条数
         page_size: [10, 20, 40, 50], // 选择限制显示条数
       },
+      searchList: {},
     };
   },
   mounted() {
@@ -211,21 +225,56 @@ export default {
   methods: {
     async getList() {
       try {
-        const arr = [36,39,41,42,43,44,45,46,47,48,49,50,52,54,55,56]
-        const res = await organStudentOverView({page:this.rules.page,rows:this.rules.limit});
-        this.tableList= res.data.rows
+        // const arr = [36,39,41,42,43,44,45,46,47,48,49,50,52,54,55,56]
+        const res = await organStudentOverView({
+          page: this.rules.page,
+          rows: this.rules.limit,
+          ...this.searchList,
+          organIds: this.organId,
+        });
+        this.tableList = res.data.rows;
         this.rules.total = res.data.total;
         // console.log(this.tableList)
       } catch (e) {
         console.log(e);
       }
     },
-    sortChang(val){
-      console.log('val',val)
+    sortChang(val) {
+      const dates = {
+        ascending: "ASC",
+        descending: "DESC",
+      };
+      this.searchList = {};
+      if (val.prop && val.order) {
+        this.searchList[val.prop] = dates[val.order];
+      }
+      this.rules.page = 1;
+      this.getList();
     },
     gotoDetail(row) {
       // 跳转到分部数据详情 row.organId
-      this.$router.push({ name: "organDateDetail", params: { organId: row.organId } });
+      this.$router.push({
+        name: "organDateDetail",
+        params: { organId: row.organId },
+      });
+    },
+    changeOrgan(val) {
+      this.organId = val;
+      this.rules.page = 1;
+      this.getList();
+    },
+    organDateExport() {
+      let params = { ...this.searchList, organIds: this.organId };
+      Export(
+        this,
+        {
+          url: "/api-web/export/organStudentOverView",
+          fileName: "分部云教练数据.xls",
+          method: "post",
+          params,
+        },
+        "您确定导出分部云教练数据列表?"
+      );
     },
   },
 };
@@ -237,4 +286,7 @@ export default {
 .titleCell {
   display: inline-block;
 }
+.tableWrap {
+  margin-top: 20px;
+}
 </style>

+ 24 - 9
src/views/main/cloudDate/organDateDetail.vue

@@ -31,10 +31,11 @@
             ></el-option>
           </el-select>
         </el-form-item>
-        <!-- <el-form-item>
-          <el-button native-type="submit" type="primary">搜索</el-button>
-          <el-button native-type="reset" type="danger">重置</el-button>
-        </el-form-item> -->
+        <el-form-item>
+          <!-- <el-button native-type="submit" type="primary">搜索</el-button>
+          <el-button native-type="reset" type="danger">重置</el-button> -->
+          <el-button type="primary" @click="organDateExport" v-permission="'export/organTeacherMemberStudentData'">导出</el-button>
+        </el-form-item>
       </save-form>
       <div class="tableWrap">
         <el-table
@@ -51,25 +52,25 @@
             align="center"
             prop="totalStudentNum"
             label="学员总数"
-            sortable
+
           ></el-table-column>
           <el-table-column
             align="center"
             prop="vipStudentNum"
             label="付费会员数"
-            sortable
+
           ></el-table-column>
           <el-table-column
             align="center"
             prop="eVipStudentNum"
             label="试用会员"
-            sortable
+
           ></el-table-column>
           <el-table-column
             align="center"
             prop="vipStudentDuty"
             label="会员占比"
-            sortable
+
           >
           <template slot-scope="scope">
             <div>
@@ -116,6 +117,7 @@ import { getToken } from "@/utils/auth";
 import pagination from "@/components/Pagination/index";
 import load from "@/utils/loading";
 import organStudentDetail from "./organStudentDetail";
+import { Export } from "@/utils/downLoadFile";
 import { queryMemberStudentData } from "../api";
 export default {
   name: "organDateDetail",
@@ -126,7 +128,7 @@ export default {
         organId: null,
       },
 
-      tableList: [{}],
+      tableList: [],
       organList: [],
       rules: {
         // 分页规则
@@ -177,6 +179,19 @@ export default {
       this.$store.dispatch("delVisitedViews", this.$route);
       this.$router.push({ path: "/main/main?tabrouter=cloudDate" });
     },
+    organDateExport(){
+      let params = { ...this.searchForm,  };
+      Export(
+        this,
+        {
+          url: "/api-web/export/organTeacherMemberStudentData",
+          fileName: "分部云教练数据详情.xls",
+          method: "post",
+          params,
+        },
+        "您确定导出分部云教练数据详情列表?"
+      );
+    },
   },
 };
 </script>

+ 121 - 37
src/views/main/cloudDate/organRanking.vue

@@ -3,14 +3,17 @@
     <el-card>
       <headers title="分部排行" :hidenOrgan="true" />
       <div class="wrap">
+        <el-button type="primary" size="mini" @click="rankingExport" v-permission="'export/cloudStudyStudentOverView'">导出</el-button>
         <div class="chioseBox">
           <el-date-picker
             v-model="date"
+            size="mini"
             type="date"
             value-format="yyyy-MM-dd"
             format="yyyy-MM-dd"
             @change="changeValue"
             :picker-options="bigin()"
+            :clearable="false"
           >
           </el-date-picker>
         </div>
@@ -20,37 +23,59 @@
           style="width: 100%"
           :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
           :data="tableList"
+          @sort-change="sortChang"
         >
-          <el-table-column align="center" prop="studentId" label="排名">
+          <el-table-column align="center" prop="index" label="排名">
           </el-table-column>
           <el-table-column
             align="center"
-            prop="studentId"
+            prop="organName"
             label="分部"
           ></el-table-column>
-
-          <template slot="header" slot-scope="slot">
-            <div class="titleCell">
-              <span>活跃用户</span>
-              <el-tooltip placement="top" popper-class="mTooltip">
-                <div slot="content">当日使用过云教练的用户数量(含试用)</div>
-                <i
-                  class="el-icon-question micon el-tooltip"
-                  style="
-                    font-size: 18px;
-                    color: #f56c6c;
-                    top: 2px;
-                    position: relative;
-                  "
-                ></i>
-              </el-tooltip>
-            </div>
-          </template>
+          <el-table-column
+            align="center"
+            prop="cloudStudyLivelyStudentNum"
+            label="活跃人数"
+          >
+          </el-table-column>
+                 <el-table-column
+            align="center"
+            prop="totalStudentNum"
+            label="学员总数"
+          >
+          </el-table-column>
+          <!--  -->
+          <el-table-column
+            sortable
+            align="center"
+            prop="cloudStudyLivelyStudentDuty"
+            label="活跃人数占比"
+          >
+            <template slot-scope="scope">
+              <div>{{ scope.row.cloudStudyLivelyStudentDuty }}%</div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="cloudStudyUseStudentNum"
+            label="使用人数"
+          >
+          </el-table-column>
+          <el-table-column
+            sortable
+            align="center"
+            prop="cloudStudyUseStudentDuty"
+            label="使用人数占比"
+          >
+            <template slot-scope="scope">
+              <div>{{ scope.row.cloudStudyUseStudentDuty }}%</div>
+            </template>
+          </el-table-column>
 
           <el-table-column
             sortable
             align="center"
-            prop="studentId"
+            prop="vipStudentNum"
             label="付费会员数"
           >
             <template slot="header" slot-scope="slot">
@@ -74,7 +99,17 @@
           <el-table-column
             sortable
             align="center"
-            prop="studentId"
+            prop="vipStudentDuty"
+            label="付费会员占比"
+          >
+            <template slot-scope="scope">
+              <div>{{ scope.row.vipStudentDuty }}%</div>
+            </template>
+          </el-table-column>
+          <!-- <el-table-column
+            sortable
+            align="center"
+            prop="eVipStudentNum"
             label="试用会员"
           >
             <template slot="header" slot-scope="slot">
@@ -94,11 +129,10 @@
                 </el-tooltip>
               </div>
             </template>
-          </el-table-column>
+          </el-table-column> -->
           <el-table-column
-            sortable
             align="center"
-            prop="studentId"
+            prop="newMemberStudentNum"
             label="新增付费会员"
           >
             <template slot="header" slot-scope="slot">
@@ -119,7 +153,7 @@
               </div>
             </template>
           </el-table-column>
-          <el-table-column
+          <!-- <el-table-column
             sortable
             align="center"
             prop="studentId"
@@ -144,9 +178,10 @@
                 </el-tooltip>
               </div>
             </template>
-          </el-table-column>
+          </el-table-column> -->
         </el-table>
         <pagination
+          :autoScroll="false"
           sync
           :total.sync="rules.total"
           :page.sync="rules.page"
@@ -161,7 +196,9 @@
 <script>
 import headers from "./modals/headers.vue";
 import pagination from "@/components/Pagination/index";
-import dayjs from 'dayjs';
+import { Export } from "@/utils/downLoadFile";
+import dayjs from "dayjs";
+import { indexStudentOverView } from "../api";
 export default {
   components: {
     headers,
@@ -170,6 +207,7 @@ export default {
   data() {
     return {
       tableList: [],
+      searchList: {},
       rules: {
         // 分页规则
         limit: 10, // 限制显示条数
@@ -181,11 +219,24 @@ export default {
     };
   },
   mounted() {
-    this.date = dayjs(new Date()).subtract(1, 'day').format('YYYY-MM-DD')
-
+    this.date = dayjs(new Date()).subtract(1, "day").format("YYYY-MM-DD");
+    this.getList();
   },
   methods: {
-    getList() {},
+    async getList() {
+      try {
+        const res = await indexStudentOverView({
+          ...this.searchList,
+          date: this.date,
+          rows: this.rules.limit,
+          page: this.rules.page,
+        });
+        this.tableList = res.data.rows;
+        this.rules.total = res.data.total;
+      } catch (e) {
+        console.log(e);
+      }
+    },
     bigin() {
       let self = this;
       return {
@@ -200,7 +251,36 @@ export default {
         },
       };
     },
-    changeValue(val) {},
+    changeValue(val) {
+      this.date = val;
+      this.rules.page = 1;
+      this.getList();
+    },
+    sortChang(val) {
+      const dates = {
+        ascending: "ASC",
+        descending: "DESC",
+      };
+      this.searchList = {};
+      if (val.prop && val.order) {
+        this.searchList[val.prop] = dates[val.order];
+      }
+      this.rules.page = 1;
+      this.getList();
+    },
+    rankingExport() {
+      let params = { ...this.searchForm ,date:this.date};
+      Export(
+        this,
+        {
+          url: "/api-web/export/cloudStudyStudentOverView",
+          fileName: "分部云教练数据排行.xls",
+          method: "post",
+          params,
+        },
+        "您确定导出分部云教练数据排行?"
+      );
+    },
   },
 };
 </script>
@@ -212,14 +292,18 @@ export default {
   display: inline-block;
 }
 .chioseBox {
-display: flex;
-flex-direction: row;
-align-items: center;
-justify-content: flex-end;
-margin-bottom: 20px;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: flex-end;
 }
 .wrap {
   position: relative;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: space-between;
+  margin-bottom: 20px;
 }
 </style>
 

+ 2 - 2
vue.config.js

@@ -20,8 +20,8 @@ const name = defaultSettings.title || '管乐迷后台管理系统' // page titl
 // let target = 'http://192.168.3.148:8000' //邹璇
 // let target = 'http://192.168.3.112:8000' //勇哥
 // let target = 'http://dev.dayaedu.com' // 开发环境
-// let target = 'https://test.dayaedu.com' //测试环境
-let target = 'http://192.168.3.134:8000' // 乔
+let target = 'https://test.dayaedu.com' //测试环境
+// let target = 'http://192.168.3.134:8000' // 乔
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {
   /**