fix: 修改场景联动

This commit is contained in:
100011797 2023-03-29 16:16:06 +08:00
parent 6d4a442ee8
commit 6abbe34663
5 changed files with 10 additions and 8 deletions

View File

@ -58,7 +58,7 @@
@change="propertySelect"
>
<j-select-option
v-for="item in metadata?.properties.filter((i) =>
v-for="item in (metadata?.properties || []).filter((i) =>
i?.expands?.type?.includes('read'),
) || []"
:value="item?.id"

View File

@ -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(() => {

View File

@ -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);
// })
</script>
<style lang="less" scoped>

View File

@ -285,6 +285,7 @@ const onTagChange = (val: any[], arr: any[]) => {
i.name
}为${i.value}`;
});
console.log(tagName)
emits(
'save',
unref(modelRef),

View File

@ -69,7 +69,6 @@ import Product from './Product.vue';
import Device from './device/index.vue';
import Action from './actions/index.vue';
import { onlyMessage } from '@/utils/comm';
import { detail } from '@/api/device/product';
import { useSceneStore } from '@/store/scene';
import { storeToRefs } from 'pinia';