فهرست منبع

fix: 仪表盘占比颜色修复

outaozhen 5 سال پیش
والد
کامیت
03d6998076
1فایلهای تغییر یافته به همراه28 افزوده شده و 4 حذف شده
  1. 28 4
      src/pages/workbench/Dashboard/index.jsx

+ 28 - 4
src/pages/workbench/Dashboard/index.jsx

@@ -251,7 +251,13 @@ const Dashboard = ({ dispatch, groupList = [] }) => {
                   <Col span={18} flex="wrap">
                     <div className="flex items-center justify-between ">
                       <div className="text-2xl">{state.customerChainRatio.count}</div>
-                      <span className="text-xl text-green-500">
+                      <span
+                        className={[
+                          'text-xl',
+                          state.customerChainRatio.percentage.startsWith('-')
+                            ? 'text-green-500'
+                            : 'text-red-500'
+                        ].join(' ')}>
                         {state.customerChainRatio.percentage}
                       </span>
                     </div>
@@ -281,7 +287,13 @@ const Dashboard = ({ dispatch, groupList = [] }) => {
                   <Col span={18} flex="wrap">
                     <div className="flex items-center justify-between ">
                       <div className="text-2xl">{state.clientChainRatio.count}</div>
-                      <span className="text-xl text-green-500">
+                      <span
+                        className={[
+                          'text-xl',
+                          state.clientChainRatio.percentage.startsWith('-')
+                            ? 'text-green-500'
+                            : 'text-red-500'
+                        ].join(' ')}>
                         {state.clientChainRatio.percentage}
                       </span>
                     </div>
@@ -310,7 +322,13 @@ const Dashboard = ({ dispatch, groupList = [] }) => {
                   <Col span={18} flex="wrap">
                     <div className="flex items-center justify-between ">
                       <div className="text-2xl">{state.businessChainRatio.count}</div>
-                      <span className="text-xl text-green-500">
+                      <span
+                        className={[
+                          'text-xl',
+                          state.businessChainRatio.percentage.startsWith('-')
+                            ? 'text-green-500'
+                            : 'text-red-500'
+                        ].join(' ')}>
                         {state.businessChainRatio.percentage}
                       </span>
                     </div>
@@ -340,7 +358,13 @@ const Dashboard = ({ dispatch, groupList = [] }) => {
                   <Col span={18} flex="wrap">
                     <div className="flex items-center justify-between ">
                       <div className="text-2xl">{state.serviceLogChainRatio.count}</div>
-                      <span className="text-xl text-green-500">
+                      <span
+                        className={[
+                          'text-xl',
+                          state.serviceLogChainRatio.percentage.startsWith('-')
+                            ? 'text-green-500'
+                            : 'text-red-500'
+                        ].join(' ')}>
                         {state.serviceLogChainRatio.percentage}
                       </span>
                     </div>