From c0713842f226235b001cb78c28d8b27e371e6f1b Mon Sep 17 00:00:00 2001 From: zhoule Date: Wed, 8 May 2024 17:02:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=8C=E8=BD=A6=E8=AF=B1=E5=AF=BC=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/DeviceControlDialog.vue | 5 +++- .../Dialogs/DrivingGuidance/index.vue | 29 +++++++++++-------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceControlDialog.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceControlDialog.vue index efaad632..93b1ef0b 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceControlDialog.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceControlDialog.vue @@ -38,7 +38,7 @@ export default { props: { visible: Boolean, deviceId: String, - id: String, + id: Number, deviceType: String, }, data() { @@ -49,6 +49,9 @@ export default { computed: { modelVisible: { get() { + if(this.visible){ + console.log('id',id) + } return this.visible; }, set(val) { diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue index 5a8efaf2..30a45fa7 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/index.vue @@ -164,18 +164,23 @@ export default { handleClickTabs() { }, requestURL(functionId = 52, options = {}) { return new Promise((resolve, reject) => { - request - .post( - `business/device/functions/${this.dialogData.iotDeviceId}/${functionId}`, - options - ) - .then((result) => { - if (result.code != 200) return reject(); - resolve(result.data[0]); - }) - .catch((err) => { - reject(); - }); + if (!this.dialogData.iotDeviceId) { + reject(); + } else { + request + .post( + `business/device/functions/${this.dialogData.iotDeviceId}/${functionId}`, + options + ) + .then((result) => { + if (result.code != 200) return reject(); + resolve(result.data[0]); + }) + .catch((err) => { + reject(); + }); + } + }); }, },