|
@@ -84,14 +84,14 @@
|
|
</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="hardwareName" 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="hardwareNo" width="200" show-overflow-tooltip/>
|
|
<el-table-column label="设备类型" prop="hardwareTypeName" 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>
|
|
<el-table-column label="实验室" prop="subjectName" width="200" show-overflow-tooltip>
|
|
<template slot-scope="scope">{{scope.row.subjectName?scope.row.subjectName:'-'}}</template>
|
|
<template slot-scope="scope">{{scope.row.subjectName?scope.row.subjectName:'-'}}</template>
|
|
</el-table-column>
|
|
</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 label="物联编号" prop="relayNum" width="200" show-overflow-tooltip>
|
|
|
|
+ <template slot-scope="scope">{{scope.row.deviceNo?scope.row.deviceNo:'-'}}</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="工作状态" prop="operatingState" width="100" show-overflow-tooltip>
|
|
<el-table-column label="工作状态" prop="operatingState" width="100" show-overflow-tooltip>
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
@@ -118,7 +118,7 @@
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="创建时间" prop="createTime" width="200" show-overflow-tooltip>
|
|
<el-table-column label="创建时间" prop="createTime" width="200" show-overflow-tooltip>
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <span>{{ parseTime(scope.row.createTime,"{y}-{m}-{d} {h}:{i}") }}</span>
|
|
|
|
|
|
+ <span>{{ parseTime(scope.row.createTime,'{y}-{m}-{d} {h}:{i}') }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="操作" width="200" show-overflow-tooltip v-if="tableButtonType">
|
|
<el-table-column label="操作" width="200" show-overflow-tooltip v-if="tableButtonType">
|
|
@@ -172,35 +172,34 @@
|
|
/>
|
|
/>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <!--当前类型关联继电器才显示下列配置-->
|
|
|
|
- <div v-if="dialogForm.correlationRelay">
|
|
|
|
- <el-form-item label="继电器" prop="relayId" >
|
|
|
|
- <el-select v-model="dialogForm.relayId" placeholder="请选择继电器" style="width: 320px" @change="relayFun">
|
|
|
|
- <el-option
|
|
|
|
- v-for="dict in relayList"
|
|
|
|
- :key="dict.id"
|
|
|
|
- :label="dict.deviceName"
|
|
|
|
- :value="dict.id"
|
|
|
|
- />
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="端子" prop="relayBit">
|
|
|
|
- <el-select v-model="dialogForm.relayBit" placeholder="请选择继电器" style="width: 320px">
|
|
|
|
- <el-option
|
|
|
|
- v-for="dict in terminalList"
|
|
|
|
- :key="dict.value"
|
|
|
|
- :label="dict.label"
|
|
|
|
- :value="dict.value"
|
|
|
|
- />
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <el-form-item label="物联设备" prop="deviceId">
|
|
|
|
+ <el-select v-model="dialogForm.deviceId" @change="deviceChange" placeholder="请选择物联设备" style="width: 320px">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="dict in relayList"
|
|
|
|
+ :key="dict.id"
|
|
|
|
+ :label="dict.deviceName"
|
|
|
|
+ :value="dict.id"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
<el-form-item label="状态" prop="state">
|
|
<el-form-item label="状态" prop="state">
|
|
<el-radio-group v-model="dialogForm.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>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item label="参数 A" prop="reservedOne">
|
|
|
|
+ <el-input v-model="dialogForm.reservedOne" placeholder="请输入名称"
|
|
|
|
+ maxLength="10" style="width:320px;"/>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="参数 B" prop="reservedTwo">
|
|
|
|
+ <el-input v-model="dialogForm.reservedTwo" placeholder="请输入名称"
|
|
|
|
+ maxLength="10" style="width:320px;"/>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="参数 C" prop="reservedThree">
|
|
|
|
+ <el-input v-model="dialogForm.reservedThree" placeholder="请输入名称"
|
|
|
|
+ maxLength="10" style="width:320px;"/>
|
|
|
|
+ </el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer dialog-footer-box">
|
|
<div slot="footer" class="dialog-footer dialog-footer-box">
|
|
<p class="dialog-footer-button-null"></p>
|
|
<p class="dialog-footer-button-null"></p>
|
|
@@ -212,327 +211,338 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
-import {
|
|
|
|
- iotHardwareAdd,
|
|
|
|
- iotHardwareUpdate,
|
|
|
|
- iotHardwareList,
|
|
|
|
- iotHardwareDelete, iotHardwareTypeFindHardwareType, iotDeviceFindByType
|
|
|
|
-} from '@/api/iotDevice/index'
|
|
|
|
-import { systemBuildingGetTreeList,laboratorySubRelInfoGetListByFloor } from "@/api/commonality/permission";
|
|
|
|
|
|
+ import {
|
|
|
|
+ iotHardwareAdd,
|
|
|
|
+ iotHardwareUpdate,
|
|
|
|
+ iotHardwareList,
|
|
|
|
+ iotHardwareDelete,
|
|
|
|
+ iotHardwareTypeFindHardwareType,
|
|
|
|
+ iotDeviceFindByType
|
|
|
|
+
|
|
|
|
+ } from '@/api/iotDevice/index'
|
|
|
|
+ import { systemBuildingGetTreeList, laboratorySubRelInfoGetListByFloor } from '@/api/commonality/permission'
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
name: 'index',
|
|
name: 'index',
|
|
- data () {
|
|
|
|
|
|
+ data() {
|
|
return {
|
|
return {
|
|
- tableButtonType:this.hasPermiDom(['iot:hardware:edit','iot:hardware:del',]),
|
|
|
|
|
|
+ tableButtonType: this.hasPermiDom(['iot:hardware:edit', 'iot:hardware:del']),
|
|
//页面状态
|
|
//页面状态
|
|
- pageType:1,
|
|
|
|
|
|
+ pageType: 1,
|
|
//页面遮罩
|
|
//页面遮罩
|
|
- loading:false,
|
|
|
|
|
|
+ loading: false,
|
|
//下拉列表数据
|
|
//下拉列表数据
|
|
- 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'}],
|
|
|
|
|
|
+ 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:{
|
|
|
|
- page:1,
|
|
|
|
- pageSize:20,
|
|
|
|
- searchValue:"",
|
|
|
|
- hardwareTypeId :null,
|
|
|
|
- schoolId :null,
|
|
|
|
- buildId :null,
|
|
|
|
- subjectId :null,
|
|
|
|
- operatingState :null,
|
|
|
|
- state :null,
|
|
|
|
|
|
+ queryParams: {
|
|
|
|
+ page: 1,
|
|
|
|
+ pageSize: 20,
|
|
|
|
+ searchValue: '',
|
|
|
|
+ hardwareTypeId: null,
|
|
|
|
+ schoolId: null,
|
|
|
|
+ buildId: null,
|
|
|
|
+ subjectId: null,
|
|
|
|
+ operatingState: null,
|
|
|
|
+ state: null
|
|
},
|
|
},
|
|
- typeList:[],//类型
|
|
|
|
- relayList:[],//继电器
|
|
|
|
|
|
+ typeList: [],//类型
|
|
|
|
+ relayList: [],//继电器
|
|
//列表数据
|
|
//列表数据
|
|
- dataList:[],
|
|
|
|
|
|
+ dataList: [],
|
|
//数据数量
|
|
//数据数量
|
|
- total:0,
|
|
|
|
|
|
+ total: 0,
|
|
//组件传参
|
|
//组件传参
|
|
- propsData:{},
|
|
|
|
|
|
+ propsData: {},
|
|
//弹窗相关
|
|
//弹窗相关
|
|
- dialogTitle:'',
|
|
|
|
- dialogType:false,
|
|
|
|
- dialogForm:{},
|
|
|
|
- dialogRules:{
|
|
|
|
|
|
+ dialogTitle: '',
|
|
|
|
+ dialogType: false,
|
|
|
|
+ dialogForm: {},
|
|
|
|
+ dialogRules: {
|
|
hardwareName: [
|
|
hardwareName: [
|
|
- { required: true, message: "请输入名称", trigger: "blur" },
|
|
|
|
- { required: true, message: "请输入名称", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
|
|
|
+ { required: true, message: '请输入名称', trigger: 'blur' },
|
|
|
|
+ { required: true, message: '请输入名称', validator: this.spaceJudgment, trigger: 'blur' }
|
|
],
|
|
],
|
|
hardwareNo: [
|
|
hardwareNo: [
|
|
- { required: true, message: "请输入编号", trigger: "blur" },
|
|
|
|
- { required: true, message: "请输入编号", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
|
|
|
+ { required: true, message: '请输入编号', trigger: 'blur' },
|
|
|
|
+ { required: true, message: '请输入编号', validator: this.spaceJudgment, trigger: 'blur' }
|
|
],
|
|
],
|
|
hardwareTypeId: [
|
|
hardwareTypeId: [
|
|
- { required: true, message: "请选择类型", trigger: "blur" },
|
|
|
|
- { required: true, message: "请选择类型", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
|
|
|
+ { required: true, message: '请选择类型', trigger: 'blur' },
|
|
|
|
+ { required: true, message: '请选择类型', validator: this.spaceJudgment, trigger: 'blur' }
|
|
|
|
+ ],
|
|
|
|
+ deviceId: [
|
|
|
|
+ { required: true, message: '请选择物联设备', trigger: 'blur' },
|
|
|
|
+ { required: true, message: '请选择物联设备', validator: this.spaceJudgment, trigger: 'blur' }
|
|
],
|
|
],
|
|
subjectId: [
|
|
subjectId: [
|
|
- { required: true, message: "请搜索选择实验室", trigger: "blur" },
|
|
|
|
- { required: true, message: "请搜索选择实验室", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
|
|
|
+ { required: true, message: '请搜索选择实验室', trigger: 'blur' },
|
|
|
|
+ { required: true, message: '请搜索选择实验室', validator: this.spaceJudgment, trigger: 'blur' }
|
|
],
|
|
],
|
|
relayId: [
|
|
relayId: [
|
|
- { required: true, message: "请选择继电器", trigger: "blur" },
|
|
|
|
- { required: true, message: "请选择继电器", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
|
|
|
+ { required: true, message: '请选择继电器', trigger: 'blur' },
|
|
|
|
+ { required: true, message: '请选择继电器', validator: this.spaceJudgment, trigger: 'blur' }
|
|
],
|
|
],
|
|
relayBit: [
|
|
relayBit: [
|
|
- { required: true, message: "请选择继电器端子", trigger: "blur" },
|
|
|
|
- { required: true, message: "请选择继电器端子", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
|
|
|
+ { required: true, message: '请选择继电器端子', trigger: 'blur' },
|
|
|
|
+ { required: true, message: '请选择继电器端子', validator: this.spaceJudgment, trigger: 'blur' }
|
|
],
|
|
],
|
|
state: [
|
|
state: [
|
|
- { required: true, message: "请选择状态", trigger: "blur" },
|
|
|
|
- { required: true, message: "请选择状态", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
|
- ],
|
|
|
|
|
|
+ { required: true, message: '请选择状态', trigger: 'blur' },
|
|
|
|
+ { required: true, message: '请选择状态', validator: this.spaceJudgment, trigger: 'blur' }
|
|
|
|
+ ]
|
|
},
|
|
},
|
|
//校区楼栋原始数据
|
|
//校区楼栋原始数据
|
|
- addressList:[],
|
|
|
|
|
|
+ addressList: [],
|
|
//校区下拉列表
|
|
//校区下拉列表
|
|
- schoolOption:[],
|
|
|
|
|
|
+ schoolOption: [],
|
|
//楼栋下拉列表
|
|
//楼栋下拉列表
|
|
- buildOption:[],
|
|
|
|
|
|
+ buildOption: [],
|
|
//实验室下拉列表
|
|
//实验室下拉列表
|
|
- subjectOption:[],
|
|
|
|
|
|
+ subjectOption: [],
|
|
|
|
+ //物联分类下拉列表
|
|
|
|
+ iotTypeOptions:[],
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- created () {
|
|
|
|
|
|
+ created() {
|
|
|
|
|
|
},
|
|
},
|
|
- mounted () {
|
|
|
|
- this.systemBuildingGetTreeList();
|
|
|
|
- this.iotHardwareTypeFindHardwareType();
|
|
|
|
- this.getList();
|
|
|
|
|
|
+ mounted() {
|
|
|
|
+ this.systemBuildingGetTreeList()
|
|
|
|
+ this.iotHardwareTypeFindHardwareType()
|
|
|
|
+ this.getList()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
//查询按钮
|
|
//查询按钮
|
|
- handleQuery(){
|
|
|
|
- this.$set(this.queryParams,'page',1);
|
|
|
|
- this.getList();
|
|
|
|
|
|
+ handleQuery() {
|
|
|
|
+ this.$set(this.queryParams, 'page', 1)
|
|
|
|
+ this.getList()
|
|
},
|
|
},
|
|
//重置按钮
|
|
//重置按钮
|
|
- resetQuery(){
|
|
|
|
- this.$set(this,'buildOption',[]);
|
|
|
|
- this.$set(this,'subjectOption',[]);
|
|
|
|
- this.$set(this,'queryParams',{
|
|
|
|
- page:1,
|
|
|
|
- pageSize:20,
|
|
|
|
- searchValue:"",
|
|
|
|
- hardwareTypeId :null,
|
|
|
|
- schoolId :null,
|
|
|
|
- buildId :null,
|
|
|
|
- subjectId :null,
|
|
|
|
- operatingState :null,
|
|
|
|
- state :null,
|
|
|
|
- });
|
|
|
|
- this.getList();
|
|
|
|
|
|
+ resetQuery() {
|
|
|
|
+ this.$set(this, 'buildOption', [])
|
|
|
|
+ this.$set(this, 'subjectOption', [])
|
|
|
|
+ this.$set(this, 'queryParams', {
|
|
|
|
+ page: 1,
|
|
|
|
+ pageSize: 20,
|
|
|
|
+ searchValue: '',
|
|
|
|
+ hardwareTypeId: null,
|
|
|
|
+ schoolId: null,
|
|
|
|
+ buildId: null,
|
|
|
|
+ subjectId: null,
|
|
|
|
+ operatingState: null,
|
|
|
|
+ state: null
|
|
|
|
+ })
|
|
|
|
+ this.getList()
|
|
},
|
|
},
|
|
//获取类型
|
|
//获取类型
|
|
- iotHardwareTypeFindHardwareType(){
|
|
|
|
- let obj={
|
|
|
|
- searchValue:'',
|
|
|
|
|
|
+ iotHardwareTypeFindHardwareType() {
|
|
|
|
+ let obj = {
|
|
|
|
+ searchValue: ''
|
|
}
|
|
}
|
|
iotHardwareTypeFindHardwareType(obj).then(response => {
|
|
iotHardwareTypeFindHardwareType(obj).then(response => {
|
|
- this.$set(this,'typeList',response.data);
|
|
|
|
- });
|
|
|
|
|
|
+ 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,'hardwareTypeKey',this.typeList[i].hardwareTypeKey);
|
|
|
|
- this.$set(this.dialogForm,'hardwareTypeName',this.typeList[i].hardwareTypeName);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ typeFun(val) {
|
|
|
|
+ let self = this;
|
|
|
|
+ this.typeList.forEach((item) => {
|
|
|
|
+ if(val == item.hardwareTypeId){
|
|
|
|
+ self.$set(self.dialogForm, 'hardwareTypeKey', item.hardwareTypeKey)
|
|
|
|
+ self.$set(self.dialogForm, 'hardwareTypeName', item.hardwareTypeName)
|
|
|
|
+ self.$set(self.dialogForm, 'deviceTypeKey', item.deviceTypeKey)
|
|
|
|
+ self.$set(self.dialogForm, 'deviceId', '')
|
|
|
|
+ self.$set(self.dialogForm, 'deviceNo','')
|
|
|
|
+ self.iotDeviceFindByType(item.deviceTypeKey);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
},
|
|
},
|
|
- //继电器
|
|
|
|
- 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);
|
|
|
|
|
|
+ //属性选中
|
|
|
|
+ deviceChange(val){
|
|
|
|
+ let self = this;
|
|
|
|
+ this.relayList.forEach((item) => {
|
|
|
|
+ if(val == item.id){
|
|
|
|
+ self.$set(self.dialogForm, 'deviceNo', item.deviceNo)
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ });
|
|
},
|
|
},
|
|
//根据类型查询物联设备
|
|
//根据类型查询物联设备
|
|
- iotDeviceFindByType(){
|
|
|
|
- let obj={
|
|
|
|
- searchValue:'',
|
|
|
|
- subjectId:this.dialogForm.subjectId,
|
|
|
|
- typeKey:'relay',//(relay 继电器,sensor 传感器)
|
|
|
|
|
|
+ iotDeviceFindByType(val) {
|
|
|
|
+ let obj = {
|
|
|
|
+ searchValue: '',
|
|
|
|
+ typeKey: val//(relay 继电器,sensor 传感器)
|
|
}
|
|
}
|
|
iotDeviceFindByType(obj).then(response => {
|
|
iotDeviceFindByType(obj).then(response => {
|
|
- this.$set(this,'relayList',response.data);
|
|
|
|
- });
|
|
|
|
|
|
+ this.$set(this, 'relayList', response.data)
|
|
|
|
+ })
|
|
},
|
|
},
|
|
|
|
|
|
//获取数据列表
|
|
//获取数据列表
|
|
- getList(){
|
|
|
|
- this.$set(this,'loading',true);
|
|
|
|
|
|
+ getList() {
|
|
|
|
+ this.$set(this, 'loading', true)
|
|
let obj = JSON.parse(JSON.stringify(this.queryParams))
|
|
let obj = JSON.parse(JSON.stringify(this.queryParams))
|
|
iotHardwareList(obj).then(response => {
|
|
iotHardwareList(obj).then(response => {
|
|
- this.$set(this,'loading',false);
|
|
|
|
- this.$set(this,'dataList',response.data.records);
|
|
|
|
- this.$set(this,'total',response.data.total);
|
|
|
|
- });
|
|
|
|
|
|
+ this.$set(this, 'loading', false)
|
|
|
|
+ this.$set(this, 'dataList', response.data.records)
|
|
|
|
+ this.$set(this, 'total', response.data.total)
|
|
|
|
+ })
|
|
},
|
|
},
|
|
|
|
|
|
//操作按钮
|
|
//操作按钮
|
|
- tableButton(type,row){
|
|
|
|
- let self = this;
|
|
|
|
- if(type == 3){
|
|
|
|
|
|
+ tableButton(type, row) {
|
|
|
|
+ let self = this
|
|
|
|
+ if (type == 3) {
|
|
//编辑
|
|
//编辑
|
|
let obj = JSON.parse(JSON.stringify(row))
|
|
let obj = JSON.parse(JSON.stringify(row))
|
|
- 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,'dialogType',true);
|
|
|
|
- }else if(type == 4){
|
|
|
|
|
|
+ this.iotDeviceFindByType(row.deviceTypeKey)
|
|
|
|
+ this.$set(this, 'dialogForm', obj)
|
|
|
|
+ this.$set(this, 'dialogType', true)
|
|
|
|
+ } else if (type == 4) {
|
|
//删除
|
|
//删除
|
|
- this.$confirm('是否确认删除?', "警告", {
|
|
|
|
- confirmButtonText: "确定",
|
|
|
|
- cancelButtonText: "取消",
|
|
|
|
- type: "warning"
|
|
|
|
|
|
+ this.$confirm('是否确认删除?', '警告', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
}).then(function() {
|
|
}).then(function() {
|
|
}).then(() => {
|
|
}).then(() => {
|
|
- iotHardwareDelete({id:row.id}).then(response => {
|
|
|
|
|
|
+ iotHardwareDelete({ id: row.id }).then(response => {
|
|
self.msgSuccess(response.message)
|
|
self.msgSuccess(response.message)
|
|
- self.getList();
|
|
|
|
- });
|
|
|
|
- }).catch(() => {});
|
|
|
|
- }else if(type == 5){
|
|
|
|
|
|
+ self.getList()
|
|
|
|
+ })
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ })
|
|
|
|
+ } else if (type == 5) {
|
|
//启用&停用
|
|
//启用&停用
|
|
- let text = row.state ? "停用" : "启用";
|
|
|
|
- this.$confirm('是否确认' + text + '?', "警告", {
|
|
|
|
- confirmButtonText: "确定",
|
|
|
|
- cancelButtonText: "取消",
|
|
|
|
- type: "warning"
|
|
|
|
|
|
+ let text = row.state ? '停用' : '启用'
|
|
|
|
+ this.$confirm('是否确认' + text + '?', '警告', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
}).then(function() {
|
|
}).then(function() {
|
|
}).then(() => {
|
|
}).then(() => {
|
|
- iotHardwareUpdate({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();
|
|
|
|
- });
|
|
|
|
- }).catch(() => {});
|
|
|
|
- }else if(type == 6){
|
|
|
|
|
|
+ self.getList()
|
|
|
|
+ })
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ })
|
|
|
|
+ } else if (type == 6) {
|
|
//返回并刷新
|
|
//返回并刷新
|
|
- this.$set(this,'pageType',1);
|
|
|
|
- this.getList();
|
|
|
|
|
|
+ this.$set(this, 'pageType', 1)
|
|
|
|
+ this.getList()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//**************************弹窗相关**************************
|
|
//**************************弹窗相关**************************
|
|
//弹层关闭
|
|
//弹层关闭
|
|
- dialogOff(){
|
|
|
|
- this.$set(this,'dialogType',false);
|
|
|
|
|
|
+ dialogOff() {
|
|
|
|
+ this.$set(this, 'dialogType', false)
|
|
},
|
|
},
|
|
//弹层新增
|
|
//弹层新增
|
|
- dialogFormReset(){
|
|
|
|
- this.$set(this,'dialogTitle','新增');
|
|
|
|
- this.$set(this,'dialogForm',{
|
|
|
|
- hardwareName:"",
|
|
|
|
- hardwareNo:"",
|
|
|
|
- hardwareTypeId:"",
|
|
|
|
- hardwareTypeName:"",
|
|
|
|
- hardwareTypeKey:"",
|
|
|
|
- correlationRelay:"",
|
|
|
|
- subjectId:"",
|
|
|
|
- subjectName:"",
|
|
|
|
- relayId:"",
|
|
|
|
- relayNum:'',
|
|
|
|
- relayBit:'',
|
|
|
|
- state:true,
|
|
|
|
- });
|
|
|
|
- this.iotDeviceFindByType()
|
|
|
|
- this.$set(this,'dialogType',true);
|
|
|
|
|
|
+ dialogFormReset() {
|
|
|
|
+ this.$set(this, 'dialogTitle', '新增')
|
|
|
|
+ this.$set(this, 'dialogForm', {
|
|
|
|
+ hardwareName: '',
|
|
|
|
+ hardwareNo: '',
|
|
|
|
+ hardwareTypeId: '',
|
|
|
|
+ hardwareTypeName: '',
|
|
|
|
+ hardwareTypeKey: '',
|
|
|
|
+ deviceTypeKey: '',
|
|
|
|
+ deviceId: '',
|
|
|
|
+ deviceNo: '',
|
|
|
|
+ state: true,
|
|
|
|
+ reservedOne:'',
|
|
|
|
+ reservedTwo:'',
|
|
|
|
+ reservedThree:'',
|
|
|
|
+ })
|
|
|
|
+ this.$set(this, 'relayList', [])
|
|
|
|
+ this.$set(this, 'dialogType', true)
|
|
},
|
|
},
|
|
//dialog提交按钮
|
|
//dialog提交按钮
|
|
- dialogSubmit(){
|
|
|
|
- this.$refs["dialogForm"].validate(valid => {
|
|
|
|
|
|
+ dialogSubmit() {
|
|
|
|
+ this.$refs['dialogForm'].validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
let obj = {
|
|
let obj = {
|
|
- id:this.dialogForm.id,
|
|
|
|
- hardwareName:this.dialogForm.hardwareName,
|
|
|
|
- hardwareNo:this.dialogForm.hardwareNo,
|
|
|
|
- hardwareTypeId:this.dialogForm.hardwareTypeId,
|
|
|
|
- hardwareTypeName:this.dialogForm.hardwareTypeName,
|
|
|
|
- hardwareTypeKey:this.dialogForm.hardwareTypeKey,
|
|
|
|
- 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,
|
|
|
|
|
|
+ id: this.dialogForm.id,
|
|
|
|
+ hardwareName: this.dialogForm.hardwareName,
|
|
|
|
+ hardwareNo: this.dialogForm.hardwareNo,
|
|
|
|
+ hardwareTypeId: this.dialogForm.hardwareTypeId,
|
|
|
|
+ hardwareTypeName: this.dialogForm.hardwareTypeName,
|
|
|
|
+ hardwareTypeKey: this.dialogForm.hardwareTypeKey,
|
|
|
|
+ deviceTypeKey: this.dialogForm.deviceTypeKey,
|
|
|
|
+ deviceId: this.dialogForm.deviceId,
|
|
|
|
+ deviceNo: this.dialogForm.deviceNo,
|
|
|
|
+ state: this.dialogForm.state,
|
|
|
|
+ reservedOne:this.dialogForm.reservedOne,
|
|
|
|
+ reservedTwo:this.dialogForm.reservedTwo,
|
|
|
|
+ reservedThree:this.dialogForm.reservedThree,
|
|
}
|
|
}
|
|
- if(this.dialogForm.id){
|
|
|
|
|
|
+ if (this.dialogForm.id) {
|
|
iotHardwareUpdate(obj).then(response => {
|
|
iotHardwareUpdate(obj).then(response => {
|
|
this.msgSuccess(response.message)
|
|
this.msgSuccess(response.message)
|
|
- this.dialogOff();
|
|
|
|
- this.getList();
|
|
|
|
- });
|
|
|
|
- }else{
|
|
|
|
|
|
+ this.dialogOff()
|
|
|
|
+ this.getList()
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
iotHardwareAdd(obj).then(response => {
|
|
iotHardwareAdd(obj).then(response => {
|
|
this.msgSuccess(response.message)
|
|
this.msgSuccess(response.message)
|
|
- this.dialogOff();
|
|
|
|
- this.getList();
|
|
|
|
- });
|
|
|
|
|
|
+ this.dialogOff()
|
|
|
|
+ this.getList()
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
//获取校区
|
|
//获取校区
|
|
- systemBuildingGetTreeList(){
|
|
|
|
|
|
+ systemBuildingGetTreeList() {
|
|
systemBuildingGetTreeList({}).then(response => {
|
|
systemBuildingGetTreeList({}).then(response => {
|
|
- let list = [];
|
|
|
|
- for(let i=0;i<response.data.length;i++){
|
|
|
|
|
|
+ let list = []
|
|
|
|
+ for (let i = 0; i < response.data.length; i++) {
|
|
list.push({
|
|
list.push({
|
|
- id:response.data[i].id,
|
|
|
|
- name:response.data[i].name,
|
|
|
|
|
|
+ id: response.data[i].id,
|
|
|
|
+ name: response.data[i].name
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- this.$set(this,'schoolOption',list);
|
|
|
|
- this.$set(this,'addressList',response.data);
|
|
|
|
|
|
+ this.$set(this, 'schoolOption', list)
|
|
|
|
+ this.$set(this, 'addressList', response.data)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
//校区选中
|
|
//校区选中
|
|
- changeSchool(val){
|
|
|
|
- let self = this;
|
|
|
|
- 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++){
|
|
|
|
|
|
+ changeSchool(val) {
|
|
|
|
+ let self = this
|
|
|
|
+ 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({
|
|
list.push({
|
|
- id:self.addressList[i].buildFloorVoList[o].id,
|
|
|
|
- name:self.addressList[i].buildFloorVoList[o].name,
|
|
|
|
|
|
+ id: self.addressList[i].buildFloorVoList[o].id,
|
|
|
|
+ name: self.addressList[i].buildFloorVoList[o].name
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- this.$set(this.queryParams,'buildId',null);
|
|
|
|
- this.$set(this.queryParams,'subjectId',null);
|
|
|
|
- this.$set(this,'buildOption',list);
|
|
|
|
- this.$set(this,'subjectOption',[]);
|
|
|
|
|
|
+ this.$set(this.queryParams, 'buildId', null)
|
|
|
|
+ this.$set(this.queryParams, 'subjectId', null)
|
|
|
|
+ this.$set(this, 'buildOption', list)
|
|
|
|
+ this.$set(this, 'subjectOption', [])
|
|
},
|
|
},
|
|
//楼栋选中
|
|
//楼栋选中
|
|
- buildSchool(val){
|
|
|
|
- laboratorySubRelInfoGetListByFloor({buildId:val}).then(response => {
|
|
|
|
- this.$set(this.queryParams,'subjectId',null);
|
|
|
|
- this.$set(this,'subjectOption',response.data);
|
|
|
|
|
|
+ buildSchool(val) {
|
|
|
|
+ laboratorySubRelInfoGetListByFloor({ buildId: val }).then(response => {
|
|
|
|
+ this.$set(this.queryParams, 'subjectId', null)
|
|
|
|
+ this.$set(this, 'subjectOption', response.data)
|
|
})
|
|
})
|
|
- },
|
|
|
|
- },
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
- .hardwareEquipment{
|
|
|
|
- .hardwareEquipmentPage{
|
|
|
|
|
|
+ .hardwareEquipment {
|
|
|
|
+ .hardwareEquipmentPage {
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|