<template>
  <!-- 设置站点选择 和 设备下发状态 -->
  <DeviceSelectAndStatus :status="status" />

  <el-tabs v-model="activeName">
    <el-tab-pane :lazy="true" label="下发参数" name="pending">
      <NetworkConfigPending v-if="activeName === 'pending'" :active-name="activeName" @status="setStatus" />
    </el-tab-pane>
    <el-tab-pane :lazy="true" label="设备参数" name="applied">
      <NetworkConfigApplied v-if="activeName === 'applied'" :active-name="activeName" @status="setStatus" />
    </el-tab-pane>
  </el-tabs>
</template>

<script setup>
import { ref } from 'vue';
import DeviceSelectAndStatus from 'components/device-select-and-status.vue';
import NetworkConfigPending from 'components/config/network-config-pending.vue';
import NetworkConfigApplied from 'components/network-config-applied.vue';

const activeName = ref('pending');
const status = ref('');

// 设置 设置状态
function setStatus(event) {
  status.value = event;
}
</script>
