forked from liweijie/education
学员权限
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
<!-- ==================== 1. 查询条件区域 ==================== -->
|
<!-- ==================== 1. 查询条件区域 ==================== -->
|
||||||
<el-card shadow="never" class="search-card">
|
<el-card shadow="never" class="search-card">
|
||||||
<el-form :model="queryForm" label-width="90px" inline class="search-form">
|
<el-form :model="queryForm" label-width="90px" inline class="search-form">
|
||||||
<el-form-item label="学号">
|
<el-form-item v-if="!isStudentRole" label="学号">
|
||||||
<el-input v-model="queryForm.xh" placeholder="请输入学号" clearable style="width: 180px" />
|
<el-input v-model="queryForm.xh" placeholder="请输入学号" clearable style="width: 180px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="年度">
|
<el-form-item label="年度">
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
<el-option v-for="item in kbOptions" :key="item.kbh" :label="item.kmc" :value="item.kbh" />
|
<el-option v-for="item in kbOptions" :key="item.kbh" :label="item.kmc" :value="item.kbh" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="班次">
|
<el-form-item v-if="!isStudentRole" label="班次">
|
||||||
<el-select v-model="queryForm.xydbh" placeholder="请选择班次" clearable filterable style="width: 200px">
|
<el-select v-model="queryForm.xydbh" placeholder="请选择班次" clearable filterable style="width: 200px">
|
||||||
<el-option v-for="item in teamOptions" :key="item.xydbh" :label="item.xydmc" :value="item.xydbh" />
|
<el-option v-for="item in teamOptions" :key="item.xydbh" :label="item.xydmc" :value="item.xydbh" />
|
||||||
</el-select>
|
</el-select>
|
||||||
@@ -122,6 +122,13 @@ export default {
|
|||||||
this.handleSearch()
|
this.handleSearch()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
/** 学员角色(后端角色键 STUDENT)隐藏学号/班次查询,仅查看本人成绩 */
|
||||||
|
isStudentRole() {
|
||||||
|
const roles = this.$store.getters.roles
|
||||||
|
return Array.isArray(roles) && roles.includes('STUDENT')
|
||||||
|
}
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.loadKbOptions()
|
this.loadKbOptions()
|
||||||
this.loadTeamOptions()
|
this.loadTeamOptions()
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container student-info-page">
|
<div class="app-container student-info-page">
|
||||||
<!-- ==================== 1. 查询条件区域 ==================== -->
|
<!-- ==================== 1. 查询条件区域 ==================== -->
|
||||||
<el-card shadow="never" class="search-card">
|
<el-card v-if="!isStudentRole" shadow="never" class="search-card">
|
||||||
<el-form :model="searchForm" label-width="110px" class="search-form">
|
<el-form :model="searchForm" label-width="110px" class="search-form">
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<!-- 左栏 -->
|
<!-- 左栏 -->
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
<el-card shadow="never" class="table-card">
|
<el-card shadow="never" class="table-card">
|
||||||
<div class="list-header">
|
<div class="list-header">
|
||||||
<div class="list-title">学员信息列表</div>
|
<div class="list-title">学员信息列表</div>
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增学员</el-button>
|
<el-button v-if="!isStudentRole" type="primary" icon="el-icon-plus" @click="handleAdd">新增学员</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-table v-loading="loading" :data="tableData" class="student-info-table" stripe border>
|
<el-table v-loading="loading" :data="tableData" class="student-info-table" stripe border>
|
||||||
<el-table-column type="index" label="序号" width="70" align="center" />
|
<el-table-column type="index" label="序号" width="70" align="center" />
|
||||||
@@ -472,6 +472,11 @@ export default {
|
|||||||
|
|
||||||
return [...new Set(years)].sort((firstYear, secondYear) => secondYear.localeCompare(firstYear))
|
return [...new Set(years)].sort((firstYear, secondYear) => secondYear.localeCompare(firstYear))
|
||||||
},
|
},
|
||||||
|
/** 学员角色(后端角色键 STUDENT)隐藏条件查询栏与新增学员按钮 */
|
||||||
|
isStudentRole() {
|
||||||
|
const roles = this.$store.getters.roles
|
||||||
|
return Array.isArray(roles) && roles.includes('STUDENT')
|
||||||
|
},
|
||||||
filteredGradesData() {
|
filteredGradesData() {
|
||||||
return this.filterGradesByYear(this.gradesData)
|
return this.filterGradesByYear(this.gradesData)
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user