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

  <el-tabs v-model="activeName">
    <el-tab-pane label="下发参数" name="pending" :lazy="true">
      <NetworkConfigPending @status="setStatus" v-if="activeName === 'pending'" :active-name="activeName" />
    </el-tab-pane>
    <el-tab-pane label="设备参数" name="applied" :lazy="true">
      <NetworkConfigApplied @status="setStatus" v-if="activeName === 'applied'" :active-name="activeName" />
    </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/network-config-pending.vue';
import NetworkConfigApplied from 'components/network-config-applied.vue';

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

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