2026-01-02 13:41:09 +00:00
|
|
|
|
<!-- Copyright (C) 2012-2026 Zammad Foundation, https://zammad-foundation.org/ -->
|
2022-08-31 11:19:01 +00:00
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
|
import { computed } from 'vue'
|
2024-05-17 13:31:19 +00:00
|
|
|
|
|
2023-04-24 12:50:55 +00:00
|
|
|
|
import { translateOption } from '../../utils.ts'
|
2024-05-17 13:31:19 +00:00
|
|
|
|
|
2023-04-24 12:50:55 +00:00
|
|
|
|
import type { ObjectAttributeSingleSelect } from './attributeSingleSelectTypes.ts'
|
2024-12-12 09:24:27 +00:00
|
|
|
|
import type { ObjectAttributeProps } from '../../types.ts'
|
2022-08-31 11:19:01 +00:00
|
|
|
|
|
2025-06-11 17:45:28 +00:00
|
|
|
|
const props = defineProps<ObjectAttributeProps<ObjectAttributeSingleSelect, string>>()
|
2022-08-31 11:19:01 +00:00
|
|
|
|
|
|
|
|
|
|
const body = computed(() => {
|
|
|
|
|
|
if (props.attribute.dataType === 'tree_select') {
|
|
|
|
|
|
return props.value
|
|
|
|
|
|
.split('::')
|
|
|
|
|
|
.map((field) => translateOption(props.attribute, field))
|
2025-03-05 10:47:23 +00:00
|
|
|
|
.join(' › ')
|
2022-08-31 11:19:01 +00:00
|
|
|
|
}
|
2025-06-11 17:45:28 +00:00
|
|
|
|
const value = props.attribute.dataOption.historical_options?.[props.value] ?? props.value
|
2022-08-31 11:19:01 +00:00
|
|
|
|
return translateOption(props.attribute, value)
|
|
|
|
|
|
})
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
|
{{ body }}
|
|
|
|
|
|
</template>
|