chore(admin): remove Recalc UI block from users page
Users page no longer shows the "Скоринг / Пересчитать всё" card. Backend endpoint POST /api/admin/leads/recalc and the recalcAllLeads api client function are kept (still callable via curl) for ops use.
This commit is contained in:
parent
45a4102ae4
commit
6015dee57e
@ -6,7 +6,6 @@ import {
|
||||
createUser,
|
||||
deleteUser,
|
||||
listUsers,
|
||||
recalcAllLeads,
|
||||
updateUser,
|
||||
type AppUser,
|
||||
} from '@/api/admin';
|
||||
@ -23,20 +22,6 @@ const form = reactive<{ username: string; password: string; role: 'manager' | 'r
|
||||
role: 'manager',
|
||||
});
|
||||
const creating = ref(false);
|
||||
const recalcing = ref(false);
|
||||
|
||||
async function recalc() {
|
||||
if (!confirm('Пересчитать score у всех лидов по текущей формуле?')) return;
|
||||
recalcing.value = true;
|
||||
try {
|
||||
const r = await recalcAllLeads();
|
||||
toast.success(`Пересчитано: ${r.updated} из ${r.total} (formula v${r.formula_version})`);
|
||||
} catch (e) {
|
||||
toast.error((e as Error).message);
|
||||
} finally {
|
||||
recalcing.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function load() {
|
||||
loading.value = true;
|
||||
@ -153,25 +138,6 @@ onMounted(load);
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="card-pad space-y-3">
|
||||
<h2 class="text-xs font-semibold text-gray-400 uppercase tracking-widest">
|
||||
Скоринг
|
||||
</h2>
|
||||
<div class="flex items-center justify-between gap-3 flex-wrap">
|
||||
<p class="text-sm text-gray-600">
|
||||
Пересчитать score у всех лидов по текущей формуле. Лиды, где итоговый балл не изменился, не трогаются.
|
||||
</p>
|
||||
<button
|
||||
type="button"
|
||||
class="btn-secondary text-sm shrink-0"
|
||||
:disabled="recalcing"
|
||||
@click="recalc"
|
||||
>
|
||||
{{ recalcing ? 'Считаем…' : 'Пересчитать всё' }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="loading" class="card p-4">
|
||||
<Skeleton :rows="4" height="40px" />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user