forked from liweijie/education
把工具条横过来,占满一行,数据导入也放到工具条中,不要单独放
This commit is contained in:
@@ -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