<template>
  <div class='default-main'>
    <el-tabs v-model='activeName' type='border-card'>
      <el-tab-pane label='未建档用户档案录入管理' name='1'>
        <undocumented ref='Undocumented' :id='id' v-if="activeName == '1'"/>
      </el-tab-pane>
      <el-tab-pane label='常态化干扰源用户管理' name='3'>
        <interferenceUserTable ref='InterferenceUserTable' :id='id' :businessKey="key" v-if="activeName == '3'"/>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script setup lang='ts'>
import {nextTick, ref, provide} from 'vue'
import {mainHeight} from '@/utils/layout'
import undocumented from './components/undocumented/index.vue'
import interferenceUserTable from './components/normalizationManager/interferenceUserTable.vue'
import {useRoute} from 'vue-router'

const route = useRoute()
const Undocumented = ref()
const InterferenceUserTable = ref()
defineOptions({
  name: 'supervision/interferencemanagement'
})
const activeName = ref('1')
const id = ref('')
const key = ref('')


watch(() => route.query.t, async (newValue, oldValue) => {
  if (route.fullPath.includes('supervision/interferencemanagement')) {
    let type = (route.query.type as string) || 'null'
    if (type == 'null' || type == '1') {
      activeName.value = '1'
    } else {
      activeName.value = '3'
    }
    id.value = (route.query.id as string) || 'null'
    id.value = id.value + '@' + route.query.t
    key.value = (route.query.key as string) || 'null'
  }
}, {deep: true, immediate: true})


const layout = mainHeight(63) as any

</script>

<style lang='scss' scoped>
.bars_w {
  width: 100%;
  height: 500px;
}

:deep(.el-tabs__content) {
  height: v-bind('layout.height');
  overflow-y: auto;
}
</style>
