index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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 { getList } from '@/api/scene';
  17. export default {
  18. name: 'SceneVerify',
  19. components: { toolbar },
  20. mixins: [
  21. mxFilterList({
  22. fetchList: getList // 在下方data再声明一个 fetchList: iGetList 同等效果
  23. })
  24. ],
  25. data() {
  26. return {
  27. columns: [
  28. {
  29. key: 'id',
  30. name: 'ID',
  31. width: '160'
  32. },
  33. {
  34. key: 'name',
  35. name: '机构名称',
  36. width: '180'
  37. },
  38. {
  39. key: 'logo',
  40. name: 'Logo',
  41. width: '120',
  42. render: (h, { row }) =>
  43. h('image', {
  44. style: {
  45. width: '120px',
  46. height: '90px'
  47. },
  48. attrs: {
  49. src: row.logo
  50. },
  51. on: {
  52. click: () =>
  53. this.$AdvanceViewImageModal({
  54. items: [{ src: row.logo }]
  55. })
  56. }
  57. })
  58. },
  59. {
  60. key: 'region',
  61. name: '所在地区',
  62. minWidth: '180',
  63. render: (h, { row }) =>
  64. h('span', `${row.province}/${row.city}/${row.area}`)
  65. },
  66. {
  67. key: 'type',
  68. name: '机构类型',
  69. width: '180'
  70. },
  71. {
  72. key: 'realName',
  73. name: '申请人',
  74. width: '180'
  75. },
  76. {
  77. key: 'personPhonenumber',
  78. name: '手机号码',
  79. width: '180'
  80. },
  81. {
  82. key: 'auditStatus',
  83. name: '状态',
  84. minWidth: '180',
  85. type: 'tag',
  86. fetchTagType: val => {
  87. switch (val) {
  88. case 1:
  89. return 'success';
  90. case 0:
  91. return 'info';
  92. case -1:
  93. return 'error';
  94. default:
  95. return 'info';
  96. }
  97. },
  98. tagName: row => {
  99. switch (row.auditStatus) {
  100. case 1:
  101. return '通过';
  102. case 0:
  103. return '待审核';
  104. case -1:
  105. return '拒绝';
  106. default:
  107. return '-';
  108. }
  109. }
  110. },
  111. {
  112. key: 'action',
  113. name: '操作',
  114. width: '120',
  115. render: (h, { row }) => {
  116. const action = [];
  117. action.push(
  118. h(
  119. 'el-button',
  120. {
  121. props: {
  122. type: 'text'
  123. },
  124. on: {
  125. click: () =>
  126. this.$SceneVerifyItemModal({
  127. id: row.id,
  128. auditStatus: row.auditStatus
  129. })
  130. }
  131. },
  132. '编辑'
  133. )
  134. );
  135. return h('div', action);
  136. }
  137. }
  138. ]
  139. };
  140. },
  141. created() {
  142. this.$g_on('scene_reload', this.reload);
  143. },
  144. beforeDestroy() {
  145. this.$g_off('scene_reload', this.reload);
  146. }
  147. };
  148. </script>
  149. <style type="scss" scoped></style>