mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +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 (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 (text && pcount > pdocs.length) pcount = pdocs.length;
|
||||||
if (this.user.hasPriv(PRIV.PRIV_USER_PROFILE)) {
|
if (this.user.hasPriv(PRIV.PRIV_USER_PROFILE)) {
|
||||||
const domainIds = Array.from(new Set(pdocs.map((i) => i.domainId)));
|
Object.assign(psdict, await problem.getListStatus(
|
||||||
await Promise.all(
|
domainId, this.user._id,
|
||||||
domainIds.map((did) =>
|
pdocs.map((i) => i.docId),
|
||||||
problem.getListStatus(
|
));
|
||||||
did, this.user._id,
|
|
||||||
pdocs.filter((i) => i.domainId === did).map((i) => i.docId),
|
|
||||||
).then((res) => Object.assign(psdict, res))),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (pjax) {
|
if (pjax) {
|
||||||
this.response.body = {
|
this.response.body = {
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ export async function log<T extends Handler>(handler: T, type: string, data: any
|
|||||||
args,
|
args,
|
||||||
operator: handler.user?._id,
|
operator: handler.user?._id,
|
||||||
operateIp: handler.request.ip,
|
operateIp: handler.request.ip,
|
||||||
|
json: handler.request.json,
|
||||||
});
|
});
|
||||||
return res.insertedId;
|
return res.insertedId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{%- for pdoc in pdocs -%}
|
{%- for pdoc in pdocs -%}
|
||||||
{% set psdoc = psdict[pdoc.domainId + '#' + pdoc.docId] %}
|
{% set psdoc = psdict[pdoc.docId] %}
|
||||||
<tr data-pid="{{ pdoc.docId }}">
|
<tr data-pid="{{ pdoc.docId }}">
|
||||||
<td class="col--checkbox display-mode-hide">
|
<td class="col--checkbox display-mode-hide">
|
||||||
<label class="compact checkbox">
|
<label class="compact checkbox">
|
||||||
|
|||||||
Reference in new issue
Block a user