|
@@ -3,23 +3,15 @@
|
|
|
<el-card>
|
|
<el-card>
|
|
|
<el-row :gutter="16" style="margin-bottom:16px">
|
|
<el-row :gutter="16" style="margin-bottom:16px">
|
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
|
- <el-card shadow="never" class="stat-card">
|
|
|
|
|
- <div class="stat-value">{{ stats.total || 0 }}</div>
|
|
|
|
|
- <div class="stat-label">总文件数</div>
|
|
|
|
|
- </el-card>
|
|
|
|
|
|
|
+ <StatCard label="总文件数" :value="stats.total || 0" />
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
|
- <el-card shadow="never" class="stat-card">
|
|
|
|
|
- <div class="stat-value">{{ formatSize(stats.totalBytes || 0) }}</div>
|
|
|
|
|
- <div class="stat-label">总大小</div>
|
|
|
|
|
- </el-card>
|
|
|
|
|
|
|
+ <StatCard label="总大小" :value="formatSize(stats.totalBytes || 0)" />
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
<el-card shadow="never" class="stat-card">
|
|
<el-card shadow="never" class="stat-card">
|
|
|
<div style="display:flex;gap:12px;flex-wrap:wrap">
|
|
<div style="display:flex;gap:12px;flex-wrap:wrap">
|
|
|
- <span v-for="c in stats.byCategory || []" :key="c.category">
|
|
|
|
|
- <el-tag size="small">{{ c.category }}: {{ c.cnt }}</el-tag>
|
|
|
|
|
- </span>
|
|
|
|
|
|
|
+ <StatusTag v-for="c in stats.byCategory || []" :key="c.category" type="primary" :text="c.category + ': ' + c.cnt" size="small" />
|
|
|
</div>
|
|
</div>
|
|
|
<div class="stat-label">分类分布</div>
|
|
<div class="stat-label">分类分布</div>
|
|
|
</el-card>
|
|
</el-card>
|
|
@@ -62,10 +54,10 @@
|
|
|
<el-table-column label="预览" width="70">
|
|
<el-table-column label="预览" width="70">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-image v-if="scope.row.fileType === 'image'" :src="scope.row.url" style="width:40px;height:40px;border-radius:4px" fit="cover" :preview-src-list="[scope.row.url]"></el-image>
|
|
<el-image v-if="scope.row.fileType === 'image'" :src="scope.row.url" style="width:40px;height:40px;border-radius:4px" fit="cover" :preview-src-list="[scope.row.url]"></el-image>
|
|
|
- <i v-else-if="scope.row.fileType === 'pdf'" class="el-icon-document" style="font-size:28px;color:#F56C6C;display:block;text-align:center"></i>
|
|
|
|
|
- <i v-else-if="scope.row.fileType === 'video'" class="el-icon-video-camera" style="font-size:28px;color:#409EFF;display:block;text-align:center"></i>
|
|
|
|
|
- <i v-else-if="scope.row.fileType === 'audio'" class="el-icon-headset" style="font-size:28px;color:#67C23A;display:block;text-align:center"></i>
|
|
|
|
|
- <i v-else class="el-icon-document" style="font-size:28px;color:#909399;display:block;text-align:center"></i>
|
|
|
|
|
|
|
+ <i v-else-if="scope.row.fileType === 'pdf'" class="el-icon-document" style="font-size:28px;color:var(--adm-error);display:block;text-align:center"></i>
|
|
|
|
|
+ <i v-else-if="scope.row.fileType === 'video'" class="el-icon-video-camera" style="font-size:28px;color:var(--adm-primary);display:block;text-align:center"></i>
|
|
|
|
|
+ <i v-else-if="scope.row.fileType === 'audio'" class="el-icon-headset" style="font-size:28px;color:var(--adm-success);display:block;text-align:center"></i>
|
|
|
|
|
+ <i v-else class="el-icon-document" style="font-size:28px;color:var(--adm-text-45);display:block;text-align:center"></i>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column prop="originalFilename" label="文件名" min-width="180" show-overflow-tooltip>
|
|
<el-table-column prop="originalFilename" label="文件名" min-width="180" show-overflow-tooltip>
|
|
@@ -78,7 +70,7 @@
|
|
|
<span class="sort-header" @click.stop="onSortClick('fileType', $event)">类型<span v-if="sortIndex('fileType') !== null" class="sort-index" :class="sortClass('fileType') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('fileType') }}</span>{{ sortIcon('fileType') }}</span>
|
|
<span class="sort-header" @click.stop="onSortClick('fileType', $event)">类型<span v-if="sortIndex('fileType') !== null" class="sort-index" :class="sortClass('fileType') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('fileType') }}</span>{{ sortIcon('fileType') }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <el-tag size="mini" :type="typeTag(scope.row.fileType)">{{ scope.row.fileType || '?' }}</el-tag>
|
|
|
|
|
|
|
+ <StatusTag size="mini" :type="typeTag(scope.row.fileType)" :text="scope.row.fileType || '?'" />
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column prop="fileSize" label="大小" width="90">
|
|
<el-table-column prop="fileSize" label="大小" width="90">
|
|
@@ -112,7 +104,7 @@
|
|
|
<el-table-column label="操作" width="120" fixed="right">
|
|
<el-table-column label="操作" width="120" fixed="right">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-button size="mini" type="text" @click="openEdit(scope.row)">编辑</el-button>
|
|
<el-button size="mini" type="text" @click="openEdit(scope.row)">编辑</el-button>
|
|
|
- <el-button size="mini" type="text" style="color:#F56C6C" @click="handleDelete(scope.row)">删除</el-button>
|
|
|
|
|
|
|
+ <el-button size="mini" type="text" style="color:var(--adm-error)" @click="handleDelete(scope.row)">删除</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
@@ -217,7 +209,6 @@ export default {
|
|
|
<style scoped>
|
|
<style scoped>
|
|
|
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
|
|
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
|
|
|
.stat-card { text-align: center; }
|
|
.stat-card { text-align: center; }
|
|
|
-.stat-value { font-size: 24px; font-weight: bold; color: #303133; }
|
|
|
|
|
.stat-label { font-size: 12px; color: #909399; margin-top: 4px; }
|
|
.stat-label { font-size: 12px; color: #909399; margin-top: 4px; }
|
|
|
.sort-header {
|
|
.sort-header {
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
@@ -226,7 +217,7 @@ export default {
|
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
|
}
|
|
}
|
|
|
.sort-header:hover {
|
|
.sort-header:hover {
|
|
|
- color: #409eff;
|
|
|
|
|
|
|
+ color: var(--adm-primary);
|
|
|
}
|
|
}
|
|
|
.no-tag { color: #C0C4CC; }
|
|
.no-tag { color: #C0C4CC; }
|
|
|
</style>
|
|
</style>
|