outaozhen пре 4 година
родитељ
комит
3133dbd46f

+ 5 - 0
config/routes.js

@@ -210,6 +210,11 @@ export default [
             component: './Statistic/Product/InvoiceTrends',
             access: 'authRouteFilter',
             validatePerm: true
+          },
+          {
+            path: 'customer-additions',
+            name: 'customer-additions',
+            component: './Statistic/Product/CustomerAdditions'
           }
         ]
       }

+ 2 - 1
src/locales/zh-CN/menu.js

@@ -41,5 +41,6 @@ export default {
   'menu.statistic.product': '产品销售',
   'menu.statistic.product.software-usage': '软件锁用量',
   'menu.statistic.product.invoice-aggregate': '发票收款入账汇总',
-  'menu.statistic.product.invoice-trends': '发票收款入账趋势'
+  'menu.statistic.product.invoice-trends': '发票收款入账趋势',
+  'menu.statistic.product.customer-additions': '客户新增'
 }

+ 31 - 0
src/pages/Statistic/Product/CustomerAdditions/index.jsx

@@ -0,0 +1,31 @@
+import React, { useState } from 'react'
+import { DatePicker, TimePicker, Select, Space } from 'antd'
+import dayjs from 'dayjs'
+import { dayjsFormat } from '@/utils/utils'
+
+const { Option } = Select
+
+function PickerWithType({ type, onChange }) {
+  if (type === 'time') return <TimePicker onChange={onChange} />
+  if (type === 'date') return <DatePicker onChange={onChange} />
+  return <DatePicker picker={type} onChange={onChange} />
+}
+
+const CustomerAdditions = () => {
+  const [type, setType] = useState('time')
+  return (
+    <Space>
+      <Select value={type} onChange={setType}>
+        <Option value="time">Time</Option>
+        <Option value="date">Date</Option>
+        <Option value="week">Week</Option>
+        <Option value="month">Month</Option>
+        <Option value="quarter">Quarter</Option>
+        <Option value="year">Year</Option>
+      </Select>
+      <PickerWithType type={type} onChange={value => console.log(dayjsFormat(value))} />
+    </Space>
+  )
+}
+
+export default CustomerAdditions