ScheduledtaskEnabled.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <base-dialog @cancel="cancelDialog">
  3. <div slot="header">{{$t('cloudenv.text_334')}}</div>
  4. <div slot="body">
  5. <dialog-selected-tips :name="$t('cloudenv.text_431')" class="mt-3" :count="params.data.length" :action="$t('cloudenv.text_334')" />
  6. <dialog-table v-if="params.columns && params.columns.length" :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: 'ScheduledtaskEnabledDialog',
  19. mixins: [DialogMixin, WindowsMixin],
  20. data () {
  21. return {
  22. loading: false,
  23. }
  24. },
  25. methods: {
  26. async handleConfirm () {
  27. this.loading = true
  28. try {
  29. const ids = this.params.data.map(item => item.id)
  30. await this.params.onManager('batchPerformAction', {
  31. id: ids,
  32. managerArgs: {
  33. action: 'enable',
  34. },
  35. })
  36. this.cancelDialog()
  37. } catch (error) {
  38. throw error
  39. } finally {
  40. this.loading = false
  41. }
  42. },
  43. },
  44. }
  45. </script>