feat: refs #6994 create VnLogValue and use in VnLog

This commit is contained in:
Alex Moreno 2025-03-12 14:17:51 +01:00
parent 6d0b4b7607
commit 0a9560f286
2 changed files with 32 additions and 12 deletions

View File

@ -10,7 +10,7 @@ import { useColor } from 'src/composables/useColor';
import { useCapitalize } from 'src/composables/useCapitalize'; import { useCapitalize } from 'src/composables/useCapitalize';
import { useValidator } from 'src/composables/useValidator'; import { useValidator } from 'src/composables/useValidator';
import VnAvatar from '../ui/VnAvatar.vue'; import VnAvatar from '../ui/VnAvatar.vue';
import VnJsonValue from '../common/VnJsonValue.vue'; import VnLogValue from './VnLogValue.vue';
import FetchData from '../FetchData.vue'; import FetchData from '../FetchData.vue';
import VnSelect from './VnSelect.vue'; import VnSelect from './VnSelect.vue';
import VnUserLink from '../ui/VnUserLink.vue'; import VnUserLink from '../ui/VnUserLink.vue';
@ -560,9 +560,11 @@ watch(
value.nameI18n value.nameI18n
}}: }}:
</span> </span>
<VnJsonValue <VnLogValue
:value="prop.val" :value="
:name="prop.name" value.val.val
"
:name="value.name"
/> />
</QItem> </QItem>
</QCardSection> </QCardSection>
@ -613,10 +615,11 @@ watch(
> >
{{ prop.nameI18n }}: {{ prop.nameI18n }}:
</span> </span>
<VnJsonValue <VnLogValue
:value="prop.val" :value="prop.val.val"
:name="prop.name" :name="prop.name"
/> />
<VnIconLink />
<span <span
v-if=" v-if="
propIndex < propIndex <
@ -644,8 +647,8 @@ watch(
{{ prop.nameI18n }}: {{ prop.nameI18n }}:
</span> </span>
<span v-if="log.action == 'update'"> <span v-if="log.action == 'update'">
<VnJsonValue <VnLogValue
:value="prop.old" :value="prop.old.val"
:name="prop.name" :name="prop.name"
/> />
<span <span
@ -655,8 +658,8 @@ watch(
#{{ prop.old.id }} #{{ prop.old.id }}
</span> </span>
<VnJsonValue <VnLogValue
:value="prop.val" :value="prop.val.val"
:name="prop.name" :name="prop.name"
/> />
<span <span
@ -667,8 +670,8 @@ watch(
</span> </span>
</span> </span>
<span v-else="prop.old.val"> <span v-else="prop.old.val">
<VnJsonValue <VnLogValue
:value="prop.val" :value="prop.val.val"
:name="prop.name" :name="prop.name"
/> />
<span <span

View File

@ -0,0 +1,17 @@
<script setup>
import { useDescriptorStore } from 'src/stores/useDescriptorStore';
import VnJsonValue from './VnJsonValue.vue';
import { computed } from 'vue';
const descriptorStore = useDescriptorStore();
const $props = defineProps({
name: { type: [String], default: undefined },
});
const descriptor = computed(() => descriptorStore.has($props.name));
</script>
<template>
<VnJsonValue v-bind="$attrs" />
<QIcon name="launch" class="link" v-if="$attrs.value && descriptor" />
<component :is="descriptor" :id="$attrs.value" v-if="$attrs.value && descriptor" />
</template>