+
diff --git a/src/views/doc/tools.ts b/src/views/doc/tools.ts
index a983a59..32abeae 100644
--- a/src/views/doc/tools.ts
+++ b/src/views/doc/tools.ts
@@ -78,7 +78,7 @@ export const getFileIcon = (fileName:string) => {
}
}
- export function readableSize(val:matterInfo){
+export function readableSize(val:matterInfo){
if(val.size<1024) return "1 Kb"
//1024*1024
if(val.size<1048576) return (val.size/1024).toFixed(1)+"Kb"
@@ -88,4 +88,19 @@ export const getFileIcon = (fileName:string) => {
if(val.size<1099511627776) return (val.size/1073741824).toFixed(1)+"Gb"
return "BIG"
- }
\ No newline at end of file
+ }
+
+
+export function fileType(name:string){
+ const suffix=name.match(/(\.[a-zA-Z]+$)/)[0]
+ if (".doc, .docx, .html, .md, .txt, .wps, .xml".includes(suffix)){
+ return "word"
+ } else if(".csv, .xls, .xlsb, .xlsm, .xlsx".includes(suffix)){
+ return "cell"
+ }else if(".ppt, .pptm, .pptx".includes(suffix)){
+ return "slide "
+ }else if (suffix===".pdf"){
+ return "pdf"
+ }
+ return ""
+}
\ No newline at end of file