|
@@ -34,12 +34,12 @@ export default (props) => {
|
34
|
34
|
const [showCutover, setShowCutover] = useState(false)
|
35
|
35
|
const [valueList, setValueList] = useState([])
|
36
|
36
|
|
|
37
|
+ const [traveCoumun, setTraveCoumun] = useState()
|
37
|
38
|
|
38
|
39
|
useEffect(() => {
|
39
|
|
- if (item == []) {
|
40
|
|
- }
|
41
|
|
- setValueList(travelMine?.records)
|
42
|
40
|
|
|
41
|
+ setValueList(travelMine?.records)
|
|
42
|
+ setTraveCoumun(travelMine?.records[0].dayNum)
|
43
|
43
|
|
44
|
44
|
}, [travelMine?.records, item])
|
45
|
45
|
|
|
@@ -51,7 +51,6 @@ export default (props) => {
|
51
|
51
|
}
|
52
|
52
|
|
53
|
53
|
//列改变
|
54
|
|
- const [traveCoumun, setTraveCoumun] = useState()
|
55
|
54
|
|
56
|
55
|
|
57
|
56
|
const numberTrave = (new Array(traveCoumun).fill()).map((_, index) => ({ id: index + 1, title: `第 ${index + 1} 天` }))
|
|
@@ -62,12 +61,16 @@ export default (props) => {
|
62
|
61
|
const handleColumn = e => {
|
63
|
62
|
console.log("🚀 ~ file: index.jsx ~ line 63 ~ e", e)
|
64
|
63
|
// console.log(e.detail.column);
|
65
|
|
-
|
66
|
64
|
const { column, value } = e.detail
|
67
|
65
|
|
|
66
|
+ if (column == 0) {
|
|
67
|
+
|
|
68
|
+ const firstValue = valueList[value] || ''
|
|
69
|
+ setTraveCoumun(firstValue.dayNum)
|
|
70
|
+
|
|
71
|
+ }
|
|
72
|
+
|
68
|
73
|
|
69
|
|
- const firstValue = valueList[value]
|
70
|
|
- setTraveCoumun(firstValue.dayNum)
|
71
|
74
|
|
72
|
75
|
}
|
73
|
76
|
|
|
@@ -77,7 +80,8 @@ export default (props) => {
|
77
|
80
|
const m = day.getMonth() + 1;
|
78
|
81
|
const d = day.getDate();
|
79
|
82
|
let number = 0
|
80
|
|
- const onChange = (e) => {
|
|
83
|
+
|
|
84
|
+ const hanleChange = (e) => {
|
81
|
85
|
console.log("🚀 ~ file: index.jsx ~ line 63 ~ e", e)
|
82
|
86
|
|
83
|
87
|
if (travelMine?.records == '') {
|
|
@@ -168,7 +172,7 @@ export default (props) => {
|
168
|
172
|
range={array}
|
169
|
173
|
range-key='title'
|
170
|
174
|
onColumnChange={handleColumn}
|
171
|
|
- onChange={onChange}
|
|
175
|
+ onChange={hanleChange}
|
172
|
176
|
scrollType='link'
|
173
|
177
|
// value={}
|
174
|
178
|
>
|