Forráskód Böngészése

fix: the assigned device cannot be deleted

Casper Dai 3 éve
szülő
commit
51c6ee181f
2 módosított fájl, 5 hozzáadás és 10 törlés
  1. 2 2
      src/api/device.js
  2. 3 8
      src/views/realm/assign/Device.vue

+ 2 - 2
src/api/device.js

@@ -122,10 +122,10 @@ export function getDevicesByAdmin (query) {
   })
 }
 
-export function getDevicesByOrg (query) {
+export function getDevicesByRelation (query) {
   const { pageNum: pageIndex, pageSize, ...params } = query
   return tenantRequest({
-    url: '/device/relation/page',
+    url: '/device/queryRelation/page',
     method: 'GET',
     params: {
       pageIndex, pageSize,

+ 3 - 8
src/views/realm/assign/Device.vue

@@ -18,7 +18,7 @@ import { getUserGroups } from '@/api/user'
 import {
   getProducts,
   getDevicesByAdmin,
-  getDevicesByOrg,
+  getDevicesByRelation,
   bindDeviceToObject,
   unbindDevice
 } from '@/api/device'
@@ -100,16 +100,11 @@ export default {
     getDevices (params) {
       const queryParams = { ...params }
       if (this.isGroup) {
-        if (this.value === this.tenant.path) {
-          queryParams.tenant = this.value
-        } else {
-          queryParams.org = this.value
-          queryParams.flag = 1
-        }
+        queryParams.org = this.value
       } else {
         queryParams.user = this.value
       }
-      return getDevicesByOrg(queryParams)
+      return getDevicesByRelation(queryParams)
     },
     onAdd () {
       this.$refs.tableDialog.show()