Explorar el Código

feat: 统计增加角色权限

lanjianrong hace 4 años
padre
commit
56896cc9a0
Se han modificado 3 ficheros con 12 adiciones y 4 borrados
  1. 9 3
      config/routes.js
  2. 2 0
      src/access.ts
  3. 1 1
      src/pages/Statistic/Product/InvoiceTrends/index.jsx

+ 9 - 3
config/routes.js

@@ -165,17 +165,23 @@ export default [
           {
             path: 'software-usage',
             name: 'software-usage',
-            component: './Statistic/Product/SoftwareUsage'
+            component: './Statistic/Product/SoftwareUsage',
+            access: 'authRouteFilter',
+            validatePerm: true
           },
           {
             path: 'invoice-aggregate',
             name: 'invoice-aggregate',
-            component: './Statistic/Product/InvoiceAggregate'
+            component: './Statistic/Product/InvoiceAggregate',
+            access: 'authRouteFilter',
+            validatePerm: true
           },
           {
             path: 'invoice-trends',
             name: 'invoice-trends',
-            component: './Statistic/Product/InvoiceTrends'
+            component: './Statistic/Product/InvoiceTrends',
+            access: 'authRouteFilter',
+            validatePerm: true
           }
         ]
       }

+ 2 - 0
src/access.ts

@@ -9,6 +9,8 @@ export default function (initialState) {
       return true
     }
     const name = route.path?.match(/\/(\w*)\//)[1]
+    console.log(name)
+
     if (name && permData[name] && permData[name]?.length) {
       return true
     }

+ 1 - 1
src/pages/Statistic/Product/InvoiceTrends/index.jsx

@@ -11,7 +11,7 @@ import OptionSelect from '../../components/OptionSelect'
 const InvoiceTrends = () => {
   const [state, setState] = useState({
     params: {
-      optionType: 'staff',
+      optionType: 'singleStaff',
       dataIds: [],
       priceType: 'invoice',
       startMonth: dayjs(new Date())