map.js 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. /**
  2. * 存放一些静态变量、Map 等全局可用的变量
  3. * @author 小鲤鱼听听
  4. */
  5. /**
  6. * 未知文件类型图标
  7. */
  8. export const unknownImg = import('@/assets/images/myResource/file/file_unknown.png')
  9. console.log('unknownImg==', unknownImg.default)
  10. /**
  11. * 文件类型图标 Map 映射
  12. */
  13. export const fileImgMap = new Map([
  14. ['avi', import('@/assets/images/myResource/file/file_avi.png')],
  15. ['bat', import('@/assets/images/myResource/file/file_powershell.png')],
  16. // ['c', import('@/assets/images/myResource/file/file_c.png')],
  17. // ['c++', import('@/assets/images/myResource/file/file_c++.png')],
  18. // ['c#', import('@/assets/images/myResource/file/file_c#.png')],
  19. ['css', import('@/assets/images/myResource/file/file_css.png')],
  20. ['go', import('@/assets/images/myResource/file/file_go.png')],
  21. ['py', import('@/assets/images/myResource/file/file_python.png')],
  22. ['styl', import('@/assets/images/myResource/file/file_stylus.png')],
  23. ['less', import('@/assets/images/myResource/file/file_less.png')],
  24. ['conf', import('@/assets/images/myResource/file/file_nginx.png')],
  25. ['m', import('@/assets/images/myResource/file/file_objective_c.png')],
  26. ['scss', import('@/assets/images/myResource/file/file_scss.png')],
  27. ['sass', import('@/assets/images/myResource/file/file_sass.png')],
  28. ['csv', import('@/assets/images/myResource/file/file_csv.png')],
  29. ['dmg', import('@/assets/images/myResource/file/file_dmg.png')],
  30. ['dir', import('@/assets/images/myResource/file/dir.png')],
  31. ['doc', import('@/assets/images/myResource/file/file_word.svg')],
  32. ['docx', import('@/assets/images/myResource/file/file_word.svg')],
  33. ['exe', import('@/assets/images/myResource/file/file_exe.png')],
  34. ['html', import('@/assets/images/myResource/file/file_html.png')],
  35. ['jar', import('@/assets/images/myResource/file/file_jar.png')],
  36. ['java', import('@/assets/images/myResource/file/file_java.png')],
  37. ['js', import('@/assets/images/myResource/file/file_js.png')],
  38. ['json', import('@/assets/images/myResource/file/file_json.png')],
  39. ['jsp', import('@/assets/images/myResource/file/file_jsp.png')],
  40. ['kt', import('@/assets/images/myResource/file/file_kotlin.png')],
  41. ['mp3', import('@/assets/images/myResource/file/file_music.png')],
  42. ['flac', import('@/assets/images/myResource/file/file_flac.svg')],
  43. ['oa', import('@/assets/images/myResource/file/file_oa.png')],
  44. ['open', import('@/assets/images/myResource/file/file_open.png')],
  45. ['pdf', import('@/assets/images/myResource/file/file_pdf.png')],
  46. ['php', import('@/assets/images/myResource/file/file_php.png')],
  47. ['ppt', import('@/assets/images/myResource/file/file_ppt.svg')],
  48. ['pptx', import('@/assets/images/myResource/file/file_ppt.svg')],
  49. ['properties', import('@/assets/images/myResource/file/file_properties.png')],
  50. ['r', import('@/assets/images/myResource/file/file_r.png')],
  51. ['rar', import('@/assets/images/myResource/file/file_rar.png')],
  52. ['rs', import('@/assets/images/myResource/file/file_rust.png')],
  53. ['rtf', import('@/assets/images/myResource/file/file_rtf.png')],
  54. ['sh', import('@/assets/images/myResource/file/file_shell.png')],
  55. ['sql', import('@/assets/images/myResource/file/file_sql.png')],
  56. ['svg', import('@/assets/images/myResource/file/file_svg.png')],
  57. ['swift', import('@/assets/images/myResource/file/file_swift.png')],
  58. ['ts', import('@/assets/images/myResource/file/file_typescript.png')],
  59. ['txt', import('@/assets/images/myResource/file/file_txt.png')],
  60. ['vue', import('@/assets/images/myResource/file/file_vue.png')],
  61. ['xls', import('@/assets/images/myResource/file/file_excel.svg')],
  62. ['xlsx', import('@/assets/images/myResource/file/file_excel.svg')],
  63. ['xml', import('@/assets/images/myResource/file/file_xml.png')],
  64. ['zip', import('@/assets/images/myResource/file/file_zip.png')],
  65. ['7z', import('@/assets/images/myResource/file/file_7z.svg')],
  66. ['tar', import('@/assets/images/myResource/file/file_tar.svg')],
  67. ['md', import('@/assets/images/myResource/file/file_markdown.png')],
  68. ['markdown', import('@/assets/images/myResource/file/file_markdown.png')],
  69. ['yaml', import('@/assets/images/myResource/file/file_yaml.png')],
  70. ['yml', import('@/assets/images/myResource/file/file_yaml.png')]
  71. ])
  72. /**
  73. * 支持使用 onlyoffice 打开的文件格式
  74. */
  75. export const officeFileType = ['ppt', 'pptx', 'doc', 'docx', 'xls', 'xlsx']
  76. /**
  77. * markdown 文件后缀
  78. */
  79. export const markdownFileType = ['markdown', 'md']
  80. /**
  81. * 文件展示模式选择列表时,所有可供选择的表格列名
  82. */
  83. export const allColumnList = ['extendName', 'fileSize', 'uploadTime', 'deleteTime']
  84. /**
  85. * 可以用代码编辑器打开的文件后缀和 解析语言、 codemirror 解析模式 mode 映射关系
  86. * language:解析语言,
  87. * mime: codemirror 解析模式
  88. */
  89. export const fileSuffixCodeModeMap = new Map([
  90. ['c', { language: 'C', mime: 'text/x-csrc' }],
  91. ['c++', { language: 'C++', mime: 'text/x-c++src' }],
  92. ['c#', { language: 'C#', mime: 'text/x-csharp' }],
  93. ['m', { language: 'Objective-C', mime: 'text/x-objectivec' }],
  94. ['go', { language: 'GO', mime: 'text/x-go' }],
  95. ['kt', { language: 'Kotlin', mime: 'text/x-java' }],
  96. ['css', { language: 'CSS', mime: 'text/css' }],
  97. ['less', { language: 'Less', mime: 'text/x-less' }],
  98. ['php', { language: 'PHP', mime: 'text/x-php' }],
  99. ['bat', { language: 'PowerShell', mime: 'application/x-powershell' }],
  100. ['py', { language: 'Python', mime: 'text/x-python' }],
  101. ['properties', { language: 'Properties', mime: 'text/x-properties' }],
  102. ['R', { language: 'R', mime: 'text/x-rsrc' }],
  103. ['rs', { language: 'Rust', mime: 'text/x-rustsrc' }],
  104. ['scss', { language: 'Scss', mime: 'text/x-scss' }],
  105. ['sass', { language: 'Sass', mime: 'text/x-sass' }],
  106. ['sh', { language: 'Shell', mime: 'text/x-sh' }],
  107. ['styl', { language: 'stylus', mime: 'text/x-styl' }],
  108. ['xml', { language: 'XML', mime: 'text/xml' }],
  109. ['html', { language: 'HTML', mime: 'text/html' }],
  110. ['http', { language: 'HTTP', mime: 'text/http' }],
  111. ['conf', { language: 'Nginx', mime: 'text/x-nginx-conf' }],
  112. ['java', { language: 'Java', mime: 'text/x-java' }],
  113. ['js', { language: 'JavaScript', mime: 'text/javascript' }],
  114. ['ts', { language: 'Typescript', mime: 'text/typescript' }],
  115. ['json', { language: 'JSON', mime: 'application/json' }],
  116. ['jsp', { language: 'JSP', mime: 'application/x-jsp' }],
  117. // ['txt', { language: '', mime: '' }],
  118. ['vue', { language: 'HTML', mime: 'text/html' }],
  119. ['sql', { language: 'SQL', mime: 'text/x-sql' }],
  120. ['swift', { language: 'Swift', mime: 'text/x-swift' }],
  121. ['yml', { language: 'YAML', mime: 'text/x-yaml' }]
  122. ])
  123. /**
  124. * codemirror 编辑器代码高亮主题列表
  125. */
  126. export const codeMirrorThemeList = [
  127. '3024-day',
  128. '3024-night',
  129. 'abbott',
  130. 'abcdef',
  131. 'ambiance-mobile',
  132. 'ambiance',
  133. 'ayu-dark',
  134. 'ayu-mirage',
  135. 'base16-dark',
  136. 'base16-light',
  137. 'bespin',
  138. 'blackboard',
  139. 'cobalt',
  140. 'colorforth',
  141. 'darcula',
  142. 'dracula',
  143. 'duotone-dark',
  144. 'duotone-light',
  145. 'eclipse',
  146. 'elegant',
  147. 'erlang-dark',
  148. 'gruvbox-dark',
  149. 'hopscotch',
  150. 'icecoder',
  151. 'idea',
  152. 'isotope',
  153. 'juejin',
  154. 'lesser-dark',
  155. 'liquibyte',
  156. 'lucario',
  157. 'material-darker',
  158. 'material-ocean',
  159. 'material-palenight',
  160. 'material',
  161. 'mbo',
  162. 'mdn-like',
  163. 'midnight',
  164. 'monokai',
  165. 'moxer',
  166. 'neat',
  167. 'neo',
  168. 'night',
  169. 'nord',
  170. 'oceanic-next',
  171. 'panda-syntax',
  172. 'paraiso-dark',
  173. 'paraiso-light',
  174. 'pastel-on-dark',
  175. 'railscasts',
  176. 'rubyblue',
  177. 'seti',
  178. 'shadowfox',
  179. 'solarized',
  180. 'ssms',
  181. 'the-matrix',
  182. 'tomorrow-night',
  183. 'tomorrow-night-bright',
  184. 'tomorrow-night-eighties',
  185. 'ttcn',
  186. 'twilight',
  187. 'vibrant-ink',
  188. 'xq-dark',
  189. 'xq-light',
  190. 'yeti',
  191. 'yonce',
  192. 'zenburn'
  193. ]
  194. /**
  195. * codemirror 编辑器代码字体大小
  196. */
  197. export const fontSizeList = [12, 14, 16, 18, 20, 22, 24, 26, 28, 30]