|
@@ -8,24 +8,28 @@
|
|
<el-table-column label="继电器编号" align="left" prop="relayCode" />
|
|
<el-table-column label="继电器编号" align="left" prop="relayCode" />
|
|
<el-table-column label="状态" align="left" >
|
|
<el-table-column label="状态" align="left" >
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <p :class="scope.row.status==4?'table-type-color-ash':(scope.row.status==3?'table-type-color-green':(scope.row.status==0?'table-type-color-red':''))">{{scope.row.status==4?'关闭':(scope.row.status==3?'开启':(scope.row.status==0?'离线':(!scope.row.status?'未知':'')))}}</p>
|
|
|
|
|
|
+ <p v-if="scope.row.pcType == 0" :class="scope.row.status==4?'table-type-color-ash':(scope.row.status==3?'table-type-color-green':(scope.row.status==0?'table-type-color-red':''))">{{scope.row.status==4?'关闭':(scope.row.status==3?'开启':(scope.row.status==0?'离线':(!scope.row.status?'未知':'')))}}</p>
|
|
|
|
+ <p v-if="scope.row.pcType == 1">无</p>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="开关" align="left" >
|
|
<el-table-column label="开关" align="left" >
|
|
<template slot-scope="scope" class="captcha-img">
|
|
<template slot-scope="scope" class="captcha-img">
|
|
- <el-switch
|
|
|
|
- v-if="scope.row.status == 3||scope.row.status == 4"
|
|
|
|
- @click.native="changeIsNeedCaptcha(scope.row)"
|
|
|
|
- class="switch captcha-img"
|
|
|
|
- :active-value="3"
|
|
|
|
- :inactive-value="4"
|
|
|
|
- v-model="scope.row.status"
|
|
|
|
- active-text="开"
|
|
|
|
- inactive-text="关"
|
|
|
|
- disabled
|
|
|
|
- >
|
|
|
|
- </el-switch>
|
|
|
|
- <p v-else :class="scope.row.status==0?'table-type-color-red':''">{{scope.row.status==0?'离线':'未知'}}</p>
|
|
|
|
|
|
+ <div v-if="scope.row.pcType == 0">
|
|
|
|
+ <el-switch
|
|
|
|
+ v-if="scope.row.status == 3||scope.row.status == 4"
|
|
|
|
+ @click.native="changeIsNeedCaptcha(scope.row)"
|
|
|
|
+ class="switch captcha-img"
|
|
|
|
+ :active-value="3"
|
|
|
|
+ :inactive-value="4"
|
|
|
|
+ v-model="scope.row.status"
|
|
|
|
+ active-text="开"
|
|
|
|
+ inactive-text="关"
|
|
|
|
+ disabled
|
|
|
|
+ >
|
|
|
|
+ </el-switch>
|
|
|
|
+ <p v-else :class="scope.row.status==0?'table-type-color-red':''">{{scope.row.status==0?'离线':'未知'}}</p>
|
|
|
|
+ </div>
|
|
|
|
+ <P v-if="scope.row.pcType == 1" style="cursor: pointer;color:#0183FA;" @click="tableButton(scope.row)">操作</P>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="120" v-if="tableButtonType">
|
|
<el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="120" v-if="tableButtonType">
|
|
@@ -87,6 +91,11 @@
|
|
<el-radio :label="item.value" :key="item.value" v-for="item in hardwardTypeList">{{item.label}}</el-radio>
|
|
<el-radio :label="item.value" :key="item.value" v-for="item in hardwardTypeList">{{item.label}}</el-radio>
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item label="通风类型" label-width="1rem">
|
|
|
|
+ <el-radio-group v-model="form.pcType">
|
|
|
|
+ <el-radio :label="item.value" :key="item.value" v-for="item in hardwardTypeListOne">{{item.label}}</el-radio>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ </el-form-item>
|
|
<el-form-item label="绑定继电器" prop="relayCode" v-if="form.hardwareType==1">
|
|
<el-form-item label="绑定继电器" prop="relayCode" v-if="form.hardwareType==1">
|
|
<el-select v-model="form.relayCode" placeholder="请选择继电器" clearable @change="loadRelayNum" @clear="loadClear">
|
|
<el-select v-model="form.relayCode" placeholder="请选择继电器" clearable @change="loadRelayNum" @clear="loadClear">
|
|
<el-option v-for="relay in relayList"
|
|
<el-option v-for="relay in relayList"
|
|
@@ -148,7 +157,7 @@
|
|
import mqtt from 'mqtt'
|
|
import mqtt from 'mqtt'
|
|
import { subjectDictList } from "@/api/laboratory/group";
|
|
import { subjectDictList } from "@/api/laboratory/group";
|
|
import { listDepartments } from "@/api/system/dept";
|
|
import { listDepartments } from "@/api/system/dept";
|
|
- import { listHardware, getHardware, delHardware, addHardware, updateHardware,queryHardwareType,getHardwareDetail,getSubjectLayout,hardWareControl } from "@/api/laboratory/hardware";
|
|
|
|
|
|
+ import { listHardware, getHardware, delHardware, addHardware, updateHardware,queryHardwareType,getHardwareDetail,getSubjectLayout,hardWareControl,controlSwitch } from "@/api/laboratory/hardware";
|
|
|
|
|
|
import { treeselect } from "@/api/system/dept";
|
|
import { treeselect } from "@/api/system/dept";
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
@@ -243,6 +252,10 @@
|
|
{value:1,label:"老继电器"},
|
|
{value:1,label:"老继电器"},
|
|
{value:2,label:"新继电器"}
|
|
{value:2,label:"新继电器"}
|
|
],
|
|
],
|
|
|
|
+ hardwardTypeListOne:[
|
|
|
|
+ {value:0,label:"排风扇"},
|
|
|
|
+ {value:1,label:"通风橱"}
|
|
|
|
+ ],
|
|
mtopic:"lab/hardware/data",
|
|
mtopic:"lab/hardware/data",
|
|
//mqtt发送id数组
|
|
//mqtt发送id数组
|
|
mqttIdList:[],
|
|
mqttIdList:[],
|
|
@@ -271,6 +284,20 @@
|
|
self.relayNumList = list;
|
|
self.relayNumList = list;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ async tableButton(row){
|
|
|
|
+ let self = this;
|
|
|
|
+ this.$confirm(`是否确认操作此设备`, "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "warning"
|
|
|
|
+ }).then(async () => {
|
|
|
|
+ controlSwitch({id:row.id}).then(response => {
|
|
|
|
+ self.msgSuccess(response.msg);
|
|
|
|
+ });
|
|
|
|
+ }).catch(() => {
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 开启关闭验证
|
|
// 开启关闭验证
|
|
async changeIsNeedCaptcha (row) {
|
|
async changeIsNeedCaptcha (row) {
|
|
let self = this;
|
|
let self = this;
|
|
@@ -613,6 +640,7 @@
|
|
this.$set(this.form,'hardwareType',1);
|
|
this.$set(this.form,'hardwareType',1);
|
|
// this.form.type=this.pageType;
|
|
// this.form.type=this.pageType;
|
|
this.$set(this.form,'type',this.pageType);
|
|
this.$set(this.form,'type',this.pageType);
|
|
|
|
+ this.$set(this.form,'pcType',0);
|
|
this.drawer = true;
|
|
this.drawer = true;
|
|
this.title = "添加硬件";
|
|
this.title = "添加硬件";
|
|
this.getHardTypeList();
|
|
this.getHardTypeList();
|