Bladeren bron

Merge branch 'staging' of http://pms.inspur.com/web/msr into staging

Casper Dai 3 jaren geleden
bovenliggende
commit
25c6801158
2 gewijzigde bestanden met toevoegingen van 25 en 25 verwijderingen
  1. 1 24
      src/views/device/index.vue
  2. 24 1
      src/views/realm/device/Device.vue

+ 1 - 24
src/views/device/index.vue

@@ -16,10 +16,6 @@
       :ratio="ratio"
       @choosen="onChoosen"
     />
-    <bind-device-dialog
-      ref="bindDeviceDialog"
-      @choosen="onBindDeviceChoosen"
-    />
   </wrapper>
 </template>
 
@@ -32,7 +28,6 @@ import {
   getProducts
 } from '@/api/device'
 import { publish } from '@/api/platform'
-import { bind as bindDevice } from '@/api/external'
 import {
   Access,
   EventPriority,
@@ -102,8 +97,7 @@ export default {
                   : '未激活'
               }
           }, on: this.onTagClick },
-          { type: 'invoke', width: canEdit ? 160 + 40 : 120 + 40, render: [
-            { label: '绑定设备', render ({ empty }) { return !empty }, on: this.onBindDevice },
+          { type: 'invoke', width: canEdit ? 160 : 120, render: [
             { label: '查看', render ({ empty }) { return !empty }, on: this.onViewDevice },
             canEdit ? { label: '默认播放', render ({ isMaster, activate }) { return isMaster && activate }, on: this.onSetDefaultProgram } : null
           ].filter(val => val) }
@@ -201,23 +195,6 @@ export default {
       }
       this.$refs.eventTargetDialog.show()
     },
-    onBindDevice (device) {
-      this.$device = {
-        id: device.id,
-        name: device.name
-      }
-      this.$refs.bindDeviceDialog.show()
-    },
-    onBindDeviceChoosen ({ value, done }) {
-      console.log(bindDevice)
-      this.$confirm(
-        `确定绑定设备 ?`,
-        { type: 'warning' }
-      ).then(() => {
-        console.log(bindDevice)
-        bindDevice(this.$device.id, value.deviceType, value.id).then(done)
-      })
-    },
     onChoosen ({ value, done }) {
       this.$confirm(
         `将设备 ${this.$device.name} 的默认播放设置为 ${value.name} ?`,

+ 24 - 1
src/views/realm/device/Device.vue

@@ -49,6 +49,10 @@
         />
       </div>
     </confirm-dialog>
+    <bind-device-dialog
+      ref="bindDeviceDialog"
+      @choosen="onBindDeviceChoosen"
+    />
   </schema-table>
 </template>
 
@@ -64,6 +68,7 @@ import {
   getProducts
 } from '@/api/device'
 import { validMAC } from '@/utils/validate'
+import { bind as bindDevice } from '@/api/external'
 
 export default {
   name: 'Device',
@@ -134,7 +139,8 @@ export default {
                   : '未激活'
               }
           }, on: this.onTagClick },
-          { type: 'invoke', width: 180, render: [
+          { type: 'invoke', width: 240, render: [
+            { label: '绑定设备', render ({ empty }) { return !empty }, on: this.onBindDevice },
             { label: '查看', render ({ empty }) { return !empty }, on: this.onViewDevice },
             { label: '添加备份', render ({ isMaster }) { return isMaster }, on: this.onAddSubDevice },
             { label: '删除', render ({ empty }) { return !empty }, on: this.onDelDevice }
@@ -324,6 +330,23 @@ export default {
           this.reloadSubDevices(data.parent)
         }
       })
+    },
+    onBindDevice (device) {
+      this.$device = {
+        id: device.id,
+        name: device.name
+      }
+      this.$refs.bindDeviceDialog.show()
+    },
+    onBindDeviceChoosen ({ value, done }) {
+      console.log(bindDevice)
+      this.$confirm(
+        `确定绑定设备 ?`,
+        { type: 'warning' }
+      ).then(() => {
+        console.log(bindDevice)
+        bindDevice(this.$device.id, value.deviceType, value.id).then(done)
+      })
     }
   }
 }