KvalityUI

Визиты, заявки, звонки, обращения

Списки записей в ответе агента: карточки визитов, список заявок, карточки звонков и обращений в Telegram, разбор записей.

Визиты

Живой код — редактируйте
const sessionsData = {
  period: { from: "2026-10-13", to: "2026-10-19", days: 7 },
  caveats: [],
  total: 3,
  items: [
    {
      id: "session-1",
      at: "2026-10-19T09:14:00Z",
      source: "Яндекс Директ",
      campaign: "Поиск · Москва",
      device: "mobile",
      landingPath: "/ceny",
      activeSeconds: 184,
      wallSeconds: 260,
      hasReplay: true,
      outcome: "submitted",
      submissionId: "submission-1",
      lastField: null
    },
    {
      id: "session-2",
      at: "2026-10-19T11:02:00Z",
      source: "Органика",
      campaign: null,
      device: "desktop",
      landingPath: "/",
      activeSeconds: 96,
      wallSeconds: 140,
      hasReplay: true,
      outcome: "abandoned",
      submissionId: null,
      lastField: "Телефон"
    },
    {
      id: "session-3",
      at: "2026-10-18T17:40:00Z",
      source: "Соцсети",
      campaign: null,
      device: "mobile",
      landingPath: "/otzyvy",
      activeSeconds: 32,
      wallSeconds: 40,
      hasReplay: false,
      outcome: "browsed",
      submissionId: null,
      lastField: null
    }
  ]
};

render(
  <SessionCards data={sessionsData} />
);

Заявки

Живой код — редактируйте
const submissionsData = {
  period: { from: "2026-10-13", to: "2026-10-19", days: 7 },
  caveats: [],
  total: 3,
  items: [
    {
      id: "submission-1",
      at: "2026-10-19T09:18:00Z",
      status: "analyzed",
      source: "Яндекс Директ",
      campaign: "Поиск · Москва",
      score: 82,
      aiLevel: "high",
      managerLevel: null,
      sessionDbId: "session-1",
      pagePath: "/ceny",
      reasons: ["Долго изучал цены", "Вернулся на сайт"]
    },
    {
      id: "submission-2",
      at: "2026-10-18T14:05:00Z",
      status: "analyzed",
      source: "Органика",
      campaign: null,
      score: 47,
      aiLevel: "medium",
      managerLevel: "medium",
      sessionDbId: "session-4",
      pagePath: "/"
    },
    {
      id: "submission-3",
      at: "2026-10-17T21:47:00Z",
      status: "analyzed",
      source: null,
      campaign: null,
      score: 12,
      aiLevel: "low",
      managerLevel: null,
      sessionDbId: "session-5",
      reasons: ["Форма заполнена за 2 секунды"]
    }
  ]
};

render(
  <SubmissionList data={submissionsData} />
);

Звонки

Живой код — редактируйте
const callsData = {
  period: { from: "2026-10-13", to: "2026-10-19", days: 7 },
  caveats: [],
  total: 2,
  items: [
    {
      id: "call-1",
      at: "2026-10-19T10:30:00Z",
      source: "Яндекс Директ",
      outcome: "answered",
      durationS: 312,
      matched: true,
      aiLevel: "high",
      intent: "Хочет рассчитать стоимость под ключ"
    },
    {
      id: "call-2",
      at: "2026-10-18T16:12:00Z",
      source: null,
      outcome: "missed",
      durationS: 0,
      matched: false,
      aiLevel: null
    }
  ]
};

render(
  <CallCards data={callsData} />
);

Обращения в Telegram

Список find_dialogs: дата, менеджер, откуда пришёл клиент, начало первого сообщения, оценка AI и через сколько менеджер ответил. Без ответа — «Нет ответа» красным; у обращений без сайта текста нет.

Живой код — редактируйте
const dialogsData = {
  period: { from: "2026-10-13", to: "2026-10-19", days: 7 },
  caveats: [],
  total: 3,
  items: [
    {
      id: "dialog-1",
      at: "2026-10-19T07:12:00Z",
      managerName: "Олег",
      origin: "site",
      source: "Яндекс Директ",
      preview: "Здравствуйте! Сколько стоит замена фильтров в кондиционере?",
      replied: true,
      firstReplyS: 480,
      aiLevel: "high",
      score: 78,
      summary: null,
      managerScore: 83,
      managerFeedback: null
    },
    {
      id: "dialog-2",
      at: "2026-10-18T19:40:00Z",
      managerName: "Мария",
      origin: "site",
      source: null,
      preview: "Добрый вечер, вы работаете в выходные?",
      replied: false,
      firstReplyS: null,
      aiLevel: null,
      score: null,
      summary: null,
      managerScore: null,
      managerFeedback: null
    },
    {
      id: "dialog-3",
      at: "2026-10-18T11:05:00Z",
      managerName: "Олег",
      origin: "direct",
      source: null,
      preview: null,
      replied: true,
      firstReplyS: 95,
      aiLevel: null,
      score: null,
      summary: null,
      managerScore: null,
      managerFeedback: null
    }
  ]
};

render(
  <DialogCards data={dialogsData} />
);

Разбор записей

Таблица analyze_records (в данных records) показывается не таблицей, а карточками: дата, источник, балл и оценка AI, причины и улики чипами без повторов, остальные поля с подписью. id и «(нет данных)» не выводятся.

Живой код — редактируйте
const recordsTable = {
  period: { from: "2026-10-13", to: "2026-10-19", days: 7 },
  caveats: [],
  records: "submissions",
  columns: [
    { key: "id", label: "id", role: "dimension", unit: "text" },
    { key: "at", label: "Дата (МСК)", role: "dimension", unit: "text" },
    { key: "source", label: "Источник", role: "dimension", unit: "text" },
    { key: "campaign", label: "Кампания", role: "dimension", unit: "text" },
    { key: "aiLevel", label: "Оценка AI", role: "dimension", unit: "text" },
    { key: "managerLevel", label: "Оценка менеджера", role: "dimension", unit: "text" },
    { key: "verdictReason", label: "Причина оценки AI", role: "dimension", unit: "text" },
    { key: "evidence", label: "Улика проверки на бота", role: "dimension", unit: "text" },
    { key: "device", label: "Устройство", role: "dimension", unit: "text" },
    { key: "score", label: "Балл AI", role: "metric", unit: "count" },
    { key: "activeSeconds", label: "Активное время", role: "metric", unit: "seconds" }
  ],
  rows: [
    {
      id: "sub-1",
      at: "17.10.2026 14:12 (МСК)",
      source: "yandex",
      campaign: "brand-search",
      aiLevel: "Высокое",
      managerLevel: "Низкое",
      verdictReason: "Понятный запрос; Изучал сайт",
      evidence: "(нет данных)",
      device: "Телефон",
      score: 82,
      activeSeconds: 214
    },
    {
      id: "sub-2",
      at: "16.10.2026 09:40 (МСК)",
      source: "ya-business",
      campaign: "(нет данных)",
      aiLevel: "Низкое",
      managerLevel: "Низкое",
      verdictReason: "(нет данных)",
      evidence: "Мусорный номер телефона; Прокрутка без чтения",
      device: "Компьютер",
      score: 20,
      activeSeconds: 5
    }
  ]
};

render(
  <RecordCards data={recordsTable} />
);

Со ссылками и записью визита

В приложении AnalyticsLinksProvider подставляет ссылки на заявки и звонки и диалог записи. Здесь — заглушки:

Живой код — редактируйте
const sessionsData = {
  period: { from: "2026-10-13", to: "2026-10-19", days: 7 },
  caveats: [],
  total: 3,
  items: [
    {
      id: "session-1",
      at: "2026-10-19T09:14:00Z",
      source: "Яндекс Директ",
      campaign: "Поиск · Москва",
      device: "mobile",
      landingPath: "/ceny",
      activeSeconds: 184,
      wallSeconds: 260,
      hasReplay: true,
      outcome: "submitted",
      submissionId: "submission-1",
      lastField: null
    },
    {
      id: "session-2",
      at: "2026-10-19T11:02:00Z",
      source: "Органика",
      campaign: null,
      device: "desktop",
      landingPath: "/",
      activeSeconds: 96,
      wallSeconds: 140,
      hasReplay: true,
      outcome: "abandoned",
      submissionId: null,
      lastField: "Телефон"
    },
    {
      id: "session-3",
      at: "2026-10-18T17:40:00Z",
      source: "Соцсети",
      campaign: null,
      device: "mobile",
      landingPath: "/otzyvy",
      activeSeconds: 32,
      wallSeconds: 40,
      hasReplay: false,
      outcome: "browsed",
      submissionId: null,
      lastField: null
    }
  ]
};

function ReplayStub({ open, onOpenChange, name }) {
  return (
    <ConfirmDialog
      open={open}
      onOpenChange={onOpenChange}
      title={name}
      description="Здесь откроется плеер записи визита"
      confirmText="Закрыть"
      onConfirm={() => onOpenChange(false)}
    />
  );
}

render(
  <AnalyticsLinksProvider
    value={{
      submissionHref: (id) => '#' + id,
      callHref: (id) => '#' + id,
      ReplayDialog: ReplayStub
    }}
  >
    <SessionCards data={sessionsData} />
  </AnalyticsLinksProvider>
);

On this page