Browse Source

feat: 统计权限修改

outaozhen 3 years ago
parent
commit
409be3a080
1 changed files with 28 additions and 7 deletions
  1. 28 7
      src/pages/Role/Statistic/index.tsx

+ 28 - 7
src/pages/Role/Statistic/index.tsx

@@ -235,21 +235,42 @@ const Statistic = () => {
                           />
                         )}
                       </ProFormDependency>
+
                       <ProFormDependency name={['showProduct']}>
                         {({ showProduct }) => (
                           <ProFormCheckbox.Group
-                            name="customer-additions"
-                            label="客户新增"
+                            name="invoice-receivables"
+                            label="应收款统计"
                             options={[{ value: 'access', label: '查看', disabled: !showProduct }]}
                           />
                         )}
                       </ProFormDependency>
-                      <ProFormDependency name={['showProduct']}>
-                        {({ showProduct }) => (
+                    </div>
+                    <ProFormSwitch
+                      fieldProps={{
+                        onChange(checked) {
+                          if (!checked) {
+                            formRef.current?.setFieldsValue({
+                              'customer-additions': []
+                            })
+                          }
+                        }
+                      }}
+                      name="showCustomer"
+                      label={
+                        <span className="flex items-center">
+                          <PieChartOutlined theme="outline" className="flex items-baseline mr-1" />
+                          客户数据
+                        </span>
+                      }
+                    />
+                    <div className="ml-25px">
+                      <ProFormDependency name={['showCustomer']}>
+                        {({ showCustomer }) => (
                           <ProFormCheckbox.Group
-                            name="invoice-receivables"
-                            label="应收款统计"
-                            options={[{ value: 'access', label: '查看', disabled: !showProduct }]}
+                            name="customer-additions"
+                            label="客户新增"
+                            options={[{ value: 'access', label: '查看', disabled: !showCustomer }]}
                           />
                         )}
                       </ProFormDependency>