| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372 |
- <template>
- <div>
- <el-card style="margin-bottom: 20px">
- <headers title="数据总览" @changeOrgan="changeOrgan" :special="true"/>
- <div
- class="wall"
- style="height: 68px"
- v-if="JSON.stringify(items) == '{}'"
- >
- 暂无数据
- </div>
- <!--
- -->
- <statistic :col="4" class="statistic" :cols="0">
- <statistic-item
- v-for="(item, key) in items"
- :key="key"
- @click="active = key"
- :class="{ active: active === key }"
- >
- <span v-if="key=='againBuyRate' || key=='buyRate'">
- {{ item.title + "(%)" }}
- <el-tooltip
- v-if="item.desc"
- :content="item.desc"
- :open-delay="0.3"
- placement="top"
- >
- <i
- style="margin-left: 5px; cursor: pointer"
- class="el-icon-warning-outline"
- />
- </el-tooltip>
- </span>
- <span v-else>
- {{ item.title + "(人)" }}
- <el-tooltip
- v-if="item.desc"
- :content="item.desc"
- :open-delay="0.3"
- placement="top"
- >
- <i
- style="margin-left: 5px; cursor: pointer"
- class="el-icon-warning-outline"
- />
- </el-tooltip>
- </span>
- <span v-if="key=='againBuyRate' || key=='buyRate'"> <count-to :endVal="item.percent || 0" :decimals="2" /> </span>
- <span v-else> <count-to :endVal="item.percent || 0" /> </span>
- </statistic-item>
- </statistic>
- </el-card>
- <el-card>
- <headers title="分部数据" :hidenOrgan="true"/>
- <div class="tableWrap">
- <el-table
- style="width: 100%"
- :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
- :data="tableList"
- @sort-change="sortChang"
- :default-sort="{
- prop: 'cloudStudyUseStudentDuty',
- order: 'descending',
- }"
- sortable="custom"
- >
- <el-table-column
- align="center"
- prop="organId"
- label="分部编号"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="organName"
- label="分部名称"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="totalStudentNum"
- label="在读学员总数"
- >
- <!-- <template slot="header" slot-scope="slot">
- <div class="titleCell">
- <span>学员总数</span>
- <el-tooltip placement="top" popper-class="mTooltip">
- <div slot="content">
- 乐团在读学员+有剩余VIP课或网管课学员去重之和
- </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>
- <!-- <el-table-column
- align="center"
- prop="effectiveStudentNum"
- label="有效学员数"
- >
- </el-table-column> -->
- <el-table-column
- align="center"
- prop="vipStudentNum"
- label="会员总人数"
- >
- </el-table-column>
- <el-table-column
- align="center"
- prop="activeStudentNum"
- label="活跃会员"
- >
- <template slot="header" slot-scope="slot">
- <div class="titleCell">
- <span>活跃学员人数</span>
- <el-tooltip placement="top" popper-class="mTooltip">
- <div slot="content">
- 过去四周内有三周及以上每周训练时长超过60分钟为活跃学员
- </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>
- <el-table-column
- align="center"
- prop="effectiveVipStudentNum"
- label="生效中会员人数"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="waitActivateVipStudentNum"
- label="待激活会员人数"
- ></el-table-column>
- <el-table-column
- align="center"
- prop="vipStudentRate"
- label="会员人数占比"
- >
- <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>
- <template slot-scope="scope">
- <div>
- {{ numeral(scope.row.vipStudentRate || 0).format("0.00") }}%
- </div>
- </template>
- </el-table-column>
- <!-- <el-table-column
- align="center"
- prop="totalStudentNum"
- label="今日使用人数"
- ></el-table-column> -->
- </el-table>
- <!-- <pagination
- :autoScroll="false"
- :total.sync="rules.total"
- :page.sync="rules.page"
- :limit.sync="rules.limit"
- :page-sizes="rules.page_size"
- @pagination="getList"
- /> -->
- </div>
- </el-card>
- </div>
- </template>
- <script>
- import pagination from "@/components/Pagination/index";
- import { getOrganMemberList } from "../api";
- import { Export } from "@/utils/downLoadFile";
- import headers from "./modals/headers.vue";
- import countTo from "vue-count-to";
- import { descs, titles } from "../constant";
- import { getCloudStudyStudentOverView } from "../api";
- import numeral from "numeral";
- import qs from "qs";
- export default {
- props: ["data"],
- components: {
- headers,
- pagination,
- countTo,
- },
- data() {
- return {
- tableList: [],
- organId: "",
- rules: {
- // 分页规则
- limit: 10, // 限制显示条数
- page: 1, // 当前页
- total: 0, // 总条数
- page_size: [10, 20, 40, 50], // 选择限制显示条数
- },
- searchList: {
- cloudStudyUseStudentDuty: "DESC",
- },
- tenantId: "",
- dataList: {},
- active: "",
- };
- },
- mounted() {
- this.tenantId = this.$helpers.tenantId;
- this.getList();
- },
- methods: {
- async getList() {
- /**
- * try {
- const res = await getCloudStudyStudentOverView();
- this.dataList = res.data;
- } catch (e) {
- console.log(e);
- }
- */
- try {
- const arr = [
- 36, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 52, 54, 56,
- ];
- const res = await getCloudStudyStudentOverView({
- page: 1,
- rows: 10,
- ...this.searchList,
- organIds: this.organId,
- });
- this.tableList = [];
- // res.data.forEach(ele => {
- // if(arr.indexOf (ele.organId) == -1){
- // this.tableList.push(ele)
- // }
- // });
- this.tableList = res.data.list;
- // this.rules.total = res.data.list?.total;
- this.dataList = res.data?.overView || {};
- // console.log(this.tableList)
- } catch (e) {
- console.log(e);
- }
- },
- 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 },
- });
- },
- 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: qs.stringify(params),
- },
- "您确定导出分部云教练数据列表?"
- );
- },
- gotoAll() {
- this.$router.push({
- name: "organRankDetail",
- });
- },
- numeral(val) {
- return numeral(val);
- },
- },
- computed: {
- items() {
- let obj = {};
- // "eVipStudentNum",
- let arr = [
- "totalStudentNum",
- "buyRate",
- "againBuyRate",
- // "effectiveStudentNum",
- "vipStudentNum",
- "cloudStudyLivelyStudentNum",
- "effectiveVipStudentNum",
- "waitActivateVipStudentNum",
- // "newCloudStudyStudentNum",
- // "vipStudentRate",
- // "cloudStudyUseStudentNum",
- "cloudStudyTodayUseStudentNum",
- ];
- arr.forEach((str) => {
- if (this.dataList[str] + "") {
- obj[str] = {
- title: titles[str],
- percent: this.dataList[str],
- desc: descs[str],
- };
- }
- });
- return obj;
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- ::v-deep .el-card__body {
- padding-top: 0 !important;
- }
- .titleCell {
- display: inline-block;
- }
- .tableWrap {
- margin-top: 20px;
- }
- .btnList {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- }
- </style>
|