BackupList.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <page-list
  3. :list="list"
  4. :columns="columns"
  5. :single-actions="singleActions"
  6. :group-actions="groupActions"
  7. :export-data-options="exportDataOptions"
  8. :hiddenExportKeys="['description']"
  9. :showPage="false" />
  10. </template>
  11. <script>
  12. import WindowsMixin from '@/mixins/windows'
  13. import ListMixin from '@/mixins/list'
  14. // import { getNameFilter } from '@/utils/common/tableFilter'
  15. import { getTimeTableColumn } from '@/utils/common/tableColumn'
  16. export default {
  17. name: 'BackupListForWebAppSidepage',
  18. mixins: [WindowsMixin, ListMixin],
  19. props: {
  20. resId: String,
  21. data: {
  22. type: Object,
  23. required: true,
  24. },
  25. },
  26. data () {
  27. return {
  28. list: this.$list.createList(this, {
  29. id: 'WebAppBackupList',
  30. resource: `webapps/${this.data.id}/backups`,
  31. getParams: {
  32. },
  33. // filterOptions: {
  34. // name: getNameFilter(),
  35. // },
  36. }),
  37. columns: [
  38. getTimeTableColumn({ field: 'name', title: this.$t('network.time') }),
  39. {
  40. field: 'type',
  41. title: this.$t('network.text_249'),
  42. formatter: ({ row }) => {
  43. if (row.type) {
  44. return row.type === 'auto' ? this.$t('network.backup.auto') : this.$t('network.backup.hand')
  45. }
  46. },
  47. },
  48. ],
  49. singleActions: [],
  50. groupActions: [],
  51. }
  52. },
  53. computed: {
  54. exportDataOptions () {
  55. return {
  56. downloadType: 'local',
  57. title: this.$t('common.backup'),
  58. items: [
  59. { field: 'id', label: 'ID' },
  60. ...this.columns,
  61. ],
  62. }
  63. },
  64. },
  65. created () {
  66. this.list.fetchData()
  67. },
  68. methods: {
  69. },
  70. }
  71. </script>