import { ref } from 'vue' import { getProductNameList } from '@/apis/equipment/product' import type { LabelValueState } from '@/types/global' /** 设备名称列表 */ export function productName(options?: { onSuccess?: () => void }) { const loading = ref(false) const productNameList = ref([]) const getProductName = async () => { try { loading.value = true const res = await getProductNameList() productNameList.value = res.data // eslint-disable-next-line ts/no-unused-expressions options?.onSuccess && options.onSuccess() } finally { loading.value = false } } return { productNameList, getProductName, loading } }