forked from liweijie/education
把工具条横过来,占满一行,数据导入也放到工具条中,不要单独放
This commit is contained in:
+9
@@ -330,6 +330,15 @@ public class JYSController {
|
||||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 去重职称列表(职称检索下拉数据源,职称无字典表)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('teach:teacher:list')")
|
||||
@GetMapping("/teacher/zc-options")
|
||||
public Result<java.util.List<String>> teacherZcOptions() {
|
||||
return Result.success(facultyService.listDistinctZc());
|
||||
}
|
||||
|
||||
/**
|
||||
* 教员数据文件导入(.xls/.xlsx)
|
||||
* <p>表头顺序:教员编号, 教员姓名, 教研室代号, 职称, 专业技术职务等级, 教员类别,
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.roomroot.jwgl.entity.JYB;
|
||||
import com.roomroot.jwgl.vo.faculty.TeacherListVO;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
@@ -29,6 +30,10 @@ public interface JYBMapper extends BaseMapper<JYB> {
|
||||
/** 教员列表双表联查分页 */
|
||||
Page<TeacherListVO> selectTeacherPageList(Page<TeacherListVO> page, @Param("jyb") JYB cond);
|
||||
|
||||
/** 去重职称列表(教员类别/职称检索下拉数据源,职称无字典表) */
|
||||
@Select("SELECT DISTINCT \"职称\" FROM \"教员表\" WHERE \"职称\" IS NOT NULL AND \"职称\" <> '' ORDER BY \"职称\"")
|
||||
List<String> selectDistinctZc();
|
||||
|
||||
@Select("SELECT TRIM(b.\"教员编号\") FROM \"教员登录表\" b "
|
||||
+ "JOIN \"登录信息表\" a ON TRIM(a.\"编号\") = TRIM(b.\"登录信息编号\") "
|
||||
+ "WHERE LOWER(TRIM(a.\"账号\")) = LOWER(TRIM(#{username})) "
|
||||
|
||||
@@ -84,6 +84,11 @@ public interface FacultyService {
|
||||
*/
|
||||
void enableJYB(String jYBH);
|
||||
|
||||
/**
|
||||
* 去重职称列表(职称检索下拉数据源)
|
||||
*/
|
||||
java.util.List<String> listDistinctZc();
|
||||
|
||||
/**
|
||||
* 更新教员基本信息
|
||||
*/
|
||||
|
||||
+5
@@ -316,6 +316,11 @@ public class FacultyServiceImpl implements FacultyService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.util.List<String> listDistinctZc() {
|
||||
return jybMapper.selectDistinctZc();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateJYB(JYB entity) {
|
||||
|
||||
@@ -56,6 +56,14 @@ export function disableTeacher(jybh) {
|
||||
})
|
||||
}
|
||||
|
||||
/** 去重职称列表(职称检索下拉)GET /jys/teacher/zc-options */
|
||||
export function listTeacherZcOptions() {
|
||||
return request({
|
||||
url: '/jys/teacher/zc-options',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/** 教员复职(还原离职状态)POST /jys/teacher/enable?jybh= */
|
||||
export function enableTeacher(jybh) {
|
||||
return request({
|
||||
|
||||
@@ -485,21 +485,10 @@ body .el-table td.el-table__cell {
|
||||
}
|
||||
|
||||
#app .elective-page .query-card,
|
||||
#app .elective-page .upload-card,
|
||||
#app .elective-page .table-card {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
#app .elective-page .action-card {
|
||||
grid-column: 1;
|
||||
grid-row: 2;
|
||||
}
|
||||
|
||||
#app .elective-page .export-card {
|
||||
grid-column: 2;
|
||||
grid-row: 2;
|
||||
}
|
||||
|
||||
#app .management-page .query-card .q-control,
|
||||
#app .management-page .search-card .q-control {
|
||||
max-width: 520px;
|
||||
|
||||
@@ -56,41 +56,6 @@
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ==================== 3. 导出按钮区域 ==================== -->
|
||||
<div class="section-card export-card">
|
||||
<div class="section-heading section-heading--compact">
|
||||
<div>
|
||||
<h2 class="section-title">数据导出</h2>
|
||||
<p class="section-description">下载选修班及学员名单</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="export-bar">
|
||||
<el-button icon="el-icon-download" @click="handleDownloadList">下载选修班列表</el-button>
|
||||
<el-button icon="el-icon-download" @click="handleDownloadWord">下载选修班学员名单Word</el-button>
|
||||
<el-button icon="el-icon-download" @click="handleDownloadExcel">下载选修班学员名单Excel</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ==================== 5. 文件上传区域 ==================== -->
|
||||
<div class="section-card upload-card">
|
||||
<div class="section-heading section-heading--compact">
|
||||
<div>
|
||||
<h2 class="section-title">数据导入</h2>
|
||||
<p class="section-description">选择填写完成的模板文件并上传</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="upload-row">
|
||||
<div class="upload-left">
|
||||
<el-button icon="el-icon-folder-opened" @click="handleSelectFile">选择文件</el-button>
|
||||
<span class="file-name" :class="{ 'has-file': selectedFile }">{{ fileName }}</span>
|
||||
<input ref="fileInputRef" type="file" style="display: none" @change="handleFileChange" />
|
||||
</div>
|
||||
<div class="upload-right">
|
||||
<el-button type="primary" icon="el-icon-upload2" @click="handleUpload">上传数据</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ==================== 6. 数据表格区域 ==================== -->
|
||||
<div class="section-card table-card">
|
||||
<div class="list-header">
|
||||
@@ -106,6 +71,13 @@
|
||||
<el-button type="danger" plain icon="el-icon-circle-close" @click="handleStopSignup">
|
||||
批量停止报名
|
||||
</el-button>
|
||||
<el-button icon="el-icon-download" @click="handleDownloadList">下载选修班列表</el-button>
|
||||
<el-button icon="el-icon-download" @click="handleDownloadWord">学员名单Word</el-button>
|
||||
<el-button icon="el-icon-download" @click="handleDownloadExcel">学员名单Excel</el-button>
|
||||
<el-button icon="el-icon-folder-opened" @click="handleSelectFile">选择文件</el-button>
|
||||
<span class="file-name" :class="{ 'has-file': selectedFile }">{{ fileName }}</span>
|
||||
<input ref="fileInputRef" type="file" style="display: none" @change="handleFileChange" />
|
||||
<el-button type="primary" plain icon="el-icon-upload2" @click="handleUpload">上传数据</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table v-loading="loading" :data="tableData" border stripe class="main-table" @selection-change="handleSelectionChange">
|
||||
@@ -514,41 +486,6 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.export-bar {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
// ==================== 5. 文件上传区域 ====================
|
||||
.upload-card {
|
||||
.upload-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
|
||||
.upload-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
|
||||
.file-name {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
|
||||
&.has-file {
|
||||
color: #303133;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.upload-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ==================== 6. 数据表格区域 ====================
|
||||
.table-card {
|
||||
.list-header {
|
||||
@@ -581,6 +518,19 @@ export default {
|
||||
.el-button + .el-button {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.file-name {
|
||||
max-width: 180px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
|
||||
&.has-file {
|
||||
color: #303133;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,18 +10,24 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="教研室代号">
|
||||
<el-input v-model="searchForm.jysdh" placeholder="请输入" clearable />
|
||||
<el-form-item label="教研室">
|
||||
<el-select v-model="searchForm.jysdh" placeholder="请选择" clearable filterable style="width:100%">
|
||||
<el-option v-for="o in allOfficeOptions" :key="o.jysdh" :label="o.jysmc + '(' + o.jysdh + ')'" :value="o.jysdh" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="职称">
|
||||
<el-input v-model="searchForm.zc" placeholder="请输入" clearable />
|
||||
<el-select v-model="searchForm.zc" placeholder="请选择" clearable filterable style="width:100%">
|
||||
<el-option v-for="z in zcOptions" :key="z" :label="z" :value="z" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="教员类别">
|
||||
<el-input v-model="searchForm.jylb" placeholder="请输入" clearable />
|
||||
<el-select v-model="searchForm.jylb" placeholder="请选择" clearable filterable style="width:100%">
|
||||
<el-option v-for="item in jylbOptions" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
@@ -731,6 +737,7 @@ import {
|
||||
updateTeacher,
|
||||
disableTeacher,
|
||||
enableTeacher,
|
||||
listTeacherZcOptions,
|
||||
getTeacherAttribute,
|
||||
updateTeacherAttribute,
|
||||
downloadTeacherTemplate,
|
||||
@@ -823,6 +830,8 @@ export default {
|
||||
jylbOptions: [],
|
||||
zzlbOptions: [],
|
||||
dslbOptions: [],
|
||||
zcOptions: [],
|
||||
allOfficeOptions: [],
|
||||
defaultZzlb: '1',
|
||||
// 教研室下拉(新增教员时选择所属教研室)
|
||||
officeOptions: [],
|
||||
@@ -899,6 +908,7 @@ export default {
|
||||
if (hit) this.defaultZzlb = hit.dictValue
|
||||
}).catch(() => {})
|
||||
getDicts('teacher_dslb').then(res => { this.dslbOptions = res.data || [] }).catch(() => {})
|
||||
listTeacherZcOptions().then(res => { this.zcOptions = res.data || [] }).catch(() => {})
|
||||
},
|
||||
|
||||
/** 加载教研室下拉:教员表 [教研室代号] 为非空外键,新增时必须选择 */
|
||||
@@ -909,14 +919,19 @@ export default {
|
||||
const rows = data.records || []
|
||||
const seen = {}
|
||||
const options = []
|
||||
const all = []
|
||||
rows.forEach(row => {
|
||||
const jysdh = row.jysdh
|
||||
// 已停用(ty=1)的教研室不再参与新建教员
|
||||
if (!jysdh || seen[jysdh] || Number(row.ty) === 1) return
|
||||
if (!jysdh || seen[jysdh]) return
|
||||
seen[jysdh] = true
|
||||
options.push({ jysdh, jysmc: row.jysmc || jysdh, bmbh: row.bmbh })
|
||||
const opt = { jysdh, jysmc: row.jysmc || jysdh, bmbh: row.bmbh }
|
||||
all.push(opt)
|
||||
// 已停用(ty=1)的教研室不再参与新建教员
|
||||
if (Number(row.ty) === 1) return
|
||||
options.push(opt)
|
||||
})
|
||||
this.officeOptions = options
|
||||
this.allOfficeOptions = all
|
||||
}).catch(() => {
|
||||
this.officeOptions = []
|
||||
}).finally(() => {
|
||||
|
||||
Reference in New Issue
Block a user