Skip to content

Commit

Permalink
feat(mis): 将操作日志、消费记录、结束作业的默认排序改为按照时间倒序 (#1399)
Browse files Browse the repository at this point in the history
  • Loading branch information
usaveh authored Aug 16, 2024
1 parent 3d36aa0 commit 1287509
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/tender-crabs-visit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@scow/mis-web": patch
---

将操作日志、消费记录、结束作业的默认排序改为按照时间倒序。
5 changes: 3 additions & 2 deletions apps/mis-web/src/pages/api/finance/charges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,9 @@ export default typeboxRoute(GetChargesSchema, async (req, res) => {

const client = getClient(ChargingServiceClient);

const mapChargesSortBy = sortBy ? mapChargesSortByType[sortBy] : undefined;
const mapChargesSortOrder = sortOrder ? mapChargesSortOrderType[sortOrder] : undefined;
// 默认按照时间的倒序排序
const mapChargesSortBy = sortBy ? mapChargesSortByType[sortBy] : mapChargesSortByType.time;
const mapChargesSortOrder = sortOrder ? mapChargesSortOrderType[sortOrder] : mapChargesSortOrderType.descend;

const reply = ensureNotUndefined(await asyncClientCall(client, "getPaginatedChargeRecords", {
startTime,
Expand Down
5 changes: 3 additions & 2 deletions apps/mis-web/src/pages/api/job/jobInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,9 @@ export default /* #__PURE__*/typeboxRoute(GetJobInfoSchema, async (req, res) =>
return { 403: null };
}

const mapJobSortBy = sortBy ? mapJobSortByType[sortBy] : undefined;
const mapJobSortOrder = sortOrder ? mapJobSortOrderType[sortOrder] : undefined;
// 默认按照作业结束时间的降序排列
const mapJobSortBy = sortBy ? mapJobSortByType[sortBy] : mapJobSortByType.timeEnd;
const mapJobSortOrder = sortOrder ? mapJobSortOrderType[sortOrder] : mapJobSortOrderType.descend;

const result = await getJobInfo({
filter,
Expand Down
6 changes: 4 additions & 2 deletions apps/mis-web/src/pages/api/log/getOperationLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,10 @@ export default typeboxRoute(GetOperationLogsSchema, async (req, res) => {
return { 403: null };
}
}
const mapOperationSortBy = sortBy ? mapOperationSortByType[sortBy] : undefined;
const mapOperationSortOrder = sortOrder ? mapOperationSortOrderType[sortOrder] : undefined;

// 默认按照时间降序排序
const mapOperationSortBy = sortBy ? mapOperationSortByType[sortBy] : mapOperationSortByType.operationTime;
const mapOperationSortOrder = sortOrder ? mapOperationSortOrderType[sortOrder] : mapOperationSortOrderType.descend;

const client = getClient(UserServiceClient);

Expand Down

0 comments on commit 1287509

Please sign in to comment.