feat:封装axios接口
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<div class="library-view">
|
||||
<!-- 标题行 -->
|
||||
<div class="page-header">
|
||||
<div>
|
||||
<h2 class="page-title">知识库</h2>
|
||||
@@ -9,33 +8,29 @@
|
||||
<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()
|
||||
onMounted(async () => {
|
||||
await libraryStore.queryFileList()
|
||||
})
|
||||
|
||||
const addFileClick = () => {
|
||||
libraryStore.currentFile = libraryStore.getEmptyFile()
|
||||
libraryStore.fileApiType = 'ADD'
|
||||
libraryStore.hasGenerateQuestion = false
|
||||
libraryStore.fileDialogVisible = true
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user