feat:初始化工程
This commit is contained in:
126
src/views/Library.vue
Normal file
126
src/views/Library.vue
Normal file
@@ -0,0 +1,126 @@
|
||||
<template>
|
||||
<div class="library-view">
|
||||
<!-- 标题行 -->
|
||||
<div class="page-header">
|
||||
<div>
|
||||
<h2 class="page-title">知识库</h2>
|
||||
<p class="page-subtitle">管理学习资料,查看 AI 解析结果</p>
|
||||
</div>
|
||||
<el-button type="primary" :icon="Plus" @click="addFileClick">新增资料</el-button>
|
||||
</div>
|
||||
|
||||
<library-filter />
|
||||
|
||||
<library-file-list />
|
||||
|
||||
<library-file-dialog />
|
||||
|
||||
<library-file-detail-dialog />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import LibraryFilter from '@/components/Library/LibraryFilter.vue'
|
||||
import LibraryFileList from '@/components/Library/LibraryFileList.vue'
|
||||
import LibraryFileDialog from '@/components/Library/LibraryFileDialog.vue'
|
||||
import LibraryFileDetailDialog from '@/components/Library/LibraryFileDetailDialog.vue'
|
||||
import { useLibraryStore } from '@/stores/library.ts'
|
||||
import { Plus } from '@element-plus/icons-vue'
|
||||
import { onMounted } from 'vue'
|
||||
|
||||
const libraryStore = useLibraryStore()
|
||||
|
||||
onMounted(() => {
|
||||
libraryStore.queryFileList()
|
||||
})
|
||||
|
||||
const addFileClick = () => {
|
||||
libraryStore.currentFile = libraryStore.getEmptyFile()
|
||||
libraryStore.fileDialogVisible = true
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.library-view {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
|
||||
/* 标题行 */
|
||||
.page-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.page-title {
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
color: #0f172a;
|
||||
}
|
||||
|
||||
.page-subtitle {
|
||||
font-size: 13px;
|
||||
color: #94a3b8;
|
||||
}
|
||||
}
|
||||
|
||||
/* 筛选栏 */
|
||||
.filter-bar {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
|
||||
.filter-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 文件列表 */
|
||||
.file-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
|
||||
.file-card {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.file-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
cursor: pointer;
|
||||
|
||||
.file-icon {
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 20px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.icon-pdf { background: #fee2e2; }
|
||||
.icon-image { background: #dbeafe; }
|
||||
|
||||
.file-name {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #1e293b;
|
||||
}
|
||||
|
||||
.file-meta {
|
||||
font-size: 12px;
|
||||
color: #94a3b8;
|
||||
margin-top: 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user