|
|
|
|
@ -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>
|
|
|
|
|
|