浏览代码

创建空间和设备的枚举类,替换所有里面的数字,优化新建设备时对空间的选择,优化模拟设备的mac地址输入

LAPTOP-LIQ71VDD\m 3 年之前
父节点
当前提交
a422ede340

+ 8 - 0
src/api/ncs_hospitalFrame.js

@@ -14,6 +14,14 @@ export function getHospitalFrameList(id) {
     headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
   })
 }
+/** 根据空间类型查找空间 */
+export function getFrameByPartIdAndFrameType(partId, frameType) {
+  return request({
+    url: `/ncs/frame/getFrameByPartIdAndFrameType/${partId}/${frameType}`,
+    loading: false,
+    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
+  })
+}
 /** 新增医院结构 */
 export function addHospitalFrame(params) {
   // params = JSON.parse(JSON.stringify(params))

+ 27 - 0
src/utils/DeviceTypeEnum.js

@@ -0,0 +1,27 @@
+import createEnum from '@/utils/createEnum'
+
+export const DEVICE_TYPE = createEnum(
+  {
+    NURSE_HOST: [1, '护士主机'],
+    DOCTOR_HOST: [2, '医生主机'],
+    DOOR_DEVICE: [3, '门口机'],
+    DIGIT_BED_DEVICE: [4, '病床分机'],
+    LED_SCREEN: [5, 'LCD走廊屏'],
+    LCD_SCREEN: [6, 'LED点阵屏'],
+    NURSE_WATCH: [7, '护士移动'],
+    WORKER_WATCH: [8, '护工移动'],
+    USER_WATCH: [9, '用户移动'],
+    CELL_PHONE: [10, '手机App'],
+    TRANSFER_DEVICE: [11, '总线转换盒'],
+    SIMULATE_BED_DEVICE: [12, '模拟分机'],
+    SIMULATE_EMERGENCY_BUTTON: [13, '模拟紧急按钮'],
+    SIMULATE_DOOR_LIGHT: [14, '模拟门灯'],
+    REMOTE_CONTROL: [15, '遥控器'],
+    BEACON: [16, '信标'],
+    INFORMATION_BOARD: [17, '信息看版'],
+    ENTRANCE_GUARD: [18, '门禁设备'],
+    VISITATION: [19, '探视机'],
+    RS485_TRANSFER: [20, '485转换盒'],
+    EMERGENCY_BUTTON: [21, '紧急按钮']
+  }
+)

+ 25 - 0
src/utils/FrameTypeEnum.js

@@ -0,0 +1,25 @@
+// const frameType = {
+//   'HOSPITAL': 1,
+//   'BUILDING': 2,
+//   'PART': 3,
+//   'ROOM': 4,
+//   'BED': 5
+// }
+import createEnum from '@/utils/createEnum'
+
+export const FRAME_TYPE = createEnum(
+  {
+    HOSPITAL: [1, '机构'],
+    BUILDING: [2, '楼栋'],
+    PART: [3, '科室'],
+    ROOM: [4, '房间'],
+    BED: [5, '床位']
+  }
+)
+// enum FRAME_TYPE {
+//     HOSPITAL = 1,
+//     BUILDING = 2,
+//     PART = 3,
+//     ROOM = 4,
+//     BED = 5
+// }

+ 30 - 0
src/utils/createEnum.js

@@ -0,0 +1,30 @@
+/**
+ * 枚举定义工具
+ * 示例:
+ * const STATUS = createEnum({
+ *     AUDIT_WAIT: [1, '审核中'],
+ *     AUDIT_PASS: [2, '审核通过']
+ * })
+ * 获取枚举值:STATUS.AUDIT_WAIT
+ * 获取枚举描述:STATUS.getDesc('AUDIT_WAIT')
+ * 通过枚举值获取描述:STATUS.getDescFromValue(STATUS.WAIT)
+ *
+ */
+export default function createEnum(definition) {
+  const strToValueMap = {}
+  const numToDescMap = {}
+  for (const enumName of Object.keys(definition)) {
+    const [value, desc] = definition[enumName]
+    strToValueMap[enumName] = value
+    numToDescMap[value] = desc
+  }
+  return {
+    ...strToValueMap,
+    getDesc(enumName) {
+      return (definition[enumName] && definition[enumName][1]) || ''
+    },
+    getDescFromValue(value) {
+      return numToDescMap[value] || ''
+    }
+  }
+}

+ 103 - 5
src/views/hospital/ncs_device/deviceManager.vue

@@ -149,6 +149,22 @@
             </el-form-item>
           </el-col>
         </el-row>
+        <el-row v-if="hasAudioId">
+          <el-col :span="12">
+            <el-form-item label="上属总线转换盒" prop="trans_audio_id">
+              <el-select v-model="deviceModel.trans_audio_id" placeholder="上属总线转换盒" clearable>
+                <el-option v-for="item in audioOptions" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="上属485转换盒" prop="trans_rs485_id">
+              <el-select v-model="deviceModel.trans_rs485_id" placeholder="上属485转换盒" clearable>
+                <el-option v-for="item in rs485Options" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="handlerFormSubmit('deviceEditForm')">确 定</el-button>
@@ -166,6 +182,9 @@ import ListFilter from '@/components/AgGridCustomFilter/ListFilter'
 import RadioFilter from '@/components/AgGridCustomFilter/RadioFilter'
 import * as API_Device from '@/api/ncs_device'
 import * as clerk_API from '@/api/ncs_clerk'
+import { DEVICE_TYPE } from '@/utils/DeviceTypeEnum'
+import * as API_Frame from '@/api/ncs_hospitalFrame'
+import { FRAME_TYPE } from '@/utils/FrameTypeEnum'
 export default {
   name: 'DeviceManager',
   components: { ButtonCellRender, ListFilter, RadioFilter },
@@ -225,8 +244,15 @@ export default {
         ],
         role_id: [
           { required: true, message: '请选择适用人', trigger: 'blur' }
+        ],
+        trans_audio_id: [
+          { required: true, message: '请选择总线转换盒', trigger: 'blur' }
         ]
       },
+      partFrameList: [],
+      roomFrameList: [],
+      bedFrameList: [],
+      typeFrames: [],
       /** 设备类型转换数组 **/
       deviceTypeTransfer: [
         { key: '护士主机', value: 1 },
@@ -255,6 +281,9 @@ export default {
       ],
       rolesOptions: [],
       hasRoleId: false,
+      audioOptions: [],
+      rs485Options: [],
+      hasAudioId: false,
       hasAdd: true
     }
   },
@@ -398,8 +427,19 @@ export default {
       }).catch(err => {
         this.$message.error(err)
       })
+      this.getTypeFrame()
+    },
+    getTypeFrame() {
+      API_Frame.getFrameByPartIdAndFrameType(this.$store.getters.partId, FRAME_TYPE.PART).then(res => {
+        this.partFrameList = [...res]
+      })
+      API_Frame.getFrameByPartIdAndFrameType(this.$store.getters.partId, FRAME_TYPE.ROOM).then(res => {
+        this.roomFrameList = [...res]
+      })
+      API_Frame.getFrameByPartIdAndFrameType(this.$store.getters.partId, FRAME_TYPE.BED).then(res => {
+        this.bedFrameList = [...res]
+      })
     },
-
     /**
      * 过滤状态发生变化,发送到服务器检索数据
      */
@@ -504,8 +544,52 @@ export default {
     },
     /** 设备类型选中变化  **/
     deviceTypeChange(val) {
-      this.deviceRules.eth_mac[0].required = !(val === 12 || val === 13 || val === 14)
-      this.hasRoleId = val === 7
+      this.deviceTypeChangeToFrameTypeChange(val)
+      this.$set(this.deviceModel, 'frame_id', null)
+      if (val === DEVICE_TYPE.SIMULATE_BED_DEVICE ||
+          val === DEVICE_TYPE.SIMULATE_EMERGENCY_BUTTON ||
+          val === DEVICE_TYPE.SIMULATE_DOOR_LIGHT ||
+          val === DEVICE_TYPE.EMERGENCY_BUTTON) { // 模拟设备不需要mac地址
+        this.deviceRules.eth_mac[0].required = false
+        // this.deviceRules.eth_mac[1].pattern = null
+      } else if (val === DEVICE_TYPE.REMOTE_CONTROL) {
+        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
+      }
+      this.hasRoleId = val === DEVICE_TYPE.NURSE_WATCH
+      this.hasAudioId = val === DEVICE_TYPE.SIMULATE_BED_DEVICE ||
+          val === DEVICE_TYPE.SIMULATE_EMERGENCY_BUTTON ||
+          val === DEVICE_TYPE.SIMULATE_DOOR_LIGHT
+    },
+    /** 设备类型选中对应的空间结构  **/
+    deviceTypeChangeToFrameTypeChange(val) {
+      if (val === DEVICE_TYPE.NURSE_HOST ||
+          val === DEVICE_TYPE.DOCTOR_HOST ||
+          val === DEVICE_TYPE.LED_SCREEN ||
+          val === DEVICE_TYPE.LCD_SCREEN ||
+          val === DEVICE_TYPE.NURSE_WATCH ||
+          val === DEVICE_TYPE.WORKER_WATCH ||
+          val === DEVICE_TYPE.TRANSFER_DEVICE ||
+          val === DEVICE_TYPE.INFORMATION_BOARD ||
+          val === DEVICE_TYPE.RS485_TRANSFER) {
+        // this.getTypeFrame(this.$store.getters.partId, FRAME_TYPE.PART)
+        this.typeFrames = this.partFrameList
+      } else if (val === DEVICE_TYPE.DOOR_DEVICE ||
+          val === DEVICE_TYPE.SIMULATE_EMERGENCY_BUTTON ||
+          val === DEVICE_TYPE.SIMULATE_DOOR_LIGHT ||
+          val === DEVICE_TYPE.BEACON) {
+        // this.getTypeFrame(this.$store.getters.partId, FRAME_TYPE.ROOM)
+        this.typeFrames = this.roomFrameList
+      } else if (val === DEVICE_TYPE.DIGIT_BED_DEVICE ||
+          val === DEVICE_TYPE.SIMULATE_BED_DEVICE ||
+          val === DEVICE_TYPE.REMOTE_CONTROL ||
+          val === DEVICE_TYPE.CELL_PHONE) {
+        // this.getTypeFrame(this.$store.getters.partId, FRAME_TYPE.BED)
+        this.typeFrames = this.bedFrameList
+      }
     },
     /** 添加设备事件 **/
     handleAdd() {
@@ -521,6 +605,8 @@ export default {
       delete this.deviceModel.id
       this.hasRoleId = false
       this.getRoles({ page_size: 200, page_no: 1, fixedCondition: ' shop_id = -1', sort: ' role_id', dir: 'desc' })
+      this.hasAudioId = false
+      this.getDevices(this.$store.getters.partId)
       this.deviceEditTitle = '添加设备'
       this.deviceDialogVisible = true
       this.deviceTypeDisabled = false // 新增设备可以选择设备类型
@@ -529,8 +615,12 @@ export default {
     /** 修改设备  **/
     handleEdit(params) {
       this.getRoles({ page_size: 200, page_no: 1, fixedCondition: ' shop_id = -1', sort: ' role_id', dir: 'desc' })
+      this.getDevices(this.$store.getters.partId)
       console.log('param', params)
-      this.hasRoleId = params.device_type === 7
+      this.hasRoleId = params.device_type === DEVICE_TYPE.NURSE_WATCH
+      this.hasAudioId = params.device_type === DEVICE_TYPE.SIMULATE_BED_DEVICE ||
+          params.device_type === DEVICE_TYPE.SIMULATE_EMERGENCY_BUTTON ||
+          params.device_type === DEVICE_TYPE.SIMULATE_DOOR_LIGHT
       this.deviceModel = {
         ...params
       }
@@ -582,8 +672,16 @@ export default {
       clerk_API.getRoles(param).then(response => {
         this.rolesOptions = response.data
       })
+    },
+    getDevices(partId) {
+      // 获取设备列表
+      API_Device.getDeviceByType(partId, DEVICE_TYPE.TRANSFER_DEVICE).then(response => {
+        this.audioOptions = response
+      })
+      API_Device.getDeviceByType(partId, DEVICE_TYPE.RS485_TRANSFER).then(response => {
+        this.rs485Options = response
+      })
     }
-
   }
 }
 </script>

+ 68 - 16
src/views/ncs-device/components/deviceManager.vue

@@ -118,7 +118,7 @@
           <el-col :span="12">
             <el-form-item label="设备位置" prop="frame_id">
               <el-select v-model="deviceModel.frame_id" filterable clearable :disabled="frameSelectabled" placeholder="请选择安装位置">
-                <el-option v-for="(item,index) in partFrames" :key="index" :label="item.full_name" :value="item.id" />
+                <el-option v-for="(item,index) in typeFrames" :key="index" :label="item.full_name" :value="item.id" />
               </el-select>
             </el-form-item>
           </el-col>
@@ -187,6 +187,8 @@ import * as API_Device from '@/api/ncs_device'
 import * as API_Frame from '@/api/ncs_hospitalFrame'
 import * as clerk_API from '@/api/ncs_clerk'
 import { DeviceUrl } from '@/utils/domain'
+import { FRAME_TYPE } from '@/utils/FrameTypeEnum'
+import { DEVICE_TYPE } from '@/utils/DeviceTypeEnum'
 export default {
   name: 'DeviceManager',
   components: { ButtonCellRender, ListFilter, RadioFilter },
@@ -258,6 +260,10 @@ export default {
         // ]
       },
       partFrames: [],
+      partFrameList: [],
+      roomFrameList: [],
+      bedFrameList: [],
+      typeFrames: [],
       /** 设备类型转换数组 **/
       deviceTypeTransfer: [
         { key: '护士主机', value: 1 },
@@ -451,6 +457,7 @@ export default {
       this.getPartFrames(this.$store.getters.partId)
     }
     this.initWebSocket()
+    this.getTypeFrame(this.$store.getters.partId)
   },
   methods: {
     windowResize() {
@@ -492,11 +499,22 @@ export default {
       })
     },
     /** 获取科室的所有空间节点 */
-    getPartFrames(partid) {
-      API_Frame.getFramesPartId(partid).then(res => {
+    getPartFrames(partId) {
+      API_Frame.getFramesPartId(partId).then(res => {
         this.partFrames = [...res]
       })
     },
+    getTypeFrame(partId) {
+      API_Frame.getFrameByPartIdAndFrameType(partId, FRAME_TYPE.PART).then(res => {
+        this.partFrameList = [...res]
+      })
+      API_Frame.getFrameByPartIdAndFrameType(partId, FRAME_TYPE.ROOM).then(res => {
+        this.roomFrameList = [...res]
+      })
+      API_Frame.getFrameByPartIdAndFrameType(partId, FRAME_TYPE.BED).then(res => {
+        this.bedFrameList = [...res]
+      })
+    },
 
     /**
          * 过滤状态发生变化,发送到服务器检索数据
@@ -604,18 +622,49 @@ export default {
     },
     /** 设备类型选中变化  **/
     deviceTypeChange(val) {
-      if (val === 12 || val === 13 || val === 14 || val === 21) { // 模拟设备不需要mac地址
+      this.deviceTypeChangeToFrameTypeChange(val)
+      this.$set(this.deviceModel, 'frame_id', null)
+      if (val === DEVICE_TYPE.SIMULATE_BED_DEVICE ||
+          val === DEVICE_TYPE.SIMULATE_EMERGENCY_BUTTON ||
+          val === DEVICE_TYPE.SIMULATE_DOOR_LIGHT ||
+          val === DEVICE_TYPE.EMERGENCY_BUTTON) { // 模拟设备不需要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
+      } else if (val === DEVICE_TYPE.REMOTE_CONTROL) {
         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
       }
-      this.hasRoleId = val === 7
-      this.hasAudioId = val === 12 || val === 13 || val === 14
+      this.hasRoleId = val === DEVICE_TYPE.NURSE_WATCH
+      this.hasAudioId = val === DEVICE_TYPE.SIMULATE_BED_DEVICE ||
+                        val === DEVICE_TYPE.SIMULATE_EMERGENCY_BUTTON ||
+                        val === DEVICE_TYPE.SIMULATE_DOOR_LIGHT
+    },
+    /** 设备类型选中对应的空间结构  **/
+    deviceTypeChangeToFrameTypeChange(val) {
+      if (val === DEVICE_TYPE.NURSE_HOST ||
+          val === DEVICE_TYPE.DOCTOR_HOST ||
+          val === DEVICE_TYPE.LED_SCREEN ||
+          val === DEVICE_TYPE.LCD_SCREEN ||
+          val === DEVICE_TYPE.NURSE_WATCH ||
+          val === DEVICE_TYPE.WORKER_WATCH ||
+          val === DEVICE_TYPE.TRANSFER_DEVICE ||
+          val === DEVICE_TYPE.INFORMATION_BOARD ||
+          val === DEVICE_TYPE.RS485_TRANSFER) {
+        this.typeFrames = this.partFrameList
+      } else if (val === DEVICE_TYPE.DOOR_DEVICE ||
+                 val === DEVICE_TYPE.SIMULATE_EMERGENCY_BUTTON ||
+                 val === DEVICE_TYPE.SIMULATE_DOOR_LIGHT ||
+                 val === DEVICE_TYPE.BEACON) {
+        this.typeFrames = this.roomFrameList
+      } else if (val === DEVICE_TYPE.DIGIT_BED_DEVICE ||
+                 val === DEVICE_TYPE.SIMULATE_BED_DEVICE ||
+                 val === DEVICE_TYPE.REMOTE_CONTROL ||
+                 val === DEVICE_TYPE.CELL_PHONE) {
+        this.typeFrames = this.bedFrameList
+      }
     },
     /** 添加设备事件 **/
     handleAdd() {
@@ -641,12 +690,15 @@ export default {
     /** 修改设备  **/
     handleEdit(params) {
       this.getRoles({ page_size: 200, page_no: 1, fixedCondition: ' shop_id = -1', sort: ' role_id', dir: 'desc' })
-      this.getDevices(this.$store.getters.partId)
-      if (!this.part_view) {
-        this.getPartFrames(params.part_id)
-      }
-      this.hasRoleId = params.device_type === 7
-      this.hasAudioId = params.device_type === 12 || params.device_type === 13 || params.device_type === 14
+      this.getDevices(params.part_id)
+      // if (!this.part_view) {
+      //   this.getPartFrames(params.part_id, params.device_type)
+      // }
+      this.deviceTypeChangeToFrameTypeChange(params.device_type)
+      this.hasRoleId = params.device_type === DEVICE_TYPE.NURSE_WATCH
+      this.hasAudioId = params.device_type === DEVICE_TYPE.SIMULATE_BED_DEVICE ||
+                        params.device_type === DEVICE_TYPE.SIMULATE_EMERGENCY_BUTTON ||
+                        params.device_type === DEVICE_TYPE.SIMULATE_DOOR_LIGHT
       this.deviceModel = {
         ...params
       }
@@ -699,10 +751,10 @@ export default {
     },
     getDevices(partId) {
       // 获取设备列表
-      API_Device.getDeviceByType(partId, 11).then(response => {
+      API_Device.getDeviceByType(partId, DEVICE_TYPE.TRANSFER_DEVICE).then(response => {
         this.audioOptions = response
       })
-      API_Device.getDeviceByType(partId, 20).then(response => {
+      API_Device.getDeviceByType(partId, DEVICE_TYPE.RS485_TRANSFER).then(response => {
         this.rs485Options = response
       })
     },

+ 29 - 22
src/views/ncs-device/device-edit.vue

@@ -145,8 +145,9 @@
 
 <script>
 import * as API_Device from '@/api/ncs_device'
-import { returnDeviceType } from "@/utils/device_type"
-import * as clerk_API from "@/api/ncs_clerk";
+import { returnDeviceType } from '@/utils/device_type'
+import * as clerk_API from '@/api/ncs_clerk'
+import { DEVICE_TYPE } from '@/utils/DeviceTypeEnum'
 
 export default {
 
@@ -248,10 +249,10 @@ export default {
     },
     getDevices(partId) {
       // 获取设备列表
-      API_Device.getDeviceByType(partId, 11).then(response => {
+      API_Device.getDeviceByType(partId, DEVICE_TYPE.TRANSFER_DEVICE).then(response => {
         this.audioOptions = response
       })
-      API_Device.getDeviceByType(partId, 20).then(response => {
+      API_Device.getDeviceByType(partId, DEVICE_TYPE.RS485_TRANSFER).then(response => {
         this.rs485Options = response
       })
     },
@@ -316,31 +317,31 @@ export default {
       this.formmodel.eth_ip = this.nextIp
       this.formmodel.eth_mac = null
       this.wifiHostReadonly = true
-      if (value === 3) {
+      if (value === DEVICE_TYPE.DOOR_DEVICE) {
         this.wifiHostReadonly = false
-      } else if (value === 11) {
+      } else if (value === DEVICE_TYPE.TRANSFER_DEVICE) {
         this.rules.code[0].required = false
-      } else if (value === 12) {
+      } else if (value === DEVICE_TYPE.SIMULATE_BED_DEVICE) {
         this.rules.eth_mac[0].required = false
         this.rules.eth_ip[0].required = false
         this.formmodel.eth_ip = null
         this.formmodel.eth_mac = '1000'
         this.deviceEthIPReadonly = true
-      } else if (value === 13) {
+      } else if (value === DEVICE_TYPE.SIMULATE_EMERGENCY_BUTTON) {
         this.rules.eth_mac[0].required = false
         this.rules.eth_ip[0].required = false
         this.formmodel.eth_ip = null
         this.formmodel.eth_mac = '3000'
         this.deviceEthIPReadonly = true
-      } else if (value === 14) {
+      } else if (value === DEVICE_TYPE.SIMULATE_DOOR_LIGHT) {
         this.rules.eth_mac[0].required = false
         this.rules.eth_ip[0].required = false
         this.formmodel.eth_ip = null
         this.formmodel.eth_mac = '2000'
         this.deviceEthIPReadonly = true
-      } else if (value === 15) {
+      } else if (value === DEVICE_TYPE.REMOTE_CONTROL) {
         this.rules.eth_mac[0].required = true
-      } else if (value === 16) {
+      } else if (value === DEVICE_TYPE.BEACON) {
         this.rules.eth_mac[0].required = true
         this.rules.code[0].required = false
         this.deviceEthIPReadonly = true
@@ -353,23 +354,29 @@ export default {
       this.rules.code[0].required = true // 设备出厂编号 ,总线转换盒不需要填写
       this.deviceEthIPReadonly = false // ip 地址只读
       this.wifiHostReadonly = true
-      if (value === 3) {
+      if (value === DEVICE_TYPE.DOOR_DEVICE) {
         this.wifiHostReadonly = false
-      } else if (value === 11) {
+      } else if (value === DEVICE_TYPE.TRANSFER_DEVICE) {
         this.rules.code[0].required = false
-      } else if (value === 12) {
-        this.rules.eth_mac[0].required = false
-        this.rules.eth_ip[0].required = false
-        this.deviceEthIPReadonly = true
-      } else if (value === 13) {
-        this.rules.eth_mac[0].required = false
-        this.rules.eth_ip[0].required = false
-        this.deviceEthIPReadonly = true
-      } else if (value === 14) {
+      } else if (value === DEVICE_TYPE.SIMULATE_BED_DEVICE ||
+                 value === DEVICE_TYPE.SIMULATE_EMERGENCY_BUTTON ||
+                 value === DEVICE_TYPE.SIMULATE_DOOR_LIGHT
+      ) {
         this.rules.eth_mac[0].required = false
         this.rules.eth_ip[0].required = false
         this.deviceEthIPReadonly = true
       }
+      // } else if (value === DEVICE_TYPE.SIMULATE_EMERGENCY_BUTTON) {
+      //   this.rules.eth_mac[0].required = false
+      //   this.rules.eth_mac[1].pattern = null
+      //   this.rules.eth_ip[0].required = false
+      //   this.deviceEthIPReadonly = true
+      // } else if (value === DEVICE_TYPE.SIMULATE_DOOR_LIGHT) {
+      //   this.rules.eth_mac[0].required = false
+      //   this.rules.eth_mac[1].pattern = null
+      //   this.rules.eth_ip[0].required = false
+      //   this.deviceEthIPReadonly = true
+      // }
     },
     getDeviceById() {
       const _this = this