fileSelect.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import API from "@/api";
  2. //文件选择器配置
  3. export default {
  4. apiObj: API.common.upload,
  5. menuApiObj: API.common.file.menu,
  6. listApiObj: API.common.file.list,
  7. successCode: 200,
  8. maxSize: 30,
  9. max: 99,
  10. uploadParseData: function (res) {
  11. return {
  12. id: res.data.id,
  13. fileName: res.data.fileName,
  14. url: res.data.src
  15. }
  16. },
  17. listParseData: function (res) {
  18. return {
  19. rows: res.data.rows,
  20. total: res.data.total,
  21. msg: res.message,
  22. code: res.code
  23. }
  24. },
  25. request: {
  26. page: 'page',
  27. pageSize: 'pageSize',
  28. keyword: 'keyword',
  29. menuKey: 'groupId'
  30. },
  31. menuProps: {
  32. key: 'id',
  33. label: 'label',
  34. children: 'children'
  35. },
  36. fileProps: {
  37. key: 'id',
  38. fileName: 'fileName',
  39. url: 'url'
  40. },
  41. files: {
  42. doc: {
  43. icon: 'sc-icon-file-word-2-fill',
  44. color: '#409eff'
  45. },
  46. docx: {
  47. icon: 'sc-icon-file-word-2-fill',
  48. color: '#409eff'
  49. },
  50. xls: {
  51. icon: 'sc-icon-file-excel-2-fill',
  52. color: '#67C23A'
  53. },
  54. xlsx: {
  55. icon: 'sc-icon-file-excel-2-fill',
  56. color: '#67C23A'
  57. },
  58. ppt: {
  59. icon: 'sc-icon-file-ppt-2-fill',
  60. color: '#F56C6C'
  61. },
  62. pptx: {
  63. icon: 'sc-icon-file-ppt-2-fill',
  64. color: '#F56C6C'
  65. }
  66. }
  67. }