outaozhen %!s(int64=4) %!d(string=hai) anos
pai
achega
6afe7161d8

+ 5 - 4
src/pages/Statistic/Product/CustomerAdditions/index.jsx

@@ -7,6 +7,8 @@ import { dayjsFormat } from '@/utils/utils'
 import OptionSelect from '../../components/OptionSelect'
 import OptionSelect from '../../components/OptionSelect'
 import { queryCustomerAdditionList } from '@/services/statistic'
 import { queryCustomerAdditionList } from '@/services/statistic'
 
 
+const { Option } = Select
+const { RangePicker } = DatePicker
 const CustomerAdditions = () => {
 const CustomerAdditions = () => {
   const [state, setState] = useState({
   const [state, setState] = useState({
     params: {
     params: {
@@ -17,11 +19,10 @@ const CustomerAdditions = () => {
     },
     },
     list: []
     list: []
   })
   })
-  const { Option } = Select
-  const { RangePicker } = DatePicker
+
   const [type, setType] = useState('month')
   const [type, setType] = useState('month')
   const tRef = useRef(null)
   const tRef = useRef(null)
-  const optionChange = (type, ids) =>
+  const handleOptionChange = (type, ids) =>
     setState({ ...state, params: { ...state.params, optionType: type, dataIds: ids } })
     setState({ ...state, params: { ...state.params, optionType: type, dataIds: ids } })
   const columns = [
   const columns = [
     {
     {
@@ -60,7 +61,7 @@ const CustomerAdditions = () => {
         pagination={false}
         pagination={false}
         bordered
         bordered
         toolbar={{
         toolbar={{
-          title: [<OptionSelect onChange={optionChange} type="CustomerAdditions" key="op" multiple={false} />],
+          title: [<OptionSelect onChange={handleOptionChange} type="CustomerAdditions" key="op" multiple={false} />],
           actions: [
           actions: [
             <Space key="id">
             <Space key="id">
               <Select value={type} onChange={setType}>
               <Select value={type} onChange={setType}>

+ 2 - 2
src/pages/Statistic/Product/InvoiceAggregate/index.jsx

@@ -49,7 +49,7 @@ const InvoiceAggregate = () => {
     }
     }
   ]
   ]
 
 
-  const optionChange = (type, ids) =>
+  const handleOptionChange = (type, ids) =>
     setState({ ...state, params: { ...state.params, optionType: type, dataIds: ids } })
     setState({ ...state, params: { ...state.params, optionType: type, dataIds: ids } })
 
 
   const columnConfig = {
   const columnConfig = {
@@ -98,7 +98,7 @@ const InvoiceAggregate = () => {
         actionRef={tRef}
         actionRef={tRef}
         rowkey="id"
         rowkey="id"
         toolbar={{
         toolbar={{
-          title: <OptionSelect onChange={optionChange} type="InvoiceAggregate" />,
+          title: <OptionSelect onChange={handleOptionChange} type="InvoiceAggregate" />,
           actions: [
           actions: [
             <DatePicker.RangePicker
             <DatePicker.RangePicker
               allowClear={false}
               allowClear={false}

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

@@ -117,7 +117,7 @@ const InvoiceTrends = () => {
     }
     }
   ]
   ]
 
 
-  const optionChange = (type, ids) =>
+  const handleOptionChange = (type, ids) =>
     setState({ ...state, params: { ...state.params, optionType: type, dataIds: ids } })
     setState({ ...state, params: { ...state.params, optionType: type, dataIds: ids } })
 
 
   const dualAxesOptions = {
   const dualAxesOptions = {
@@ -197,7 +197,7 @@ const InvoiceTrends = () => {
         rowkey="id"
         rowkey="id"
         toolbar={{
         toolbar={{
           title: [
           title: [
-            <OptionSelect onChange={optionChange} type="InvoiceTrends" key="op" multiple={false} />,
+            <OptionSelect onChange={handleOptionChange} type="InvoiceTrends" key="op" multiple={false} />,
             <div className="ml-2" key="pp">
             <div className="ml-2" key="pp">
               <Select
               <Select
                 defaultValue="invoice"
                 defaultValue="invoice"

+ 1 - 1
src/pages/Statistic/components/OptionSelect.tsx

@@ -46,7 +46,7 @@ const OptionSelect: React.FC<OptionSelectProps> = ({ multiple = true, type, onCh
 
 
   const [state, setState] = useState({
   const [state, setState] = useState({
     optionType: optionType || (multiple ? statisticOptionMap.STAFF : statisticOptionMap.SINGLE_STAFF),
     optionType: optionType || (multiple ? statisticOptionMap.STAFF : statisticOptionMap.SINGLE_STAFF),
-    dataIds: dataIds || [],
+    dataIds,
     department: [],
     department: [],
     staff: []
     staff: []
   })
   })