|
@@ -27,28 +27,32 @@
|
|
|
<div class="management-content-middle">
|
|
|
<el-table :data="filesList" ref="fileTableRef" size="large" style="width: 99% ;">
|
|
|
<el-table-column type="selection" width="35" />
|
|
|
- <el-table-column label="#" prop="index" width="60" />
|
|
|
+ <el-table-column label="#" prop="index" width="50" />
|
|
|
<el-table-column prop="file_name" min-width="150" label="标题">
|
|
|
<template #default="{ row }">
|
|
|
<div class="list-name">
|
|
|
<span class="icon-area">
|
|
|
<i :class="`${row.file_type}-icon file-icon`"></i>
|
|
|
</span>
|
|
|
- <span @click="handleViewFile(row.minio_url, row.file_type)" class="text-area">
|
|
|
+ <span @click="handleViewFile(row.minio_url, row.file_type, row.file_name)" class="text-area">
|
|
|
{{ row.file_name }}
|
|
|
</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="knowledge_type" label="知识类型" />
|
|
|
+ <el-table-column prop="knowledge_type" label="知识类型">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-text line-clamp="1" style="vertical-align: bottom;">{{ row.knowledge_type }}</el-text>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column prop="version" label="版本" />
|
|
|
<el-table-column prop="author" label="作者(主编)" min-width="90" />
|
|
|
- <el-table-column prop="year" label="年份" min-width="70" />
|
|
|
+ <el-table-column prop="year" label="年份" min-width="60" />
|
|
|
<el-table-column prop="creator" label="上传人" />
|
|
|
- <el-table-column prop="created_at" label="上传时间" width="170" />
|
|
|
- <el-table-column prop="" label="状态" min-width="100">
|
|
|
+ <el-table-column prop="created_at" label="上传时间" width="155" />
|
|
|
+ <el-table-column prop="" label="状态" min-width="70">
|
|
|
<template #default="{ row, $index }">
|
|
|
- <div style="display:flex; align-items: center;gap: 10px;">
|
|
|
+ <div class="status">
|
|
|
<span v-if="row.status">
|
|
|
<i class="circle" type="success"></i>
|
|
|
<el-text type="success">可用</el-text>
|
|
@@ -65,7 +69,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="created_at" label="下载" width="64">
|
|
|
+ <el-table-column prop="created_at" label="下载" width="50">
|
|
|
<template #default="{ row }">
|
|
|
<div style="text-align: center;">
|
|
|
<i class="document-download-icon" :disabled="row.status ? true : false"
|
|
@@ -113,7 +117,7 @@
|
|
|
import { saveAs } from 'file-saver'
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
import { ref, getCurrentInstance, computed, watch, toRaw, onMounted } from 'vue'
|
|
|
-import { Download, Search } from '@element-plus/icons-vue'
|
|
|
+import { Search } from '@element-plus/icons-vue'
|
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
|
import axios from 'axios';
|
|
|
import { api } from '@/utils/config';
|
|
@@ -212,10 +216,11 @@ function handleEditFile(data) {
|
|
|
editKBFileData.value.data = data;
|
|
|
}
|
|
|
|
|
|
-const handleViewFile = (url, type) => {
|
|
|
+const handleViewFile = (url, type, name) => {
|
|
|
viewFileData.value.show = true;
|
|
|
viewFileData.value.url = url;
|
|
|
viewFileData.value.type = type
|
|
|
+ viewFileData.value.name = name
|
|
|
// console.log(viewFileData.value)
|
|
|
}
|
|
|
function handleDownloadFile(file_url, file_name, status = true) {
|
|
@@ -398,7 +403,11 @@ onMounted(() => {
|
|
|
|
|
|
:deep(.el-table) {
|
|
|
min-width: 0px;
|
|
|
- max-width: 100%;
|
|
|
+ max-width: auto;
|
|
|
+
|
|
|
+ .cell {
|
|
|
+ padding: 0px 8px;
|
|
|
+ }
|
|
|
|
|
|
.document-download-icon {
|
|
|
width: 28px;
|
|
@@ -422,13 +431,20 @@ onMounted(() => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ .status {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 10px;
|
|
|
+ white-space: nowrap;
|
|
|
+ }
|
|
|
+
|
|
|
.circle {
|
|
|
border-radius: 50%;
|
|
|
width: 10px;
|
|
|
height: 10px;
|
|
|
background-color: #8AD068;
|
|
|
display: inline-block;
|
|
|
- margin-right: 10px;
|
|
|
+ margin-right: 7px;
|
|
|
|
|
|
&:is([type='warning']) {
|
|
|
background-color: #E6A23C;
|