|
@@ -44,10 +44,12 @@
|
|
|
<div class="cell-title">
|
|
<div class="cell-title">
|
|
|
<div class="title-left">
|
|
<div class="title-left">
|
|
|
<div class="title">{{currentData.title_any_where}} 空调管理</div>
|
|
<div class="title">{{currentData.title_any_where}} 空调管理</div>
|
|
|
- <div class="title-detail">房间数:{{room_number}}间</div>
|
|
|
|
|
|
|
+ <div class="title-detail">房间:{{room_number}}间</div>
|
|
|
<div class="title-detail">设备:{{device_number}}台</div>
|
|
<div class="title-detail">设备:{{device_number}}台</div>
|
|
|
- <div class="title-detail">已开启:{{open_number}}台</div>
|
|
|
|
|
- <div class="title-detail">预警台数:{{warning_number}}台</div>
|
|
|
|
|
|
|
+ <div class="title-detail">离线:{{offline_device_number}}台</div>
|
|
|
|
|
+ <div class="title-detail">关机:{{shutdown_device_number}}台</div>
|
|
|
|
|
+ <div class="title-detail">已开:{{open_number}}台</div>
|
|
|
|
|
+ <div class="title-detail">预警:{{warning_number}}台</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="title-right">
|
|
<div class="title-right">
|
|
|
<el-button type="primary" @click="add_room">新增房间</el-button>
|
|
<el-button type="primary" @click="add_room">新增房间</el-button>
|
|
@@ -88,7 +90,7 @@
|
|
|
element-loading-spinner="el-icon-loading"
|
|
element-loading-spinner="el-icon-loading"
|
|
|
element-loading-background="rgba(0, 0, 0, 0.8)" :cell-style="setCellStyle"
|
|
element-loading-background="rgba(0, 0, 0, 0.8)" :cell-style="setCellStyle"
|
|
|
:header-cell-style="setHeaderSellStyle">
|
|
:header-cell-style="setHeaderSellStyle">
|
|
|
- <el-table-column label="名称" align="center" width="160">
|
|
|
|
|
|
|
+ <el-table-column label="名称" align="center" width="140">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<span>{{ scope.row.name }}</span>
|
|
<span>{{ scope.row.name }}</span>
|
|
|
</template>
|
|
</template>
|
|
@@ -98,7 +100,7 @@
|
|
|
<span>{{ scope.row.ip }}</span>
|
|
<span>{{ scope.row.ip }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="类型" align="center">
|
|
|
|
|
|
|
+ <el-table-column label="类型" align="center" width="85">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<span>{{ scope.row.device }}</span>
|
|
<span>{{ scope.row.device }}</span>
|
|
|
</template>
|
|
</template>
|
|
@@ -168,7 +170,7 @@
|
|
|
element-loading-spinner="el-icon-loading"
|
|
element-loading-spinner="el-icon-loading"
|
|
|
element-loading-background="rgba(0, 0, 0, 0.8)" :cell-style="setCellStyle"
|
|
element-loading-background="rgba(0, 0, 0, 0.8)" :cell-style="setCellStyle"
|
|
|
:header-cell-style="setHeaderSellStyle">
|
|
:header-cell-style="setHeaderSellStyle">
|
|
|
- <el-table-column label="名称" align="center" width="160">
|
|
|
|
|
|
|
+ <el-table-column label="名称" align="center" width="140">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<span>{{ scope.row.name }}</span>
|
|
<span>{{ scope.row.name }}</span>
|
|
|
</template>
|
|
</template>
|
|
@@ -178,7 +180,7 @@
|
|
|
<span>{{ scope.row.ip }}</span>
|
|
<span>{{ scope.row.ip }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="类型" align="center">
|
|
|
|
|
|
|
+ <el-table-column label="类型" align="center" width="85">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<span>{{ scope.row.device }}</span>
|
|
<span>{{ scope.row.device }}</span>
|
|
|
</template>
|
|
</template>
|
|
@@ -250,7 +252,7 @@
|
|
|
element-loading-spinner="el-icon-loading"
|
|
element-loading-spinner="el-icon-loading"
|
|
|
element-loading-background="rgba(0, 0, 0, 0.8)" :cell-style="setCellStyle"
|
|
element-loading-background="rgba(0, 0, 0, 0.8)" :cell-style="setCellStyle"
|
|
|
:header-cell-style="setHeaderSellStyle">
|
|
:header-cell-style="setHeaderSellStyle">
|
|
|
- <el-table-column label="名称" align="center" width="160">
|
|
|
|
|
|
|
+ <el-table-column label="名称" align="center" width="140">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<span>{{ scope.row.name }}</span>
|
|
<span>{{ scope.row.name }}</span>
|
|
|
</template>
|
|
</template>
|
|
@@ -260,7 +262,7 @@
|
|
|
<span>{{ scope.row.ip }}</span>
|
|
<span>{{ scope.row.ip }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="类型" align="center">
|
|
|
|
|
|
|
+ <el-table-column label="类型" align="center" width="85">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<span>{{ scope.row.device }}</span>
|
|
<span>{{ scope.row.device }}</span>
|
|
|
</template>
|
|
</template>
|
|
@@ -330,7 +332,7 @@
|
|
|
element-loading-spinner="el-icon-loading"
|
|
element-loading-spinner="el-icon-loading"
|
|
|
element-loading-background="rgba(0, 0, 0, 0.8)" :cell-style="setCellStyle"
|
|
element-loading-background="rgba(0, 0, 0, 0.8)" :cell-style="setCellStyle"
|
|
|
:header-cell-style="setHeaderSellStyle">
|
|
:header-cell-style="setHeaderSellStyle">
|
|
|
- <el-table-column label="名称" align="center" width="160">
|
|
|
|
|
|
|
+ <el-table-column label="名称" align="center" width="140">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<span>{{ scope.row.name }}</span>
|
|
<span>{{ scope.row.name }}</span>
|
|
|
</template>
|
|
</template>
|
|
@@ -340,7 +342,7 @@
|
|
|
<span>{{ scope.row.ip }}</span>
|
|
<span>{{ scope.row.ip }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="类型" align="center">
|
|
|
|
|
|
|
+ <el-table-column label="类型" align="center" width="85">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<span>{{ scope.row.device }}</span>
|
|
<span>{{ scope.row.device }}</span>
|
|
|
</template>
|
|
</template>
|
|
@@ -451,8 +453,7 @@
|
|
|
<!-- 添加房间 -->
|
|
<!-- 添加房间 -->
|
|
|
<el-dialog title="新增房间" custom-class="el-dialog-add-room" :visible.sync="dialog_add_room"
|
|
<el-dialog title="新增房间" custom-class="el-dialog-add-room" :visible.sync="dialog_add_room"
|
|
|
:close-on-click-modal="false" :close-on-press-escape="false" @close="dialog_close('form_add_room')">
|
|
:close-on-click-modal="false" :close-on-press-escape="false" @close="dialog_close('form_add_room')">
|
|
|
- <!-- <el-form :model="form_add_room" ref="add_room_form" :rules="form_add_room_rules"> -->
|
|
|
|
|
- <el-form :model="form_add_room" ref="add_room_form">
|
|
|
|
|
|
|
+ <el-form :model="form_add_room" ref="add_room_form" :rules="form_add_room_rules">
|
|
|
<el-form-item label="校区:" :label-width="formLabelWidth">
|
|
<el-form-item label="校区:" :label-width="formLabelWidth">
|
|
|
<div>{{form_add_room.school}}</div>
|
|
<div>{{form_add_room.school}}</div>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -481,13 +482,13 @@
|
|
|
<div>{{form_add_device.school + ' / ' + form_add_device.build + ' / ' + form_add_device.floors}}
|
|
<div>{{form_add_device.school + ' / ' + form_add_device.build + ' / ' + form_add_device.floors}}
|
|
|
</div>
|
|
</div>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="操作员:" :label-width="formLabelWidth" prop="cao" :required="true">
|
|
|
|
|
- <el-input v-model="form_add_device.cao" autocomplete="off" placeholder="请输入操作员" ref="ref_cao"
|
|
|
|
|
|
|
+ <el-form-item label="操作员:" :label-width="formLabelWidth" prop="cao">
|
|
|
|
|
+ <el-input v-model="cao" autocomplete="off" placeholder="请输入操作员" ref="ref_cao" readonly=""
|
|
|
maxlength="10"></el-input>
|
|
maxlength="10"></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="手机号码:" :label-width="formLabelWidth" prop="contact" :required="true">
|
|
|
|
|
- <el-input v-model="form_add_device.contact" autocomplete="off" placeholder="请输入手机号码"
|
|
|
|
|
- ref="ref_contact" maxlength="11"></el-input>
|
|
|
|
|
|
|
+ <el-form-item label="手机号码:" :label-width="formLabelWidth" prop="contact">
|
|
|
|
|
+ <el-input v-model="contact" autocomplete="off" placeholder="请输入手机号码" ref="ref_contact"
|
|
|
|
|
+ maxlength="11" readonly=""></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="设备名称:" :label-width="formLabelWidth" prop="deviceName" :required="true">
|
|
<el-form-item label="设备名称:" :label-width="formLabelWidth" prop="deviceName" :required="true">
|
|
|
<el-input v-model="form_add_device.deviceName" autocomplete="off" placeholder="请输入设备名称"
|
|
<el-input v-model="form_add_device.deviceName" autocomplete="off" placeholder="请输入设备名称"
|
|
@@ -514,8 +515,7 @@
|
|
|
<!-- 编辑房间 -->
|
|
<!-- 编辑房间 -->
|
|
|
<el-dialog title="编辑房间" custom-class="el-dialog-modify-room" :visible.sync="dialog_modify_room"
|
|
<el-dialog title="编辑房间" custom-class="el-dialog-modify-room" :visible.sync="dialog_modify_room"
|
|
|
:close-on-click-modal="false" :close-on-press-escape="false" @close="dialog_close('form_modify_room')">
|
|
:close-on-click-modal="false" :close-on-press-escape="false" @close="dialog_close('form_modify_room')">
|
|
|
- <!-- <el-form :model="form_modify_room" ref="modify_room_form" :rules="form_modify_room_rules"> -->
|
|
|
|
|
- <el-form :model="form_modify_room" ref="modify_room_form">
|
|
|
|
|
|
|
+ <el-form :model="form_modify_room" ref="modify_room_form" :rules="form_modify_room_rules">
|
|
|
<el-form-item label="校区:" :label-width="formLabelWidth">
|
|
<el-form-item label="校区:" :label-width="formLabelWidth">
|
|
|
<div>{{form_modify_room.school}}</div>
|
|
<div>{{form_modify_room.school}}</div>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -578,9 +578,10 @@
|
|
|
delRooms,
|
|
delRooms,
|
|
|
startAirs,
|
|
startAirs,
|
|
|
stopAirs,
|
|
stopAirs,
|
|
|
- selAirsStatus
|
|
|
|
|
|
|
+ selAirsStatus,
|
|
|
|
|
+ getDevices
|
|
|
} from '@/api/serveAC'
|
|
} from '@/api/serveAC'
|
|
|
- const deviceOptions = ['1匹', '1.5匹', '2匹', '3匹', '天花机器(3匹)'];
|
|
|
|
|
|
|
+ var deviceOptions = [];
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
// var checkloudong = (rule, value, callback) => {
|
|
// var checkloudong = (rule, value, callback) => {
|
|
@@ -608,54 +609,59 @@
|
|
|
callback();
|
|
callback();
|
|
|
}
|
|
}
|
|
|
}, 100);
|
|
}, 100);
|
|
|
- }
|
|
|
|
|
- // var checkroom = (rule, value, callback) => {
|
|
|
|
|
|
|
+ };
|
|
|
|
|
+ var checkroom = (rule, value, callback) => {
|
|
|
|
|
+ if (!value) {
|
|
|
|
|
+ return callback(new Error('请输入房间号'));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ callback();
|
|
|
|
|
+ }, 100);
|
|
|
|
|
+ // setTimeout(() => {
|
|
|
|
|
+ // var regH = /[\d]$/g;
|
|
|
|
|
+ // var floor = this.currentData.floor.replace(regH, '');
|
|
|
|
|
+ // var reg = /[1-9]{1}[0-9]{2,3}$/
|
|
|
|
|
+ // if (value.indexOf(floor)) {
|
|
|
|
|
+ // callback(new Error('房间号数字部分,必须以楼层号开头!'));
|
|
|
|
|
+ // } else if (!reg.test(value)) {
|
|
|
|
|
+ // callback(new Error('房间号数字部分,为3-4个数字,非0开头!栋号不需要添加!'));
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // callback();
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }, 100);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // var checkCao = (rule, value, callback) => {
|
|
|
// if (!value) {
|
|
// if (!value) {
|
|
|
- // return callback(new Error('请输入房间号'));
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ // return callback(new Error('请输入操作员'));
|
|
|
|
|
+ // };
|
|
|
|
|
|
|
|
// setTimeout(() => {
|
|
// setTimeout(() => {
|
|
|
- // var regH = /[\d]$/g;
|
|
|
|
|
- // var floor = this.currentData.floor.replace(regH, '');
|
|
|
|
|
- // var reg = /[1-9]{1}[0-9]{2,3}$/
|
|
|
|
|
- // if (value.indexOf(floor)) {
|
|
|
|
|
- // callback(new Error('房间号数字部分,必须以楼层号开头!'));
|
|
|
|
|
- // } else if (!reg.test(value)) {
|
|
|
|
|
- // callback(new Error('房间号数字部分,为3-4个数字,非0开头!栋号不需要添加!'));
|
|
|
|
|
|
|
+ // var reg = /^[\u4e00-\u9fa5]{2,10}$/
|
|
|
|
|
+ // if (!reg.test(value)) {
|
|
|
|
|
+ // callback(new Error('必须为2-10个汉字!'));
|
|
|
// } else {
|
|
// } else {
|
|
|
// callback();
|
|
// callback();
|
|
|
// }
|
|
// }
|
|
|
// }, 100);
|
|
// }, 100);
|
|
|
- // }
|
|
|
|
|
- var checkCao = (rule, value, callback) => {
|
|
|
|
|
- if (!value) {
|
|
|
|
|
- return callback(new Error('请输入操作员'));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // };
|
|
|
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- var reg = /^[\u4e00-\u9fa5]{2,10}$/
|
|
|
|
|
- if (!reg.test(value)) {
|
|
|
|
|
- callback(new Error('必须为2-10个汉字!'));
|
|
|
|
|
- } else {
|
|
|
|
|
- callback();
|
|
|
|
|
- }
|
|
|
|
|
- }, 100);
|
|
|
|
|
- }
|
|
|
|
|
- var checkcontact = (rule, value, callback) => {
|
|
|
|
|
- if (!value) {
|
|
|
|
|
- return callback(new Error('请输入手机号码'));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // var checkcontact = (rule, value, callback) => {
|
|
|
|
|
+ // if (!value) {
|
|
|
|
|
+ // return callback(new Error('请输入手机号码'));
|
|
|
|
|
+ // };
|
|
|
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- var reg =
|
|
|
|
|
- /^((13[0-9])|(14[0|5|6|7|9])|(15[0-3])|(15[5-9])|(16[6|7])|(17[2|3|5|6|7|8])|(18[0-9])|(19[1|8|9]))\d{8}$/
|
|
|
|
|
- if (!reg.test(value)) {
|
|
|
|
|
- callback(new Error('手机号码输入不规范!'));
|
|
|
|
|
- } else {
|
|
|
|
|
- callback();
|
|
|
|
|
- }
|
|
|
|
|
- }, 100);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // setTimeout(() => {
|
|
|
|
|
+ // var reg =
|
|
|
|
|
+ // /^((13[0-9])|(14[0|5|6|7|9])|(15[0-3])|(15[5-9])|(16[6|7])|(17[2|3|5|6|7|8])|(18[0-9])|(19[1|8|9]))\d{8}$/
|
|
|
|
|
+ // if (!reg.test(value)) {
|
|
|
|
|
+ // callback(new Error('手机号码输入不规范!'));
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // callback();
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }, 100);
|
|
|
|
|
+ // };
|
|
|
var checkDeviceName = (rule, value, callback) => {
|
|
var checkDeviceName = (rule, value, callback) => {
|
|
|
if (!value) {
|
|
if (!value) {
|
|
|
return callback(new Error('请输入设备名称'));
|
|
return callback(new Error('请输入设备名称'));
|
|
@@ -669,7 +675,7 @@
|
|
|
callback();
|
|
callback();
|
|
|
}
|
|
}
|
|
|
}, 100);
|
|
}, 100);
|
|
|
- }
|
|
|
|
|
|
|
+ };
|
|
|
var checkDeviceIp = (rule, value, callback) => {
|
|
var checkDeviceIp = (rule, value, callback) => {
|
|
|
if (!value) {
|
|
if (!value) {
|
|
|
return callback(new Error('请输入设备IP/ID'));
|
|
return callback(new Error('请输入设备IP/ID'));
|
|
@@ -683,17 +689,21 @@
|
|
|
callback();
|
|
callback();
|
|
|
}
|
|
}
|
|
|
}, 100);
|
|
}, 100);
|
|
|
- }
|
|
|
|
|
|
|
+ };
|
|
|
var checkCheckedDevice = (rule, value, callback) => {
|
|
var checkCheckedDevice = (rule, value, callback) => {
|
|
|
if (!value[0]) {
|
|
if (!value[0]) {
|
|
|
return callback(new Error('请选择设备类型'));
|
|
return callback(new Error('请选择设备类型'));
|
|
|
} else {
|
|
} else {
|
|
|
callback();
|
|
callback();
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ };
|
|
|
return {
|
|
return {
|
|
|
|
|
+ cao: this.$store.state.user.name, // 操作员
|
|
|
|
|
+ contact: this.$store.state.user.phone,
|
|
|
room_number: 0, // 房间数量
|
|
room_number: 0, // 房间数量
|
|
|
device_number: 0, // 设备数量
|
|
device_number: 0, // 设备数量
|
|
|
|
|
+ offline_device_number: 0, // 离线数量
|
|
|
|
|
+ shutdown_device_number: 0, // 关机数量
|
|
|
open_number: 0, // 已开启
|
|
open_number: 0, // 已开启
|
|
|
warning_number: 0, // 预警台数
|
|
warning_number: 0, // 预警台数
|
|
|
search_datatime: '',
|
|
search_datatime: '',
|
|
@@ -728,11 +738,11 @@
|
|
|
floor: '',
|
|
floor: '',
|
|
|
room: ''
|
|
room: ''
|
|
|
},
|
|
},
|
|
|
- // form_add_room_rules: { // 添加房间表单验证
|
|
|
|
|
- // room: [{
|
|
|
|
|
- // validator: checkroom
|
|
|
|
|
- // }]
|
|
|
|
|
- // },
|
|
|
|
|
|
|
+ form_add_room_rules: { // 添加房间表单验证
|
|
|
|
|
+ room: [{
|
|
|
|
|
+ validator: checkroom
|
|
|
|
|
+ }]
|
|
|
|
|
+ },
|
|
|
// 修改房间
|
|
// 修改房间
|
|
|
dialog_modify_room: false,
|
|
dialog_modify_room: false,
|
|
|
form_modify_room: { // 修改房间数据
|
|
form_modify_room: { // 修改房间数据
|
|
@@ -741,11 +751,11 @@
|
|
|
floor: '',
|
|
floor: '',
|
|
|
room: ''
|
|
room: ''
|
|
|
},
|
|
},
|
|
|
- // form_modify_room_rules: { // 修改房间表单验证
|
|
|
|
|
- // room: [{
|
|
|
|
|
- // validator: checkroom
|
|
|
|
|
- // }]
|
|
|
|
|
- // },
|
|
|
|
|
|
|
+ form_modify_room_rules: { // 修改房间表单验证
|
|
|
|
|
+ room: [{
|
|
|
|
|
+ validator: checkroom
|
|
|
|
|
+ }]
|
|
|
|
|
+ },
|
|
|
// 添加设备
|
|
// 添加设备
|
|
|
dialog_add_device: false,
|
|
dialog_add_device: false,
|
|
|
form_add_device: { // 添加设备数据
|
|
form_add_device: { // 添加设备数据
|
|
@@ -759,9 +769,7 @@
|
|
|
devices: deviceOptions,
|
|
devices: deviceOptions,
|
|
|
duration_use: 0.00, // 使用时长
|
|
duration_use: 0.00, // 使用时长
|
|
|
is_normal: '1', // 是否正常
|
|
is_normal: '1', // 是否正常
|
|
|
- is_on: '0', // 是否开启
|
|
|
|
|
- cao: '', // 操作员
|
|
|
|
|
- contact: ''
|
|
|
|
|
|
|
+ is_on: '0' // 是否开启
|
|
|
},
|
|
},
|
|
|
form_add_device_rules: {
|
|
form_add_device_rules: {
|
|
|
deviceName: [{
|
|
deviceName: [{
|
|
@@ -773,12 +781,12 @@
|
|
|
checkedDevice: [{
|
|
checkedDevice: [{
|
|
|
validator: checkCheckedDevice
|
|
validator: checkCheckedDevice
|
|
|
}],
|
|
}],
|
|
|
- cao: [{
|
|
|
|
|
- validator: checkCao
|
|
|
|
|
- }],
|
|
|
|
|
- contact: [{
|
|
|
|
|
- validator: checkcontact
|
|
|
|
|
- }]
|
|
|
|
|
|
|
+ // cao: [{
|
|
|
|
|
+ // validator: checkCao
|
|
|
|
|
+ // }],
|
|
|
|
|
+ // contact: [{
|
|
|
|
|
+ // validator: checkcontact
|
|
|
|
|
+ // }]
|
|
|
},
|
|
},
|
|
|
dialog_operator_details: false, // 操作员详情
|
|
dialog_operator_details: false, // 操作员详情
|
|
|
form_operator_details: { // 操作员详情数据
|
|
form_operator_details: { // 操作员详情数据
|
|
@@ -863,12 +871,38 @@
|
|
|
clearInterval(auto_click);
|
|
clearInterval(auto_click);
|
|
|
}
|
|
}
|
|
|
}, 200);
|
|
}, 200);
|
|
|
|
|
+
|
|
|
|
|
+ // 空调设备类型
|
|
|
|
|
+ this.get_Devices();
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
document.getElementsByClassName("el-pagination__jump")[0].childNodes[0].nodeValue = "跳至";
|
|
document.getElementsByClassName("el-pagination__jump")[0].childNodes[0].nodeValue = "跳至";
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * 获取费率列表数据
|
|
|
|
|
+ */
|
|
|
|
|
+ get_Devices() {
|
|
|
|
|
+ // 开始发送请求,获取配置数据
|
|
|
|
|
+ getDevices().then((res) => {
|
|
|
|
|
+ // console.log(res.data);
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ let resdata = res.data;
|
|
|
|
|
+ deviceOptions = []
|
|
|
|
|
+ for (var i = 0; i < resdata.length; i++) {
|
|
|
|
|
+ deviceOptions.push(resdata[i].air_config);
|
|
|
|
|
+ }
|
|
|
|
|
+ deviceOptions.sort((a, b) => a.localeCompare(b))
|
|
|
|
|
+ } else {
|
|
|
|
|
+ deviceOptions = [];
|
|
|
|
|
+ this.$message.warning('没有符合条件的数据!');
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch((err) => {
|
|
|
|
|
+ // console.log(err);
|
|
|
|
|
+ this.$message.error(err.message);
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
* 开关空调
|
|
* 开关空调
|
|
|
* @param {Object} roomIndex
|
|
* @param {Object} roomIndex
|
|
|
* @param {Object} rowIndex
|
|
* @param {Object} rowIndex
|
|
@@ -966,7 +1000,7 @@
|
|
|
* @param {Object} air_ip
|
|
* @param {Object} air_ip
|
|
|
*/
|
|
*/
|
|
|
getAirsStatus(roomIndex, rowIndex, air_ip) {
|
|
getAirsStatus(roomIndex, rowIndex, air_ip) {
|
|
|
- console.log(roomIndex, rowIndex);
|
|
|
|
|
|
|
+ // console.log(roomIndex, rowIndex);
|
|
|
selAirsStatus({
|
|
selAirsStatus({
|
|
|
air_ip: air_ip
|
|
air_ip: air_ip
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
@@ -991,61 +1025,73 @@
|
|
|
* 编辑修改房间
|
|
* 编辑修改房间
|
|
|
*/
|
|
*/
|
|
|
dialog_modify_room_click(room) {
|
|
dialog_modify_room_click(room) {
|
|
|
- updateRooms({
|
|
|
|
|
- school: this.form_modify_room.school,
|
|
|
|
|
- build: this.form_modify_room.building,
|
|
|
|
|
- floors: this.form_modify_room.floor,
|
|
|
|
|
- dom: this.form_modify_room.room,
|
|
|
|
|
- old_dom: room
|
|
|
|
|
- }).then((res) => {
|
|
|
|
|
- // console.log(res);
|
|
|
|
|
- if (typeof res.code == 'undefined' || res.code == '') {
|
|
|
|
|
- this.$message.error('返回数据格式问题,code未获取到!')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.$refs["modify_room_form"].validate(validate => {
|
|
|
|
|
+ if (validate) {
|
|
|
|
|
+ updateRooms({
|
|
|
|
|
+ school: this.form_modify_room.school,
|
|
|
|
|
+ build: this.form_modify_room.building,
|
|
|
|
|
+ floors: this.form_modify_room.floor,
|
|
|
|
|
+ dom: this.form_modify_room.room,
|
|
|
|
|
+ old_dom: room
|
|
|
|
|
+ }).then((res) => {
|
|
|
|
|
+ // console.log(res);
|
|
|
|
|
+ if (typeof res.code == 'undefined' || res.code == '') {
|
|
|
|
|
+ this.$message.error('返回数据格式问题,code未获取到!')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if (res.code == 200) {
|
|
|
|
|
- // 隐藏删除对话框
|
|
|
|
|
- this.dialog_modify_room = false
|
|
|
|
|
- // 更新本地变量中的房间
|
|
|
|
|
- let tmp = this.navData
|
|
|
|
|
- for (var i = 0; i < tmp.length; i++) {
|
|
|
|
|
- if (tmp[i].label == this.form_modify_room.school && typeof tmp[i].children !==
|
|
|
|
|
- 'undefined' && tmp[i].children.length > 0) {
|
|
|
|
|
- let tmp1 = tmp[i].children;
|
|
|
|
|
- for (var j = 0; j < tmp1.length; j++) {
|
|
|
|
|
- if (tmp1[j].label == this.form_modify_room.building && typeof tmp1[j]
|
|
|
|
|
- .children !== 'undefined' && tmp1[j].children.length > 0) {
|
|
|
|
|
- let tmp2 = tmp1[j].children;
|
|
|
|
|
- for (var k = 0; k < tmp2.length; k++) {
|
|
|
|
|
- if (tmp2[k].label == this.form_modify_room.floor &&
|
|
|
|
|
- typeof tmp2[k]
|
|
|
|
|
- .rooms !== 'undefined' && tmp2[k].rooms.length > 0) {
|
|
|
|
|
- let tmp3 = tmp2[k].rooms;
|
|
|
|
|
- for (var p = 0; p < tmp3.length; p++) {
|
|
|
|
|
- if (tmp3[p] == room) {
|
|
|
|
|
- this.navData[i].children[j].children[k].rooms[p] =
|
|
|
|
|
- this
|
|
|
|
|
- .form_modify_room.building + '-' + this
|
|
|
|
|
- .form_modify_room.room;
|
|
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ // 隐藏删除对话框
|
|
|
|
|
+ this.dialog_modify_room = false
|
|
|
|
|
+ // 更新本地变量中的房间
|
|
|
|
|
+ let tmp = this.navData
|
|
|
|
|
+ for (var i = 0; i < tmp.length; i++) {
|
|
|
|
|
+ if (tmp[i].label == this.form_modify_room.school && typeof tmp[i]
|
|
|
|
|
+ .children !==
|
|
|
|
|
+ 'undefined' && tmp[i].children.length > 0) {
|
|
|
|
|
+ let tmp1 = tmp[i].children;
|
|
|
|
|
+ for (var j = 0; j < tmp1.length; j++) {
|
|
|
|
|
+ if (tmp1[j].label == this.form_modify_room.building &&
|
|
|
|
|
+ typeof tmp1[j]
|
|
|
|
|
+ .children !== 'undefined' && tmp1[j].children.length > 0) {
|
|
|
|
|
+ let tmp2 = tmp1[j].children;
|
|
|
|
|
+ for (var k = 0; k < tmp2.length; k++) {
|
|
|
|
|
+ if (tmp2[k].label == this.form_modify_room.floor &&
|
|
|
|
|
+ typeof tmp2[k]
|
|
|
|
|
+ .rooms !== 'undefined' && tmp2[k].rooms.length > 0
|
|
|
|
|
+ ) {
|
|
|
|
|
+ let tmp3 = tmp2[k].rooms;
|
|
|
|
|
+ for (var p = 0; p < tmp3.length; p++) {
|
|
|
|
|
+ if (tmp3[p] == room) {
|
|
|
|
|
+ this.navData[i].children[j].children[k]
|
|
|
|
|
+ .rooms[p] =
|
|
|
|
|
+ this
|
|
|
|
|
+ .form_modify_room.building + '-' + this
|
|
|
|
|
+ .form_modify_room.room;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ this.navData[i].children[j].children[k].rooms
|
|
|
|
|
+ .sort();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- this.navData[i].children[j].children[k].rooms.sort();
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ // 自动点击
|
|
|
|
|
+ this.currentData.clickElement.click()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error(res.message)
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- // 自动点击
|
|
|
|
|
- this.currentData.clickElement.click()
|
|
|
|
|
|
|
+ }).catch((err) => {
|
|
|
|
|
+ // console.log(err);
|
|
|
|
|
+ this.$message.error(err.message)
|
|
|
|
|
+ })
|
|
|
} else {
|
|
} else {
|
|
|
- this.$message.error(res.message)
|
|
|
|
|
|
|
+ this.$message.error('验证不通过')
|
|
|
|
|
+ return false
|
|
|
}
|
|
}
|
|
|
- }).catch((err) => {
|
|
|
|
|
- // console.log(err);
|
|
|
|
|
- this.$message.error(err.message)
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
* 删除房间
|
|
* 删除房间
|
|
@@ -1664,7 +1710,7 @@
|
|
|
* @param {Object} row
|
|
* @param {Object} row
|
|
|
*/
|
|
*/
|
|
|
alarm_status_click(index, row) {
|
|
alarm_status_click(index, row) {
|
|
|
- console.log(index, row);
|
|
|
|
|
|
|
+ // console.log(index, row);
|
|
|
this.form_operator_details.name = row.userName
|
|
this.form_operator_details.name = row.userName
|
|
|
this.form_operator_details.contact = row.contact
|
|
this.form_operator_details.contact = row.contact
|
|
|
// 显示操作详情
|
|
// 显示操作详情
|
|
@@ -1876,21 +1922,21 @@
|
|
|
* @param {Object} room
|
|
* @param {Object} room
|
|
|
*/
|
|
*/
|
|
|
add_device(room) {
|
|
add_device(room) {
|
|
|
- // this.$message.success(room)
|
|
|
|
|
- this.currentData.addDevice = room
|
|
|
|
|
|
|
+ // this.$message.success(room);
|
|
|
|
|
+ this.currentData.addDevice = room;
|
|
|
// 填充数据
|
|
// 填充数据
|
|
|
- this.form_add_device.school = this.currentData.school
|
|
|
|
|
- this.form_add_device.build = this.currentData.building
|
|
|
|
|
- this.form_add_device.floors = this.currentData.floor
|
|
|
|
|
- this.form_add_device.room = room
|
|
|
|
|
|
|
+ this.form_add_device.school = this.currentData.school;
|
|
|
|
|
+ this.form_add_device.build = this.currentData.building;
|
|
|
|
|
+ this.form_add_device.floors = this.currentData.floor;
|
|
|
|
|
+ this.form_add_device.room = room;
|
|
|
// 显示对话框
|
|
// 显示对话框
|
|
|
- this.dialog_add_device = true
|
|
|
|
|
|
|
+ this.dialog_add_device = true;
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
- this.$refs.ref_cao.focus()
|
|
|
|
|
- })
|
|
|
|
|
- }, 500)
|
|
|
|
|
|
|
+ this.$refs.ref_deviceName.focus();
|
|
|
|
|
+ });
|
|
|
|
|
+ }, 500);
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
* 操作编辑修改房间
|
|
* 操作编辑修改房间
|
|
@@ -1979,7 +2025,6 @@
|
|
|
duration_use: 0.00, // 使用时长
|
|
duration_use: 0.00, // 使用时长
|
|
|
is_normal: '0', // 是否正常
|
|
is_normal: '0', // 是否正常
|
|
|
is_on: '0', // 是否开启
|
|
is_on: '0', // 是否开启
|
|
|
- cao: '' // 操作员
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -2211,8 +2256,11 @@
|
|
|
border-bottom: 1px solid #CCCCCC;
|
|
border-bottom: 1px solid #CCCCCC;
|
|
|
|
|
|
|
|
.title-left {
|
|
.title-left {
|
|
|
|
|
+ width: 88%;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
|
|
|
.title {
|
|
.title {
|
|
|
font-size: 22px;
|
|
font-size: 22px;
|
|
@@ -2222,7 +2270,7 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.title-detail {
|
|
.title-detail {
|
|
|
- margin-left: 40px;
|
|
|
|
|
|
|
+ margin-left: 16px;
|
|
|
font-size: 18px;
|
|
font-size: 18px;
|
|
|
font-family: Microsoft YaHei-3970(82674968);
|
|
font-family: Microsoft YaHei-3970(82674968);
|
|
|
color: #1A202B;
|
|
color: #1A202B;
|
|
@@ -2371,7 +2419,7 @@
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
color: #00ff00;
|
|
color: #00ff00;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
.power-icon-off {
|
|
.power-icon-off {
|
|
|
font-size: 22px;
|
|
font-size: 22px;
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
@@ -2585,7 +2633,7 @@
|
|
|
height: fit-content !important;
|
|
height: fit-content !important;
|
|
|
width: fit-content !important;
|
|
width: fit-content !important;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
.dialog-footer {
|
|
.dialog-footer {
|
|
|
height: 68px !important;
|
|
height: 68px !important;
|
|
|
}
|
|
}
|
|
@@ -2594,4 +2642,4 @@
|
|
|
.el-dialog-delete-air .el-dialog__header {
|
|
.el-dialog-delete-air .el-dialog__header {
|
|
|
display: none !important;
|
|
display: none !important;
|
|
|
}
|
|
}
|
|
|
-</style>
|
|
|
|
|
|
|
+</style>
|