ScheduledtaskDisabled.vue 1.4 KB

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