index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <div class="">
  3. <toolbar @on-filter="filterData" @on-reset="filterData" />
  4. <base-table
  5. class="m-10 bg-w p-20 br-10"
  6. :columns="columns"
  7. :items="items"
  8. :pagination="pagination"
  9. :page-change="pageChange"
  10. />
  11. </div>
  12. </template>
  13. <script>
  14. import toolbar from './toolbar';
  15. import mxFilterList from '@/mixins/filterList';
  16. import { getPage } from '@/api/photoWarehouse';
  17. export default {
  18. name: 'photoVerifyManagement',
  19. components: { toolbar },
  20. mixins: [
  21. mxFilterList({
  22. fetchList: getPage // 在下方data再声明一个 fetchList: iGetList 同等效果
  23. })
  24. ],
  25. data() {
  26. return {
  27. columns: [
  28. {
  29. key: 'location',
  30. name: '上传位置',
  31. minWidth: this.$col.b,
  32. render: (h, { row }) =>
  33. h('span', `${row.kindergartenName}/${row.activityName}`)
  34. },
  35. {
  36. key: 'listPreview',
  37. name: '图片',
  38. width: this.$col.b,
  39. render: (h, { row }) => {
  40. if (!row.listPreview) {
  41. return h('span', '图片正在处理中请稍等...');
  42. }
  43. return h('img', {
  44. style: {
  45. width: '160px',
  46. height: '90px'
  47. },
  48. attrs: {
  49. src: row.listPreview
  50. },
  51. on: {
  52. click: () =>
  53. this.$AdvanceViewImageModal({
  54. items: [{ src: row.listPreview }]
  55. })
  56. }
  57. });
  58. }
  59. },
  60. {
  61. key: 'createAt',
  62. name: '上传时间',
  63. width: this.$col.b
  64. },
  65. {
  66. key: 'auditStatus',
  67. name: '状态',
  68. width: this.$col.s,
  69. type: 'tag',
  70. fetchTagType: val => {
  71. switch (val) {
  72. case 1:
  73. return 'success';
  74. case 0:
  75. return 'info';
  76. case -1:
  77. return 'error';
  78. default:
  79. return 'info';
  80. }
  81. },
  82. tagName: row => {
  83. switch (row.auditStatus) {
  84. case 1:
  85. return '通过';
  86. case 0:
  87. return '待审核';
  88. case -1:
  89. return '拒绝';
  90. default:
  91. return '-';
  92. }
  93. }
  94. },
  95. {
  96. key: 'action',
  97. name: '操作',
  98. width: '120',
  99. render: (h, { row }) => {
  100. const action = [];
  101. row.auditStatus !== 1 &&
  102. action.push(
  103. h(
  104. 'el-button',
  105. {
  106. props: {
  107. type: 'text'
  108. },
  109. on: {
  110. click: () =>
  111. this.$PhotoVerifyItemModal({
  112. id: row.id,
  113. auditStatus: row.auditStatus
  114. })
  115. }
  116. },
  117. '审核'
  118. )
  119. );
  120. return h('div', action);
  121. }
  122. }
  123. ]
  124. };
  125. },
  126. created() {
  127. this.$g_on('photo_reload', this.reload);
  128. },
  129. beforeDestroy() {
  130. this.$g_off('photo_reload', this.reload);
  131. }
  132. };
  133. </script>
  134. <style type="scss" scoped></style>