lanjianrong 3 éve
szülő
commit
d36e0eda3a
2 módosított fájl, 86 hozzáadás és 85 törlés
  1. 1 1
      src/pages/Role/Product/index.tsx
  2. 85 84
      src/pages/Role/Statistic/index.tsx

+ 1 - 1
src/pages/Role/Product/index.tsx

@@ -187,7 +187,7 @@ const Product = () => {
                       fieldProps={{
                         onChange(checked) {
                           if (!checked) {
-                            formRef.current?.setFieldsValue({ client: [] })
+                            formRef.current?.setFieldsValue({ lockstore: [] })
                           }
                         }
                       }}

+ 85 - 84
src/pages/Role/Statistic/index.tsx

@@ -1,6 +1,6 @@
 import { useModel, useRequest } from 'umi'
 import { Delete } from '@icon-park/react'
-import ProForm from '@ant-design/pro-form'
+import ProForm, { ProFormDependency, ProFormSwitch, ProFormCheckbox } from '@ant-design/pro-form'
 import type { FormInstance } from 'antd'
 import { message, Table, Tabs, Radio, Space, Popconfirm } from 'antd'
 import React, { useRef, useMemo, useState, useEffect } from 'react'
@@ -18,6 +18,7 @@ import RoleMenu from '../System/components/RoleMenu'
 import ConnectModal from '../System/components/ConnectModal'
 import FormItem from 'antd/lib/form/FormItem'
 import { permData } from '../Customer'
+import { PieChartOutlined } from '@ant-design/icons'
 
 const Statistic = () => {
   const { TabPane } = Tabs
@@ -183,104 +184,104 @@ const Statistic = () => {
                       })
                       message.success('设置成功')
                     }}>
-                    {/* <ProFormSwitch
+                    <ProFormSwitch
                       fieldProps={{
                         onChange(checked) {
                           if (!checked) {
-                            formRef.current?.setFieldsValue({ client: [] })
+                            formRef.current?.setFieldsValue({
+                              showSoftwareUsage: false,
+                              showInvoiceTrends: false,
+                              showInvoiceAggregate: false
+                            })
                           }
                         }
                       }}
-                      name="showClient"
+                      name="showProduct"
                       label={
                         <span className="flex items-center">
-                          <EveryUser className="mr-1" className="flex items-baseline mr-1" />
-                          客户
+                          <PieChartOutlined theme="outline" className="flex items-baseline mr-1" />
+                          产品销售
                         </span>
                       }
                     />
-                    <ProFormDependency name={['showClient']}>
-                      {({ showClient }) => (
-                        <ProFormCheckbox.Group
-                          wrapperCol={{ offset: 1 }}
-                          name="client"
-                          options={[
-                            { value: 'access', label: '查看', disabled: !showClient },
-                            { value: 'add', label: '添加客户', disabled: !showClient },
-                            // { value: 'delete', label: '删除客户', disabled: !showClient },
-                            {
-                              value: 'edit_team_tags',
-                              label: '编辑协作标签',
-                              disabled: !showClient
+                    <div className="ml-25px">
+                      <ProFormSwitch
+                        fieldProps={{
+                          onChange(checked) {
+                            if (!checked) {
+                              formRef.current?.setFieldsValue({ 'software-usage': [] })
+                            }
+                            // 判断最外层按钮是否关闭
+                            if (checked && !formRef.current?.getFieldValue('showProduct')) {
+                              formRef.current?.setFieldsValue({ showProduct: true })
                             }
-                          ]}
-                        />
-                      )}
-                    </ProFormDependency>
-                    <ProFormSwitch
-                      fieldProps={{
-                        onChange(checked) {
-                          if (!checked) {
-                            formRef.current?.setFieldsValue({ company: [] })
                           }
-                        }
-                      }}
-                      name="showCompany"
-                      label={
-                        <span className="flex items-center">
-                          <EveryUser className="mr-1" className="flex items-baseline mr-1" />
-                          单位
-                        </span>
-                      }
-                    />
-                    <ProFormDependency name={['showCompany']}>
-                      {({ showCompany }) => (
-                        <ProFormCheckbox.Group
-                          wrapperCol={{ offset: 1 }}
-                          // initialValue={}
-                          name="company"
-                          options={[
-                            { value: 'access', label: '查看', disabled: !showCompany },
-                            { value: 'add', label: '添加单位', disabled: !showCompany },
-                            // { value: 'delete', label: '删除单位', disabled: !showCompany },
-                            {
-                              value: 'edit_team_tags',
-                              label: '编辑协作标签',
-                              disabled: !showCompany
+                        }}
+                        name="showSoftwareUsage"
+                        label="软件锁用量"
+                      />
+                      <ProFormDependency name={['showSoftwareUsage']}>
+                        {({ showSoftwareUsage }) => (
+                          <ProFormCheckbox.Group
+                            wrapperCol={{ offset: 2 }}
+                            name="software-usage"
+                            options={[
+                              { value: 'access', label: '查看', disabled: !showSoftwareUsage }
+                            ]}
+                          />
+                        )}
+                      </ProFormDependency>
+                      <ProFormSwitch
+                        fieldProps={{
+                          onChange(checked) {
+                            if (!checked) {
+                              formRef.current?.setFieldsValue({ 'software-usage': [] })
+                            }
+                            if (checked && !formRef.current?.getFieldValue('showProduct')) {
+                              formRef.current?.setFieldsValue({ showProduct: true })
                             }
-                          ]}
-                        />
-                      )}
-                    </ProFormDependency>
-                    <ProFormSwitch
-                      fieldProps={{
-                        onChange(checked) {
-                          if (!checked) {
-                            formRef.current?.setFieldsValue({ bisiness: [] })
                           }
-                        }
-                      }}
-                      name="showBusiness"
-                      label={
-                        <span className="flex items-center">
-                          <EveryUser className="mr-1" className="flex items-baseline mr-1" />
-                          商机
-                        </span>
-                      }
-                    />
-                    <ProFormDependency name={['showBusiness']}>
-                      {({ showBusiness }) => (
-                        <ProFormCheckbox.Group
-                          wrapperCol={{ offset: 1 }}
-                          name="business"
-                          options={[
-                            { value: 'access', label: '查看', disabled: !showBusiness },
-                            { value: 'add', label: '添加商机', disabled: !showBusiness }
-                            // { value: 'delete', label: '删除商机', disabled: !showBusiness }
-                          ]}
-                        />
-                      )}
-                    </ProFormDependency> */}
+                        }}
+                        name="showInvoiceAggregate"
+                        label="发票收款入账汇总"
+                      />
+                      <ProFormDependency name={['showInvoiceAggregate']}>
+                        {({ showInvoiceAggregate }) => (
+                          <ProFormCheckbox.Group
+                            wrapperCol={{ offset: 2 }}
+                            name="invoice-aggregate"
+                            options={[
+                              { value: 'access', label: '查看', disabled: !showInvoiceAggregate }
+                            ]}
+                          />
+                        )}
+                      </ProFormDependency>
+                      <ProFormSwitch
+                        fieldProps={{
+                          onChange(checked) {
+                            if (!checked) {
+                              formRef.current?.setFieldsValue({ 'invoice-trends': [] })
+                            }
+                            if (checked && !formRef.current?.getFieldValue('showProduct')) {
+                              formRef.current?.setFieldsValue({ showProduct: true })
+                            }
+                          }
+                        }}
+                        name="showInvoiceTrends"
+                        label="发票收款入账趋势"
+                      />
+                      <ProFormDependency name={['showInvoiceTrends']}>
+                        {({ showInvoiceTrends }) => (
+                          <ProFormCheckbox.Group
+                            wrapperCol={{ offset: 2 }}
+                            name="invoice-trends"
+                            options={[
+                              { value: 'access', label: '查看', disabled: !showInvoiceTrends }
+                            ]}
+                          />
+                        )}
+                      </ProFormDependency>
+                    </div>
                   </ProForm>
                 )}
               </div>