|
|
@ -1,6 +1,55 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div class="app-container">
|
|
|
|
<div class="app-container">
|
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-col :span="0.1" :xs="24" v-if="toggleRightDisplay">
|
|
|
|
|
|
|
|
<div @click="toggleDeviceClick">
|
|
|
|
|
|
|
|
<img v-if="toggleMenuRightImg" :src="toggleMenuRightImg" class="hamburger"/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
<!--网关设备数据-->
|
|
|
|
|
|
|
|
<el-col :span="4" :xs="24" v-if="toggleLeftDisplay">
|
|
|
|
|
|
|
|
<div @click="toggleDeviceClick" style="display:flex;justify-content: space-between">
|
|
|
|
|
|
|
|
<h6 class="form-header h6" style="margin: 10px 0 10px 0">网关设备,点击过滤显示子设备</h6>
|
|
|
|
|
|
|
|
<img v-if="toggleMenuLeftImg" :src="toggleMenuLeftImg" class="hamburger"/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="head-container">
|
|
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
|
|
v-model="gatewayDeviceName"
|
|
|
|
|
|
|
|
placeholder="请输入网关设备名称"
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
|
|
prefix-icon="el-icon-search"
|
|
|
|
|
|
|
|
style="margin-bottom: 20px"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="head-container">
|
|
|
|
|
|
|
|
<el-tree
|
|
|
|
|
|
|
|
:data="gatewayDeviceList"
|
|
|
|
|
|
|
|
:props="defaultProps"
|
|
|
|
|
|
|
|
:expand-on-click-node="false"
|
|
|
|
|
|
|
|
:filter-node-method="filterNode"
|
|
|
|
|
|
|
|
ref="tree"
|
|
|
|
|
|
|
|
node-key="deviceId"
|
|
|
|
|
|
|
|
default-expand-all
|
|
|
|
|
|
|
|
highlight-current
|
|
|
|
|
|
|
|
@node-click="handleNodeClick"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
<!--设备数据-->
|
|
|
|
|
|
|
|
<el-col :span="20" :xs="24">
|
|
|
|
|
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
|
|
|
|
|
|
|
|
label-width="68px">
|
|
|
|
|
|
|
|
<el-form-item label="网关设备" prop="releatedDeviceId" v-if="false">
|
|
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
|
|
v-model="queryParams.releatedDeviceId"
|
|
|
|
|
|
|
|
placeholder="请输入设备编号"
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="设备编号" prop="deviceCode">
|
|
|
|
<el-form-item label="设备编号" prop="deviceCode">
|
|
|
|
<el-input
|
|
|
|
<el-input
|
|
|
|
v-model="queryParams.deviceCode"
|
|
|
|
v-model="queryParams.deviceCode"
|
|
|
@ -241,6 +290,10 @@
|
|
|
|
@pagination="getList"
|
|
|
|
@pagination="getList"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改设备信息对话框 -->
|
|
|
|
<!-- 添加或修改设备信息对话框 -->
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
@ -436,6 +489,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
</el-dialog>
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
@ -458,6 +512,8 @@ import {
|
|
|
|
import {getToken} from "@/utils/auth";
|
|
|
|
import {getToken} from "@/utils/auth";
|
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
|
|
|
|
|
import toggleMenuLeftImg from '@/assets/images/togglemenu-left.png'
|
|
|
|
|
|
|
|
import toggleMenuRightImg from '@/assets/images/togglemenu-right.png'
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
components: {Treeselect},
|
|
|
|
components: {Treeselect},
|
|
|
@ -489,6 +545,13 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
|
|
|
|
toggleMenuLeftImg: toggleMenuLeftImg,
|
|
|
|
|
|
|
|
toggleMenuRightImg: toggleMenuRightImg,
|
|
|
|
|
|
|
|
toggleLeftDisplay: true,
|
|
|
|
|
|
|
|
toggleRightDisplay: false,
|
|
|
|
|
|
|
|
// 网关设备名称
|
|
|
|
|
|
|
|
gatewayDeviceName: undefined,
|
|
|
|
|
|
|
|
|
|
|
|
// 遮罩层
|
|
|
|
// 遮罩层
|
|
|
|
loading: true,
|
|
|
|
loading: true,
|
|
|
|
// 选中数组
|
|
|
|
// 选中数组
|
|
|
@ -503,6 +566,8 @@ export default {
|
|
|
|
total: 0,
|
|
|
|
total: 0,
|
|
|
|
// 设备信息表格数据
|
|
|
|
// 设备信息表格数据
|
|
|
|
deviceList: [],
|
|
|
|
deviceList: [],
|
|
|
|
|
|
|
|
// 网关设备信息表格数据
|
|
|
|
|
|
|
|
gatewayDeviceList: [],
|
|
|
|
//场景列表
|
|
|
|
//场景列表
|
|
|
|
scenes: [],
|
|
|
|
scenes: [],
|
|
|
|
//查询页面监控单元树
|
|
|
|
//查询页面监控单元树
|
|
|
@ -544,6 +609,10 @@ export default {
|
|
|
|
// 是否显示弹出层
|
|
|
|
// 是否显示弹出层
|
|
|
|
open: false,
|
|
|
|
open: false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
defaultProps: {
|
|
|
|
|
|
|
|
children: "children",
|
|
|
|
|
|
|
|
label: "deviceName"
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 用户导入参数
|
|
|
|
// 用户导入参数
|
|
|
|
upload: {
|
|
|
|
upload: {
|
|
|
@ -653,8 +722,15 @@ export default {
|
|
|
|
fileList: [],
|
|
|
|
fileList: [],
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
watch: {
|
|
|
|
|
|
|
|
// 根据名称筛选部门树
|
|
|
|
|
|
|
|
gatewayDeviceName(val) {
|
|
|
|
|
|
|
|
this.$refs.tree.filter(val);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
|
this.getList();
|
|
|
|
this.getList();
|
|
|
|
|
|
|
|
this.getGatewayDeviceList();
|
|
|
|
getScenes().then(response => {
|
|
|
|
getScenes().then(response => {
|
|
|
|
this.scenes = response.data;
|
|
|
|
this.scenes = response.data;
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -690,6 +766,15 @@ export default {
|
|
|
|
this.loading = false;
|
|
|
|
this.loading = false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getGatewayDeviceList() {
|
|
|
|
|
|
|
|
this.loading = true;
|
|
|
|
|
|
|
|
listDevice({"deviceType": 1}).then(response => {
|
|
|
|
|
|
|
|
this.gatewayDeviceList = response.rows;
|
|
|
|
|
|
|
|
this.loading = false;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 取消按钮
|
|
|
|
// 取消按钮
|
|
|
|
cancel() {
|
|
|
|
cancel() {
|
|
|
|
this.open = false;
|
|
|
|
this.open = false;
|
|
|
@ -737,6 +822,8 @@ export default {
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
resetQuery() {
|
|
|
|
resetQuery() {
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
|
|
|
|
this.queryParams.deviceType = null;
|
|
|
|
|
|
|
|
this.queryParams.releatedDeviceId = null;
|
|
|
|
this.handleQuery();
|
|
|
|
this.handleQuery();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 多选框选中数据
|
|
|
|
// 多选框选中数据
|
|
|
@ -1115,7 +1202,7 @@ export default {
|
|
|
|
importTemplate() {
|
|
|
|
importTemplate() {
|
|
|
|
this.$refs["uploadForm"].validate(valid => {
|
|
|
|
this.$refs["uploadForm"].validate(valid => {
|
|
|
|
if (valid) {
|
|
|
|
if (valid) {
|
|
|
|
this.download('business/device/importTemplate', {"sceneId": this.upload.sceneId}, `device_template_`+this.upload.sceneName+`_${new Date().getTime()}.xlsx`)
|
|
|
|
this.download('business/device/importTemplate', {"sceneId": this.upload.sceneId}, `device_template_` + this.upload.sceneName + `_${new Date().getTime()}.xlsx`)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -1138,9 +1225,40 @@ export default {
|
|
|
|
this.$refs.upload.submit();
|
|
|
|
this.$refs.upload.submit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 筛选节点
|
|
|
|
|
|
|
|
filterNode(value, data) {
|
|
|
|
|
|
|
|
if (!value) return true;
|
|
|
|
|
|
|
|
return data.deviceName.indexOf(value) !== -1;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 节点单击事件
|
|
|
|
|
|
|
|
handleNodeClick(data) {
|
|
|
|
|
|
|
|
this.queryParams.deviceType = this.DEVICE_TYPE_GATEWAY_SUB_EQUIPMENT;
|
|
|
|
|
|
|
|
this.queryParams.releatedDeviceId = data.deviceId;
|
|
|
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
toggleDeviceClick() {
|
|
|
|
|
|
|
|
if (this.toggleLeftDisplay) {
|
|
|
|
|
|
|
|
this.toggleRightDisplay = true;
|
|
|
|
|
|
|
|
this.toggleLeftDisplay = false;
|
|
|
|
|
|
|
|
} else if (this.toggleRightDisplay) {
|
|
|
|
|
|
|
|
this.toggleRightDisplay = false;
|
|
|
|
|
|
|
|
this.toggleLeftDisplay = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
|
.hamburger {
|
|
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
|
|
width: 20px;
|
|
|
|
|
|
|
|
height: 20px;
|
|
|
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
|
|
|
margin: 5px 5px 0 0;
|
|
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|
|
|
|