core: problem_list: fix status display

This commit is contained in:
undefined committed 2025-04-04 03:37:13 +08:00
1 parent 68a0ac8e67
commit c061bc3b5b
3 files changed
+6 -9

No files matched your search

+4 -8
View File
@@ -156,14 +156,10 @@ export class ProblemMainHandler extends Handler {
if (sort.length) pdocs = pdocs.sort((a, b) => sort.indexOf(`${a.domainId}/${a.docId}`) - sort.indexOf(`${b.domainId}/${b.docId}`));
if (text && pcount > pdocs.length) pcount = pdocs.length;
if (this.user.hasPriv(PRIV.PRIV_USER_PROFILE)) {
const domainIds = Array.from(new Set(pdocs.map((i) => i.domainId)));
await Promise.all(
domainIds.map((did) =>
problem.getListStatus(
did, this.user._id,
pdocs.filter((i) => i.domainId === did).map((i) => i.docId),
).then((res) => Object.assign(psdict, res))),
);
Object.assign(psdict, await problem.getListStatus(
domainId, this.user._id,
pdocs.map((i) => i.docId),
));
}
if (pjax) {
this.response.body = {
+1
View File
@@ -52,6 +52,7 @@ export async function log<T extends Handler>(handler: T, type: string, data: any
args,
operator: handler.user?._id,
operateIp: handler.request.ip,
json: handler.request.json,
});
return res.insertedId;
}
@@ -39,7 +39,7 @@
</thead>
<tbody>
{%- for pdoc in pdocs -%}
{% set psdoc = psdict[pdoc.domainId + '#' + pdoc.docId] %}
{% set psdoc = psdict[pdoc.docId] %}
<tr data-pid="{{ pdoc.docId }}">
<td class="col--checkbox display-mode-hide">
<label class="compact checkbox">