Cancel.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <template>
  2. <base-dialog @cancel="cancelDialog">
  3. <div slot="header">{{$t('cloudenv.bill_tasks')}}</div>
  4. <div slot="body">
  5. <dialog-selected-tips :name="$t('cloudenv.bill_tasks')" :count="params.data.length" :action="$t('dialog.cancel')" />
  6. <dialog-table :data="params.data" :columns="params.columns.slice(0,3)" />
  7. </div>
  8. <div slot="footer">
  9. <a-button type="primary" @click="handleConfirm" :loading="loading">{{ $t('dialog.ok') }}</a-button>
  10. <a-button @click="cancelDialog">{{ $t('dialog.cancel') }}</a-button>
  11. </div>
  12. </base-dialog>
  13. </template>
  14. <script>
  15. import DialogMixin from '@/mixins/dialog'
  16. import WindowsMixin from '@/mixins/windows'
  17. export default {
  18. name: 'BilltasksCancelDialog',
  19. components: {
  20. },
  21. mixins: [DialogMixin, WindowsMixin],
  22. data () {
  23. return {
  24. loading: false,
  25. }
  26. },
  27. methods: {
  28. async handleConfirm () {
  29. this.loading = true
  30. try {
  31. const ids = this.params.data.map(item => item.id)
  32. await this.params.onManager('batchPerformAction', {
  33. ids,
  34. managerArgs: {
  35. ids,
  36. action: 'cancel',
  37. },
  38. })
  39. this.cancelDialog()
  40. } finally {
  41. this.loading = false
  42. }
  43. },
  44. },
  45. }
  46. </script>