|
@@ -14,7 +14,8 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="" prop="hardwareTypeId">
|
|
|
- <el-select v-model="queryParams.hardwareTypeId" placeholder="请选择类型" style="width: 200px" @change="typeFun">
|
|
|
+ <el-select v-model="queryParams.hardwareTypeId" placeholder="请选择类型"
|
|
|
+ style="width: 160px">
|
|
|
<el-option
|
|
|
v-for="dict in typeList"
|
|
|
:key="dict.hardwareTypeId"
|
|
@@ -23,36 +24,36 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="" prop="deptId">
|
|
|
- <el-select v-model="queryParams.deptId" placeholder="请选择学院" style="width: 200px">
|
|
|
- <el-option
|
|
|
- v-for="dict in deptOptions"
|
|
|
- :key="dict.deptId"
|
|
|
- :label="dict.deptName"
|
|
|
- :value="dict.deptId"
|
|
|
- />
|
|
|
+ <el-form-item label="" prop="schoolId">
|
|
|
+ <el-select v-model="queryParams.schoolId" @change="changeSchool"
|
|
|
+ placeholder="请选择校区" style="width: 150px">
|
|
|
+ <el-option v-for="(item,index) in schoolOption"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"/>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="" prop="buildId">
|
|
|
+ <el-select v-model="queryParams.buildId" @change="buildSchool"
|
|
|
+ placeholder="请选择楼栋" style="width: 150px">
|
|
|
+ <el-option v-for="(item,index) in buildOption"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<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
|
|
|
- v-for="item in subOptions"
|
|
|
- :key="item.subId"
|
|
|
- :label="item.subName"
|
|
|
- :value="item.subId">
|
|
|
- </el-option>
|
|
|
+ <el-select v-model="queryParams.subjectId"
|
|
|
+ placeholder="请选择实验室" style="width: 150px">
|
|
|
+ <el-option v-for="(item,index) in subjectOption"
|
|
|
+ :key="item.subId"
|
|
|
+ :label="item.subName"
|
|
|
+ :value="item.subId"/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="" prop="operatingState">
|
|
|
- <el-select v-model="queryParams.operatingState" placeholder="请选择工作状态" style="width: 200px">
|
|
|
+ <el-select v-model="queryParams.operatingState" placeholder="请选择工作状态"
|
|
|
+ style="width: 160px">
|
|
|
<el-option
|
|
|
v-for="dict in operatingStateList"
|
|
|
:key="dict.value"
|
|
@@ -62,7 +63,8 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="" prop="state">
|
|
|
- <el-select v-model="queryParams.state" placeholder="请选择状态" style="width: 200px">
|
|
|
+ <el-select v-model="queryParams.state" placeholder="请选择状态"
|
|
|
+ style="width: 160px">
|
|
|
<el-option
|
|
|
v-for="dict in optionList"
|
|
|
:key="dict.value"
|
|
@@ -168,24 +170,6 @@
|
|
|
</el-form-item>
|
|
|
<!--当前类型关联继电器才显示下列配置-->
|
|
|
<div v-if="dialogForm.correlationRelay">
|
|
|
- <el-form-item label="实验室:" prop="subjectId">
|
|
|
- <el-select
|
|
|
- style="width:320px;"
|
|
|
- v-model="dialogForm.subjectId"
|
|
|
- filterable
|
|
|
- remote
|
|
|
- reserve-keyword
|
|
|
- @change="subChange"
|
|
|
- placeholder="请搜索选择实验室"
|
|
|
- :remote-method="subSelectList">
|
|
|
- <el-option
|
|
|
- v-for="item in subOptions"
|
|
|
- :key="item.subId"
|
|
|
- :label="item.subName"
|
|
|
- :value="item.subId">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
<el-form-item label="继电器" prop="relayId" >
|
|
|
<el-select v-model="dialogForm.relayId" placeholder="请选择继电器" style="width: 320px" @change="relayFun">
|
|
|
<el-option
|
|
@@ -230,8 +214,7 @@ import {
|
|
|
iotHardwareList,
|
|
|
iotHardwareDelete, iotHardwareTypeFindHardwareType, iotDeviceFindByType
|
|
|
} from '@/api/iotDevice/index'
|
|
|
-import { systemSubjectGetList } from '@/api/commonality/noPermission'
|
|
|
-import { getDeptDropList } from '@/api/commonality/permission'
|
|
|
+import { systemBuildingGetTreeList,laboratorySubRelInfoGetListByFloor } from "@/api/commonality/permission";
|
|
|
export default {
|
|
|
name: 'index',
|
|
|
data () {
|
|
@@ -250,13 +233,13 @@ import { getDeptDropList } from '@/api/commonality/permission'
|
|
|
page:1,
|
|
|
pageSize:20,
|
|
|
searchValue:"",
|
|
|
- deptId :null,
|
|
|
+ hardwareTypeId :null,
|
|
|
+ schoolId :null,
|
|
|
+ buildId :null,
|
|
|
subjectId :null,
|
|
|
- subjectName :null,
|
|
|
operatingState :null,
|
|
|
state :null,
|
|
|
},
|
|
|
- deptOptions:[],
|
|
|
typeList:[],//类型
|
|
|
relayList:[],//继电器
|
|
|
//列表数据
|
|
@@ -299,15 +282,21 @@ import { getDeptDropList } from '@/api/commonality/permission'
|
|
|
{ required: true, message: "请选择状态", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
],
|
|
|
},
|
|
|
- // 实验室列表
|
|
|
- subOptions:[],
|
|
|
+ //校区楼栋原始数据
|
|
|
+ addressList:[],
|
|
|
+ //校区下拉列表
|
|
|
+ schoolOption:[],
|
|
|
+ //楼栋下拉列表
|
|
|
+ buildOption:[],
|
|
|
+ //实验室下拉列表
|
|
|
+ subjectOption:[],
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
|
|
|
|
},
|
|
|
mounted () {
|
|
|
- this.getDeptDropList();
|
|
|
+ this.systemBuildingGetTreeList();
|
|
|
this.iotHardwareTypeFindHardwareType();
|
|
|
this.getList();
|
|
|
},
|
|
@@ -319,25 +308,21 @@ import { getDeptDropList } from '@/api/commonality/permission'
|
|
|
},
|
|
|
//重置按钮
|
|
|
resetQuery(){
|
|
|
+ this.$set(this,'buildOption',[]);
|
|
|
+ this.$set(this,'subjectOption',[]);
|
|
|
this.$set(this,'queryParams',{
|
|
|
page:1,
|
|
|
pageSize:20,
|
|
|
searchValue:"",
|
|
|
hardwareTypeId :null,
|
|
|
- deptId :null,
|
|
|
+ schoolId :null,
|
|
|
+ buildId :null,
|
|
|
subjectId :null,
|
|
|
- subjectName :null,
|
|
|
operatingState :null,
|
|
|
state :null,
|
|
|
});
|
|
|
this.getList();
|
|
|
},
|
|
|
- //查询学院列表
|
|
|
- getDeptDropList(){
|
|
|
- getDeptDropList({deptName:"",level:2,deptType:1}).then(response => {
|
|
|
- this.$set(this, 'deptOptions', response.data)
|
|
|
- });
|
|
|
- },
|
|
|
//获取类型
|
|
|
iotHardwareTypeFindHardwareType(){
|
|
|
let obj={
|
|
@@ -393,7 +378,6 @@ import { getDeptDropList } from '@/api/commonality/permission'
|
|
|
if(type == 3){
|
|
|
//编辑
|
|
|
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
|
|
@@ -459,6 +443,7 @@ import { getDeptDropList } from '@/api/commonality/permission'
|
|
|
relayBit:'',
|
|
|
state:true,
|
|
|
});
|
|
|
+ this.iotDeviceFindByType()
|
|
|
this.$set(this,'dialogType',true);
|
|
|
},
|
|
|
//dialog提交按钮
|
|
@@ -495,29 +480,45 @@ import { getDeptDropList } from '@/api/commonality/permission'
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- //选中实验室
|
|
|
- subChange(val){
|
|
|
+ //获取校区
|
|
|
+ systemBuildingGetTreeList(){
|
|
|
+ systemBuildingGetTreeList({}).then(response => {
|
|
|
+ let list = [];
|
|
|
+ for(let i=0;i<response.data.length;i++){
|
|
|
+ list.push({
|
|
|
+ id:response.data[i].id,
|
|
|
+ name:response.data[i].name,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.$set(this,'schoolOption',list);
|
|
|
+ this.$set(this,'addressList',response.data);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //校区选中
|
|
|
+ changeSchool(val){
|
|
|
let self = this;
|
|
|
- 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);
|
|
|
+ let list = [];
|
|
|
+ for(let i=0;i<self.addressList.length;i++){
|
|
|
+ if(val == self.addressList[i].id && self.addressList[i].buildFloorVoList[0]){
|
|
|
+ for(let o=0;o<self.addressList[i].buildFloorVoList.length;o++){
|
|
|
+ list.push({
|
|
|
+ id:self.addressList[i].buildFloorVoList[o].id,
|
|
|
+ name:self.addressList[i].buildFloorVoList[o].name,
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- if (this.dialogForm.correlationRelay){
|
|
|
- //如果设备关联有继电器进行查询
|
|
|
- this.iotDeviceFindByType()
|
|
|
- }
|
|
|
+ this.$set(this.queryParams,'buildId',null);
|
|
|
+ this.$set(this.queryParams,'subjectId',null);
|
|
|
+ this.$set(this,'buildOption',list);
|
|
|
+ this.$set(this,'subjectOption',[]);
|
|
|
},
|
|
|
- //搜索实验室
|
|
|
- subSelectList(query){
|
|
|
- if (query !== '' && query.length>1) {
|
|
|
- systemSubjectGetList({"subName":query}).then(response => {
|
|
|
- this.$set(this,'subOptions',response.data);
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.$set(this,'subOptions',[]);
|
|
|
- }
|
|
|
+ //楼栋选中
|
|
|
+ buildSchool(val){
|
|
|
+ laboratorySubRelInfoGetListByFloor({buildId:val}).then(response => {
|
|
|
+ this.$set(this.queryParams,'subjectId',null);
|
|
|
+ this.$set(this,'subjectOption',response.data);
|
|
|
+ })
|
|
|
},
|
|
|
},
|
|
|
}
|