mirror of
https://github.com/zammad/zammad
synced 2026-05-24 09:48:36 +00:00
Co-authored-by: Vladimir Sheremet <vs@zammad.com> Co-authored-by: Martin Gruner <mg@zammad.com>
28 lines
762 B
Vue
28 lines
762 B
Vue
<!-- Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/ -->
|
|
|
|
<script setup lang="ts">
|
|
import { computed } from 'vue'
|
|
import { translateOption } from '../../utils'
|
|
import type { ObjectAttributeSingleSelect } from './attributeSingleSelectTypes'
|
|
|
|
const props = defineProps<{
|
|
attribute: ObjectAttributeSingleSelect
|
|
value: string
|
|
}>()
|
|
|
|
const body = computed(() => {
|
|
if (props.attribute.dataType === 'tree_select') {
|
|
return props.value
|
|
.split('::')
|
|
.map((field) => translateOption(props.attribute, field))
|
|
.join('::')
|
|
}
|
|
const value =
|
|
props.attribute.dataOption.historical_options?.[props.value] ?? props.value
|
|
return translateOption(props.attribute, value)
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
{{ body }}
|
|
</template>
|