index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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. class: 'pre-fix',
  49. attrs: {
  50. src: row.listPreview
  51. },
  52. on: {
  53. click: () =>
  54. this.$AdvanceViewImageModal({
  55. items: [{ src: row.listPreview }]
  56. })
  57. }
  58. });
  59. }
  60. },
  61. {
  62. key: 'createAt',
  63. name: '上传时间',
  64. width: this.$col.b
  65. },
  66. {
  67. key: 'auditStatus',
  68. name: '状态',
  69. width: this.$col.s,
  70. type: 'tag',
  71. fetchTagType: val => {
  72. switch (val) {
  73. case 1:
  74. return 'success';
  75. case 0:
  76. return 'info';
  77. case -1:
  78. return 'error';
  79. default:
  80. return 'info';
  81. }
  82. },
  83. tagName: row => {
  84. switch (row.auditStatus) {
  85. case 1:
  86. return '通过';
  87. case 0:
  88. return '待审核';
  89. case -1:
  90. return '拒绝';
  91. default:
  92. return '-';
  93. }
  94. }
  95. },
  96. {
  97. key: 'action',
  98. name: '操作',
  99. width: '120',
  100. render: (h, { row }) => {
  101. const action = [];
  102. row.auditStatus !== 1 &&
  103. action.push(
  104. h(
  105. 'el-button',
  106. {
  107. props: {
  108. type: 'text'
  109. },
  110. on: {
  111. click: () =>
  112. this.$PhotoVerifyItemModal({
  113. id: row.id,
  114. auditStatus: row.auditStatus
  115. })
  116. }
  117. },
  118. '审核'
  119. )
  120. );
  121. return h('div', action);
  122. }
  123. }
  124. ]
  125. };
  126. },
  127. created() {
  128. this.$g_on('photo_reload', this.reload);
  129. },
  130. beforeDestroy() {
  131. this.$g_off('photo_reload', this.reload);
  132. }
  133. };
  134. </script>
  135. <style type="scss" scoped></style>