From 1cde879d78794d84173d41232976c7194a3ef156 Mon Sep 17 00:00:00 2001 From: odjbin <1042039504@qq.com> Date: Mon, 25 Mar 2024 16:31:37 +0800 Subject: [PATCH] =?UTF-8?q?fix=20:=20=E4=BF=AE=E5=A4=8D=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E9=98=B2=E6=8A=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/views/device-manage/index.vue | 8 +++--- src/views/edit/edit.vue | 6 ++-- src/views/site/index.vue | 14 +++++----- src/views/tunnel-manage/index.vue | 46 +++++++++++++++++++++++-------- src/views/tunnel/index.vue | 5 ++-- src/views/user/index.vue | 17 +++++++----- 7 files changed, 62 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index 9d118c2..8f2339d 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ }, "devDependencies": { "@vitejs/plugin-vue": "^4.2.1", + "lodash": "^4.17.21", "unplugin-auto-import": "^0.15.3", "unplugin-vue-components": "^0.24.1", "vite": "^4.3.4" diff --git a/src/views/device-manage/index.vue b/src/views/device-manage/index.vue index 2897ee9..cdd53de 100644 --- a/src/views/device-manage/index.vue +++ b/src/views/device-manage/index.vue @@ -310,7 +310,7 @@ import {ElLoading, ElMessage} from "element-plus"; import {getEquipmentList, editEquipment, getTunnelDetail} from "@/api/tunnelManage"; import TunnelTitle from "@/components/tunnelTitle/index.vue"; - +import { debounce } from 'lodash' const router = useRouter() const tunnelId = reactive(router.currentRoute.value.params.tunnelId) const userId = reactive(router.currentRoute.value.params.userId) @@ -373,7 +373,7 @@ const changeData = (item) => { state: item.state, } } -const editEquip = () => { +const editEquip = debounce(() => { let newFrequency = [{ acquisitionPeriod: fanFrequency.value * 1000, tunnelId: parseInt(tunnelId), @@ -393,7 +393,7 @@ const editEquip = () => { fanData.value.forEach(item => { let obj = { equipmentId: item.equipmentId, - ratedPower:parseInt(item.ratedPower), + ratedPower: parseInt(item.ratedPower), acurrentValue: parseInt(item.acurrentValue), bcurrentValue: parseInt(item.bcurrentValue), ccurrentValue: parseInt(item.ccurrentValue), @@ -423,7 +423,7 @@ const editEquip = () => { ElMessage.error(res.msg) } }) -} +}, 1000) const handleChangeMenu = (e) => { changeIndex.value = e diff --git a/src/views/edit/edit.vue b/src/views/edit/edit.vue index 7cd828d..65db929 100644 --- a/src/views/edit/edit.vue +++ b/src/views/edit/edit.vue @@ -78,7 +78,7 @@ import {editTunnel, getTunnelDetail} from "@/api/tunnelManage"; import {ElLoading, ElMessage} from "element-plus"; import {initSceneData} from "@/api/tunnelScene"; import TunnelTitle from "@/components/tunnelTitle/index.vue"; - +import { debounce } from 'lodash' const router = useRouter(); const tunnelId = reactive(router.currentRoute.value.params.tunnelId); const userId = reactive(router.currentRoute.value.params.userId); @@ -144,9 +144,9 @@ const getTunnelInfo = () => { }); }) } -const handleSave = () => { +const handleSave =debounce(() => { getTunnelInfo() -}; +},1000)