<script setup>
import { apiCustomerUser } from '@/api/customer'

const model=defineModel()
const props=defineProps({
  props:{},
  clearable:{
    type:Boolean,
    default:false
  }
})
const emits=defineEmits(['change'])

const options=ref([])
async function getData(){
  const res=await apiCustomerUser.reportClassify()
  if(res.Ret!=200) return
  const arr=res.Data||[]
  options.value=arr
}
getData()

function handleChange(){
  emits('change')
}

</script>
<template>
  <el-cascader
    :options="options"
    :props="{
      value: 'Id',
      label: 'ClassifyName',
      children: 'Child',
      ...props.props
    }"
    v-model="model"
    placeholder="报告类型"
    collapse-tags
    :clearable="clearable"
    @change="handleChange"
  />
</template>