Browse Source

关联设备修改

duy 3 tháng trước cách đây
mục cha
commit
51a2857133

+ 9 - 0
src/api/modules/basic/code.js

@@ -95,4 +95,13 @@ export default {
             params: form,
         })
     },
+    //获取关联设备修改
+       async getDeviceInfoByIds(form) {
+        return HcApi({
+            url: '/api/blade-business/detection/self/getDeviceInfoByIds',
+            method: 'get',
+            params: form,
+        })
+    },
 }
+

+ 15 - 9
src/views/tentative/detect/components/basicInfo.vue

@@ -529,17 +529,23 @@ const linksAcquisitionClose = () => {
     linksAcquisitionLoading.value = false
 }
 
-const linkAcquisitionChange = (ids, rows) => {
-    console.log(ids)
-    console.log(rows, 'rows')
-    // tableData.value.push
-    if (rows.length > 0) {
-      rows.forEach((item)=>{
-        basicInfoData.value.trailDeviceUseInfoDTOS.push(item)
-      })
-    }
+const linkAcquisitionChange = async (ids, rows) => {
     linkAcquisitionLoadDataId.value = ids
         basicInfoData.value.deviceUseIds = ids
+             const { error, code, data, msg } = await codeApi.getDeviceInfoByIds({
+                   deviceInfoIds: ids,
+                 
+                })
+            handleSaveLoad.value = false
+            if (!error && code === 200) {
+              let resArr = getArrValue(data)
+              if (resArr.length > 0) {
+                resArr.forEach((item)=>{
+                  basicInfoData.value.trailDeviceUseInfoDTOS.push(item)
+                })
+              }
+              
+            }
 }
 
 //保存