Kaynağa Gözat

feat: 云版权限

outaozhen 4 yıl önce
ebeveyn
işleme
cd96bcddef
2 değiştirilmiş dosya ile 38 ekleme ve 71 silme
  1. 12 7
      config/routes.js
  2. 26 64
      src/pages/Workbench/Dashboard/index.jsx

+ 12 - 7
config/routes.js

@@ -123,22 +123,26 @@ export default [
           {
             path: '/product/cloud/building',
             name: 'building',
-            component: './Product/Cloud'
+            component: './Product/Cloud',
+            access: 'authRouteFilter'
           },
           {
             path: '/product/cloud/curing',
             name: 'curing',
-            component: './Product/Cloud'
+            component: './Product/Cloud',
+            access: 'authRouteFilter'
           },
           {
             path: '/product/cloud/highway',
             name: 'highway',
-            component: './Product/Cloud'
+            component: './Product/Cloud',
+            access: 'authRouteFilter'
           },
           {
             path: '/product/cloud/gs',
             name: 'gs',
-            component: './Product/Cloud'
+            component: './Product/Cloud',
+            access: 'authRouteFilter'
           }
         ]
       },
@@ -154,14 +158,15 @@ export default [
           {
             path: '/product/road/personal',
             name: 'personal',
-            component: './Product/Road/Personal'
+            component: './Product/Road/Personal',
+            access: 'authRouteFilter'
           },
           {
             path: '/product/road/enterprise',
             name: 'enterprise',
             component: './Product/Road/Enterprise',
-            access: 'authRouteFilter',
-            validatePerm: true
+            access: 'authRouteFilter'
+            // validatePerm: true
           }
         ]
       }

+ 26 - 64
src/pages/Workbench/Dashboard/index.jsx

@@ -170,12 +170,7 @@ 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 = [
     {
@@ -188,8 +183,7 @@ 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>
       )
@@ -200,8 +194,7 @@ 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>
       )
@@ -212,8 +205,7 @@ 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>
       )
@@ -224,20 +216,18 @@ 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>
       )
     },
     {
-      title: '6个月',
-      dataIndex: 'month6',
+      title: '9个月',
+      dataIndex: 'month9',
       render: (name, record) => (
         <span
-          onClick={() => handleReminderList(record.type, '6month')}
-          className="text-primary cursor-pointer hover:text-hex-967bbd"
-        >
+          onClick={() => handleReminderList(record.type, '9month')}
+          className="text-primary cursor-pointer hover:text-hex-967bbd">
           {name}
         </span>
       )
@@ -250,8 +240,7 @@ 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>
       )
@@ -262,9 +251,8 @@ const Dashboard = ({ dispatch, departments = [] }) => {
       render: (_, record) => (
         <span
           onClick={() => handleReminderList(record.type, 'unexpired')}
-          className="text-primary cursor-pointer hover:text-hex-967bbd"
-        >
-          {record.remind.expiry}
+          className="text-primary cursor-pointer hover:text-hex-967bbd">
+          {record.remind.unexpired}
         </span>
       )
     }
@@ -409,8 +397,7 @@ 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={
@@ -445,19 +432,14 @@ 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>
@@ -469,10 +451,7 @@ 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" />
@@ -484,20 +463,15 @@ 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>
@@ -547,10 +521,7 @@ 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" />
@@ -562,20 +533,15 @@ 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>
@@ -600,8 +566,7 @@ 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>个,服务
@@ -628,10 +593,7 @@ 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>