|
@@ -5,56 +5,64 @@
|
|
<div class="page-form-title-box">
|
|
<div class="page-form-title-box">
|
|
<el-form :model="queryParams" class="form-box" ref="queryForm"
|
|
<el-form :model="queryParams" class="form-box" ref="queryForm"
|
|
:inline="true" style="width:100%;">
|
|
:inline="true" style="width:100%;">
|
|
- <el-form-item label="" prop="queryParamsData1">
|
|
|
|
|
|
+ <el-form-item label="" prop="searchValue">
|
|
<el-input
|
|
<el-input
|
|
maxLength="30"
|
|
maxLength="30"
|
|
- v-model="queryParams.queryParamsData1"
|
|
|
|
|
|
+ v-model="queryParams.searchValue"
|
|
placeholder="请输入名称或编号"
|
|
placeholder="请输入名称或编号"
|
|
style="width: 200px"
|
|
style="width: 200px"
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="" prop="queryParamsData2">
|
|
|
|
- <el-select v-model="queryParams.queryParamsData2" placeholder="请选择类型" style="width: 200px">
|
|
|
|
|
|
+ <el-form-item label="" prop="hardwareTypeId">
|
|
|
|
+ <el-select v-model="queryParams.hardwareTypeId" placeholder="请选择类型" style="width: 200px" @change="typeFun">
|
|
<el-option
|
|
<el-option
|
|
- v-for="dict in optionList"
|
|
|
|
- :key="dict.value"
|
|
|
|
- :label="dict.label"
|
|
|
|
- :value="dict.value"
|
|
|
|
|
|
+ v-for="dict in typeList"
|
|
|
|
+ :key="dict.hardwareTypeId"
|
|
|
|
+ :label="dict.hardwareTypeName"
|
|
|
|
+ :value="dict.hardwareTypeId"
|
|
/>
|
|
/>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="" prop="queryParamsData3">
|
|
|
|
- <el-select v-model="queryParams.queryParamsData3" placeholder="请选择学院" style="width: 200px">
|
|
|
|
|
|
+ <el-form-item label="" prop="deptId">
|
|
|
|
+ <el-select v-model="queryParams.deptId" placeholder="请选择学院" style="width: 200px">
|
|
<el-option
|
|
<el-option
|
|
- v-for="dict in optionList"
|
|
|
|
- :key="dict.value"
|
|
|
|
- :label="dict.label"
|
|
|
|
- :value="dict.value"
|
|
|
|
|
|
+ v-for="dict in deptOptions"
|
|
|
|
+ :key="dict.deptId"
|
|
|
|
+ :label="dict.deptName"
|
|
|
|
+ :value="dict.deptId"
|
|
/>
|
|
/>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="" prop="queryParamsData4">
|
|
|
|
- <el-select v-model="queryParams.queryParamsData4" placeholder="请选择实验室" style="width: 200px">
|
|
|
|
|
|
+ <el-form-item label="" prop="subjectId">
|
|
|
|
+ <el-select
|
|
|
|
+ style="width:200px;"
|
|
|
|
+ v-model="queryParams.subjectId"
|
|
|
|
+ filterable
|
|
|
|
+ remote
|
|
|
|
+ reserve-keyword
|
|
|
|
+ @change="subChange"
|
|
|
|
+ placeholder="请搜索选择实验室"
|
|
|
|
+ :remote-method="subSelectList">
|
|
<el-option
|
|
<el-option
|
|
- v-for="dict in optionList"
|
|
|
|
- :key="dict.value"
|
|
|
|
- :label="dict.label"
|
|
|
|
- :value="dict.value"
|
|
|
|
- />
|
|
|
|
|
|
+ v-for="item in subOptions"
|
|
|
|
+ :key="item.subId"
|
|
|
|
+ :label="item.subName"
|
|
|
|
+ :value="item.subId">
|
|
|
|
+ </el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="" prop="queryParamsData5">
|
|
|
|
- <el-select v-model="queryParams.queryParamsData5" placeholder="请选择工作状态" style="width: 200px">
|
|
|
|
|
|
+ <el-form-item label="" prop="operatingState">
|
|
|
|
+ <el-select v-model="queryParams.operatingState" placeholder="请选择工作状态" style="width: 200px">
|
|
<el-option
|
|
<el-option
|
|
- v-for="dict in optionList"
|
|
|
|
|
|
+ v-for="dict in operatingStateList"
|
|
:key="dict.value"
|
|
:key="dict.value"
|
|
:label="dict.label"
|
|
:label="dict.label"
|
|
:value="dict.value"
|
|
:value="dict.value"
|
|
/>
|
|
/>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="" prop="queryParamsData6">
|
|
|
|
- <el-select v-model="queryParams.queryParamsData6" placeholder="请选择状态" style="width: 200px">
|
|
|
|
|
|
+ <el-form-item label="" prop="state">
|
|
|
|
+ <el-select v-model="queryParams.state" placeholder="请选择状态" style="width: 200px">
|
|
<el-option
|
|
<el-option
|
|
v-for="dict in optionList"
|
|
v-for="dict in optionList"
|
|
:key="dict.value"
|
|
:key="dict.value"
|
|
@@ -74,12 +82,21 @@
|
|
</div>
|
|
</div>
|
|
<div class="page-content-box">
|
|
<div class="page-content-box">
|
|
<el-table class="table-box" v-loading="loading" border :data="dataList">
|
|
<el-table class="table-box" v-loading="loading" border :data="dataList">
|
|
- <el-table-column label="设备名" prop="name" show-overflow-tooltip/>
|
|
|
|
- <el-table-column label="编号" prop="content" width="200" show-overflow-tooltip/>
|
|
|
|
- <el-table-column label="设备类型" prop="content" width="200" show-overflow-tooltip/>
|
|
|
|
- <el-table-column label="实验室" prop="content" width="200" show-overflow-tooltip/>
|
|
|
|
- <el-table-column label="继电器" prop="content" width="200" show-overflow-tooltip/>
|
|
|
|
- <el-table-column label="工作状态" prop="content" width="200" show-overflow-tooltip/>
|
|
|
|
|
|
+ <el-table-column label="设备名" prop="hardwareName" show-overflow-tooltip/>
|
|
|
|
+ <el-table-column label="编号" prop="hardwareNo" width="200" show-overflow-tooltip/>
|
|
|
|
+ <el-table-column label="设备类型" prop="hardwareTypeName" width="200" show-overflow-tooltip/>
|
|
|
|
+ <el-table-column label="实验室" prop="subjectName" width="200" show-overflow-tooltip>
|
|
|
|
+ <template slot-scope="scope">{{scope.row.subjectName?scope.row.subjectName:'-'}}</template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="继电器" prop="relayNum" width="200" show-overflow-tooltip>
|
|
|
|
+ <template slot-scope="scope">{{scope.row.relayNum?scope.row.relayNum:'-'}}</template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="工作状态" prop="operatingState" width="200" show-overflow-tooltip>
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span v-if="scope.row.operatingState" style="color: #0183FA">运行中</span>
|
|
|
|
+ <span v-if="!scope.row.operatingState">未运行</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
<el-table-column label="状态" prop="state" width="100" show-overflow-tooltip>
|
|
<el-table-column label="状态" prop="state" width="100" show-overflow-tooltip>
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-switch
|
|
<el-switch
|
|
@@ -133,28 +150,28 @@
|
|
:close-on-click-modal="false" :close-on-press-escape="false">
|
|
:close-on-click-modal="false" :close-on-press-escape="false">
|
|
<el-form :model="dialogForm" ref="dialogForm" :inline="true"
|
|
<el-form :model="dialogForm" ref="dialogForm" :inline="true"
|
|
:rules="dialogRules" class="addCheckPage-min" label-width="120px">
|
|
:rules="dialogRules" class="addCheckPage-min" label-width="120px">
|
|
- <el-form-item label="名称" prop="data1">
|
|
|
|
- <el-input v-model="dialogForm.data1" placeholder="请输入名称" maxLength="10" style="width:320px;"/>
|
|
|
|
|
|
+ <el-form-item label="名称" prop="hardwareName">
|
|
|
|
+ <el-input v-model="dialogForm.hardwareName" placeholder="请输入名称" maxLength="10" style="width:320px;"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="编号" prop="data2">
|
|
|
|
- <el-input v-model="dialogForm.data2" placeholder="请输入编号" maxLength="10" style="width:320px;"/>
|
|
|
|
|
|
+ <el-form-item label="编号" prop="hardwareNo">
|
|
|
|
+ <el-input v-model="dialogForm.hardwareNo" placeholder="请输入编号" maxLength="10" style="width:320px;"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="类型" prop="data3">
|
|
|
|
- <el-select v-model="dialogForm.data3" placeholder="请选择类型" style="width: 320px">
|
|
|
|
|
|
+ <el-form-item label="类型" prop="hardwareTypeId">
|
|
|
|
+ <el-select v-model="dialogForm.hardwareTypeId" placeholder="请选择类型" style="width: 320px" @change="typeFun">
|
|
<el-option
|
|
<el-option
|
|
- v-for="dict in optionList"
|
|
|
|
- :key="dict.value"
|
|
|
|
- :label="dict.label"
|
|
|
|
- :value="dict.value"
|
|
|
|
|
|
+ v-for="dict in typeList"
|
|
|
|
+ :key="dict.hardwareTypeId"
|
|
|
|
+ :label="dict.hardwareTypeName"
|
|
|
|
+ :value="dict.hardwareTypeId"
|
|
/>
|
|
/>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<!--当前类型关联继电器才显示下列配置-->
|
|
<!--当前类型关联继电器才显示下列配置-->
|
|
- <div>
|
|
|
|
- <el-form-item label="实验室:" prop="data4">
|
|
|
|
|
|
+ <div v-if="dialogForm.correlationRelay">
|
|
|
|
+ <el-form-item label="实验室:" prop="subjectId">
|
|
<el-select
|
|
<el-select
|
|
style="width:320px;"
|
|
style="width:320px;"
|
|
- v-model="dialogForm.data4"
|
|
|
|
|
|
+ v-model="dialogForm.subjectId"
|
|
filterable
|
|
filterable
|
|
remote
|
|
remote
|
|
reserve-keyword
|
|
reserve-keyword
|
|
@@ -169,20 +186,20 @@
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="继电器" prop="data5">
|
|
|
|
- <el-select v-model="dialogForm.data5" placeholder="请选择继电器" style="width: 320px">
|
|
|
|
|
|
+ <el-form-item label="继电器" prop="relayId" >
|
|
|
|
+ <el-select v-model="dialogForm.relayId" placeholder="请选择继电器" style="width: 320px" @change="relayFun">
|
|
<el-option
|
|
<el-option
|
|
- v-for="dict in optionList"
|
|
|
|
- :key="dict.value"
|
|
|
|
- :label="dict.label"
|
|
|
|
- :value="dict.value"
|
|
|
|
|
|
+ v-for="dict in relayList"
|
|
|
|
+ :key="dict.id"
|
|
|
|
+ :label="dict.deviceName"
|
|
|
|
+ :value="dict.id"
|
|
/>
|
|
/>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="端子" prop="data6">
|
|
|
|
- <el-select v-model="dialogForm.data6" placeholder="请选择继电器端子" style="width: 320px">
|
|
|
|
|
|
+ <el-form-item label="端子" prop="relayBit">
|
|
|
|
+ <el-select v-model="dialogForm.relayBit" placeholder="请选择继电器" style="width: 320px">
|
|
<el-option
|
|
<el-option
|
|
- v-for="dict in optionList"
|
|
|
|
|
|
+ v-for="dict in terminalList"
|
|
:key="dict.value"
|
|
:key="dict.value"
|
|
:label="dict.label"
|
|
:label="dict.label"
|
|
:value="dict.value"
|
|
:value="dict.value"
|
|
@@ -190,8 +207,8 @@
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</div>
|
|
</div>
|
|
- <el-form-item label="状态" prop="data7">
|
|
|
|
- <el-radio-group v-model="dialogForm.data7">
|
|
|
|
|
|
+ <el-form-item label="状态" prop="state">
|
|
|
|
+ <el-radio-group v-model="dialogForm.state">
|
|
<el-radio :label="true" style="margin-left:20px;">启用</el-radio>
|
|
<el-radio :label="true" style="margin-left:20px;">启用</el-radio>
|
|
<el-radio :label="false">禁用</el-radio>
|
|
<el-radio :label="false">禁用</el-radio>
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
@@ -204,19 +221,19 @@
|
|
<p class="dialog-footer-button-null"></p>
|
|
<p class="dialog-footer-button-null"></p>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
- <!--<add-page :propsData="propsData" v-if="pageType === 2"></add-page>-->
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
- //import { getDicts } from "@/api/commonality/noPermission";
|
|
|
|
- //import { systemUserSelect } from "@/api/commonality/permission";
|
|
|
|
- //import { getInfo } from "@/api/basicsModules/index";
|
|
|
|
- //import addPage from "./addPage.vue";
|
|
|
|
|
|
+import {
|
|
|
|
+ iotHardwareAdd,
|
|
|
|
+ iotHardwareUpdate,
|
|
|
|
+ iotHardwareList,
|
|
|
|
+ iotHardwareDelete, iotHardwareTypeFindHardwareType, iotDeviceFindByType
|
|
|
|
+} from '@/api/iotDevice/index'
|
|
|
|
+import { systemSubjectGetList } from '@/api/commonality/noPermission'
|
|
|
|
+import { getDeptDropList } from '@/api/commonality/permission'
|
|
export default {
|
|
export default {
|
|
name: 'index',
|
|
name: 'index',
|
|
- //components: {
|
|
|
|
- // addPage
|
|
|
|
- //},
|
|
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
tableButtonType:this.hasPermiDom(['demo:demo:detail','demo:demo:edit','demo:demo:del',]),
|
|
tableButtonType:this.hasPermiDom(['demo:demo:detail','demo:demo:edit','demo:demo:del',]),
|
|
@@ -226,13 +243,22 @@
|
|
loading:false,
|
|
loading:false,
|
|
//下拉列表数据
|
|
//下拉列表数据
|
|
optionList:[{value:true,label:'启用'},{value:false,label:'停用'}],
|
|
optionList:[{value:true,label:'启用'},{value:false,label:'停用'}],
|
|
|
|
+ operatingStateList:[{value:true,label:'运行中'},{value:false,label:'未运行'}],
|
|
|
|
+ terminalList:[{value:1,label:'1'},{value:2,label:'2'},{value:3,label:'3'},{value:4,label:'4'},{value:5,label:'5'},{value:6,label:'6'},{value:7,label:'7'},{value:8,label:'8'}],
|
|
//查询条件
|
|
//查询条件
|
|
queryParams:{
|
|
queryParams:{
|
|
page:1,
|
|
page:1,
|
|
pageSize:20,
|
|
pageSize:20,
|
|
- queryParamsData1:"",
|
|
|
|
- queryParamsData2 :null,
|
|
|
|
|
|
+ searchValue:"",
|
|
|
|
+ deptId :null,
|
|
|
|
+ subjectId :null,
|
|
|
|
+ subjectName :null,
|
|
|
|
+ operatingState :null,
|
|
|
|
+ state :null,
|
|
},
|
|
},
|
|
|
|
+ deptOptions:[],
|
|
|
|
+ typeList:[],//类型
|
|
|
|
+ relayList:[],//继电器
|
|
//列表数据
|
|
//列表数据
|
|
dataList:[],
|
|
dataList:[],
|
|
//数据数量
|
|
//数据数量
|
|
@@ -244,31 +270,31 @@
|
|
dialogType:false,
|
|
dialogType:false,
|
|
dialogForm:{},
|
|
dialogForm:{},
|
|
dialogRules:{
|
|
dialogRules:{
|
|
- data1: [
|
|
|
|
|
|
+ hardwareName: [
|
|
{ required: true, message: "请输入名称", trigger: "blur" },
|
|
{ required: true, message: "请输入名称", trigger: "blur" },
|
|
{ required: true, message: "请输入名称", validator: this.spaceJudgment, trigger: "blur" }
|
|
{ required: true, message: "请输入名称", validator: this.spaceJudgment, trigger: "blur" }
|
|
],
|
|
],
|
|
- data2: [
|
|
|
|
|
|
+ hardwareNo: [
|
|
{ required: true, message: "请输入编号", trigger: "blur" },
|
|
{ required: true, message: "请输入编号", trigger: "blur" },
|
|
{ required: true, message: "请输入编号", validator: this.spaceJudgment, trigger: "blur" }
|
|
{ required: true, message: "请输入编号", validator: this.spaceJudgment, trigger: "blur" }
|
|
],
|
|
],
|
|
- data3: [
|
|
|
|
|
|
+ hardwareTypeId: [
|
|
{ required: true, message: "请选择类型", trigger: "blur" },
|
|
{ required: true, message: "请选择类型", trigger: "blur" },
|
|
{ required: true, message: "请选择类型", validator: this.spaceJudgment, trigger: "blur" }
|
|
{ required: true, message: "请选择类型", validator: this.spaceJudgment, trigger: "blur" }
|
|
],
|
|
],
|
|
- data4: [
|
|
|
|
|
|
+ subjectId: [
|
|
{ required: true, message: "请搜索选择实验室", trigger: "blur" },
|
|
{ required: true, message: "请搜索选择实验室", trigger: "blur" },
|
|
{ required: true, message: "请搜索选择实验室", validator: this.spaceJudgment, trigger: "blur" }
|
|
{ required: true, message: "请搜索选择实验室", validator: this.spaceJudgment, trigger: "blur" }
|
|
],
|
|
],
|
|
- data5: [
|
|
|
|
|
|
+ relayId: [
|
|
{ required: true, message: "请选择继电器", trigger: "blur" },
|
|
{ required: true, message: "请选择继电器", trigger: "blur" },
|
|
{ required: true, message: "请选择继电器", validator: this.spaceJudgment, trigger: "blur" }
|
|
{ required: true, message: "请选择继电器", validator: this.spaceJudgment, trigger: "blur" }
|
|
],
|
|
],
|
|
- data6: [
|
|
|
|
|
|
+ relayBit: [
|
|
{ required: true, message: "请选择继电器端子", trigger: "blur" },
|
|
{ required: true, message: "请选择继电器端子", trigger: "blur" },
|
|
{ required: true, message: "请选择继电器端子", validator: this.spaceJudgment, trigger: "blur" }
|
|
{ required: true, message: "请选择继电器端子", validator: this.spaceJudgment, trigger: "blur" }
|
|
],
|
|
],
|
|
- data7: [
|
|
|
|
|
|
+ state: [
|
|
{ required: true, message: "请选择状态", trigger: "blur" },
|
|
{ required: true, message: "请选择状态", trigger: "blur" },
|
|
{ required: true, message: "请选择状态", validator: this.spaceJudgment, trigger: "blur" }
|
|
{ required: true, message: "请选择状态", validator: this.spaceJudgment, trigger: "blur" }
|
|
],
|
|
],
|
|
@@ -281,7 +307,9 @@
|
|
|
|
|
|
},
|
|
},
|
|
mounted () {
|
|
mounted () {
|
|
- //this.getList();
|
|
|
|
|
|
+ this.getDeptDropList();
|
|
|
|
+ this.iotHardwareTypeFindHardwareType();
|
|
|
|
+ this.getList();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
//查询按钮
|
|
//查询按钮
|
|
@@ -294,27 +322,87 @@
|
|
this.$set(this,'queryParams',{
|
|
this.$set(this,'queryParams',{
|
|
page:1,
|
|
page:1,
|
|
pageSize:20,
|
|
pageSize:20,
|
|
- queryParamsData1:"",
|
|
|
|
- queryParamsData2 :null,
|
|
|
|
|
|
+ searchValue:"",
|
|
|
|
+ hardwareTypeId :null,
|
|
|
|
+ deptId :null,
|
|
|
|
+ subjectId :null,
|
|
|
|
+ subjectName :null,
|
|
|
|
+ operatingState :null,
|
|
|
|
+ state :null,
|
|
});
|
|
});
|
|
this.getList();
|
|
this.getList();
|
|
},
|
|
},
|
|
|
|
+ //查询学院列表
|
|
|
|
+ getDeptDropList(){
|
|
|
|
+ getDeptDropList({deptName:"",level:2,deptType:1}).then(response => {
|
|
|
|
+ this.$set(this, 'deptOptions', response.data)
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ //获取类型
|
|
|
|
+ iotHardwareTypeFindHardwareType(){
|
|
|
|
+ let obj={
|
|
|
|
+ searchValue:'',
|
|
|
|
+ }
|
|
|
|
+ iotHardwareTypeFindHardwareType(obj).then(response => {
|
|
|
|
+ this.$set(this,'typeList',response.data);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ //类型选中
|
|
|
|
+ typeFun(){
|
|
|
|
+ for (let i=0;i<this.typeList.length;i++){
|
|
|
|
+ if(this.dialogForm.hardwareTypeId==this.typeList[i].hardwareTypeId){
|
|
|
|
+ this.$set(this.dialogForm,'correlationRelay',this.typeList[i].correlationRelay);
|
|
|
|
+ this.$set(this.dialogForm,'hardwareTypeName',this.typeList[i].hardwareTypeName);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //继电器
|
|
|
|
+ relayFun(){
|
|
|
|
+ for (let i=0;i<this.relayList.length;i++){
|
|
|
|
+ if(this.dialogForm.relayId==this.relayList[i].id){
|
|
|
|
+ this.$set(this.dialogForm,'relayNum',this.relayList[i].deviceNo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //根据类型查询物联设备
|
|
|
|
+ iotDeviceFindByType(){
|
|
|
|
+ let obj={
|
|
|
|
+ searchValue:'',
|
|
|
|
+ subjectId:this.dialogForm.subjectId,
|
|
|
|
+ typeKey:'relay',//(relay 继电器,sensor 传感器)
|
|
|
|
+ }
|
|
|
|
+ iotDeviceFindByType(obj).then(response => {
|
|
|
|
+ this.$set(this,'relayList',response.data);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
//获取数据列表
|
|
//获取数据列表
|
|
getList(){
|
|
getList(){
|
|
this.$set(this,'loading',true);
|
|
this.$set(this,'loading',true);
|
|
let obj = JSON.parse(JSON.stringify(this.queryParams))
|
|
let obj = JSON.parse(JSON.stringify(this.queryParams))
|
|
- getListFunction(obj).then(response => {
|
|
|
|
|
|
+ iotHardwareList(obj).then(response => {
|
|
this.$set(this,'loading',false);
|
|
this.$set(this,'loading',false);
|
|
this.$set(this,'dataList',response.data.records);
|
|
this.$set(this,'dataList',response.data.records);
|
|
this.$set(this,'total',response.data.total);
|
|
this.$set(this,'total',response.data.total);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+
|
|
//操作按钮
|
|
//操作按钮
|
|
tableButton(type,row){
|
|
tableButton(type,row){
|
|
let self = this;
|
|
let self = this;
|
|
if(type == 3){
|
|
if(type == 3){
|
|
//编辑
|
|
//编辑
|
|
let obj = JSON.parse(JSON.stringify(row))
|
|
let obj = JSON.parse(JSON.stringify(row))
|
|
|
|
+ this.subSelectList(obj.subjectName)
|
|
|
|
+ for (let i=0;i<this.typeList.length;i++){
|
|
|
|
+ if (obj.hardwareTypeId==this.typeList[i].hardwareTypeId){
|
|
|
|
+ obj.correlationRelay=this.typeList[i].correlationRelay
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (obj.correlationRelay){
|
|
|
|
+ //如果设备关联有继电器进行查询
|
|
|
|
+ this.iotDeviceFindByType()
|
|
|
|
+ }
|
|
this.$set(this,'dialogForm',obj);
|
|
this.$set(this,'dialogForm',obj);
|
|
this.$set(this,'dialogType',true);
|
|
this.$set(this,'dialogType',true);
|
|
}else if(type == 4){
|
|
}else if(type == 4){
|
|
@@ -325,7 +413,7 @@
|
|
type: "warning"
|
|
type: "warning"
|
|
}).then(function() {
|
|
}).then(function() {
|
|
}).then(() => {
|
|
}).then(() => {
|
|
- deleteFunction({id:row.id}).then(response => {
|
|
|
|
|
|
+ iotHardwareDelete({id:row.id}).then(response => {
|
|
self.msgSuccess(response.message)
|
|
self.msgSuccess(response.message)
|
|
self.getList();
|
|
self.getList();
|
|
});
|
|
});
|
|
@@ -339,7 +427,7 @@
|
|
type: "warning"
|
|
type: "warning"
|
|
}).then(function() {
|
|
}).then(function() {
|
|
}).then(() => {
|
|
}).then(() => {
|
|
- stateFunction({id:row.id,state:!row.state,}).then(response => {
|
|
|
|
|
|
+ iotHardwareUpdate({id:row.id,state:!row.state,}).then(response => {
|
|
self.msgSuccess(response.message)
|
|
self.msgSuccess(response.message)
|
|
self.getList();
|
|
self.getList();
|
|
});
|
|
});
|
|
@@ -359,13 +447,16 @@
|
|
dialogFormReset(){
|
|
dialogFormReset(){
|
|
this.$set(this,'dialogTitle','新增');
|
|
this.$set(this,'dialogTitle','新增');
|
|
this.$set(this,'dialogForm',{
|
|
this.$set(this,'dialogForm',{
|
|
- name:"",
|
|
|
|
- code:"",
|
|
|
|
- attrName:"",
|
|
|
|
- unit:"",
|
|
|
|
- icon:"",
|
|
|
|
- exceptionIcon:"",
|
|
|
|
- sort:1,
|
|
|
|
|
|
+ hardwareName:"",
|
|
|
|
+ hardwareNo:"",
|
|
|
|
+ hardwareTypeId:"",
|
|
|
|
+ hardwareTypeName:"",
|
|
|
|
+ correlationRelay:"",
|
|
|
|
+ subjectId:"",
|
|
|
|
+ subjectName:"",
|
|
|
|
+ relayId:"",
|
|
|
|
+ relayNum:'',
|
|
|
|
+ relayBit:'',
|
|
state:true,
|
|
state:true,
|
|
});
|
|
});
|
|
this.$set(this,'dialogType',true);
|
|
this.$set(this,'dialogType',true);
|
|
@@ -375,30 +466,27 @@
|
|
this.$refs["dialogForm"].validate(valid => {
|
|
this.$refs["dialogForm"].validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
let obj = {
|
|
let obj = {
|
|
- typeId:this.propsData.typeId,
|
|
|
|
- typeKey:this.propsData.typeKey,
|
|
|
|
- name:this.dialogForm.name,
|
|
|
|
- code:this.dialogForm.code,
|
|
|
|
- attrName:this.dialogForm.attrName,
|
|
|
|
- unit:this.dialogForm.unit,
|
|
|
|
- sort:this.dialogForm.sort,
|
|
|
|
- threshhold:this.dialogForm.threshhold?this.dialogForm.threshhold:0,
|
|
|
|
- isFluctuation:this.dialogForm.isFluctuation?this.dialogForm.isFluctuation:false,
|
|
|
|
- fluctuationDirection:this.dialogForm.fluctuationDirection,
|
|
|
|
- fluctuationRange:this.dialogForm.fluctuationRange?this.dialogForm.fluctuationRange:0,
|
|
|
|
- remark:this.dialogForm.remark,
|
|
|
|
- icon:this.dialogForm.icon,
|
|
|
|
- exceptionIcon:this.dialogForm.exceptionIcon,
|
|
|
|
|
|
+ id:this.dialogForm.id,
|
|
|
|
+ hardwareName:this.dialogForm.hardwareName,
|
|
|
|
+ hardwareNo:this.dialogForm.hardwareNo,
|
|
|
|
+ hardwareTypeId:this.dialogForm.hardwareTypeId,
|
|
|
|
+ hardwareTypeName:this.dialogForm.hardwareTypeName,
|
|
|
|
+ correlationRelay:this.dialogForm.correlationRelay,
|
|
|
|
+ subjectId:this.dialogForm.subjectId,
|
|
|
|
+ subjectName:this.dialogForm.subjectName,
|
|
|
|
+ relayId:this.dialogForm.relayId,
|
|
|
|
+ relayNum:this.dialogForm.relayNum,
|
|
|
|
+ relayBit:this.dialogForm.relayBit,
|
|
|
|
+ state:this.dialogForm.state,
|
|
}
|
|
}
|
|
if(this.dialogForm.id){
|
|
if(this.dialogForm.id){
|
|
- obj.id = this.dialogForm.id;
|
|
|
|
- iotAttributeUpdate(obj).then(response => {
|
|
|
|
|
|
+ iotHardwareUpdate(obj).then(response => {
|
|
this.msgSuccess(response.message)
|
|
this.msgSuccess(response.message)
|
|
this.dialogOff();
|
|
this.dialogOff();
|
|
this.getList();
|
|
this.getList();
|
|
});
|
|
});
|
|
}else{
|
|
}else{
|
|
- iotAttributeAdd(obj).then(response => {
|
|
|
|
|
|
+ iotHardwareAdd(obj).then(response => {
|
|
this.msgSuccess(response.message)
|
|
this.msgSuccess(response.message)
|
|
this.dialogOff();
|
|
this.dialogOff();
|
|
this.getList();
|
|
this.getList();
|
|
@@ -410,20 +498,24 @@
|
|
//选中实验室
|
|
//选中实验室
|
|
subChange(val){
|
|
subChange(val){
|
|
let self = this;
|
|
let self = this;
|
|
- // console.log(val)
|
|
|
|
- // for(let i=0;i<self.optionsUser.length;i++){
|
|
|
|
- // if(self.optionsUser[i].userId == val){
|
|
|
|
- // this.$set(this,'shadeName',self.optionsUser[i].userName);
|
|
|
|
- // this.$set(this,'shadeMobile',self.optionsUser[i].mobile);
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
|
|
+ console.log(val)
|
|
|
|
+ for(let i=0;i<self.subOptions.length;i++){
|
|
|
|
+ if(self.subOptions[i].subId == val){
|
|
|
|
+ this.$set(this.dialogForm,'subjectName',self.subOptions[i].subName);
|
|
|
|
+ this.$set(this.dialogForm,'subjectId',self.subOptions[i].subId);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (this.dialogForm.correlationRelay){
|
|
|
|
+ //如果设备关联有继电器进行查询
|
|
|
|
+ this.iotDeviceFindByType()
|
|
|
|
+ }
|
|
},
|
|
},
|
|
//搜索实验室
|
|
//搜索实验室
|
|
subSelectList(query){
|
|
subSelectList(query){
|
|
if (query !== '' && query.length>1) {
|
|
if (query !== '' && query.length>1) {
|
|
- // systemUserSelectUser({"userName":query,'userType':'1'}).then(response => {
|
|
|
|
- // this.$set(this,'userOptions',response.data);
|
|
|
|
- // });
|
|
|
|
|
|
+ systemSubjectGetList({"subName":query}).then(response => {
|
|
|
|
+ this.$set(this,'subOptions',response.data);
|
|
|
|
+ });
|
|
} else {
|
|
} else {
|
|
this.$set(this,'subOptions',[]);
|
|
this.$set(this,'subOptions',[]);
|
|
}
|
|
}
|