|
@@ -1,19 +1,31 @@
|
|
-import React, { useCallback, useEffect, useMemo, useState } from 'react'
|
|
|
|
|
|
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
|
import styles from './index.module.scss'
|
|
import styles from './index.module.scss'
|
|
import { useDispatch, useSelector } from 'react-redux'
|
|
import { useDispatch, useSelector } from 'react-redux'
|
|
import { A6_APIdel, A6_APIgetList } from '@/store/action/A6record'
|
|
import { A6_APIdel, A6_APIgetList } from '@/store/action/A6record'
|
|
import { RootState } from '@/store'
|
|
import { RootState } from '@/store'
|
|
import { MessageFu } from '@/utils/message'
|
|
import { MessageFu } from '@/utils/message'
|
|
-import { A6tableType } from './type'
|
|
|
|
-import { Button } from 'antd'
|
|
|
|
|
|
+import { A6FromDataType, A6tableType } from './type'
|
|
|
|
+import { Button, DatePicker, Input } from 'antd'
|
|
import MyPopconfirm from '@/components/MyPopconfirm'
|
|
import MyPopconfirm from '@/components/MyPopconfirm'
|
|
import MyTable from '@/components/MyTable'
|
|
import MyTable from '@/components/MyTable'
|
|
import { A6tableC } from '@/utils/tableData'
|
|
import { A6tableC } from '@/utils/tableData'
|
|
import A6auth from './A6auth'
|
|
import A6auth from './A6auth'
|
|
|
|
+import LocStat from './LocStat'
|
|
|
|
+
|
|
|
|
+const { RangePicker } = DatePicker
|
|
|
|
+
|
|
|
|
+const fromDataBase: A6FromDataType = {
|
|
|
|
+ searchKey: '',
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ startTime: '',
|
|
|
|
+ endTime: ''
|
|
|
|
+}
|
|
|
|
+
|
|
function A6record() {
|
|
function A6record() {
|
|
const dispatch = useDispatch()
|
|
const dispatch = useDispatch()
|
|
|
|
|
|
- const [fromData, setFromData] = useState({ pageNum: 1, pageSize: 10 })
|
|
|
|
|
|
+ const [fromData, setFromData] = useState(fromDataBase)
|
|
|
|
|
|
const getListFu = useCallback(() => {
|
|
const getListFu = useCallback(() => {
|
|
dispatch(A6_APIgetList(fromData))
|
|
dispatch(A6_APIgetList(fromData))
|
|
@@ -64,18 +76,83 @@ function A6record() {
|
|
]
|
|
]
|
|
}, [delTableFu])
|
|
}, [delTableFu])
|
|
|
|
|
|
|
|
+ const [inputKey, setInputKey] = useState(1)
|
|
|
|
+
|
|
|
|
+ // 输入框的输入
|
|
|
|
+ const timeRef = useRef(-1)
|
|
|
|
+ const txtChangeFu = useCallback(
|
|
|
|
+ (e: React.ChangeEvent<HTMLInputElement>, key: 'searchKey') => {
|
|
|
|
+ clearTimeout(timeRef.current)
|
|
|
|
+ timeRef.current = window.setTimeout(() => {
|
|
|
|
+ setFromData({
|
|
|
|
+ ...fromData,
|
|
|
|
+ [key]: e.target.value.replaceAll("'", ''),
|
|
|
|
+ pageNum: 1
|
|
|
|
+ })
|
|
|
|
+ }, 500)
|
|
|
|
+ },
|
|
|
|
+ [fromData]
|
|
|
|
+ )
|
|
|
|
+
|
|
|
|
+ // 点击重置
|
|
|
|
+ const resetSelectFu = useCallback(() => {
|
|
|
|
+ setInputKey(Date.now())
|
|
|
|
+ setFromData(fromDataBase)
|
|
|
|
+ }, [])
|
|
|
|
+
|
|
|
|
+ // 时间选择器改变
|
|
|
|
+ const timeChange = useCallback(
|
|
|
|
+ (date: any, dateString: any) => {
|
|
|
|
+ let startTime = ''
|
|
|
|
+ let endTime = ''
|
|
|
|
+ if (dateString[0] && dateString[1]) {
|
|
|
|
+ startTime = dateString[0] + ' 00:00:00'
|
|
|
|
+ endTime = dateString[1] + ' 23:59:59'
|
|
|
|
+ }
|
|
|
|
+ setFromData({ ...fromData, startTime, endTime, pageNum: 1 })
|
|
|
|
+ },
|
|
|
|
+ [fromData]
|
|
|
|
+ )
|
|
|
|
+
|
|
// 点击审核
|
|
// 点击审核
|
|
const [authId, setAuthId] = useState({
|
|
const [authId, setAuthId] = useState({
|
|
id: 0,
|
|
id: 0,
|
|
status: 0
|
|
status: 0
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+ // 点击地区统计
|
|
|
|
+ const [locShow, setLocShow] = useState(false)
|
|
|
|
+
|
|
return (
|
|
return (
|
|
<div className={styles.A6record}>
|
|
<div className={styles.A6record}>
|
|
<div className='pageTitle'>课程预约记录</div>
|
|
<div className='pageTitle'>课程预约记录</div>
|
|
|
|
|
|
|
|
+ <div className='A6top'>
|
|
|
|
+ <div className='A6top1'>
|
|
|
|
+ <div className='A6topRow'>
|
|
|
|
+ <span>搜索:</span>
|
|
|
|
+ <Input
|
|
|
|
+ key={inputKey}
|
|
|
|
+ maxLength={50}
|
|
|
|
+ style={{ width: 200 }}
|
|
|
|
+ placeholder='请输入姓名/联系电话'
|
|
|
|
+ allowClear
|
|
|
|
+ onChange={e => txtChangeFu(e, 'searchKey')}
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ <div className='A6topRow'>
|
|
|
|
+ <span>预约日期:</span>
|
|
|
|
+ <RangePicker key={inputKey} onChange={timeChange} />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div className='A6top1'>
|
|
|
|
+ <Button onClick={() => setLocShow(true)}>地区统计</Button> 
|
|
|
|
+ <Button onClick={resetSelectFu}>重置</Button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
<MyTable
|
|
<MyTable
|
|
- yHeight={680}
|
|
|
|
|
|
+ yHeight={604}
|
|
list={tableInfo.list}
|
|
list={tableInfo.list}
|
|
columnsTemp={A6tableC}
|
|
columnsTemp={A6tableC}
|
|
lastBtn={tableLastBtn}
|
|
lastBtn={tableLastBtn}
|
|
@@ -94,6 +171,11 @@ function A6record() {
|
|
editTableFu={getListFu}
|
|
editTableFu={getListFu}
|
|
/>
|
|
/>
|
|
) : null}
|
|
) : null}
|
|
|
|
+
|
|
|
|
+ {/* 点击地区统计 */}
|
|
|
|
+ {locShow ? (
|
|
|
|
+ <LocStat type='课程' apiObj={fromData} closeFu={() => setLocShow(false)} />
|
|
|
|
+ ) : null}
|
|
</div>
|
|
</div>
|
|
)
|
|
)
|
|
}
|
|
}
|