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

chore: 修改证书管理页面

上级 0e7d2610
...@@ -14,6 +14,23 @@ const routes = [ ...@@ -14,6 +14,23 @@ const routes = [
meta: { title: '证书信息' } meta: { title: '证书信息' }
} }
] ]
},
{
path: '/bfi',
component: () => import('@/components/layout/Index.vue'),
props: { sidebar: false },
children: [
{
path: 'cert',
component: () => import('./views/List.vue'),
meta: { title: '证书管理' }
},
{
path: 'cert/details',
component: () => import('./views/Details.vue'),
meta: { title: '证书信息' }
}
]
} }
] ]
......
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
<p v-if="list.length === 0">还未取得证书</p> <p v-if="list.length === 0">还未取得证书</p>
<template v-else> <template v-else>
<div style="margin: 20px" v-for="item in list" :key="item.id"> <div style="margin: 20px" v-for="item in list" :key="item.id">
<img :src="item.url" /> <object :data="item.url" style="width: 100%; height: 860px; object-fit: contain">
<a :href="item.url">{{ item.url }}</a>
</object>
</div> </div>
</template> </template>
</app-card> </app-card>
......
...@@ -5,26 +5,38 @@ ...@@ -5,26 +5,38 @@
<app-student-select v-model="params.personal_name" placeholder="请选择学员" /> <app-student-select v-model="params.personal_name" placeholder="请选择学员" />
</template> --> </template> -->
<template v-slot:filter-class="{ params }"> <template v-slot:filter-class="{ params }">
<app-class-select v-model="params.class_id" placeholder="所属班级" /> <app-class-select v-model="params.class_id" placeholder="所属班级" v-if="hasClassPermission" />
</template> </template>
<template v-slot:filter-cert="{ params }"> <template v-slot:filter-certificateStart="{ params }">
<el-select v-model="params.has_certificate" placeholder="是否取证"> <el-date-picker
<el-option label="已获得" :value="true" /> v-model="params.certificate_start"
<el-option label="未获得" :value="false" /> type="date"
</el-select> value-format="yyyy-MM-dd"
placeholder="开始日期"
style="width: 140px"
>
</el-date-picker>
<span style="padding-left: 10px; color: #606266">-</span>
</template> </template>
<template v-slot:table-img="{ row }"> <template v-slot:filter-certificateEnd="{ params }">
<img :src="row.url" width="120" height="70" /> <el-date-picker
v-model="params.certificate_end"
type="date"
value-format="yyyy-MM-dd"
placeholder="结束日期"
style="width: 140px"
>
</el-date-picker>
</template> </template>
<template v-slot:table-x="{ row }"> <template v-slot:table-x="{ row }">
<router-link <router-link
:to="{ path: '/school/cert/details', query: { id: row.student_id, name: row.personal_name } }" :to="{ path: './cert/details', query: { id: row.student_id, name: row.personal_name } }"
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>
</router-link> </router-link>
</template> </template>
<div class="buttons"> <div class="buttons" v-permission="'menu_certificate_download'">
<a :href="exportUrl" download target="_blank"> <a :href="exportUrl" download target="_blank">
<el-button type="primary" icon="el-icon-download">导出</el-button> <el-button type="primary" icon="el-icon-download">导出</el-button>
</a> </a>
...@@ -47,6 +59,10 @@ export default { ...@@ -47,6 +59,10 @@ export default {
}, },
components: { AppClassSelect }, components: { AppClassSelect },
computed: { computed: {
// 是否有班级权限
hasClassPermission() {
return this.$store.state.permissions.find(item => item.tag === 'menu_class_list')
},
// 列表配置 // 列表配置
tableOptions() { tableOptions() {
return { return {
...@@ -58,11 +74,21 @@ export default { ...@@ -58,11 +74,21 @@ export default {
filters: [ filters: [
{ type: 'input', placeholder: '姓名', prop: 'personal_name' }, { type: 'input', placeholder: '姓名', prop: 'personal_name' },
{ slots: 'filter-class', prop: 'class_id' }, { slots: 'filter-class', prop: 'class_id' },
{ slots: 'filter-cert', prop: 'has_certificate' } {
type: 'select',
placeholder: '是否取证',
prop: 'has_certificate',
options: [
{ label: '已获得', value: true },
{ label: '未获得', value: false }
]
},
{ slots: 'filter-certificateStart', prop: 'certificate_start', label: '取证日期' },
{ slots: 'filter-certificateEnd', prop: 'certificate_end' }
], ],
columns: [ columns: [
{ label: '姓名', align: 'center', prop: 'personal_name' }, { label: '姓名', align: 'center', prop: 'personal_name' },
{ label: '所属班级', align: 'center', prop: 'class_name' }, { label: '所属班级', align: 'center', prop: 'class_name', visible: this.hasClassPermission },
{ label: '所属机构', align: 'center', prop: 'organization_name' }, { label: '所属机构', align: 'center', prop: 'organization_name' },
{ {
label: '是否取证', label: '是否取证',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论