From 573e42724de566b3e695c93e00a4c53d972d2495 Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Wed, 31 May 2023 16:09:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9opc=5Fua=E5=86=99?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/data-collect/collector.ts | 3 ++ .../Collector/Point/Save/SaveOPCUA.vue | 31 ++++++++--- .../DataCollect/Collector/Point/Scan/Tree.vue | 1 + .../Collector/Point/Scan/index.vue | 1 + .../Point/components/WritePoint/index.vue | 53 ++++++++++++++++++- 5 files changed, 81 insertions(+), 8 deletions(-) diff --git a/src/api/data-collect/collector.ts b/src/api/data-collect/collector.ts index 8dadd463..191913ce 100644 --- a/src/api/data-collect/collector.ts +++ b/src/api/data-collect/collector.ts @@ -55,3 +55,6 @@ export const scanOpcUAList = (data: any) => data?.nodeId || '' }`, ); + +export const queryTypeList = () => server.get(`/data-collect/opc/data-types`); + diff --git a/src/views/DataCollect/Collector/Point/Save/SaveOPCUA.vue b/src/views/DataCollect/Collector/Point/Save/SaveOPCUA.vue index 3192c66e..8309a1a6 100644 --- a/src/views/DataCollect/Collector/Point/Save/SaveOPCUA.vue +++ b/src/views/DataCollect/Collector/Point/Save/SaveOPCUA.vue @@ -19,13 +19,15 @@ (); const id = props.data.id; const collectorId = props.data.collectorId; const provider = props.data.provider; +const options = ref([]); const formData = ref({ name: '', @@ -157,6 +161,19 @@ const filterOption = (input: string, option: any) => { return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0; }; +onMounted(() => { + queryTypeList().then((resp: any) => { + if(resp.status === 200){ + options.value = (resp?.result || []).map((item: any) => { + return { + label: item, + value: item + } + }) + } + }) +}) + watch( () => props.data, (value) => { diff --git a/src/views/DataCollect/Collector/Point/Scan/Tree.vue b/src/views/DataCollect/Collector/Point/Scan/Tree.vue index f506b4a5..f036dfe3 100644 --- a/src/views/DataCollect/Collector/Point/Scan/Tree.vue +++ b/src/views/DataCollect/Collector/Point/Scan/Tree.vue @@ -130,6 +130,7 @@ const onCheck = (checkedKeys: any, info: any) => { value: last ? last?.accessModes?.value : one?.accessModes || [], check: true, }, + type: one?.type, configuration: { ...one?.configuration, interval: { diff --git a/src/views/DataCollect/Collector/Point/Scan/index.vue b/src/views/DataCollect/Collector/Point/Scan/index.vue index 0509830f..b92cf84e 100644 --- a/src/views/DataCollect/Collector/Point/Scan/index.vue +++ b/src/views/DataCollect/Collector/Point/Scan/index.vue @@ -65,6 +65,7 @@ const handleOk = async () => { pointKey: item.id, configuration: { interval: item.configuration?.interval?.value, + type: item.type, }, features: !item.features?.value ? [] : ['changedOnly'], accessModes: item.accessModes?.value || [], diff --git a/src/views/DataCollect/Collector/Point/components/WritePoint/index.vue b/src/views/DataCollect/Collector/Point/components/WritePoint/index.vue index ac56f2bd..be170d52 100644 --- a/src/views/DataCollect/Collector/Point/components/WritePoint/index.vue +++ b/src/views/DataCollect/Collector/Point/components/WritePoint/index.vue @@ -30,6 +30,57 @@ showCount /> + + + + + + +