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 { ObjectAttributeMultiSelect } from './attributeMultiSelectTypes.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<ObjectAttributeMultiSelect, string[]>>()
|
2022-08-31 11:19:01 +00:00
|
|
|
|
|
|
|
|
|
|
const body = computed(() => {
|
|
|
|
|
|
if (props.attribute.dataType === 'multi_tree_select') {
|
|
|
|
|
|
return props.value
|
|
|
|
|
|
.map((value) =>
|
|
|
|
|
|
value
|
|
|
|
|
|
.split('::')
|
|
|
|
|
|
.map((option) => translateOption(props.attribute, option))
|
2025-03-05 10:47:23 +00:00
|
|
|
|
.join(' › '),
|
2022-08-31 11:19:01 +00:00
|
|
|
|
)
|
|
|
|
|
|
.join(', ')
|
|
|
|
|
|
}
|
|
|
|
|
|
return props.value
|
|
|
|
|
|
.map((key) => {
|
2022-11-30 09:00:58 +00:00
|
|
|
|
const option = props.attribute.dataOption.historical_options?.[key] ?? key
|
2022-08-31 11:19:01 +00:00
|
|
|
|
return translateOption(props.attribute, option)
|
|
|
|
|
|
})
|
|
|
|
|
|
.join(', ')
|
|
|
|
|
|
})
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
|
{{ body }}
|
|
|
|
|
|
</template>
|