Dateityp-Belegarten in Listen anzeigen
This commit is contained in:
@@ -75,6 +75,11 @@
|
|||||||
|
|
||||||
return `${stringValue.substring(0, maxLength)}...`
|
return `${stringValue.substring(0, maxLength)}...`
|
||||||
}
|
}
|
||||||
|
const getColumnDisplayValue = (column, row) => {
|
||||||
|
const value = row[column.key]
|
||||||
|
if (column.displayFunction) return column.displayFunction(value, row)
|
||||||
|
return value
|
||||||
|
}
|
||||||
const handleSortChange = (value) => {
|
const handleSortChange = (value) => {
|
||||||
const nextSort = Array.isArray(value) ? value[0] : undefined
|
const nextSort = Array.isArray(value) ? value[0] : undefined
|
||||||
|
|
||||||
@@ -148,9 +153,9 @@
|
|||||||
v-slot:[`${column.key}-cell`]="{ row }">
|
v-slot:[`${column.key}-cell`]="{ row }">
|
||||||
<component v-if="column.component" :is="column.component" :row="row.original"></component>
|
<component v-if="column.component" :is="column.component" :row="row.original"></component>
|
||||||
<span v-else-if="row.original[column.key]" class="block truncate">
|
<span v-else-if="row.original[column.key]" class="block truncate">
|
||||||
<UTooltip :text="String(row.original[column.key])">
|
<UTooltip :text="String(getColumnDisplayValue(column, row.original))">
|
||||||
<span class="block truncate">
|
<span class="block truncate">
|
||||||
{{ `${truncateValue(row.original[column.key], column.maxLength)}${column.unit ? ` ${column.unit}` : ''}` }}
|
{{ `${truncateValue(getColumnDisplayValue(column, row.original), column.maxLength)}${column.unit ? ` ${column.unit}` : ''}` }}
|
||||||
</span>
|
</span>
|
||||||
</UTooltip>
|
</UTooltip>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -317,9 +317,17 @@ const truncateValue = (value, maxLength) => {
|
|||||||
return `${stringValue.substring(0, maxLength)}...`
|
return `${stringValue.substring(0, maxLength)}...`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getColumnDisplayValue = (column, row) => {
|
||||||
|
const value = row[column.key]
|
||||||
|
if (column.displayFunction) return column.displayFunction(value, row)
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
|
||||||
const getDistinctFilterItems = (columnKey) => {
|
const getDistinctFilterItems = (columnKey) => {
|
||||||
|
const column = dataType.templateColumns.find((item) => item.key === columnKey)
|
||||||
|
|
||||||
return (itemsMeta.value?.distinctValues?.[columnKey] || []).map((value) => ({
|
return (itemsMeta.value?.distinctValues?.[columnKey] || []).map((value) => ({
|
||||||
label: String(value),
|
label: String(column?.displayFunction ? column.displayFunction(value) : value),
|
||||||
value
|
value
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
@@ -550,9 +558,9 @@ const isDistinctFilterActive = (columnKey) => {
|
|||||||
v-slot:[`${column.key}-cell`]="{row}">
|
v-slot:[`${column.key}-cell`]="{row}">
|
||||||
<component v-if="column.component" :is="column.component" :row="row.original"></component>
|
<component v-if="column.component" :is="column.component" :row="row.original"></component>
|
||||||
<span v-else-if="row.original[column.key]" class="block truncate">
|
<span v-else-if="row.original[column.key]" class="block truncate">
|
||||||
<UTooltip :text="String(row.original[column.key])">
|
<UTooltip :text="String(getColumnDisplayValue(column, row.original))">
|
||||||
<span class="block truncate">
|
<span class="block truncate">
|
||||||
{{ `${truncateValue(row.original[column.key], column.maxLength)}${column.unit ? ` ${column.unit}` : ''}` }}
|
{{ `${truncateValue(getColumnDisplayValue(column, row.original), column.maxLength)}${column.unit ? ` ${column.unit}` : ''}` }}
|
||||||
</span>
|
</span>
|
||||||
</UTooltip>
|
</UTooltip>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -87,6 +87,10 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
{ key: "reminders", label: "Mahnung" },
|
{ key: "reminders", label: "Mahnung" },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
const getFiletagDocumentTypeLabel = (options, value) => {
|
||||||
|
return options.find((option) => option.key === value)?.label || value
|
||||||
|
}
|
||||||
|
|
||||||
const dataTypes = {
|
const dataTypes = {
|
||||||
tasks: {
|
tasks: {
|
||||||
isArchivable: true,
|
isArchivable: true,
|
||||||
@@ -2397,6 +2401,9 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
selectValueAttribute: "key",
|
selectValueAttribute: "key",
|
||||||
selectOptionAttribute: "label",
|
selectOptionAttribute: "label",
|
||||||
selectManualOptions: filetagCreatedDocumentTypeOptions,
|
selectManualOptions: filetagCreatedDocumentTypeOptions,
|
||||||
|
displayFunction: function (value) {
|
||||||
|
return getFiletagDocumentTypeLabel(filetagCreatedDocumentTypeOptions, value)
|
||||||
|
},
|
||||||
inputColumn: "Automatik",
|
inputColumn: "Automatik",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -2406,6 +2413,9 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
selectValueAttribute: "key",
|
selectValueAttribute: "key",
|
||||||
selectOptionAttribute: "label",
|
selectOptionAttribute: "label",
|
||||||
selectManualOptions: filetagIncomingDocumentTypeOptions,
|
selectManualOptions: filetagIncomingDocumentTypeOptions,
|
||||||
|
displayFunction: function (value) {
|
||||||
|
return getFiletagDocumentTypeLabel(filetagIncomingDocumentTypeOptions, value)
|
||||||
|
},
|
||||||
inputColumn: "Automatik",
|
inputColumn: "Automatik",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user