提交 21db2050 authored 作者: 王鹏飞's avatar 王鹏飞

updates

上级 d0b5f259
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div class="table-list-filter" v-if="filters.length"> <div class="table-list-filter" v-if="filters.length">
<el-form :inline="true" :model="params" ref="filterForm" label-width="110px"> <el-form :inline="true" :model="params" ref="filterForm" label-width="110px">
<template v-for="item in filters"> <template v-for="item in filters">
<el-form-item :label="item.label" :prop="item.prop" :key="item.prop"> <el-form-item :label="item.label" :prop="item.prop" :key="item.prop" v-if="visible(item)">
<template v-if="item.slots"> <template v-if="item.slots">
<slot :name="item.slots" v-bind="{ params }"></slot> <slot :name="item.slots" v-bind="{ params }"></slot>
</template> </template>
......
...@@ -22,7 +22,7 @@ const routes = [ ...@@ -22,7 +22,7 @@ const routes = [
children: [ children: [
{ {
path: 'cert', path: 'cert',
component: () => import('./views/List.vue'), component: () => import('./views/BFIList.vue'),
meta: { title: '证书管理' } meta: { title: '证书管理' }
}, },
{ {
......
<template>
<app-card>
<app-list v-bind="tableOptions" ref="list">
<template v-slot:filter-certificateStart="{ params }">
<el-date-picker
v-model="params.certificate_start"
type="date"
value-format="yyyy-MM-dd"
placeholder="开始日期"
style="width: 140px"
>
</el-date-picker>
<span style="padding-left: 10px; color: #606266">-</span>
</template>
<template v-slot:filter-certificateEnd="{ params }">
<el-date-picker
v-model="params.certificate_end"
type="date"
value-format="yyyy-MM-dd"
placeholder="结束日期"
style="width: 140px"
>
</el-date-picker>
</template>
<template v-slot:table-x="{ row }">
<router-link
:to="{ path: './cert/details', query: { id: row.student_id, name: row.personal_name } }"
target="_blank"
v-permission="'menu_certificate_view'"
>
<el-button type="primary" size="mini" plain>查看</el-button>
</router-link>
</template>
<div class="buttons" v-permission="'menu_certificate_download'">
<a :href="exportUrl" download target="_blank">
<el-button type="primary" icon="el-icon-download">导出</el-button>
</a>
<span style="font-size: 12px; padding: 0 10px; color: #606266">导出当前搜索结果</span>
</div>
</app-list>
</app-card>
</template>
<script>
import { getCertList } from '../api'
import queryString from 'query-string'
export default {
data() {
return {
listParams: {}
}
},
computed: {
// 是否有班级权限
hasClassPermission() {
return this.$store.state.permissions.find(item => item.tag === 'menu_class_list')
},
// 列表配置
tableOptions() {
return {
remote: {
httpRequest: getCertList,
beforeRequest: this.beforeRequest,
params: { personal_name: '', class_id: '', has_certificate: '' }
},
filters: [
{ type: 'input', placeholder: '姓名', prop: 'personal_name', label: '姓名' },
{ slots: 'filter-certificateStart', prop: 'certificate_start', label: '取证日期' },
{ slots: 'filter-certificateEnd', prop: 'certificate_end' }
],
columns: [
{ label: '姓名', align: 'center', prop: 'personal_name' },
{ label: '所属机构', align: 'center', prop: 'organization_name' },
{ label: '身份证号码', align: 'center', prop: 'id_number' },
{ label: '取证时间', align: 'center', prop: 'certificate_created_time' },
{ label: '操作', slots: 'table-x', align: 'center', width: '220', fixed: 'right' }
]
}
},
// 导出地址
exportUrl() {
const query = queryString.stringify(this.listParams)
return import.meta.env.VITE_BASE_URL + '/api/zy-admin/school/certificate/download?' + query
}
},
methods: {
beforeRequest(params) {
this.listParams = { ...params }
return params
}
}
}
</script>
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<template v-slot:table-x="{ row }"> <template v-slot:table-x="{ row }">
<router-link <router-link
:to="{ path: './cert/details', query: { id: row.student_id, name: row.personal_name } }" :to="{ path: './cert/details', query: { id: row.student_id, name: row.personal_name } }"
target="_blank"
v-permission="'menu_certificate_view'" v-permission="'menu_certificate_view'"
> >
<el-button type="primary" size="mini" plain>查看</el-button> <el-button type="primary" size="mini" plain>查看</el-button>
...@@ -81,7 +82,8 @@ export default { ...@@ -81,7 +82,8 @@ export default {
options: [ options: [
{ label: '已获得', value: true }, { label: '已获得', value: true },
{ label: '未获得', value: false } { label: '未获得', value: false }
] ],
visible: this.hasClassPermission
}, },
{ slots: 'filter-certificateStart', prop: 'certificate_start', label: '取证日期' }, { slots: 'filter-certificateStart', prop: 'certificate_start', label: '取证日期' },
{ slots: 'filter-certificateEnd', prop: 'certificate_end' } { slots: 'filter-certificateEnd', prop: 'certificate_end' }
...@@ -90,9 +92,11 @@ export default { ...@@ -90,9 +92,11 @@ export default {
{ label: '姓名', align: 'center', prop: 'personal_name' }, { label: '姓名', align: 'center', prop: 'personal_name' },
{ label: '所属班级', align: 'center', prop: 'class_name', visible: this.hasClassPermission }, { label: '所属班级', align: 'center', prop: 'class_name', visible: this.hasClassPermission },
{ label: '所属机构', align: 'center', prop: 'organization_name' }, { label: '所属机构', align: 'center', prop: 'organization_name' },
{ label: '身份证号码', align: 'center', prop: 'id_number' },
{ {
label: '是否取证', label: '是否取证',
align: 'center', align: 'center',
visible: this.hasClassPermission,
computed({ row }) { computed({ row }) {
return row.has_certificate ? '已获得' : '未获得' return row.has_certificate ? '已获得' : '未获得'
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论