index.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <div class="home-main index-model">
  3. <m-dag v-if="!isLoading"></m-dag>
  4. <m-spin :is-spin="isLoading"></m-spin>
  5. </div>
  6. </template>
  7. <script>
  8. import mDag from './_source/dag.vue'
  9. import { mapActions, mapMutations } from 'vuex'
  10. import mSpin from '@/module/components/spin/spin'
  11. import Affirm from './_source/jumpAffirm'
  12. import disabledState from '@/module/mixin/disabledState'
  13. export default {
  14. name: 'create-index',
  15. data () {
  16. return {
  17. // loading
  18. isLoading: true
  19. }
  20. },
  21. // mixins
  22. mixins: [disabledState],
  23. props: {},
  24. methods: {
  25. ...mapMutations('dag', ['resetParams']),
  26. ...mapActions('dag', ['getProcessList','getProjectList', 'getResourcesList']),
  27. ...mapActions('security', ['getTenantList','getWorkerGroupsAll']),
  28. /**
  29. * init
  30. */
  31. init () {
  32. this.isLoading = true
  33. // Initialization parameters
  34. this.resetParams()
  35. // Promise Get node needs data
  36. Promise.all([
  37. // get process definition
  38. this.getProcessList(),
  39. // get project
  40. this.getProjectList(),
  41. // get resource
  42. this.getResourcesList(),
  43. // get worker group list
  44. this.getWorkerGroupsAll(),
  45. this.getTenantList()
  46. ]).then((data) => {
  47. this.isLoading = false
  48. // Whether to pop up the box?
  49. Affirm.init(this.$root)
  50. }).catch(() => {
  51. this.isLoading = false
  52. })
  53. }
  54. },
  55. watch: {
  56. '$route': {
  57. deep: true,
  58. handler () {
  59. this.init()
  60. }
  61. }
  62. },
  63. created () {
  64. this.init()
  65. },
  66. mounted () {
  67. },
  68. components: { mDag, mSpin }
  69. }
  70. </script>