mirror of
https://github.com/wasrusgen/zov-tech.git
synced 2026-06-03 17:04:48 +00:00
feat: маршрут #/master — экран входящих задач замерщика/сборщика
- routeByHash: #/master → renderStaff(window.__zovMe) - таймаут 15с на fetch в renderStaff и renderStaffAssemblies - app.js v=20260518g Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
64292cef8e
commit
b43087a4b4
@ -862,13 +862,13 @@ async function renderStaff(me) {
|
|||||||
|
|
||||||
if (caps.measurer) {
|
if (caps.measurer) {
|
||||||
try {
|
try {
|
||||||
|
const ctrl1 = new AbortController();
|
||||||
|
const t1 = setTimeout(() => ctrl1.abort(), 15000);
|
||||||
const res = await fetch(`${BACKEND_URL}/api/measurement_inbox`, {
|
const res = await fetch(`${BACKEND_URL}/api/measurement_inbox`, {
|
||||||
method: "POST",
|
method: "POST", signal: ctrl1.signal,
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({ initData: tg?.initData || "", initDataUnsafe: tg?.initDataUnsafe || null }),
|
||||||
initData: tg?.initData || "",
|
|
||||||
initDataUnsafe: tg?.initDataUnsafe || null,
|
|
||||||
}),
|
|
||||||
});
|
});
|
||||||
|
clearTimeout(t1);
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
const list = document.getElementById("inboxList");
|
const list = document.getElementById("inboxList");
|
||||||
if (!list) return;
|
if (!list) return;
|
||||||
@ -922,13 +922,13 @@ async function renderStaff(me) {
|
|||||||
|
|
||||||
async function renderStaffAssemblies(container) {
|
async function renderStaffAssemblies(container) {
|
||||||
try {
|
try {
|
||||||
|
const ctrl2 = new AbortController();
|
||||||
|
const t2 = setTimeout(() => ctrl2.abort(), 15000);
|
||||||
const res = await fetch(`${BACKEND_URL}/api/assembly_list`, {
|
const res = await fetch(`${BACKEND_URL}/api/assembly_list`, {
|
||||||
method: "POST",
|
method: "POST", signal: ctrl2.signal,
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({ initData: tg?.initData || "", initDataUnsafe: tg?.initDataUnsafe || null }),
|
||||||
initData: tg?.initData || "",
|
|
||||||
initDataUnsafe: tg?.initDataUnsafe || null,
|
|
||||||
}),
|
|
||||||
});
|
});
|
||||||
|
clearTimeout(t2);
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
if (data.error) {
|
if (data.error) {
|
||||||
container.innerHTML = `<div class="error">Ошибка: ${escHtml(data.error)}</div>`;
|
container.innerHTML = `<div class="error">Ошибка: ${escHtml(data.error)}</div>`;
|
||||||
@ -1743,6 +1743,9 @@ function routeByHash() {
|
|||||||
renderInboxDetail(location.hash.replace("#/inbox/", ""));
|
renderInboxDetail(location.hash.replace("#/inbox/", ""));
|
||||||
} else if (location.hash.startsWith("#/assembly")) {
|
} else if (location.hash.startsWith("#/assembly")) {
|
||||||
Assembly.mount(app);
|
Assembly.mount(app);
|
||||||
|
} else if (location.hash.startsWith("#/master")) {
|
||||||
|
const me = window.__zovMe;
|
||||||
|
if (me) renderStaff(me); else init();
|
||||||
} else if (location.hash.startsWith("#/c/proposal")) {
|
} else if (location.hash.startsWith("#/c/proposal")) {
|
||||||
app.innerHTML = "";
|
app.innerHTML = "";
|
||||||
document.body.classList.remove("has-bottom-nav");
|
document.body.classList.remove("has-bottom-nav");
|
||||||
|
|||||||
@ -45,6 +45,6 @@
|
|||||||
<script src="assets/request.js?v=20260518f"></script>
|
<script src="assets/request.js?v=20260518f"></script>
|
||||||
<script src="assets/assembly.js?v=20260518f"></script>
|
<script src="assets/assembly.js?v=20260518f"></script>
|
||||||
<script src="assets/proposals.js?v=20260518f"></script>
|
<script src="assets/proposals.js?v=20260518f"></script>
|
||||||
<script src="assets/app.js?v=20260517d"></script>
|
<script src="assets/app.js?v=20260518g"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user