article-constants.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. // 表格列信息
  2. const table = {
  3. columns: [
  4. {
  5. title: 'ID',
  6. align: 'center',
  7. dataIndex: 'id'
  8. },
  9. {
  10. title: '文章名称',
  11. align: 'center',
  12. dataIndex: 'title',
  13. scopedSlots: { customRender: 'titles' }
  14. },
  15. {
  16. title: '创建时间',
  17. align: 'center',
  18. dataIndex: 'createTime',
  19. scopedSlots: { customRender: 'createTime' }
  20. },
  21. {
  22. title: '摘要',
  23. dataIndex: 'summary',
  24. align: 'center',
  25. scopedSlots: { customRender: 'summary' }
  26. },
  27. {
  28. title: '文章状态',
  29. dataIndex: 'status',
  30. align: 'center',
  31. scopedSlots: { customRender: 'status' }
  32. },
  33. {
  34. title: '浏览数',
  35. align: 'center',
  36. dataIndex: 'views'
  37. },
  38. {
  39. title: '评论数',
  40. align: 'center',
  41. dataIndex: 'comments'
  42. },
  43. {
  44. title: '权重',
  45. align: 'center',
  46. dataIndex: 'weight'
  47. },
  48. {
  49. title: '操作',
  50. dataIndex: 'action',
  51. align: 'center',
  52. fixed: 'right',
  53. width: '250px',
  54. scopedSlots: { customRender: 'action' }
  55. }
  56. ]
  57. }
  58. // 表格里面的列key value
  59. const filters = {
  60. syncStatusFilter (status) {
  61. const statusMap = {
  62. 0: '未同步',
  63. 1: '已同步'
  64. }
  65. return statusMap[status]
  66. },
  67. syncStatusTypeFilter (status) {
  68. const statusMap = {
  69. 0: 'error',
  70. 1: 'success'
  71. }
  72. return statusMap[status]
  73. },
  74. statusFilter (status) {
  75. const statusMap = {
  76. 1: '草稿箱',
  77. 2: '已发布'
  78. }
  79. return statusMap[status]
  80. },
  81. statusTypeFilter (status) {
  82. const statusMap = {
  83. 1: 'error',
  84. 2: 'success'
  85. }
  86. return statusMap[status]
  87. }
  88. }
  89. // md配置
  90. const markdownOption = {
  91. bold: true, // 粗体
  92. italic: true, // 斜体
  93. header: true, // 标题
  94. underline: true, // 下划线
  95. strikethrough: false, // 中划线
  96. mark: true, // 标记
  97. superscript: false, // 上角标
  98. subscript: false, // 下角标
  99. quote: true, // 引用
  100. ol: true, // 有序列表
  101. ul: true, // 无序列表
  102. link: true, // 链接
  103. imagelink: true, // 图片链接
  104. code: true, // code
  105. table: true, // 表格
  106. fullscreen: false, // 全屏编辑
  107. readmodel: false, // 沉浸式阅读
  108. help: true, // 帮助
  109. undo: true, // 上一步
  110. redo: true, // 下一步
  111. trash: true, // 清空
  112. save: true, // 保存(触发events中的save事件)
  113. navigation: true, // 导航目录
  114. subfield: true, // 单双栏模式
  115. preview: true, // 预览
  116. htmlcode: true// 展示html源码
  117. }
  118. export { table, filters, markdownOption }