<!--
 * @Author: ssl 710450920@qq.com
 * @Date: 2023-08-03 14:02:20
 * @LastEditors: ssl 710450920@qq.com
 * @LastEditTime: 2023-08-03 15:14:12
 * @FilePath: \csc\src\views\resource-apply\alteration\index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div>
  <alteration-item></alteration-item>
    <vc :type="type" v-if="type == 'VMWARE'" @type="setType" :item-data="itemData" :disabled="disabled" ref="node"></vc>
    <sangFor :type="type" v-if="type == 'SANGFOR'" @type="setType" :item-data="itemData" :disabled="disabled" ref="node"></sangFor>
  </div>
</template>

<script>
import vc from './vc.vue';
import sangFor from './sangfor.vue';
import alterationItem from '../components/alterationItem'
export default {
  props: {
    itemData: {
      type: [Object, Boolean]
    },
    disabled: {
      type: Boolean
    }
  },
  components: { alterationItem, vc, sangFor },
  data () {
    return {
      type: '',
      serverId: ''
    };
  },
  created () {
    if (!this.itemData) {
      this.type = this.$route.params.type;
      this.serverId = this.$route.params.serverId;
    } else {
      this.type = this.itemData.location.vendorType;
      this.serverId = this.itemData.configs.serverId;
    }
  },
  methods: {
    setType (data) {
      this.type = data;
    },
    getApplyData () {
      return this.$refs.node.getPostData();
    }
  }
}
</script>

<style scoped lang="scss">
</style>
