MediaDesigner.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <div class="l-flex__auto l-flex--col">
  3. <el-tabs
  4. :value="active"
  5. class="c-tabs has-bottom-padding"
  6. @tab-click="onTabClick"
  7. >
  8. <el-tab-pane
  9. label="待审核"
  10. name="101"
  11. />
  12. <el-tab-pane
  13. label="已审核"
  14. name="2"
  15. />
  16. <el-tab-pane
  17. label="驳回"
  18. name="3"
  19. />
  20. </el-tabs>
  21. <schema-table
  22. v-if="isVaild"
  23. ref="table"
  24. :schema="schema"
  25. :proxy.sync="currOptions"
  26. :header-cell-class-name="adjustHeader"
  27. />
  28. </div>
  29. </template>
  30. <script>
  31. import { State } from '@/constant'
  32. import {
  33. addListener,
  34. removeListener
  35. } from '@/utils/upload'
  36. import mixin from './mixin'
  37. export default {
  38. name: 'MediaDesigner',
  39. mixins: [mixin],
  40. data () {
  41. return {
  42. active: `${State.AVAILABLE_ASSET}`
  43. }
  44. },
  45. computed: {
  46. isVaild () {
  47. return this.type && this.active
  48. }
  49. },
  50. created () {
  51. addListener('uploaded', this.onUploaded)
  52. },
  53. beforeDestroy () {
  54. removeListener('uploaded', this.onUploaded)
  55. },
  56. methods: {
  57. onUploaded ({ type }) {
  58. if (this.type === type && Number(this.active) === State.AVAILABLE_ASSET) {
  59. this.$refs.table.pageTo(1)
  60. }
  61. },
  62. onTabClick ({ name: active }) {
  63. if (this.active !== active) {
  64. this.active = null
  65. this.$nextTick(() => {
  66. this.active = active
  67. })
  68. }
  69. }
  70. }
  71. }
  72. </script>