You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

135 lines
3.1 KiB

3 years ago
<template>
<div>
2 years ago
<div class="title">最新上传</div>
<xy-table :height="300" :action="index" :req-opt="select1" :table-item="table"></xy-table>
3 years ago
2 years ago
<div class="title">热门文件</div>
<xy-table :height="300" :action="index" :req-opt="select2" :table-item="table"></xy-table>
3 years ago
</div>
</template>
<script>
2 years ago
import { index } from '@/api/system/baseForm'
3 years ago
export default {
data() {
return {
2 years ago
select1: {
table_name: 'materials',
sort_name: 'created_at',
sort_type: 'desc'
},
select2: {
table_name: 'materials',
sort_name: 'dianjiliang',
sort_type: 'desc'
},
table: [
{
type: 'index',
width: 60
3 years ago
},
2 years ago
{
label: '文件',
width: 180,
customFn: row => {
return (
2 years ago
<div>{(row?.nianfen && row?.wenjian && row?.bianhao) ? `${row.nianfen} | ${row.wenjian} | ${row.bianhao}` : ''}</div>
2 years ago
)
3 years ago
}
},
2 years ago
{
label: '标题',
prop: 'biaoti',
width: 140
3 years ago
},
2 years ago
{
label: '类型',
prop: 'leixing',
width: 140,
formatter: (data, row, val) => {
let map = new Map([
[1,'流程文件'],
[2,'表单文件'],
[3,'岗位工作及标准'],
[4,'部门工作职责'],
[5,'规章制度管理']
])
return map.get(val)
}
3 years ago
},
2 years ago
{
label: '审核部门',
prop: 'id_material_shenhebumen_depts_material_id_relation.name',
width: 140
3 years ago
},
2 years ago
{
label: '标签',
minWidht: 180,
align: 'left',
customFn:row => {
return (
<div>{
row.id_material_biaoqian_tags_material_id_relation.map(i => {
return (
<span style="padding-left: 10px;">{ i.mingcheng }</span>
)
})
}</div>
)
}
3 years ago
},
2 years ago
{
label: '文件',
minWidht: 200,
align: 'left',
customFn:row => {
return (
<div>{
row.id_material_fujian_uploads_material_id_relation.map(i => {
return (
<a href={i.url} download={i.name} class="uploaded-a" style="padding-left: 10px;">{ i.name }</a>
)
})
}</div>
)
3 years ago
}
2 years ago
}
]
3 years ago
}
},
2 years ago
methods: {
index,
},
3 years ago
created() {
},
mounted() {
},
destroyed() {
}
}
</script>
<style lang="scss" scoped>
2 years ago
.title {
font-weight: 600;
font-size: 16px;
letter-spacing: 1px;
3 years ago
2 years ago
padding: 10px 4px;
3 years ago
}
2 years ago
.uploaded-a {
color: red;
text-decoration: none;
transition: all 0.2s;
}
3 years ago
2 years ago
.uploaded-a:hover {
color: red;
text-decoration: underline;
3 years ago
}
2 years ago
4 years ago
</style>