|
@@ -1,164 +1,201 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="page-container">
|
|
<div class="page-container">
|
|
|
- <div class="page-header">
|
|
|
|
|
- <h2 class="page-title">学员管理</h2>
|
|
|
|
|
- <div class="page-filters">
|
|
|
|
|
- <el-select v-model="filters.classId" placeholder="班级" clearable style="width:120px;margin-right:8px">
|
|
|
|
|
- <el-option v-for="c in classes" :key="c.id" :label="c.name" :value="c.id" />
|
|
|
|
|
- </el-select>
|
|
|
|
|
- <el-select v-model="filters.role" placeholder="角色" clearable style="width:120px;margin-right:8px">
|
|
|
|
|
|
|
+ <!-- 内容工具栏:新建 / 导入(页头标题由外壳提供) -->
|
|
|
|
|
+ <div class="toolbar">
|
|
|
|
|
+ <div class="toolbar-left">
|
|
|
|
|
+ <el-button type="primary" icon="el-icon-plus" @click="$message.info('新建学员入口')">新建学员</el-button>
|
|
|
|
|
+ <el-button icon="el-icon-upload2" @click="$message.info('导入名单')">导入名单</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="toolbar-right">
|
|
|
|
|
+ <span class="toolbar-count">共 {{ total }} 条记录</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 筛选栏 -->
|
|
|
|
|
+ <div class="card filter-card">
|
|
|
|
|
+ <div class="fr">
|
|
|
|
|
+ <label>姓名 / 编号</label>
|
|
|
|
|
+ <el-input v-model="filters.keyword" placeholder="请输入姓名或学员编号" clearable style="width:240px" @keyup.enter.native="search" />
|
|
|
|
|
+ <label class="fr-label">手机号</label>
|
|
|
|
|
+ <el-input v-model="filters.phone" placeholder="请输入手机号" clearable style="width:240px" @keyup.enter.native="search" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="fr">
|
|
|
|
|
+ <label>角色</label>
|
|
|
|
|
+ <el-select v-model="filters.role" placeholder="全部角色" clearable style="width:200px">
|
|
|
<el-option label="学员" value="student" />
|
|
<el-option label="学员" value="student" />
|
|
|
<el-option label="助教" value="assistant" />
|
|
<el-option label="助教" value="assistant" />
|
|
|
<el-option label="讲师" value="lecturer" />
|
|
<el-option label="讲师" value="lecturer" />
|
|
|
|
|
+ <el-option label="管理员" value="admin" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
- <el-select v-model="filters.status" placeholder="状态" clearable style="width:120px">
|
|
|
|
|
|
|
+ <label class="fr-label">状态</label>
|
|
|
|
|
+ <el-select v-model="filters.status" placeholder="全部状态" clearable style="width:200px">
|
|
|
<el-option label="已激活" value="active" />
|
|
<el-option label="已激活" value="active" />
|
|
|
<el-option label="已禁用" value="banned" />
|
|
<el-option label="已禁用" value="banned" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
- <el-button type="primary" icon="el-icon-search" style="margin-left:8px" @click="fetchList">查询</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" icon="el-icon-search" @click="search" style="margin-left:12px">查询</el-button>
|
|
|
|
|
+ <el-button @click="resetFilters">重置</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <el-table :data="list" v-loading="loading" border stripe style="width:100%">
|
|
|
|
|
- <el-table-column prop="id" label="用户ID" width="100" />
|
|
|
|
|
- <el-table-column prop="name" label="姓名" min-width="120" />
|
|
|
|
|
- <el-table-column prop="phone" label="手机" width="130" />
|
|
|
|
|
- <el-table-column prop="role" label="角色" width="90">
|
|
|
|
|
- <template slot-scope="{ row }">
|
|
|
|
|
- <el-tag :type="roleTagMap[row.role] || 'info'" size="small">{{ roleLabel[row.role] || row.role }}</el-tag>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column prop="groupName" label="分组" width="120" />
|
|
|
|
|
- <el-table-column label="班级" width="120">
|
|
|
|
|
- <template slot-scope="{ row }">
|
|
|
|
|
- {{ classNameOf(row.classId) }}
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column label="校友校验" width="100">
|
|
|
|
|
- <template slot-scope="{ row }">
|
|
|
|
|
- <el-tag :type="alumniType(row.alumniVerify)" size="small">{{ alumniLabel(row.alumniVerify) }}</el-tag>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column prop="status" label="状态" width="90">
|
|
|
|
|
- <template slot-scope="{ row }">
|
|
|
|
|
- <el-tag :type="row.status === 'active' ? 'success' : 'danger'" size="small">{{ row.status === 'active' ? '已激活' : '已禁用' }}</el-tag>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column label="操作" width="280" fixed="right">
|
|
|
|
|
- <template slot-scope="{ row }">
|
|
|
|
|
- <el-button size="mini" type="primary" plain @click="openDetail(row)">详情</el-button>
|
|
|
|
|
- <el-button size="mini" @click="toggleStatus(row)">{{ row.status === 'active' ? '禁用' : '激活' }}</el-button>
|
|
|
|
|
- <el-button size="mini" type="warning" @click="openMoveClass(row)">调整班级</el-button>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- </el-table>
|
|
|
|
|
|
|
+ <!-- 批量操作栏 -->
|
|
|
|
|
+ <div class="batch-bar" v-if="selected.length > 0">
|
|
|
|
|
+ <span>已选中 <b>{{ selected.length }}</b> 名学员 · <span class="link" @click="clearSelection">取消选择</span></span>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <el-button size="mini" @click="$message.info('批量导出')">批量导出</el-button>
|
|
|
|
|
+ <el-button size="mini" @click="$message.info('批量转批次')">批量转批次</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
- <el-pagination
|
|
|
|
|
- v-if="total > pageSize"
|
|
|
|
|
- layout="prev, pager, next, total"
|
|
|
|
|
- :total="total"
|
|
|
|
|
- :page-size="pageSize"
|
|
|
|
|
- :current-page.sync="page"
|
|
|
|
|
- @current-change="fetchList"
|
|
|
|
|
- style="margin-top:16px;text-align:right"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <!-- 表格 -->
|
|
|
|
|
+ <div class="card table-card">
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ :data="list"
|
|
|
|
|
+ v-loading="loading"
|
|
|
|
|
+ style="width:100%"
|
|
|
|
|
+ :row-class-name="rowClass"
|
|
|
|
|
+ @selection-change="onSelectionChange"
|
|
|
|
|
+ @row-click="onRowClick"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-table-column type="selection" width="48" />
|
|
|
|
|
+ <el-table-column label="序号" type="index" width="56" />
|
|
|
|
|
+ <el-table-column prop="name" label="姓名" min-width="140">
|
|
|
|
|
+ <template slot-scope="{ row }"><span class="link" @click.stop="openDetail(row)">{{ row.name }}</span></template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="角色" width="100">
|
|
|
|
|
+ <template slot-scope="{ row }">
|
|
|
|
|
+ <el-tag :type="roleTagMap[row.role] || 'info'" size="small">{{ roleLabel[row.role] || row.role }}</el-tag>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="groupName" label="分组" width="120" />
|
|
|
|
|
+ <el-table-column label="班级" width="130">
|
|
|
|
|
+ <template slot-scope="{ row }">{{ classNameOf(row.classId) }}</template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="校友校验" width="110">
|
|
|
|
|
+ <template slot-scope="{ row }">
|
|
|
|
|
+ <el-tag :type="alumniType(row.alumniVerify)" size="small">{{ alumniLabel(row.alumniVerify) }}</el-tag>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="状态" width="100">
|
|
|
|
|
+ <template slot-scope="{ row }">
|
|
|
|
|
+ <el-tag :type="row.status === 'active' ? 'success' : 'info'" size="small">{{ row.status === 'active' ? '已激活' : '已禁用' }}</el-tag>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="报名时间" width="150">
|
|
|
|
|
+ <template slot-scope="{ row }">{{ row.createdAt || '-' }}</template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="操作" width="150" fixed="right">
|
|
|
|
|
+ <template slot-scope="{ row }">
|
|
|
|
|
+ <span class="link" @click.stop="openDetail(row)">详情</span>
|
|
|
|
|
+ <span class="op-sep">·</span>
|
|
|
|
|
+ <span class="link" @click.stop="toggleStatus(row)">{{ row.status === 'active' ? '禁用' : '激活' }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
|
|
|
-<el-dialog title="调整班级" :visible.sync="moveVisible" width="420px" @closed="moveForm = { uid: null, classId: null }">
|
|
|
|
|
- <el-form label-width="80px">
|
|
|
|
|
- <el-form-item label="学员">
|
|
|
|
|
- <span>{{ moveUserName }}</span>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="目标班级">
|
|
|
|
|
- <el-select v-model="moveForm.classId" placeholder="不选则移出班级(退班)" clearable style="width:100%">
|
|
|
|
|
- <el-option v-for="c in classes" :key="c.id" :label="c.name" :value="c.id" />
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <div class="tips">留空提交即学员退班,将同时清空其报名单班次</div>
|
|
|
|
|
- </el-form>
|
|
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
|
|
- <el-button @click="moveVisible = false">取 消</el-button>
|
|
|
|
|
- <el-button type="primary" :loading="moveSubmitting" @click="handleMoveClass">确 定</el-button>
|
|
|
|
|
- </span>
|
|
|
|
|
- </el-dialog>
|
|
|
|
|
|
|
+ <!-- 空态 / 错误态 -->
|
|
|
|
|
+ <div v-if="!loading && state === 'empty'" class="empty-state">
|
|
|
|
|
+ <div class="empty-ico"></div>
|
|
|
|
|
+ <h4>没有符合条件的学员记录</h4>
|
|
|
|
|
+ <p>可调整姓名、角色或状态后重新筛选</p>
|
|
|
|
|
+ <div class="empty-actions">
|
|
|
|
|
+ <el-button size="small" type="primary" @click="fetchList">重新加载</el-button>
|
|
|
|
|
+ <el-button size="small" @click="resetFilters">返回列表</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div v-if="!loading && state === 'error'" class="error-banner">
|
|
|
|
|
+ <span>学员列表加载失败,请重新加载(已保留输入条件)</span>
|
|
|
|
|
+ <el-button size="mini" @click="fetchList">重试</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
- <!-- 学员详情弹窗 -->
|
|
|
|
|
- <el-dialog :title="'学员详情 - ' + (detailUser && detailUser.name ? detailUser.name : '')" :visible.sync="detailVisible" width="820px" top="6vh">
|
|
|
|
|
- <div v-loading="detailLoading">
|
|
|
|
|
- <div class="detail-section" v-if="detailUser">
|
|
|
|
|
- <h4>基本信息</h4>
|
|
|
|
|
- <el-descriptions :column="3" size="small" border>
|
|
|
|
|
- <el-descriptions-item label="用户ID">{{ detailUser.id }}</el-descriptions-item>
|
|
|
|
|
- <el-descriptions-item label="姓名">{{ detailUser.name }}</el-descriptions-item>
|
|
|
|
|
- <el-descriptions-item label="手机">{{ detailUser.phone || '-' }}</el-descriptions-item>
|
|
|
|
|
- <el-descriptions-item label="角色">{{ roleLabel[detailUser.role] || detailUser.role || '-' }}</el-descriptions-item>
|
|
|
|
|
- <el-descriptions-item label="班级">{{ classNameOf(detailUser.classId) }}</el-descriptions-item>
|
|
|
|
|
- <el-descriptions-item label="分组">{{ detailUser.groupName || '-' }}</el-descriptions-item>
|
|
|
|
|
- <el-descriptions-item label="校友校验">
|
|
|
|
|
- <el-tag :type="alumniType(detailUser.alumniVerify)" size="small">{{ alumniLabel(detailUser.alumniVerify) }}</el-tag>
|
|
|
|
|
- </el-descriptions-item>
|
|
|
|
|
- <el-descriptions-item label="状态">
|
|
|
|
|
- <el-tag :type="detailUser.status === 'active' ? 'success' : 'danger'" size="small">{{ detailUser.status === 'active' ? '已激活' : '已禁用' }}</el-tag>
|
|
|
|
|
- </el-descriptions-item>
|
|
|
|
|
- <el-descriptions-item label="邀请码">{{ detailUser.inviteCode || '-' }}</el-descriptions-item>
|
|
|
|
|
- </el-descriptions>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <el-pagination
|
|
|
|
|
+ v-if="total > pageSize"
|
|
|
|
|
+ layout="prev, pager, next, total"
|
|
|
|
|
+ :total="total"
|
|
|
|
|
+ :page-size="pageSize"
|
|
|
|
|
+ :current-page.sync="page"
|
|
|
|
|
+ @current-change="fetchList"
|
|
|
|
|
+ style="margin-top:16px;text-align:right"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
- <div class="detail-section">
|
|
|
|
|
- <h4>报名单</h4>
|
|
|
|
|
- <el-table :data="detailEnrollments" size="small" border stripe style="width:100%">
|
|
|
|
|
- <el-table-column prop="id" label="ID" width="70" />
|
|
|
|
|
- <el-table-column prop="courseId" label="课程ID" width="80" />
|
|
|
|
|
- <el-table-column label="状态" width="110">
|
|
|
|
|
- <template slot-scope="{ row }">
|
|
|
|
|
- <el-tag :type="enrollStatusType(row.status)" size="small">{{ enrollStatusLabel(row.status) }}</el-tag>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column prop="createdAt" label="报名时间" width="160" />
|
|
|
|
|
- <el-table-column prop="source" label="来源" width="80">
|
|
|
|
|
- <template slot-scope="{ row }">
|
|
|
|
|
- {{ row.source === 'invite' ? '邀请' : '场景' }}
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- </el-table>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <!-- 调整班级弹窗 -->
|
|
|
|
|
+ <el-dialog title="调整班级" :visible.sync="moveVisible" width="420px" @closed="moveForm = { uid: null, classId: null }">
|
|
|
|
|
+ <el-form label-width="80px">
|
|
|
|
|
+ <el-form-item label="学员">
|
|
|
|
|
+ <span>{{ moveUserName }}</span>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="目标班级">
|
|
|
|
|
+ <el-select v-model="moveForm.classId" placeholder="不选则移出班级(退班)" clearable style="width:100%">
|
|
|
|
|
+ <el-option v-for="c in classes" :key="c.id" :label="c.name" :value="c.id" />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <div class="tips">留空提交即学员退班,将同时清空其报名单班次</div>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
|
+ <el-button @click="moveVisible = false">取 消</el-button>
|
|
|
|
|
+ <el-button type="primary" :loading="moveSubmitting" @click="handleMoveClass">确 定</el-button>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
|
|
|
- <div class="detail-section">
|
|
|
|
|
- <h4>卡券</h4>
|
|
|
|
|
- <el-table :data="detailCoupons" size="small" border stripe style="width:100%">
|
|
|
|
|
- <el-table-column prop="id" label="ID" width="70" />
|
|
|
|
|
- <el-table-column prop="type" label="类型" width="90" />
|
|
|
|
|
- <el-table-column prop="code" label="卡券码" min-width="130" />
|
|
|
|
|
- <el-table-column label="状态" width="90">
|
|
|
|
|
- <template slot-scope="{ row }">
|
|
|
|
|
- <el-tag :type="couponStatusType(row.status)" size="small">{{ couponStatusLabel(row.status) }}</el-tag>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column prop="trigger" label="来源" width="90" />
|
|
|
|
|
- <el-table-column prop="grantedAt" label="发放时间" width="160" />
|
|
|
|
|
- </el-table>
|
|
|
|
|
|
|
+ <!-- 学员详情:右侧抽屉(C 类) -->
|
|
|
|
|
+ <el-drawer :visible.sync="detailVisible" size="440px" :with-header="false">
|
|
|
|
|
+ <div class="detail-drawer" v-loading="detailLoading">
|
|
|
|
|
+ <div class="dw-head">
|
|
|
|
|
+ <div class="dw-title">
|
|
|
|
|
+ {{ detailUser && detailUser.name ? detailUser.name : '学员档案' }}
|
|
|
|
|
+ <el-tag size="small" :type="detailUser && detailUser.status === 'active' ? 'success' : 'info'" style="margin-left:8px">{{ detailUser && detailUser.status === 'active' ? '在训' : '已禁用' }}</el-tag>
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
- <div class="detail-section">
|
|
|
|
|
- <h4>完课证书进度(离场验收六项)</h4>
|
|
|
|
|
- <div v-if="detailCert">
|
|
|
|
|
- <el-alert :title="detailCert.eligible ? '已达标:可领取完课证书' : '未达标:完成以下全部项目后可领取证书'" :type="detailCert.eligible ? 'success' : 'warning'" :closable="false" show-icon style="margin-bottom:10px" />
|
|
|
|
|
- <el-table :data="detailCert.items || []" size="small" border stripe style="width:100%">
|
|
|
|
|
- <el-table-column prop="label" label="校验项" min-width="200" />
|
|
|
|
|
- <el-table-column label="状态" width="120">
|
|
|
|
|
|
|
+ <el-button size="mini" @click="detailVisible = false">关闭</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="dw-body">
|
|
|
|
|
+ <el-tabs v-model="detailTab">
|
|
|
|
|
+ <el-tab-pane label="基本信息" name="base">
|
|
|
|
|
+ <div class="kv"><span>学员编号</span><b>XY-{{ detailUser ? String(detailUser.id).padStart(4, '0') : '-' }}</b></div>
|
|
|
|
|
+ <div class="kv"><span>角色</span><b>{{ detailUser ? (roleLabel[detailUser.role] || detailUser.role) : '-' }}</b></div>
|
|
|
|
|
+ <div class="kv"><span>班级</span><b>{{ detailUser ? classNameOf(detailUser.classId) : '-' }}</b></div>
|
|
|
|
|
+ <div class="kv"><span>分组</span><b>{{ detailUser ? (detailUser.groupName || '-') : '-' }}</b></div>
|
|
|
|
|
+ <div class="kv"><span>联系电话</span><b>{{ detailUser ? (maskPhone(detailUser.phone)) : '-' }}</b></div>
|
|
|
|
|
+ <div class="kv"><span>校友校验</span><b><el-tag size="small" :type="detailUser ? alumniType(detailUser.alumniVerify) : 'info'">{{ detailUser ? alumniLabel(detailUser.alumniVerify) : '-' }}</el-tag></b></div>
|
|
|
|
|
+ </el-tab-pane>
|
|
|
|
|
+ <el-tab-pane label="培训记录" name="records">
|
|
|
|
|
+ <h5 class="dw-sec">报名单</h5>
|
|
|
|
|
+ <el-table :data="detailEnrollments" size="small" style="width:100%">
|
|
|
|
|
+ <el-table-column prop="courseId" label="课程ID" width="70" />
|
|
|
|
|
+ <el-table-column label="状态" width="100">
|
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
|
- <el-tag :type="row.ok ? 'success' : 'info'" size="small">{{ row.ok ? '已完成' : '未完成' }}</el-tag>
|
|
|
|
|
|
|
+ <el-tag :type="enrollStatusType(row.status)" size="small">{{ enrollStatusLabel(row.status) }}</el-tag>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
+ <el-table-column prop="createdAt" label="报名时间" width="150" />
|
|
|
</el-table>
|
|
</el-table>
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <h5 class="dw-sec">完课证书进度</h5>
|
|
|
|
|
+ <div v-if="detailCert">
|
|
|
|
|
+ <el-alert :title="detailCert.eligible ? '已达标:可领取完课证书' : '未达标:完成以下全部项目后可领取证书'" :type="detailCert.eligible ? 'success' : 'warning'" :closable="false" show-icon style="margin-bottom:10px" />
|
|
|
|
|
+ <el-table :data="detailCert.items || []" size="small" style="width:100%">
|
|
|
|
|
+ <el-table-column prop="label" label="校验项" min-width="140" />
|
|
|
|
|
+ <el-table-column label="状态" width="90">
|
|
|
|
|
+ <template slot-scope="{ row }">
|
|
|
|
|
+ <el-tag :type="row.ok ? 'success' : 'info'" size="small">{{ row.ok ? '已完成' : '未完成' }}</el-tag>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div v-else class="empty-inline">暂无证书进度</div>
|
|
|
|
|
+ </el-tab-pane>
|
|
|
|
|
+ <el-tab-pane label="来源信息" name="source">
|
|
|
|
|
+ <div class="note">来源信息:<b>管理员可见</b>,仅统计聚合值;后台学员来源统计与学员端零互链,不展示邀请奖励数据。</div>
|
|
|
|
|
+ <div class="kv"><span>来源</span><b>{{ detailUser && detailUser.inviteCode ? '邀请码 ' + detailUser.inviteCode : '自然注册' }}</b></div>
|
|
|
|
|
+ </el-tab-pane>
|
|
|
|
|
+ </el-tabs>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="dw-foot">
|
|
|
|
|
+ <el-button @click="detailVisible = false">取消</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="$message.info('保存资料')">保存资料</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
- <span slot="footer">
|
|
|
|
|
- <el-button @click="detailVisible = false">关 闭</el-button>
|
|
|
|
|
- </span>
|
|
|
|
|
- </el-dialog>
|
|
|
|
|
- </div>
|
|
|
|
|
- </template>
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-drawer>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import { userList, setUserStatus, userDetail } from '@/api/user'
|
|
import { userList, setUserStatus, userDetail } from '@/api/user'
|
|
@@ -170,11 +207,13 @@ export default {
|
|
|
return {
|
|
return {
|
|
|
list: [],
|
|
list: [],
|
|
|
loading: false,
|
|
loading: false,
|
|
|
|
|
+ state: 'normal', // normal / empty / error
|
|
|
total: 0,
|
|
total: 0,
|
|
|
page: 1,
|
|
page: 1,
|
|
|
pageSize: 20,
|
|
pageSize: 20,
|
|
|
- filters: { classId: '', role: '', status: '' },
|
|
|
|
|
|
|
+ filters: { keyword: '', phone: '', role: '', status: '' },
|
|
|
classes: [],
|
|
classes: [],
|
|
|
|
|
+ selected: [],
|
|
|
moveVisible: false,
|
|
moveVisible: false,
|
|
|
moveForm: { uid: null, classId: null },
|
|
moveForm: { uid: null, classId: null },
|
|
|
moveUserName: '',
|
|
moveUserName: '',
|
|
@@ -183,9 +222,9 @@ export default {
|
|
|
roleTagMap: { student: 'info', assistant: 'warning', lecturer: '', admin: 'danger' },
|
|
roleTagMap: { student: 'info', assistant: 'warning', lecturer: '', admin: 'danger' },
|
|
|
detailVisible: false,
|
|
detailVisible: false,
|
|
|
detailLoading: false,
|
|
detailLoading: false,
|
|
|
|
|
+ detailTab: 'base',
|
|
|
detailUser: null,
|
|
detailUser: null,
|
|
|
detailEnrollments: [],
|
|
detailEnrollments: [],
|
|
|
- detailCoupons: [],
|
|
|
|
|
detailCert: null
|
|
detailCert: null
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -202,10 +241,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
classNameOf: function (classId) {
|
|
classNameOf: function (classId) {
|
|
|
if (!classId) return '-'
|
|
if (!classId) return '-'
|
|
|
- var self = this
|
|
|
|
|
- var c = self.classes.find(function (item) {
|
|
|
|
|
- return item.id === classId
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ var c = this.classes.find(function (item) { return item.id === classId })
|
|
|
return c ? c.name : '-'
|
|
return c ? c.name : '-'
|
|
|
},
|
|
},
|
|
|
alumniType: function (v) {
|
|
alumniType: function (v) {
|
|
@@ -228,27 +264,45 @@ export default {
|
|
|
var map = { pending: '待支付', paid: '已支付', reviewing: '进班待审核', confirmed: '已进班', rejected: '进班被拒', cancelled: '已取消' }
|
|
var map = { pending: '待支付', paid: '已支付', reviewing: '进班待审核', confirmed: '已进班', rejected: '进班被拒', cancelled: '已取消' }
|
|
|
return map[s] || s || '-'
|
|
return map[s] || s || '-'
|
|
|
},
|
|
},
|
|
|
- couponStatusType: function (s) {
|
|
|
|
|
- var map = { unused: 'success', used: 'info', expired: 'danger' }
|
|
|
|
|
- return map[s] || 'info'
|
|
|
|
|
|
|
+ maskPhone: function (phone) {
|
|
|
|
|
+ if (!phone) return '-'
|
|
|
|
|
+ var s = String(phone)
|
|
|
|
|
+ if (s.length < 7) return s.slice(0, 3) + '****' + s.slice(-2)
|
|
|
|
|
+ return s.slice(0, 3) + '****' + s.slice(-4)
|
|
|
},
|
|
},
|
|
|
- couponStatusLabel: function (s) {
|
|
|
|
|
- var map = { unused: '未使用', used: '已使用', expired: '已过期' }
|
|
|
|
|
- return map[s] || s || '-'
|
|
|
|
|
|
|
+ search: function () {
|
|
|
|
|
+ this.page = 1
|
|
|
|
|
+ this.fetchList()
|
|
|
|
|
+ },
|
|
|
|
|
+ resetFilters: function () {
|
|
|
|
|
+ this.filters = { keyword: '', phone: '', role: '', status: '' }
|
|
|
|
|
+ this.page = 1
|
|
|
|
|
+ this.fetchList()
|
|
|
|
|
+ },
|
|
|
|
|
+ onSelectionChange: function (rows) {
|
|
|
|
|
+ this.selected = rows
|
|
|
|
|
+ },
|
|
|
|
|
+ clearSelection: function () {
|
|
|
|
|
+ this.selected = []
|
|
|
|
|
+ },
|
|
|
|
|
+ rowClass: function () {
|
|
|
|
|
+ return ''
|
|
|
|
|
+ },
|
|
|
|
|
+ onRowClick: function (row) {
|
|
|
|
|
+ this.openDetail(row)
|
|
|
},
|
|
},
|
|
|
openDetail: function (row) {
|
|
openDetail: function (row) {
|
|
|
var self = this
|
|
var self = this
|
|
|
self.detailVisible = true
|
|
self.detailVisible = true
|
|
|
self.detailLoading = true
|
|
self.detailLoading = true
|
|
|
|
|
+ self.detailTab = 'base'
|
|
|
self.detailUser = row
|
|
self.detailUser = row
|
|
|
self.detailEnrollments = []
|
|
self.detailEnrollments = []
|
|
|
- self.detailCoupons = []
|
|
|
|
|
self.detailCert = null
|
|
self.detailCert = null
|
|
|
userDetail(row.id).then(function (res) {
|
|
userDetail(row.id).then(function (res) {
|
|
|
var data = res.data || {}
|
|
var data = res.data || {}
|
|
|
self.detailUser = data.user || row
|
|
self.detailUser = data.user || row
|
|
|
self.detailEnrollments = data.enrollments || []
|
|
self.detailEnrollments = data.enrollments || []
|
|
|
- self.detailCoupons = data.coupons || []
|
|
|
|
|
self.detailCert = data.cert || null
|
|
self.detailCert = data.cert || null
|
|
|
}).catch(function () {
|
|
}).catch(function () {
|
|
|
self.$message.error('获取学员详情失败')
|
|
self.$message.error('获取学员详情失败')
|
|
@@ -261,13 +315,18 @@ export default {
|
|
|
self.loading = true
|
|
self.loading = true
|
|
|
var params = {}
|
|
var params = {}
|
|
|
if (self.filters.classId) params.classId = self.filters.classId
|
|
if (self.filters.classId) params.classId = self.filters.classId
|
|
|
|
|
+ if (self.filters.keyword) params.keyword = self.filters.keyword
|
|
|
|
|
+ if (self.filters.phone) params.phone = self.filters.phone
|
|
|
if (self.filters.role) params.role = self.filters.role
|
|
if (self.filters.role) params.role = self.filters.role
|
|
|
if (self.filters.status) params.status = self.filters.status
|
|
if (self.filters.status) params.status = self.filters.status
|
|
|
userList(params).then(function (res) {
|
|
userList(params).then(function (res) {
|
|
|
self.list = res.data || []
|
|
self.list = res.data || []
|
|
|
self.total = self.list.length
|
|
self.total = self.list.length
|
|
|
|
|
+ self.state = self.list.length > 0 ? 'normal' : 'empty'
|
|
|
|
|
+ self.selected = []
|
|
|
}).catch(function () {
|
|
}).catch(function () {
|
|
|
self.$message.error('获取学员列表失败')
|
|
self.$message.error('获取学员列表失败')
|
|
|
|
|
+ self.state = 'error'
|
|
|
}).finally(function () {
|
|
}).finally(function () {
|
|
|
self.loading = false
|
|
self.loading = false
|
|
|
})
|
|
})
|
|
@@ -286,10 +345,9 @@ export default {
|
|
|
}).catch(function () {})
|
|
}).catch(function () {})
|
|
|
},
|
|
},
|
|
|
openMoveClass: function (row) {
|
|
openMoveClass: function (row) {
|
|
|
- var self = this
|
|
|
|
|
- self.moveForm = { uid: row.id, classId: row.classId || null }
|
|
|
|
|
- self.moveUserName = row.name
|
|
|
|
|
- self.moveVisible = true
|
|
|
|
|
|
|
+ this.moveForm = { uid: row.id, classId: row.classId || null }
|
|
|
|
|
+ this.moveUserName = row.name
|
|
|
|
|
+ this.moveVisible = true
|
|
|
},
|
|
},
|
|
|
handleMoveClass: function () {
|
|
handleMoveClass: function () {
|
|
|
var self = this
|
|
var self = this
|
|
@@ -309,43 +367,202 @@ export default {
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|
|
|
-.page-header {
|
|
|
|
|
|
|
+.page-container {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ gap: 16px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.toolbar {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
- margin-bottom: 16px;
|
|
|
|
|
- flex-wrap: wrap;
|
|
|
|
|
- gap: 8px;
|
|
|
|
|
|
|
+}
|
|
|
|
|
+.toolbar-count {
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ color: #6B7B8C;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-.page-title {
|
|
|
|
|
- margin: 0;
|
|
|
|
|
- font-size: 18px;
|
|
|
|
|
|
|
+.card {
|
|
|
|
|
+ background: #FFFFFF;
|
|
|
|
|
+ border: 1px solid #DCE7F1;
|
|
|
|
|
+ border-radius: 8px;
|
|
|
|
|
+ box-shadow: 0 2px 10px rgba(30, 58, 95, 0.06);
|
|
|
|
|
+ padding: 16px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.filter-card .fr {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ margin-bottom: 12px;
|
|
|
|
|
+}
|
|
|
|
|
+.filter-card .fr:last-child {
|
|
|
|
|
+ margin-bottom: 0;
|
|
|
|
|
+}
|
|
|
|
|
+.filter-card label {
|
|
|
|
|
+ width: 100px;
|
|
|
|
|
+ flex: none;
|
|
|
|
|
+ text-align: right;
|
|
|
|
|
+ padding-right: 12px;
|
|
|
|
|
+ font-size: 14px;
|
|
|
font-weight: 600;
|
|
font-weight: 600;
|
|
|
|
|
+ color: #1E3A5F;
|
|
|
|
|
+}
|
|
|
|
|
+.filter-card .fr-label {
|
|
|
|
|
+ width: auto;
|
|
|
|
|
+ text-align: left;
|
|
|
|
|
+ padding-left: 16px;
|
|
|
|
|
+ padding-right: 12px;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-.page-filters {
|
|
|
|
|
|
|
+.batch-bar {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
|
|
+ padding: 8px 16px;
|
|
|
|
|
+ background: #E8F3FC;
|
|
|
|
|
+ border: 1px solid #2E6FA8;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ font-size: 13px;
|
|
|
|
|
+ color: #1E3A5F;
|
|
|
|
|
+}
|
|
|
|
|
+.batch-bar b {
|
|
|
|
|
+ color: #2E6FA8;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.link {
|
|
|
|
|
+ color: #2E6FA8;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+}
|
|
|
|
|
+.op-sep {
|
|
|
|
|
+ color: #C3D2DF;
|
|
|
|
|
+ margin: 0 6px;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.tips {
|
|
.tips {
|
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
|
- color: #909399;
|
|
|
|
|
|
|
+ color: #6B7B8C;
|
|
|
margin-top: 8px;
|
|
margin-top: 8px;
|
|
|
line-height: 1.4;
|
|
line-height: 1.4;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-.detail-section {
|
|
|
|
|
- margin-bottom: 20px;
|
|
|
|
|
|
|
+.empty-state {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ gap: 10px;
|
|
|
|
|
+ padding: 40px 0;
|
|
|
|
|
+}
|
|
|
|
|
+.empty-ico {
|
|
|
|
|
+ width: 60px;
|
|
|
|
|
+ height: 60px;
|
|
|
|
|
+ border-radius: 50%;
|
|
|
|
|
+ background: #E8F3FC;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+}
|
|
|
|
|
+.empty-ico::after {
|
|
|
|
|
+ content: '';
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ left: 17px;
|
|
|
|
|
+ top: 17px;
|
|
|
|
|
+ width: 26px;
|
|
|
|
|
+ height: 26px;
|
|
|
|
|
+ border: 3px solid #0F766E;
|
|
|
|
|
+ border-radius: 5px;
|
|
|
|
|
+}
|
|
|
|
|
+.empty-state h4 {
|
|
|
|
|
+ font-size: 16px;
|
|
|
|
|
+ color: #1E3A5F;
|
|
|
|
|
+ margin: 0;
|
|
|
|
|
+}
|
|
|
|
|
+.empty-state p {
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ color: #6B7B8C;
|
|
|
|
|
+ margin: 0;
|
|
|
|
|
+}
|
|
|
|
|
+.empty-actions {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ gap: 8px;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-.detail-section h4 {
|
|
|
|
|
- margin: 0 0 10px;
|
|
|
|
|
|
|
+.error-banner {
|
|
|
|
|
+ background: #FDE8E8;
|
|
|
|
|
+ border: 1px solid #C0392B;
|
|
|
|
|
+ color: #C0392B;
|
|
|
|
|
+ padding: 10px 14px;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ margin-top: 12px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.detail-drawer {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+}
|
|
|
|
|
+.dw-head {
|
|
|
|
|
+ height: 56px;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ padding: 0 20px;
|
|
|
|
|
+ border-bottom: 1px solid #DCE7F1;
|
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
|
+}
|
|
|
|
|
+.dw-title {
|
|
|
|
|
+ font-size: 16px;
|
|
|
|
|
+ font-weight: 700;
|
|
|
|
|
+ color: #1E3A5F;
|
|
|
|
|
+}
|
|
|
|
|
+.dw-body {
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ overflow: auto;
|
|
|
|
|
+ padding: 16px 20px;
|
|
|
|
|
+}
|
|
|
|
|
+.dw-sec {
|
|
|
|
|
+ font-size: 13px;
|
|
|
font-weight: 600;
|
|
font-weight: 600;
|
|
|
color: #1E3A5F;
|
|
color: #1E3A5F;
|
|
|
border-left: 3px solid #2E6FA8;
|
|
border-left: 3px solid #2E6FA8;
|
|
|
padding-left: 8px;
|
|
padding-left: 8px;
|
|
|
|
|
+ margin: 16px 0 10px;
|
|
|
|
|
+}
|
|
|
|
|
+.kv {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ line-height: 40px;
|
|
|
|
|
+ border-bottom: 1px solid #DCE7F1;
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+}
|
|
|
|
|
+.kv span {
|
|
|
|
|
+ width: 100px;
|
|
|
|
|
+ color: #6B7B8C;
|
|
|
|
|
+ flex: none;
|
|
|
|
|
+}
|
|
|
|
|
+.note {
|
|
|
|
|
+ background: #E8F3FC;
|
|
|
|
|
+ border-left: 3px solid #2E6FA8;
|
|
|
|
|
+ padding: 8px 12px;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ color: #3B5A78;
|
|
|
|
|
+ margin-bottom: 12px;
|
|
|
|
|
+}
|
|
|
|
|
+.dw-foot {
|
|
|
|
|
+ height: 64px;
|
|
|
|
|
+ border-top: 1px solid #DCE7F1;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: flex-end;
|
|
|
|
|
+ gap: 8px;
|
|
|
|
|
+ padding: 0 20px;
|
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
|
+}
|
|
|
|
|
+.empty-inline {
|
|
|
|
|
+ font-size: 13px;
|
|
|
|
|
+ color: #6B7B8C;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ padding: 20px 0;
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|