index.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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: 'listPreview',
  30. name: '图片',
  31. width: this.$col.b,
  32. render: (h, { row }) =>
  33. h('img', {
  34. style: {
  35. width: '160px',
  36. height: '90px'
  37. },
  38. attrs: {
  39. src: row.listPreview
  40. },
  41. on: {
  42. click: () =>
  43. this.$AdvanceViewImageModal({
  44. items: [{ src: row.listPreview }]
  45. })
  46. }
  47. })
  48. },
  49. {
  50. key: 'location',
  51. name: '上传位置',
  52. minWidth: this.$col.b,
  53. render: (h, { row }) =>
  54. h('span', `${row.kindergartenName}/${row.activityName}`)
  55. },
  56. {
  57. key: 'createAt',
  58. name: '上传时间',
  59. width: this.$col.b
  60. },
  61. {
  62. key: 'auditStatus',
  63. name: '状态',
  64. width: this.$col.s,
  65. type: 'tag',
  66. fetchTagType: val => {
  67. switch (val) {
  68. case 1:
  69. return 'success';
  70. case 0:
  71. return 'info';
  72. case -1:
  73. return 'error';
  74. default:
  75. return 'info';
  76. }
  77. },
  78. tagName: row => {
  79. switch (row.auditStatus) {
  80. case 1:
  81. return '通过';
  82. case 0:
  83. return '待审核';
  84. case -1:
  85. return '拒绝';
  86. default:
  87. return '-';
  88. }
  89. }
  90. },
  91. {
  92. key: 'action',
  93. name: '操作',
  94. width: '120',
  95. render: (h, { row }) => {
  96. const action = [];
  97. row.auditStatus !== 1 &&
  98. action.push(
  99. h(
  100. 'el-button',
  101. {
  102. props: {
  103. type: 'text'
  104. },
  105. on: {
  106. click: () =>
  107. this.$PhotoVerifyItemModal({
  108. id: row.id,
  109. auditStatus: row.auditStatus
  110. })
  111. }
  112. },
  113. '审核'
  114. )
  115. );
  116. return h('div', action);
  117. }
  118. }
  119. ]
  120. };
  121. },
  122. created() {
  123. this.$g_on('photot_reload', this.reload);
  124. },
  125. beforeDestroy() {
  126. this.$g_off('photot_reload', this.reload);
  127. }
  128. };
  129. </script>
  130. <style type="scss" scoped></style>