Selaa lähdekoodia

添加新的设备类型17

tanghongbin 5 vuotta sitten
vanhempi
commit
c2dea111c0
2 muutettua tiedostoa jossa 7 lisäystä ja 1 poistoa
  1. 1 0
      Ansjer/config.py
  2. 6 1
      Controller/AdminManage.py

+ 1 - 0
Ansjer/config.py

@@ -144,6 +144,7 @@ DEVICE_TYPE = {
     13: 'C199',
     14: 'C190',
     15: 'C199_PRO',
+    17: 'C289',
     10001: 'DVRPTZ'
 }
 

+ 6 - 1
Controller/AdminManage.py

@@ -296,8 +296,13 @@ class AdminManage(TemplateView):
             item = tmpDict[area]
             item['quantity'] = item['quantity'] + di['value']
             res['quantity'] = res['quantity'] + item['quantity']
+            device_model = None
+            if DEVICE_TYPE.__contains__(di['Type']):
+                device_model = DEVICE_TYPE[di['Type']]
+            else:
+                device_model = DEVICE_TYPE[0]
             model = {
-                'model': DEVICE_TYPE[di['Type']],
+                'model': device_model,
                 'quantity': di['value']
             }
             item['models'].append(model)