|
@@ -19,8 +19,10 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
|
19
|
19
|
*/
|
20
|
20
|
const Edit = (props) => {
|
21
|
21
|
const [ data, setData ] = useState([])
|
|
22
|
+ const [ buildingIdValue, setBuildingIdData ] = useState('')
|
22
|
23
|
|
23
|
24
|
const changBuilding = (buildingId) => {
|
|
25
|
+ setBuildingIdData(buildingId)
|
24
|
26
|
request({
|
25
|
27
|
url: '/api/admin/tdBizEventIntention',
|
26
|
28
|
method: 'GET',
|
|
@@ -31,6 +33,32 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
|
31
|
33
|
})
|
32
|
34
|
}
|
33
|
35
|
|
|
36
|
+ const changeBox = (x) => (e) => {
|
|
37
|
+ setData(data.map((item) => {
|
|
38
|
+ return x.eventId === item.eventId ? {...item, checkbox: e.target.checked} : item
|
|
39
|
+ }))
|
|
40
|
+ }
|
|
41
|
+
|
|
42
|
+ const changeInput = (x) => (e) => {
|
|
43
|
+ setData(data.map((item) => {
|
|
44
|
+ return x.eventId === item.eventId ? {...item, intention: e.target.value} : item
|
|
45
|
+ }))
|
|
46
|
+ }
|
|
47
|
+
|
|
48
|
+ const submitValue = () => {
|
|
49
|
+ console.log(buildingIdValue)
|
|
50
|
+ if(buildingIdValue === ''){
|
|
51
|
+ return
|
|
52
|
+ }
|
|
53
|
+ request({
|
|
54
|
+ url: '/api/admin/taBuildingIntentionAddOrUpdate/' + buildingIdValue,
|
|
55
|
+ method: 'POST',
|
|
56
|
+ data
|
|
57
|
+ }).then((data) => {
|
|
58
|
+ message.info("保存成功")
|
|
59
|
+ })
|
|
60
|
+ }
|
|
61
|
+
|
34
|
62
|
return (
|
35
|
63
|
<>
|
36
|
64
|
<Row>
|
|
@@ -39,26 +67,25 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
|
39
|
67
|
</Col>
|
40
|
68
|
</Row>
|
41
|
69
|
<Row>
|
42
|
|
- <Col span={6} offset={6}>
|
|
70
|
+ <Col span={3} offset={3}>
|
43
|
71
|
用户操作
|
44
|
72
|
</Col>
|
45
|
|
- <Col span={6} offset={6}>
|
|
73
|
+ <Col span={3} offset={3}>
|
46
|
74
|
意向值
|
47
|
75
|
</Col>
|
48
|
76
|
</Row>
|
49
|
77
|
{data.map((x) => {
|
50
|
|
- console.log(x)
|
51
|
78
|
return <Row>
|
52
|
|
- <Col span={6} offset={6}>
|
53
|
|
- {x.eventName}
|
|
79
|
+ <Col span={3} offset={3}>
|
|
80
|
+ <Checkbox checked={x.checkbox} onChange={changeBox(x)}>{x.eventName}</Checkbox>
|
54
|
81
|
</Col>
|
55
|
|
- <Col span={6} offset={6}>
|
56
|
|
- {x.intention}
|
|
82
|
+ <Col span={3} offset={3}>
|
|
83
|
+ <Input value={x.intention} onChange={changeInput(x)}/>
|
57
|
84
|
</Col>
|
58
|
85
|
</Row>
|
59
|
86
|
})}
|
60
|
87
|
<Row>
|
61
|
|
- <Button type="primary" className={styles.searchBtn} >确定</Button>
|
|
88
|
+ <Button type="primary" className={styles.searchBtn} onClick={submitValue}>确定</Button>
|
62
|
89
|
</Row>
|
63
|
90
|
</>
|
64
|
91
|
);
|