style:采集设备-新增/编辑弹框打开时请求模型列表接口

main
黄伟杰 1 month ago
parent dfc607b243
commit 167e1291e2

@ -167,7 +167,14 @@ const open = async (type: string, id?: number) => {
type === 'setting' ? t('DataCollection.Device.settingDialogTitle') : t('action.' + type)
formType.value = type
resetForm()
//
try {
const models = await DeviceModelApi.getDeviceModelList()
modelList.value = Array.isArray(models) ? models : []
} catch {
modelList.value = []
}
if (id) {
formLoading.value = true
try {
@ -244,8 +251,4 @@ const resetForm = () => {
}
/** 初始化 **/
onMounted(async () => {
modelList.value = await DeviceModelApi.getDeviceModelList()
})
</script>

Loading…
Cancel
Save