提交 0005ac5b authored 作者: pengxiaohui's avatar pengxiaohui

update: 人员列表增加签到状态筛选条件

上级 9c1e3c3f
......@@ -68,7 +68,7 @@
:visible.sync="personDrawerVisible"
:close-on-click-modal="false"
:destroy-on-close="true"
size="1100px"
size="1150px"
top="15px"
@close="handleClose">
<person-list :id="selectedActivity.id" />
......
......@@ -12,12 +12,18 @@
<el-option label="邮箱" value="email"></el-option>
</el-select>
</template>
<template v-slot:filter-status="{ params }">
<el-select v-model="params.sign_in_status" placeholder="请选择类型" size="small" clearable>
<el-option label="已签到" :value="1"></el-option>
<el-option label="未签到" :value="0"></el-option>
</el-select>
</template>
<template #footer>
<div style="font-size:14px;">
已选中 {{multipleSelection.length}}
<el-button style="margin:0 15px;" size="mini" :disabled="!multipleSelection.length" @click="handleRemove">删除</el-button>
<!-- <el-button size="mini" :disabled="!multipleSelection.length" @click="exportSelected">导出</el-button> -->
<el-dropdown size="small" @command="handleCommand">
<el-button size="mini" @click="fetchExportStudentList">{{multipleSelection.length ? '导出选中项' : '导出全部'}}</el-button>
<!-- <el-dropdown size="small" @command="handleCommand">
<el-button type="primary" size="mini">
导出<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
......@@ -25,7 +31,7 @@
<el-dropdown-item command="all">导出全部</el-dropdown-item>
<el-dropdown-item command="selected" :disabled="!multipleSelection.length">导出选中项</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-dropdown> -->
<el-button style="margin-left:15px;" size="mini" :disabled="!multipleSelection.length" @click="fetchBatchSignin(1)">标记为已签到</el-button>
<el-button style="margin-left:15px;" size="mini" :disabled="!multipleSelection.length" @click="fetchBatchSignin(0)">取消签到</el-button>
</div>
......@@ -87,7 +93,8 @@ export default {
},
filters: [
{ prop: 'type', slots: 'filter-type' },
{ type: 'input', placeholder: '请输入', prop: 'key', size: 'small' }
{ type: 'input', placeholder: '请输入', prop: 'key', size: 'small' },
{ prop: 'sign_in_status', slots: 'filter-status' },
],
columns: [
{ type: 'selection', minWidth: '50px', fixed: 'left' },
......@@ -101,12 +108,12 @@ export default {
{
prop: 'sign_in_status',
label: '签到状态',
minWidth: '80px',
minWidth: '70px',
computed({ row }) {
return row.sign_in_status === 0 ? '未签到' : '已签到'
}
},
{ prop: 'sign_in_time', label: '签到时间', minWidth: '130px' }
{ prop: 'sign_in_time', label: '签到时间', minWidth: '150px' }
]
}
}
......@@ -237,9 +244,16 @@ export default {
},
fetchExportStudentList() {
const params = {}
console.log(this.tableOptions.remote.params)
if (this.tableOptions.remote.params.key) {
params[this.tableOptions.remote.params.type] = this.tableOptions.remote.params.key
}
if (this.tableOptions.remote.params.sign_in_status !== '') {
params.sign_in_status = this.tableOptions.remote.params.sign_in_status
}
if (this.multipleSelection.length > 0) {
params.ids = this.multipleSelection.map(item => item.id)
}
exportStudents(this.id, params).then(res => {
if (res && res.type === 'text/xlsx') {
const url = URL.createObjectURL(res)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论