From c0bcccbfaf73e78de2001acaa32454cc05345c5e Mon Sep 17 00:00:00 2001
From: 100011797 <2642441182@qq.com>
Date: Fri, 14 Jul 2023 14:00:14 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../DuerOS/Detail/command/index.vue | 88 +++++++++++++------
1 file changed, 63 insertions(+), 25 deletions(-)
diff --git a/src/views/Northbound/DuerOS/Detail/command/index.vue b/src/views/Northbound/DuerOS/Detail/command/index.vue
index 85f5fe83..6c9df789 100644
--- a/src/views/Northbound/DuerOS/Detail/command/index.vue
+++ b/src/views/Northbound/DuerOS/Detail/command/index.vue
@@ -10,22 +10,28 @@
message: '请选择指令类型',
}"
>
-
- 读取属性
- 修改属性
- 调用功能
-
+ type="messageType"
+ />
+
-
+
import EditTable from './EditTable.vue';
+import MSelect from '../../../components/MSelect/index.vue';
const formRef = ref();
@@ -187,7 +208,7 @@ const props = defineProps({
},
});
-const emit = defineEmits(['update:modelValue'])
+const emit = defineEmits(['update:modelValue']);
const editRef = ref();
@@ -210,11 +231,25 @@ const onPropertyChange = (val: string, flag?: boolean) => {
);
property.value = _item || {};
}
- if(!flag){
- modelRef.message.value = undefined
+ if (!flag) {
+ modelRef.message.value = undefined;
}
};
+const _options = [
+ {
+ id: 'READ_PROPERTY',
+ name: '读取属性',
+ },
+ {
+ id: 'WRITE_PROPERTY',
+ name: '修改属性',
+ },
+ {
+ id: 'INVOKE_FUNCTION',
+ name: '调用功能',
+ },
+];
const onTypeChange = () => {
// 需要记住之前的选择, 所以注释了该代码
// modelRef.message = {
@@ -231,14 +266,14 @@ const funcChange = (val: string, _inputs?: any[]) => {
props.metadata?.functions.find((item: any) => item.id === val)
?.inputs || [];
const list = arr.map((item: any) => {
- const _item = _inputs?.find(i => i.id === item.id)
+ const _item = _inputs?.find((i) => i.id === item.id);
return {
id: item.id,
name: item.name,
value: undefined,
valueType: item?.valueType?.type,
..._item,
- required: item?.expands?.required
+ required: item?.expands?.required,
};
});
modelRef.message.inputs = list;
@@ -254,7 +289,10 @@ watch(
onPropertyChange(newVal?.message?.properties, true);
}
if (newVal?.message?.functionId) {
- funcChange(newVal?.message?.functionId, newVal?.message?.inputs);
+ funcChange(
+ newVal?.message?.functionId,
+ newVal?.message?.inputs,
+ );
}
}
},
@@ -273,7 +311,7 @@ const saveBtn = () =>
resolve(false);
});
}
- emit('update:modelValue', _data)
+ emit('update:modelValue', _data);
resolve(_data);
})
.catch((err: any) => {