Browse Source

feat: 优化项目管理中设备管理选择后的重置问题

yanglzh 1 year ago
parent
commit
073fdfdcd7
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/views/iot/projects/detail/device.vue

+ 2 - 0
src/views/iot/projects/detail/device.vue

@@ -102,6 +102,7 @@ function getProducts() {
 
 
 function onCancel() {
 function onCancel() {
   Object.assign(form, baseForm)
   Object.assign(form, baseForm)
+  deviceList.value = []
   isShowDialog.value = false
   isShowDialog.value = false
 }
 }
 
 
@@ -137,6 +138,7 @@ function onDel(row: any) {
 
 
 function getDivices(productKey: string) {
 function getDivices(productKey: string) {
   form.resourcesKey = ''
   form.resourcesKey = ''
+  deviceList.value = []
   deviceApi.device.allList({ productKey }).then((res: any) => {
   deviceApi.device.allList({ productKey }).then((res: any) => {
     deviceList.value = (res?.device || []).map((item: any) => ({ label: item.name, value: item.key }))
     deviceList.value = (res?.device || []).map((item: any) => ({ label: item.name, value: item.key }))
   })
   })