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 }, +); +