From 27982377803a0b162d307517a57e3ee0411f633e Mon Sep 17 00:00:00 2001 From: "zangch@mesnac.com" Date: Tue, 2 Dec 2025 13:48:20 +0800 Subject: [PATCH] =?UTF-8?q?feat(base):=20=E6=B7=BB=E5=8A=A0=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=8F=82=E6=95=B0=E6=9F=A5=E7=9C=8B=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=8F=8A=E8=81=94=E5=8A=A8=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在设备台账列表中添加“参数”按钮以查看设备参数详情 - 设备详情页设备编号输入框改为可编辑 - 设备台账表单中增加资产编号字段 - 点击“参数”按钮跳转至设备参数页面并携带deviceCode查询参数 - 设备参数页面新增路由query参数监听,实现路由变化时自动刷新设备参数列表 - 重置查询时清除路由中的deviceCode参数,保证查询条件同步 --- src/views/base/deviceLedger/index.vue | 19 +++++++++++++++++-- src/views/base/deviceParam/index.vue | 25 ++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/src/views/base/deviceLedger/index.vue b/src/views/base/deviceLedger/index.vue index 73328bf..df2e42d 100644 --- a/src/views/base/deviceLedger/index.vue +++ b/src/views/base/deviceLedger/index.vue @@ -184,6 +184,13 @@ v-hasPermi="['base:deviceLedger:remove']" >删除 + 参数 + @@ -202,13 +209,13 @@ - + --> - + { this.deviceLedgerList = response.data }) + // 从路由参数获取设备编号 + const deviceCode = this.$route.query.deviceCode; + if (deviceCode) { + this.queryParams.deviceCode = deviceCode; + } this.getList(); }, + watch: { + // 监听路由变化,重新获取参数并查询 + '$route.query.deviceCode': { + handler(newVal, oldVal) { + // 只在值真正变化且新值存在时才查询(避免重置时重复查询) + if (newVal && newVal !== this.queryParams.deviceCode) { + this.queryParams.deviceCode = newVal; + this.queryParams.pageNum = 1; + this.getList(); + } + } + } + }, methods: { /** 查询设备参数列表 */ getList() { @@ -324,6 +342,11 @@ export default { /** 重置按钮操作 */ resetQuery() { this.resetForm("queryForm"); + this.queryParams.deviceCode = null; + // 清除路由中的 deviceCode 参数 + if (this.$route.query.deviceCode) { + this.$router.replace({ path: this.$route.path }); + } this.handleQuery(); }, // 多选框选中数据