|
@@ -1,4 +1,4 @@
|
|
|
-import React, { useCallback, useEffect, useRef, useState } from 'react'
|
|
|
+import React, { useCallback, useEffect, useState } from 'react'
|
|
|
import styles from './index.module.scss'
|
|
|
import { Button, DatePicker, Modal } from 'antd'
|
|
|
import MyPopconfirm from '@/components/MyPopconfirm'
|
|
@@ -17,7 +17,7 @@ function A2NoTime({ baseTime, closeFu, editFu, num }: Props) {
|
|
|
|
|
|
useEffect(() => {
|
|
|
if (baseTime && baseTime !== '空') {
|
|
|
- let txt = baseTime.replaceAll('月', '-').replaceAll('日', '')
|
|
|
+ let txt = baseTime.replaceAll('年', '-').replaceAll('月', '-').replaceAll('日', '')
|
|
|
setValue(txt.split(','))
|
|
|
}
|
|
|
}, [baseTime])
|
|
@@ -30,15 +30,19 @@ function A2NoTime({ baseTime, closeFu, editFu, num }: Props) {
|
|
|
arr = arr.filter((c, i) => i < num)
|
|
|
MessageFu.warning(`最多${num}个日期,已过滤超出日期`)
|
|
|
}
|
|
|
- setValue(arr.map(v => v.replaceAll('月', '-').replaceAll('日', '')))
|
|
|
+ setValue(
|
|
|
+ arr.map(v => v.replaceAll('年', '-').replaceAll('月', '-').replaceAll('日', ''))
|
|
|
+ )
|
|
|
} else setValue(null)
|
|
|
},
|
|
|
[num]
|
|
|
)
|
|
|
|
|
|
- const disabledDate = useCallback((time: any) => {
|
|
|
- return dayjs().year() !== time.year()
|
|
|
- }, [])
|
|
|
+ // const disabledDate = useCallback((time: any) => {
|
|
|
+ // return dayjs().year() !== time.year()
|
|
|
+ // }, [])
|
|
|
+
|
|
|
+ // const [checkTime, setCheckTime] = useState(dayjs())
|
|
|
|
|
|
return (
|
|
|
<Modal
|
|
@@ -54,12 +58,17 @@ function A2NoTime({ baseTime, closeFu, editFu, num }: Props) {
|
|
|
multiple
|
|
|
onChange={onChange}
|
|
|
maxTagCount='responsive'
|
|
|
- value={value ? value.map(v => dayjs(`${dayjs().year()}-${v}`)) : []}
|
|
|
+ value={value ? value.map(v => dayjs(v)) : []}
|
|
|
size='large'
|
|
|
- allowClear={false}
|
|
|
- format='MM月DD日'
|
|
|
- disabledDate={disabledDate}
|
|
|
+ // allowClear={false}
|
|
|
+ format='YYYY年MM月DD日'
|
|
|
+ // disabledDate={disabledDate}
|
|
|
// needConfirm={true}
|
|
|
+ // pickerValue={checkTime}
|
|
|
+ // onPanelChange={a => {
|
|
|
+ // // 只能选择今年的月份
|
|
|
+ // if (dayjs(a).year() === dayjs().year()) setCheckTime(a)
|
|
|
+ // }}
|
|
|
/>
|
|
|
|
|
|
<div className='A2Nbtn'>
|