From 3ab9eca61aa64380d1f80b7954640e4f9a799474 Mon Sep 17 00:00:00 2001 From: lizhensheng Date: Thu, 27 Jul 2023 10:38:05 +0800 Subject: [PATCH 1/2] [feature]: order info chart added execting status --- CHANGELOG.md | 1 + src/locale/zh-CN/projectManage.ts | 7 ++++ .../Panel/OrderClassification.tsx | 35 +++++++++++++++---- .../OrderClassification.test.tsx.snap | 6 ++-- .../ProjectOverview/Panel/__test__/mockApi.ts | 1 + 5 files changed, 40 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8080bd78..74ec5077 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,3 +34,4 @@ * [ ] [fix]: 规则列表分类进行排序, 优化编辑规则模板时的规则列表样式 * [ ] [chore]: 项目概览界面中数据源最小单位改成1,数据源tips提示文案修改, 没有任何工单时总计显示 0. * [ ] [fix]:修复在创建自定义规则时先修改了按钮状态然后才进行表单校验, 导致按钮状态未复原的问题 +* [ ] [feature]: 项目概览的工单状态报表添加 正在上线 状态 diff --git a/src/locale/zh-CN/projectManage.ts b/src/locale/zh-CN/projectManage.ts index 1e6a1d71..782b8c4d 100644 --- a/src/locale/zh-CN/projectManage.ts +++ b/src/locale/zh-CN/projectManage.ts @@ -87,6 +87,13 @@ export default { }, orderClassification: { title: '工单', + closed: '已关闭', + executing: '正在上线', + executionSuccess: '上线成功', + executionFailed: '上线失败', + rejected: '被驳回', + waitingForAudit: '待审核', + waitingForExecution: '待上线', }, orderRisk: { title: '工单潜在风险', diff --git a/src/page/ProjectManage/ProjectOverview/Panel/OrderClassification.tsx b/src/page/ProjectManage/ProjectOverview/Panel/OrderClassification.tsx index 9fa973d1..a9e8f52f 100644 --- a/src/page/ProjectManage/ProjectOverview/Panel/OrderClassification.tsx +++ b/src/page/ProjectManage/ProjectOverview/Panel/OrderClassification.tsx @@ -17,7 +17,15 @@ const config: PieConfig = { colorField: 'status', xAxis: false, yAxis: false, - color: ['#42a2ff', '#43cb77', '#fbd44d', '#f04864', '#9963e5', '#46cbcb'], + color: [ + '#42a2ff', + '#43cb77', + '#fbd44d', + '#7767fa', + '#f04864', + '#9963e5', + '#46cbcb', + ], padding: 'auto', radius: 1, innerRadius: 0.8, @@ -38,23 +46,35 @@ const orderStatusMap = () => { return new Map([ [ 'execution_success_count', - t('reportStatistics.orderStatus.executionSuccess'), + t('projectManage.projectOverview.orderClassification.executionSuccess'), ], [ 'waiting_for_audit_count', - t('reportStatistics.orderStatus.waitingForAudit'), + t('projectManage.projectOverview.orderClassification.waitingForAudit'), + ], + [ + 'closed_count', + t('projectManage.projectOverview.orderClassification.closed'), ], - ['closed_count', t('reportStatistics.orderStatus.closed')], - ['rejected_count', t('reportStatistics.orderStatus.rejected')], + [ + 'rejected_count', + t('projectManage.projectOverview.orderClassification.rejected'), + ], [ 'waiting_for_execution_count', - t('reportStatistics.orderStatus.waitingForExecution'), + t( + 'projectManage.projectOverview.orderClassification.waitingForExecution' + ), ], [ 'executing_failed_count', - t('reportStatistics.orderStatus.executionFailed'), + t('projectManage.projectOverview.orderClassification.executionFailed'), + ], + [ + 'executing_count', + t('projectManage.projectOverview.orderClassification.executing'), ], ]); }; @@ -106,6 +126,7 @@ const OrderClassification: React.FC = ({ res.data.data?.waiting_for_execution_count ?? 0, execution_success_count: res.data.data?.execution_success_count ?? 0, + executing_count: res.data.data?.executing_count ?? 0, executing_failed_count: res.data.data?.executing_failed_count ?? 0, rejected_count: res.data.data?.rejected_count ?? 0, closed_count: res.data.data?.closed_count ?? 0, diff --git a/src/page/ProjectManage/ProjectOverview/Panel/__test__/__snapshots__/OrderClassification.test.tsx.snap b/src/page/ProjectManage/ProjectOverview/Panel/__test__/__snapshots__/OrderClassification.test.tsx.snap index 9fe1cee8..a9235ea7 100644 --- a/src/page/ProjectManage/ProjectOverview/Panel/__test__/__snapshots__/OrderClassification.test.tsx.snap +++ b/src/page/ProjectManage/ProjectOverview/Panel/__test__/__snapshots__/OrderClassification.test.tsx.snap @@ -47,7 +47,7 @@ exports[`test OrderClassification should match snapshot 1`] = ` >
{ executing_failed_count: 11, rejected_count: 33, closed_count: 10, + executing_count: 3, }) ); return spy; From 6904f1253d089c41edfe29e7650edff183996b65 Mon Sep 17 00:00:00 2001 From: lizhensheng Date: Thu, 27 Jul 2023 13:49:40 +0800 Subject: [PATCH 2/2] [test]: update snapshot --- .../__test__/__snapshots__/index.test.tsx.snap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/page/ProjectManage/ProjectOverview/__test__/__snapshots__/index.test.tsx.snap b/src/page/ProjectManage/ProjectOverview/__test__/__snapshots__/index.test.tsx.snap index a5419400..fc24746d 100644 --- a/src/page/ProjectManage/ProjectOverview/__test__/__snapshots__/index.test.tsx.snap +++ b/src/page/ProjectManage/ProjectOverview/__test__/__snapshots__/index.test.tsx.snap @@ -351,9 +351,9 @@ exports[`test ProjectOverview should match snapshot 1`] = ` >