Skip to content

Commit

Permalink
fix(mis): 修复了mis中横坐标显示不正确的问题 (#1310)
Browse files Browse the repository at this point in the history
Co-authored-by: valign <[email protected]>
  • Loading branch information
usaveh and cuvalign authored Jun 21, 2024
1 parent 3558bd4 commit f91ba34
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 22 deletions.
5 changes: 5 additions & 0 deletions .changeset/thirty-mayflies-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@scow/mis-web": patch
---

修正了 mis 系统下平台数据统计横坐标的表现形式
4 changes: 2 additions & 2 deletions apps/mis-web/src/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1107,8 +1107,8 @@ export default {
topTenSubmitJobUser: "Top 10 Submit Job User",
newJobCount: "New Job Count",
systemFeatureUsageCount: "System Feature Usage Count",
portalFeatureUsageCount: "Portal Feature Usage Count",
misFeatureUsageCount: "MIS Feature Usage Count",
topTenPortalFeatureUsageCount: "Portal Feature Usage Count Top Ten",
topTenMisFeatureUsageCount: "MIS Feature Usage Count Top Ten",
jobCount: "Job Count",
usageCount:"count",
userName: "User Name",
Expand Down
4 changes: 2 additions & 2 deletions apps/mis-web/src/i18n/zh_cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1105,8 +1105,8 @@ export default {
topTenSubmitJobUser: "作业提交用户Top10",
newJobCount: "新增作业数",
systemFeatureUsageCount: "系统使用量",
portalFeatureUsageCount: "门户系统使用功能次数",
misFeatureUsageCount: "管理系统使用功能次数",
topTenPortalFeatureUsageCount: "门户系统使用功能次数Top10",
topTenMisFeatureUsageCount: "管理系统使用功能次数Top10",
jobCount: "作业数",
usageCount:"次数",
userName: "用户名",
Expand Down
7 changes: 2 additions & 5 deletions apps/mis-web/src/pageComponents/admin/DataBarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ export const DataBarChart: React.FC<Props> = ({
return roundedValue.toString();
};

console.log(title);

return (
<StatisticContainer>
{isLoading ? <Spin /> : (
Expand All @@ -81,9 +79,8 @@ export const DataBarChart: React.FC<Props> = ({
padding={{ left: 20, right: 20 }}
label={{ value: xLabel, position: "insideBottom", offset: 0 }}
interval={0}
height={(title.includes("系统使用功能次数") || title.includes("Feature Usage Count")) ? 80 : 40}
tick={(title.includes("系统使用功能次数") || title.includes("Feature Usage Count")) ?
<CustomizedAxisTick /> : true}
height={ 80 }
tick={<CustomizedAxisTick /> }
/>
<YAxis padding={{ top: 20 }} tickFormatter={tickFormatter} />
<Tooltip
Expand Down
26 changes: 13 additions & 13 deletions apps/mis-web/src/pages/admin/statistic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ requireAuth((u) => u.platformRoles.includes(PlatformRole.PLATFORM_ADMIN))
bordered={false}
>
<Row>
<Col span={12}>
<Col xs={24} md={24} lg={12}>
<DataBarChart
data={topChargeAccountData}
title={t(p("topTenChargedAccount"))}
Expand All @@ -443,7 +443,7 @@ requireAuth((u) => u.platformRoles.includes(PlatformRole.PLATFORM_ADMIN))
toolTipFormatter={amountToolTipFormatter}
/>
</Col>
<Col span={12}>
<Col xs={24} md={24} lg={12}>
<DataLineChart
data={dailyChargeData.map((d) => ({
x: d.date.format("YYYY-MM-DD"),
Expand All @@ -456,7 +456,7 @@ requireAuth((u) => u.platformRoles.includes(PlatformRole.PLATFORM_ADMIN))
</Col>
</Row>
<Row>
<Col span={12}>
<Col xs={24} md={24} lg={12}>
<DataBarChart
data={topPayAccountData}
title={t(p("topTenPayAccount"))}
Expand All @@ -465,7 +465,7 @@ requireAuth((u) => u.platformRoles.includes(PlatformRole.PLATFORM_ADMIN))
toolTipFormatter={amountToolTipFormatter}
/>
</Col>
<Col span={12}>
<Col xs={24} md={24} lg={12}>
<DataLineChart
data={dailyPayData.map((d) => ({
x: d.date.format("YYYY-MM-DD"),
Expand All @@ -492,7 +492,7 @@ requireAuth((u) => u.platformRoles.includes(PlatformRole.PLATFORM_ADMIN))
bordered={false}
>
<Row>
<Col span={12}>
<Col xs={24} md={24} lg={12}>
<DataBarChart
data={topSubmitJobUserData}
title={t(p("topTenSubmitJobUser"))}
Expand All @@ -501,7 +501,7 @@ requireAuth((u) => u.platformRoles.includes(PlatformRole.PLATFORM_ADMIN))
toolTipFormatter={(value) => [value, t(p("jobCount"))]}
/>
</Col>
<Col span={12}>
<Col xs={24} md={24} lg={12}>
<DataLineChart
data={newJobCountData.map((d) => ({
x: d.date.format("YYYY-MM-DD"),
Expand All @@ -526,24 +526,24 @@ requireAuth((u) => u.platformRoles.includes(PlatformRole.PLATFORM_ADMIN))
bordered={false}
>
<Row>
<Col span={12}>
<Col xs={24} md={24} lg={12}>
<DataBarChart
data={portalUsageCountData.map((d) => ({
data={portalUsageCountData.slice(0, 10).map((d) => ({
x: OperationTypeTexts[d.operationType],
y: d.count,
}))}
title={t(p("portalFeatureUsageCount"))}
title={t(p("topTenPortalFeatureUsageCount"))}
toolTipFormatter={(value) => [value, t(p("usageCount"))]}
isLoading={portalUsageCountLoading}
/>
</Col>
<Col span={12}>
<Col xs={24} md={24} lg={12}>
<DataBarChart
data={misUsageCountData.map((d) => ({
data={misUsageCountData.slice(0, 10).map((d) => ({
x: OperationTypeTexts[d.operationType],
y:d.count,
y: d.count,
}))}
title={t(p("misFeatureUsageCount"))}
title={t(p("topTenMisFeatureUsageCount"))}
toolTipFormatter={(value) => [value, t(p("usageCount"))]}
isLoading={misUsageCountLoading}
/>
Expand Down

0 comments on commit f91ba34

Please sign in to comment.