issue.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <div>
  3. <!-- 数据表格 -->
  4. <ele-pro-table
  5. ref="table"
  6. :columns="columns"
  7. :datasource="tableList"
  8. tool-class="ele-toolbar-form"
  9. :needPage="false"
  10. >
  11. </ele-pro-table>
  12. </div>
  13. </template>
  14. <script>
  15. import { queryRelease } from '@/api/doc-manage';
  16. export default {
  17. props: {
  18. // 上级id
  19. parentId: [Number, String]
  20. },
  21. data() {
  22. return {
  23. // 表格列配置
  24. tableList:[],
  25. columns: [
  26. {
  27. columnKey: 'index',
  28. label: '序号',
  29. type: 'index',
  30. width: 55,
  31. align: 'center',
  32. showOverflowTooltip: true,
  33. },
  34. {
  35. prop: 'versionNum',
  36. label: '版本',
  37. align: 'center',
  38. slot: 'versionNum',
  39. showOverflowTooltip: true,
  40. width: 100
  41. },
  42. {
  43. prop: 'fileName',
  44. label: '文档名称',
  45. align: 'center',
  46. slot: 'fileName',
  47. showOverflowTooltip: true,
  48. minWidth: 200
  49. },
  50. {
  51. prop: 'storagePath',
  52. label: '文件名称',
  53. align: 'center',
  54. showOverflowTooltip: true,
  55. minWidth: 200,
  56. formatter: (_row, _column, cellValue) => {
  57. // return '';
  58. return cellValue[0]?.name
  59. }
  60. },
  61. {
  62. prop: 'operationUserName',
  63. label: '发布人',
  64. align: 'center',
  65. showOverflowTooltip: true,
  66. minWidth: 100
  67. },
  68. {
  69. prop: 'createTime',
  70. label: '发布时间',
  71. align: 'center',
  72. showOverflowTooltip: true,
  73. minWidth: 160
  74. },
  75. {
  76. prop: 'createUserName',
  77. label: '创建人',
  78. align: 'center',
  79. showOverflowTooltip: true,
  80. minWidth: 100
  81. },
  82. {
  83. prop: 'sizeUnit',
  84. label: '文档大小',
  85. align: 'center',
  86. showOverflowTooltip: true,
  87. minWidth: 100
  88. }
  89. // {
  90. // prop: '',
  91. // label: '状态',
  92. // align: 'center',
  93. // showOverflowTooltip: true,
  94. // minWidth: 100,
  95. // }
  96. ]
  97. };
  98. },
  99. watch:{
  100. parentId(val){
  101. if(val){
  102. this.getList(val)
  103. }
  104. }
  105. },
  106. methods: {
  107. async getList() {
  108. this.tableList = await queryRelease(this.parentId);
  109. },
  110. init() {
  111. this.$nextTick(() => {
  112. this.$refs.table.reRenderTable()
  113. });
  114. }
  115. }
  116. };
  117. </script>