From a45719001daa7b7ec6cf8fd4da1f291e4a953c36 Mon Sep 17 00:00:00 2001 From: xins Date: Fri, 10 Nov 2023 16:06:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8B=A5=E4=BE=9D=E5=BE=AE=E6=9C=8D=E5=8A=A11.?= =?UTF-8?q?9.4=20business=EF=BC=9A=201=E3=80=81=E8=AE=BE=E5=A4=87=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=A2=9E=E5=8A=A0=E6=A0=B9=E6=8D=AE=E7=BD=91=E5=85=B3?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/business/HwDeviceMapper.xml | 1 + ruoyi-ui/src/views/business/device/index.vue | 590 +++++++++++------- 2 files changed, 355 insertions(+), 236 deletions(-) diff --git a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwDeviceMapper.xml b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwDeviceMapper.xml index 7aa5481..15ec32e 100644 --- a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwDeviceMapper.xml +++ b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwDeviceMapper.xml @@ -276,6 +276,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and hd.active_status = #{activeStatus} and hd.device_status = #{deviceStatus} and hd.tenant_id = #{tenantId} + and hd.releated_device_id = #{releatedDeviceId} and hd.online_status = #{onlineStatus} ${params.tenantDataScope} diff --git a/ruoyi-ui/src/views/business/device/index.vue b/ruoyi-ui/src/views/business/device/index.vue index 179f887..fb9ee22 100644 --- a/ruoyi-ui/src/views/business/device/index.vue +++ b/ruoyi-ui/src/views/business/device/index.vue @@ -1,245 +1,298 @@ @@ -458,6 +512,8 @@ import { import {getToken} from "@/utils/auth"; import Treeselect from "@riophae/vue-treeselect"; 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 { components: {Treeselect}, @@ -489,6 +545,13 @@ export default { data() { return { + toggleMenuLeftImg: toggleMenuLeftImg, + toggleMenuRightImg: toggleMenuRightImg, + toggleLeftDisplay: true, + toggleRightDisplay: false, + // 网关设备名称 + gatewayDeviceName: undefined, + // 遮罩层 loading: true, // 选中数组 @@ -503,6 +566,8 @@ export default { total: 0, // 设备信息表格数据 deviceList: [], + // 网关设备信息表格数据 + gatewayDeviceList: [], //场景列表 scenes: [], //查询页面监控单元树 @@ -544,6 +609,10 @@ export default { // 是否显示弹出层 open: false, + defaultProps: { + children: "children", + label: "deviceName" + }, // 用户导入参数 upload: { @@ -653,8 +722,15 @@ export default { fileList: [], }; }, + watch: { + // 根据名称筛选部门树 + gatewayDeviceName(val) { + this.$refs.tree.filter(val); + } + }, created() { this.getList(); + this.getGatewayDeviceList(); getScenes().then(response => { this.scenes = response.data; }); @@ -690,6 +766,15 @@ export default { this.loading = false; }); }, + + getGatewayDeviceList() { + this.loading = true; + listDevice({"deviceType": 1}).then(response => { + this.gatewayDeviceList = response.rows; + this.loading = false; + }); + }, + // 取消按钮 cancel() { this.open = false; @@ -737,6 +822,8 @@ export default { /** 重置按钮操作 */ resetQuery() { this.resetForm("queryForm"); + this.queryParams.deviceType = null; + this.queryParams.releatedDeviceId = null; this.handleQuery(); }, // 多选框选中数据 @@ -1115,7 +1202,7 @@ export default { importTemplate() { this.$refs["uploadForm"].validate(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(); } }); + }, + + // 筛选节点 + 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; + } } } }; - +