heyang 2 年之前
父節點
當前提交
747f4368aa

+ 22 - 0
src/views/comprehensive/laboratoryManagement/subject/deviceList.vue

@@ -93,6 +93,15 @@
       <el-dialog :title="title" :visible.sync="addType" v-if="addType" width="500px" append-to-body>
         <el-form ref="form" :model="form" :rules="rules" label-width="110px">
           <div v-if="upType == 1 || upType == 5">
+            <el-form-item label="传感器名称"  prop="name">
+              <el-input
+                v-model="form.name"
+                placeholder="请输入名称"
+                clearable
+                size="small"
+                maxLength="8"
+              />
+            </el-form-item>
             <el-form-item label="传感器类型" prop="type">
               <el-select v-model="form.type" placeholder="请选择传感器类型" style="width:320px;">
                 <el-option
@@ -182,6 +191,15 @@
             </el-form-item>
           </div>
           <div v-if="upType == 4 || upType == 8">
+            <el-form-item label="摄像头名称"  prop="name">
+              <el-input
+                v-model="form.name"
+                placeholder="请输入名称"
+                clearable
+                size="small"
+                maxLength="8"
+              />
+            </el-form-item>
             <el-form-item label="摄像头编号" prop="hardwareNum">
               <el-input v-model="form.hardwareNum" placeholder="摄像头编号"
                         maxlength="30" style="width:320px;"/>
@@ -299,6 +317,7 @@ import { getSensorList } from "@/api/laboratory/sensor";
         addHardwareThree(){
           let obj = {
             type:4,
+            name:this.form.name,
             hardwareNum:this.form.hardwareNum,
             subjectId:this.subjectData.id,
             deptId:this.subjectData.deptId,
@@ -314,6 +333,7 @@ import { getSensorList } from "@/api/laboratory/sensor";
         putHardwareThree(){
           let obj = {
             id:this.form.id,
+            name:this.form.name,
             hardwareNum:this.form.hardwareNum,
             subjectId:this.form.subjectId,
             deptId:this.form.deptId,
@@ -450,6 +470,7 @@ import { getSensorList } from "@/api/laboratory/sensor";
         //添加传感器
         addSensor(){
           let obj = {
+            name:this.form.name,
             type:this.form.type,
             gatewayId:this.form.gatewayId,
             routeNum:this.form.routeNum,
@@ -466,6 +487,7 @@ import { getSensorList } from "@/api/laboratory/sensor";
         //编辑传感器
         putSensor(){
           let obj = {
+            name:this.form.name,
             type:this.form.type,
             id:this.form.id,
             gatewayId:this.form.gatewayId,

+ 2 - 2
src/views/comprehensive/laboratoryManagement/subject/index.vue

@@ -134,7 +134,7 @@
               <div class="switch-for-max-box" v-show="checkedSubject.labHardwareVOList" v-hasPermi="['laboratory:subcontrol:set']">
                 <div class="switch-for-big-box" v-for="(item,index) in checkedSubject.labHardwareVOList" :key="index">
                   <div class="switch-for-min-box" v-if="item.hardwareTypeEnum.enumName == 'SWITCH'">
-                    <p class="switch-for-min-title">电源控制</p>
+                    <p class="switch-for-min-title">{{item.hardwareName}}</p>
                     <el-switch
                       v-if="item.state.code == 3||item.state.code == 4"
                       class="switch"
@@ -149,7 +149,7 @@
                     <p class="switch-null-p" v-else>{{item.state.name}}</p>
                   </div>
                   <div class="switch-for-min-box" v-if="item.hardwareTypeEnum.enumName == 'AI_VENTILATION'">
-                    <p class="switch-for-min-title">智能通风</p>
+                    <p class="switch-for-min-title">{{item.hardwareName}}</p>
                     <el-switch
                       v-if="item.state.code == 3||item.state.code == 4"
                       class="switch"