From 7b727d5587f33b49f92384bc54964c46f245a638 Mon Sep 17 00:00:00 2001 From: hear <70554662+Wzyyy98@users.noreply.github.com> Date: Wed, 15 Nov 2023 16:25:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Ds7=E7=82=B9=E4=BD=8Dbu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 修复s7点位bug --- .../Collector/Point/Save/SaveS7.vue | 28 +++++++++- .../Point/components/WritePoint/index.vue | 55 +++++++++++++++++++ .../DataCollect/Collector/Point/index.vue | 14 ++++- 3 files changed, 93 insertions(+), 4 deletions(-) diff --git a/src/views/DataCollect/Collector/Point/Save/SaveS7.vue b/src/views/DataCollect/Collector/Point/Save/SaveS7.vue index 3415bc07..f02c333f 100644 --- a/src/views/DataCollect/Collector/Point/Save/SaveS7.vue +++ b/src/views/DataCollect/Collector/Point/Save/SaveS7.vue @@ -177,7 +177,7 @@ const emit = defineEmits(['change']); const loading = ref(false); const formRef = ref(); const formRef2 = ref(); -const deviceType = ref('S200'); +const deviceType = ref(props.data.deviceType); const dataTypesList = ref([]); const daveAreaList = ref([]); @@ -326,12 +326,38 @@ const Area = (_: any, value: any): Promise => onMounted(() => { form.value.features = props.data.features?.map((item:any)=>item.value) + form.value.configuration.bytes = props.data.configuration?.bytes if(props.data.accessModes?.length!==0){ form.value.accessModes = props.data.accessModes?.map((item:any)=>item.value) } }) +watch( + () => dataTypesList.value, + (val: any[]) => { + if (val) { + const result: any = dataTypesList.value.find( + (item: any) => item.id == form.value.configuration.type, + ); + if(result) { + // console.log('result',result) + disabled.value = (result && result.length !== 0); + } + } + }, +); + +watch( + () => form.value.configuration.type, + (val) => { + if (val !== 'Bool') { + form.value.configuration.bits = 0; + } + }, + { deep: true }, +); +