From 51da808ae7d71b4bbd110accacaca1821fb0636f Mon Sep 17 00:00:00 2001 From: jackhoo_98 Date: Wed, 29 Mar 2023 16:14:16 +0800 Subject: [PATCH 1/2] fix: bug#10965 --- src/views/DataCollect/Dashboard/components/Card.vue | 2 ++ src/views/link/DashBoard/components/Cpu.vue | 1 + src/views/link/DashBoard/components/Jvm.vue | 1 + src/views/link/DashBoard/components/Network.vue | 1 + 4 files changed, 5 insertions(+) diff --git a/src/views/DataCollect/Dashboard/components/Card.vue b/src/views/DataCollect/Dashboard/components/Card.vue index 3f1d19eb..edb96cbe 100644 --- a/src/views/DataCollect/Dashboard/components/Card.vue +++ b/src/views/DataCollect/Dashboard/components/Card.vue @@ -52,6 +52,7 @@ const data: any = ref({ const pickerTimeChange = () => { data.value.time.type = undefined; + console.log(1); }; const getEcharts = async (val: any) => { @@ -108,6 +109,7 @@ const handleOptions = (x = [], y = []) => { watch( () => data.value.time.type, (value) => { + if (value === undefined) return; const date = getTimeByType(value); data.value.time.time = [dayjs(date), dayjs(new Date())]; }, diff --git a/src/views/link/DashBoard/components/Cpu.vue b/src/views/link/DashBoard/components/Cpu.vue index 41462cac..2b03f631 100644 --- a/src/views/link/DashBoard/components/Cpu.vue +++ b/src/views/link/DashBoard/components/Cpu.vue @@ -165,6 +165,7 @@ const handleCpuOptions = (optionsData: any, xAxis: any) => { watch( () => data.value.type, (value) => { + if (value === undefined) return; const date = getTimeByType(value); data.value.time = [dayjs(date), dayjs(new Date())]; }, diff --git a/src/views/link/DashBoard/components/Jvm.vue b/src/views/link/DashBoard/components/Jvm.vue index c9385bd9..d721b18e 100644 --- a/src/views/link/DashBoard/components/Jvm.vue +++ b/src/views/link/DashBoard/components/Jvm.vue @@ -169,6 +169,7 @@ const handleJVMOptions = (optionsData: any, xAxis: any) => { watch( () => data.value.type, (value) => { + if (value === undefined) return; const date = getTimeByType(value); data.value.time = [dayjs(date), dayjs(new Date())]; }, diff --git a/src/views/link/DashBoard/components/Network.vue b/src/views/link/DashBoard/components/Network.vue index 399c5410..73dc81ba 100644 --- a/src/views/link/DashBoard/components/Network.vue +++ b/src/views/link/DashBoard/components/Network.vue @@ -183,6 +183,7 @@ const handleNetworkOptions = (optionsData: any, xAxis: any) => { watch( () => data.value.time.type, (value) => { + if (value === undefined) return; const date = getTimeByType(value); data.value.time.time = [dayjs(date), dayjs(new Date())]; }, From 6abbe346633671a0c4251f81cd2660d2ad5656d2 Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Wed, 29 Mar 2023 16:16:06 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=9C=BA=E6=99=AF?= =?UTF-8?q?=E8=81=94=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scene/Save/action/Device/actions/index.vue | 2 +- .../Scene/Save/action/Device/device/Device.vue | 9 +++------ .../rule-engine/Scene/Save/action/Device/device/Tag.vue | 5 +++++ .../Scene/Save/action/Device/device/index.vue | 1 + src/views/rule-engine/Scene/Save/action/Device/index.vue | 1 - 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/views/rule-engine/Scene/Save/action/Device/actions/index.vue b/src/views/rule-engine/Scene/Save/action/Device/actions/index.vue index 5266196e..f48ed3d6 100644 --- a/src/views/rule-engine/Scene/Save/action/Device/actions/index.vue +++ b/src/views/rule-engine/Scene/Save/action/Device/actions/index.vue @@ -58,7 +58,7 @@ @change="propertySelect" > i?.expands?.type?.includes('read'), ) || []" :value="item?.id" diff --git a/src/views/rule-engine/Scene/Save/action/Device/device/Device.vue b/src/views/rule-engine/Scene/Save/action/Device/device/Device.vue index b98f67dd..8ab6ad76 100644 --- a/src/views/rule-engine/Scene/Save/action/Device/device/Device.vue +++ b/src/views/rule-engine/Scene/Save/action/Device/device/Device.vue @@ -171,15 +171,12 @@ const handleClick = (_detail: any) => { } }; -watch(() => props.value?.[0]?.value, (newVal) => { - if(newVal){ - detail(newVal).then(resp => { +onMounted(() => { + if(props.value?.[0]?.value){ + detail(props.value?.[0]?.value).then(resp => { emit('change', resp.result); }) } -}, { - deep: true, - immediate: true }) watchEffect(() => { diff --git a/src/views/rule-engine/Scene/Save/action/Device/device/Tag.vue b/src/views/rule-engine/Scene/Save/action/Device/device/Tag.vue index b49db279..d839f1bc 100644 --- a/src/views/rule-engine/Scene/Save/action/Device/device/Tag.vue +++ b/src/views/rule-engine/Scene/Save/action/Device/device/Tag.vue @@ -180,6 +180,11 @@ const onValueChange = () => { emits('update:value', [{ value: newValue, name: '标签' }]); emits('change', [{ value: newValue, name: '标签' }], _data); }; + +// onMounted(() => { +// // console.log(tagList.value, props.tagData, props.value) +// // emits('change', props.value, _data); +// })