mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: problem_list: fix status display
This commit is contained in:
3 files changed
+6
-9
No files matched your search
@@ -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 = {
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in new issue
Block a user