lanjianrong 4 years ago
parent
commit
ad6a8bd0fe
2 changed files with 62 additions and 23 deletions
  1. 1 1
      .prettierrc.js
  2. 61 22
      src/pages/Workbench/Dashboard/index.jsx

+ 1 - 1
.prettierrc.js

@@ -9,7 +9,7 @@ module.exports = {
   trailingComma: 'none',
   bracketSpacing: true,
   arrowParens: 'avoid',
-  printWidth: 120,
+  printWidth: 100,
   tabWidth: 2,
   singleQuote: true,
   quoteProps: 'as-needed',

+ 61 - 22
src/pages/Workbench/Dashboard/index.jsx

@@ -170,7 +170,13 @@ const Dashboard = ({ dispatch, departments = [] }) => {
         type: 'staff/fetchDepartments'
       })
     }
-  }, [state.params.businessGroupId, state.params.dataPermission, state.params.cyclical, state.params.staffIds])
+  }, [
+    state.params.businessGroupId,
+    state.params.dataPermission,
+    state.params.cyclical,
+    state.params.staffIds
+  ])
+
   const columns = [
     {
       title: '超过周期未服务提醒',
@@ -182,7 +188,8 @@ const Dashboard = ({ dispatch, departments = [] }) => {
       render: (name, record) => (
         <span
           onClick={() => handleReminderList(record.type, '7day')}
-          className="text-primary cursor-pointer hover:text-hex-967bbd">
+          className="text-primary cursor-pointer hover:text-hex-967bbd"
+        >
           {name}
         </span>
       )
@@ -193,7 +200,8 @@ const Dashboard = ({ dispatch, departments = [] }) => {
       render: (name, record) => (
         <span
           onClick={() => handleReminderList(record.type, '15day')}
-          className="text-primary cursor-pointer hover:text-hex-967bbd">
+          className="text-primary cursor-pointer hover:text-hex-967bbd"
+        >
           {name}
         </span>
       )
@@ -204,7 +212,8 @@ const Dashboard = ({ dispatch, departments = [] }) => {
       render: (name, record) => (
         <span
           onClick={() => handleReminderList(record.type, '30day')}
-          className="text-primary cursor-pointer hover:text-hex-967bbd">
+          className="text-primary cursor-pointer hover:text-hex-967bbd"
+        >
           {name}
         </span>
       )
@@ -215,7 +224,8 @@ const Dashboard = ({ dispatch, departments = [] }) => {
       render: (name, record) => (
         <span
           onClick={() => handleReminderList(record.type, '3month')}
-          className="text-primary cursor-pointer hover:text-hex-967bbd">
+          className="text-primary cursor-pointer hover:text-hex-967bbd"
+        >
           {name}
         </span>
       )
@@ -226,7 +236,8 @@ const Dashboard = ({ dispatch, departments = [] }) => {
       render: (name, record) => (
         <span
           onClick={() => handleReminderList(record.type, '6month')}
-          className="text-primary cursor-pointer hover:text-hex-967bbd">
+          className="text-primary cursor-pointer hover:text-hex-967bbd"
+        >
           {name}
         </span>
       )
@@ -239,7 +250,8 @@ const Dashboard = ({ dispatch, departments = [] }) => {
       render: (_, record) => (
         <span
           onClick={() => handleReminderList(record.type, 'expiry')}
-          className="text-primary cursor-pointer hover:text-hex-967bbd">
+          className="text-primary cursor-pointer hover:text-hex-967bbd"
+        >
           {record.remind.expiry}
         </span>
       )
@@ -250,7 +262,8 @@ const Dashboard = ({ dispatch, departments = [] }) => {
       render: (_, record) => (
         <span
           onClick={() => handleReminderList(record.type, 'unexpired')}
-          className="text-primary cursor-pointer hover:text-hex-967bbd">
+          className="text-primary cursor-pointer hover:text-hex-967bbd"
+        >
           {record.remind.expiry}
         </span>
       )
@@ -396,7 +409,8 @@ const Dashboard = ({ dispatch, departments = [] }) => {
                     'relative',
                     'cursor-pointer',
                     state.selectId === item.id ? styles.imgBg : styles.paddingBg
-                  ].join(' ')}>
+                  ].join(' ')}
+                >
                   <img
                     className="w-full max-w-30px h-30px border rounded-30px"
                     src={
@@ -431,14 +445,19 @@ const Dashboard = ({ dispatch, departments = [] }) => {
                       <span
                         className={[
                           'text-xl',
-                          state.clientChainRatio.percentage.startsWith('-') ? 'text-green-500' : 'text-red-500'
-                        ].join(' ')}>
+                          state.clientChainRatio.percentage.startsWith('-')
+                            ? 'text-green-500'
+                            : 'text-red-500'
+                        ].join(' ')}
+                      >
                         {state.clientChainRatio.percentage}
                       </span>
                     </div>
                     <div className="flex justify-between items-center">
                       <div>新增客户</div>
-                      <span>{cyclicalOp.find(item => item.value === state.params.cyclical)?.title}</span>
+                      <span>
+                        {cyclicalOp.find(item => item.value === state.params.cyclical)?.title}
+                      </span>
                     </div>
                   </Col>
                 </Row>
@@ -450,7 +469,10 @@ const Dashboard = ({ dispatch, departments = [] }) => {
               {state.loading ? (
                 <Skeleton active avatar />
               ) : (
-                <Row className="cursor-pointer" onClick={() => handleRatioCard(cardTypeMap.COMPANY)}>
+                <Row
+                  className="cursor-pointer"
+                  onClick={() => handleRatioCard(cardTypeMap.COMPANY)}
+                >
                   <Col span={6}>
                     <div className="w-full max-w-48px h-48px border rounded-48px bg-[#0c7cd5] flex items-center justify-center">
                       <City size="26" fill="#fff" />
@@ -462,15 +484,20 @@ const Dashboard = ({ dispatch, departments = [] }) => {
                       <span
                         className={[
                           'text-xl',
-                          state.customerChainRatio.percentage.startsWith('-') ? 'text-green-500' : 'text-red-500'
-                        ].join(' ')}>
+                          state.customerChainRatio.percentage.startsWith('-')
+                            ? 'text-green-500'
+                            : 'text-red-500'
+                        ].join(' ')}
+                      >
                         {state.customerChainRatio.percentage}
                       </span>
                     </div>
 
                     <div className="flex justify-between items-center">
                       <div>新增单位</div>
-                      <span>{cyclicalOp.find(item => item.value === state.params.cyclical)?.title}</span>
+                      <span>
+                        {cyclicalOp.find(item => item.value === state.params.cyclical)?.title}
+                      </span>
                     </div>
                   </Col>
                 </Row>
@@ -520,7 +547,10 @@ const Dashboard = ({ dispatch, departments = [] }) => {
               {state.loading ? (
                 <Skeleton active avatar />
               ) : (
-                <Row onClick={() => handleRatioCard(cardTypeMap.SERVICE)} className="cursor-pointer">
+                <Row
+                  onClick={() => handleRatioCard(cardTypeMap.SERVICE)}
+                  className="cursor-pointer"
+                >
                   <Col span={6}>
                     <div className="w-full max-w-48px h-48px border rounded-48px bg-[#0c7cd5] flex items-center justify-center">
                       <Comment size="26" fill="#fff" />
@@ -532,15 +562,20 @@ const Dashboard = ({ dispatch, departments = [] }) => {
                       <span
                         className={[
                           'text-xl',
-                          state.serviceLogChainRatio.percentage.startsWith('-') ? 'text-green-500' : 'text-red-500'
-                        ].join(' ')}>
+                          state.serviceLogChainRatio.percentage.startsWith('-')
+                            ? 'text-green-500'
+                            : 'text-red-500'
+                        ].join(' ')}
+                      >
                         {state.serviceLogChainRatio.percentage}
                       </span>
                     </div>
 
                     <div className="flex justify-between items-center">
                       <div>服务记录</div>
-                      <span>{cyclicalOp.find(item => item.value === state.params.cyclical)?.title}</span>
+                      <span>
+                        {cyclicalOp.find(item => item.value === state.params.cyclical)?.title}
+                      </span>
                     </div>
                   </Col>
                 </Row>
@@ -565,7 +600,8 @@ const Dashboard = ({ dispatch, departments = [] }) => {
               title="数据汇总"
               className="shadow-card"
               bodyStyle={{ padding: state.loading ? '24px' : 0 }}
-              loading={state.loading}>
+              loading={state.loading}
+            >
               <ul>
                 <li className="px-12px py-16px border-b-1">
                   新增客户<b className="px-1">{state.aggregation.clientCount}</b>个,服务
@@ -592,7 +628,10 @@ const Dashboard = ({ dispatch, departments = [] }) => {
             <LeaderBoard dataList={state.leaderboard} loading={state.loading} />
           </Col>
           <Col xs={24} sm={24} md={24} lg={12} xl={12}>
-            <SoftLeaderboard productLeaderBoard={state.productLeaderBoard} loading={state.loading} />
+            <SoftLeaderboard
+              productLeaderBoard={state.productLeaderBoard}
+              loading={state.loading}
+            />
           </Col>
         </Row>
       </div>