{{ file.name }}
-
{{ file.size }} · {{ file.time }}
+
{{ file.size }} · {{ file.uploadTime }}
diff --git a/src/main.ts b/src/main.ts
index b17300c..1978076 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -21,4 +21,4 @@ app.use(createPinia())
// 使用Element UI Plus
app.use(ElementPlus, { locale: zhCn })
// 挂载到根组件上
-app.mount('#app')
\ No newline at end of file
+app.mount('#app')
diff --git a/src/stores/library.ts b/src/stores/library.ts
index 2015005..c650032 100644
--- a/src/stores/library.ts
+++ b/src/stores/library.ts
@@ -59,13 +59,11 @@ export const useLibraryStore = defineStore('library', {
subject: '中医学',
module: '中医基础理疗',
name: '向量代数.pdf',
- size: '2.4 MB',
- time: '2分钟前',
+ size: 2.4,
+ uploadTime: '2分钟前',
type: 'pdf',
- iconClass: 'icon-pdf',
questions: [
- { type: '选择题', stem: '设 a=(1,2,3), b=(2,-1,1),求 a·b = ?', options: ['A. 3', 'B. 5', 'C. 7', 'D. 9'], answer: 'A' },
- { type: '计算题', stem: '求过点 P(1,0,2) 且法向量为 n=(2,1,-1) 的平面方程', answer: '2x + y - z = 0' }
+ { id: 1, type: 'single', question: '设 a=(1,2,3), b=(2,-1,1),求 a·b = ?', options: ['A. 3', 'B. 5', 'C. 7', 'D. 9'], answer: ['A'] }
]
},
{
@@ -73,23 +71,23 @@ export const useLibraryStore = defineStore('library', {
subject: '中医学',
module: '中医基础理疗',
name: '向量代数精讲.png',
- size: '156 MB',
- time: '3小时前',
+ size: 156,
+ uploadTime: '3小时前',
type: 'image',
- iconClass: 'icon-image'
+ questions: []
}
]
},
getEmptyFile(): ILibraryFile {
return {
- iconClass: '',
id: 0,
module: '',
name: '',
- size: '',
+ size: 0,
subject: '',
- time: '',
- type: ''
+ uploadTime: '',
+ type: '',
+ questions: []
}
}
}
diff --git a/src/styles/common.module.scss b/src/styles/common.module.scss
new file mode 100644
index 0000000..76319a1
--- /dev/null
+++ b/src/styles/common.module.scss
@@ -0,0 +1,17 @@
+.common-view {
+
+}
+
+.common-dialog {
+ --el-dialog-margin-top: 0 !important;
+ margin: 0 auto !important;
+ height: 100vh;
+
+ display: flex;
+ flex-direction: column;
+
+ .el-dialog__body {
+ flex-grow: 1;
+ overflow: auto;
+ }
+}
diff --git a/src/types/library.ts b/src/types/library.ts
index 3f5d04f..85bea2d 100644
--- a/src/types/library.ts
+++ b/src/types/library.ts
@@ -5,10 +5,11 @@ export interface ITreeNode {
}
export interface ILibraryFileQuestion {
+ id: number;
type: string;
- stem: string;
- options?: string[];
- answer: string;
+ question: string;
+ options: string[];
+ answer: string[];
}
export interface ILibraryFile {
@@ -16,9 +17,8 @@ export interface ILibraryFile {
subject: string;
module: string;
name: string;
- size: string;
- time: string;
+ size: number;
+ uploadTime: string;
type: string;
- iconClass: string;
- questions?: ILibraryFileQuestion[];
+ questions: ILibraryFileQuestion[];
}