feat: refs #6994 create VnLogValue and use in VnLog
This commit is contained in:
parent
6d0b4b7607
commit
0a9560f286
|
@ -10,7 +10,7 @@ import { useColor } from 'src/composables/useColor';
|
|||
import { useCapitalize } from 'src/composables/useCapitalize';
|
||||
import { useValidator } from 'src/composables/useValidator';
|
||||
import VnAvatar from '../ui/VnAvatar.vue';
|
||||
import VnJsonValue from '../common/VnJsonValue.vue';
|
||||
import VnLogValue from './VnLogValue.vue';
|
||||
import FetchData from '../FetchData.vue';
|
||||
import VnSelect from './VnSelect.vue';
|
||||
import VnUserLink from '../ui/VnUserLink.vue';
|
||||
|
@ -560,9 +560,11 @@ watch(
|
|||
value.nameI18n
|
||||
}}:
|
||||
</span>
|
||||
<VnJsonValue
|
||||
:value="prop.val"
|
||||
:name="prop.name"
|
||||
<VnLogValue
|
||||
:value="
|
||||
value.val.val
|
||||
"
|
||||
:name="value.name"
|
||||
/>
|
||||
</QItem>
|
||||
</QCardSection>
|
||||
|
@ -613,10 +615,11 @@ watch(
|
|||
>
|
||||
{{ prop.nameI18n }}:
|
||||
</span>
|
||||
<VnJsonValue
|
||||
:value="prop.val"
|
||||
<VnLogValue
|
||||
:value="prop.val.val"
|
||||
:name="prop.name"
|
||||
/>
|
||||
<VnIconLink />
|
||||
<span
|
||||
v-if="
|
||||
propIndex <
|
||||
|
@ -644,8 +647,8 @@ watch(
|
|||
{{ prop.nameI18n }}:
|
||||
</span>
|
||||
<span v-if="log.action == 'update'">
|
||||
<VnJsonValue
|
||||
:value="prop.old"
|
||||
<VnLogValue
|
||||
:value="prop.old.val"
|
||||
:name="prop.name"
|
||||
/>
|
||||
<span
|
||||
|
@ -655,8 +658,8 @@ watch(
|
|||
#{{ prop.old.id }}
|
||||
</span>
|
||||
→
|
||||
<VnJsonValue
|
||||
:value="prop.val"
|
||||
<VnLogValue
|
||||
:value="prop.val.val"
|
||||
:name="prop.name"
|
||||
/>
|
||||
<span
|
||||
|
@ -667,8 +670,8 @@ watch(
|
|||
</span>
|
||||
</span>
|
||||
<span v-else="prop.old.val">
|
||||
<VnJsonValue
|
||||
:value="prop.val"
|
||||
<VnLogValue
|
||||
:value="prop.val.val"
|
||||
:name="prop.name"
|
||||
/>
|
||||
<span
|
||||
|
|
|
@ -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>
|
Loading…
Reference in New Issue