This commit is contained in:
@@ -60,6 +60,15 @@ function changesOf(row) {
|
|||||||
return Array.isArray(row.changes) ? row.changes : []
|
return Array.isArray(row.changes) ? row.changes : []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Строка изменения: «Поле: было → стало» либо «Поле: значение».
|
||||||
|
function changeLine(change) {
|
||||||
|
const field = fieldLabel(change.field)
|
||||||
|
const to = valueLabel(change.field, change.to)
|
||||||
|
return hasFrom(change)
|
||||||
|
? `${field}: ${valueLabel(change.field, change.from)} → ${to}`
|
||||||
|
: `${field}: ${to}`
|
||||||
|
}
|
||||||
|
|
||||||
// Вторая строка колонки пользователя: имя пространства, иначе id.
|
// Вторая строка колонки пользователя: имя пространства, иначе id.
|
||||||
function tenantSubline(row) {
|
function tenantSubline(row) {
|
||||||
return row.userName && row.tenantName ? row.tenantName : row.tenantId || '—'
|
return row.userName && row.tenantName ? row.tenantName : row.tenantId || '—'
|
||||||
@@ -99,14 +108,7 @@ function pretty(json) {
|
|||||||
class="mt-1.5 max-w-[460px] rounded-md bg-ink/70 border border-white/8 p-2"
|
class="mt-1.5 max-w-[460px] rounded-md bg-ink/70 border border-white/8 p-2"
|
||||||
>
|
>
|
||||||
<div v-if="changesOf(row).length" class="space-y-0.5">
|
<div v-if="changesOf(row).length" class="space-y-0.5">
|
||||||
<div v-for="(change, i) in changesOf(row)" :key="i" class="text-[11px] text-mid">
|
<div v-for="(change, i) in changesOf(row)" :key="i" class="text-[11px] text-mid">{{ changeLine(change) }}</div>
|
||||||
<span class="text-low">{{ fieldLabel(change.field) }}:</span>
|
|
||||||
<template v-if="hasFrom(change)">
|
|
||||||
<span class="text-low">{{ valueLabel(change.field, change.from) }}</span>
|
|
||||||
<span class="text-low/60"> → </span>
|
|
||||||
</template>
|
|
||||||
<span class="text-hi">{{ valueLabel(change.field, change.to) }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="text-[11px] text-low">{{ $t('operator.dopolnitelnyh-parametrov-net') }}</div>
|
<div v-else class="text-[11px] text-low">{{ $t('operator.dopolnitelnyh-parametrov-net') }}</div>
|
||||||
<button
|
<button
|
||||||
|
|||||||
Reference in New Issue
Block a user