Browse Source

增加紧急按钮,调整遥控器mac地址必输

LAPTOP-LIQ71VDD\m 3 năm trước cách đây
mục cha
commit
c50878292b

+ 4 - 0
src/utils/device_type.js

@@ -34,6 +34,10 @@ export function returnDeviceType(value) {
       return '信标'
     case 17:
       return '看板'
+    case 20:
+      return '485转换盒'
+    case 21:
+      return '紧急按钮'
     default:
       return '未知设备'
   }

+ 3 - 1
src/views/hospital/ncs_device/deviceManager.vue

@@ -245,7 +245,9 @@ export default {
         { key: '模拟门灯', value: 14 },
         { key: '遥控器', value: 15 },
         { key: '信标', value: 16 },
-        { key: '看板', value: 17 }
+        { key: '看板', value: 17 },
+        { key: '485转换盒', value: 20 },
+        { key: '紧急按钮', value: 21 }
       ],
       deviceStatusTransfer: [
         { key: '启用', value: 1, color: 'green' },

+ 6 - 4
src/views/ncs-device/components/deviceManager.vue

@@ -279,7 +279,8 @@ export default {
         // { key: '看板', value: 17 },
         // { key: '门禁设备', value: 18 },
         // { key: '探视机', value: 19 },
-        { key: '485转换盒', value: 20 }
+        { key: '485转换盒', value: 20 },
+        { key: '紧急按钮', value: 21 }
       ],
       deviceStatusTransfer: [
         { key: '启用', value: 1, color: 'green' },
@@ -603,11 +604,12 @@ export default {
     },
     /** 设备类型选中变化  **/
     deviceTypeChange(val) {
-      if (val === 12 || val === 13 || val === 14) { // 模拟设备不需要mac地址
-        // this.deviceRules.eth_mac[0].required = false
-        this.deviceRules.eth_mac[1].pattern = null
+      if (val === 12 || val === 13 || val === 14 || val === 21) { // 模拟设备不需要mac地址
+        this.deviceRules.eth_mac[0].required = false
+        // this.deviceRules.eth_mac[1].pattern = null
       } else if (val === 15) {
         this.deviceRules.eth_mac[1].pattern = null
+        this.deviceRules.eth_mac[0].required = true
       } else {
         this.deviceRules.eth_mac[1].pattern = /^([0-9A-Fa-f]{2}:?){6}/gi
         this.deviceRules.eth_mac[0].required = true

+ 3 - 0
src/views/ncs-device/device-edit.vue

@@ -25,6 +25,7 @@
                 <el-option label="信标" :value="16" />
                 <el-option label="看板" :value="17" />
                 <el-option label="485转换盒" :value="20" />
+                <el-option label="紧急按钮" :value="21" />
               </el-select>
             </el-form-item>
           </el-col>
@@ -337,6 +338,8 @@ export default {
         this.formmodel.eth_ip = null
         this.formmodel.eth_mac = '2000'
         this.deviceEthIPReadonly = true
+      } else if (value === 15) {
+        this.rules.eth_mac[0].required = true
       } else if (value === 16) {
         this.rules.eth_mac[0].required = true
         this.rules.code[0].required = false