index.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <div>
  3. <a-form-item class="mb-0">
  4. <a-switch :checkedChildren="$t('compute.text_115')" :unCheckedChildren="$t('compute.text_116')" v-decorator="decorators.groupsEnable" @change="change" />
  5. </a-form-item>
  6. <a-form-item v-if="showGroups">
  7. <base-select
  8. v-decorator="decorators.groups"
  9. :select-props="{ placeholder: $t('compute.text_148', [$t('dictionary.instancegroup')]), mode: 'multiple' }"
  10. resource="instancegroups"
  11. :params="params"
  12. :need-params="true" />
  13. </a-form-item>
  14. </div>
  15. </template>
  16. <script>
  17. import * as R from 'ramda'
  18. export default {
  19. name: 'InstanceGroups',
  20. props: {
  21. decorators: {
  22. type: Object,
  23. required: true,
  24. validator: val => !R.isNil(val.groupsEnable) && !R.isNil(val.groups),
  25. },
  26. params: {
  27. type: Object,
  28. required: true,
  29. },
  30. },
  31. data () {
  32. return {
  33. showGroups: this.decorators.groupsEnable[1].initialValue,
  34. }
  35. },
  36. computed: {
  37. },
  38. methods: {
  39. change (val) {
  40. this.showGroups = val
  41. },
  42. },
  43. }
  44. </script>